1 2013-07-01 Cary Coutant <ccoutant@google.com>
3 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
5 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
6 (Dwarf_ranges_table::lookup_reloc): New function.
7 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
9 (Dwarf_ranges_table::lookup_reloc): New function.
10 (Dwarf_ranges_table::reloc_type_): New data member.
12 2013-06-27 Jing Yu <jingyu@google.com>
15 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
17 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
18 (Target_powerpc::do_relax): Call the above.
20 2013-06-27 Cary Coutant <ccoutant@google.com>
22 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
23 on garbage collected .opd section.
25 2013-06-27 Alan Modra <amodra@gmail.com>
27 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
29 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
30 (Target_powerpc::do_function_location): Likewise for loc->shndx.
32 2013-06-14 Cary Coutant <ccoutant@google.com>
34 * resolve.cc (Symbol::override_base): Don't override st_type
35 from plugin placeholder symbols.
36 (Symbol_table::resolve): Likewise.
37 (Symbol_table::should_override): Don't complain about TLS mismatch
38 if the TO symbol is a plugin placeholder.
39 * testsuite/Makefile.am (plugin_test_tls): New test.
40 * testsuite/Makefile.in: Regenerate.
41 * testsuite/plugin_test_tls.sh: New test script.
42 * testsuite/two_file_test_2_tls.cc: New test source.
43 * testsuite/two_file_test_tls.cc: New test source.
45 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
47 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
48 the maximum segment alignment is larger than the page size.
49 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
50 correctly aligns the symbols with large alignemnt.
51 * testsuite/Makefile.in: Regenerate.
52 * testsuite/large_symbol_alignment.cc: New file.
54 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
55 Sriraman Tallam <tmsriram@google.com>
57 * options.h (sort_section): New option.
58 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
59 Rename from Input_section_sort_section_name_special_ordering_compare.
60 (Input_section_sort_section_name_compare): New struct.
61 * output.cc (Output_section::Input_section_sort_section_name_compare::
62 operator()): New function.
63 (Output_section::sort_attached_input_sections): Use new sort function
64 for .text if --sort-section=name is specified.
65 * layout.cc (Layout::make_output_section):
66 Add sorting by name when --sort-section=name is specified.
67 * testsuite/Makefile.am (text_section_grouping): Test option
69 * testsuite/Makefile.in: Regenerate.
70 * testsuite/section_sorting_name.cc: New file.
71 * testsuite/section_sorting_name.sh: New file.
73 2013-05-21 Cary Coutant <ccoutant@google.com>
75 * symtab.h (Symbol::is_cxx_vtable): New function.
76 * target-reloc.h (relocate_section): Check for vtable symbol.
77 * testsuite/Makefile.am (missing_key_func.sh): New test case.
78 * testsuite/Makefile.in: Regenerate.
79 * testsuite/missing_key_func.cc: New test source.
80 * testsuite/missing_key_func.sh: New test script.
82 2013-05-21 Cary Coutant <ccoutant@google.com>
84 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
85 type of enclosing symbol.
86 (Relocate_info::location): Check symbol type when describing symbol.
87 * object.h (Symbol_location_info): Remove unused line_number;
88 add enclosing_symbol_type.
89 * testsuite/debug_msg.sh: Adjust expected output.
91 2013-05-13 Cary Coutant <ccoutant@google.com>
93 * configure.ac: Export DEFAULT_TARGET.
94 * configure: Regenerate.
95 * Makefile.in: Regenerate.
96 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
97 * testsuite/Makefile.in: Regenerate.
98 * testsuite/debug_msg.sh: Delete duplicate tests.
99 Don't check undef_int error message match for powerpc where the
100 source file and line number aren't available.
102 2013-05-10 Roland McGrath <mcgrathr@google.com>
104 * options.h (General_options): Add --rosegment-gap option.
105 * options.cc (finalize): --rosegment-gap implies --rosegment.
106 * layout.cc (set_segment_offsets): Let user option override
107 target->rosegment_gap().
109 2013-05-10 Roland McGrath <mcgrathr@google.com>
111 * options.h (General_options): Remove leading space from help
112 messages for -nostdlib and --rosegment.
114 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
117 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
119 2013-05-03 Alan Modra <amodra@gmail.com>
121 * merge.cc (Output_merge_string::do_add_input_section): Correct
122 scan for number of strings. Rename vars to avoid shadowing.
123 Include missing terminator in input_size_.
125 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
127 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
128 Restore empty string handling.
130 2013-05-01 Cary Coutant <ccoutant@google.com>
132 * stringpool.cc (Stringpool_template::new_key_offset): Fix
133 uninitialized warning.
135 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
137 * output.cc (Output_section::add_merge_input_section): Allow
138 to merge sections if the alignment is more than character size.
139 * merge.h (Output_merge_string::Output_merge_string): Remove
141 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
142 only not-null strings. Check the alignment of strings.
144 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
145 alignment as the argument.
146 (Stringpool_template<Stringpool_char>::addralign_): New class member.
147 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
148 Align non-zero length strings according to the addralign_.
149 (Stringpool_template<Stringpool_char>::set_string_offsets):
150 Updating offsets according to the given alignment.
151 * testsuite/Makefile.am (text_section_grouping): Test if string
152 literals are getting merged.
153 * testsuite/Makefile.in: Regenerate.
154 * testsuite/merge_string_literals_1.c: New file.
155 * testsuite/merge_string_literals_2.c: Ditto.
156 * testsuite/merge_string_literals.sh: Ditto.
158 2013-04-26 Ian Lance Taylor <iant@google.com>
160 * target-reloc.h (relocate_section): If the reloc offset is out of
161 range, pass VIEW as NULL to relocate.relocate.
162 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
163 * i386.cc (Target_i386::Relocate::relocate): Likewise.
164 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
165 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
166 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
167 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
169 2013-04-26 Geoff Pike <gpike@chromium.org>
171 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
172 * layout.cc (Hash_task): New class.
173 (Layout::queue_build_id_tasks): New function.
174 (Layout::write_build_id): Handle single-thread portion of build ID
175 computation. (In some cases, all of it is single-threaded.) Replace
176 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
177 functionality in fewer lines of code.
178 * layout.h (Layout::queue_build_id_tasks): New function declaration.
179 * options.h (General_options): make "--build-id" default to tree
180 rather than sha1. Add two new options related to --build-id=tree:
181 --build-id-chunk-size-for-treehash and
182 --build-id-min-file-size-for-treehash.
183 * Makefile.am: add testing of --build-id=tree and related new options
184 (these tests will be invoked by "make check").
185 * Makefile.in: Regenerate.
187 2013-04-25 Alan Modra <amodra@gmail.com>
189 * configure.tgt: Add powerpcle and powerpc64le.
191 2013-04-22 Alan Modra <amodra@gmail.com>
194 * layout.cc (Layout::segment_precedes): Allow more than one
195 segment with the same type and flags.
197 2013-04-15 Cary Coutant <ccoutant@google.com>
199 * layout.cc (Layout::set_relocatable_section_offsets): Don't
200 allocate space in file for BSS sections.
202 2013-04-15 Cary Coutant <ccoutant@google.com>
204 * script-sections.cc (Orphan_output_section): Reset address
205 to zero after each orphaned section for relocatable links.
207 2013-04-15 Cary Coutant <ccoutant@google.com>
209 * symtab.cc (Symbol_table::sized_write_globals): Subtract
210 section starting address for relocatable link.
211 * testsuite/Makefile.am (script_test_11): New test.
212 * testsuite/Makefile.in: Regenerate.
213 * testsuite/script_test_11.c: New source file.
214 * testsuite/script_test_11.t: New linker script.
216 2013-04-13 Alan Modra <amodra@gmail.com>
218 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
219 owner when sections are not adjacent and exceed group size.
220 (Target_powerpc::group_sections): Handle corner case.
221 (Target_powerpc::Branch_info::make_stub): Handle case where
222 stub table doesn't exist due to branches in non-exec sections.
223 (Target_powerpc::Relocate::relocate): Likewise.
225 2013-04-11 Alan Modra <amodra@gmail.com>
228 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
229 .branch_lt to match bfd ld. Adjust comments throughout file.
231 2013-04-04 Ian Lance Taylor <iant@google.com>
234 * object.cc (do_layout_deferred_sections): Handle .eh_frame
235 sections before checking whether they are included in the link.
237 2013-03-29 Sriraman Tallam <tmsriram@google.com>
239 * archive.cc (Archive::get_elf_object_for_member): Create the elf
240 object before calling the plugin claim_file handler. Pass the elf
241 object of the archive to the plugin. Delete the elf object if the
242 plugin claims the file.
244 2013-03-21 Alan Modra <amodra@gmail.com>
246 * layout.cc (Layout::set_segment_offsets): Accept writable .text
249 2013-03-21 Alan Modra <amodra@gmail.com>
251 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
253 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
254 uninitialized" warning.
256 2013-03-20 Alan Modra <amodra@gmail.com>
258 * symtab.h (Symbol::clear_version): New function.
259 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
260 is_needed by weak references. Clear version for symbols defined
261 in as-needed objects that are not needed.
263 2013-03-15 Alan Modra <amodra@gmail.com>
265 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
266 static and public. Add report_err param. Return false for data refs.
267 (Target_powerpc::rela_dyn_section): New overloaded function.
268 (Target_powerpc::plt_, iplt_): Elucidate.
269 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
270 (Output_data_plt_powerpc::do_write): Don't write .iplt.
271 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
272 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
273 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
274 push_branch and make_plt_entry for ifunc syms when
275 reloc_needs_plt_for_ifunc.
276 (Target_powerpc::Relocate::relocate): Don't use plt entry value
277 for ifunc unless reloc_needs_plt_for_ifunc.
279 2013-03-15 Alan Modra <amodra@gmail.com>
281 * gc.h (gc_process_relocs): Don't look through function descriptors.
282 * icf.cc (get_section_contents): Do so here instead.
284 2013-03-13 Alan Modra <amodra@gmail.com>
286 * powerpc.cc (is_branch_reloc): Forward declare.
287 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
288 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
289 false for 64-bit, true for 32-bit non-branch relocs.
290 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
291 * testsuite/Makefile.am (icf_test): Use linker map file instead of
293 (icf_safe_test): Generate linker map file as well as nm output.
294 (icf_safe_so_test): Likewise.
295 * testsuite/Makefile.in: Regenerate.
296 * testsuite/icf_test.sh: Parse linker map file to determine
298 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
299 * testsuite/icf_safe_so_test.sh: Likewise.
300 (X86_32_or_ARM_specific_safe_fold): Merge into..
301 (arch_specific_safe_fold): ..this.
302 (X86_64_specific_safe_fold): Delete unused function.
304 2013-03-12 Alan Modra <amodra@gmail.com>
306 * gc.h (gc_process_relocs): Look through function descriptors
307 to determine shndx, symvalue and addend used by ICF. Tidy
308 variable duplication.
310 2013-03-11 Alan Modra <amodra@gmail.com>
312 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
313 * layout.cc (Layout_task_runner::run): ..to here.
314 * symtab.h (struct Symbol_location): Extract from..
315 (class Symbol_table): ..here.
316 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
317 * target.h (class Target): Add function_location and
318 do_function_location functions.
319 (class Sized_target): Add do_function_location.
320 * object.h (class Sized_relobj_file): Move find_shdr..
321 (class Object): ..to here.
322 * object.cc: Likewise. Update to suit. Instantiate.
323 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
324 * powerpc.cc (class Powerpc_dynobj): New.
325 (Target_powerpc::do_function_location): New function.
326 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
327 (Powerpc_dynobj::do_read_symbols): New function.
328 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
330 2013-03-08 Ian Lance Taylor <iant@google.com>
332 * options.cc (General_options::string_to_object_format): Accept
335 2013-03-08 Alan Modra <amodra@gmail.com>
337 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
339 (struct Post_fde): Move definition to here..
340 * ehframe.cc (struct Post_fde): ..from here.
341 (Cie::write): Don't alloc Post_fde.
342 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
344 2013-03-07 Alan Modra <amodra@gmail.com>
346 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
347 relocation referencing .LC0.
348 * testsuite/discard_locals_test.sh: Remove FIXMEs.
350 2013-03-07 Alan Modra <amodra@gmail.com>
352 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
353 always_inline. Add assembly for powerpc to avoid GOT.
355 2013-03-07 Alan Modra <amodra@gmail.com>
357 * testsuite/script_test_10.sh: Don't test .bss section
360 2013-03-06 Alan Modra <amodra@gmail.com>
362 * powerpc.cc (class Powerpc_relobj): Move some member functions.
363 (Target_powerpc::symval_for_branch): Add symtab param. Update
364 all callers. Handle folded sections.
365 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
367 (Global_symbol_visitor_opd::operator()): Likewise.
369 2013-03-04 Alan Modra <amodra@gmail.com>
371 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
372 * testsuite/Makefile.in: Regenerate.
374 2013-03-01 Cary Coutant <ccoutant@google.com>
376 Add dwp support for v2 DWARF package file format.
377 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
378 tu_length parameter. Adjust all callers.
379 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
380 * dwp.cc: Include dwarf.h.
381 (Section_bounds): New struct type.
382 (Unit_set): New struct type.
383 (Dwo_file::Dwo_file): Initialize new data member.
384 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
385 Combine and rename to...
386 (Dwo_file::read_unit_index): ...this.
387 (Dwo_file::sized_read_compunit_index)
388 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
389 (Dwo_file::sized_read_unit_index): ...this.
390 (Dwo_file::copy_section): Remove section_name, is_str_offsets
391 parameters; add section_id parameter.
392 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
393 (Dwo_file::add_unit_set): ...this.
394 (Dwo_file::shndx_map_): Remove.
395 (Dwo_file::sect_offsets_): New data member.
396 (Dwp_output_file::Dwp_output_file): Initialize new data members.
397 (Dwp_output_file::add_section): Rename to...
398 (Dwp_output_file::add_contribution): ...this.
399 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
400 (Dwp_output_file::add_tu_set): Likewise.
401 (Dwp_output_file::Contribution): New type.
402 (Dwp_output_file::Section::contributions): New data member.
403 (Dwp_output_file::Cu_or_tu_set): Remove.
404 (Dwp_output_file::Section::Section): New ctor.
405 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
406 (Dwp_output_file::Dwp_index::Section_table): New type.
407 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
408 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
410 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
411 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
412 (Dwp_output_file::Dwp_index::section_table): New member function.
413 (Dwp_output_file::Dwp_index::section_table_end): New member function.
414 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
415 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
416 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
417 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
418 (Dwp_output_file::Dwp_index::section_table_): New data member.
419 (Dwp_output_file::Dwp_index::section_mask_): New data member.
420 (Dwp_output_file::add_output_section): New member function.
421 (Dwp_output_file::write_new_section): New member function.
422 (Dwp_output_file::write_contributions): New member function.
423 (Dwp_output_file::section_id_map_): New data member.
424 (class Dwo_id_info_reader): Remove.
425 (class Unit_reader): New class.
426 (get_dwarf_section_name): New function.
427 (Dwo_file::read_executable): Adjust initializations of class data.
428 (Dwo_file::read): Add support for v2 package file format.
429 (Dwo_file::read_unit_index): Likewise.
430 (Dwo_file::sized_read_unit_index): Likewise.
431 (Dwo_file::copy_section): Likewise.
432 (Dwo_file::add_unit_set): Likewise.
433 (Dwp_output_file::add_output_section): Likewise.
434 (Dwp_output_file::add_contribution): Likewise.
435 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
437 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
439 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
441 (Dwp_output_file::initialize): Remove unused function.
442 (Dwp_output_file::finalize): Add support for v2 package file format.
443 (Dwp_output_file::write_index): Likewise.
444 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
447 2013-03-01 Cary Coutant <ccoutant@google.com>
449 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
450 function into class definition in header file.
451 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
452 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
454 (Dwarf_info_reader::check_buffer): Move here from .cc file.
456 2013-02-28 Alan Modra <amodra@gmail.com>
458 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
459 * target.cc (Target::do_plt_fde_location): New function.
460 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
461 accessor function, and constructor param.
462 (struct Post_fde, Post_fdes): Declare.
463 (Cie::write): Add post_fdes param.
464 * ehframe.cc (Fde::write): Use plt_fde_location.
465 (struct Post_fde): Define.
466 (Cie::write): Stash FDEs added post merge mapping.
467 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
468 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
469 (Eh_frame::do_sized_write): Arrange to write post map FDES after
471 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
472 (Target_powerpc::has_glink): New function.
473 (Target_powerpc::do_relax): Add eh_frame info for stubs.
474 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
475 glink_eh_frame_fde_32, default_fde): New data.
476 (Stub_table::eh_frame_added_): New var.
477 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
479 (Stub_table::add_eh_frame): New function.
480 (Output_data_glink::add_eh_frame): New function.
481 (Target_powerpc::make_glink_section): Call add_eh_frame.
483 2013-02-15 Ian Lance Taylor <iant@google.com>
485 * options.h (DEFINE_uint64_alias): Define.
486 (class General_options): Add -Ttext-segment as an alias for
489 2013-02-15 Alan Modra <amodra@gmail.com>
491 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
492 (Stub_table::do_write): ..here, two places.
493 (Stub_table::plt_call_size): Use it here too.
495 2013-02-11 Ian Lance Taylor <iant@google.com>
497 * descriptors.cc (Descriptors::close_all): New function.
498 * descriptors.h (class Descriptors): Declare close_all.
499 (close_all_descriptors): New inline function.
500 * plugin.cc: Include "descriptors.h".
501 (Plugin_manager::cleanup): Call close_all_descriptors.
503 2013-02-06 Alan Modra <amodra@gmail.com>
505 * README: Update coding style link.
507 2013-01-28 Cary Coutant <ccoutant@google.com>
509 * dwp.cc (File_list): New typedef.
510 (Dwo_name_info_reader): New class.
511 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
512 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
513 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
514 (Dwo_file::read_executable): New function.
515 (Dwo_file::read): Move common setup code to ...
516 (Dwo_file::make_object): ... here.
517 (dwp_options): Add --exec/-e.
521 2013-01-24 Sriraman Tallam <tmsriram@google.com>
523 * layout.cc (Layout::layout): Check for option text_reorder.
524 (Layout::make_output_section): Ditto.
525 * options.h (text_reorder): New option.
526 * output.cc (Input_section_sort_compare): Remove special ordering
529 Input_section_sort_section_name_special_ordering_compare::
530 operator()): New function.
531 (Output_section::sort_attached_input_sections): Use new sort function
533 * output.h (Input_section_sort_section_name_special_ordering_compare):
535 * testsuite/Makefile.am (text_section_grouping): Test option
537 * testsuite/Makefile.in: Regenerate.
538 * testsuite/text_section_grouping.sh: Check order of functions without
539 default text reordering.
541 2013-01-18 Mike Frysinger <vapier@gentoo.org>
543 * options.h (General_options): Change default to true for new_dtags.
545 2013-01-18 Mike Frysinger <vapier@gentoo.org>
547 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
548 when enable_new_dtags is false. Only add DT_RUNPATH when
549 enable_new_dtags is true.
551 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
553 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
554 used in declaration and definition consistent.
555 (Target_powerpc::symval_for_branch): Ditto.
557 2013-01-16 Sriraman Tallam <tmsriram@google.com>
559 * testsuite/plugin_final_layout.cc: Fix comment.
561 2013-01-16 Sriraman Tallam <tmsriram@google.com>
563 * layout.cc (Layout::layout): Do not do default sorting for
564 text sections when section ordering is specified.
565 (make_output_section): Ditto.
566 * testsuite/plugin_final_layout.cc: Name the function sections
567 to catch reordering issues.
569 2013-01-15 Alan Modra <amodra@gmail.com>
571 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
574 2013-01-15 Alan Modra <amodra@gmail.com>
576 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
577 * testsuite/Makefile.in: Regenerate.
579 2013-01-14 Alan Modra <amodra@gmail.com>
581 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
582 * testsuite/Makefile.in: Regenerate.
584 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
587 Fix mingw gold build with plugins enabled
588 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
589 * configure.ac: Export DLOPEN_LIBS and add headers check.
590 * plugin.cc: Handle non-dlfcn case.
591 * Makefile.in: Regenerate.
592 * config.in: Regenerate.
593 * configure: Regenerate.
594 * testsuite/Makefile.in: Regenerate.
596 2013-01-09 Sriraman Tallam <tmsriram@google.com>
598 * output.h (sort_attached_input_sections): Change to be public.
600 (Output_section_definition::set_section_addresses): Sort
601 attached input sections according to section order before linker
602 script assigns section addresses.
603 (Orphan_output_section::set_section_addresses): Sort
604 attached input sections according to section order before linker
605 script assigns section addresses.
606 * Makefile.am (final_layout.sh): Use a simple linker script to
607 check if section ordering still works.
608 * Makefile.in: Regenerate.
610 2013-01-09 Ben Cheng <bccheng@google.com>
612 * arm.cc (Target_arm::attributes_accept_div): New function.
613 (Target_arm::attributes_forbid_div): New function.
614 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
615 attribute using the same new functions as what bfd/elf32_arm.c
618 2013-01-07 Cary Coutant <ccoutant@google.com>
621 * output.cc (Output_section::add_input_section): For incremental
622 updates, don't track input sections that are allocated from patch
625 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
626 Ian Lance Taylor <iant@google.com>
629 * configure.ac (--enable-ld): Removed.
630 (install_as_default): Set to yes only for --enable-gold=default
632 * configure: Regenerated.
634 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
636 * options.h (General_options): Add -fuse-ld= for GCC linker
637 option compatibility.
639 2013-01-04 Cary Coutant <ccoutant@google.com>
641 * configure.ac: Fix typo restoring CXXFLAGS.
642 * configure: Regenerate.
644 2013-01-04 Cary Coutant <ccoutant@google.com>
646 * testsuite/Makefile.am (CXXLINK_S): New macro.
647 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
648 * testsuite/Makefile.in: Regenerate.
650 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
652 * version.cc (print_version): Update copyright year to 2013.
654 2012-12-20 Ian Lance Taylor <iant@google.com>
656 * layout.cc (Layout::special_ordering_of_input_section): New
658 (Layout::layout): If input section requires special ordering, must
660 (Layout::make_output_section): May sort .text input sections.
661 (Layout::is_section_name_prefix_grouped): Remove.
662 * layout.h (class Layout): Declare
663 special_ordering_of_input_section. Don't declare
664 is_section_name_prefix_grouped.
665 * output.cc (Output_section::add_input_section): Revert last
667 (Output_section::Input_section_sort::match_file_name): Don't crash
668 if called on output section data.
669 (Output_section::Input_section_sort_compare): Sort based on
671 (Output_section::Input_section_sort_section_order_index_compare):
673 (Output_section::sort_attached_input_sections): Likewise.
675 2012-12-18 Sriraman Tallam <tmsriram@google.com>
677 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
678 * layout.h (Layout::is_section_name_prefix_grouped): New function.
679 * output.cc (Output_section::add_input_section): Check if section
680 name contains special prefix. Keep input sections to sort such
682 (Output_section::Input_section_sort_section_order_index_compare
683 ::operator()): Group sections according to prefixes.
684 (Output_section::sort_attached_input_sections): Add condition to
685 Input_section_entry constructor call.
686 * testsuite/Makefile.am (text_section_grouping): New test.
687 * testsuite/Makefile.in: Regenerate.
688 * testsuite/text_section_grouping.cc: New file.
689 * testsuite/text_section_grouping.sh: New file.
691 2012-12-17 Nick Clifton <nickc@redhat.com>
693 * Makefile.am: Add copyright notice.
696 * configure.ac: Likewise.
697 * ftruncate.c: Likewise.
698 * Makefile.in: Regenerate.
700 2012-12-14 Cary Coutant <ccoutant@google.com>
702 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
704 (exception_separate_shared_12_test): Likewise.
705 (incremental_copy_test): Likewise.
706 * testsuite/Makefile.in: Regenerate.
708 2012-12-14 Cary Coutant <ccoutant@google.com>
710 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
711 (Dwp_output_file::Dwp_index::enter_set): Add assert.
713 2012-12-12 Alan Modra <amodra@gmail.com>
715 * powerpc.cc (class Track_tls): New.
716 (class Relocate, class Scan): Inherit Track_tls.
717 (Target_powerpc::Scan::local, global): Track tls optimization
718 and avoid creating plt entry for __tls_get_addr if all uses
720 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
722 2012-12-12 Alan Modra <amodra@gmail.com>
724 * options.h (General_options): Add --toc-sort/--no-toc-sort.
725 Replace no_toc_optimize with toc_optimize.
726 * output.h (Output_section::input_sections): Provide non-const variant.
727 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
728 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
730 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
731 (class Sort_toc_sections): New.
732 (Target_powerpc::do_finalize_sections): Sort toc sections.
733 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
735 2012-12-10 Roland McGrath <mcgrathr@google.com>
737 * testsuite/binary_unittest.cc (read_all): New function.
738 (Sized_binary_test): Use it instead of ::read.
739 * fileread.cc (do_read): Don't assume pread always reads the whole
740 amount in a single call.
742 2012-12-10 Alan Modra <amodra@gmail.com>
744 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
745 Set EM_PPC64 or EM_PPC here.
746 (Target_selector_powerpc::do_recognize): Delete.
748 2012-12-10 Alan Modra <amodra@gmail.com>
750 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
752 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
754 2012-12-07 Roland McGrath <mcgrathr@google.com>
756 * testsuite/binary_unittest.cc (Sized_binary_test):
757 Use open_descriptor rather than ::open.
759 2012-12-07 Alan Modra <amodra@gmail.com>
761 * powerpc.cc (Stub_table::do_write): Delete redundant Address
762 typedef and invalid_address constant.
763 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
764 instantiate constants.
766 2012-12-06 Roland McGrath <mcgrathr@google.com>
768 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
769 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
770 * aclocal.m4: Regenerate.
771 * configure: Regenerate.
772 * Makefile.in: Regenerate.
773 * testsuite/Makefile.in: Regenerate.
775 2012-12-07 Alan Modra <amodra@gmail.com>
777 * options.h (General_options): Add no_toc_optimize.
778 * powerpc.cc (ok_lo_toc_insn): New function.
779 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
781 2012-12-06 Alan Modra <amodra@gmail.com>
783 * options.h (General_options): Add plt_align, plt_static_chain,
784 plt_thread_safe. Update stub_group_size help text.
785 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
786 for new plt_thread_safe_ var.
787 (use_plt_offset): Correct comments.
788 (Target_powerpc::do_relax): Look for thread creation symbols to
789 determine default plt_thread_safe value. Clear plt call stubs
790 as well as branch stubs each iteration.
791 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
793 (l, hi, ha, write_insn): Move earlier.
794 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
795 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
797 (Stub_table::update_size): Adjust.
798 (Stub_table::prev_size, set_prev_size): Delete.
799 (Stub_table::stub_align): Let --plt-align affect result.
800 (Stub_table::plt_call_size): Calculate sizes for various stubs.
801 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
802 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
803 (Stub_table::do_write): Support more stub variants.
805 2012-12-04 Alan Modra <amodra@gmail.com>
807 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
808 (Target_powerpc::do_define_standard_symbols): New function.
810 2012-12-03 Alan Modra <amodra@gmail.com>
812 * output.h: Formatting, whitespace.
814 2012-12-03 Alan Modra <amodra@gmail.com>
816 * layout.h (Layout::get_executable_sections): Declare.
817 * layout.cc (Layout::get_executable_sections): New function.
818 * arm.cc (Target_arm::group_sections): Use it.
819 (Arm_output_section::group_sections): Delete now redundant test.
820 * output.cc (Output_reloc::Output_reloc): Add is_relative.
821 param to handle relative relocs.
822 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
823 (Output_data_reloc::add_absolute): Adjust.
824 (Output_data_reloc::add_relative): New function.
825 (Output_data::reset_data_size): New function.
826 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
827 (Output_section::set_addralign): New function.
828 (Output_section::checkpoint_set_addralign): New function.
829 (Output_section::clear_section_offsets_need_adjustment): New function.
830 (Output_section::input_sections): Make public.
831 * powerpc.cc (class Output_data_brlt_powerpc): New.
832 (class Stub_table, class Stub_control): New.
833 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
834 stub_table_, set_stub_table, stub_table): New vectors and accessor
836 (Target_powerpc::do_may_relax, do_relax, push_branch,
837 new_stub_table, stub_tables, brlt_section, group_sections,
838 add_branch_lookup_table, find_branch_lookup_table,
839 write_branch_lookup_table, make_brlt_section): New functions.
840 (Target_powerpc::struct Sort_sections, class Branch_info): New.
841 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
842 branch_info_): New vars.
843 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
844 make call stubs here.
845 (Output_data_glink): Remove all call stub handling from this class.
846 (Target_powerpc::Scan::local, global): Save interesting branch
847 relocs and relocs for ifunc. Adjust calls to plt entry functions.
848 (Target_powerpc::do_finalize_sections): Only make reg save/restore
849 functions on final link.
850 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
851 Handle long branch destinations too.
852 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
853 do_plt_address_for_local): Adjust lookup of plt call stubs.
855 2012-11-30 Alan Modra <amodra@gmail.com>
857 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
858 relocs against protected symbols when building 32-bit shared libs.
860 2012-11-30 Alan Modra <amodra@gmail.com>
862 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
863 param. Call got_section() to make .got. Update all callers
864 and their callers and so on.
866 2012-11-30 Alan Modra <amodra@gmail.com>
868 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
869 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
870 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
871 value if it already exists.
873 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
876 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
878 2012-11-14 Roland McGrath <mcgrathr@google.com>
880 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
881 than bfc instruction for data sandboxing.
883 2012-11-08 Alan Modra <amodra@gmail.com>
885 * po/POTFILES.in: Regenerate.
887 2012-11-05 Alan Modra <amodra@gmail.com>
889 * configure.ac: Apply 2012-09-10 change to config.in here.
890 * configure: Regenerate.
892 2012-11-05 Alan Modra <amodra@gmail.com>
894 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
895 (struct Opd_ent): Use "Address" rather than "Offset".
896 (Output_data_got_powerpc::got_base_offset): Return Valtype.
897 (Target_powerpc::got_section): Make public.
898 (Target_powerpc::scan_relocs): Move code setting symbols..
899 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
900 Create _SDA_BASE_ only when referenced.
902 2012-11-02 Roland McGrath <mcgrathr@google.com>
904 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
907 2012-11-01 Roland McGrath <mcgrathr@google.com>
909 * target.h (Sized_target::relocate_relocs): Use Elf_Off
910 for offset_in_output_section parameter.
911 (Sized_target::relocate_special_relocatable): Likewise.
912 * arm.cc (Target_arm::relocate_relocs): Likewise.
913 (Target_arm::relocate_special_relocatable): Likewise.
914 * i386.cc (Target_i386::relocate_relocs): Likewise.
915 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
916 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
917 * target-reloc.h (relocate_relocs): Likewise.
918 * testsuite/testfile.cc (Target_test): Likewise.
919 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
920 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
922 * system.h: Move inclusion of <clocale> to after <libintl.h> in
923 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
925 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
926 parameter, which is unused in the [!F_SETFD] case.
928 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
929 SYMNDX to off_t before comparing it to this->data_size().
930 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
931 * incremental.cc (Output_section_incremental_inputs::do_write):
932 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
934 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
936 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
938 * gold.cc (Target_arm::do_adjust_elf_header): Add the
939 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
942 2012-10-29 Cary Coutant <ccoutant@google.com>
944 * dwp.cc (usage): Add file and exit status parameters;
945 add --help and --version options.
946 (print_version): New function.
947 (main): Add --help and --version options.
949 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
951 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
952 final_layout_sequence.txt.
953 * testsuite/Makefile.in: Regenerated.
955 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
957 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
958 COMPILE generated by automake.
960 (CXXCOMPILE1): Likewise.
961 (CXXLINK1): Likewise.
962 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
964 (CXXCOMPILE): Likewise.
966 * testsuite/Makefile.in: Regenerated.
968 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
970 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
971 on bad fwrite return.
973 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
975 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
978 2012-10-23 Cary Coutant <ccoutant@google.com>
980 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
981 * testsuite/Makefile.in: Regenerate.
982 * testsuite/dwp_test.h: New source file.
983 * testsuite/dwp_test_1.cc: New source file.
984 * testsuite/dwp_test_1.s: New source file.
985 * testsuite/dwp_test_1.sh: New source file.
986 * testsuite/dwp_test_1b.cc: New source file.
987 * testsuite/dwp_test_1b.s: New source file.
988 * testsuite/dwp_test_2.cc: New source file.
989 * testsuite/dwp_test_2.s: New source file.
990 * testsuite/dwp_test_2.sh: New source file.
991 * testsuite/dwp_test_main.cc: New source file.
992 * testsuite/dwp_test_main.s: New source file.
994 2012-10-23 Cary Coutant <ccoutant@google.com>
996 * dwp.h: New header file.
997 * dwp.cc: New source file.
998 * gold.h: Move shared declarations to system.h.
999 * system.h: New header file.
1000 * Makefile.am: Add dwp.
1001 * Makefile.in: Regenerate.
1003 2012-10-23 Cary Coutant <ccoutant@google.com>
1005 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
1006 Dwarf_info_reader::read_from_pointer.
1007 (Dwarf_pubnames_table::read_header): Likewise.
1008 (Dwarf_pubnames_table::next_name): Likewise.
1009 (Dwarf_die::read_attributes): Likewise.
1010 (Dwarf_die::skip_attributes): Likewise.
1011 (Dwarf_info_reader::read_from_pointer): New function template.
1012 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
1013 (Dwarf_pubnames_table): Likewise.
1014 (Dwarf_info_reader::read_from_pointer): New function template.
1015 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
1016 Dwarf_pubnames_table ctor.
1018 2012-10-23 Cary Coutant <ccoutant@google.com>
1020 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
1022 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
1024 (Dwarf_info_reader::set_abbrev_shndx): New method.
1025 (Dwarf_info_reader::abbrev_shndx_): New data member.
1027 2012-10-23 Cary Coutant <ccoutant@google.com>
1029 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
1030 from object, not parameters.
1031 (Dwarf_info_reader::parse): Likewise.
1032 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
1033 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
1034 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
1037 2012-10-23 Cary Coutant <ccoutant@google.com>
1039 * fileread.cc (Input_file::Input_file): New constructor.
1040 * fileread.h (class Input_file): Add new constructor.
1042 2012-10-18 Alan Modra <amodra@gmail.com>
1045 * object.cc (Relobj::is_section_name_included): Also match
1046 .sdata personality section.
1048 2012-10-18 Alan Modra <amodra@gmail.com>
1050 * target-reloc.h (class Default_comdat_behavior): New, package up..
1051 (get_comdat_behaviour): ..this.
1052 (relocate_section): Add Relocate_comdat_behavior template arg,
1053 adjust code to suit.
1054 * arm.cc (Target_arm::relocate_section): Adjust to suit.
1055 (Target_arm::scan_reloc_section): Likewise.
1056 * i386.cc (Target_i386::relocate_section): Likewise.
1057 * sparc.cc (Target_sparc::relocate_section): Likewise.
1058 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
1059 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
1060 * powerpc.cc (class Relocate_comdat_behavior): New.
1061 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
1062 gold::relocate_section with new template arg.
1064 2012-10-18 Alan Modra <amodra@gmail.com>
1066 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
1067 dynamic relocs for GOT_TPREL got entries, without symbol if
1069 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
1070 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
1071 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
1073 2012-10-17 Alan Modra <amodra@gmail.com>
1076 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
1078 2012-10-16 Sriraman Tallam <tmsriram@google.com>
1080 * layout.cc (Layout::include_section): Keep sections marked
1081 SHF_EXCLUDE when doing relocatable links.
1083 2012-10-16 Alan Modra <amodra@gmail.com>
1085 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
1086 (Target_powerpc::do_finalize_sections): Call it.
1087 (Output_data_save_res): New class and supporting functions.
1088 (Target_powerpc::symval_for_branch): Only look up .opd entry for
1089 normal symbols defined in object files.
1091 2012-10-12 Alan Modra <amodra@gmail.com>
1093 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
1094 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
1095 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
1096 section if scan_opd_relocs not yet called.
1097 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
1099 2012-10-12 Alan Modra <amodra@gmail.com>
1101 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1102 add_local_ifunc_entry): Revert last change.
1103 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
1105 2012-10-05 Alan Modra <amodra@gmail.com>
1107 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
1108 do_plt_address_for_global): New functions.
1109 (Output_data_got_powerpc::do_write): Don't segfault when linking
1111 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1112 add_local_ifunc_entry): Return true on adding entry..
1113 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
1114 glink->add_entry call. Remove unused symtab param. Adjust calls.
1115 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
1116 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
1117 set up symbols here.
1118 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
1119 syms here. Do so even when no .iplt. Don't segfault when linking
1121 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
1122 new variants without reloc param.
1123 (Glink_sym_ent::Glink_sym_ent): Likewise.
1124 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
1125 reloc when refs will resolve to plt call stub.
1126 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
1127 R_PPC_PLTREL24 to resolve locally.
1128 (Target_powerpc::Scan::global): Correct ifunc handling.
1129 (Target_powerpc::Relocate::relocate): Correct local sym glink
1130 lookup. Don't destroy "value" when we have a plt call stub,
1131 and when checking plt call validity.
1132 (Target_powerpc::do_dynsym_value): Simplify.
1134 2012-10-05 Alan Modra <amodra@gmail.com>
1136 * i386.cc (Output_data_plt_i386::address_for_global,
1137 address_for_local): Add plt offset to returned value. Adjust uses.
1138 * sparc.cc (Output_data_plt_sparc::address_for_global,
1139 address_for_local): Likewise.
1140 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
1141 address_for_local): Likewise.
1142 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
1143 address_for_local): Likewise.
1144 * target.h (Target::plt_address_for_global, plt_address_for_local):
1146 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
1147 (Output_data_got::Got_entry::write): Nor here.
1148 * output.h: Comment fix.
1150 2012-10-02 Jiong Wang <jiwang@tilera.com>
1152 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
1153 global_offset_table_ value for larget got.
1154 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
1156 2012-09-29 Alan Modra <amodra@gmail.com>
1158 * powerpc.cc (Target_powerpc::iplt_): New output section.
1159 (Target_powerpc::iplt_section, make_iplt_section,
1160 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
1161 (Target_powerpc::make_plt_entry): Handle ifunc syms.
1162 Target_powerpc::plt_entry_count): Count iplt entries too.
1163 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
1164 reloc section in constructor. New params.
1165 (Target_powerpc::make_plt_section): Create reloc section here instead.
1166 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
1168 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
1169 (Output_data_glink::add_entry, find_entry): New functions to
1170 deal with local syms.
1171 (Glink_sym_ent): Add support for local syms.
1172 (Output_data_glink::do_write): Handle ifunc plt entries.
1173 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1174 (Target_powerpc::Scan::local, global): Handle ifunc syms.
1175 (Target_powerpc::Relocate::relocate): Likewise.
1176 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
1178 2012-09-25 Alan Modra <amodra@gmail.com>
1180 * object.h (Sized_relobj_file::adjust_local_symbol,
1181 do_adjust_local_symbol): New functions.
1182 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
1183 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
1184 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
1185 and irregular opd entry spacing.
1186 (Powerpc_relobj::do_read_relocs): Add opd size checks.
1187 (Global_symbol_visitor_opd): New functor.
1188 (Target_powerpc::do_finalize_sections): Omit global symbols defined
1189 on deleted opd entries.
1191 2012-09-15 Jiong Wang <jiwang@tilera.com>
1193 * tilegx.cc: New file.
1194 * Makefile.am (TARGETSOURCES): Add tilegx.cc
1195 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
1196 * configure.tgt: Add entries for tilegx*.
1197 * configure.ac: Likewise.
1198 * Makefile.in: Rebuild.
1199 * configure: Likewise.
1200 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
1203 2012-09-13 Alan Modra <amodra@gmail.com>
1205 * target-reloc.h (scan_relocs): Call scan.local for relocs
1206 against symbols in discarded sections. Pass is_discarded
1208 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
1209 Add is_discarded param.
1210 * powerpc (Target_powerpc::Scan::local): Likewise. Use
1211 is_discarded to flag opd entry as discarded. Don't emit dyn
1212 relocs on such entries.
1213 (Target_powerpc::Scan::global): Similarly detect and handle
1215 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
1216 opd_ent_. Update all uses.
1217 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
1218 (Target_powerpc::relocate_section): Zero out discarded opd
1221 2012-09-12 Ian Lance Taylor <iant@google.com>
1224 * output.cc: Rename Output_data_got template parameter from size
1225 to got_size for all functions. Compile all variants of
1227 (Output_data_got::Got_entry::write): Correct use of size for
1228 symbol value. Use local_is_tls rather than casting to
1230 * object.h (class Object): Add local_is_tls and do_local_is_tls.
1231 (class Sized_relobj_file): Add do_local_is_tls.
1232 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
1234 2012-09-11 Alan Modra <amodra@gmail.com>
1237 * layout.cc (Layout::set_segment_offsets): When using
1238 common-page-size alignment, ensure we are on a new max-page-size
1240 * output.cc (Output_segment::set_section_addresses): Use
1241 abi_pagesize, not common_pagesize for relro boundary.
1242 (Output_segment::set_offset): Likewise.
1244 2012-09-11 Alan Modra <amodra@gmail.com>
1246 * output.h (Output_data_got::add_global_tls, add_local_tls,
1247 add_local_tls_pair): New functions.
1248 (Output_data_got::add_local_pair_with_rel): Remove second
1249 reloc param. Expand comment.
1250 (Output_data_got::Got_entry): Rename use_plt_offset_ to
1251 use_plt_or_tls_offset_, similarly for constructor param.
1252 (Output_data_got::Got_entry::write): Add got_index param.
1253 * output.cc (Output_data_got::add_global_tls, add_local_tls,
1254 add_local_tls_pair): New functions.
1255 (Output_data_got::Got_entry::write): Handle tls symbols
1256 with use_plt_or_tls_offset_ set specially.
1257 (Output_data_got::add_local_pair_with_rel): Only one reloc.
1258 (Output_data_got::do_write): Replace iterator with index, pass
1259 index to entry write function.
1260 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
1261 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
1262 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
1264 * i386.cc (Target_i386::Scan::local): Likewise.
1265 * sparc.cc (Target_sparc::Scan::local): Likewise.
1266 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
1267 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
1268 do_tls_offset_for_global): New functions.
1269 (Target_powerpc::Scan::local): Correct TLS relocations and got
1271 (Target_powerpc::Scan::global): Don't emit unnecessary
1272 dynamic relocations on TLS GOT entries.
1274 2012-09-10 Matthias Klose <doko@ubuntu.com>
1276 * config.in: Disable sanity check for kfreebsd.
1278 2012-09-10 Sterling Augustine <saugustine@google.com>
1280 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
1281 (Gdb_index::pubtypes_read): New parameter.
1282 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
1284 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
1287 2012-09-09 Alan Modra <amodra@gmail.com>
1289 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
1290 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
1291 * gc.h (gc_process_relocs): Call target gc_add_reference.
1292 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
1293 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
1294 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
1296 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
1297 to cater for when we don't need code offset. Update use.
1298 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
1299 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
1300 set_opd_valid): New functions.
1301 (Target_powerpc::do_gc_add_reference): New function.
1302 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
1304 (Target_powerpc::do_gc_mark_symbol): New function.
1306 2012-09-06 Cary Coutant <ccoutant@google.com>
1308 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
1309 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
1310 (Dwarf_die::skip_attributes): Likewise.
1311 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
1312 * testsuite/gdb_index_test.cc (inline_func_1): New function.
1314 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
1316 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
1318 * testsuite/script_test_3.t: Add .got.plt output section
1320 * testsuite/script_test_4.t: Likewise.
1322 2012-09-05 Alan Modra <amodra@gmail.com>
1324 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
1325 update all uses and lose "enum" when using type.
1327 2012-09-05 Alan Modra <amodra@gmail.com>
1329 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
1330 * configure: Regenerate.
1331 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
1332 (plugin_final_layout.stdout): Likewise.
1333 (memory_test): Set page sizes to 0x1000.
1334 * testsuite/Makefile.in: Regenerate.
1335 * testsuite/discard_locals_test.sh: Add FIXME comment.
1336 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
1337 * testsuite/pr14265.t: Add .got output section statement.
1338 * testsuite/script_test_2.t: Likewise.
1339 * testsuite/script_test_3.t: Likewise.
1340 * testsuite/script_test_4.t: Likewise.
1341 * testsuite/script_test_5.t: Likewise.
1342 * testsuite/script_test_6.t: Likewise.
1343 * testsuite/script_test_7.t: Likewise.
1344 * testsuite/script_test_9.t: Likewise.
1346 2012-09-05 Alan Modra <amodra@gmail.com>
1348 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
1349 (Powerpc_relocate_functions::Status): New typedef.
1350 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1351 (Target_powerpc::Scan::local): Handle REL64.
1352 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
1353 for REL32 and REL64.
1354 (Target_powerpc::symval_for_branch): New function, extracted from..
1355 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
1356 checks. Report overflow errors.
1358 2012-09-05 Alan Modra <amodra@gmail.com>
1360 * object.h (Sized_relobj_file::emit_relocs): Delete.
1361 (Sized_relobj_file::emit_relocs_reltype): Delete.
1362 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
1363 relocate_relocs for --emit-relocs.
1364 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
1365 * output.h: Update comment.
1366 (Output_segment::first_section): New function.
1367 (Output_segment::first_section_load_address): Use first_section.
1368 * output.cc (Output_segment::first_section): New function extracted..
1369 (Output_segment::first_section_load_address): ..from here. Delete.
1370 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
1371 * target.h (Sized_target::relocate_for_relocatable): Likewise.
1372 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
1373 adjust call to target.h function.
1374 * i386.cc (Target_i386): Likewise.
1375 * sparc.cc (Target_sparc): Likewise.
1376 * x86_64.cc (Target_x86_64): Likewise.
1377 * powerpc.cc (Target_powerpc): Likewise.
1378 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
1379 first tls section has section symbol for optimised local dynamic
1381 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
1382 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
1384 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
1385 Rename to relocate_relocs. Update error message.
1387 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
1389 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
1392 2012-08-31 Alan Modra <amodra@gmail.com>
1394 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
1395 (Powerpc_relobj::toc_base_offset): New stub function.
1396 (Target_powerpc): Add tp_offset, dtp_offset. Rename
1397 got_mod_index_offset to tlsld_got_offset. Update all refs.
1398 (Target_powerpc::Relocate::enum skip_tls): New.
1399 (Target_powerpc::call_tls_get_addr_): New var.
1400 (Target_powerpc::is_branch_reloc): Move to file scope.
1401 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
1402 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
1404 (Target_powerpc::enum Got_type): Delete old values, add new ones.
1405 (powerpc_info): Correct common_pagesize for ppc64.
1406 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
1407 (Powerpc_relocate_functions): Add overflow check enums and functions.
1408 Add non-shift version of rela, rela_ua. Delete all rel public
1409 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
1410 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
1411 addr16_ha3, addr14 functions.
1412 (Output_data_got_powerpc::add_constant_pair): New function.
1413 (Output_data_got_powerpc::got_base_offset): Likewise.
1414 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
1415 (instruction constants): Sort, add some more.
1416 (Output_data_glink::do_write): Add and use Address typedef. Use
1417 object->toc_base_offset() stub for 64-bit.
1418 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
1419 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1420 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
1421 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
1422 Always treat .opd relocs as against locally defined symbol.
1423 Correct condition for RELATIVE relocs.
1424 (Target_powerpc::do_finalize_sections): Test for NULL sections.
1425 (Target_powerpc::Relocate::relocate): Use plt call stub as value
1426 for 32-bit syms with a plt entry. Correct ppc64 toc base
1427 calculations. Handle TLS relocs, and more. Add overflow
1428 checking and adjust for Powerpc_relocate_functions changes.
1429 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
1430 Reinstate --emit-relocs code with FIXME.
1432 2012-08-30 Alan Modra <amodra@gmail.com>
1434 * layout.cc (Layout::set_segment_offsets): Set p_align to
1435 abi_pagesize, not common_pagesize.
1436 (Layout::relaxation_loop_body): Similarly use abi_pagesize
1437 to determine whether file header can go in segment.
1439 2012-08-30 Alan Modra <amodra@gmail.com>
1441 * output.h (Output_reloc::Output_reloc <output section>): Add
1442 is_relative param. Adjust calls.
1443 (Output_reloc::add_output_section_relative): New functions.
1444 * output.cc (Output_reloc::Output_reloc <output section>): Handle
1446 (Output_reloc::symbol_value): Handle SECTION_CODE.
1448 2012-08-24 Sriraman Tallam <tmsriram@google.com>
1450 * gold.cc (queue_middle_tasks): Call layout again when unique
1451 segments for sections is desired.
1452 * layout.cc (Layout::Layout): Initialize new members.
1453 (Layout::get_output_section_flags): New function.
1454 (Layout::choose_output_section): Call get_output_section_flags.
1455 (Layout::layout): Make output section for mapping to a unique segment.
1456 (Layout::insert_section_segment_map): New function.
1457 (Layout::attach_allocated_section_to_segment): Make unique segment for
1458 output sections marked so.
1459 (Layout::segment_precedes): Check for unique segments when sorting.
1460 * layout.h (Layout::Unique_segment_info): New struct.
1461 (Layout::Section_segment_map): New typedef.
1462 (Layout::insert_section_segment_map): New function.
1463 (Layout::get_output_section_flags): New function.
1464 (Layout::is_unique_segment_for_sections_specified): New function.
1465 (Layout::set_unique_segment_for_sections_specified): New function.
1466 (Layout::unique_segment_for_sections_specified_): New member.
1467 (Layout::section_segment_map_): New member.
1468 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
1469 Rename is_gc_pass_one to is_pass_one.
1470 Rename is_gc_pass_two to is_pass_two.
1471 Rename is_gc_or_icf to is_two_pass.
1472 Check for which pass based on whether symbols data is present.
1473 Make it two pass when unique segments for sections is desired.
1474 * output.cc (Output_section::Output_section): Initialize new
1476 * output.h (Output_section::is_unique_segment): New function.
1477 (Output_section::set_is_unique_segment): New function.
1478 (Output_section::is_unique_segment_): New member.
1479 (Output_section::extra_segment_flags): New function.
1480 (Output_section::set_extra_segment_flags): New function.
1481 (Output_section::extra_segment_flags_): New member.
1482 (Output_section::segment_alignment): New function.
1483 (Output_section::set_segment_alignment): New function.
1484 (Output_section::segment_alignment_): New member.
1485 (Output_segment::Output_segment): Initialize is_unique_segment_.
1486 (Output_segment::is_unique_segment): New function.
1487 (Output_segment::set_is_unique_segment): New function.
1488 (Output_segment::is_unique_segment_): New member.
1489 * plugin.cc (allow_unique_segment_for_sections): New function.
1490 (unique_segment_for_sections): New function.
1491 (Plugin::load): Add new functions to transfer vector.
1492 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
1493 * Makefile.in: Regenerate.
1494 * testsuite/plugin_final_layout.sh: Check if unique segment
1495 functionality works.
1496 * testsuite/plugin_section_order.c (onload): Check if new interfaces
1498 (allow_unique_segment_for_sections): New global.
1499 (unique_segment_for_sections): New global.
1500 (claim_file_hook): Call allow_unique_segment_for_sections.
1501 (all_symbols_read_hook): Call unique_segment_for_sections.
1503 2012-08-22 Cary Coutant <ccoutant@google.com>
1505 * layout.cc (Layout::include_section): Don't assert on GROUP
1506 sections with --emit-relocs.
1508 2012-08-21 Cary Coutant <ccoutant@google.com>
1510 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
1511 if --export-dynamic-symbol names an undef symbol.
1513 2012-08-18 Alan Modra <amodra@gmail.com>
1515 * powerpc.cc: Formatting and white space.
1516 (Powerpc_relobj): Rename got2_section_ to special_.
1517 Add opd_ent_shndx_ and opd_ent_off_ vectors.
1518 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
1519 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
1520 (Target_powerpc): Add Address typedef and invalid_address. Use
1522 (Target_powerpc::is_branch_reloc): New function.
1523 (Powerpc_relocate_functions): Add Address typedef, use throughout.
1524 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
1525 for dst_mask, value and addend.
1526 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
1527 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
1528 (Output_data_glink::do_write): Correct toc base. Don't try to use
1529 uint16_t for 24-bit offset. Use get_output_section_offset and
1531 (Target_powerpc::Scan::local): Handle more relocs.
1532 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
1533 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
1534 Plug in toc restoring insn after plt calls. Translate branches
1535 to function descriptor symbols to corresponding entry point.
1536 (Target_powerpc::relocate_for_relocatable): Check return from
1537 get_output_section_offset.
1538 * symtab.h: Comment typo.
1540 2012-08-14 Ian Lance Taylor <iant@google.com>
1542 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
1543 unsupported_relocal_local to call unsupported_reloc_global.
1545 2012-08-14 Nick Clifton <nickc@redhat.com>
1548 * script-sections.cc (Sections_element::output_section_name): Add
1549 keep return parameter.
1550 (Output_section_element::match_name): Add keep return parameter.
1551 Return the value of the keep_ member.
1552 * script-sections.h (class Output_section): Update
1553 output_section_name prototype.
1554 * layout.cc (Layout::keep_input_section): New public member
1556 (Layout::choose_output_section): Pass keep parameter to
1557 output_section_name.
1558 * layout.h (class Layout): Add keep_input_section.
1559 * object.cc (Sized_relobj_file::do_layout): Check for kept input
1561 * testsuite/Makefile.am: Add a test.
1562 * testsuite/Makefile.in: Regenerate.
1563 * testsuite/pr14265.c: Source file for the test.
1564 * testsuite/pr14265.t: Linker script for the test.
1565 * testsuite/pr14265.sh: Shell script for the test.
1567 2012-08-14 Alan Modra <amodra@gmail.com>
1569 * target.h (Target::output_section_name): New function.
1570 (Target::do_output_section_name): New function.
1571 * layout.cc (Layout::choose_output_section): Call the above.
1572 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
1574 2012-08-14 Alan Modra <amodra@gmail.com>
1576 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
1577 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
1578 for replace_constant call.
1579 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
1580 (Output_data_glink::do_print_to_mapfile): New function.
1581 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
1582 (Target_powerpc::Relocate::relocate): Likewise.
1584 2012-08-14 Alan Modra <amodra@gmail.com>
1586 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
1587 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
1588 (Output_data_glink::add_entry,find_entry): Remove shndx param.
1589 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
1590 all references to shndx_. Handle special case for R_PPC_PLTREL24
1592 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
1593 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
1594 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
1596 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
1597 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
1599 2012-08-12 Alan Modra <amodra@gmail.com>
1601 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
1602 (glink insn constants): Use uint32_t.
1603 (Output_data_glink::add_entry): Use insert, not [] operator.
1605 2012-08-11 Alan Modra <amodra@gmail.com>
1607 * object.h (Sized_relobj_file::find_shdr): New function.
1608 (Sized_relobj_file::find_special_sections): New function.
1609 * object.cc (Sized_relobj_file::find_shdr): New function.
1610 (Sized_relobj_file::find_eh_frame): Use find_shdr.
1611 (Sized_relobj_file::find_special_sections): New function, split out..
1612 (Sized_relobj_file::do_read_symbols): ..from here.
1613 * output.h (Output_data_got::replace_constant): New function.
1614 (Output_data_got::num_entries): New function.
1615 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
1616 (Output_data_got::got_offset): Protected rather than private.
1617 (Output_data_got::replace_got_entry): New function.
1618 * output.cc (Output_data_got::replace_got_entry): New function.
1619 * powerpc.cc (class Powerpc_relobj): New.
1620 (class Powerpc_relocate_functions): Delete all psymval variants or
1621 convert to value,addend type. Delete pcrela, pcrela_unaligned.
1622 Implement _ha functions using corresponding _hi function.
1623 (Powerpc_relobj::find_special_sections): New function.
1624 (Target_powerpc::do_make_elf_object): New function.
1625 (class Output_data_got_powerpc): New.
1626 (class Output_data_glink): New.
1627 (class Powerpc_scan_relocatable_reloc): New.
1628 Many more changes througout file.
1630 2012-08-09 Nick Clifton <nickc@redhat.com>
1632 * po/vi.po: Updated Vietnamese translation.
1634 2012-08-07 Ian Lance Taylor <iant@google.com>
1636 * layout.cc (Layout::add_target_dynamic_tags): If
1637 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
1640 2012-07-30 Nick Clifton <nickc@redhat.com>
1642 * po/gold.pot: Updated template.
1643 * po/es.po: Updated Spanish translation.
1645 2012-07-18 Cary Coutant <ccoutant@google.com>
1648 * configure.ac: Add check for -gpubnames support.
1649 * configure: Regenerate.
1650 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
1651 support; force -gno-pubnames.
1652 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
1654 (gdb_index_test_4): New test.
1655 * testsuite/Makefile.in: Regenerate.
1656 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
1657 * testsuite/gdb_index_test_2.sh: Likewise.
1658 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
1659 * testsuite/gdb_index_test_4.sh: New script.
1660 * testsuite/gdb_index_test_comm.sh: New script with common code;
1661 don't look for space after colon.
1663 2012-07-16 Sriraman Tallam <tmsriram@google.com>
1665 * gold.cc (queue_middle_tasks): Update function order only after
1666 deferred objects due to plugins are processed.
1668 2012-07-11 Ian Lance Taylor <iant@google.com>
1670 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
1671 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
1672 (Target_arm::scan_reloc_for_stub): Likewise.
1673 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
1674 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
1675 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
1676 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
1677 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
1679 2012-07-10 Dodji Seketeli <dodji@redhat.com>
1680 Ian Lance Taylor <iant@google.com>
1683 * configure.ac: Test whether std::tr1::hash<off_t> works.
1684 * gold.h: Add a specialization for std::tr1::hash<off_t> if
1686 * output.h (class Output_fill): Add virtual destructor.
1687 * configure, config.in: Rebuild.
1689 2012-06-22 Roland McGrath <mcgrathr@google.com>
1691 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
1693 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
1695 * plugin.cc (Plugin::load): Handle position independent executables.
1697 2012-06-06 Cary Coutant <ccoutant@google.com>
1699 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
1701 (lines_only_debug_sections): Likewise.
1702 (gdb_fast_lookup_sections): New static array.
1703 (is_gdb_debug_section): Rename formal parameter.
1704 (is_lines_only_debug_section): Likewise.
1705 (is_gdb_fast_lookup_section): New function.
1706 (Layout::include_section): Check for ".zdebug_" prefix; pass
1707 section name suffix to is_gdb_debug_section, et al.; check for
1708 fast-lookup sections when building .gdb_index.
1709 * options.h (--strip-debug-gdb): Update GDB version number.
1711 2012-06-06 Cary Coutant <ccoutant@google.com>
1713 * configure.ac: Add check for fallocate.
1714 * configure: Regenerate.
1715 * config.in: Regenerate.
1717 * options.h (class General_options): Add --mmap-output-file and
1718 --posix-fallocate options.
1719 * output.cc: (posix_fallocate): Remove; replace with...
1720 (gold_fallocate): New function.
1721 (Output_file::map_no_anonymous): Call gold_fallocate.
1722 (Output_file::map): Check --mmap-output-file option.
1724 2012-06-05 Jing Yu <jingyu@google.com>
1726 * gold.h (textdomain): Add do {} to empty while(0).
1727 (bindtextdomain): Likewise.
1729 2012-06-04 Cary Coutant <ccoutant@google.com>
1731 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
1734 2012-05-25 Sriraman Tallam <tmsriram@google.com>
1736 * symtab.cc (Symbol_table::define_special_symbol):
1737 Initialize *poldsym to prevent uninitialized variable errors.
1739 2012-05-23 Cary Coutant <ccoutant@google.com>
1741 * layout.cc (Layout::section_name_mapping): Add rules to handle
1742 exact match on .data.rel.ro.local or .data.rel.ro.
1743 (Layout::output_section_name): Check for exact matches.
1745 2012-05-23 Cary Coutant <ccoutant@google.com>
1747 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
1750 2012-05-22 Cary Coutant <ccoutant@google.com>
1752 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
1753 object before exporting symbol.
1755 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
1757 * testsuite/tls_test.cc: Include "config.h" first.
1758 * testsuite/tls_test_c.c: Likewise.
1760 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
1761 Nick Clifton <nickc@redhat.com>
1764 * configure.in: Add check that sysdep.h has been included before
1765 any system header files.
1766 * configure: Regenerate.
1767 * config.in: Regenerate.
1769 2012-05-14 Cary Coutant <ccoutant@google.com>
1771 * layout.cc (Layout::make_output_section): Mark .tdata section
1773 * testsuite/relro_test.cc: Add a TLS variable.
1775 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
1778 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
1779 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
1782 2012-05-08 Cary Coutant <ccoutant@google.com>
1784 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
1785 (lines_only_debug_sections): Likewise.
1787 2012-05-02 Roland McGrath <mcgrathr@google.com>
1789 * nacl.cc: New file.
1791 * Makefile.am (CCFILES, HFILES): Add them.
1792 * Makefile.in: Regenerate.
1793 * i386.cc (Output_data_plt_i386_nacl): New class.
1794 (Output_data_plt_i386_nacl_exec): New class.
1795 (Output_data_plt_i386_nacl_dyn): New class.
1796 (Target_i386_nacl): New class.
1797 (Target_selector_i386_nacl): New class.
1798 (target_selector_i386): Use it instead of Target_selector_i386.
1799 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
1800 (Target_x86_64_nacl): New class.
1801 (Target_selector_x86_64_nacl): New class.
1802 (target_selector_x86_64, target_selector_x32): Use it instead of
1803 Target_selector_x86_64.
1804 * arm.cc (Output_data_plt_arm_nacl): New class.
1805 (Target_arm_nacl): New class.
1806 (Target_selector_arm_nacl): New class.
1807 (target_selector_arm, target_selector_armbe): Use it instead of
1808 Target_selector_arm.
1810 * target-select.cc (select_target): Take new Input_file* and off_t
1811 arguments, pass them on to recognize method of selector.
1812 * object.cc (make_elf_sized_object): Update caller.
1813 * parameters.cc (parameters_force_valid_target): Likewise.
1814 * incremental.cc (make_sized_incremental_binary): Likewise.
1815 * target-select.h: Update decl.
1816 (Target_selector::recognize): Take new Input_file* argument,
1817 pass it on to do_recognize.
1818 (Target_selector::do_recognize): Take new Input_file* argument.
1819 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
1820 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
1821 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
1822 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
1824 * target.h (Target::Target_info): New members isolate_execinstr
1826 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
1827 * arm.cc (Target_arm::arm_info): Update initializer.
1828 * i386.cc (Target_i386::i386_info): Likewise.
1829 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
1830 * sparc.cc (Target_sparc::sparc_info): Likewise.
1831 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1832 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1833 * layout.cc (Layout::attach_allocated_section_to_segment):
1834 Take new const Target* argument. If target->isolate_execinstr(), act
1836 (Layout::find_first_load_seg): Take new const Target* argument;
1837 if target->isolate_execinstr(), reject PF_X segments.
1838 (Layout::relaxation_loop_body): Update caller.
1839 (Layout::set_segment_offsets): If target->isolate_execinstr(),
1840 reset file offset to zero when we hit LOAD_SEG, and then do a second
1841 loop over the segments before LOAD_SEG to reassign offsets after
1842 addresses have been determined. Handle target->rosegment_gap().
1843 (Layout::attach_section_to_segment): Take new const Target* argument;
1844 pass it to attach_allocated_section_to_segment.
1845 (Layout::make_output_section): Update caller.
1846 (Layout::attach_sections_to_segments): Take new const Target* argument;
1847 pass it to attach_section_to_segment.
1848 * gold.cc (queue_middle_tasks): Update caller.
1849 * layout.h (Layout): Update method decls with new arguments.
1851 * arm.cc (Target_arm::Target_arm): Take optional argument for the
1852 Target_info pointer to use.
1853 (Target_arm::do_make_data_plt): New virtual method.
1854 (Target_arm::make_data_plt): New method that calls it.
1855 (Target_arm::make_plt_entry): Use it.
1856 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
1857 for the section alignment.
1858 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
1860 (Output_data_plt_arm::first_plt_entry_offset): Call it.
1861 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
1863 (Output_data_plt_arm::get_plt_entry_size): Call it.
1864 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
1865 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
1866 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
1868 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
1869 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
1870 method instead of sizeof(plt_entry).
1871 (Output_data_plt_arm::add_entry): Likewise.
1872 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
1873 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
1875 (Target_arm::plt_entry_size): Likewise.
1876 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
1878 (Output_data_plt_arm_standard): ... here, new class.
1879 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
1880 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
1881 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
1883 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1884 Take additional argument for the PLT entry size.
1885 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
1886 Use get_plt_entry_size method rather than plt_entry_size variable.
1887 (Output_data_plt_x86_64::reserve_slot): Likewise.
1888 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
1889 (Output_data_plt_x86_64::add_entry): Likewise.
1890 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
1891 (Output_data_plt_x86_64::address_for_global): Likewise.
1892 (Output_data_plt_x86_64::address_for_local): Likewise.
1893 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1894 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
1895 Make method non-static.
1896 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
1898 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
1899 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
1900 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
1901 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
1903 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
1904 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
1906 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
1907 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
1909 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
1910 (Output_data_plt_x86_64::plt_entry_size)
1911 (Output_data_plt_x86_64::first_plt_entry)
1912 (Output_data_plt_x86_64::plt_entry)
1913 (Output_data_plt_x86_64::tlsdesc_plt_entry)
1914 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
1915 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
1916 (Output_data_plt_x86_64_standard): ... here, new class.
1917 (Target_x86_64::Target_x86_64): Take optional argument for the
1918 Target_info pointer to use.
1919 (Target_x86_64::do_make_data_plt): New virtual method.
1920 (Target_x86_64::make_data_plt): New method to call it.
1921 (Target_x86_64::init_got_plt_for_update): Use that.
1922 Call this->plt_->add_eh_frame method here.
1923 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
1924 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
1925 rather than static method.
1926 (Target_x86_64::plt_entry_size): Likewise.
1927 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
1928 rather than plt_entry_size variable. Move guts of PLT filling to...
1929 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
1930 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
1931 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
1933 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
1934 additional argument for the section alignment.
1935 Don't do add_eh_frame_for_plt here.
1936 (Output_data_plt_i386::first_plt_entry_offset): Make the method
1937 non-static. Use get_plt_entry_size method rather than plt_entry_size
1939 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
1941 (Output_data_plt_i386::get_plt_entry_size): Call it.
1942 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
1943 (Output_data_plt_i386::add_eh_frame): New method to call it.
1944 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
1946 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
1947 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
1949 (Output_data_plt_i386::fill_plt_entry): New method to call it.
1950 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
1951 method instead of plt_entry_size.
1952 (Output_data_plt_i386::plt_entry_size)
1953 (Output_data_plt_i386::plt_eh_frame_fde_size)
1954 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
1955 (Output_data_plt_i386_standard): ... here, new class.
1956 (Output_data_plt_i386_exec): New class.
1957 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
1958 (Output_data_plt_i386_exec::first_plt_entry): ... here.
1959 (Output_data_plt_i386::exec_plt_entry): Move to ...
1960 (Output_data_plt_i386_exec::plt_entry): ... here.
1961 (Output_data_plt_i386_dyn): New class.
1962 (Output_data_plt_i386::first_plt_entry): Move to ...
1963 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
1964 (Output_data_plt_i386::dyn_plt_entry): Move to ...
1965 (Output_data_plt_i386_dyn::plt_entry): ... here.
1966 (Target_i386::Target_i386): Take optional argument for the Target_info
1968 (Target_i386::do_make_data_plt): New virtual method.
1969 (Target_i386::make_data_plt): New method to call it.
1970 (Target_i386::make_plt_section): Use that.
1971 Call this->plt_->add_eh_frame method here.
1972 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
1973 rather than plt_entry_size variable.
1974 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
1975 (Output_data_plt_i386::address_for_local): Likewise.
1976 (Output_data_plt_i386::do_write): Likewise.
1977 Move guts of PLT filling to...
1978 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
1979 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
1980 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
1981 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
1983 2012-05-01 Cary Coutant <ccoutant@google.com>
1985 * dwarf_reader.cc (Dwarf_die::read_attributes)
1986 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
1987 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
1988 * reduced_debug_output.cc
1989 (Output_reduced_debug_info_section::get_die_end): Remove
1990 DW_FORM_GNU_ref_index. Add default case.
1992 2012-04-26 Mark Wielaard <mjw@redhat.com>
1994 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
1995 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
1996 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
1997 DW_AT_high_pc as offset from DW_AT_low_pc.
1999 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
2000 * testsuite/Makefile.in: Regenerate.
2001 * testsuite/gdb_index_test_3.c: New test source file.
2002 * testsuite/gdb_index_test_3.sh: New test source file.
2004 2012-04-25 Ian Lance Taylor <iant@google.com>
2006 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
2008 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
2009 as a class, not a struct.
2010 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
2011 (Target_arm::apply_cortex_a8_workaround): Likewise.
2012 * gc.h: Declare Reloc_types as a struct, not a class.
2013 * object.h: Declare Symbols_data as a struct.
2014 * reloc.h: Declare Read_relocs_data as a struct.
2015 * target.h: Declare Relocate_info as a struct.
2017 2012-04-24 David S. Miller <davem@davemloft.net>
2019 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
2020 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
2023 2012-04-24 Cary Coutant <ccoutant@google.com>
2025 * incremental-dump.cc (find_input_containing_global): Replace
2026 magic number with symbolic constant.
2027 (dump_incremental_inputs): Update version number.
2028 * incremental.cc (Output_section_incremental_inputs): Update version
2029 number; import symbolic constants from Incremental_inputs_reader.
2030 (Incremental_inputs::create_data_sections): Align relocations
2031 section correctly for 64-bit targets.
2032 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
2033 constants; add padding.
2034 (Output_section_incremental_inputs::write_header): Add assert for
2036 (Output_section_incremental_inputs::write_input_files): Add assert
2037 for input_entry_size.
2038 (Output_section_incremental_inputs::write_info_blocks): Add padding;
2039 add assert for object_info_size, input_section_entry_size,
2040 global_sym_entry_size.
2041 * incremental.h (Incremental_inputs_reader): Add symbolic constants
2042 for data structure sizes; use them.
2043 (Incremental_input_entry_reader): Import symbolic constants from
2044 Incremental_inputs_reader; use them.
2046 2012-04-23 David S. Miller <davem@davemloft.net>
2048 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
2050 (Target_sparc::Target_sparc): Initialize new fields.
2051 (Target_sparc::do_make_elf_object): New function.
2052 (Target_sparc::do_adjust_elf_header): New function.
2054 2012-04-23 Cary Coutant <ccoutant@google.com>
2056 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
2057 CU range table of gdb index.
2059 2012-04-20 David S. Miller <davem@davemloft.net>
2061 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
2064 2012-04-16 David S. Miller <davem@davemloft.net>
2066 * sparc.cc (Target_sparc::got_address): New function.
2067 (Sparc_relocate_functions::gdop_hix22): New function.
2068 (Sparc_relocate_functions::gdop_lox10): New function.
2069 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
2071 (Target_sparc::Scan::local): Likewise if the global symbol is not
2072 preemptible and is not IFUNC.
2073 (Target_sparc::Relocate::relocate): Perform GOTDATA code
2074 transformations for local and non-preemptible non-IFUNC global
2077 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
2078 writing out 64-bit part of ranges.
2080 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
2081 -fpic and -fpie respectively.
2082 * Makefile.in: Regenerate.
2084 * sparc.cc (class Target_sparc): Add rela_ifunc_.
2085 (Target_sparc::Target_sparc): Initialize new field.
2086 (Target_sparc::do_plt_section_for_global): New function.
2087 (Target_sparc::do_plt_section_for_local): New function.
2088 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
2089 (Target_sparc::make_plt_section): New function, broken out of
2090 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
2091 (Target_sparc::make_plt_entry): Call make_plt_section.
2092 (Target_sparc::make_local_ifunc_plt_entry): New function.
2093 (Target_sparc::rela_ifunc_section): New function.
2094 (Target_sparc::plt_section): Remove const.
2095 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
2096 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
2097 and ifunc_count_ fields.
2098 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
2099 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
2100 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
2101 (Output_data_plt_sparc::rela_ifunc): New function.
2102 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
2103 (Output_data_plt_sparc::has_ifunc_section): New function.
2104 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
2105 (Output_data_plt_sparc::address_for_global): New function.
2106 (Output_data_plt_sparc::address_for_local): New function.
2107 (Output_data_plt_sparc::plt_index_to_offset): New function.
2108 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
2110 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
2112 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
2113 R_SPARC_JMP_IREL to switch.
2114 (Target_sparc::Scan::check_non_pic): Likewise.
2115 (Target_sparc::Scan::local): Handle IFUNC symbols.
2116 (Target_sparc::Scan::local): Likewise.
2117 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
2118 and plt_address_for_local.
2119 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
2120 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
2122 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
2123 (class Output_data_reloc): Adjust calls to Output_reloc_type.
2124 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
2125 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
2127 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
2128 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
2130 * sparc.cc (Target_sparc::Scan::global): Likewise.
2131 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2133 2012-04-16 Cary Coutant <ccoutant@google.com>
2135 * archive.cc (Library_base::should_include_member): Check for
2136 --export-dynamic-symbol.
2137 * options.h (class General_options): Add --export-dynamic-symbol.
2138 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
2139 --export-dynamic-symbol.
2140 (Symbol_table::gc_mark_undef_symbols): Likewise.
2141 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
2143 2012-04-12 David S. Miller <davem@davemloft.net>
2145 * sparc.cc (Reloc::wdisp10): New relocation method.
2146 (Reloc::h34): Likewise.
2147 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
2148 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
2150 (Target_sparc::Scan::local): Likewise.
2151 (Target_sparc::Scan::global): Likewise.
2152 (Target_sparc::Relocate::relocate): Likewise.
2154 2012-04-09 Cary Coutant <ccoutant@google.com>
2156 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
2159 2012-04-06 Ian Lance Taylor <iant@google.com>
2161 * timer.cc: #include <unistd.h>.
2163 2012-04-06 Roland McGrath <mcgrathr@google.com>
2165 * configure.in (AC_CHECK_HEADERS): Add locale.h.
2166 * config.in: Regenerate.
2167 * configure: Regenerate.
2169 2012-04-05 Nick Clifton <nickc@redhat.com>
2171 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
2172 (AM_LC_MESSAGES): Add.
2173 * aclocal.m4: Regenerate.
2174 * config.in: Regenerate.
2175 * configure: Regenerate.
2177 2012-03-21 Cary Coutant <ccoutant@google.com>
2179 * Makefile.am: Add gdb-index.cc, gdb-index.h.
2180 * Makefile.in: Regenerate.
2181 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
2182 (Sized_elf_reloc_mapper::symbol_section): New function.
2183 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
2184 (make_elf_reloc_mapper): New function.
2185 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
2186 (Dwarf_abbrev_table::do_read_abbrevs): New function.
2187 (Dwarf_abbrev_table::do_get_abbrev): New function.
2188 (Dwarf_ranges_table::read_ranges_table): New function.
2189 (Dwarf_ranges_table::read_range_list): New function.
2190 (Dwarf_pubnames_table::read_section): New function.
2191 (Dwarf_pubnames_table::read_header): New function.
2192 (Dwarf_pubnames_table::next_name): New function.
2193 (Dwarf_die::Dwarf_die): New function.
2194 (Dwarf_die::read_attributes): New function.
2195 (Dwarf_die::skip_attributes): New function.
2196 (Dwarf_die::set_name): New function.
2197 (Dwarf_die::set_linkage_name): New function.
2198 (Dwarf_die::attribute): New function.
2199 (Dwarf_die::string_attribute): New function.
2200 (Dwarf_die::int_attribute): New function.
2201 (Dwarf_die::uint_attribute): New function.
2202 (Dwarf_die::ref_attribute): New function.
2203 (Dwarf_die::child_offset): New function.
2204 (Dwarf_die::sibling_offset): New function.
2205 (Dwarf_info_reader::check_buffer): New function.
2206 (Dwarf_info_reader::parse): New function.
2207 (Dwarf_info_reader::do_parse): New function.
2208 (Dwarf_info_reader::do_read_string_table): New function.
2209 (Dwarf_info_reader::lookup_reloc): New function.
2210 (Dwarf_info_reader::get_string): New function.
2211 (Dwarf_info_reader::visit_compilation_unit): New function.
2212 (Dwarf_info_reader::visit_type_unit): New function.
2213 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
2214 Sized_elf_reloc_mapper.
2215 (Sized_dwarf_line_info::symbol_section): Remove function.
2216 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
2217 (Sized_dwarf_line_info::read_line_mappings): Remove object
2218 parameter, adjust callers.
2219 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
2220 * dwarf_reader.h: Include <sys/types.h>.
2221 (class Track_relocs): Remove forward declaration.
2222 (class Elf_reloc_mapper): New class.
2223 (class Sized_elf_reloc_mapper): New class.
2224 (class Dwarf_abbrev_table): New class.
2225 (class Dwarf_range_list): New class.
2226 (class Dwarf_ranges_table): New class.
2227 (class Dwarf_pubnames_table): New class.
2228 (class Dwarf_die): New class.
2229 (class Dwarf_info_reader): New class.
2230 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
2231 (Sized_dwarf_line_info::symbol_section): Remove member function.
2232 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
2234 * gdb-index.cc: New source file.
2235 * gdb-index.h: New source file.
2236 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
2237 and .debug_types sections, call Layout::add_to_gdb_index.
2238 (Sized_relobj_incr::do_section_name): Implement.
2239 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
2240 return type; Implement.
2241 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
2243 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
2244 parameter list and return type.
2245 (Sized_incr_dynobj::do_section_contents): Likewise.
2246 * layout.cc: Include gdb-index.h.
2247 (Layout::Layout): Initialize gdb_index_data_.
2248 (Layout::init_fixed_output_section): Check for .gdb_index section.
2249 (Layout::add_to_gdb_index): New function. Instantiate.
2250 * layout.h: Add forward declaration for class Gdb_index.
2251 (Layout::add_to_gdb_index): New member function.
2252 (Layout::gdb_index_data_): New data member.
2253 * main.cc: Include gdb-index.h.
2254 (main): Print statistics for gdb index.
2255 * object.cc (Object::section_contents): Move code into
2256 do_section_contents.
2257 (need_decompressed_section): Check for sections needed when building
2259 (build_compressed_section_map): Likewise.
2260 (Sized_relobj_file::do_read_symbols): Need local symbols when building
2262 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
2263 sections; call Layout::add_to_gdb_index.
2264 (Sized_relobj_file::do_decompressed_section_contents): Call
2265 do_section_contents directly.
2266 * object.h (Object::do_section_contents): Adjust parameter list and
2268 (Object::do_decompressed_section_contents): Call do_section_contents
2270 (Sized_relobj_file::do_section_contents): Adjust parameter list and
2272 * options.h (class General_options): Add --gdb-index option.
2273 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
2274 list and return type.
2275 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
2276 * reloc.h (Track_relocs::checkpoint): New function.
2277 (Track_relocs::reset): New function.
2279 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
2281 * testsuite/Makefile.in: Regenerate.
2282 * testsuite/gdb_index_test.cc: New test source file.
2283 * testsuite/gdb_index_test_1.sh: New test source file.
2284 * testsuite/gdb_index_test_2.sh: New test source file.
2286 2012-03-19 Doug Kwan <dougkwan@google.com>
2288 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2289 (Target_arm::do_finalize_sections): Remove code which defines
2290 __exidx_start and __exidx_end. Make symbol table parameter
2291 anonymous as it is not used.
2292 * gold.cc (queue_middle_tasks): Call target hook to define any
2293 target-specific symbols.
2294 * target.h (Target::define_standard_symbols): New method.
2295 (Target::do_define_standard_symbols): Same.
2296 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
2297 * testsuite/Makefile.in: Regenerate.
2298 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
2300 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
2301 relocations are generated for __exidx_start and __exidx_end.
2303 2012-03-16 Doug Kwan <dougkwan@google.com>
2305 * testsuite/Makefile.am: Disable test initpri3b.
2306 * testsuite/Makefile.in: Regenerate.
2308 2012-03-15 Doug Kwan <dougkwan@google.com>
2310 * arm.cc (Target_arm::got_section): Make .got section read-only
2313 2012-03-15 Ian Lance Taylor <iant@google.com>
2316 * layout.cc (Layout::make_output_section): Correctly mark
2317 SHT_INIT_ARRAY, et. al., as relro.
2319 2012-03-14 Doug Kwan <dougkwan@google.com>
2321 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
2322 dynamic relocations for protected symbols in shared objects.
2324 2012-03-13 Ian Lance Taylor <iant@google.com>
2326 * resolve.cc (Symbol_table::resolve): When merging common symbols,
2327 keep the larger alignment.
2329 2012-03-12 Cary Coutant <ccoutant@google.com>
2331 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
2332 handling of DW_LNE_define_file.
2334 2012-03-12 Cary Coutant <ccoutant@google.com>
2336 * reduced_debug_output.cc
2337 (Output_reduced_debug_info_section::get_die_end): Add new FORM
2340 2012-02-29 Cary Coutant <ccoutant@google.com>
2342 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
2344 2012-02-29 Cary Coutant <ccoutant@google.com>
2346 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2347 Call Object::decompressed_section_contents.
2348 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
2350 (Sized_dwarf_line_info::buffer_start_): New data member.
2351 * merge.cc (Output_merge_data::do_add_input_section): Call
2352 Object::decompressed_section_contents.
2353 (Output_merge_string::do_add_input_section): Likewise.
2354 * object.cc (need_decompressed_section): New function.
2355 (build_compressed_section_map): Decompress sections needed later.
2356 (Sized_relobj_file::do_decompressed_section_contents): New function.
2357 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2358 * object.h (Object::decompressed_section_contents): New function.
2359 (Object::discard_decompressed_sections): New function.
2360 (Object::do_decompressed_section_contents): New function.
2361 (Object::do_discard_decompressed_sections): New function.
2362 (Compressed_section_info): New type.
2363 (Compressed_section_map): Include decompressed section contents.
2364 (Sized_relobj_file::do_decompressed_section_contents): New function.
2365 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2367 2012-02-16 Cary Coutant <ccoutant@google.com>
2369 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
2370 * testsuite/Makefile.in: Regenerate.
2372 2012-02-14 Cary Coutant <ccoutant@google.com>
2374 * options.cc (General_options::finalize): Disallow -pie and -static.
2376 2012-02-03 Doug Kwan <dougkwan@google.com>
2378 * arm.cc (Arm_relocate_functions::abs8,
2379 Arm_relocate_functions::abs16): Use
2380 Bits::has_signed_unsigned_overflow32.
2381 (Arm_relocate_functions::thm_abs8): Correct range of
2383 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
2386 2012-02-02 Doug Kwan <dougkwan@google.com>
2388 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
2389 position independent outputs, not just shared objects.
2391 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
2393 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
2394 * configure: Regenerated.
2396 2012-01-27 Ian Lance Taylor <iant@google.com>
2398 * reloc.h (Bits): New class with static functions, copied from
2399 namespace utils in arm.cc.
2400 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
2403 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2405 * incremental.cc (write_info_blocks): Correct relocation offset.
2407 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2409 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
2410 (Relocate::tls_gd_to_le): Likewise.
2412 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2414 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
2416 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2418 * configure.ac: Check if -mcmodel=medium works.
2419 * configure: Regenerated.
2421 2012-01-24 Cary Coutant <ccoutant@google.com>
2423 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
2425 (read_unsigned_LEB_128_x): ... this new function.
2426 (read_signed_LEB_128): Replaced with inline definition and ...
2427 (read_signed_LEB_128_x): ... this new function.
2428 * int_encoding.h (read_unsigned_LEB_128_x): New function.
2429 (read_unsigned_LEB_128): Add inline definition.
2430 (read_signed_LEB_128_x): New function.
2431 (read_signed_LEB_128): Add inline definition.
2432 * testsuite/Makefile.am (leb128_unittest): New unit test.
2433 * testsuite/Makefile.in: Regenerate.
2434 * testsuite/leb128_unittest.cc: New unit test.
2436 2012-01-23 Ian Lance Taylor <iant@google.com>
2439 * i386.cc (Target_i386::do_code_fill): When using a jmp
2440 instruction, pad with nop instructions.
2441 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2443 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
2445 * x86_64.cc (gc_process_relocs): Add typename on types used in
2447 (scan_relocs): Likewise.
2448 (relocate_section): Likewise.
2449 (apply_relocation): Likewise.
2451 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
2453 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
2454 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
2457 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
2459 * x86_64.cc: Initial support for x32.
2461 2012-01-03 Cary Coutant <ccoutant@google.com>
2463 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
2464 Use abstract base class for GOT.
2465 * gold/output.h (class Output_data_got_base): New abstract base class.
2466 (class Output_data_got): Derive from new base class, adjust ctors.
2467 (Output_data_got::reserve_slot): Make virtual; rename to
2468 do_reserve_slot; Adjust callers.
2469 * gold/target.h (Sized_target::init_got_plt_for_update): Return
2470 pointer to abstract base class.
2471 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
2473 2011-12-18 Ian Lance Taylor <iant@google.com>
2475 * object.h (Relobj::local_symbol_value): New function.
2476 (Relobj::local_plt_offset): New function.
2477 (Relobj::local_has_got_offset): New function.
2478 (Relobj::local_got_offset): New function.
2479 (Relobj::set_local_got_offset): New function.
2480 (Relobj::do_local_symbol_value): New pure virtual function.
2481 (Relobj::do_local_plt_offset): Likewise.
2482 (Relobj::do_local_has_got_offset): Likewise.
2483 (Relobj::do_local_got_offset): Likewise.
2484 (Relobj::do_set_local_got_offset): Likewise.
2485 (Sized_relobj::do_local_has_got_offset): Rename from
2486 local_has_got_offset.
2487 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
2488 (Sized_relobj::do_set_local_got_offset): Rename from
2489 set_local_got_offset.
2490 (Sized_relobj_file::do_local_plt_offset): Rename from
2492 (Sized_relobj_file::do_local_symbol_value): New function.
2493 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
2495 * output.cc (Output_data_got::Got_entry::write): Change object to
2496 Relobj. Use local_symbol_value.
2497 (Output_data_got::add_global_with_rel): Change rel_dyn to
2498 Output_data_reloc_generic*. Use add_global_generic.
2499 (Output_data_got::add_global_with_rela): Remove. Change all
2500 callers to use add_global_with_rel.
2501 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
2502 Output_data_reloc_generic*. Use add_global_generic.
2503 (Output_data_got::add_global_pair_with_rela): Remove. Change all
2504 callers to use add_global_pair_with_rel.
2505 (Output_data_got::add_local): Change object to Relobj*.
2506 (Output_data_got::add_local_plt): Likewise.
2507 (Output_data_got::add_local_with_rel): Change object to Relobj*,
2508 change rel_dyn to Output_data_reloc_generic*. Use
2510 (Output_data_got::add_local_with_rela): Remove. Change all
2511 callers to use all_local_with_rel.
2512 (Output_data_got::add_local_pair_with_rel): Change object to
2513 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
2514 add_output_section_generic.
2515 (Output_data_got::add_local_pair_with_rela): Remove. Change all
2516 callers to use add_local_pair_with_rel.
2517 (Output_data_got::reserve_local): Change object to Relobj*.
2518 * output.h: (class Output_data_reloc_generic): Add pure virtual
2519 declarations for add_global_generic, add_local_generic,
2520 add_output_section_generic.
2521 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
2522 functions for Output_data_reloc_generic. Update declarations for
2523 changes listed in output.cc.
2524 (class Output_data_got): Change template parameter to got_size.
2525 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
2526 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
2528 (Sized_relobj_incr::do_local_plt_offset): New function.
2529 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
2532 2011-12-17 Cary Coutant <ccoutant@google.com>
2534 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
2535 * resolve.cc (Symbol_table::resolve): Likewise.
2536 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
2538 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2540 2011-12-16 Ian Lance Taylor <iant@google.com>
2542 * output.h (Output_data_reloc_generic::add): Only call
2543 add_dynamic_reloc if this is a dynamic reloc section.
2545 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
2548 * target-reloc.h (apply_relocation): Replace <64, false> with
2551 2011-11-25 Nick Clifton <nickc@redhat.com>
2553 * po/it.po: New Italian translation.
2555 2011-11-17 Sterling Augustine <saugustine@google.com>
2557 * script.cc (script_include_directive): Implement.
2558 (read_script_file): New local variables name and search_path. Update
2559 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
2560 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
2561 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
2563 2011-11-11 Sterling Augustine <saugustine@google.com>
2565 * yyscript.y (section_cmd): Add support for INCLUDE directive.
2566 (file_or_sections_cmd): Likewise.
2568 2011-11-11 Doug Kwan <dougkwan@google.com>
2570 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
2571 if --just-symbols is given.
2573 2011-11-10 Doug Kwan <dougkwan@google.com>
2576 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
2577 when processing data relocs.
2578 * reloc.h (Relocate_functions::rel_unaligned): New method.
2579 (Relocate_functions::pcrel_unaligned): Ditto.
2580 (Relocate_functions::rel32_unaligned): Ditto.
2581 (Relocate_functions::pcrel32_unaligned): Ditto.
2583 2011-11-09 Doug Kwan <dougkwan@google.com>
2586 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
2587 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
2588 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
2589 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2590 (Relocate_functions::rel_unaligned): New.
2591 (Relocate_functions::rel32_unaligned): New.
2592 * target-reloc.h (relocate_for_relocatable): Add code to handle
2593 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2594 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
2595 arm_unaligned_reloc_r): New targets.
2596 * testsuite/Makefile.in: Regenerate.
2597 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
2600 2011-11-02 Ian Lance Taylor <iant@google.com>
2602 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
2604 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
2605 * options.cc (General_options::finalize): Use library search path
2606 from configure script if specified. If not native and no sysroot,
2607 only search TOOLLIBDIR.
2608 * options.h (Search_directory::Search_directory): Change name to
2610 (General_options::add_to_library_path_with_sysroot): Change arg to
2612 * configure, Makefile.in, config.in: Rebuild.
2614 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2616 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
2617 we are working around the ARM1176 Erratum.
2618 * options.h (General_options::fix_arm1176): Add option.
2619 * testsuite/Makefile.am: Add testcases, and keep current ones
2621 * testsuite/Makefile.in: Regenerate.
2622 * testsuite/arm_fix_1176.s: New file.
2623 * testsuite/arm_fix_1176.sh: Likewise.
2625 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2627 * arm.cc (Target_arm::Target_arm): Remove initialisation of
2629 (Target_arm::may_use_blx): Remove method.
2630 (Target_arm::set_may_use_blx): Likewise.
2631 (Target_arm::may_use_v4t_interworking): New method.
2632 (Target_arm::may_use_v5t_interworking): Likewise.
2633 (Target_arm::may_use_blx_): Remove member variable.
2634 (Arm_relocate_functions::arm_branch_common): Check for v5T
2636 (Arm_relocate_functions::thumb_branch_common): Likewise.
2637 (Reloc_stub::stub_type_for_reloc): Likewise.
2638 (Target_arm::do_finalize_sections): Correct interworking checks.
2639 * testsuite/Makefile.am: Add new tests.
2640 * testsuite/Makefile.in: Regenerate.
2641 * testsuite/arm_farcall_arm_arm.s: New test.
2642 * testsuite/arm_farcall_arm_arm.sh: Likewise.
2643 * testsuite/arm_farcall_arm_thumb.s: Likewise.
2644 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
2645 * testsuite/arm_farcall_thumb_arm.s: Likewise.
2646 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
2647 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
2648 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
2650 2011-10-31 Cary Coutant <ccoutant@google.com>
2653 * expression.cc (Expression::eval_with_dot): Add
2654 is_section_dot_assignment parameter.
2655 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
2656 absolute and assigning to dot within a section.
2657 * script-sections.cc
2658 (Output_section_element_assignment::set_section_addresses): Pass
2659 dot_section to set_if_absolute.
2660 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
2661 as is_section_dot_assignment flag to eval_with_dot.
2662 (Output_section_element_dot_assignment::set_section_addresses):
2664 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
2665 parameter. Also set value if relative to dot_section; set the
2666 symbol's output_section.
2667 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
2668 parameter. Adjust all callers.
2669 (Expression::eval_maybe_dot): Likewise.
2670 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
2672 * testsuite/script_test_2.t: Test assignment of an absolute value
2673 to dot within an output section element.
2675 2011-10-31 Cary Coutant <ccoutant@google.com>
2677 * options.h (class General_options): Add --[no-]gnu-unique options.
2678 * symtab.cc (Symbol_table::sized_write_globals): Convert
2679 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
2681 2011-10-31 Cary Coutant <ccoutant@google.com>
2684 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
2685 unnecessary assertion.
2686 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
2688 2011-10-31 Sriraman Tallam <tmsriram@google.com>
2690 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2692 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2694 Change to just keep the section associated with symbol.
2695 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
2696 they are externally visible and --export-dynamic is turned on.
2697 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
2699 2011-10-19 Ian Lance Taylor <iant@google.com>
2702 * script-sections.cc
2703 (Output_section_element_dot_assignment::needs_output_section): New
2706 2011-10-19 Ian Lance Taylor <iant@google.com>
2709 * layout.cc (Layout::segment_precedes): Don't assert failure if a
2710 --section-start option was seen.
2711 * options.h (General_options::any_section_start): New function.
2713 2011-10-18 David S. Miller <davem@davemloft.net>
2716 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
2717 member to track relocation locations that have moved during TLS
2718 reloc optimizations.
2719 (Target_sparc::Relocate::Relocate): Initialize to NULL.
2720 (Target_sparc::Relocate::relocate): Adjust view down by 4
2721 bytes if it matches reloc_adjust_addr_.
2722 (Target_sparc::Relocate::relocate_tls): Always move the
2723 __tls_get_addr call delay slot instruction forward 4 bytes when
2724 performing relaxation.
2726 2011-10-18 Cary Coutant <ccoutant@google.com>
2728 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
2729 (Output_file::map_no_anonymous): Check for non-zero
2730 return code from posix_fallocate.
2732 2011-10-17 Cary Coutant <ccoutant@google.com>
2735 * plugin.cc (is_visible_from_outside): Check for symbols
2736 referenced from dynamic objects.
2737 * resolve.cc (Symbol_table::resolve): Don't count references
2738 from dynamic objects as references from real ELF files.
2739 * testsuite/plugin_test_2.sh: Adjust expected result.
2741 2011-10-17 Cary Coutant <ccoutant@google.com>
2743 * gold.cc: Include timer.h.
2744 (queue_middle_tasks): Stamp time.
2745 (queue_final_tasks): Likewise.
2746 * main.cc (main): Store timer in parameters. Print timers
2748 * parameters.cc (Parameters::Parameters): Initialize timer_.
2749 (Parameters::set_timer): New function.
2750 (set_parameters_timer): New function.
2751 * parameters.h (Parameters::set_timer): New function.
2752 (Parameters::timer): New function.
2753 (Parameters::timer_): New data member.
2754 (set_parameters_timer): New function.
2755 * timer.cc (Timer::stamp): New function.
2756 (Timer::get_pass_time): New function.
2757 * timer.h (Timer::stamp): New function.
2758 (Timer::get_pass_time): New function.
2759 (Timer::pass_times_): New data member.
2761 2011-10-17 Cary Coutant <ccoutant@google.com>
2763 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
2764 task for members of lib groups.
2766 2011-10-17 Cary Coutant <ccoutant@google.com>
2769 * fileread.cc (File_read::find_view): Add assert.
2770 (File_read::make_view): Move bounds check (replace with assert)...
2771 (File_read::find_or_make_view): ... to here.
2773 2011-10-12 Cary Coutant <ccoutant@google.com>
2775 * output.cc (Output_file::open_base_file): Handle case where
2776 ::read returns less than requested size.
2778 2011-10-10 Cary Coutant <ccoutant@google.com>
2780 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
2781 Initialize defined_count_.
2782 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
2783 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
2784 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
2785 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
2786 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
2787 * incremental.h (Sized_relobj_incr::defined_count_): New data
2789 (Sized_incr_dynobj::defined_count_): New data member.
2790 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
2791 Return zeroes instead of internal error.
2793 2011-10-10 Cary Coutant <ccoutant@google.com>
2796 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
2797 (Output_reloc::symbol_value): Return PLT offset if flag is set.
2798 * output.h (class Output_reloc): Add use_plt_offset flag.
2799 (Output_reloc::type_): Adjust size of bit field.
2800 (Output_reloc::use_plt_offset_): New bit field.
2801 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
2802 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
2803 flag. Adjust all callers.
2804 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
2805 creating RELATIVE relocations.
2807 2011-10-10 Nick Clifton <nickc@redhat.com>
2809 * po/es.po: Updated Spanish translation.
2810 * po/fi.po: Updated Finnish translation.
2812 2011-10-03 Diego Novillo <dnovillo@google.com>
2814 * options.cc (parse_uint): Fix dereference of RETVAL.
2816 2011-09-29 Sriraman Tallam <tmsriram@google.com>
2818 * layout.h (section_order_map_): New member.
2819 (get_section_order_map): New member function.
2820 * output.cc (Output_section::add_input_section): Check for patterns
2821 only when --section-ordering-file is specified.
2822 * gold.cc (queue_middle_tasks): Delay updating order of sections till
2823 output_sections have been formed.
2824 * layout.cc (Layout_Layout): Initialize section_order_map_.
2825 * plugin.cc (update_section_order): Store order in order_map. Do not
2827 * testsuite/Makefile.am: Add test case for plugin_final_layout.
2828 * testsuite/Makefile.in: Regenerate.
2829 * testsuite/plugin_section_order.c: New file.
2830 * testsuite/plugin_final_layout.cc: New file.
2831 * testsuite/plugin_final_layout.sh: New file.
2833 2011-09-29 Cary Coutant <ccoutant@google.com>
2835 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2837 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
2838 symbols during incremental update.
2839 (Symbol_table::add_from_dynobj): Likewise.
2841 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2842 Ian Lance Taylor <iant@google.com>
2844 * symtab.cc (Symbol_table::define_special_symbol): Always
2845 canonicalize version string.
2847 2011-09-26 Cary Coutant <ccoutant@google.com>
2849 * gold.cc (queue_initial_tasks): Move option checks ...
2850 * options.cc (General_options::finalize): ... to here. Disable
2851 some options; make others fatal.
2853 2011-09-26 Cary Coutant <ccoutant@google.com>
2856 * plugin.cc (get_symbols_v2): New function.
2857 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
2858 (is_referenced_from_outside): New function.
2859 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
2860 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
2861 (get_symbols): Pass version parameter.
2862 (get_symbols_v2): New function.
2863 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
2865 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
2866 (onload): Add LDPT_GET_SYMBOLS_V2.
2867 (all_symbols_read_hook): Use get_symbols_v2; check for
2868 LDPR_PREVAILING_DEF_IRONLY_EXP.
2869 * testsuite/plugin_test_3.sh: Update expected results.
2871 2011-09-23 Simon Baldwin <simonb@google.com>
2873 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
2874 configuration options.
2875 * configure: Regenerate.
2876 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
2877 * Makefile.in: Regenerate.
2878 * testsuite/Makefile.in: Regenerate.
2880 2011-09-19 Sriraman Tallam <tmsriram@google.com>
2882 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
2884 2011-09-19 Cary Coutant <ccoutant@google.com>
2886 * incremental.cc (can_incremental_update): Fix typo in comment.
2887 * incremental.h (can_incremental_update): Likewise.
2889 2011-09-18 Cary Coutant <ccoutant@google.com>
2891 * incremental.cc (can_incremental_update): New function.
2892 * incremental.h (can_incremental_update): New function.
2893 * layout.cc (Layout::init_fixed_output_section): Call it.
2894 (Layout::make_output_section): Don't allow patch space in .eh_frame.
2895 * object.cc (Sized_relobj_file::do_layout): Call
2896 can_incremental_update.
2898 2011-09-13 Cary Coutant <ccoutant@google.com>
2900 * configure.ac: Check for glibc support for gnu_indirect_function
2901 support with static linking, setting automake conditional
2903 * Makefile.in: Regenerate.
2904 * configure: Regenerate.
2906 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
2907 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
2909 * testsuite/Makefile.in: Regenerate.
2911 2011-09-13 Cary Coutant <ccoutant@google.com>
2913 * incremental.cc (Sized_relobj_incr::do_layout): Call
2914 report_comdat_group for kept comdat sections.
2915 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
2916 * testsuite/Makefile.in: Regenerate.
2917 * testsuite/incr_comdat_test_1.cc: New source file.
2918 * testsuite/incr_comdat_test_2_v1.cc: New source file.
2919 * testsuite/incr_comdat_test_2_v2.cc: New source file.
2920 * testsuite/incr_comdat_test_2_v3.cc: New source file.
2922 2011-09-13 Ian Lance Taylor <iant@google.com>
2924 * object.cc (Sized_relobj_file::do_layout): Remove unused local
2925 variable external_symbols_offset.
2927 2011-09-12 Ian Lance Taylor <iant@google.com>
2929 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
2930 triggered if object has no symbols.
2932 2011-09-09 David S. Miller <davem@davemloft.net>
2934 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
2935 (Output_fill_debug_line::do_write): Likewise.
2937 2011-08-29 Cary Coutant <ccoutant@google.com>
2939 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
2940 casts to match formatting specs.
2941 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
2943 2011-08-26 Cary Coutant <ccoutant@google.com>
2945 * layout.cc (Free_list::allocate): Provide guarantee of minimum
2946 remaining hole size when allocating.
2947 (Layout::make_output_section): Set fill methods for debug sections.
2948 * layout.h (Free_list::Free_list_node): Move from private to
2950 (Free_list::set_min_hole_size): New function.
2951 (Free_list::begin, Free_list::end): New functions.
2952 (Free_list::min_hole_): New data member.
2953 * output.cc: Include dwarf.h.
2954 (Output_fill_debug_info::do_minimum_hole_size): New function.
2955 (Output_fill_debug_info::do_write): New function.
2956 (Output_fill_debug_line::do_minimum_hole_size): New function.
2957 (Output_fill_debug_line::do_write): New function.
2958 (Output_section::Output_section): Initialize new data member.
2959 (Output_section::set_final_data_size): Ensure patch space is larger
2960 than minimum hole size.
2961 (Output_section::do_write): Fill holes in debug sections.
2962 * output.h (Output_fill): New class.
2963 (Output_fill_debug_info): New class.
2964 (Output_fill_debug_line): New class.
2965 (Output_section::set_free_space_fill): New function.
2966 (Output_section::free_space_fill_): New data member.
2967 * testsuite/Makefile.am (incremental_test_3): Add
2968 --incremental-patch option.
2969 (incremental_test_4): Likewise.
2970 (incremental_test_5): Likewise.
2971 (incremental_test_6): Likewise.
2972 (incremental_copy_test): Likewise.
2973 (incremental_common_test_1): Likewise.
2974 * testsuite/Makefile.in: Regenerate.
2976 2011-08-26 Nick Clifton <nickc@redhat.com>
2978 * po/es.po: Updated Spanish translation.
2980 2011-08-01 Cary Coutant <ccoutant@google.com>
2982 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
2983 * gold/testsuite/Makefile.in: Regenerate.
2984 * gold/testsuite/justsyms_exec.c: New source file.
2985 * gold/testsuite/justsyms_lib.c: New source file.
2987 2011-08-01 Cary Coutant <ccoutant@google.com>
2989 * layout.cc (Layout::set_segment_offsets): Don't realign text
2990 segment if -Ttext was specified.
2991 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
2993 * object.h (Sized_relobj_file::e_type): New function.
2994 (Sized_relobj_file::e_type_): New data member.
2995 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
2996 base address for ET_EXEC files.
2997 * target.cc (Target::do_make_elf_object_implementation): Allow
2998 ET_EXEC files with --just-symbols option.
3000 2011-07-28 Cary Coutant <ccoutant@google.com>
3002 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
3003 Add thread_number parameter.
3004 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
3005 * workqueue-threads.cc
3006 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
3007 current thread if its thread number is greater than desired thread
3009 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
3010 Add thread_number parameter.
3011 (Workqueue::should_cancel_thread): Likewise.
3012 (Workqueue::find_runnable_or_wait): Pass thread_number to
3013 should_cancel_thread.
3014 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
3017 2011-07-22 Sriraman Tallam <tmsriram@google.com>
3019 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
3020 only after checking if it cannot be forced local.
3021 * symtab.h (is_externally_visible): Check if the symbol is not forced
3024 2011-07-15 Ian Lance Taylor <iant@google.com>
3026 * options.h (class General_options): Add --print-output-format.
3027 Move -EL next to -EB, for better --help output.
3028 * target-select.cc: Include <cstdio>, "options.h", and
3030 (Target_selector::do_target_bfd_name): New function.
3031 (print_output_format): New function.
3032 * target-select.h (class Target_selector): Update declarations.
3033 (Target_selector::target_bfd_name): New function.
3034 (print_output_format): Declare.
3035 * main.cc: Include "target-select.h".
3036 (main): Handle --print-output-format.
3037 * gold.cc: Include "target-select.h".
3038 (queue_initial_tasks): Handle --print-output-format when there are
3040 * parameters.cc (parameters_force_valid_target): Give a better
3041 error message if -EB/-EL does not match target.
3042 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
3045 2011-07-15 Ian Lance Taylor <iant@google.com>
3047 * i386.cc (class Output_data_plt_i386): Add layout_ field.
3048 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
3049 (Output_data_plt_i386::do_write): Write address of .dynamic
3050 section to first entry in .got.plt section.
3051 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
3052 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3054 (Output_data_plt_x86_64::do_write): Write address of .dynamic
3055 section to first entry in .got.plt section.
3056 * layout.h (Layout::dynamic_section): New function.
3058 2011-07-13 Sriraman Tallam <tmsriram@google.com>
3060 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
3062 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
3063 input_section_position_, and input_section_glob_.
3064 (read_layout_from_file): Call function section_ordering_specified.
3065 * layout.h (is_section_ordering_specified): New function.
3066 (section_ordering_specified): New function.
3067 (section_ordering_specified_): New boolean member.
3068 * main.cc(main): Call load_plugins after layout object is defined.
3069 * output.cc (Output_section::add_input_section): Use
3070 function section_ordering_specified to check if section ordering is
3072 * output.cc (Output_section::add_relaxed_input_section): Use
3073 function section_ordering_specified to check if section ordering is
3075 (Output_section::update_section_layout): New function.
3076 (Output_section::sort_attached_input_sections): Check if input section
3078 * output.h (Output_section::update_section_layout): New function.
3079 * plugin.cc (get_section_count): New function.
3080 (get_section_type): New function.
3081 (get_section_name): New function.
3082 (get_section_contents): New function.
3083 (update_section_order): New function.
3084 (allow_section_ordering): New function.
3085 (Plugin::load): Add the new interfaces to the transfer vector.
3086 (Plugin_manager::load_plugins): New parameter.
3087 (Plugin_manager::all_symbols_read): New parameter.
3088 (Plugin_manager::claim_file): New parameter. Save the elf object for
3090 (Plugin_manager::get_elf_object): New function.
3091 (Plugin_manager::get_view): Change to directly use the bool to check
3092 if get_view is called from claim_file_hook.
3093 * plugin.h (input_objects): New function
3094 (Plugin__manager::load_plugins): New parameter.
3095 (Plugin_manager::claim_file): New parameter.
3096 (Plugin_manager::get_elf_object): New function.
3097 (Plugin_manager::in_claim_file_handler): New function.
3098 (Plugin_manager::in_claim_file_handler_): New member.
3099 (layout): New function.
3100 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
3101 handler with an extra parameter. Make the elf object before calling
3103 * testsuite/plugin_test.c (get_section_count): New function pointer.
3104 (get_section_type): New function pointer.
3105 (get_section_name): New function pointer.
3106 (get_section_contents): New function pointer.
3107 (update_section_order): New function pointer.
3108 (allow_section_ordering): New function pointer.
3109 (onload): Check if the new interfaces exist.
3111 2011-07-13 Ian Lance Taylor <iant@google.com>
3113 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
3115 * x86_64.cc (Target_x86_64::got_section): Likewise.
3116 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
3117 (relro_now_test_SOURCES): New variable.
3118 (relro_now_test_DEPENDENCIES): New variable.
3119 (relro_now_test_LDFLAGS): New variable.
3120 (relro_now_test_LDADD): New variable.
3121 (relro_now_test.so): New target.
3122 * testsuite/Makefile.in: Rebuild.
3124 2011-07-12 Ian Lance Taylor <iant@google.com>
3127 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
3128 GLOB_DAT relocation rather than a RELATIVE relocation for a
3129 protected symbol when creating a shared library.
3130 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3131 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
3132 * testsuite/protected_main_1.cc (main): Test that protected
3133 function has same address.
3135 2011-07-11 Ian Lance Taylor <iant@google.com>
3138 * options.h (class General_options): Add -Bgroup.
3139 * options.cc (General_options::finalize): If -Bgroup is set,
3140 default to --unresolved-symbols=report-all.
3141 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
3142 * target-reloc.h (issue_undefined_symbol_error): Handle
3143 --unresolved-symbols=report-all.
3145 2011-07-08 Ian Lance Taylor <iant@google.com>
3148 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
3149 if linker script discards key sections.
3150 (Layout::create_dynamic_symtab): Likewise.
3151 (Layout::assign_local_dynsym_offsets): Likewise.
3152 (Layout::sized_create_version_sections): Likewise.
3153 (Layout::create_interp): Likewise.
3154 (Layout::finish_dynamic_section): Likewise.
3155 (Layout::set_dynamic_symbol_size): Likewise.
3157 2011-07-08 Ian Lance Taylor <iant@google.com>
3160 * options.h (class General_options): Add --unresolved-symbols.
3161 * target-reloc.h (issue_undefined_symbol_error): Check
3162 --unresolved-symbols. Add comments.
3164 2011-07-08 Ian Lance Taylor <iant@google.com>
3166 * testsuite/odr_violation2.cc (Ordering::operator()): Make
3167 expression more complex.
3169 2011-07-08 Ian Lance Taylor <iant@google.com>
3172 * target-reloc.h (issue_undefined_symbol_error): New inline
3173 function, broken out of relocate_section.
3174 (relocate_section): Call issue_undefined_symbol_error.
3175 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3176 there is no TLS segment if we are about to issue an undefined
3178 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3180 2011-07-08 Ian Lance Taylor <iant@google.com>
3183 * resolve.cc (Symbol_table::should_override): Add fromtype
3184 parameter. Change all callers. Give error when linking together
3185 TLS and non-TLS symbol.
3186 (Symbol_table::should_override_with_special): Add fromtype
3187 parameter. Change all callers.
3188 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3189 there is no TLS segment if we have reported some errors.
3190 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3192 2011-07-08 Ian Lance Taylor <iant@google.com>
3195 * target.h (Target::plt_address_for_global): New function.
3196 (Target::plt_address_for_local): New function.
3197 (Target::plt_section_for_global): Remove.
3198 (Target::plt_section_for_local): Remove.
3199 (Target::do_plt_address_for_global): New virtual function.
3200 (Target::do_plt_address_for_local): New virtual function.
3201 (Target::do_plt_section_for_global): Remove.
3202 (Target::do_plt_section_for_local): Remove.
3203 (Target::register_global_plt_entry): Add Symbol_table and Layout
3205 * output.cc (Output_data_got::Got_entry::write): Use
3206 plt_address_for_global and plt_address_for_local.
3207 * layout.cc (Layout::add_target_dynamic_tags): Use size and
3208 address of output section.
3209 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
3210 got_irelative_, and irelative_count_ fields. Update
3212 (Output_data_plt_i386::has_irelative_section): New function.
3213 (Output_data_plt_i386::entry_count): Add irelative_count_.
3214 (Output_data_plt_i386::set_final_data_size): Likewise.
3215 (class Target_i386): Add got_irelative_ and rel_irelative_
3216 fields. Update declarations.
3217 (Target_i386::Target_i386): Initialize new fields.
3218 (Target_i386::do_plt_address_for_global): New function replacing
3219 do_plt_section_for_global.
3220 (Target_i386::do_plt_address_for_local): New function replacing
3221 do_plt_section_for_local.
3222 (Target_i386::got_section): Create got_irelative_.
3223 (Target_i386::rel_irelative_section): New function.
3224 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
3225 fields. Don't define __rel_iplt_{start,end}.
3226 (Output_data_plt_i386::add_entry): Add symtab and layout
3227 parameters. Change all callers. Use different PLT and GOT for
3229 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
3230 layout parameters. Change all callers. Use different PLT and
3232 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
3233 (Output_data_plt_i386::rel_irelative): New function.
3234 (Output_data_plt_i386::address_for_global): New function.
3235 (Output_data_plt_i386::address_for_local): New function.
3236 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
3237 IRELATIVE GOT when changing IFUNC GOT entries.
3238 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
3240 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
3241 if we didn't create an IRELATIVE GOT.
3242 (Target_i386::Relocate::relocate): Use plt_address_for_global and
3243 plt_address_for_local.
3244 (Target_i386::do_dynsym_value): Use plt_address_for_global.
3245 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
3246 got_irelative_, and irelative_count_ fields. Update
3248 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3249 Initialize new fields. Remove symtab parameter. Change all
3251 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
3253 (Output_data_plt_x86_64::has_irelative_section): New function.
3254 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
3255 (class Target_x86_64): Add got_irelative_ and rel_irelative_
3256 fields. Update declarations.
3257 (Target_x86_64::Target_x86_64): Initialize new fields.
3258 (Target_x86_64::do_plt_address_for_global): New function replacing
3259 do_plt_section_for_global.
3260 (Target_x86_64::do_plt_address_for_local): New function replacing
3261 do_plt_section_for_local.
3262 (Target_x86_64::got_section): Create got_irelative_.
3263 (Target_x86_64::rela_irelative_section): New function.
3264 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
3265 all callers. Don't create __rel_iplt_{start,end}.
3266 (Output_data_plt_x86_64::add_entry): Add symtab and layout
3267 parameters. Change all callers. Use different PLT and GOT for
3269 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
3270 layout parameters. Change all callers. Use different PLT and
3272 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
3273 parameters. Change all callers. Use different PLT and GOT for
3275 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
3276 (Output_data_plt_x86_64::rela_irelative): New function.
3277 (Output_data_plt_x86_64::address_for_global): New function.
3278 (Output_data_plt_x86_64::address_for_local): New function.
3279 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3280 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
3281 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
3282 (Target_x86_64::register_global_plt_entry): Add symtab and layout
3284 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
3286 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
3287 symbols if we didn't create an IRELATIVE GOT.
3288 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
3289 plt_address_for_local.
3290 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
3291 * testsuite/ifuncvar1.c: New test file.
3292 * testsuite/ifuncvar2.c: New test file.
3293 * testsuite/ifuncvar3.c: New test file.
3294 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
3295 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
3296 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
3297 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
3298 * testsuite/Makefile.in: Rebuild.
3300 2011-07-07 Cary Coutant <ccoutant@google.com>
3302 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
3303 (two_file_test_1_ndebug.o): Likewise.
3304 (two_file_test_1b_ndebug.o): Likewise.
3305 (two_file_test_2_ndebug.o): Likewise.
3306 (two_file_test_main_ndebug.o): Likewise.
3307 (incremental_test_2): Link with no-debug versions.
3309 2011-07-06 Cary Coutant <ccoutant@google.com>
3311 * gold/incremental.cc
3312 (Output_section_incremental_inputs::write_info_blocks): Check for
3313 hidden and internal symbols.
3315 2011-07-06 Cary Coutant <ccoutant@google.com>
3317 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
3318 Check disposition for startup file.
3319 (Incremental_inputs::report_command_line): Ignore
3320 --incremental-startup-unchanged option.
3321 * options.cc (General_options::parse_incremental_startup_unchanged):
3323 (General_options::General_options): Initialize new data member.
3324 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
3325 (General_options): Add --incremental-startup-unchanged option.
3326 (General_options::incremental_startup_disposition): New function.
3327 (General_options::incremental_startup_disposition_): New data member.
3329 2011-07-06 Cary Coutant <ccoutant@google.com>
3331 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
3332 input file index to Script_info ctor.
3333 (Sized_incremental_binary::do_file_has_changed): Find the
3334 command-line argument for files named in scripts.
3335 * incremental.h (Script_info::Script_info): New ctor
3336 with input file index.
3337 (Script_info::input_file_index): New function.
3338 (Script_info::input_file_index_): New data member.
3339 (Incremental_binary::get_library): Add const.
3340 (Incremental_binary::get_script_info): Add const.
3341 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
3342 * testsuite/Makefile.am (incremental_test_5): New test case.
3343 (incremental_test_6): New test case.
3344 * testsuite/Makefile.in: Regenerate.
3346 2011-07-06 Cary Coutant <ccoutant@google.com>
3348 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
3349 debug output when command lines differ.
3351 2011-07-06 Cary Coutant <ccoutant@google.com>
3353 * incremental.cc (Incremental_inputs::report_command_line): Ignore
3354 --incremental-patch option.
3355 * layout.cc (Free_list::allocate): Extend allocation beyond original
3357 (Layout::make_output_section): Mark sections that should get
3359 * options.cc (parse_percent): New function.
3360 * options.h (parse_percent): New function.
3361 (DEFINE_percent): New macro.
3362 (General_options): Add --incremental-patch option.
3363 * output.cc (Output_section::Output_section): Initialize new data
3365 (Output_section::add_input_section): Print section name when out
3367 (Output_section::add_output_section_data): Likewise.
3368 (Output_section::set_final_data_size): Add patch space when
3369 doing --incremental-full.
3370 (Output_section::do_reset_address_and_file_offset): Remove patch
3372 (Output_segment::set_section_list_addresses): Print debug output
3373 only if --incremental-update.
3374 * output.h (Output_section::set_is_patch_space_allowed): New function.
3375 (Output_section::is_patch_space_allowed_): New data member.
3376 (Output_section::patch_space_): New data member.
3377 * parameters.cc (Parameters::incremental_full): New function.
3378 * parameters.h (Parameters::incremental_full): New function
3379 * testsuite/Makefile.am (incremental_test_2): Add test for
3380 --incremental-patch option.
3381 * testsuite/Makefile.in: Regenerate.
3382 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
3383 (t18): Remove function body.
3385 2011-07-05 Doug Kwan <dougkwan@google.com>
3388 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
3389 Arm_Address type for relocation result.
3390 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
3392 (Arm_relocate_functions::abs32): Use unaligned access.
3393 (Arm_relocate_functions::rel32): Ditto.
3394 (Arm_relocate_functions::prel31): Ditto.
3395 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
3396 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
3397 static data relocations.
3398 * testsuite/Makefile.in: Regnerate.
3399 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
3401 2011-07-05 Ian Lance Taylor <iant@google.com>
3404 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
3405 symbols if necessary.
3406 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3408 2011-07-05 Ian Lance Taylor <iant@google.com>
3411 * resolve.cc (Symbol::override_base_with_special): Simply override
3412 version with special symbol version, ignoring previous version.
3414 2011-07-05 Ian Lance Taylor <iant@google.com>
3416 * object.cc (Sized_relobj_file::include_section_group): Add
3417 information to comment about signature location.
3419 2011-07-02 Ian Lance Taylor <iant@google.com>
3422 * options.h (class General_options): Add -f and -F.
3423 * options.cc (General_options::finalize): Fatal error if -f/-F
3424 are used without -shared.
3425 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
3427 2011-07-02 Ian Lance Taylor <iant@google.com>
3429 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
3431 2011-07-01 Ian Lance Taylor <iant@google.com>
3435 * resolve.cc (Symbol::override_base_with_special): Don't override
3436 the version if the overriding symbol has a different name.
3437 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
3438 all callers. If we give an error about an undefined version,
3439 define the base version if necessary.
3440 * dynobj.h (class Versions): Update declaration.
3441 * testsuite/weak_alias_test_5.cc: New file.
3442 * testsuite/weak_alias_test.script: New file.
3443 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
3444 and versioned_alias have the right value, and call t2.
3445 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
3446 weak_alias_test_5.so.
3447 (weak_alias_test_LDADD): Likewise.
3448 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
3449 * testsuite/Makefile.in: Rebuild.
3451 2011-07-01 Ian Lance Taylor <iant@google.com>
3454 * options.h (class General_options): Support -z notext.
3455 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
3457 (two_file_shared_nonpic.so): Likewise.
3458 (two_file_shared_mixed.so): Likewise.
3459 (two_file_shared_mixed_1.so): Likewise.
3460 (weak_undef_lib_nonpic.so): Likewise.
3461 (alt/weak_undef_lib_nonpic.so): Likewise.
3462 (tls_test_shared_nonpic.so): Likewise.
3463 * testsuite/Makefile.in: Rebuild.
3465 2011-07-01 Ian Lance Taylor <iant@google.com>
3468 * configure.ac: Test whether static linking works, setting
3469 the automake conditional HAVE_STATIC.
3470 * testsuite/Makefile.am: Disable tests using -static if
3471 HAVE_STATIC is not true.
3472 * configure, testsuite/Makefile.in: Rebuild.
3474 2011-07-01 Ian Lance Taylor <iant@google.com>
3477 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
3478 Assert if we see DW_EH_PE_indirect.
3479 * target.h (Target::ehframe_datarel_base): New function.
3480 (Target::do_ehframe_datarel_base): New target function.
3481 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
3482 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
3485 2011-07-01 Ian Lance Taylor <iant@google.com>
3488 * options.h (class General_options): Add
3489 --ld-generated-unwind-info.
3490 * ehframe.cc (Fde::write): Add address parameter. Change all
3491 callers. If associated with PLT, fill in address and size.
3492 (Cie::set_output_offset): Only add merge mapping if there is an
3494 (Cie::write): Add address parameter. Change all callers.
3495 (Eh_frame::add_ehframe_for_plt): New function.
3496 * ehframe.h (class Fde): Update declarations. Move shndx_ and
3497 input_offset_ fields into union u_, with new plt field.
3498 (Fde::Fde): Adjust for new union field.
3499 (Fde::Fde) [Output_data version]: New constructor.
3500 (Fde::add_mapping): Only add merge mapping if there is an object.
3501 (class Cie): Update declarations.
3502 (class Eh_frame): Declare add_ehframe_for_plt.
3503 * layout.cc (Layout::layout_eh_frame): Break out code into
3504 make_eh_frame_section, and call it.
3505 (Layout::make_eh_frame_section): New function.
3506 (Layout::add_eh_frame_for_plt): New function.
3507 * layout.h (class Layout): Update declarations.
3508 * merge.cc (Merge_map::add_mapping): Add assertion.
3509 * i386.cc: Include "dwarf.h".
3510 (class Output_data_plt_i386): Make first_plt_entry,
3511 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
3512 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3513 and plt_eh_frame_fde.
3514 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
3515 boundary. Call add_eh_frame_for_plt if appropriate.
3516 * x86_64.cc: Include "dwarf.h".
3517 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
3518 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
3519 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3520 and plt_eh_frame_fde.
3521 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
3524 2011-06-29 Ian Lance Taylor <iant@google.com>
3527 * object.cc (Sized_relobj_file::layout_section): Change shdr
3528 parameter to be const.
3529 (Sized_relobj_file::layout_eh_frame_section): New function, broken
3531 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
3532 appropriate. Call layout_eh_frame_section.
3533 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
3535 * object.h (class Sized_relobj_file): Update declarations.
3537 2011-06-29 Ian Lance Taylor <iant@google.com>
3540 * script.cc (Token::integer_value): Accept trailing M/m/K/k
3542 (Lex::gather_token): Accept trailing M/m/K/k for integers.
3544 2011-06-29 Ian Lance Taylor <iant@google.com>
3547 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
3549 * layout.cc (Layout::layout_eh_frame): Likewise.
3551 2011-06-29 Ian Lance Taylor <iant@google.com>
3554 * layout.cc (Layout::symtab_section_shndx): New function.
3555 * layout.h (class Layout): Declare symtab_section_shndx.
3556 * output.cc (Output_section::write_header): Call it.
3558 2011-06-29 Ian Lance Taylor <iant@google.com>
3561 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
3562 symbols which are not used in a relocation.
3564 2011-06-28 Ian Lance Taylor <iant@google.com>
3567 * layout.cc (Layout::segment_precedes): Don't crash if a linker
3568 script create indistinguishable segments.
3569 (Layout::set_segment_offsets): Use stable_sort when sorting
3570 segments. Pass this to Compare_segments constructor.
3571 * layout.h (class Layout): Make segment_precedes non-static.
3572 (class Compare_segments): Change from struct to class. Add
3573 layout_ field. Add constructor.
3574 * script-sections.cc
3575 (Script_sections::attach_sections_using_phdrs_clause): Rename
3576 local orphan to is_orphan. Don't report failure to put empty
3577 section in segment. On attachment failure, report name of
3578 section, and attach to first PT_LOAD segment.
3580 2011-06-28 Ian Lance Taylor <iant@google.com>
3583 * target-select.cc (Target_selector::Target_selector): Add
3584 emulation parameter. Change all callers.
3585 (select_target_by_bfd_name): Rename from select_target_by_name.
3587 (select_target_by_emulation): New function.
3588 (supported_emulation_names): New function.
3589 * target-select.h (class Target_selector): Add emulation_ field.
3590 Update declarations.
3591 (Target_selector::recognize_by_bfd_name): Rename from
3592 recognize_by_name. Change all callers.
3593 (Target_selector::supported_bfd_names): Rename from
3594 supported_names. Change all callers.
3595 (Target_selector::recognize_by_emulation): New function.
3596 (Target_selector::supported_emulations): New function.
3597 (Target_selector::emulation): New function.
3598 (Target_selector::do_recognize_by_bfd_name): Rename from
3599 do_recognize_by_name. Change all callers.
3600 (Target_selector::do_supported_bfd_names): Rename from
3601 do_supported_names. Change all callers.
3602 (Target_selector::do_recognize_by_emulation): New function.
3603 (Target_selector::do_supported_emulations): New function.
3604 (select_target_by_bfd_name): Change name in declaration.
3605 (select_target_by_emulation): Declare.
3606 (supported_emulation_names): Declare.
3607 * parameters.cc (parameters_force_valid_target): Try to find
3608 target based on emulation from -m option.
3609 * options.h (class General_options): Change doc string for -m.
3610 * options.cc (help): Print emulations.
3611 (General_options::parse_V): Likewise.
3612 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
3613 Add emulation parameter. Change all callers.
3615 2011-06-28 Ian Lance Taylor <iant@google.com>
3617 * target.h (class Target): Add osabi_ field.
3618 (Target::osabi): New function.
3619 (Target::set_osabi): New function.
3620 (Target::Target): Initialize osabi_.
3621 (Target::do_adjust_elf_header): Make pure virtual.
3622 (Sized_target::do_adjust_elf_header): Declare.
3623 * target.cc (Sized_target::do_adjust_elf_header): New function.
3624 (class Sized_target): Instantiate all versions.
3625 * freebsd.h (class Target_freebsd): Remove.
3626 (Target_selector_freebsd::do_recognize): Call set_osabi on
3628 (Target_selector_freebsd::do_recognize_by_name): Likewise.
3629 (Target_selector_freebsd::set_osabi): Remove.
3630 * i386.cc (class Target_i386): Inherit from Sized_target rather
3631 than Target_freebsd.
3632 * x86_64.cc (class Target_x86_64): Likewise.
3634 2011-06-28 Ian Lance Taylor <iant@google.com>
3636 * target.h (Target::can_check_for_function_pointers): Rewrite.
3638 (Target::can_icf_inline_merge_sections): Likewise.
3639 (Target::section_may_have_icf_unsafe_poineters): Likewise.
3640 (Target::Target_info): Add can_icf_inline_merge_sections field.
3641 (Target::do_can_check_for_function_pointers): New virtual
3643 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
3644 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
3645 from can_check_for_function_pointers, move in file.
3646 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
3647 section_may_have_icf_unsafe_poineters, move in file.
3648 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
3649 * i386.cc (Target_i386::do_can_check_for_function_pointers):
3650 Rename from can_check_for_function_pointers, move in file.
3651 (Target_i386::can_icf_inline_merge_sections): Remove.
3652 (Target_i386::i386_info): Initialize
3653 can_icf_inline_merge_sections.
3654 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
3655 Initialize can_icf_inline_merge_sections.
3656 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
3657 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
3658 Rename from can_check_for_function_pointers, move in file.
3659 (Target_x86_64::can_icf_inline_merge_sections): Remove.
3660 (Target_x86_64::x86_64_info): Initialize
3661 can_icf_inline_merge_sections.
3662 * testsuite/testfile.cc (Target_test::test_target_info):
3664 * icf.cc (get_section_contents): Correct formatting.
3666 2011-06-27 Ian Lance Taylor <iant@google.com>
3668 * symtab.cc (Symbol::versioned_name): New function.
3669 (Symbol_table::add_to_final_symtab): Use versioned_name when
3671 (Symbol_table::sized_write_symbol): Likewise.
3672 * symtab.h (class Symbol): Declare versioned_name.
3673 * stringpool.h (class Stringpool_template): Add variant of add
3674 which takes a std::basic_string.
3675 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
3676 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
3677 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
3678 (ver_test_12.o): New target.
3679 * testsuite/Makefile.in: Rebuild.
3681 2011-06-27 Doug Kwan <dougkwan@google.com>
3683 * arm.cc (Arm_relocate_functions::thm_jump8,
3684 Arm_relocate_functions::thm_jump11): Use a wider signed
3685 type to compute offset.
3686 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
3688 * testsuite/Makefile.in: Regenerate.
3689 * testsuite/arm_branch_in_range.sh: Check test results of
3690 arm_thm_jump11 and arm_thm_jump8.
3691 * testsuite/arm_thm_jump11.s: New test source file.
3692 * testsuite/arm_thm_jump11.t: New linker script.
3693 * testsuite/arm_thm_jump8.s: New test source file.
3694 * testsuite/arm_thm_jump8.t: New linker script.
3696 2011-06-24 Ian Lance Taylor <iant@google.com>
3698 * layout.cc: Include "object.h".
3699 (ctors_sections_in_init_array): New static variable.
3700 (Layout::is_ctors_in_init_array): New function.
3701 (Layout::layout): Add entry to ctors_sections_in_init_array if
3703 * layout.h (class Layout): Declare is_ctors_in_init_array.
3704 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
3705 is_ctors_reverse_view is set.
3706 (Sized_relobj_file::write_sections): Add layout parameter. Change
3707 all callers. Set is_ctors_reverse_view field of View_size.
3708 (Sized_relobj_file::reverse_words): New function.
3709 * object.h (Sized_relobj_file::View_size): Add
3710 is_ctors_reverse_view field.
3711 (class Sized_relobj_file): Update declarations.
3712 * testsuite/initpri3.c: New test.
3713 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
3715 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
3716 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
3717 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
3718 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
3719 * testsuite/Makefile.in: Rebuild.
3721 2011-06-24 Cary Coutant <ccoutant@google.com>
3723 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
3724 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
3725 (debug_msg_cdebug.err): New targets.
3726 * testsuite/Makefile.in: Regenerate.
3727 * testsuite/debug_msg.sh: Check output of link with compressed debug.
3728 Fix checks for link with shared library.
3730 2011-06-24 Doug Kwan <dougkwan@google.com>
3732 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
3733 skip empty text sections.
3734 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
3736 2011-06-22 Ian Lance Taylor <iant@google.com>
3739 * options.h (class General_options): Add --ctors-in-init-array.
3740 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
3741 friends as SHT_PROGBITS for merging sections.
3742 (Layout::layout): Remove special handling of .init_array and
3743 friends. Don't sort if doing relocatable link. Sort for .ctors
3744 and .dtors if ctors_in_init_array.
3745 (Layout::make_output_section): Force correct section types for
3746 .init_array and friends. Don't sort if doing relocatable link,
3747 Don't sort .ctors and .dtors if ctors_in_init_array.
3748 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
3749 (Layout::output_section_name): Add relobj parameter. Change all
3750 callers. Handle .ctors. and .dtors. in code rather than table.
3751 Handle .ctors and .dtors if ctors_in_init_array.
3752 (Layout::match_file_name): New function, moved from output.cc.
3753 * layout.h (class Layout): Update declarations.
3754 * output.cc: Include "layout.h".
3755 (Input_section_sort_entry::get_priority): New function.
3756 (Input_section_sort_entry::match_file_name): Just call
3757 Layout::match_file_name.
3758 (Output_section::Input_section_sort_init_fini_compare::operator()):
3759 Handle .ctors and .dtors. Sort by explicit priority rather than
3761 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
3762 * testsuite/initpri2.c: New test.
3763 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
3764 (check_PROGRAMS): Add initpri2.
3765 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
3766 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
3767 * configure, testsuite/Makefile.in: Rebuild.
3769 2011-06-19 Ian Lance Taylor <iant@google.com>
3772 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
3773 .interp section to a PT_INTERP segment even if we have seen a
3774 --dynamic-linker option. Don't do it if we have seen a PHDRS
3775 clause in a linker script.
3776 (Layout::finalize): Don't create a .interp section if we've
3777 already create a PT_INTERP segment.
3778 (Layout::create_interp): Always call choose_output_section (revert
3779 patch of 2011-06-17). Don't create PT_INTERP segment.
3780 * script-sections.cc
3781 (Script_sections::create_note_and_tls_segments): Add a .interp
3782 section to a PT_INTERP segment even if we have seen a
3783 --dynamic-linker option.
3785 2011-06-18 Ian Lance Taylor <iant@google.com>
3787 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
3788 merely because a non-PT_LOAD segment has a dynamic reloc.
3790 2011-06-18 Ian Lance Taylor <iant@google.com>
3792 * layout.cc (Layout::finish_dynamic_section): Don't create
3793 DT_FLAGS entry if not needed.
3795 2011-06-18 Ian Lance Taylor <iant@google.com>
3798 * layout.cc (Layout::layout_eh_frame): Correct handling of
3799 writable .eh_frame section.
3801 2011-06-17 Ian Lance Taylor <iant@google.com>
3804 * resolve.cc (Symbol_table::resolve): Don't give an error if a
3805 symbol is redefined with the exact same object and value.
3807 2011-06-17 Ian Lance Taylor <iant@google.com>
3810 * layout.h (class Layout): Add interp_segment_ field.
3811 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
3812 (Layout::attach_allocated_section_to_segment): If making shared
3813 library, put .interp section in PT_INTERP segment.
3814 (Layout::finalize): Also call create_interp if -dynamic-linker
3816 (Layout::create_interp): Assert that there is no PT_INTERP
3817 segment. If not using a SECTIONS clause, use make_output_section.
3818 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
3819 * script-sections.cc
3820 (Script_sections::create_note_and_tls_segments): If making shared
3821 library, put .interp section in PT_INTERP segment.
3823 2011-06-17 Ian Lance Taylor <iant@google.com>
3825 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
3826 when making a shared library.
3828 2011-06-17 Ian Lance Taylor <iant@google.com>
3830 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
3831 parameter. Change all callers. Don't issue warning about PC32
3832 against locally defined symbol.
3834 2011-06-16 Ian Lance Taylor <iant@google.com>
3836 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
3837 occurs in same object.
3839 2011-06-14 Alan Modra <amodra@gmail.com>
3841 * po/POTFILES.in: Regenerate.
3843 2011-06-09 Ian Lance Taylor <iant@google.com>
3845 * script-sections.cc
3846 (Orphan_output_section::set_section_addresses): For a relocatable
3847 link set address to 0.
3849 2011-06-09 Cary Coutant <ccoutant@google.com>
3852 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
3853 used with --compress-debug-sections.
3854 * gold/object.cc (Sized_relobj_file::do_layout): Report
3855 uncompressed size of compressed input sections.
3857 2011-06-08 Cary Coutant <ccoutant@google.com>
3860 * testsuite/two_file_test_2_v1.cc: Change initialization of
3861 v2 to keep it in .data.
3863 2011-06-07 Cary Coutant <ccoutant@google.com>
3865 * common.cc (Symbol_table::do_allocate_commons_list): Call
3867 * errors.cc (Errors::fatal): Adjust call to gold_exit.
3868 (Errors::fallback): New function.
3869 (gold_fallback): New function.
3870 * errors.h (Errors::fallback): New function.
3871 * gold.cc (gold_exit): Change status parameter to enum; adjust
3873 (queue_initial_tasks): Call gold_fallback.
3874 * gold.h: Include cstdlib.
3875 (Exit_status): New enum type.
3876 (gold_exit): Change status parameter to enum.
3877 (gold_fallback): New function.
3878 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
3879 (Layout::create_symtab_sections): Likewise.
3880 (Layout::create_shdrs): Likewise.
3881 * main.cc (main): Adjust call to gold_exit.
3882 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
3883 (Output_data_got::add_got_entry_pair): Likewise.
3884 (Output_section::add_input_section): Likewise.
3885 (Output_section::add_output_section_data): Likewise.
3886 (Output_segment::set_section_list_addresses): Likewise.
3887 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
3889 2011-06-07 Cary Coutant <ccoutant@google.com>
3891 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
3892 for incremental links.
3893 * output.cc (Output_segment::set_section_list_addresses): Remove
3894 FIXME and test for TLS or BSS.
3896 2011-06-07 Cary Coutant <ccoutant@google.com>
3898 * testsuite/Makefile.am: Add incremental_copy_test,
3899 incremental_common_test_1.
3900 * testsuite/Makefile.in: Regenerate.
3901 * testsuite/common_test_1_v1.c: New source file.
3902 * testsuite/common_test_1_v2.c: New source file.
3903 * testsuite/copy_test_v1.cc: New source file.
3905 2011-06-07 Cary Coutant <ccoutant@google.com>
3907 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
3908 update, allocate common from bss section's free list.
3909 * incremental-dump.cc (dump_incremental_inputs): Print flag for
3910 linker-defined symbols.
3911 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3912 Skip GOT and PLT entries that are no longer referenced.
3913 (Output_section_incremental_inputs::write_info_blocks): Mark
3914 linker-defined symbols.
3915 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
3916 * output.cc (Output_section::allocate): New function.
3917 * output.h (Output_section::allocate): New function.
3918 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
3919 linker-defined symbols.
3920 (Symbol::override_base_with_special): Copy is_predefined_ flag.
3921 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
3922 (Symbol::init_base_output_data): Likewise.
3923 (Symbol::init_base_output_segment): Likewise.
3924 (Symbol::init_base_constant): Likewise.
3925 (Sized_symbol::init_output_data): Likewise.
3926 (Sized_symbol::init_output_segment): Likewise.
3927 (Sized_symbol::init_constant): Likewise.
3928 (Symbol_table::do_define_in_output_data): Likewise.
3929 (Symbol_table::do_define_in_output_segment): Likewise.
3930 (Symbol_table::do_define_as_constant): Likewise.
3931 * symtab.h (Symbol::is_predefined): New function.
3932 (Symbol::init_base_output_data): Add is_predefined parameter.
3933 (Symbol::init_base_output_segment): Likewise.
3934 (Symbol::init_base_constant): Likewise.
3935 (Symbol::is_predefined_): New data member.
3936 (Sized_symbol::init_output_data): Add is_predefined parameter.
3937 (Sized_symbol::init_output_segment): Likewise.
3938 (Sized_symbol::init_constant): Likewise.
3939 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
3941 2011-06-07 Cary Coutant <ccoutant@google.com>
3943 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
3944 instead of emit_copy_reloc.
3945 (Copy_relocs::emit_copy_reloc): Refactor.
3946 (Copy_relocs::make_copy_reloc): New function.
3947 (Copy_relocs::add_copy_reloc): Remove.
3948 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
3950 (Copy_relocs::make_copy_reloc): New function.
3951 (Copy_relocs::add_copy_reloc): Remove.
3952 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
3953 unchanged input files.
3954 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
3955 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
3956 Reserve BSS space for COPY relocations.
3957 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3958 (Output_section_incremental_inputs::write_info_blocks): Record
3959 whether a symbol is copied from a shared object.
3960 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
3961 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
3962 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
3963 (Incremental_input_entry_reader::get_output_symbol_index): Add
3965 (Incremental_binary::emit_copy_relocs): New function.
3966 (Incremental_binary::do_emit_copy_relocs): New function.
3967 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3969 (Sized_incremental_binary::add_copy_reloc): New function.
3970 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3971 (Sized_incremental_binary::Copy_reloc): New struct.
3972 (Sized_incremental_binary::Copy_relocs): New typedef.
3973 (Sized_incremental_binary::copy_relocs_): New data member.
3974 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
3975 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
3976 * target.h (Sized_target::emit_copy_reloc): New function.
3977 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
3979 2011-06-02 Cary Coutant <ccoutant@google.com>
3982 * gold/archive.cc (Archive::Archive): Initialize new data member.
3983 (Archive::include_all_members): Return if archive has already been
3985 * gold/archive.h (Archive::include_all_members_): New data member.
3987 2011-06-02 Nick Clifton <nickc@redhat.com>
3989 * dynobj.h: Fix spelling mistake in comment.
3990 * output.cc: Likewise.
3992 2011-05-31 Doug Kwan <dougkwan@google.com>
3996 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
3997 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
3998 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
3999 redundant arm_exidx_test.so.
4000 * testsuite/Makefile.in: Regenerate.
4001 (check_SCRIPTS): Add pr12826.sh
4002 (check_DATA): Add pr12826.stdout
4003 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
4004 * testsuite/pr12826.sh: New file.
4005 * testsuite/pr12826_1.s: Ditto.
4006 * testsuite/pr12826_1.s: Ditto.
4008 2011-05-30 Ian Lance Taylor <iant@google.com>
4010 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
4013 2011-05-29 Ian Lance Taylor <iant@google.com>
4016 * testsuite/Makefile.am: Use different file name for two_file_test
4017 temporary file for each incremental test.
4018 * testsuite/Makefile.in: Rebuild.
4020 2011-05-29 Ian Lance Taylor <iant@google.com>
4022 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
4023 binary input file is empty.
4025 2011-05-27 Ian Lance Taylor <iant@google.com>
4027 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
4028 (ver_test_9.so): Likewise.
4029 * testsuite/Makefile.in: Rebuild.
4031 2011-05-26 Cary Coutant <ccoutant@google.com>
4033 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
4034 * incremental.cc (Incremental_inputs::report_input_section): Fix
4035 comment, indentation.
4036 (Incremental_inputs::report_comdat_group): New function.
4037 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4038 of data for incremental input file entry.
4039 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
4040 group count, COMDAT group signatures.
4041 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
4042 an unchanged input file.
4043 * incremental.h (Incremental_object_entry::Incremental_object_entry):
4044 Initialize new data member.
4045 (Incremental_object_entry::add_comdat_group): New function.
4046 (Incremental_object_entry::get_comdat_group_count): New function.
4047 (Incremental_object_entry::get_comdat_signature_key): New function.
4048 (Incremental_object_entry::groups_): New data member.
4049 (Incremental_inputs::report_comdat_group): New function.
4050 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
4051 data for incremental input file entry.
4052 (Incremental_input_entry_reader::get_comdat_group_count): New function.
4053 (Incremental_input_entry_reader::get_input_section): Adjust size of
4054 data for incremental input file entry.
4055 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
4056 (Incremental_input_entry_reader::get_comdat_group_signature): New
4058 * object.cc (Sized_relobj::include_section_group): Report kept
4059 COMDAT groups for incremental links.
4061 2011-05-24 David Meyer <pdox@google.com>
4063 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
4064 with name parameter. Add found_name parameter.
4065 * fileread.cc (Input_file::find_file): Adjust code accordingly.
4066 * dirsearch.h (class Dirsearch): Update declaration.
4068 2011-05-24 Ian Lance Taylor <iant@google.com>
4070 * archive.cc (Library_base::should_include_member): Pull in object
4071 from archive if it defines the entry symbol.
4072 * parameters.cc (Parameters::entry): New function.
4073 * parameters.h (class Parameters): Declare entry.
4074 * output.h (class Output_file_header): Remove entry_ field.
4075 * output.cc (Output_file_header::Output_file_header): Remove entry
4076 parameter. Change all callers.
4077 (Output_file_header::entry): Use parameters->entry.
4078 * gold.cc (queue_middle_tasks): Likewise.
4079 * plugin.cc (Plugin_hook::run): Likewise.
4081 2011-05-24 Cary Coutant <ccoutant@google.com>
4083 * gold.cc (queue_initial_tasks): Pass incremental base filename
4084 to Output_file::open_base_file; don't print error message.
4085 * incremental-dump.cc (main): Adjust call to
4086 Output_file::open_for_modification.
4087 * incremental-dump.cc (main): Likewise.
4088 * incremental.cc (Incremental_inputs::report_command_line):
4089 Ignore --incremental-base option when comparing command lines.
4090 Ignore parameter when given as separate argument.
4091 * options.h (class General_options): Add --incremental-base.
4092 * output.cc (Output_file::Output_file):
4093 (Output_file::open_base_file): Add base_name and writable parameters;
4094 read base file into new file; print error message here.
4095 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4097 * output.h (Output_file::open_for_modification): Rename to...
4098 (Output_file::open_base_file): ...this; add base_name and
4099 writable parameters; adjust all callers.
4100 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4102 * testsuite/Makefile.am (incremental_test_4): Test
4104 * testsuite/Makefile.in: Regenerate.
4106 2011-05-24 Cary Coutant <ccoutant@google.com>
4108 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
4110 * testsuite/Makefile.in: Regenerate.
4111 * testsuite/two_file_test_1_v1.cc: New test source file.
4112 * testsuite/two_file_test_1b_v1.cc: New test source file.
4113 * testsuite/two_file_test_2_v1.cc: New test source file.
4115 2011-05-24 Cary Coutant <ccoutant@google.com>
4117 * dynobj.h (Dynobj::do_dynobj): New function.
4118 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
4119 flag and soname for shared objects.
4120 * incremental.cc (Incremental_inputs::report_object): Make
4121 either Incremental_object_entry or Incremental_dynobj_entry; add
4122 soname to string table.
4123 (Incremental_inputs::report_input_section): Add assertion.
4124 (Output_section_incremental_inputs::set_final_data_size): Adjust
4125 type of input file entry for shared libraries; adjust size of
4126 shared library info entry.
4127 (Output_section_incremental_inputs::write_input_files): Write
4128 as_needed flag for shared libraries.
4129 (Output_section_incremental_inputs::write_info_blocks): Adjust type
4130 of input file entry for shared libraries; write soname.
4131 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
4132 soname from incremental info.
4133 * incremental.h (enum Incremental_input_flags): Add
4134 INCREMENTAL_INPUT_AS_NEEDED.
4135 (Incremental_input_entry::Incremental_input_entry): Initialize new
4137 (Incremental_input_entry::set_as_needed): New function.
4138 (Incremental_input_entry::as_needed): New function.
4139 (Incremental_input_entry::do_dynobj_entry): New function.
4140 (Incremental_input_entry::as_needed_): New data member.
4141 (Incremental_object_entry::Incremental_object_entry): Don't check
4143 (Incremental_object_entry::do_type): Likewise.
4144 (class Incremental_dynobj_entry): New class.
4145 (Incremental_input_entry_reader::as_needed): New function.
4146 (Incremental_input_entry_reader::get_soname): New function.
4147 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
4148 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
4149 size of shared library info entry.
4150 * layout.cc (Layout::finish_dynamic_section): Don't test for
4151 incremental link when adding DT_NEEDED entries.
4152 * object.h (Object::Object): Initialize new data member.
4153 (Object::dynobj): New function.
4154 (Object::set_as_needed): New function.
4155 (Object::as_needed): New function.
4156 (Object::do_dynobj): New function.
4157 (Object::as_needed_): New data member.
4159 2011-05-24 Cary Coutant <ccoutant@google.com>
4161 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
4162 info; adjust display of GOT entries.
4163 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4164 vector of input objects; remove file_status_.
4165 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
4166 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
4167 got_plt reader; call target hooks to reserve GOT entries.
4168 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4169 of input file info header and GOT info entry.
4170 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
4172 (Got_plt_view_info::got_descriptor): Remove.
4173 (Got_plt_view_info::sym_index): New data member.
4174 (Got_plt_view_info::input_index): New data member.
4175 (Local_got_offset_visitor::visit): Write input file index.
4176 (Global_got_offset_visitor::visit): Write 0 for input file index.
4177 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
4178 with sym_index and input_index.
4179 (Output_section_incremental_inputs::write_got_plt): Adjust size of
4180 incremental info GOT entry; replace got_descriptor with input_index.
4181 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
4182 map from input file index to object.
4183 (Sized_relobj_incr::do_layout): Replace direct data member reference
4184 with accessor function.
4185 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
4186 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
4187 Adjust size of input file info header.
4188 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
4189 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
4190 (Incremental_input_entry_reader::get_input_section): Adjust size of
4191 input file info header.
4192 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
4193 of incremental info GOT entry.
4194 (Incremental_got_plt_reader::get_got_desc): Remove.
4195 (Incremental_got_plt_reader::get_got_symndx): New function.
4196 (Incremental_got_plt_reader::get_got_input_index): New function.
4197 (Sized_incremental_binary::Sized_incremental_binary): Remove
4198 file_status_; add input_objects_.
4199 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
4200 (Sized_incremental_binary::set_file_is_unchanged): Remove.
4201 (Sized_incremental_binary::file_is_unchanged): Remove.
4202 (Sized_incremental_binary::set_input_object): New function.
4203 (Sized_incremental_binary::input_object): New function.
4204 (Sized_incremental_binary::file_status_): Remove.
4205 (Sized_incremental_binary::input_objects_): New data member.
4206 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
4208 (Sized_relobj_incr::invalid_address): Move to base class.
4209 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
4211 (Sized_relobj_incr::do_output_section_offset): Likewise.
4212 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
4213 (Sized_relobj_incr::section_offsets_): Likewise.
4214 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
4216 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
4217 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
4218 with accessor function.
4219 (Sized_relobj_file::do_layout): Likewise.
4220 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
4221 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
4222 (Sized_relobj_file::compute_final_local_value): Replace refs to
4223 section_offsets_ with accessor function.
4224 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
4225 * object.h (Relobj::Relobj): Initialize new data members.
4226 (Relobj::add_dyn_reloc): New function.
4227 (Relobj::first_dyn_reloc): New function.
4228 (Relobj::dyn_reloc_count): New function.
4229 (Relobj::first_dyn_reloc_): New data member.
4230 (Relobj::dyn_reloc_count_): New data member.
4231 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
4233 (Sized_relobj::Address): New typedef.
4234 (Sized_relobj::invalid_address): Move here from child class.
4235 (Sized_relobj::Sized_relobj): Initialize new data members.
4236 (Sized_relobj::sized_relobj): New function.
4237 (Sized_relobj::is_output_section_offset_invalid): Move here from
4239 (Sized_relobj::get_output_section_offset): Likewise.
4240 (Sized_relobj::local_has_got_offset): Likewise.
4241 (Sized_relobj::local_got_offset): Likewise.
4242 (Sized_relobj::set_local_got_offset): Likewise.
4243 (Sized_relobj::do_for_all_local_got_entries): Likewise.
4244 (Sized_relobj::clear_got_offsets): New function.
4245 (Sized_relobj::section_offsets): Move here from child class.
4246 (Sized_relobj::do_output_section_offset): Likewise.
4247 (Sized_relobj::do_set_section_offset): Likewise.
4248 (Sized_relobj::Local_got_offsets): Likewise.
4249 (Sized_relobj::local_got_offsets_): Likewise.
4250 (Sized_relobj::section_offsets_): Likewise.
4251 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
4253 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
4255 (Sized_relobj_file::sized_relobj): New function
4256 (Sized_relobj_file::local_has_got_offset): Move to base class.
4257 (Sized_relobj_file::local_got_offset): Likewise.
4258 (Sized_relobj_file::set_local_got_offset): Likewise.
4259 (Sized_relobj_file::get_output_section_offset): Likewise.
4260 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
4261 (Sized_relobj_file::do_output_section_offset): Likewise.
4262 (Sized_relobj_file::do_set_section_offset): Likewise.
4263 (Sized_relobj_file::Local_got_offsets): Likewise.
4264 (Sized_relobj_file::local_got_offsets_): Likewise.
4265 (Sized_relobj_file::section_offsets_): Likewise.
4266 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
4268 (set_needs_dynsym_index): Convert relobj to derived class pointer.
4269 (Output_reloc::get_symbol_index): Likewise.
4270 (Output_reloc::local_section_offset): Likewise.
4271 (Output_reloc::get_address): Likewise.
4272 (Output_reloc::symbol_value): Likewise.
4273 (Output_data_got::reserve_slot): Move to class definition.
4274 (Output_data_got::reserve_local): New function.
4275 (Output_data_got::reserve_slot_for_global): Remove.
4276 (Output_data_got::reserve_global): New function.
4277 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
4278 (all constructors, two instantiations).
4279 (Output_reloc::get_relobj): New function (two instantiations).
4280 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
4281 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
4282 (Output_data_reloc::add_global): Adjust type of relobj.
4283 (Output_data_reloc::add_global_relative): Likewise.
4284 (Output_data_reloc::add_symbolless_global_addend): Likewise.
4285 (Output_data_reloc::add_local): Likewise.
4286 (Output_data_reloc::add_local_relative): Likewise.
4287 (Output_data_reloc::add_symbolless_local_addend): Likewise.
4288 (Output_data_reloc::add_local_section): Likewise.
4289 (Output_data_reloc::add_output_section): Likewise.
4290 (Output_data_reloc::add_absolute): Likewise.
4291 (Output_data_reloc::add_target_specific): Likewise.
4292 (Output_data_got::reserve_slot): Move definition here.
4293 (Output_data_got::reserve_local): New function.
4294 (Output_data_got::reserve_global): New function.
4295 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
4296 section_offsets_ with accessor function.
4297 (Sized_relobj_file::write_sections): Likewise.
4298 (Sized_relobj_file::do_relocate_sections): Likewise.
4299 * target.h (Sized_target::reserve_local_got_entry): New function.
4300 (Sized_target::reserve_global_got_entry): New function.
4301 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
4302 (Target_x86_64::reserve_global_got_entry): New function.
4303 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
4305 2011-05-23 Cary Coutant <ccoutant@google.com>
4307 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
4308 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
4309 bit when checking got_type.
4310 * incremental.cc (Sized_incremental_binary::setup_readers):
4311 Store symbol table and string table locations; initialize bit vector
4312 of file status flags.
4313 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
4315 (Sized_incremental_binary::do_process_got_plt): New function.
4316 (Sized_incremental_binary::get_symtab_view): Use stored locations.
4317 (Output_section_incremental_inputs::set_final_data_size): Record
4318 file index for each input file.
4319 (Output_section_incremental_inputs::write_got_plt): Store file index
4320 instead of input entry offset for each GOT entry.
4322 (Incremental_input_entry::Incremental_input_entry): Initialize new
4324 (Incremental_input_entry::set_offset): Store file index.
4325 (Incremental_input_entry::get_file_index): New function.
4326 (Incremental_input_entry::file_index_): New data member.
4327 (Incremental_binary::process_got_plt): New function.
4328 (Incremental_binary::do_process_got_plt): New function.
4329 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4331 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
4332 (Sized_incremental_binary::set_file_is_unchanged): New function.
4333 (Sized_incremental_binary::file_is_unchanged): New function.
4334 (Sized_incremental_binary::do_process_got_plt): New function.
4335 (Sized_incremental_binary::file_status_): New data member.
4336 (Sized_incremental_binary::main_symtab_loc_): New data member.
4337 (Sized_incremental_binary::main_strtab_loc_): New data member.
4338 * output.cc (Output_data_got::Got_entry::write): Add case
4340 (Output_data_got::add_global): Call add_got_entry.
4341 (Output_data_got::add_global_plt): Likewise.
4342 (Output_data_got::add_global_with_rel): Likewise.
4343 (Output_data_got::add_global_with_rela): Likewise.
4344 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
4345 (Output_data_got::add_global_pair_with_rela): Likewise.
4346 (Output_data_got::add_local): Call add_got_entry.
4347 (Output_data_got::add_local_plt): Likewise.
4348 (Output_data_got::add_local_with_rel): Likewise.
4349 (Output_data_got::add_local_with_rela): Likewise.
4350 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
4351 (Output_data_got::add_local_pair_with_rela): Likewise.
4352 (Output_data_got::reserve_slot): New function.
4353 (Output_data_got::reserve_slot_for_global): New function.
4354 (Output_data_got::add_got_entry): New function.
4355 (Output_data_got::add_got_entry_pair): New function.
4356 (Output_section::add_output_section_data): Edit FIXME.
4358 (Output_section_data_build::Output_section_data_build): New
4359 constructor with size parameter.
4360 (Output_data_space::Output_data_space): Likewise.
4361 (Output_data_got::Output_data_got): Initialize new data member; new
4362 constructor with size parameter.
4363 (Output_data_got::add_constant): Call add_got_entry.
4364 (Output_data_got::reserve_slot): New function.
4365 (Output_data_got::reserve_slot_for_global): New function.
4366 (class Output_data_got::Got_entry): Add RESERVED_CODE.
4367 (Output_data_got::add_got_entry): New function.
4368 (Output_data_got::add_got_entry_pair): New function.
4369 (Output_data_got::free_list_): New data member.
4370 * target.h (Sized_target::init_got_plt_for_update): New function.
4371 (Sized_target::register_global_plt_entry): New function.
4372 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4373 Initialize new data member; call init; add constructor with PLT count.
4374 (Output_data_plt_x86_64::init): New function.
4375 (Output_data_plt_x86_64::add_relocation): New function.
4376 (Output_data_plt_x86_64::reserve_slot): New function.
4377 (Output_data_plt_x86_64::free_list_): New data member.
4378 (Target_x86_64::init_got_plt_for_update): New function.
4379 (Target_x86_64::register_global_plt_entry): New function.
4380 (Output_data_plt_x86_64::add_entry): Allocate from free list for
4381 incremental updates.
4382 (Output_data_plt_x86_64::add_relocation): New function.
4383 * testsuite/object_unittest.cc (Object_test): Set default options.
4385 2011-05-16 Ian Lance Taylor <iant@google.com>
4387 * options.h (class General_options): Make -i a synonym for -r.
4389 2011-05-16 Ian Lance Taylor <iant@google.com>
4391 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
4393 2011-05-10 Cary Coutant <ccoutant@google.com>
4395 * object.cc (Sized_relobj::do_count_local_symbols): Check for
4398 2011-05-06 Ian Lance Taylor <iant@google.com>
4400 * layout.cc (Layout::layout): If the output section flags change,
4401 update the ordering.
4403 2011-04-25 Cary Coutant <ccoutant@google.com>
4405 * incremental-dump.cc (dump_incremental_inputs): Print local
4406 symbol info for each input file.
4408 (Output_section_incremental_inputs::set_final_data_size): Add local
4409 symbol info to input file entries in incremental info.
4410 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4411 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
4412 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
4413 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
4415 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
4416 (Sized_incr_relobj::do_relocate): Write the local symbols.
4417 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
4418 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
4419 Adjust size of input file header.
4420 (Incremental_inputs_reader::get_local_symbol_offset): New function.
4421 (Incremental_inputs_reader::get_local_symbol_count): New function.
4422 (Incremental_inputs_reader::get_input_section): Adjust size of input
4424 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
4425 (Sized_incr_relobj::This): New typedef.
4426 (Sized_incr_relobj::sym_size): New const data member.
4427 (Sized_incr_relobj::Local_symbol): New struct.
4428 (Sized_incr_relobj::do_output_local_symbol_count): New function.
4429 (Sized_incr_relobj::do_local_symbol_offset): New function.
4430 (Sized_incr_relobj::local_symbol_count_): New data member.
4431 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
4432 (Sized_incr_relobj::local_symbol_index_): New data member.
4433 (Sized_incr_relobj::local_symbol_offset_): New data member.
4434 (Sized_incr_relobj::local_dynsym_offset_): New data member.
4435 (Sized_incr_relobj::local_symbols_): New data member.
4436 * object.h (Relobj::output_local_symbol_count): New function.
4437 (Relobj::local_symbol_offset): New function.
4438 (Relobj::do_output_local_symbol_count): New function.
4439 (Relobj::do_local_symbol_offset): New function.
4440 (Sized_relobj::do_output_local_symbol_count): New function.
4441 (Sized_relobj::do_local_symbol_offset): New function.
4443 2011-04-22 Vladimir Simonov <sv@sw.ru>
4445 * descriptors.cc (set_close_on_exec): New function.
4446 (Descriptors::open): Use set_close_on_exec.
4447 * output.cc (S_ISLNK): Define if not defined.
4449 2011-04-22 Cary Coutant <ccoutant@google.com>
4451 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4453 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4454 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
4455 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
4457 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
4458 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
4459 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
4461 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
4463 (Incremental_binary::apply_incremental_relocs): New function.
4464 (Incremental_binary::do_apply_incremental_relocs): New function.
4465 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4467 (Sized_incremental_binary::add_global_symbol): New function.
4468 (Sized_incremental_binary::global_symbol): New function.
4469 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4470 (Sized_incremental_binary::symbol_map_): New data member.
4471 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
4472 * target.h (Sized_target::apply_relocation): New function.
4473 * target-reloc.h (apply_relocation): New function.
4474 * x86_64.cc (Target_x86_64::apply_relocation): New function.
4476 2011-04-22 Doug Kwan <dougkwan@google.com>
4478 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
4479 flag of a SHT_ARM_EXIDX section.
4480 * testsuite/Makefile.am (arm_exidx_test): New test rules.
4481 * testsuite/Makefile.in: Regenerate.
4482 * testsuite/arm_exidx_test.s: New file.
4483 * testsuite/arm_exidx_test.sh: Same.
4485 2011-04-20 Cary Coutant <ccoutant@google.com>
4488 * archive.h (Incremental_archive_entry::Archive_member):
4489 Initialize arg_serial_ (second constructor).
4491 2011-04-17 Ian Lance Taylor <iant@google.com>
4493 * object.cc (Relocate_info::location): Simplify location string.
4494 * errors.cc (Errors::error_at_location): Don't print program
4496 (Errors::warning_at_location): Likewise.
4497 (Errors::undefined_symbol): Likewise.
4498 * testsuite/debug_msg.sh: Update accordingly.
4500 2011-04-14 Cary Coutant <ccoutant@google.com>
4502 * gold/layout.cc (Layout::symtab_section_offset): New function.
4503 * gold/layout.h (Layout::symtab_section_offset): New function.
4504 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
4506 2011-04-12 Ian Lance Taylor <iant@google.com>
4508 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
4509 with MREMAP_MAYMOVE.
4510 * output.h (class Output_file): Add map_is_allocated_ field.
4511 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
4512 not available, provide stubs. If mremap is not available, #define
4514 (MREMAP_MAYMOVE): Define if not defined.
4515 (Output_file::Output_file): Initialize map_is_allocated_.
4516 (Output_file::resize): Check map_is_allocated_.
4517 (Output_file::map_anonymous): If mmap fails, use malloc.
4518 (Output_file::unmap): Don't do anything for an anonymous map.
4519 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
4520 is not available, provide stubs.
4521 (File_read::View::~View): Use free rather than delete[].
4522 (File_read::make_view): Use malloc rather than new[]. If mmap
4524 (File_read::find_or_make_view): Use malloc rather than new[].
4525 * gold.h: Remove HAVE_REMAP code.
4526 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
4527 exists. Rename mremap to gold_mremap. If mmap is not available
4529 * configure, config.in: Rebuild.
4531 2011-04-11 Ian Lance Taylor <iant@google.com>
4533 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
4534 initialize local variable v.
4536 2011-04-11 Cary Coutant <ccoutant@google.com>
4538 * archive.cc (Archive::include_member): Adjust call to
4540 (Add_archive_symbols::run): Track argument serial numbers.
4541 (Lib_group::include_member): Likewise.
4542 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
4543 * archive.h (Incremental_archive_entry::Archive_member):
4544 Initialize arg_serial_.
4545 (Archive_member::arg_serial_): New data member.
4546 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
4547 (Sized_dynobj::do_add_symbols): Track symbols when doing an
4549 (Sized_dynobj::do_for_all_local_got_entries): New function.
4550 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
4552 * fileread.cc (get_mtime): New function.
4553 * fileread.h (get_mtime): New function.
4554 * gold.cc (queue_initial_tasks): Check for incremental update.
4555 (process_incremental_input): New function.
4556 (queue_middle_tasks): Don't force valid target for incremental
4558 * incremental-dump.cc (find_input_containing_global): Adjust
4559 size of symbol info entry.
4560 (dump_incremental_inputs): Dump argument serial number and
4561 in_system_directory flag; bias shndx by 1; print symbol names
4562 when dumping per-file symbol lists; use new symbol info readers.
4564 (Output_section_incremental_inputs:update_data_size): New function.
4565 (Sized_incremental_binary::setup_readers): Setup input readers
4566 for each input file; build maps for files added from libraries
4568 (Sized_incremental_binary::check_input_args): New function.
4569 (Sized_incremental_binary::do_check_inputs): Build map of argument
4570 serial numbers to input arguments.
4571 (Sized_incremental_binary::do_file_has_changed): Rename
4572 do_file_is_unchanged to this; compare file modification times.
4573 (Sized_incremental_binary::do_init_layout): New function.
4574 (Sized_incremental_binary::do_reserve_layout): New function.
4575 (Sized_incremental_binary::do_get_input_reader): Remove.
4576 (Sized_incremental_binary::get_symtab_view): New function.
4577 (Incremental_checker::can_incrementally_link_output_file): Remove.
4578 (Incremental_inputs::report_command_line): Exclude --debug options.
4579 (Incremental_inputs::report_archive_begin): Add parameter; track
4580 argument serial numbers; don't put input file entry for archive
4581 before archive members.
4582 (Incremental_inputs::report_archive_end): Put input file entry
4583 for archive after archive members.
4584 (Incremental_inputs::report_object): Add parameter; track argument
4585 serial numbers and in_system_directory flag.
4586 (Incremental_inputs::report_script): Add parameter; track argument
4588 (Output_section_incremental_inputs::set_final_data_size): Adjust
4589 size of symbol info entry; check for forwarding symbols.
4590 (Output_section_incremental_inputs::write_input_files): Write
4591 in_system_directory flag and argument serial number.
4592 (Output_section_incremental_inputs::write_info_blocks): Map section
4593 indices between incremental info and original input file; store
4594 input section index for each symbol.
4595 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
4596 change operator() to visit().
4597 (class Global_got_offset_visitor): Likewise.
4598 (class Global_symbol_visitor_got_plt):
4599 (Output_section_incremental_inputs::write_got_plt): Use new visitor
4601 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
4602 (Sized_incr_relobj::do_read_symbols): New function.
4603 (Sized_incr_relobj::do_layout): New function.
4604 (Sized_incr_relobj::do_layout_deferred_sections): New function.
4605 (Sized_incr_relobj::do_add_symbols): New function.
4606 (Sized_incr_relobj::do_should_include_member): New function.
4607 (Sized_incr_relobj::do_for_all_global_symbols): New function.
4608 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
4609 (Sized_incr_relobj::do_section_size): New function.
4610 (Sized_incr_relobj::do_section_name): New function.
4611 (Sized_incr_relobj::do_section_contents): New function.
4612 (Sized_incr_relobj::do_section_flags): New function.
4613 (Sized_incr_relobj::do_section_entsize): New function.
4614 (Sized_incr_relobj::do_section_address): New function.
4615 (Sized_incr_relobj::do_section_type): New function.
4616 (Sized_incr_relobj::do_section_link): New function.
4617 (Sized_incr_relobj::do_section_info): New function.
4618 (Sized_incr_relobj::do_section_addralign): New function.
4619 (Sized_incr_relobj::do_initialize_xindex): New function.
4620 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
4621 (Sized_incr_relobj::do_read_relocs): New function.
4622 (Sized_incr_relobj::do_gc_process_relocs): New function.
4623 (Sized_incr_relobj::do_scan_relocs): New function.
4624 (Sized_incr_relobj::do_count_local_symbols): New function.
4625 (Sized_incr_relobj::do_finalize_local_symbols): New function.
4626 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
4627 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
4628 (Sized_incr_relobj::do_relocate): New function.
4629 (Sized_incr_relobj::do_set_section_offset): New function.
4630 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
4631 (Sized_incr_dynobj::do_read_symbols): New function.
4632 (Sized_incr_dynobj::do_layout): New function.
4633 (Sized_incr_dynobj::do_add_symbols): New function.
4634 (Sized_incr_dynobj::do_should_include_member): New function.
4635 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
4636 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
4637 (Sized_incr_dynobj::do_section_size): New function.
4638 (Sized_incr_dynobj::do_section_name): New function.
4639 (Sized_incr_dynobj::do_section_contents): New function.
4640 (Sized_incr_dynobj::do_section_flags): New function.
4641 (Sized_incr_dynobj::do_section_entsize): New function.
4642 (Sized_incr_dynobj::do_section_address): New function.
4643 (Sized_incr_dynobj::do_section_type): New function.
4644 (Sized_incr_dynobj::do_section_link): New function.
4645 (Sized_incr_dynobj::do_section_info): New function.
4646 (Sized_incr_dynobj::do_section_addralign): New function.
4647 (Sized_incr_dynobj::do_initialize_xindex): New function.
4648 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
4649 (make_sized_incremental_object): New function.
4650 (Incremental_library::copy_unused_symbols): New function.
4651 (Incremental_library::do_for_all_unused_symbols): New function.
4652 * incremental.h (enum Incremental_input_flags): New type.
4653 (class Incremental_checker): Remove.
4654 (Incremental_input_entry::Incremental_input_entry): Add argument
4656 (Incremental_input_entry::arg_serial): New function.
4657 (Incremental_input_entry::set_is_in_system_directory): New function.
4658 (Incremental_input_entry::is_in_system_directory): New function.
4659 (Incremental_input_entry::arg_serial_): New data member.
4660 (Incremental_input_entry::is_in_system_directory_): New data member.
4661 (class Script_info): Move here from script.h.
4662 (Script_info::Script_info): Add filename parameter.
4663 (Script_info::filename): New function.
4664 (Script_info::filename_): New data member.
4665 (Incremental_script_entry::Incremental_script_entry): Add argument
4667 (Incremental_object_entry::Incremental_object_entry): Likewise.
4668 (Incremental_object_entry::add_input_section): Build list of input
4669 sections with map to original shndx.
4670 (Incremental_object_entry::get_input_section_index): New function.
4671 (Incremental_object_entry::shndx_): New data member.
4672 (Incremental_object_entry::name_key_): Rename; adjust all refs.
4673 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
4674 (Incremental_archive_entry::Incremental_archive_entry): Add argument
4676 (Incremental_inputs::report_archive_begin): Likewise.
4677 (Incremental_inputs::report_object): Likewise.
4678 (Incremental_inputs::report_script): Likewise.
4679 (class Incremental_global_symbol_reader): New class.
4680 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
4681 and store flags and input file type.
4682 (Incremental_input_entry_reader::arg_serial): New function.
4683 (Incremental_input_entry_reader::type): Extract type from flags.
4684 (Incremental_input_entry_reader::is_in_system_directory): New function.
4685 (Incremental_input_entry_reader::get_input_section_count): Call
4686 accessor function for type.
4687 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
4688 function for type; adjust size of global symbol entry.
4689 (Incremental_input_entry_reader::get_global_symbol_count): Call
4690 accessor function for type.
4691 (Incremental_input_entry_reader::get_object_count): Likewise.
4692 (Incremental_input_entry_reader::get_object_offset): Likewise.
4693 (Incremental_input_entry_reader::get_member_count): Likewise.
4694 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
4695 (Incremental_input_entry_reader::get_member_offset): Likewise.
4696 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
4697 (Incremental_input_entry_reader::Global_symbol_info): Remove.
4698 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
4699 (Incremental_input_entry_reader::get_global_symbol_reader): New
4701 (Incremental_input_entry_reader::get_output_symbol_index): New
4703 (Incremental_input_entry_reader::type_): Remove.
4704 (Incremental_input_entry_reader::flags_): New data member.
4705 (Incremental_inputs_reader::input_file_offset): New function.
4706 (Incremental_inputs_reader::input_file_index): New function.
4707 (Incremental_inputs_reader::input_file): Call input_file_offset.
4708 (Incremental_inputs_reader::input_file_at_offset): New function.
4709 (Incremental_relocs_reader::get_r_type): Reformat.
4710 (Incremental_relocs_reader::get_r_shndx): Reformat.
4711 (Incremental_relocs_reader::get_r_offset): Reformat.
4712 (Incremental_relocs_reader::data): New function.
4713 (Incremental_binary::Incremental_binary): Initialize new data members.
4714 (Incremental_binary::check_inputs): Add cmdline parameter.
4715 (Incremental_binary::file_is_unchanged): Remove.
4716 (Input_reader::arg_serial): New function.
4717 (Input_reader::get_unused_symbol_count): New function.
4718 (Input_reader::get_unused_symbol): New function.
4719 (Input_reader::do_arg_serial): New function.
4720 (Input_reader::do_get_unused_symbol_count): New function.
4721 (Input_reader::do_get_unused_symbol): New function.
4722 (Incremental_binary::input_file_count): New function.
4723 (Incremental_binary::get_input_reader): Change signature to use
4724 index instead of filename.
4725 (Incremental_binary::file_has_changed): New function.
4726 (Incremental_binary::get_input_argument): New function.
4727 (Incremental_binary::get_library): New function.
4728 (Incremental_binary::get_script_info): New function.
4729 (Incremental_binary::init_layout): New function.
4730 (Incremental_binary::reserve_layout): New function.
4731 (Incremental_binary::output_file): New function.
4732 (Incremental_binary::do_check_inputs): New function.
4733 (Incremental_binary::do_file_is_unchanged): Remove.
4734 (Incremental_binary::do_file_has_changed): New function.
4735 (Incremental_binary::do_init_layout): New function.
4736 (Incremental_binary::do_reserve_layout): New function.
4737 (Incremental_binary::do_input_file_count): New function.
4738 (Incremental_binary::do_get_input_reader): Change signature.
4739 (Incremental_binary::input_args_map_): New data member.
4740 (Incremental_binary::library_map_): New data member.
4741 (Incremental_binary::script_map_): New data member.
4742 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4744 (Sized_incremental_binary::output_section): New function.
4745 (Sized_incremental_binary::inputs_reader): Add const.
4746 (Sized_incremental_binary::symtab_reader): Add const.
4747 (Sized_incremental_binary::relocs_reader): Add const.
4748 (Sized_incremental_binary::got_plt_reader): Add const.
4749 (Sized_incremental_binary::get_symtab_view): New function.
4750 (Sized_incremental_binary::Inputs_reader): New typedef.
4751 (Sized_incremental_binary::Input_entry_reader): New typedef.
4752 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
4753 (Sized_incremental_binary::do_file_is_unchanged): Remove.
4754 (Sized_incremental_binary::do_file_has_changed): New function.
4755 (Sized_incremental_binary::do_init_layout): New function.
4756 (Sized_incremental_binary::do_reserve_layout): New function.
4757 (Sized_input_reader::Inputs_reader): Remove.
4758 (Sized_input_reader::Input_entry_reader): Remove.
4759 (Sized_input_reader::do_arg_serial): New function.
4760 (Sized_input_reader::do_get_unused_symbol_count): New function.
4761 (Sized_input_reader::do_get_unused_symbol): New function.
4762 (Sized_incremental_binary::do_input_file_count): New function.
4763 (Sized_incremental_binary::do_get_input_reader): Change signature;
4764 use index instead of filename.
4765 (Sized_incremental_binary::section_map_): New data member.
4766 (Sized_incremental_binary::input_entry_readers_): New data member.
4767 (class Sized_incr_relobj): New class.
4768 (class Sized_incr_dynobj): New class.
4769 (make_sized_incremental_object): New function.
4770 (class Incremental_library): New class.
4771 * layout.cc (Free_list::num_lists): New static data member.
4772 (Free_list::num_nodes): New static data member.
4773 (Free_list::num_removes): New static data member.
4774 (Free_list::num_remove_visits): New static data member.
4775 (Free_list::num_allocates): New static data member.
4776 (Free_list::num_allocate_visits): New static data member.
4777 (Free_list::init): New function.
4778 (Free_list::remove): New function.
4779 (Free_list::allocate): New function.
4780 (Free_list::dump): New function.
4781 (Free_list::print_stats): New function.
4782 (Layout_task_runner::run): Resize output file for incremental updates.
4783 (Layout::Layout): Initialize new data members.
4784 (Layout::set_incremental_base): New function.
4785 (Layout::init_fixed_output_section): New function.
4786 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
4787 incremental updates.
4788 (Layout::create_gold_note): Do not create gold note section for
4789 incremental updates.
4790 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
4791 for incremental updates.
4792 (Layout::set_section_offsets): For incremental updates, allocate space
4794 (Layout::create_symtab_sections): Layout with offsets relative to
4795 start of section; for incremental updates, allocate space from free
4797 (Layout::create_shdrs): For incremental updates, allocate space from
4799 (Layout::finish_dynamic_section): For incremental updates, do not
4800 check --as-needed (fixed in subsequent patch).
4801 * layout.h (class Free_list): New class.
4802 (Layout::set_incremental_base): New function.
4803 (Layout::incremental_base): New function.
4804 (Layout::init_fixed_output_section): New function.
4805 (Layout::allocate): New function.
4806 (Layout::incremental_base_): New data member.
4807 (Layout::free_list_): New data member.
4808 * main.cc (main): Print Free_list statistics.
4809 * object.cc (Relobj::finalize_incremental_relocs): Add
4810 clear_counts parameter; clear counts only when clear_counts is set.
4811 (Sized_relobj::Sized_relobj): Initialize new base class.
4812 (Sized_relobj::do_layout): Don't report special sections.
4813 (Sized_relobj::do_for_all_local_got_entries): New function.
4814 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
4815 symtab_off to all symbol table offsets.
4816 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
4817 * object.h (class Got_offset_list): Move to top of file.
4818 (Object::Object): Allow case where input_file == NULL.
4819 (Object::~Object): Likewise.
4820 (Object::input_file): Assert that input_file != NULL.
4821 (Object::lock): Allow case where input_file == NULL.
4822 (Object::unlock): Likewise.
4823 (Object::is_locked): Likewise.
4824 (Object::token): Likewise.
4825 (Object::release): Likewise.
4826 (Object::is_incremental): New function.
4827 (Object::get_mtime): New function.
4828 (Object::for_all_local_got_entries): New function.
4829 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
4830 (Object::set_is_in_system_directory): New function.
4831 (Object::is_in_system_directory): New function.
4832 (Object::do_is_incremental): New function.
4833 (Object::do_get_mtime): New function.
4834 (Object::do_for_all_local_got_entries): New function.
4835 (Object::is_in_system_directory_): New data member.
4836 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
4837 (class Sized_relobj_base): New class.
4838 (class Sized_relobj): Derive from Sized_relobj_base.
4839 (class Sized_relobj::Symbols): Redeclare from base class.
4840 (class Sized_relobj::local_got_offset_list): Remove.
4841 (class Sized_relobj::Output_sections): Redeclare from base class.
4842 (class Sized_relobj::do_for_all_local_got_entries): New function.
4843 (class Sized_relobj::write_local_symbols): Add offset parameter.
4844 (class Sized_relobj::local_symbol_offset_): Update comment.
4845 (class Sized_relobj::local_dynsym_offset_): Update comment.
4846 * options.cc (Input_arguments::add_file): Remove const.
4847 * options.h (Input_file_argument::Input_file_argument):
4848 Initialize arg_serial_ (all constructors).
4849 (Input_file_argument::set_arg_serial): New function.
4850 (Input_file_argument::arg_serial): New function.
4851 (Input_file_argument::arg_serial_): New data member.
4852 (Input_arguments::Input_arguments): Initialize file_count_.
4853 (Input_arguments::add_file): Remove const.
4854 (Input_arguments::number_of_input_files): New function.
4855 (Input_arguments::file_count_): New data member.
4856 (Command_line::number_of_input_files): Call
4857 Input_arguments::number_of_input_files.
4858 * output.cc (Output_segment_headers::Output_segment_headers):
4860 (Output_section::Input_section::current_data_size): New function.
4861 (Output_section::Output_section): Initialize new data members.
4862 (Output_section::add_input_section): Don't do merge sections for
4863 an incremental link; allocate space from free list for an
4865 (Output_section::add_output_section_data): Allocate space from
4866 free list for an incremental update.
4867 (Output_section::update_data_size): New function.
4868 (Output_section::set_fixed_layout): New function.
4869 (Output_section::reserve): New function.
4870 (Output_segment::set_section_addresses): Remove const.
4871 (Output_segment::set_section_list_addresses): Remove const; allocate
4872 space from free list for an incremental update.
4873 (Output_segment::set_offset): Adjust size of RELRO segment for an
4875 * output.h (Output_data::current_data_size): Move here from
4877 (Output_data::pre_finalize_data_size): New function.
4878 (Output_data::update_data_size): New function.
4879 (Output_section_headers::update_data_size): new function.
4880 (Output_section_data_build::current_data_size): Move to Output_data.
4881 (Output_data_strtab::update_data_size): New function.
4882 (Output_section::current_data_size): Move to Output_data.
4883 (Output_section::set_fixed_layout): New function.
4884 (Output_section::has_fixed_layout): New function.
4885 (Output_section::reserve): New function.
4886 (Output_section::update_data_size): New function.
4887 (Output_section::has_fixed_layout_): New data member.
4888 (Output_section::free_list_): New data member.
4889 (Output_segment::set_section_addresses): Remove const.
4890 (Output_segment::set_section_list_addresses): Remove const.
4891 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
4893 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
4895 * readsyms.cc (Read_symbols::do_read_symbols): Add library
4896 parameter when calling Add_symbols constructor; store argument
4897 serial number for members of a lib group.
4898 (Add_symbols::locks): Allow case where token == NULL.
4899 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
4900 (Read_member::~Read_member): New function.
4901 (Read_member::is_runnable): New function.
4902 (Read_member::locks): New function.
4903 (Read_member::run): New function.
4904 (Check_script::~Check_script): New function.
4905 (Check_script::is_runnable): New function.
4906 (Check_script::locks): New function.
4907 (Check_script::run): New function.
4908 (Check_library::~Check_library): New function.
4909 (Check_library::is_runnable): New function.
4910 (Check_library::locks): New function.
4911 (Check_library::run): New function.
4912 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
4913 (Add_symbols::library_): New data member.
4914 (class Read_member): New class.
4915 (class Check_script): New class.
4916 (class Check_library): New class.
4917 * reloc.cc (Read_relocs::is_runnable): Allow case where
4919 (Read_relocs::locks): Likewise.
4920 (Scan_relocs::locks): Likewise.
4921 (Relocate_task::locks): Likewise.
4922 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
4924 (Sized_relobj::incremental_relocs_scan): Fix comment.
4925 (Sized_relobj::do_relocate): Pass output file offset to
4926 write_local_symbols.
4927 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
4928 from class declaration.
4929 * script.cc (read_input_script): Allocate Script_info; pass
4930 argument serial number to report_script.
4931 * script.h (class Script_info): Move to incremental.h.
4932 * symtab.cc (Symbol_table::add_from_incrobj): New function.
4933 * symtab.h (Symbol_table::add_from_incrobj): New function.
4934 (Symbol_table::set_file_offset): New function.
4936 2011-04-05 Cary Coutant <ccoutant@google.com>
4938 * incremental-dump.cc (dump_incremental_inputs): Change signature
4939 to take a Sized_incremental_binary; change caller. Use readers
4940 in Sized_incremental_binary.
4942 (Sized_incremental_binary::find_incremental_inputs_sections):
4943 Rename do_find_incremental_inputs_sections to this.
4944 (Sized_incremental_binary::setup_readers): New function.
4945 (Sized_incremental_binary::do_check_inputs): Check
4946 has_incremental_info_ flag; move setup code to setup_readers;
4948 (Sized_incremental_binary::do_file_is_unchanged): New function.
4949 (Sized_incremental_binary::do_get_input_reader): New function.
4950 * incremental.h (class Incremental_binary): Move to end of file.
4951 (Incremental_binary::file_is_unchanged): New function.
4952 (Incremental_binary::do_file_is_unchanged): New function.
4953 (Incremental_binary::Input_reader): New class.
4954 (Incremental_binary::get_input_reader): New function.
4955 (class Sized_incremental_binary): Move to end of file.
4956 (Sized_incremental_binary::Sized_incremental_binary): Setup the
4957 input section reader classes.
4958 (Sized_incremental_binary::has_incremental_info): New function.
4959 (Sized_incremental_binary::inputs_reader): New function.
4960 (Sized_incremental_binary::symtab_reader): New function.
4961 (Sized_incremental_binary::relocs_reader): New function.
4962 (Sized_incremental_binary::got_plt_reader): New function.
4963 (Sized_incremental_binary::do_file_is_unchanged): New function.
4964 (Sized_incremental_binary::Sized_input_reader): New class.
4965 (Sized_incremental_binary::get_input_reader): New function.
4966 (Sized_incremental_binary::find_incremental_inputs_sections):
4967 Rename do_find_incremental_inputs_sections to this.
4968 (Sized_incremental_binary::setup_readers): New function.
4969 (Sized_incremental_binary::has_incremental_info_): New data member.
4970 (Sized_incremental_binary::inputs_reader_): New data member.
4971 (Sized_incremental_binary::symtab_reader_): New data member.
4972 (Sized_incremental_binary::relocs_reader_): New data member.
4973 (Sized_incremental_binary::got_plt_reader_): New data member.
4974 (Sized_incremental_binary::current_input_file_): New data member.
4976 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
4979 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
4982 2011-03-30 Cary Coutant <ccoutant@google.com>
4984 * archive.cc (Archive::include_member): Adjust call to report_object.
4985 (Add_archive_symbols::run): Add script_info to call to
4986 report_archive_begin.
4987 (Lib_group::include_member): Adjust call to report_object.
4988 (Add_lib_group_symbols::run): Adjust call to report_object.
4989 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
4990 blocks. Add object count for script input files.
4991 * incremental.cc (Incremental_inputs::report_archive_begin): Add
4992 script_info parameter; change all callers.
4993 (Incremental_inputs::report_object): Add script_info parameter;
4995 (Incremental_inputs::report_script): Store backpointer to
4996 incremental info entry.
4997 (Output_section_incremental_inputs::set_final_data_size): Record
4998 additional information for scripts.
4999 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5000 * incremental.h (Incremental_script_entry::add_object): New function.
5001 (Incremental_script_entry::get_object_count): New function.
5002 (Incremental_script_entry::get_object): New function.
5003 (Incremental_script_entry::objects_): New data member; adjust
5005 (Incremental_inputs::report_archive_begin): Add script_info parameter.
5006 (Incremental_inputs::report_object): Add script_info parameter.
5007 (Incremental_inputs_reader::get_object_count): New function.
5008 (Incremental_inputs_reader::get_object_offset): New function.
5009 * options.cc (Input_arguments::add_file): Return reference to
5011 * options.h (Input_argument::set_script_info): New function.
5012 (Input_argument::script_info): New function.
5013 (Input_argument::script_info_): New data member; adjust all
5015 (Input_file_group::add_file): Return reference to new input argument.
5016 (Input_file_lib::add_file): Likewise.
5017 (Input_arguments::add_file): Likewise.
5018 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
5019 * script.cc (Parser_closure::Parser_closure): Add script_info
5020 parameter; adjust all callers.
5021 (Parser_closure::script_info): New function.
5022 (Parser_closure::script_info_): New data member.
5023 (read_input_script): Report scripts earlier to incremental info.
5024 (script_add_file): Set script_info in Input_argument.
5025 (script_add_library): Likewise.
5026 * script.h (Script_options::Script_info): Rewrite class.
5028 2011-03-29 Cary Coutant <ccoutant@google.com>
5030 * archive.cc (Library_base::should_include_member): Move
5031 method here from class Archive.
5032 (Archive::Archive): Initialize base class.
5033 (Archive::should_include_member): Move to base class.
5034 (Archive::do_for_all_unused_symbols): New function.
5035 (Add_archive_symbols::run): Remove redundant access to
5037 (Lib_group::Lib_group): Initialize base class.
5038 (Lib_group::do_filename): New function.
5039 (Lib_group::include_member): Pass pointer to Lib_group to
5041 (Lib_group::do_for_all_unused_symbols): New function.
5042 (Add_lib_group_symbols::run): Report archive information for
5044 * archive.h (class Library_base): New base class.
5045 (class Archive): Derive from Library_base.
5046 (Archive::filename): Move to base class.
5047 (Archive::set_incremental_info): Likewise.
5048 (Archive::incremental_info): Likewise.
5049 (Archive::Should_include): Likewise.
5050 (Archive::should_include_member): Likewise.
5051 (Archive::Armap_entry): Remove.
5052 (Archive::Unused_symbol_iterator): Remove.
5053 (Archive::unused_symbols_begin): Remove.
5054 (Archive::unused_symbols_end): Remove.
5055 (Archive::do_filename): New function.
5056 (Archive::do_get_mtime): New function.
5057 (Archive::do_for_all_unused_symbols): New function.
5058 (Archive::task_): Move to base class.
5059 (Archive::incremental_info_): Likewise.
5060 (class Lib_group): Derive from Library_base.
5061 (Lib_group::do_filename): New function.
5062 (Lib_group::do_get_mtime): New function.
5063 (Lib_group::do_for_all_unused_symbols): New function.
5064 (Lib_group::task_): Move to base class.
5065 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
5067 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
5069 * incremental.cc (Incremental_inputs::report_archive_begin):
5070 Use Library_base; call library's get_mtime; add incremental inputs
5071 entry before members.
5072 (class Unused_symbol_visitor): New class.
5073 (Incremental_inputs::report_archive_end): Use Library_base; use
5074 visitor class to record unused symbols; don't add incremental inputs
5075 entry after members.
5076 (Incremental_inputs::report_object): Use Library_base.
5078 (Incremental_archive_entry::Incremental_archive_entry): Remove
5079 unused Archive parameter.
5080 (Incremental_inputs::report_archive_begin): Use Library_base.
5081 (Incremental_inputs::report_archive_end): Likewise.
5082 (Incremental_inputs::report_object): Likewise.
5083 * object.cc (Sized_relobj::do_for_all_global_symbols): New
5085 * object.h (Object::for_all_global_symbols): New function.
5086 (Object::do_for_all_global_symbols): New function.
5087 (Sized_relobj::do_for_all_global_symbols): New function.
5088 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
5090 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
5093 2011-03-27 Ian Lance Taylor <iant@google.com>
5095 * archive.cc (Archive::interpret_header): Return -1 if something
5096 goes wrong. Change callers accordingly.
5098 2011-03-25 Cary Coutant <ccoutant@google.com>
5100 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
5101 * testsuite/Makefile.in: Regenerate.
5103 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
5105 * plugin.cc (get_view): New.
5106 (Plugin::load): Pass get_view to the plugin.
5107 (Plugin_manager::get_view): New.
5109 2011-03-21 Ian Lance Taylor <iant@google.com>
5111 * testsuite/final_layout.sh: Rewrite to not use dc.
5112 * testsuite/relro_test.sh: Fail if dc is not present.
5114 2011-03-21 Sriraman Tallam <tmsriram@google.com>
5116 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
5118 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
5119 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
5121 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
5122 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
5124 2011-03-14 Ian Lance Taylor <iant@google.com>
5126 * script-sections.cc (Sort_output_sections::script_compare):
5127 Rename from is_before, change return type.
5128 (Sort_output_sections::operator()): Adjust accordingly.
5130 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
5133 * testsuite/odr_violation2.cc: Add comment to make all error line
5134 numbers double digits.
5135 * testsuite/debug_msg.sh: Adjust expected errors.
5137 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
5139 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
5140 but mark earlier ones as non-canonical
5141 (offset_to_iterator): Update search target and example
5142 (do_addr2line): Return extra lines in a vector*
5143 (format_file_lineno): Extract from do_addr2line
5144 (one_addr2line): Add vector* out-param
5145 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
5146 when a lineno entry appeared last for its instruction
5147 (Dwarf_line_info): Add vector* out-param
5148 * object.cc (Relocate_info): Pass NULL for the vector* out-param
5149 * symtab.cc (Odr_violation_compare): Include the lineno in the
5151 (linenos_from_loc): New. Combine the canonical line for an
5152 address with its other lines.
5153 (True_if_intersect): New. Helper functor to make
5154 std::set_intersection a query.
5155 (detect_odr_violations): Compare sets of lines instead of just
5156 one line for each function. This became less deterministic, but
5157 has fewer false positives.
5158 * symtab.h: Declarations.
5159 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
5160 mix an optimized and non-optimized object in the same binary
5161 (odr_violation2.so): Same.
5162 * testsuite/Makefile.in: Regenerate from Makefile.am.
5163 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
5164 * testsuite/debug_msg.sh: Update line numbers and add
5166 * testsuite/odr_violation1.cc: Use OdrDerived, in a
5167 non-optimized context.
5168 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
5169 isn't inlined, and use OdrDerived in an optimized context.
5170 * testsuite/odr_header1.h: Defines OdrDerived, where
5171 optimization will change the
5172 first-instruction-in-the-destructor's file and line number.
5173 * testsuite/odr_header2.h: Defines OdrBase.
5175 2011-03-09 Ian Lance Taylor <iant@google.com>
5177 * fileread.cc (File_read::clear_views): Don't delete the whole
5180 2011-03-08 Ian Lance Taylor <iant@google.com>
5183 * fileread.cc: #include <climits>.
5184 (GOLD_IOV_MAX): Define.
5185 (File_read::read_multiple): Limit number of entries by iov_max.
5186 * fileread.h (class File_read): Always set max_readv_entries to
5189 2011-03-07 Ian Lance Taylor <iant@google.com>
5192 * options.h (class General_options): Add -dy and -dn.
5194 2011-03-02 Cary Coutant <ccoutant@google.com>
5196 * testsuite/script_test_9.t: Add TLS segment.
5198 2011-03-02 Simon Baldwin <simonb@google.com>
5200 * configure.ac: Add check for gnu_indirect_function support in
5201 the toolchain building binutils.
5202 * configure: Rebuild.
5204 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
5206 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
5207 plugin only symbols.
5208 (Symbol_table::sized_finalize_symbol) Mark symbol only present
5209 in plugin files as not needed in the symbol table.
5211 2011-02-11 Sriraman Tallam <tmsriram@google.com>
5213 * output.cc (Output_section::add_input_section): Delay fill
5214 generation for section ordering.
5216 2011-02-09 Ian Lance Taylor <iant@google.com>
5219 * object.h (class Sized_relobj): Remove clear_local_symbols.
5220 * reloc.cc (Sized_relobj::do_relocate): Don't call
5221 clear_local_symbols.
5223 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
5225 * plugin.cc (is_visible_from_outside): Return true for symbols
5228 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
5230 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
5233 2011-02-02 Sriraman Tallam <tmsriram@google.com>
5235 * icf.h (is_section_foldable_candidate): Change type of parameter
5237 * icf.cc (Icf::find_identical_sections): Change type of local variable
5238 section_name to be std::string.
5239 (is_function_ctor_or_dtor): Change type of parameter to std::string.
5241 2011-01-25 Ian Lance Taylor <iant@google.com>
5243 * script.cc (script_add_extern): Rewrite to use
5244 add_symbol_reference.
5246 2011-01-25 Doug Kwan <dougkwan@google.com>
5248 * icf.cc (get_section_contents): Always lock section's object.
5250 2011-01-24 Ian Lance Taylor <iant@google.com>
5252 * options.h (class General_options): Accept
5253 --no-detect-odr-violations.
5255 2011-01-24 Ian Lance Taylor <iant@google.com>
5257 * version.cc (version_string): Bump to 1.11.
5259 2011-01-24 Ian Lance Taylor <iant@google.com>
5261 * plugin.cc (class Plugin_rescan): Define new class.
5262 (Plugin_manager::claim_file): Set any_claimed_.
5263 (Plugin_manager::save_archive): New function.
5264 (Plugin_manager::save_input_group): New function.
5265 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
5267 (Plugin_manager::new_undefined_symbol): New function.
5268 (Plugin_manager::rescan): New function.
5269 (Plugin_manager::rescannable_defines): New function.
5270 (Plugin_manager::add_input_file): Set any_added_.
5271 * plugin.h (class Plugin_manager): define new fields rescannable_,
5272 undefined_symbols_, any_claimed_, and any_added_. Declare
5273 Plugin_rescan as friend. Declare new functions.
5274 (Plugin_manager::Rescannable): Define type.
5275 (Plugin_manager::Rescannable_list): Define type.
5276 (Plugin_manager::Undefined_symbol_list): Define type.
5277 (Plugin_manager::Plugin_manager): Initialize new fields.
5278 * archive.cc (Archive::defines_symbol): New function.
5279 (Add_archive_symbols::run): Pass archive to plugins if any.
5280 * archive.h (class Archive): Declare defines_symbol.
5281 * readsyms.cc (Input_group::~Input_group): New function.
5282 (Finish_group::run): Pass input_group to plugins if any.
5283 * readsyms.h (class Input_group): Declare destructor.
5284 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
5287 2011-01-10 Ian Lance Taylor <iant@google.com>
5289 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
5291 (Layout::set_segment_offsets): Reset increase_relro before calling
5292 set_section_addresses a second time.
5294 2011-01-04 Cary Coutant <ccoutant@google.com>
5296 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
5297 sections before NOBITS sections.
5299 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
5301 * version.cc (print_version): Update copyright to 2011.
5303 2010-12-23 Cary Coutant <ccoutant@google.com>
5305 * output.h (Output_data_reloc::add_output_section): Pass OD instead
5306 of OS to this->add. Add OD parameter to second form of the function.
5308 2010-12-20 Ian Lance Taylor <iant@google.com>
5310 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
5311 second of two consecutive entries with same offset.
5313 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5315 * testsuite/Makefile.am (ifuncmain2static_LDADD)
5316 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
5317 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
5318 to avoid unneeded links against $(LDADD).
5319 * testsuite/Makefile.in: Regenerate.
5321 2010-12-15 Ian Lance Taylor <iant@google.com>
5324 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
5325 for R_X86_64_32 and R_X86_64_PC32.
5326 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
5327 ver_matching_def_pic.o.
5328 (ver_matching_def_pic.o): New target.
5330 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5332 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
5333 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
5334 Move definition before File_read::View member definitions.
5335 (File_read::View::~View): Initialize and hold lock before
5336 updating current_mapped_bytes.
5338 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5340 * dwarf_reader.cc: Remove outdated comment.
5341 * gold-threads.cc: Fix typo in error message.
5342 * archive.cc: Fix typos in comments.
5343 * archive.h: Likewise.
5344 * arm-reloc-property.cc: Likewise.
5345 * arm-reloc-property.h: Likewise.
5346 * arm-reloc.def: Likewise.
5348 * attributes.h: Likewise.
5349 * cref.cc: Likewise.
5350 * ehframe.cc: Likewise.
5351 * fileread.h: Likewise.
5353 * i386.cc: Likewise.
5355 * incremental.h: Likewise.
5356 * int_encoding.cc: Likewise.
5357 * layout.h: Likewise.
5358 * main.cc: Likewise.
5359 * merge.h: Likewise.
5360 * object.cc: Likewise.
5361 * object.h: Likewise.
5362 * options.cc: Likewise.
5363 * readsyms.cc: Likewise.
5364 * reduced_debug_output.cc: Likewise.
5365 * reloc.cc: Likewise.
5366 * script-sections.cc: Likewise.
5367 * sparc.cc: Likewise.
5368 * symtab.h: Likewise.
5369 * target-reloc.h: Likewise.
5370 * target.cc: Likewise.
5371 * target.h: Likewise.
5372 * timer.cc: Likewise.
5373 * timer.h: Likewise.
5374 * x86_64.cc: Likewise.
5376 2010-12-09 Cary Coutant <ccoutant@google.com>
5378 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
5380 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
5381 parameter; change all callers.
5382 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
5383 * options.h (warn_execstack): New option.
5385 2010-12-07 Doug Kwan <dougkwan@google.com>
5387 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
5388 like function call relocations.
5390 2010-12-07 Ian Lance Taylor <iant@google.com>
5392 * archive.cc (Archive::get_elf_object_for_member): Permit
5393 punconfigured to be NULL.
5394 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
5395 (Archive::include_member): Pass NULL to get_elf_object_for_member
5396 if we searched for the archive and this is the first included
5399 2010-12-01 Ian Lance Taylor <iant@google.com>
5401 * dwarf_reader.h (class Sized_dwarf_line_info): Add
5402 track_relocs_type_ field.
5403 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5404 Set track_relocs_type_.
5405 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
5406 contents when using RELA relocs.
5407 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
5409 * reloc.cc (Track_relocs::next_addend): New function.
5410 * reloc.h (class Track_relocs): Declare next_addend.
5412 2010-12-01 Ian Lance Taylor <iant@google.com>
5414 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
5417 2010-12-01 Ian Lance Taylor <iant@google.com>
5419 * README: Update compilers known to work and fail.
5421 2010-11-23 Matthias Klose <doko@ubuntu.com>
5423 * configure.in: For --enable-gold, handle value `default' instead of
5424 `both*'. Always install ld as ld.bfd, install as ld if gold is
5426 * configure: Regenerate.
5428 2010-11-18 Doug Kwan <dougkwan@google.com>
5430 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
5431 and right_alignment to be zero. Store result alignment only if it is
5432 greater than existing alignment.
5434 2010-11-16 Cary Coutant <ccoutant@google.com>
5437 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5438 Check for ".zdebug_line".
5440 2010-11-16 Doug Kwan <dougkwan@google.com>
5441 Cary Coutant <ccoutant@google.com>
5443 * output.h (Output_segment::set_section_addresses): Pass increase_relro
5444 by reference; adjust all callers.
5445 * output.cc (Output_segment::set_section_addresses): Adjust references
5446 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
5448 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
5449 end at page boundary.
5451 2010-11-16 Cary Coutant <ccoutant@google.com>
5454 * layout.cc (Layout::choose_output_section): Transform names of
5455 compressed sections even when using a script with a SECTIONS clause.
5456 (Layout::output_section_name): Remove code to transform
5457 compressed debug section names.
5458 * output.cc (Output_section::add_input_section): Use uncompressed
5459 section size when tracking input sections.
5461 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
5463 * symtab.h (Symbol::NON_PIC_REF): Remove.
5464 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
5465 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
5466 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
5467 (Symbol::use_plt_offset): Take a flags argument and pass it
5468 directly to needs_dynamic_reloc. Restrict check for undefined
5469 weak symbols to function calls.
5470 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
5471 (Target_arm::Scan::global): Use it.
5472 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
5473 (Target_arm::Relocate::relocate): Likewise.
5474 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
5475 parameter with an r_type parameter. Use get_reference_flags
5477 (Target_arm::Relocate::relocate): Update accordingly.
5478 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
5479 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
5480 (Target_i386::Scan::global): Likewise.
5481 (Target_i386::Relocate::relocate): Likewise.
5482 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
5483 parameter with an r_type parameter. Use get_reference_flags
5485 (Target_i386::Relocate::relocate): Update accordingly.
5486 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
5487 (Target_powerpc::Scan::global): Use it.
5488 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
5489 (Target_powerpc::Relocate::relocate): Likewise.
5490 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
5491 (Target_sparc::Scan::global): Use it.
5492 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
5493 (Target_sparc::Relocate::relocate): Likewise.
5494 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
5495 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
5496 (Target_x86_64::Scan::global): Likewise.
5497 (Target_x86_64::Relocate::relocate): Likewise.
5499 2010-11-08 Doug Kwan <dougkwan@google.com>
5500 Cary Coutant <ccoutant@google.com>
5502 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
5503 (Arm_exidx_merge_section::section_contents_): New data member.
5504 (Arm_input_section::Arm_input_section): Initialize original_contents_.
5505 (Arm_input_section::~Arm_input_section): De-allocate memory.
5506 (Arm_input_section::original_contents_): New data member.
5507 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
5508 in parameters instead of calling Object::section_contents without
5510 (Arm_output_section::group_section): New parameter TASK. Pass it
5511 to callees that need locking objects.
5512 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
5513 to lock EXIDX input sections. Fix a formatting issue. Call
5514 Arm_exidx_merged_section::build_contents to create merged section
5516 (Arm_output_section::create_stub_group): New parameter TASK. Use it
5517 to lock object of stub table owner.
5518 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
5519 TEXT_SIZE to initialize data member TEXT_SIZE_.
5520 (Arm_exidx_input_section::addralign): Fix typo in comment.
5521 (Arm_exidx_input_section::text_size): New method.
5522 (Target_arm::do_relax): New parameter TASK. Pass it to callees
5523 that require locking objects. Lock objects before scanning for stubs
5524 and updating local symbols.
5525 (Arm_input_section<big_endian>::init): Copy contents of original
5527 (Arm_input_section<big_endian>::do_write): Use saved contents of
5528 original input section instead of calling Object::section_contents
5530 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
5531 size without calling Object::section_size().
5532 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
5533 for size. Allocate a buffer for merged EXIDX entries.
5534 (Arm_exidx_merged_section::build_contents): New method.
5535 (Arm_exidx_merged_section::do_write): Move merge section contents
5536 building code to Arm_exidx_merged_section::build_contetns. Write
5537 out contetns in buffer instead of building it on the fly.
5538 (Arm_relobj::make_exidx_input_section): Also pass text section size
5539 to Arm_exidx_input_section constructor.
5540 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
5541 (Arm_dynobj::do_read_symbols): Fix memory leak.
5542 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
5543 * target.h: (class Task): Add forward declaration.
5544 (Target::relax): Add new parameter TASK and pass it to
5546 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
5548 2010-11-05 Cary Coutant <ccoutant@google.com>
5551 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
5552 object when reading from the file.
5553 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
5555 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
5556 when reading section contents.
5557 (get_section_contents): Likewise.
5558 (icf::find_identical_sections): Likewise.
5559 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
5560 object when reading from the file.
5561 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
5562 the object when doing deferred section layout.
5564 2010-11-03 Nick Clifton <nickc@redhat.com>
5567 * script.h (class Symbol_assignment: name): New member. Returns
5568 the name of the symbol.
5569 * scrfipt.cc (Script_options::is_pending_assignment): New member.
5570 Returns true if the given symbol name is on the list of
5571 assignments wating to be processed.
5572 * archive.cc (should_incldue_member): If the symbol is undefined,
5573 check to see if it is on the list of symbols pending assignment.
5575 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
5577 * script-sections.cc (Script_sections::find_memory_region): Check
5578 for a NULL output section pointer.
5580 2010-10-29 Doug Kwan <dougkwan@google.com>
5582 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
5583 Output_section::add_relaxed_input_section.
5584 * output.cc (Output_section::add_relaxed_input_section): Add new
5585 arguments LAYOUT and NAME. Set section order index.
5586 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5587 Copy section order index.
5588 * output.h (Output_section::add_relaxed_input_section): Add new
5589 arguments LAYOUT and NAME.
5591 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5593 * testsuite/Makefile.am: Move gcctestdir/ld rule to
5594 NATIVE_OR_CROSS_LINKER.
5595 * testsuite/Makefile.in: Regenerate.
5597 2010-10-20 Doug Kwan <dougkwan@google.com>
5599 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
5600 without SHF_LINK_ORDER flags.
5601 * layout.cc (Layout::choose_output_section): Do not filter
5602 SHF_LINK_ORDER flag in a relocatable link.
5604 2010-10-17 Cary Coutant <ccoutant@google.com>
5606 * output.h (Output_segment::set_section_addresses): Change function
5607 signature. Update all callers.
5608 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
5610 (Output_segment::set_section_addresses): Align after last TLS
5611 section. Add padding before last relro section instead of after.
5613 2010-10-17 Doug Kwan <dougkwan@google.com>
5615 * gold/arm.cc (Target_arm::got_section): Use correct order and set
5616 GOT output section to be writable.
5618 2010-10-14 Cary Coutant <ccoutant@google.com>
5620 * debug.h (DEBUG_INCREMENTAL): New flag.
5621 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
5622 * gold.cc (queue_initial_tasks): Check parameters for incremental link
5624 * incremental.cc (report_command_line): Ignore all forms of
5626 * layout.cc (Layout::Layout): Check parameters for incremental link
5628 * options.cc (General_options::parse_incremental): New function.
5629 (General_options::parse_no_incremental): New function.
5630 (General_options::parse_incremental_full): New function.
5631 (General_options::parse_incremental_update): New function.
5632 (General_options::incremental_mode_): New data member.
5633 (General_options::finalize): Check incremental_mode_.
5634 * options.h (General_options): Update help text for --incremental.
5635 Add --no-incremental, --incremental-full, --incremental-update.
5636 (General_options::Incremental_mode): New enum type.
5637 (General_options::incremental_mode): New function.
5638 (General_options::incremental_mode_): New data member.
5639 * parameters.cc (Parameters::incremental_mode_): New data member.
5640 (Parameters::set_options): Set incremental_mode_.
5641 (Parameters::set_incremental_full): New function.
5642 (Parameters::incremental): New function.
5643 (Parameters::incremental_update): New function.
5644 (set_parameters_incremental_full): New function.
5645 * parameters.h (Parameters::set_incremental_full): New function.
5646 (Parameters::incremental): New function.
5647 (Parameters::incremental_update): New function.
5648 (Parameters::incremental_mode_): New data member.
5649 (set_parameters_incremental_full): New function.
5650 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
5651 incremental link mode.
5652 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
5653 (Sized_relobj::do_relocate_sections): Likewise.
5654 * testsuite/Makefile.am (incremental_test): Use --incremental-full
5656 * testsuite/Makefile.in: Regenerate.
5657 * testsuite/incremental_test.sh: Filter all forms of --incremental.
5659 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5661 * script-sections.h (class Script_sections): Make
5662 Sections_elements typedef public.
5663 * script-sections.cc (class Sort_output_sections): Add elements_
5664 field. Add constructor which sets it; change all callers.
5665 (Sort_output_sections::is_before): New function.
5666 (Sort_output_sections::operator()): Call is_before.
5667 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
5669 * testsuite/script_test_10.sh: New test. Test script section
5671 * testsuite/script_test_10.t: Likewise.
5672 * testsuite/script_test_10.s: Likewise.
5673 * testsuite/Makefile.am: Wrap the cross linker tests and the
5674 common tests into NATIVE_OR_CROSS_LINKER.
5675 (check_SCRIPTS): Add script_test_10.sh.
5676 (check_DATA): Add script_test_10.stdout.
5677 (script_test_10.o, script_test_10): New targets.
5678 (script_test_10.stdout): New target.
5679 * configure, testsuite/Makefile.in: Regenerate.
5681 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5683 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
5684 error for the deprecated relocations.
5685 (Target_arm::Scan::global): Likewise.
5686 (Target_arm::Relocate::relocate): Likewise.
5688 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
5690 * fileread.cc (Input_file::find_file): Initialize *found_name
5691 and *namep when using the fallback search for case 4.
5693 2010-10-11 Cary Coutant <ccoutant@google.com>
5695 * options.h (class General_options): Redefine -z lazy as an alias for
5696 the negation of -z now.
5698 2010-10-11 Ian Lance Taylor <iant@google.com>
5700 * resolve.cc (symbol_to_bits): Report the value of the unsupported
5703 2010-10-06 Nick Clifton <nickc@redhat.com>
5705 * script-sections.cc(class Memory_region): Remove
5706 current_lma_offset_ field. Rename current_vma_offset_ to
5707 current_offset_. Add last_section_ field.
5708 (Memory_region::get_current_vma_address): Rename to
5709 get_current_address.
5710 (Memory_region::get_current_lma_address): Delete.
5711 (Memory_region::increment_vma_offset): Rename to
5713 (Memory_region::increment_lma_offset): Delete.
5714 (Memory_region::attributes_compatible): New method. Returns
5715 true if the provided section is compatible with the region.
5716 (Memory_region::get_last_section): New method. Returns the last
5717 section to use the region.
5718 (Memory_region::set_last_section): New method. Stores the last
5719 section to use the region.
5720 (Script_sections::block_in_region): New method. Returns true if
5721 a block of memory is contained within a region.
5722 (Script_sections::find_memory_region): New method. Locates a
5723 memory region to be used to set a VMA or LMA address.
5724 (Output_section_definition::set_section_addresses): Add code to
5725 check for addresses set by memory regions.
5726 (Output_segment::set_section_addresses): Remove memory region
5728 (Script_sections::create_segment): Add a warning if a header
5729 segment is created outside of any region.
5730 * script-sections.h (class Script_sections): Add prototypes for
5731 find_memory_region and block_in_region methods.
5732 * testsuite/memory_test.s: Use .long instead of .word.
5733 * testsuite/memory_test.t: Add some more output sections.
5734 * testsuite/memory_test.sh: Update expected output.
5736 2010-10-02 Doug Kwan <dougkwan@google.com>
5738 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
5739 defintion to symtab.h
5740 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
5741 declaration to defintion.
5743 2010-10-01 Nick Clifton <nickc@redhat.com>
5745 * expression.cc (eval): Replace dummy argument with NULL.
5746 (eval_maybe_dot): Check for a NULL result section pointer.
5747 (Symbol_expression::value): Likewise.
5748 (Dot_expression::value): Likewise.
5749 (BINARY_EXPRESSION): Likewise.
5750 (Max_expression::value): Likewise.
5751 (Min_expression::value): Likewise.
5752 (Absolute_expression::value): Likewise.
5753 (Addr_expression::value_from_output_section): Likewise.
5754 (Loaddddr_expression::value_from_output_section): Likewise.
5755 (Segment_start_expression::value): Likewise.
5756 * script-sections.cc
5757 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
5759 (Sections_elememt_dot_assignment::set_section_addresses):
5761 (Output_data_expression::do_write_to_buffer): Likewise.
5762 (Output_section_definition::finalize_symbols): Likewise.
5763 (Output_section_definition::set_section_addresses): Likewise.
5765 2010-09-30 Doug Kwan <dougkwan@google.com>
5767 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
5769 2010-09-28 Sriraman Tallam <tmsriram@google.com>
5771 * target.h (Target::can_icf_inline_merge_sections): New virtual
5773 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
5775 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
5777 * icf.cc (get_section_contents): Inline merge sections only when
5780 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5782 * configure: Regenerate.
5784 2010-09-17 Ian Lance Taylor <iant@google.com>
5786 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
5787 * testsuite/Makefile.am (memory_test.o): New target.
5788 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
5790 * testsuite/Makefile.in: Rebuild.
5792 2010-09-17 Doug Kwan <dougkwan@google.com>
5794 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
5795 defintion if relocation uses GOT entries of the symbol.
5796 * testsuite/icf_safe_test.sh: Fix test.
5797 * testsuite/icf_safe_so_test.sh: Fix test.
5799 2010-09-16 Cary Coutant <ccoutant@google.com>
5801 * script_sections.cc (class Memory_region): Remove "NULL" from
5802 vector initializations.
5804 2010-09-15 Cary Coutant <ccoutant@google.com>
5806 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
5807 Resolve forwarding symbols.
5809 2010-09-15 Doug Kwan <dougkwan@google.com>
5811 * gold/testsuite/script_test_3.t: Add ARM special sections.
5812 * gold/testsuite/script_test_4.t: Same.
5813 * gold/testsuite/script_test_5.t: Same.
5814 * gold/testsuite/script_test_6.t: Same.
5815 * gold/testsuite/script_test_7.t: Same.
5816 * gold/testsuite/script_test_7.t: Same.
5817 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
5819 2010-09-14 Cary Coutant <ccoutant@google.com>
5821 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
5822 (Target_x86_64::Relocate::relocate_tls): Replace check for
5823 saw_tls_block_reloc_ with test for executable section.
5825 2010-09-12 Cary Coutant <ccoutant@google.com>
5827 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
5828 position-independent executables to shared libraries need dynamic
5830 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
5831 position-independent executables.
5832 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
5833 * testsuite/Makefile.in: Regenerate.
5835 2010-09-10 Nick Clifton <nickc@redhat.com>
5838 * testsuite/memory_test.t: Discard any sections that are not
5841 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
5844 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
5845 "This::" to work around a bug in gcc 4.2.
5847 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
5849 2010-09-09 Rafael Espindola <espindola@google.com>
5851 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
5852 sections with different PF_X flags in the same segment.
5853 (Layout::find_first_load_seg): Search all segments to find the first
5855 * options.h (rosegment): New.
5857 2010-09-08 Rafael Espindola <espindola@google.com>
5859 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
5861 2010-09-08 Doug Kwan <dougkwan@google.com>
5863 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
5864 (Arm_relobj::do_relocate_sections): Add new parameter for output
5865 file to match the parent.
5866 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
5867 of local symbols instead of input values. Update code to track
5868 changes in gold::relocate_section.
5869 * object.cc (Sized_relobj::compute_final_local_value): New methods.
5870 (Sized_relobj::compute_final_local_value_internal): New methods.
5871 (Sized_relobj::do_finalize_local_symbols): Move code from loop
5872 body into private version of Sized_relobj::compute_final_local_value.
5873 Call the inline method.
5874 * object.h (Symbol_value::Symbol_value): Define destructor. Free
5875 merged symbol value if there is one.
5876 (Symbol_value::has_output_value): New method defintiion.
5877 (Sized_relobj::Compute_final_local_value_status): New enum type.
5878 (Sized_relobj::compute_final_local_value): New methods.
5879 (Sized_relobj::compute_final_local_value_internal): New methods.
5880 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
5881 and arm_cortex_a8.sh.
5882 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
5883 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
5885 * Makefile.in: Regenerate.
5886 * testsuite/arm_bl_out_of_range.s: Update test.
5887 * testsuite/thumb_bl_out_of_range.s: Ditto.
5888 * testsuite/thumb_blx_out_of_range.s: Ditto.
5889 * testsuite/arm_branch_out_of_range.sh: New file.
5890 * testsuite/arm_cortex_a8.sh: Ditto.
5891 * testsuite/arm_cortex_a8_b.s: Ditto.
5892 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
5893 * testsuite/arm_cortex_a8_b_local.s: Ditto.
5894 * testsuite/arm_cortex_a8_bl.s: Ditto.
5895 * testsuite/arm_cortex_a8_blx.s: Ditto.
5896 * testsuite/arm_cortex_a8_local.s: Ditto.
5897 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
5898 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
5900 2010-09-08 Rafael Espindola <espindola@google.com>
5902 * Makefile.am (memory_test.stdout): Run readelf with -W.
5903 * Makefile.in: Regenerate.
5904 * testsuite/memory_test.sh: Make the regexps accept both 32 and
5907 2010-09-08 Rafael Espindola <espindola@google.com>
5909 * script-sections.cc (Script_sections::add_memory_region): Convert
5910 field precision to int.
5911 * script.cc (script_set_section_region, script_set_section_region):
5912 Convert field precision to int.
5914 2010-09-08 Rafael Espindola <espindola@google.com>
5916 * arm.cc (do_finalize_sections): Create the __exidx_start and
5917 __exdix_end symbols even when the section is missing.
5919 2010-09-08 Nick Clifton <nickc@redhat.com>
5921 * README: Remove claim that MEMORY is not supported.
5922 * expression.cc (script_exp_function_origin)
5923 (script_exp_function_length): Move from here to ...
5924 * script.cc: ... here.
5925 (script_set_section_region, script_add_memory)
5926 (script_parse_memory_attr, script_include_directive): New
5928 * script-sections.cc
5929 (class Memory_region): New class.
5930 (class Output_section_definition): Add set_memory_region,
5931 set_section_vma, set_section_lma and get_section_name methods.
5932 (class Script_Sections): Add add_memory_region,
5933 find_memory_region, find_memory_region_origin,
5934 find_memory_region_length and set_memory_region methods.
5935 Have set_section_addresses method walk the list of set memory
5937 Extend the print methos to display memory regions.
5938 * script-sections.h: Add prototypes for new methods.
5939 Add enum for MEMORY region attributes.
5940 * yyscript.y: Add support for parsing MEMORY regions.
5941 * script-c.h: Add prototypes for new functions.
5942 * testsuite/Makefile.am: Add test of MEMORY region functionality.
5943 * testsuite/Makefile.in: Regenerate.
5944 * testsuite/memory_test.sh: New script.
5945 * testsuite/memory_test.s: New assembler source file.
5946 * testsuite/memory_test.t: New linker script.
5948 2010-08-27 Doug Kwan <dougkwan@google.com>
5950 * gold/resolve.cc (Symbol_table::should_override): Let a weak
5951 reference override an existing dynamic weak reference.
5952 * testsuite/Makefile.am: Add new test dyn_weak_ref.
5953 * testsuite/Makefile.in: Regenerate.
5954 * testsuite/dyn_weak_ref.sh: New file.
5955 * testsuite/dyn_weak_ref_1.c: Ditto.
5956 * testsuite/dyn_weak_ref_2.c: Ditto.
5958 2010-08-27 Ian Lance Taylor <iant@google.com>
5960 * incremental.h (class Incremental_input_entry): Add virtual
5963 2010-08-27 Ian Lance Taylor <iant@google.com>
5965 * testsuite/start_lib_test_3.c: Mark t3 as used.
5967 2010-08-27 Nick Clifton <nickc@redhat.com>
5969 * options.cc (version_script): Fix small typo in previous
5972 2010-08-25 Nick Clifton <nickc@redhat.com>
5974 * archive.cc: Formatting fixes: Remove whitespace between
5975 typename and following asterisk. Remove whitespace between
5976 function name and opening parenthesis.
5977 * archive.h: Likewise.
5979 * attributes.cc: Likewise.
5980 * attributes.h: Likewise.
5981 * common.cc: Likewise.
5982 * copy-relocs.cc: Likewise.
5983 * dirsearch.h: Likewise.
5984 * dynobj.cc: Likewise.
5985 * ehframe.cc: Likewise.
5986 * ehframe.h: Likewise.
5987 * expression.cc: Likewise.
5988 * fileread.cc: Likewise.
5989 * fileread.h: Likewise.
5991 * gold-threads.cc: Likewise.
5992 * gold.cc: Likewise.
5993 * i386.cc: Likewise.
5995 * incremental-dump.cc: Likewise.
5996 * incremental.cc: Likewise.
5997 * layout.cc: Likewise.
5998 * layout.h: Likewise.
5999 * main.cc: Likewise.
6000 * merge.cc: Likewise.
6001 * merge.h: Likewise.
6002 * object.cc: Likewise.
6003 * object.h: Likewise.
6004 * options.cc: Likewise.
6005 * options.h: Likewise.
6006 * output.cc: Likewise.
6007 * output.h: Likewise.
6008 * plugin.cc: Likewise.
6009 * plugin.h: Likewise.
6010 * powerpc.cc: Likewise.
6011 * reloc.cc: Likewise.
6012 * script-c.h: Likewise.
6013 * script-sections.cc: Likewise.
6014 * script.cc: Likewise.
6015 * stringpool.cc: Likewise.
6016 * symtab.cc: Likewise.
6017 * symtab.h: Likewise.
6018 * target.cc: Likewise.
6019 * timer.cc: Likewise.
6020 * timer.h: Likewise.
6021 * version.cc: Likewise.
6022 * x86_64.cc: Likewise.
6024 2010-08-24 Nick Clifton <nickc@redhat.com>
6027 * layout.cc (segment_precedes): Sort segments by their physical
6028 addresses, if they have been set.
6030 2010-08-23 Cary Coutant <ccoutant@google.com>
6032 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
6034 (Lib_group::include_member): Unlock object after deleting its
6036 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
6039 2010-08-19 Neil Vachharajani <nvachhar@google.com>
6040 Cary Coutant <ccoutant@google.com>
6042 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
6043 constructor, and set_blocker.
6044 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
6046 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
6047 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
6048 * testsuite/Makefile.am (start_lib_test): New test case.
6049 * testsuite/Makefile.in: Regenerate.
6050 * testsuite/start_lib_test_main.c: New file.
6051 * testsuite/start_lib_test_1.c: New file.
6052 * testsuite/start_lib_test_2.c: New file.
6053 * testsuite/start_lib_test_3.c: New file.
6055 2010-08-19 Ian Lance Taylor <iant@google.com>
6057 * Makefile.in: Rebuild with automake 1.11.1.
6058 * aclocal.m4: Likewise.
6059 * testsuite/Makefile.in: Likewise.
6061 2010-08-19 Ian Lance Taylor <iant@google.com>
6064 * i386.cc (class Output_data_plt_i386): Update declarations.
6065 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
6066 local_ifuncs_ fields.
6067 (Target_i386::do_plt_section_for_global): New function.
6068 (Target_i386::do_plt_section_for_local): New function.
6069 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
6070 parameter; change all callers. Initialize global_ifuncs_ and
6071 local_ifuncs_. If doing a static link define __rel_iplt_start and
6073 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
6074 (Output_data_plt_i386::add_local_ifunc_entry): New function.
6075 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
6077 (Target_i386::make_plt_section): New function, broken out of
6078 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
6079 (Target_i386::make_plt_entry): Call make_plt_section.
6080 (Target_i386::make_local_ifunc_plt_entry): New function.
6081 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
6082 (Target_i386::Scan::local): Handle IFUNC symbols. Add
6083 R_386_IRELATIVE to switch.
6084 (Target_i386::Scan::global): Likewise.
6085 (Target_i386::Relocate::relocate): Likewise.
6086 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
6088 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
6089 (Target_x86_64::do_plt_section_for_global): New function.
6090 (Target_x86_64::do_plt_section_for_local): New function.
6091 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
6092 parameter; change all callers. If doing a static link define
6093 __rela_iplt_start and __rela_iplt_end.
6094 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
6095 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
6096 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
6098 (Target_x86_64::make_local_ifunc_plt_entry): New function.
6099 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
6101 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
6102 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
6103 R_X86_64_IRELATIVE to switch.
6104 (Target_x86_64::Scan::global): Likewise.
6105 (Target_x86_64::Relocate::relocate): Likewise.
6106 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
6108 * target.h (class Target): Add plt_section_for_global and
6109 plt_section_for_local functions. Add do_plt_section_for_global
6110 and do_plt_section_for_local virtual functions.
6111 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
6112 clarifying comments.
6113 (Symbol::use_plt_offset): Handle IFUNC symbol.
6114 * object.cc (Sized_relobj::Sized_relobj): Initialize
6116 (Sized_relobj::local_has_plt_offset): New function.
6117 (Sized_relobj::local_plt_offset): New function.
6118 (Sized_relobj::set_local_plt_offset): New function.
6119 (Sized_relobj::do_count): Handle IFUNC symbol.
6120 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
6121 a bit away from input_shndx_ field. Add set_is_func_symbol and
6122 is_ifunc_symbol functions.
6123 (class Sized_relobj): Update declarations. Remove Tls_got_entry
6124 and Local_tls_got_offsets. Define Local_plt_offsets. Add
6125 local_plt_offsets_ field.
6126 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
6127 * output.h (class Output_section_data): Add non-const
6128 output_section function.
6129 (class Output_data_got): Update declarations.
6130 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
6131 Add use_plt_offset parameter to global and local constructors.
6132 Change all callers. Change local_sym_index_ field to 31 bits.
6133 Change GSYM_CODE and CONSTANT_CODE accordingly.
6134 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
6135 doing a static link don't set sh_link field.
6136 (Output_data_got::Got_entry::write): Use PLT offset if
6138 (Output_data_got::add_global_plt): New function.
6139 (Output_data_got::add_local_plt): New function.
6140 * target-reloc.h (relocate_section): Handle IFUNC symbol.
6141 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
6142 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
6143 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
6144 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
6146 * testsuite/ifunc-sel.h: New file.
6147 * testsuite/ifuncmain1.c: New file.
6148 * testsuite/ifuncmain1vis.c: New file.
6149 * testsuite/ifuncmod1.c: New file.
6150 * testsuite/ifuncdep2.c: New file.
6151 * testsuite/ifuncmain2.c: New file.
6152 * testsuite/ifuncmain3.c: New file.
6153 * testsuite/ifuncmod3.c: New file.
6154 * testsuite/ifuncmain4.c: New file.
6155 * testsuite/ifuncmain5.c: New file.
6156 * testsuite/ifuncmod5.c: New file.
6157 * testsuite/ifuncmain6pie.c: New file.
6158 * testsuite/ifuncmod6.c: New file.
6159 * testsuite/ifuncmain7.c: New file.
6160 * configure, testsuite/Makefile.in: Rebuild.
6162 2010-08-18 Ian Lance Taylor <iant@google.com>
6165 (Output_section_incremental_inputs::write_input_files): Add cast
6166 to avoid signed/unsigned comparison warning.
6167 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6169 2010-08-12 Cary Coutant <ccoutant@google.com>
6171 * common.cc (Sort_commons::operator()): Remove unnecessary code.
6173 2010-08-13 Ian Lance Taylor <iant@google.com>
6175 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
6177 2010-08-12 Cary Coutant <ccoutant@google.com>
6178 Doug Kwan <dougkwan@google.com>
6180 * resolve.cc (Symbol_table::should_override): When a weak dynamic
6181 defintion overrides non-weak undef, remember that the original undef
6183 * symtab.cc (Symbol_table::sized_write_global): For undef without
6184 an original weak binding, set binding to global in output.
6185 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
6186 * testsuite/Makefile.in: Regenerate.
6187 * testsuite/strong_ref_weak_def.sh: New file.
6188 * testsuite/strong_ref_weak_def_1.c: Ditto.
6189 * testsuite/strong_ref_weak_def_2.c: Ditto.
6191 2010-08-12 Cary Coutant <ccoutant@google.com>
6193 * testsuite/incremental_test.sh: Rewrite.
6194 * testsuite/incremental_test_1.c: Rewrite.
6195 * testsuite/incremental_test_2.c: Rewrite.
6197 2010-08-12 Cary Coutant <ccoutant@google.com>
6199 * arm.cc (Target_arm::got_size): Add const.
6200 (Target_arm::got_entry_count): New function.
6201 (Target_arm::plt_entry_count): New function.
6202 (Target_arm::first_plt_entry_offset): New function.
6203 (Target_arm::plt_entry_size): New function.
6204 (Output_data_plt_arm::entry_count): New function.
6205 (Output_data_plt_arm::first_plt_entry_offset): New function.
6206 (Output_data_plt_arm::get_plt_entry_size): New function.
6207 * i386.cc (Target_i386::got_size): Add const.
6208 (Target_i386::got_entry_count): New function.
6209 (Target_i386::plt_entry_count): New function.
6210 (Target_i386::first_plt_entry_offset): New function.
6211 (Target_i386::plt_entry_size): New function.
6212 (Output_data_plt_i386::entry_count): New function.
6213 (Output_data_plt_i386::first_plt_entry_offset): New function.
6214 (Output_data_plt_i386::get_plt_entry_size): New function.
6215 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
6216 find_incremental_inputs_sections. Dump incremental_got_plt section.
6217 * incremental.cc: Include target.h.
6218 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
6219 parameter. Adjust all callers. Find incremental_got_plt section.
6220 (Incremental_inputs::create_data_sections): Create incremental_got_plt
6222 (Output_section_incremental_inputs::set_final_data_size): Calculate
6223 size of incremental_got_plt section.
6224 (Output_section_incremental_inputs::do_write): Write the
6225 incremental_got_plt section.
6226 (Got_plt_view_info): New struct.
6227 (Local_got_offset_visitor): New class.
6228 (Global_got_offset_visitor): New class.
6229 (Global_symbol_visitor_got_plt): New class.
6230 (Output_section_incremental_inputs::write_got_plt): New function.
6231 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
6232 Add parameter. Adjust all callers.
6233 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6234 (Incremental_inputs::got_plt_section): New function.
6235 (Incremental_inputs::got_plt_section_): New data member.
6236 (Incremental_got_plt_reader): New class.
6237 * layout.cc (Layout::create_incremental_info_sections): Add the
6238 incremental_got_plt section.
6239 * object.h (Got_offset_list::get_list): New function.
6240 (Got offset_list::for_all_got_offsets): New function.
6241 (Sized_relobj::local_got_offset_list): New function.
6242 * powerpc.cc (Target_powerpc::got_size): Add const.
6243 (Target_powerpc::got_entry_count): New function.
6244 (Target_powerpc::plt_entry_count): New function.
6245 (Target_powerpc::first_plt_entry_offset): New function.
6246 (Target_powerpc::plt_entry_size): New function.
6247 (Output_data_plt_powerpc::entry_count): New function.
6248 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
6249 (Output_data_plt_powerpc::get_plt_entry_size): New function.
6250 * sparc.cc (Target_sparc::got_size): Add const.
6251 (Target_sparc::got_entry_count): New function.
6252 (Target_sparc::plt_entry_count): New function.
6253 (Target_sparc::first_plt_entry_offset): New function.
6254 (Target_sparc::plt_entry_size): New function.
6255 (Output_data_plt_sparc::entry_count): New function.
6256 (Output_data_plt_sparc::first_plt_entry_offset): New function.
6257 (Output_data_plt_sparc::get_plt_entry_size): New function.
6258 * symtab.h (Symbol::got_offset_list): New function.
6259 (Symbol_table::for_all_symbols): New function.
6260 * target.h (Sized_target::got_entry_count): New function.
6261 (Sized_target::plt_entry_count): New function.
6262 (Sized_target::plt_entry_size): New function.
6263 * x86_64.cc (Target_x86_64::got_size): Add const.
6264 (Target_x86_64::got_entry_count): New function.
6265 (Target_x86_64::plt_entry_count): New function.
6266 (Target_x86_64::first_plt_entry_offset): New function.
6267 (Target_x86_64::plt_entry_size): New function.
6268 (Output_data_plt_x86_64::entry_count): New function.
6269 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
6270 (Output_data_plt_x86_64::get_plt_entry_size): New function.
6272 2010-08-12 Cary Coutant <ccoutant@google.com>
6274 * archive.cc: Include incremental.h.
6275 (Archive::Archive): Initialize incremental_info_.
6276 (Archive::include_member): Record archive members in incremental info.
6277 (Add_archive_symbols::run): Record begin and end of an archive in
6279 (Lib_group::include_member): Record objects in incremental info.
6280 * archive.h (Incremental_archive_entry): Forward declaration.
6281 (Archive::set_incremental_info): New member function.
6282 (Archive::incremental_info): New member function.
6283 (Archive::Unused_symbol_iterator): New class.
6284 (Archive::unused_symbols_begin): New member function.
6285 (Archive::unused_symbols_end): New member function.
6286 (Archive::incremental_info_): New data member.
6287 * incremental-dump.cc (find_input_containing_global): New function.
6288 (dump_incremental_inputs): Dump new incremental info sections.
6289 * incremental.cc: Include symtab.h.
6290 (Output_section_incremental_inputs): New class.
6291 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
6292 new incremental info sections.
6293 (Sized_incremental_binary::do_check_inputs): Likewise.
6294 (Incremental_inputs::report_archive): Remove.
6295 (Incremental_inputs::report_archive_begin): New function.
6296 (Incremental_inputs::report_archive_end): New function.
6297 (Incremental_inputs::report_object): New function.
6298 (Incremental_inputs::finalize_inputs): Remove.
6299 (Incremental_inputs::report_input_section): New function.
6300 (Incremental_inputs::report_script): Rewrite.
6301 (Incremental_inputs::finalize): Do nothing but finalize string table.
6302 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6303 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6304 (Incremental_inputs::create_data_sections): New function.
6305 (Incremental_inputs::relocs_entsize): New function.
6306 (Output_section_incremental_inputs::set_final_data_size): New function.
6307 (Output_section_incremental_inputs::do_write): New function.
6308 (Output_section_incremental_inputs::write_header): New function.
6309 (Output_section_incremental_inputs::write_input_files): New function.
6310 (Output_section_incremental_inputs::write_info_blocks): New function.
6311 (Output_section_incremental_inputs::write_symtab): New function.
6312 * incremental.h (Incremental_script_entry): Forward declaration.
6313 (Incremental_object_entry): Forward declaration.
6314 (Incremental_archive_entry): Forward declaration.
6315 (Incremental_inputs): Forward declaration.
6316 (Incremental_inputs_header_data): Remove.
6317 (Incremental_inputs_header): Remove.
6318 (Incremental_inputs_header_write): Remove.
6319 (Incremental_inputs_entry_data): Remove.
6320 (Incremental_inputs_entry): Remove.
6321 (Incremental_inputs_entry_write): Remove.
6322 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
6323 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
6324 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6325 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
6327 (Incremental_input_entry): New class.
6328 (Incremental_script_entry): New class.
6329 (Incremental_object_entry): New class.
6330 (Incremental_archive_entry): New class.
6331 (Incremental_inputs::Incremental_inputs): Initialize new data members.
6332 (Incremental_inputs::report_inputs): Remove.
6333 (Incremental_inputs::report_archive): Remove.
6334 (Incremental_inputs::report_archive_begin): New function.
6335 (Incremental_inputs::report_archive_end): New function.
6336 (Incremental_inputs::report_object): Change prototype.
6337 (Incremental_inputs::report_input_section): New function.
6338 (Incremental_inputs::report_script): Change prototype.
6339 (Incremental_inputs::get_reloc_count): New function.
6340 (Incremental_inputs::set_reloc_count): New function.
6341 (Incremental_inputs::create_data_sections): New function.
6342 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6343 (Incremental_inputs::inputs_section): New function.
6344 (Incremental_inputs::symtab_section): New function.
6345 (Incremental_inputs::relocs_section): New function.
6346 (Incremental_inputs::get_stringpool): Add const.
6347 (Incremental_inputs::command_line): Add const.
6348 (Incremental_inputs::inputs): Remove.
6349 (Incremental_inputs::command_line_key): New function.
6350 (Incremental_inputs::input_file_count): New function.
6351 (Incremental_inputs::input_files): New function.
6352 (Incremental_inputs::relocs_entsize): New function.
6353 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6354 (Incremental_inputs::finalize_inputs): Remove.
6355 (Incremental_inputs::Input_info): Remove.
6356 (Incremental_inputs::lock_): Remove.
6357 (Incremental_inputs::inputs_): Change type.
6358 (Incremental_inputs::inputs_map_): Remove.
6359 (Incremental_inputs::current_object_entry_): New data member.
6360 (Incremental_inputs::inputs_section_): New data member.
6361 (Incremental_inputs::symtab_section_): New data member.
6362 (Incremental_inputs::relocs_section_): New data member.
6363 (Incremental_inputs::reloc_count_): New data member.
6364 (Incremental_inputs_reader): New class.
6365 (Incremental_symtab_reader): New class.
6366 (Incremental_relocs_reader): New class.
6367 * layout.cc (Layout::finalize): Move finalization of incremental info
6368 and creation of incremental info sections to follow finalization of
6369 symbol table. Set offsets for postprocessing sections.
6370 (Layout::create_incremental_info_sections): Call
6371 Incremental_inputs::create_data_sections. Add incremental symtab
6372 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
6373 sections to layout after input sections.
6374 * layout.h (struct Timespec): Forward declaration.
6375 (Layout::incremental_inputs): Add const.
6376 (Layout::create_incremental_info_sections): Add parameter.
6377 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
6378 * object.cc: Include incremental.h.
6379 (Relobj::finalize_incremental_relocs): New function.
6380 (Sized_relobj::do_layout): Record input sections in incremental info.
6381 * object.h (Object::output_section): New function.
6382 (Object::output_section_offset): Moved from Relobj.
6383 (Object::get_incremental_reloc_base): New function.
6384 (Object::get_incremental_reloc_count): New function.
6385 (Object::do_output_section): New function.
6386 (Object::do_output_section_offset): Moved from Relobj.
6387 (Object::do_get_incremental_reloc_base): New function.
6388 (Object::do_get_incremental_reloc_count): New function.
6389 (Object::Object): Initialize new data members.
6390 (Relobj::output_section): Renamed do_output_section and moved to
6392 (Relobj::output_section_offset): Moved to Object.
6393 (Relobj::do_get_incremental_reloc_base): New function.
6394 (Relobj::do_get_incremental_reloc_count): New function.
6395 (Relobj::allocate_incremental_reloc_counts): New function.
6396 (Relobj::count_incremental_reloc): New function.
6397 (Relobj::finalize_incremental_relocs): New function.
6398 (Relobj::next_incremental_reloc_index): New function.
6399 (Relobj::reloc_counts_): New data member.
6400 (Relobj::reloc_bases_): New data member.
6401 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
6402 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
6403 (Sized_relobj::incremental_relocs_scan): New function.
6404 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6405 (Sized_relobj::incremental_relocs_write): New function.
6406 (Sized_relobj::incremental_relocs_write_reltype): New function.
6407 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
6409 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
6410 archives and object files elsewhere.
6411 (Add_symbols::run): Report object files here.
6412 (Finish_group::run): Report end of archive at end of group.
6413 * reloc.cc: Include layout.h, incremental.h.
6414 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
6415 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
6416 (Sized_relobj::incremental_relocs_scan): New function.
6417 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6418 (Sized_relobj::do_relocate_sections): Write incremental relocations.
6419 (Sized_relobj::incremental_relocs_write): New function.
6420 (Sized_relobj::incremental_relocs_write_reltype): New function.
6421 * script.cc (read_input_script): Rewrite test for incremental link.
6422 Change call to Incremental_inputs::report_script.
6423 * symtab.h (Symbol_table::first_global_index): New function.
6424 (Symbol_table::output_count): New function.
6426 2010-08-12 Doug Kwan <dougkwan@google.com>
6428 * arm.cc (Target_arm::merge_object_attributes): Check command line
6429 options --no-wchar-size-warning and --no-enum-size-warning.
6430 * options.h (General_options): Add ld-compatible options
6431 --no-enum-size-warning and --no-wchar-size-warning.
6433 2010-08-04 Ian Lance Taylor <iant@google.com>
6435 * x86_64.cc (Target_x86_64::Scan::local): Use
6436 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
6437 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
6438 (Target_x86_64::Scan::global): Likewise.
6439 (Target_x86_64::Relocate::relocate): Likewise.
6440 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
6443 2010-08-03 Cary Coutant <ccoutant@google.com>
6445 * merge.cc (Output_merge_string::do_add_input_section): Count strings
6446 to reserve space in merged_strings vector. Keep total input size
6448 (Output_merge_string::do_print_merge_stats): Print total input size.
6449 * merge.h (Output_merge_string): Add input_size_ field.
6450 * stringpool.cc (Stringpool_template::string_length): Move
6451 implementations out of Stringpool_template class and place in
6453 * stringpool.h (string_length): Move out of Stringpool_template.
6455 2010-08-03 Ian Lance Taylor <iant@google.com>
6458 * layout.cc (relaxation_loop_body): If address of load segment is
6459 set, adjust address to include headers if possible.
6461 2010-08-03 Ian Lance Taylor <iant@google.com>
6463 * version.cc (version_string): Bump to 1.10.
6465 2010-08-03 Ian Lance Taylor <iant@google.com>
6468 * layout.h (enum Output_section_order): Define.
6469 (class Layout): Update declarations.
6470 * layout.cc (Layout::get_output_section): Add order parameter.
6471 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
6472 is_first_non_relro parameters. Change all callers.
6473 (Layout::choose_output_section): Likewise.
6474 (Layout::add_output_section_data): Likewise.
6475 (Layout::make_output_section): Likewise. Set order.
6476 (Layout::default_section_order): New function.
6477 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
6478 * output.cc (Output_section::Output_section): Initialize order_.
6479 Don't initialize deleted fields.
6480 (Output_segment::Output_segment): Don't initialize deleted
6482 (Output_segment::add_output_section_to_load): New function
6483 replacing add_output_section. Change all callers to call this or
6484 add_output_section_to_nonload.
6485 (Output_segment::add_output_section_to_nonload): New function.
6486 (Output_segment::remove_output_section): Rewrite.
6487 (Output_segment::add_initial_output_data): Likewise.
6488 (Output_segment::has_any_data_sections): Likewise.
6489 (Output_segment::is_first_section_relro): Likewise.
6490 (Output_segment::maximum_alignment): Likewise.
6491 (Output_segment::has_dynamic_reloc): New function replacing
6492 dynamic_reloc_count. Change all callers.
6493 (Output_segment::has_dynamic_reloc_list): New function replacing
6494 dynamic_reloc_count_list. Change all callers.
6495 (Output_segment::set_section_addresses): Rewrite.
6496 (Output_segment::set_offset): Rewrite.
6497 (Output_segment::find_first_and_last_list): Remove.
6498 (Output_segment::set_tls_offsets): Rewrite.
6499 (Output_segment::first_section_load_address): Likewise.
6500 (Output_segment::output_section_count): Likewise.
6501 (Output_segment::section_with_lowest_load_address): Likewise.
6502 (Output_segment::write_section_headers): Likewise.
6503 (Output_segment::print_sections_to_map): Likewise.
6504 * output.h (class Output_data): Remove dynamic_reloc_count_
6505 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
6506 (Output_data::add_dynamic_reloc): Rewrite.
6507 (Output_data::has_dynamic_reloc): New function.
6508 (Output_data::dynamic_reloc_count): Remove.
6509 (class Output_section): Add order_ field. Remvoe is_relro_local_,
6510 is_last_relro_, is_first_non_relro_, is_interp_,
6511 is_dynamic_linker_section_ fields. Add order and set_order
6512 functions. Remove is_relro_local, set_is_relro_local,
6513 is_last_relro, set_is_last_relro, is_first_non_relro,
6514 set_is_first_non_relro functions, is_interp, set_is_interp,
6515 is_dynamic_linker_section, and set_is_dynamic_linker_section
6517 (class Output_segment): Change Output_data_list from std::list to
6518 std:;vector. Add output_lists_ field. Remove output_data_ and
6519 output_bss_ fields. Update declarations.
6521 2010-08-02 Ian Lance Taylor <iant@google.com>
6523 * arm.cc (Target_arm::gc_process_relocs): Use typename.
6524 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
6525 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
6527 2010-08-02 Ian Lance Taylor <iant@google.com>
6530 * script.cc (Script_options::Script_options): Initialize
6531 symbol_definitions_ and symbol_references_.
6532 (Script_options::add_symbol_assignment): Update
6533 symbol_definitions_ and symbol_references_.
6534 (Script_options::add_symbol_reference): New function.
6535 (script_symbol): New function.
6536 * script.h (class Script_options): Add symbol_definitions_ and
6537 symbol_references_ fields.
6538 (Script_options::referenced_const_iterator): New type.
6539 (Script_options::referenced_begin): New function.
6540 (Script_options::referenced_end): New function.
6541 (Script_options::is_referenced): New function.
6542 (Script_options::any_unreferenced): New function.
6543 * script-c.h (script_symbol): Declare.
6544 * yyscript.y (exp): Call script_symbol.
6545 * symtab.cc: Include "script.h".
6546 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
6547 Change all callers. Check symbols referenced by scripts.
6548 (Symbol_table::add_undefined_symbols_from_command_line): Add
6549 layout parameter. Change all callers.
6550 (Symbol_table::do_add_undefined_symbols_from_command_line):
6551 Likewise. Break out loop body. Check symbols referenced by
6553 (Symbol_table::add_undefined_symbol_from_command_line): New
6554 function broken out of
6555 do_add_undefined_symbols_from_command_line.
6556 * symtab.h (class Symbol_table): Update declarations.
6557 * archive.cc: Include "layout.h".
6558 (Archive::should_include_member): Add layout parameter. Change
6559 all callers. Check for symbol mentioned in expression.
6560 * archive.h (class Archive): Update declaration.
6561 * object.cc (Sized_relobj::do_should_include_member): Add layout
6563 * object.h (Object::should_include_member): Add layout parameter.
6565 (Object::do_should_include_member): Add layout parameter.
6566 (class Sized_relobj): Update declaration.
6567 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
6569 * dynobj.h (class Sized_dynobj): Update declaration.
6570 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
6572 * plugin.h (class Sized_pluginobj): Update declaration.
6574 2010-08-02 Ian Lance Taylor <iant@google.com>
6577 * output.cc (Output_segment::set_offset): Search for the first and
6578 last sections rather than assuming that the list is in order.
6579 (Output_segment::find_first_and_last_list): New function.
6580 * output.h (class Output_segment): Update declarations.
6581 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
6582 (relro_strip_test_SOURCES): New variable.
6583 (relro_strip_test_DEPENDENCIES): New variable.
6584 (relro_strip_test_LDFLAGS): New variable.
6585 (relro_strip_test_LDADD): New variable.
6586 (relro_strip_test.so): New target.
6588 2010-08-02 Ian Lance Taylor <iant@google.com>
6590 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
6591 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
6592 (Target_i386::got_tlsdesc_section): New function.
6593 (Target_i386::got_section): Create space for GOT entries for
6594 TLSDESC relocations.
6595 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
6597 (Target_i386::Scan::global): Likewise.
6598 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
6600 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
6601 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
6602 (Target_x86_64::got_tlsdesc_section): New function.
6603 (Target_x86_64::got_section): Create space for GOT entries for
6604 TLSDESC relocations.
6605 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
6607 (Target_x86_64::Scan::global): Likewise.
6608 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
6611 2010-08-02 Ian Lance Taylor <iant@google.com>
6613 * testsuite/final_layout.sh: Use dc to convert from hex to
6616 2010-07-29 Sriraman Tallam <tmsriram@google.com>
6618 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
6619 paramter to the call to gold::gc_process_relocs.
6620 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
6621 paramter to the call to gold::gc_process_relocs.
6622 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
6623 parameter to the call to gold::gc_process_relocs.
6624 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
6625 template parameter to the call to gold::gc_process_relocs.
6626 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
6627 paramter to the call to gold::gc_process_relocs.
6628 * gc.h (get_embedded_addend_size): New function.
6629 (gc_process_relocs): Save the size of the reloc for use by ICF.
6630 * icf.cc (get_section_contents): Get the addend from the text section
6631 for SHT_REL relocation sections.
6632 * icf.h (Icf::Reloc_addend_size_info): New typedef.
6633 (Icf::Reloc_info): Add new member reloc_addend_size_info.
6634 * int_encoding.h (read_from_pointer): New overloaded function.
6635 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
6636 * testsuite/icf_sht_rel_addend_test.sh: New file.
6637 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
6638 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
6640 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6642 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
6643 * Makefile.in: Regenerate.
6644 * testsuite/Makefile.in: Regenerate.
6646 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
6648 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
6649 * gold/testsuite/debug_msg.cc: Likewise.
6650 * gold/testsuite/odr_violation1.cc
6651 * gold/testsuite/odr_violation2.cc
6653 2010-07-21 Cary Coutant <ccoutant@google.com>
6655 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
6656 string, and length fields.
6657 (Output_merge_string::Merged_strings_list): New type.
6658 (Output_merge_string::Merged_strings_lists): New typedef.
6659 (Output_merge_string): Replace merged_strings_ with
6660 merged_strings_lists_.
6661 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
6662 Merged_strings_list per input object and section. Don't store pointer
6663 to the string. Don't store length with each merged string entry.
6664 (Output_merge_string::finalize_merged_data): Loop over list of merged
6665 strings lists. Recompute length of each merged string.
6667 2010-07-15 Cary Coutant <ccoutant@google.com>
6669 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
6672 2010-07-14 Ian Lance Taylor <iant@google.com>
6674 * descriptors.cc (Descriptors::open): Report correct name in error
6677 2010-07-13 Doug Kwan <dougkwan@google.com>
6679 * arm.cc (Arm_input_section::Arm_input_section): For a
6680 SHT_ARM_EXIDX section, always keeps the input sections.
6681 (Arm_input_section::set_exidx_section_link): New method.
6682 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
6683 has_errors_ to false.
6684 (Arm_exidx_input_section::has_errors,
6685 Arm_exidx_input_section::set_has_errors): New methods.
6686 (Arm_exidx_input_section::has_errors_): New data member.
6687 (Arm_relobj::get_exidx_shndx_list): New method.
6688 (Arm_output_section::append_text_sections_to_list): Do not skip
6689 section without SHF_EXECINSTR.
6690 (Arm_output_section::fix_exidx_coverage): Skip input sections with
6692 (Arm_relobj::make_exidx_input_section): Add new parameter for text
6693 section header. Make error messages more verbose. Check for
6694 a non-executable section linked to an EXIDX section.
6695 (Arm_relobj::do_read_symbols): Remove error checking, which has been
6696 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
6697 check that there is no deferred EXIDX section if we exit early.
6698 Instead of not making an EXIDX section in case of an error, make one
6699 and set the has_errors flag of it.
6700 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
6701 in a relocatable link.
6702 (Target_arm::do_relax): Look for the EXIDX output section instead of
6703 assuming that it is called .ARM.exidx.
6704 (Target_arm::fix_exidx_coverage): Add a new parameter for input
6705 section list. Do not check for SHF_EXECINSTR section flags but
6706 skip any input section with errors.
6707 * output.cc (Output_section::Output_section): Initialize
6708 always_keeps_input_sections_ to false.
6709 (Output_section::add_input_section): Check for
6710 always_keeps_input_sections_.
6711 * output.h (Output_section::always_keeps_input_sections,
6712 Output_section::set_always_keeps_input_sections): New methods.
6713 (Output_section::always_keeps_input_sections): New data member.
6715 2010-07-13 Rafael Espindola <espindola@google.com>
6717 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
6718 * fileread.h (Input_file): Add try_extra_search_path and find_file.
6720 2010-07-13 Philip Herron <herron.philip@googlemail.com>
6721 Ian Lance Taylor <iant@google.com>
6723 * output.h (Output_section_lookup_maps::add_merge_section):
6724 Correct check of whether value was inserted.
6725 (Output_section_lookup_maps::add_merge_input_section): Likewise.
6726 (Output_section_lookup_maps::add_relaxed_input_section):
6728 * arm.cc (Target_arm::got_section): Remove used local os.
6729 * i386.cc (Target_i386::got_section): Likewise.
6730 * x86_64.cc (Target_x86_64::got_section): Likewise.
6731 * sparc.cc (Target_sparc::got_section): Likewise.
6732 (Target_sparc::relocate): Remove unused local have_got_offset.
6733 * powerpc.cc (Target_powerpc::relocate): Likewise.
6735 2010-07-13 Ian Lance Taylor <iant@google.com>
6737 * compressed_output.cc (zlib_decompress): Fix signature in
6740 * archive.cc (Archive::include_member): Unlock an external member
6741 of a thin archive. Don't bother to delete an object we know is
6744 2010-07-12 Cary Coutant <ccoutant@google.com>
6746 * compressed_output.cc (zlib_decompress): New function.
6747 (get_uncompressed_size): New function.
6748 (decompress_input_section): New function.
6749 * compressed_output.h (get_uncompressed_size): New function.
6750 (decompress_input_section): New function.
6751 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
6752 Handle compressed debug sections.
6753 * layout.cc (is_compressed_debug_section): New function.
6754 (Layout::output_section_name): Map compressed section names to
6756 * layout.h (is_compressed_debug_section): New function.
6757 (is_debug_info_section): Recognize compressed debug sections.
6758 * merge.cc: Include compressed_output.h.
6759 (Output_merge_data::do_add_input_section): Handle compressed
6761 (Output_merge_string::do_add_input_section): Handle compressed
6763 * object.cc: Include compressed_output.h.
6764 (Sized_relobj::Sized_relobj): Initialize new data members.
6765 (build_compressed_section_map): New function.
6766 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
6767 * object.h (Object::section_is_compressed): New method.
6768 (Object::do_section_is_compressed): New method.
6769 (Sized_relobj::Compressed_section_map): New type.
6770 (Sized_relobj::do_section_is_compressed): New method.
6771 (Sized_relobj::compressed_sections_): New data member.
6772 * output.cc (Output_section::add_input_section): Handle compressed
6774 * reloc.cc: Include compressed_output.h.
6775 (Sized_relobj::write_sections): Handle compressed debug sections.
6777 2010-07-08 Cary Coutant <ccoutant@google.com>
6779 * resolve.cc (Symbol_table::resolve): Remember whether undef was
6780 weak when resolving to a dynamic def.
6781 (Symbol_table::should_override): Add adjust_dyndef flag; set it
6782 for weak undef/dynamic def cases. Adjust callers.
6783 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
6784 undef_binding_weak_.
6785 (Symbol_table::sized_write_globals): Adjust symbol binding.
6786 (Symbol_table::sized_write_symbol): Add binding parameter.
6787 * symtab.h (Symbol::set_undef_binding): New method.
6788 (Symbol::is_undef_binding_weak): New method.
6789 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
6790 (Symbol_table::should_override): Add new parameter.
6791 (Symbol_table::sized_write_symbol): Add new parameter.
6793 * testsuite/weak_undef_file1.cc: Add new test case.
6794 * testsuite/weak_undef_file2.cc: Fix header comment.
6795 * testsuite/weak_undef_test.cc: Add new test case.
6797 2010-06-29 Doug Kwan <dougkwan@google.com>
6799 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
6800 Initialize USE_SYMBOL_.
6801 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
6803 (Arm_reloc_property::uses_symbol_): New data member declaration.
6804 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
6805 uses symbol value and symbol is undefined but not weakly undefined.
6807 2010-06-28 Rafael Espindola <espindola@google.com>
6809 * plugin.cc (Plugin::load): Use dlerror.
6811 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
6813 * symtab.cc (detect_odr_violations): When reporting an ODR
6814 violation, report an object where the symbol is defined.
6816 2010-06-25 Doug Kwan <dougkwan@google.com>
6818 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
6819 (Target_arm::section_may_have_icf_unsafe_pointers): New method
6821 (Target_arm::Scan::local_reloc_may_be_function_pointer,
6822 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
6823 target hook to detect function points.
6824 (Target_arm::Scan::possible_function_pointer_reloc): New method.
6825 * icf.h (Icf::check_section_for_function_pointers): Change type of
6826 parameter SECTION_NAME to const reference to std::string. Use
6827 target hook to determine if section may have unsafe pointers.
6828 * target.h (Target::section_may_have_icf_unsafe_pointers): New
6831 2010-06-21 Rafael Espindola <espindola@google.com>
6833 * fileread.cc (Input_file::find_fie): New
6834 (Input_file::open): Use Input_file::find_fie.
6835 * fileread.h (Input_file::find_fie): New
6836 * plugin.cc (set_extra_library_path): New.
6837 (Plugin::load): Add set_extra_library_path to the transfer vector.
6838 (Plugin_manager::set_extra_library_path): New.
6839 (Plugin_manager::add_input_file): Use the extra search path if set.
6840 (set_extra_library_path(): New.
6841 * plugin.h (Plugin_manager): Add set_extra_library_path and
6844 2010-06-19 Cary Coutant <ccoutant@google.com>
6846 * layout.cc (gdb_sections): Add .debug_types.
6847 (lines_only_debug_sections): Likewise.
6849 2010-06-18 Rafael Espindola <espindola@google.com>
6851 * plugin.cc (add_input_file,add_input_library)
6852 (Plugin_manager::add_input_file): Make filename arguments const.
6853 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
6856 2010-06-16 Doug Kwan <dougkwan@google.com>
6858 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
6859 .ARM.attributes section if we have not merged any input
6860 attributes sections.
6862 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6864 * arm.cc: Allow combining objects with no EABI version
6867 2010-06-15 Rafael Espindola <espindola@google.com>
6869 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
6871 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6873 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
6874 (struct iovec): Correct !HAVE_READV definition.
6876 2010-06-10 Cary Coutant <ccoutant@google.com>
6878 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
6879 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
6881 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
6884 * symtab.h (Symbol::is_placeholder): New member function.
6885 * target-reloc.h (relocate_section): Check for placeholder symbols.
6887 * testsuite/Makefile.am (plugin_test_8): New test.
6888 (plugin_test_9): New test.
6889 * testsuite/Makefile.in: Regenerate.
6891 2010-06-09 Nick Clifton <nickc@redhat.com>
6893 * yyscript.y (input_list_element): Allow strings prefixed with
6894 the '-' character. Treat these as libraries.
6895 * script.cc (script_add_library): New function. Adds a library
6896 specified by "-l<name>" found in an input script.
6897 * script-c.h: Add prototype for script_add_library.
6899 2010-06-07 Doug Kwan <dougkwan@google.com>
6901 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
6902 Restrict stub-group size to be within long conditional branch
6903 range when working around cortex-A8 erratum.
6905 2010-06-07 Damien Diederen <dd@crosstwine.com>
6907 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
6910 2010-06-03 Sriraman Tallam <tmsriram@google.com>
6914 (Output_section::Input_section_sort_entry::compare_section_ordering):
6915 Change to return non-zero correctly.
6916 (Output_section::Input_section_sort_section_order_index_compare
6917 ::operator()): Change to fix ambiguity in comparisons.
6919 2010-06-01 Sriraman Tallam <tmsriram@google.com>
6921 * gold.h (is_wildcard_string): New function.
6922 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
6923 (Layout::layout_eh_frame): Ditto.
6924 (Layout::find_section_order_index): New method.
6925 (Layout::read_layout_from_file): New method.
6926 * layout.h (Layout::find_section_order_index): New method.
6927 (Layout::read_layout_from_file): New method.
6928 (Layout::input_section_position_): New private member.
6929 (Layout::input_section_glob_): New private member.
6930 * main.cc (main): Call read_layout_from_file here.
6931 * options.h (--section-ordering-file): New option.
6932 * output.cc (Output_section::input_section_order_specified_): New
6934 (Output_section::Output_section): Initialize new member.
6935 (Output_section::add_input_section): Add new parameter.
6936 Keep input sections when --section-ordering-file is used.
6937 (Output_section::set_final_data_size): Sort input sections when
6938 section ordering file is specified.
6939 (Output_section::Input_section_sort_entry): Add new parameter.
6941 (Output_section::Input_section_sort_entry::compare_section_ordering):
6943 (Output_section::Input_section_sort_compare::operator()): Change to
6944 consider section_order_index.
6945 (Output_section::Input_section_sort_init_fini_compare::operator()):
6946 Change to consider section_order_index.
6947 (Output_section::Input_section_sort_section_order_index_compare
6948 ::operator()): New method.
6949 (Output_section::sort_attached_input_sections): Change to sort
6950 according to section order when specified.
6951 (Output_section::add_input_section<32, true>): Add new parameter.
6952 (Output_section::add_input_section<64, true>): Add new parameter.
6953 (Output_section::add_input_section<32, false>): Add new parameter.
6954 (Output_section::add_input_section<64, false>): Add new parameter.
6955 * output.h (Output_section::add_input_section): Add new parameter.
6956 (Output_section::input_section_order_specified): New
6958 (Output_section::set_input_section_order_specified): New method.
6959 (Input_section::Input_section): Initialize section_order_index_.
6960 (Input_section::section_order_index): New method.
6961 (Input_section::set_section_order_index): New method.
6962 (Input_section::section_order_index_): New member.
6963 (Input_section::Input_section_sort_section_order_index_compare): New
6965 (Output_section::input_section_order_specified_): New member.
6966 * script-sections.cc (is_wildcard_string): Delete and move modified
6968 (Output_section_element_input::Output_section_element_input): Modify
6969 call to is_wildcard_string.
6970 (Output_section_element_input::Input_section_pattern
6971 ::Input_section_pattern): Ditto.
6972 (Output_section_element_input::Output_section_element_input): Ditto.
6973 * testsuite/Makefile.am (final_layout): New test case.
6974 * testsuite/Makefile.in: Regenerate.
6975 * testsuite/final_layout.cc: New file.
6976 * testsuite/final_layout.sh: New file.
6978 2010-06-01 Rafael Espindola <espindola@google.com>
6980 * plugin.cc (Plugin::load): Pass the output name to the plugin.
6982 2010-06-01 Rafael Espindola <espindola@google.com>
6984 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
6985 visibility of symbols.
6987 2010-05-27 Doug Kwan <dougkwan@google.com>
6989 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
6990 from start of output section instead of address for a local symbol
6991 in a merged or relaxed section when doing a relocatable link.
6993 2010-05-26 Rafael Espindola <espindola@google.com>
6996 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
6997 adding sections the garbage collector removed.
6998 * gold/testsuite/Makefile.am: Add test.
6999 * gold/testsuite/Makefile.in: Regenerate.
7000 * gold/testsuite/plugin_test_7.sh: New.
7001 * gold/testsuite/plugin_test_7_1.c: New.
7002 * gold/testsuite/plugin_test_7_2.c: New.
7004 2010-05-26 Rafael Espindola <espindola@google.com>
7006 * script-sections.cc (Output_section_definition::set_section_addresses):
7007 Check for --section-start.
7009 2010-05-26 Doug Kwan <dougkwan@google.com>
7011 * arm.cc (Arm_scan_relocatable_relocs): New class.
7012 (Target_arm::relocate_special_relocatable): New method.
7013 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
7014 (Arm_relocate_functions::thumb_branch_common): Same.
7015 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
7016 instead of Default_scan_relocatable_relocs.
7017 * target-reloc.h (relocate_for_relocatable): Let target handle
7018 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
7019 * target.h (Sized_target::relocate_special_relocatable): New method.
7021 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7023 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
7025 2010-05-23 Doug Kwan <dougkwan@google.com>
7027 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
7029 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
7030 with a direct branch, not a conditional branch, to a stub.
7031 * merge.cc (Output_merge_base::record_input_section): New method
7033 (Output_merge_data::do_add_input_section): Record input section if
7034 keeps-input-sections flag is set.
7035 (Output_merge_string::do_add_input_section): Ditto.
7036 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
7037 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
7039 (Output_merge_base::keeps_input_sections,
7040 Output_merge_base::set_keeps_input_sections,
7041 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
7043 (Output_merge_base::Input_sections): New type declaration.
7044 (Output_merge_base::input_sections_begin,
7045 Output_merge_base::input_sections_end,
7046 Output_merge_base::do_set_keeps_input_sections): New method definitions.
7047 (Output_merge_base::bool keeps_input_sections_,
7048 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
7049 Output_merge_base::input_sections_): New data members.
7050 (Output_merge_data::do_set_keeps_input_sections): New method
7052 (Output_merge_string::do_set_keeps_input_sections): Ditto.
7053 * output.cc (Output_section::Input_section::relobj): Move method
7054 defintion from class declaration to here and handle merge sections.
7055 (Output_section::Input_section::shndx): Ditto.
7056 (Output_section::Output_section): Remove initializations of removed
7057 data members and initialize new data member LOOKUP_MAPS_.
7058 (Output_section::add_input_section): Set keeps-input-sections flag
7059 for a newly created merge output section as appropriate. Adjust code
7060 to use Output_section_lookup_maps class.
7061 (Output_section::add_relaxed_input_section): Adjst code for lookup
7062 maps code refactoring.
7063 (Output_section::add_merge_input_section): Add a new parameter
7064 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
7065 class. If adding input section to a newly created merge output
7066 section fails, remove the new merge section.
7067 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
7068 Adjust code for use of the Output_section_lookup_maps class.
7069 (Output_section::find_merge_section): Ditto.
7070 (Output_section::build_lookup_maps): New method defintion.
7071 (Output_section::find_relaxed_input_section): Adjust code to use
7072 Output_section_lookup_maps class.
7073 (Output_section::get_input_sections): Export merge sections. Adjust
7074 code to use Output_section_lookup_maps class.
7075 (Output_section:::add_script_input_section): Adjust code to use
7076 Output_section_lookup_maps class. Update lookup maps for merge
7078 (Output_section::discard_states): Use Output_section_lookup_maps.
7079 (Output_section::restore_states): Same.
7080 * output.h (Merge_section_properties): Move class defintion out of
7082 (Output_section_lookup_maps): New class.
7083 (Output_section::Input_section::is_merge_section): New method
7085 (Output_section::Input_section::relobj): Move defintion out of class
7086 defintion. Declare method only.
7087 (Output_section::Input_section::shndx): Ditto.
7088 (Output_section::Input_section::output_merge_base): New method defintion.
7089 (Output_section::Input_section::u2_.pomb): New union field.
7090 (Output_section::Merge_section_by_properties_map,
7091 Output_section::Output_section_data_by_input_section_map,
7092 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
7094 (Output_section::add_merge_input_section): Add new parameter
7095 KEEPS_INPUT_SECTIONS.
7096 (Output_section::build_lookup_maps): New method declaration.
7097 (Output_section::merge_section_map_,
7098 Output_section::merge_section_by_properties_map_,
7099 Output_section::relaxed_input_section_map_,
7100 Output_section::is_relaxed_input_section_map_valid_): Remove data
7102 (Output_section::lookup_maps_): New data member.
7104 2010-05-21 Doug Kwan <dougkwan@google.com>
7107 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
7108 avoid a compilation error.
7110 2010-05-19 Rafael Espindola <espindola@google.com>
7112 * script-sections.cc (Output_section_definition::allocate_to_segment):
7113 Update the phdrs_list even when the output section is NULL.
7114 * testsuite/Makefile.am: Add test.
7115 * testsuite/Makefile.in: Regenerate.
7116 * testsuite/script_test_9.cc: New.
7117 * testsuite/script_test_9.sh: New.
7118 * testsuite/script_test_9.t: New.
7120 2010-05-19 Doug Kwan <dougkwan@google.com>
7122 * arm.cc (Arm_input_section::original_size): New method.
7123 (Arm_input_section::do_addralign): Add a cast.
7124 (Arm_input_section::do_output_offset): Remove static cast.
7125 (Arm_input_section::original_addralign,
7126 Arm_input_section::original_size_): Change type to uint32_t.
7127 (Arm_input_section::init): Add safe casts for section alignment
7129 (Arm_input_section::set_final_data_size): Do not set address and
7130 offset of stub table.
7131 (Arm_output_section::fix_exidx_coverage): Change use of of
7132 Output_section::Simple_input_section to that of
7133 Output_section::Input_section.
7134 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
7135 except for the first pass.
7136 * output.cc (Output_section::get_input_sections): Change type of
7137 input_sections to std::list<Input_section>.
7138 (Output_section::add_script_input_section): Rename from
7139 Output_section::add_simple_input_section. Change type of SIS
7140 parameter from Simple_input_section to Input_section.
7141 * output.h (Output_section::Simple_input_section): Remove class.
7142 (Output_section::Input_section): Change class visibility to public.
7143 (Output_section::Input_section::addralign): Use stored alignments
7144 for special input sections if set.
7145 (Output_section::Input_section::set_addralign): New method.
7146 (Output_section::get_input_sections): Change parameter type from
7147 list of Simple_input_section to list of Input_section.
7148 (Output_section::add_script_input_section): Rename from
7149 Output_section::add_simple_input_section. Change first parameter's
7150 type from Simple_input_section to Input_section and remove the
7151 second and third parameters.
7152 * script-sections.cc (Input_section::Input_section_list): Change
7153 type to list of Output_section::Input_section/
7154 (Input_section_info::Input_section_info): Change parameter type of
7155 INPUT_SECTION to Output_section::Input_section.
7156 (Input_section_info::input_section): Change return type.
7157 (Input_section_info::input_section_): Change type to
7158 Output_section::Input_section.
7159 (Output_section_element_input::set_section_addresses): Adjust code
7160 to use Output_section::Input_section instead of
7161 Output_section::Simple_input_section. Adjust code for renaming
7162 of Output_section::add_simple_input_section.
7163 (Orphan_output_section::set_section_addresses): Ditto.
7165 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7167 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
7168 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
7170 2010-05-18 Rafael Espindola <espindola@google.com>
7172 * options.cc (General_options::finalize): Handle -nostdlib.
7173 * options.h (nostdlib): New option.
7174 * script.cc (script_add_search_dir): Handle -nostdlib.
7176 2010-05-12 Doug Kwan <dougkwan@google.com>
7178 * arm.cc (Target_arm::do_finalize_sections): Create an empty
7179 attributes section only if there no attributes section after merging.
7180 (Target_arm::merge_object_attributes): Move value of
7181 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
7182 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
7183 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
7184 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
7185 and arm_attr_merge_7.stdout.
7186 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
7187 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
7188 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
7189 arm_attr_merge_7b.o): New rules.
7190 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
7192 * testsuite/Makefile.in: Regenerate.
7193 * testsuite/arm_attr_merge.sh: New file.
7194 * testsuite/arm_attr_merge_[67][ab].s: Same.
7196 2010-05-05 Nick Clifton <nickc@redhat.com>
7198 * po/es.po: Updated Spanish translation.
7200 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7202 * Makefile.am (install-exec-local): Properly install gold as
7203 default cross linker.
7204 * Makefile.in: Regenerated.
7206 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7207 Nick Clifton <nickc@redhat.com>
7209 * configure.ac (install_as_default): Define and set to false
7210 unless --enable-gold or --enable-gold=both/gold has been
7212 * configure: Regenerate.
7214 * Makefile.am (install-exec-local): Install the executable as
7215 'ld.gold'. If install_as_default is true then also install it as
7217 * Makefile.in: Regenerated.
7219 2010-04-24 Ian Lance Taylor <iant@google.com>
7221 * layout.cc (Layout::layout_reloc): In relocatable link don't
7222 combine reloc sections for grouped sections.
7224 2010-04-23 Sriraman Tallam <tmsriram@google.com>
7226 * gc.h (gc_process_relocs): Pass information on relocs pointing to
7227 sections that are not ordinary to icf.
7228 * icf.cc (get_section_contents): Handle relocation pointing to section
7229 with no object or shndx information.
7230 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
7231 * testsuite/Makefile.in: Regenerate.
7232 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
7233 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
7235 2010-04-22 Ian Lance Taylor <iant@google.com>
7237 * expression.cc (Expression::Expression_eval_info): Add
7238 result_alignment_pointer field.
7239 (Expression::eval_with_dot): Add result_alignment_pointer
7240 parameter. Change all callers.
7241 (Expression::eval_maybe_dot): Likewise.
7242 (class Binary_expression): Add alignment_pointer parameter to
7243 left_value and right_value. Change all callers.
7244 (BINARY_EXPRESSION): Set result alignment.
7245 (class Trinary_expression): Add alignment_pointer parameter to
7246 arg2_value and arg3_value. Change all callers.
7247 (Trinary_cond::value): Set result alignment.
7248 (Max_expression::value, Min_expression::value): Likewise.
7249 (Align_expression::value): Likewise.
7250 * script-sections.cc (class Sections_element): Add dot_alignment
7251 parameter to set_section_addresses virtual function. Update
7253 (class Output_section_element): Likewise.
7254 (Script_sections::create_segments): Add dot_alignment parameter.
7256 (Script_sections::create_segments_from_phdrs_clause): Likewise.
7257 (Script_sections::set_phdrs_clause_addresses): Likewise.
7258 * script-sections.h: Update declarations.
7259 * script.h: Update declarations.
7260 * output.h (Output_segment::set_minimum_p_align): Don't decrease
7262 * testsuite/script_test_3.t: Set large alignment.
7263 * testsuite/script_test_3.sh: Make sure that at least one LOAD
7264 segment has expected alignment.
7266 2010-04-22 Nick Clifton <nickc@redhat.com>
7268 * po/gold.pot: Updated by the Translation project.
7269 * po/vi.po: Updated Vietnamese translation.
7271 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
7273 * testsuite/Makefile.am (check_PROGRAMS): Add
7274 icf_virtual_function_folding_test.
7275 * testsuite/Makefile.in: Regenerated.
7277 2010-04-15 Andrew Haley <aph@redhat.com>
7279 * options.h (merge_exidx_entries): New option.
7280 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
7281 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
7282 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
7283 (Target_arm::merge_exidx_entries): New function.
7284 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
7285 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
7286 to Arm_exidx_fixup constructor.
7287 Add new arg, merge_exidx_entries.
7288 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
7289 Arm_output_section::fix_exidx_coverage.
7291 2010-04-18 Sriraman Tallam <tmsriram@google.com>
7293 * icf.cc (get_section_contents): Check for preemptible functions.
7294 Ignore addend when appropriate.
7295 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
7297 (add_from_relobj): Check for section folded.
7298 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
7299 * symtab.h (should_add_dynsym_entry): Add new parameter.
7300 * target-reloc.h (scan_relocs): Check for section folded.
7301 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
7302 Check reloc types for function pointers in shared objects.
7303 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
7305 (icf_preemptible_functions_test): New test case.
7306 (icf_string_merge_test): New test case.
7307 * testsuite.Makefile.in: Regenerate.
7308 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
7309 bar_glob. Refactor code.
7310 * testsuite/icf_preemptible_functions_test.cc: New file.
7311 * testsuite/icf_preemptible_functions_test.sh: New file.
7312 * testsuite/icf_string_merge_test.cc: New file.
7313 * testsuite/icf_string_merge_test.sh: New file.
7314 * testsuite/icf_virtual_function_folding_test.cc: New file.
7315 * testsuite/icf_virtual_function_folding_test.sh: New file.
7317 2010-04-14 Doug Kwan <dougkwan@google.com>
7319 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
7320 for local symbol recounting if we remove a section due to ICF.
7321 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
7322 there are no regular objects in input.
7324 2010-04-13 Doug Kwan <dougkwan@google.com>
7326 * arm.cc (Arm_input_section::set_final_data_size): Compute
7327 accurate final data size instead of using current data size.
7329 2010-04-09 Doug Kwan <dougkwan@google.com>
7331 * layout.cc (Layout::choose_output_section): Handle script section
7333 (Layout::make_output_section_for_script): Add section type parameter.
7334 Handle script section types.
7335 * layout.h (Layout::make_output_section_for_script): Add section
7337 * output.cc (Output_section::Output_section): Initialize data member
7339 (Output_section::do_reset_address_and_file_offset): Do not set address
7340 to 0 if section is a NOLOAD section.
7341 * output.h (Output_section::is_noload): New method.
7342 (Output_section::set_is_noload): Ditto.
7343 (Output_section::is_noload_): New data member.
7344 * script-c.h (Script_section_type): New enum type.
7345 (struct Parser_output_section_header): Add new file section_type.
7346 * script-sections.cc (Sections_element::output_section_name): Add
7347 parameter for returning script section type.
7348 (Output_section_definition::output_section_name): Ditto.
7349 (Output_section_definition::section_type)P; New method.
7350 (Output_section_definiton::script_section_type_name): Ditto.
7351 (Output_section_definition::script_section_type_): New data member.
7352 (Output_section_definition::Output_section_definition): Initialize
7353 data member Output_section_definition::script_section_type_.
7354 (Output_section_definition::create_sections): Pass script section type
7355 to Layout::make_output_section_for_script.
7356 (Output_section_definition::output_section_name): Return script
7357 section type to caller.
7358 (Output_section_definition::set_section_address): Do not advance
7359 dot value and load address if section type is NOLOAD. Set address
7360 of NOLOAD sections regardless of section flags.
7361 (Output_section_definition::print): Print section type if it is
7362 not SCRIPT_SECTION_TYPE_NONE.
7363 (Output_section_definition::section_type): New method.
7364 (Output_section_definition::script_section_type_name): Ditto.
7365 (Script_sections::output_section_name): Add new parameter
7366 PSECTION_TYPE for returning script section type. Pass it to
7367 section elements. Handle discard sections.
7368 (Sort_output_sections::operator()): Handle NOLOAD sections.
7369 * script-sections.h (Script_sections::Section_type): New enum type.
7370 (Script_sections::output_section_name): Add a new parameter for
7371 returning script section type.
7372 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
7374 * yyscript.y (union): Add new field SECTION_TYPE.
7375 (COPY, DSECT, INFO, NOLOAD): New tokens.
7376 (opt_address_and_section_type): Change type to output_section_header.
7377 (section_type): New non-terminal
7378 (section_header): Handle section type.
7379 (opt_address_and_section_type): Return section type value.
7381 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
7383 * testsuite/plugin_common_test_1.c (foo): Add prototype.
7384 * testsuite/plugin_common_test_2.c (foo): Likewise.
7386 2010-04-08 Doug Kwan <dougkwan@google.com>
7388 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
7390 * output.cc (Output_section::add_merge_input_section): Simplify
7391 code and return status of Output_merge_base::add_input_section.
7392 Update merge section map only if Output_merge_base::add_input_section
7395 2010-04-07 Doug Kwan <dougkwan@google.com>
7397 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
7398 if section is marked as containing instructions but has no mapping
7400 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
7401 correct section index.
7402 (Arm_relobj::find_linked_text_section): Ditto.
7404 2010-04-07 Cary Coutant <ccoutant@google.com>
7406 * archive.cc (include_member): Destroy Read_symbols_data object before
7408 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
7409 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
7410 (Read_symbols_data::~Read_symbols_data) New destructor.
7411 (Section_relocs::Section_relocs) New constructor.
7412 (Section_relocs::~Section_relocs) New destructor.
7413 (Read_relocs_data::Read_relocs_data) New constructor.
7414 (Read_relocs_data::~Read_relocs_data) New destructor.
7415 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
7416 pointers to NULL after deleting.
7418 2010-04-07 Doug Kwan <dougkwan@google.com>
7420 * arm.cc: Replace "endianity" with "endianness" in comments.
7421 (Arm_exidx_cantunwind): Ditto.
7422 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
7423 (Arm_relobj::merge_flags_and_attributes): New method.
7424 (Arm_relobj::merge_flags_and_attributes_): New data member.
7425 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
7426 (Arm_relobj::scan_sections_for_stubs): Ditto.
7427 (Arm_relobj::do_read_symbols): Check to see if we really want to
7428 merge processor-specific flags and attributes. Exit early if
7429 an object is empty except for section names and the undefined symbol.
7430 (Target_arm::do_finalize_sections): Move check for ELF format to
7431 Arm_relobj::do_read_symbols. Merge processor specific flags and
7432 attributes from a regular object only when we have determined that
7433 it is aapropriate. Do not create an .ARM.attributes section in
7434 output if there is no regular input object.
7435 (Target_arm::merge_processor_specific_flags): Check
7436 --warn-mismatch before printing any error.
7437 (Target_arm::merge_object_attributes): Ditto.
7438 * gold.cc (queue_middle_tasks): Handle the case in which there is
7439 no regular object in input.
7440 * options.cc (General_options::parse_EB): New method.
7441 (General_options::parse_EL): Same.
7442 (General_options::General_options): Initialize endianness_.
7443 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
7445 (General_options::Endianness): New enum.
7446 (General_options::endianness): New method.
7447 (General_options::endianness_): New data member.
7448 * parameters.cc (Parameters::set_options): Check target endianness.
7449 (Parameters::set_target_once): Ditto.
7450 (Parameters::check_target_endianness): New method.
7451 (parameters_force_valid_target): If either -EL or -EB is specified,
7452 use it to define endianness of default target.
7453 * parameters.h (Parameters::check_target_endianness): New method
7455 * target.h (class Target): Change "endianity" to "endianness"
7458 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7460 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
7461 * configure: Regenerate.
7462 * Makefile.in: Regenerate.
7463 * testsuite/Makefile.in: Regenerate.
7465 2010-04-06 Cary Coutant <ccoutant@google.com>
7468 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
7469 prevailing definitions of common symbols.
7470 * testsuite/plugin_test_6.sh: New test case.
7471 * testsuite/plugin_common_test_1.c: New test case.
7472 * testsuite/plugin_common_test_2.c: New test case.
7473 * testsuite/Makefile.am (plugin_test_6): New test case.
7474 * testsuite/Makefile.in: Regenerate.
7476 2010-04-06 Nick Clifton <nickc@redhat.com>
7478 * po/vi.po: New Vietnamese translation.
7480 2010-03-30 Doug Kwan <dougkwan@google.com>
7482 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
7484 2010-03-25 Doug Kwan <dougkwan@google.com>
7486 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
7487 to avoid a conversion warning on a 32-bit host.
7489 2010-03-24 Ian Lance Taylor <iant@google.com>
7491 * testsuite/script_test_3.t: Add a TLS segment.
7492 * testsuite/Makefile.am (check_PROGRAMS): Add
7493 tls_phdrs_script_test.
7494 (tls_phdrs_script_test_SOURCES): Define.
7495 (tls_phdrs_script_test_DEPENDENCIES): Define.
7496 (tls_phdrs_script_test_LDFLAGS): Define.
7497 (tls_phdrs_script_test_LDADD): Define.
7498 * testsuite/Makefile.in: Rebuild.
7500 2010-03-23 Cary Coutant <ccoutant@google.com>
7502 * fileread.cc (find_or_make_view): Fix comment.
7504 2010-03-23 Ian Lance Taylor <iant@google.com>
7506 * script-sections.cc (class Orphan_section_placement): Define
7507 PLACE_TLS and PLACE_TLS_BSS.
7508 (Orphan_section_placement::Orphan_section_placement): Initialize
7510 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
7511 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
7512 (tls_script_test_SOURCES): Define.
7513 (tls_script_test_DEPENDENCIES): Define.
7514 (tls_script_test_LDFLAGS): Define.
7515 (tls_script_test_LDADD): Define.
7516 * testsuite/Makefile.in: Rebuild.
7518 2010-03-22 Doug Kwan <dougkwan@google.com>
7520 * arm.cc (Arm_relocate_functions::abs8,
7521 Arm_relocate_functions::abs16): Use correct check for overflow
7522 specified in the ARM ELF specs.
7523 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
7524 target of a BLX instruction specially.
7525 (Reloc_stub::stub_type_for_reloc): Ditto.
7526 (Relocate::relocate): Use symbolic names instead of numeric relocation
7527 codes to report error.
7528 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
7530 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
7531 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
7532 thumb2_blx_out_of_range.stdout
7533 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
7534 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
7535 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
7536 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
7537 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
7538 thumb2_blx_in_range, thumb2_blx_in_range.o,
7539 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
7540 thumb2_blx_out_of_range.o): New rules.
7541 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
7542 thumb2_blx_in_range and thumb2_blx_out_of_range.
7543 * testsuite/Makefile.in: Regenerate.
7544 * arm_branch_in_range.sh: Add tests for THUMB BLX.
7545 * testsuite/thumb_blx_in_range.s: New file.
7546 * testsuite/thumb_blx_out_of_range.s: New file.
7548 2010-03-22 Rafael Espindola <espindola@google.com>
7550 * archive.cc (Should_include): Move to archive.h.
7551 (should_include_member): Make it a member of Archive.
7553 (Add_lib_group_symbols): New.
7554 * archive.h: Include options.h.
7555 (Archive_member): Moved from Archive.
7556 (Should_include): Moved from archive.cc.
7558 (Add_lib_group_symbols): New.
7559 * dynobj.cc (do_should_include_member): New.
7560 * dynobj.h (do_should_include_member): New.
7561 * gold.cc (queue_initial_tasks): Update call to queue.
7562 * main.cc (main): Print lib group stats.
7563 * object.cc (do_should_include_member): New.
7564 * object.h: Include archive.h.
7565 (Object::should_include_member): New.
7566 (Object::do_should_include_member): New.
7567 (Sized_relobj::do_should_include_member): New.
7568 * options.cc (General_options::parse_start_lib): New.
7569 (General_options::parse_end_lib): New.
7570 (Input_arguments::add_file): Handle lib groups.
7571 (Input_arguments::start_group): Check we are not in a lib.
7572 (Input_arguments::start_lib): New.
7573 (Input_arguments::end_lib): New.
7574 * options.h (General_options): Add start_lib and end_lib.
7575 (Input_argument::lib_): New.
7576 (Input_argument::lib): New.
7577 (Input_argument::is_lib): New.
7578 (Input_file_lib): New.
7579 (Input_arguments::in_lib_): New.
7580 (Input_arguments::in_lib): New.
7581 (Input_arguments::start_lib): New.
7582 (Input_arguments::end_lib_): New.
7583 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
7584 in unused members as preempted.
7585 (Sized_pluginobj::do_should_include_member): New.
7586 * plugin.h (Sized_pluginobj::do_should_include_member): New.
7587 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
7589 (Read_symbols::do_whole_lib_group): New.
7590 (Read_symbols::do_lib_group): New.
7591 (Read_symbols::do_read_symbols): Handle lib groups.
7592 (Read_symbols::get_name): Handle lib groups.
7593 * readsyms.h (Read_symbols): Add an archive member pointer.
7594 (Read_symbols::do_whole_lib_group): New.
7595 (Read_symbols::do_lib_group): New.
7596 (Read_symbols::member_): New.
7597 * script.cc (read_input_script): Update call to queue_soon.
7599 2010-03-19 Doug Kwan <dougkwan@google.com>
7601 * arm.cc (Stub_table::Stub_table): Initialize new data members
7602 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7603 (Stub_table::add_reloc_stub): Assign stub offset and update
7604 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7605 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
7607 (Stub_table::update_data_size_and_addralign): Use
7608 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
7609 instead of going over all reloc stubs.
7610 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
7611 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7612 Stringpool_template::offset_ to size of Stringpool_char.
7613 (Stringpool_template::new_key_offset): Remove code to initialize
7614 Stringpool_template::offset_.
7615 * stringpool.h (Stringpool_template::set_no_zero_null): Set
7616 Stringpool_template::offset_ to zero.
7618 2010-03-15 Doug Kwan <dougkwan@google.com>
7620 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7622 (Stringpool_template::new_key_offset): New method.
7623 (Stringpool_template::add_string): Assign offsets when adding new
7625 (Stringpool_template::set_string_offsets): Do not set string offsets
7626 when not optimizing.
7627 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
7629 (Chunked_vector::clear): Clear size_.
7630 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
7631 (Chunked_vector::size): Return size_.
7632 (Chunked_vector::push_back): Use size_ to find insert position.
7633 (Chunked_vector::size_): New data member.
7634 (Stringpool_template::set_no_zero_null): Assert string set is empty.
7635 (Stringpool_template::new_key_offset): New method declaration.
7636 (Stringpool_template::offset_): New data member.
7638 2010-03-15 Rafael Espindola <espindola@google.com>
7640 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
7641 Add_symbols' constructor.
7642 * readsyms.h (Add_symbols): Remove the input_group member.
7644 2010-03-10 Ian Lance Taylor <iant@google.com>
7646 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
7647 target to ask whether a reference to a symbol requires a stack
7649 * target.h (Target::is_call_to_non_split): New function.
7650 (Target::do_is_call_to_non_split): Declare virtual function.
7651 * target.cc: Include "symtab.h".
7652 (Target::do_is_call_to_non_split): New function.
7653 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
7655 2010-03-10 Cary Coutant <ccoutant@google.com>
7657 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
7658 (File_read::open[1]): Remove initial mapping of whole_file_view_.
7659 (File_read::open[2]): Add whole_file_view_ to list of views.
7660 (File_read::make_view): Remove test of whole_file_view_.
7661 (File_read::find_or_make_view): Create whole_file_view_ if
7663 (File_read::clear_views): Replace bool parameter with enum;
7664 adjust all callers. Don't delete views with permanent data;
7665 do delete cached views and views from archives if
7666 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
7667 if clearing the corresponding view.
7668 * fileread.h (File_read::Clear_views_mode): New enum.
7669 (File_read::View::is_permanent_view): New method.
7670 (File_read::clear_views): Replace bool parameter
7671 with enum; adjust all callers.
7672 * options.h (General_options): Change keep_files_mapped option;
7673 add map_whole_files.
7674 * readsyms.cc (Add_symbols::run): Delete sd_ object before
7676 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
7679 2010-03-10 David S. Miller <davem@davemloft.net>
7681 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
7683 2010-03-09 Sriraman Tallam <tmsriram@google.com>
7685 * icf.cc (get_section_contents): Add '@' marker after processing the
7688 2010-03-08 Doug Kwan <dougkwan@google.com>
7690 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
7691 due to a conversion warning.
7692 (Arm_relobj::update_output_local_symbol_count): Check for local
7693 symbol with unset output index.
7695 2010-03-05 Ian Lance Taylor <iant@google.com>
7697 * options.h (class General_options): Add --spare-dynamic-tags.
7698 * output.cc (Output_data_dynamic::set_final_data_size): Implement
7699 --spare-dynamic-tags.
7701 2010-03-05 Ian Lance Taylor <iant@google.com>
7703 * incremental.cc: Include "libiberty.h".
7705 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
7707 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
7708 function, is_info_ member.
7709 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
7710 (Versions::Versions): Update caller.
7711 (Versions::define_base_version): Likewise.
7712 (Versions::add_def): Likewise.
7714 2010-03-03 Sriraman Tallam <tmsriram@google.com>
7716 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
7717 (Scan::possible_function_pointer_reloc): New function.
7718 (Scan::local_reloc_may_be_function_pointer): Change to call
7719 possible_function_pointer_reloc.
7720 (Scan::global_reloc_may_be_function_pointer): Ditto.
7721 * icf.h (Icf::check_section_for_function_pointers): Change to reject
7722 relocations in ".data.rel.ro._ZTV" section.
7723 * testsuite/icf_safe_so_test.sh: Change to pass i386.
7724 * testsuite/icf_safe_so_test.cc: Ditto.
7725 * testsuite/icf_safe_test.cc: Ditto.
7726 * testsuite/icf_safe_test.sh: Ditto.
7728 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7729 Ian Lance Taylor <iant@google.com>
7731 * target-reloc.h (relocate_section): Check the symbol table index
7732 for -1U before setting the local symbol index.
7733 (scan_relocatable_relocs): If copying the relocation, record that
7734 the local symbol is required.
7735 * object.h (Symbol_value::is_output_symtab_index_set): New
7737 (Symbol_value::may_be_discarded_from_output_symtab): New
7739 (Symbol_value::has_output_symtab_entry): New function.
7740 (Symbol_value::needs_output_symtab_entry): Remove.
7741 (Symbol_value::output_symtab_index): Make sure the symbol index is
7743 (Symbol_value::set_output_symtab_index): Make sure the symbol
7744 index is not set. Make sure the new index is valid.
7745 (Symbol_value::set_must_have_output_symtab_entry): New function.
7746 (Symbol_value::has_output_dynsym_entry): New function.
7747 (Symbol_value::set_output_dynsym_index): Make sure the new index
7749 (Sized_relobj::set_must_have_output_symtab_entry): New function.
7750 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
7751 local symbol if permitted.
7752 (Sized_relobj::do_finalize_local_symbols): Call
7753 is_output_symtab_index_set rather than needs_output_symtab_entry.
7754 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
7755 rather than needs_output_symtab_entry. Call
7756 has_output_dynsym_entry rather than needs_output_dynsym_entry.
7757 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
7758 is_output_symtab_index_set rather than needs_output_symtab_entry.
7759 * testsuite/discard_locals_relocatable_test.c: New file.
7760 * testsuite/discard_locals_test.sh: Test -r.
7761 * testsuite/Makefile.am (check_DATA): Add
7762 discard_locals_relocatable_test1.syms,
7763 discard_local_relocatable_test2.syms.
7764 (MOSTLYCLEANFILES): Likewise. Also add
7765 discard_locals_relocatable_test1.lout and
7766 discard_locals_relocatable_test2.out.
7767 (discard_locals_relocatable_test1.syms): New target.
7768 (discard_locals_relocatable_test.o): New target.
7769 (discard_locals_relocatable_test1.out): New target.
7770 (discard_locals_relocatable_test2.syms): New target.
7771 (discard_locals_relocatable_test2.out): New target.
7772 (various): Add missing ../ld-new dependencies.
7773 * testsuite/Makefile.in: Rebuild.
7775 2010-03-03 Nick Clifton <nickc@redhat.com>
7777 * po/fi.po: New Finnish translation.
7779 2010-03-01 Doug Kwan <dougkwan@google.com>
7781 * layout.cc (Layout::Layout): Force section types of .init_array*,
7782 .preinit_array* and .fini_array* sections.
7783 * output.cc (Output_section::Input_section_sort_entry::has_priority):
7784 Fix check of return value of std::string::find.().
7785 (Output_section::Input_section_sort_compare::operator()): Remove
7786 comment about .init_array.
7787 (Output_section::Input_section_sort_init_fini_compare::operator()):
7789 (Output_section::sort_attached_input_sections): Handle .init_array
7790 and .fini_array specially.
7791 * output.h (Output_section::Inut_section_sort_compare): Update
7793 (Output_section::Input_section_sort_init_fini_compare): New struct.
7795 2010-02-26 Doug Kwan <dougkwan@google.com>
7797 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
7798 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
7799 * testsuite/debug_msg.sh: Avoid matching source line number for
7800 use of global variable undef_int.
7802 2010-02-26 Doug Kwan <dougkwan@google.com>
7804 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
7805 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
7806 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
7807 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
7808 * options.cc (General_options::General_options): Initialize member
7810 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
7811 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
7812 and rm_no_fix_v4bx.stdout
7813 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
7814 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
7815 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
7816 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
7817 and arm_no_fix_v4bx.
7818 * Makefile.in: Regenerate.
7819 * testsuite/arm_fix_v4bx.s: New file.
7820 * testsuite/arm_fix_v4bx.sh: Ditto.
7822 2010-02-24 Doug Kwan <dougkwan@google.com>
7824 * arm.cc (Target_arm::got_section): Make the .got section the first
7825 non RELRO section in the data segment.
7826 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
7827 suffixes of section names.
7829 2010-02-24 Doug Kwan <dougkwan@google.com>
7831 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
7832 flags and attributes merging if an input file is a binary file.
7833 * fileread.cc (Input_file::open): Record format of original file.
7834 * fileread.h (Input_file::Format): New enum type.
7835 (Input_file::Input_file): Initialize data member format_.
7836 (Input_file::format): New method definition.
7837 (Input_file::format_):: New data member.
7839 2010-02-24 Doug Kwan <dougkwan@google.com>
7841 * arm.cc (Arm_output_data_got): New class.
7842 (ARM_TCB_SIZE): New constant
7843 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
7844 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
7845 If user uses a script with a SECTIONS clause, issue only a warning
7846 for a misplaced EXIDX input section. Otherwise, issue an error.
7847 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
7849 (Target_arm::got_mode_index_entry): Handle static linking.
7850 (Target_arm::Scan::local): Ditto.
7851 (Target_arm::Scan::global): Ditto.
7852 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
7853 all incorrectly implemented relocations.
7854 (Target_arm::fix_exidx_coverage): Pass layout to
7855 Arm_output_section::fix_exidx_coverage.
7856 * layout.cc (Layout::section_name_mapping): Remove trailing dots
7857 from ".ARM.exidx." and ".ARM.extab.".
7859 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7861 * arm.cc (Target_arm::do_finalize_sections): Create attribute
7862 section if it does not already exist.
7863 * attributes.cc (Attributes_section_data::Attributes_section_data):
7864 Don't crash if size is zero.
7866 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7867 Ian Lance Taylor <iant@google.com>
7869 * gold.cc (queue_middle_tasks): If no input files were opened,
7871 * workqueue.h (Task_function::Task_function): Assert that there is
7874 2010-02-22 Doug Kwan <dougkwan@google.com>
7876 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
7877 * icf.cc (get_section_contents): Cast snprintf arguments to long long
7878 types to avoid warnings due to different uint64_t implementations
7881 2010-02-21 Doug Kwan <dougkwan@google.com>
7883 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
7884 handling of the maximum backward branch offset.
7885 (Arm_relocate_functions::thumb_branch_common): Ditto.
7886 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
7887 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
7888 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
7889 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
7890 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
7891 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
7892 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
7893 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
7894 thumb_bl_out_of_range thumb_bl_out_of_range.o,
7895 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
7896 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
7897 thumb2_bl_out_of_range.o): New rules.
7898 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
7899 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
7900 thumb2_bl_out_of_range
7901 * testsuite/Makefile.in: Regenerate.
7902 * testsuite/arm_bl_in_range.s: New file.
7903 * testsuite/arm_bl_out_of_range.s: Ditto.
7904 * testsuite/arm_branch_in_range.sh: Ditto.
7905 * testsuite/arm_branch_range.t: Ditto.
7906 * testsuite/thumb2_branch_range.t: Ditto.
7907 * testsuite/thumb_bl_in_range.s: Ditto.
7908 * testsuite/thumb_bl_out_of_range.s: Ditto.
7909 * testsuite/thumb_branch_range.t: Ditto.
7911 2010-02-20 Sriraman Tallam <tmsriram@google.com>
7913 * gc.h (gc_process_relocs): Change vectors to point to the new list.
7914 Add reloc offset information.
7915 * icf.cc (get_section_contents): Change iterators to point to the new
7916 vectors. Add reloc offset information to the contents.
7917 * icf.h (Icf::Sections_reachable_info): New typedef.
7918 (Icf::Sections_reachable_list): New typedef.
7919 (Icf::Offset_info): New typedef.
7920 (Icf::Reloc_info): New struct typedef.
7921 (Icf::Reloc_info_list): New typedef.
7922 (Icf::symbol_reloc_list): Delete method.
7923 (Icf::addend_reloc_list): Delete method.
7924 (Icf::section_reloc_list): Delete method.
7925 (Icf::reloc_info_list): New method.
7926 (Icf::reloc_info_list_): New member.
7928 2010-02-19 Doug Kwan <dougkwan@google.com>
7930 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
7931 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
7932 * arm.cc (Arm_relocation_functions): New forward declaration.
7933 (Target_arm::Target_arm): Initialize new data members
7934 got_mod_index_offset_ and tls_base_symbol_defined_.
7935 (Target_arm::Relocate::relocate_tls): New method.
7936 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
7937 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
7939 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
7940 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
7941 (Target_arm::got_mod_index_offset_,
7942 Target_arm::tls_base_symbol_defined_): New data members.
7943 (Target_arm::Scan::local, Target::Scan::global,
7944 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
7947 2010-02-18 Doug Kwan <dougkwan@google.com>
7949 * arm.cc (Arm_relobj::find_linked_text_section): New method.
7950 (Arm_relobj::make_exidx_input_section): Pass section index of linked
7951 text section as a parameter becuase some broken tools may not set
7952 the link in section header.
7953 (Target_arm::has_got_section): New method.
7954 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
7955 without any mapping symbol as data only. Remove warning.
7956 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
7957 link in its section header, try to discover the link by inspecting the
7958 REL31 relocation at the beginning of the section.
7959 (Target_arm::Scan::check_non_pic): Report name of offending relocation
7961 (Target_arm::Scan::global): Treat any reference to the symbol
7962 _GLOBAL_OFFSET_TABLE_ as a GOT access.
7964 2010-02-12 Sriraman Tallam <tmsriram@google.com>
7966 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
7967 (Scan::global_reloc_may_be_function_pointer): New function.
7968 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7969 (Scan::global_reloc_may_be_function_pointer): New function.
7970 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7971 (Scan::global_reloc_may_be_function_pointer): New function.
7972 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
7973 (Scan::global_reloc_may_be_function_pointer): New function.
7974 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
7975 (Scan::global_reloc_may_be_function_pointer): New function.
7976 (Scan::possible_function_pointer_reloc): New function.
7977 (Target_x86_64::can_check_for_function_pointers): New function.
7978 * gc.h (gc_process_relocs): Scan relocation types to determine if
7979 function pointers were taken for targets that support it.
7980 * icf.cc (Icf::find_identical_sections): Include functions for
7981 folding in safe ICF whose pointer is not taken.
7982 * icf.h (Secn_fptr_taken_set): New typedef.
7983 (fptr_section_id_): New member.
7984 (section_has_function_pointers): New function.
7985 (set_section_has_function_pointers): New function.
7986 (check_section_for_function_pointers): New function.
7987 * options.h: Fix comment for safe ICF option.
7988 * target.h (can_check_for_function_pointers): New function.
7989 * testsuite/Makefile.am: Add icf_safe_so_test test case.
7990 Modify icf_safe_test for X86-64.
7991 * testsuite/Makefile.in: Regenerate.
7992 * testsuite/icf_safe_so_test.cc: New file.
7993 * testsuite/icf_safe_so_test.sh: New file.
7994 * testsuite/icf_safe_test.cc (kept_func_3): New function.
7995 (main): Change to take pointer to function kept_func_3.
7996 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
7997 folding is done correctly for X86-64.
7999 2010-02-12 David S. Miller <davem@davemloft.net>
8001 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
8002 is_symbolless parameter.
8003 (Output_reloc<SHT_REL>::is_symbolless): New.
8004 (Output_reloc<SHT_REL>::is_symbolless_): New.
8005 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
8006 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
8007 (Output_reloc<SHT_RELA>::is_symbolless): New.
8008 (Output_data_reloc::add_global): Handle is_symbolless.
8009 (Output_data_reloc::add_global_relative): Likewise.
8010 (Output_data_reloc::add_local): Likewise.
8011 (Output_data_reloc::add_local_relative): Likewise.
8012 (Output_data_reloc::add_symbolless_global_addend): New.
8013 (Output_data_reloc::add_symbolless_local_addend): New.
8014 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
8016 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
8017 instead of ->is_relative_
8018 (Output_reloc::write): Likewise.
8019 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
8020 (Output_reloc::write_rel): Simplify.
8022 * sparc.cc (Target_sparc::Scan::local): Use
8023 ->add_symbolless_local_addend as needed.
8024 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
8025 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
8026 based upon relocation offset.
8028 2010-02-11 Doug Kwan <dougkwan@google.com>
8030 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
8031 (Target_arm::Scan::global): Ditto. Also remove a comment before the
8032 beginning of function.
8033 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
8034 and MOVT_ABS relocations. Those are non issued in scanning. Fix
8035 parameter is_32bit in calls to should_apply_static_reloc.
8036 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
8037 (check_DATA): Add arm_abs_global.stdout.
8038 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
8039 arm_abs_global.stdout): New rules.
8040 (MOSTLLYCLEANFILES): Add arm_abs_global
8041 * Makefile.in: Regenerate.
8042 * testsuite/arm_abs_global.s: New file.
8043 * testsuite/arm_abs_global.sh: Ditto.
8044 * testsuite/arm_abs_lib.s: Ditto.
8046 2010-02-11 Ian Lance Taylor <iant@google.com>
8048 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
8050 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
8051 Allocate_commons_task first.
8052 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
8053 task, rather than symtab_lock_.
8054 (Gc_process_relocs::~Gc_process_relocs): New function.
8055 (Gc_process_relocs::is_runnable): Check this_blocker_.
8056 (Gc_process_relocs::locks): Use next_blocker_ rather than
8058 (Scan_relocs::~Scan_relocs): New function.
8059 (Scan_relocs::is_runnable): Check this_blocker_ rather than
8061 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
8063 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
8064 fields. Add this_blocker_ and next_blocker_ fields. Adjust
8065 constructor accordingly.
8066 (class Gc_process_relocs): Likewise.
8067 (class Scan_relocs): Likewise.
8068 * common.h (class Allocate_commons_task): Remove symtab_lock_
8069 field, and corresponding constructor parameter.
8070 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
8072 (Allocate_commons_task::locks): Likewise.
8074 2010-02-11 Ian Lance Taylor <iant@google.com>
8076 * gold-threads.h (class Once): Define.
8077 (class Initialize_lock): Rewrite as child of Once.
8078 * gold-threads.cc (class Once_initialize): Define.
8079 (once_pointer_control): New static variable.
8080 (once_pointer, once_arg): New static variables.
8081 (c_run_once): New static function.
8082 (Once::Once, Once::run_once, Once::internal_run): New functions.
8083 (class Initialize_lock_once): Remove.
8084 (initialize_lock_control): Remove.
8085 (initialize_lock_pointer): Remove.
8086 (initialize_lock_once): Remove.
8087 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
8088 (Initialize_lock::initialize): Rewrite.
8089 (Initialize_lock::do_run_once): New function.
8090 * archive.cc (Archive::interpret_header): Only clear name if it is
8092 * fileread.cc: Include "gold-threads.h"
8093 (file_counts_lock): New static variable.
8094 (file_counts_initialize_lock): Likewise.
8095 (File_read::release): Only increment counts when using --stats.
8096 Use a lock around the increment.
8097 * parameters.cc (class Set_parameters_target_once): Define.
8098 (set_parameters_target_once): New static variable.
8099 (Parameters::Parameters): Move here from parameters.h.
8100 (Parameters::set_target): Rewrite.
8101 (Parameters::set_target_once): New function.
8102 (Parameters::clear_target): Move here and rewrite.
8103 * parameters.h (class Parameters): Update declarations. Add
8104 set_parameters_target_once_ field.
8105 (Parameters::Parameters): Move to parameters.cc.
8106 (Parameters::clear_target): Likewise.
8107 * readsyms.cc (Read_symbols::do_group): Create a Start_group
8109 (Start_group::~Start_group): New function.
8110 (Start_group::is_runnable): New function.
8111 (Start_group::locks, Start_group::run): New functions.
8112 (Finish_group::run): Change saw_undefined to size_t.
8113 * readsyms.h (class Start_group): Define.
8114 (class Finish_group): Change saw_undefined_ field to size_t.
8115 (Finish_group::Finish_group): Remove saw_undefined and
8116 this_blocker parameters. Change all callers.
8117 (Finish_group::set_saw_undefined): New function.
8118 (Finish_group::set_blocker): New function.
8119 * symtab.h (class Symbol_table): Change saw_undefined to return
8120 size_t. Change saw_undefined_ field to size_t.
8121 * target-select.cc (Set_target_once::do_run_once): New function.
8122 (Target_selector::Target_selector): Initialize set_target_once_
8123 field. Don't initialize lock_ and initialize_lock_ fields.
8124 (Target_selector::instantiate_target): Rewrite.
8125 (Target_selector::set_target): New function.
8126 * target-select.h (class Set_target_once): Define.
8127 (class Target_selector): Update declarations. Make
8128 Set_target_once a friend. Remove lock_ and initialize_lock_
8129 fields. Add set_target_once_ field.
8131 2010-02-10 Ian Lance Taylor <iant@google.com>
8133 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
8135 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
8136 (queue_middle_tasks): Add all blockers before queueing any tasks.
8137 (queue_final_tasks): Likewise.
8138 * token.h (Task_token::add_blockers): New function.
8139 * object.h (Input_objects::number_of_relobjs): New function.
8141 2010-02-10 Ian Lance Taylor <iant@google.com>
8143 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
8144 shared, not if not position independent.
8145 * x86_64.cc (Relocate::relocate_tls): Likewise.
8146 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
8147 (tls_pie_pic_test): New target.
8148 * testsuite/Makefile.in: Rebuild.
8150 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
8151 (tls_test_main_pie.o, tls_test_pie.o): New targets.
8152 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
8153 * testsuite/Makefile.in: Rebuild.
8155 2010-02-09 David S. Miller <davem@davemloft.net>
8157 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
8158 R_SPARC_RELATIVE using ->add_local_relative().
8159 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
8161 * output.h (Output_data_dynamic::add_section_size): New method
8162 that takes two Output_data objects.
8163 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
8164 entry param. Handle it in initializers.
8165 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
8166 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
8167 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
8169 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
8170 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
8171 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
8172 for dynrel_includes_plt.
8173 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8174 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8175 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
8177 (Target_sparc::do_finalize_sections): Update to pass true for
8178 dynrel_includes_plt.
8179 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
8180 output before .rela.plt
8181 (Target_powerpc::do_finalize_sections): Update to pass true for
8182 dynrel_includes_plt when 32-bit.
8184 2010-02-08 Doug Kwan <dougkwan@google.com>
8186 * arm.cc (Arm_relobj::simple_input_section_output_address): New
8188 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
8189 Arm_relobj::scan_section_for_cortex_a8_stubs,
8190 Arm_relobj::do_relocation_section): Instead of calling
8191 Output_section::output_address, use faster
8192 Arm_relobj::simple_input_section_output_address.
8194 2010-02-08 David S. Miller <davem@davemloft.net>
8196 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
8197 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
8198 relocation helper function.
8200 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
8201 just like R_SPARC_GOT{10,13,22}.
8202 (Target_sparc::Scan::local): Likewise.
8203 (Target_sparc::Relocate:relocate): Likewise.
8205 2010-02-06 Ian Lance Taylor <iant@google.com>
8207 * configure.ac: Rewrite targetobjs duplicate removal code to use
8208 only shell constructs.
8209 * configure: Rebuild.
8211 2010-02-05 Doug Kwan <dougkwan@google.com>
8214 * arm.cc (Arm_relobj::section_is_scannable): New method.
8215 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
8216 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
8218 2010-02-04 Doug Kwan <dougkwan@google.com>
8221 * arm-reloc-property.cc (cstdio): Include.
8222 * configure.ac (targetobjs): Remove duplicates.
8223 * configure: Regenerate.
8224 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
8225 big and little endian version for a given address size.
8227 2010-02-03 Doug Kwan <dougkwan@google.com>
8229 * arm-reloc-property.cc
8230 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8232 * arm-reloc-property.h
8233 (Arm_reloc_property_table::get_implemented_static_reloc_property):
8234 New method definition.
8235 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8237 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
8239 (GOT_PREL): Change implemented to Y.
8240 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
8241 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
8242 (Arm_relocate_functions::movw_abs_nc): Remove method.
8243 (Arm_relocate_functions::movt_abs): Ditto.
8244 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
8245 (Arm_relocate_functions::thm_movt_abs): Ditto.
8246 (Arm_relocate_functions::movw_rel_nc): Ditto.
8247 (Arm_relocate_functions::movw_rel): Ditto.
8248 (Arm_relocate_functions::movt_rel): Ditto.
8249 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
8250 (Arm_relocate_functions:thm_movw_rel): Ditto.
8251 (Arm_relocate_functions:thm_movt_rel): Ditto.
8252 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
8253 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
8254 New method definitions.
8255 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
8256 (Arm_relocation_functions::arm_grp_ldr): Ditto.
8257 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
8258 (Arm_relocation_functions::arm_grp_ldc): Ditto.
8259 (Target_arm::Relocate::relocate): Check for non-static or
8260 unimplemented relocation code and exit early. Change calls to
8261 Target_arm::reloc_uses_thumb_bit and
8262 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
8263 instead. Refactor code to handle similar relocations to increase
8264 code sharing. Remove check for unsupported relocation code in switch
8266 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
8267 relocation property table to find out size. Change error message to
8268 print out the name of a relocation code instead of the numeric value.
8269 (Target_arm::scan_reloc_for_stub): Use relocation property table
8270 instead of calling Target_arm::reloc_uses_thumb_bit().
8272 2010-02-02 Doug Kwan <dougkwan@google.com>
8274 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
8275 types of relaxed input section.
8277 2010-02-02 Doug Kwan <dougkwan@google.com>
8279 * Makefile.am (HFILES): Add arm-reloc-property.h.
8281 (TARGETSOURCES): Add arm-reloc-property.cc
8282 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
8283 (libgold_a_SOURCES): $(DEFFILES)
8284 * Makefile.in: Regenerate.
8285 * arm-reloc-property.cc: New file.
8286 * arm-reloc-property.h: New file.
8287 * arm-reloc.def: New file.
8288 * arm.cc: Update comments.
8289 (arm-reloc-property.h): New included header.
8290 (arm_reloc_property_table): New global variable.
8291 (Target_arm::do_select_as_default_target): New method definition.
8292 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
8293 arm-reloc-property to targ_extra_obj.
8294 * parameters.cc (set_parameters_target): Call
8295 Target::select_as_default_target().
8296 * target.h (Target::select_as_default_target): New method definition.
8297 (Target::do_select_as_default_target): Same.
8299 2010-02-01 Doug Kwan <dougkwan@google.com>
8301 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
8302 first_output_text_section_.
8303 (Arm_exidx_fixup::first_output_text_section): New method definition.
8304 (Arm_exidx_fixup::first_output_text_section_): New data member.
8305 (Arm_exidx_fixup::process_exidx_section): Record the first text
8306 output section seen.
8307 (Arm_output_section::fix_exidx_coverage): Set correct linked section
8308 and entsize in output section header.
8310 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8312 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
8313 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
8314 (Arm_relocate_functions::thm_alu11): New Method.
8315 (Arm_relocate_functions::thm_pc8): New Method.
8316 (Arm_relocate_functions::thm_pc12): New Method.
8317 (Target_arm::Scan::local): Handle the relocations.
8318 (Target_arm::Scan::global): Likewise.
8319 (Target_arm::Relocate::relocate): Likewise.
8320 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8322 2010-01-29 Doug Kwan <dougkwan@google.com>
8324 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
8325 of relocation types as ld.
8327 2010-01-29 Doug Kwan <dougkwan@google.com>
8329 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
8331 (Arm_relocate_functions::thumb_branch_common): Ditto.
8332 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
8333 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
8334 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
8335 Arm_relocate_functions::jump24): Remove.
8336 (Target_arm::Relocate::relocate): Adjust code to call
8337 Arm_relocation_functions::arm_branch_common and
8338 Arm_relocation_functions::thumb_branch_common instead of their removed
8339 wrappers. Merge switch-cases together to reduce source code size.
8341 2010-01-29 Doug Kwan <dougkwan@google.com>
8343 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
8344 output_local_symbol_count_needs_update_.
8345 (Arm_relobj::output_local_symbol_count_needs_update,
8346 Arm_relobj::set_output_local_symbol_count_needs_update,
8347 Arm_relobj::update_output_local_symbol_count): New methods.
8348 (Arm_relobj::output_local_symbol_count_needs_update_): New data
8350 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
8351 of pointed function as in a R_ARM_PREL31 relocation.
8352 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
8353 for output local symbol count updating.
8354 (Target_arm::do_relax): Update output local symbol counts in objects
8356 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
8358 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8360 * arm.cc: Added support for the ARM relocations:
8361 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
8362 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
8363 (Arm_relocate_functions::movw_rel_nc): Renamed (was
8365 (Arm_relocate_functions::movw_rel): New method.
8366 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
8367 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
8369 (Arm_relocate_functions::thm_movw_rel): New method.
8370 (Arm_relocate_functions::thm_movt_rel): Renamed (was
8372 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
8374 (Target_arm::Scan::global): Likewise.
8375 (Target_arm::Relocate::relocate): Likewise.
8376 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8379 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8381 * arm.cc: Added support for ARM group relocations.
8382 (Target_arm::reloc_needs_sym_origin): New method.
8383 (Arm_relocate_functions::calc_grp_kn): New method.
8384 (Arm_relocate_functions::calc_grp_residual): New method.
8385 (Arm_relocate_functions::calc_grp_gn): New method.
8386 (Arm_relocate_functions::arm_grp_alu): New Method.
8387 (Arm_relocate_functions::arm_grp_ldr): New Method.
8388 (Arm_relocate_functions::arm_grp_ldrs): New Method.
8389 (Arm_relocate_functions::arm_grp_ldc): New Method.
8390 (Target_arm::Scan::local): Handle the ARM group relocations.
8391 (Target_arm::Scan::global): Likewise.
8392 (Target_arm::Relocate::relocate): Likewise.
8393 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8396 2010-01-26 Doug Kwan <dougkwan@google.com>
8398 * arm.cc (set): Include.
8399 (class Arm_exidx_fixup): Change type of last_input_section_ to const
8401 (Arm_output_section::Text_section_list): New type.
8402 (Arm_output_section::append_text_sections_to_list): New method.
8403 (Arm_output_section::fix_exidx_coverage): Ditto.
8404 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
8405 (Arm_relobj::convert_input_section_to_relaxed_section): Use
8406 Relobj::set_section_offset() instead of
8407 Sized_relobj::invalidate_section_offset().
8408 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
8409 parameter for section headers. Ignore relocation sections for
8410 unallocated sections and EXIDX sections.
8411 (Target_arm::fix_exidx_coverage): New method.
8412 (Target_arm::output_section_address_less_than): New type.
8413 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
8414 linked text section instead of the EXIDX section.
8415 (Arm_output_section::create_stub_group): Add an assertion to check
8416 that this is not an EXIDX output section.
8417 (Arm_output_section::append_text_sections_to_list): New method.
8418 (Arm_output_section::fix_exidx_coverage): Ditto.
8419 (Arm_relobj::scan_sections_for_stubs): Adjust call to
8420 Arm_relobj::section_needs_reloc_stub_scanning.
8421 (Target_arm::do_relax): Fix EXIDX output section coverage in the
8423 (Target_arm::fix_exidx_coverage): New method.
8424 * object.h (Relobj::set_output_section): New method.
8425 (Sized_relobj::invalidate_section_offset): Remove method.
8426 (Sized_relobj::do_invalidate_section_offset): Remove method.
8427 (Sized_relobj::do_set_section_offset): Handle offset value -1.
8429 2010-01-25 Doug Kwan <dougkwan@google.com>
8431 * arm.cc (Arm_exidx_merged_section::do_output_offset):
8432 Fix warning due to signed and unsigned comparison on a 32-bit host.
8434 2010-01-22 Doug Kwan <dougkwan@google.com>
8436 * arm.cc (Target_arm::do_relax): Record an output section for section
8437 offset adjustment it contains any stub table that has changed.
8438 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
8439 offsets in an output section if necessary.
8440 * output.cc (Output_section::Output_section): Initialize
8441 section_offsets_need_adjustments_.
8442 (Output_section::add_input_section_for_script): Renamed to
8443 Output_section::add_simple_input_section.
8444 (Output_section::save_states): Add a comment.
8445 (Output_section::discard_states): New method defintion.
8446 (Output_section::adjust_section_offsets): Same.
8447 * output.h (Output_section::add_input_section_for_script): Renamed to
8448 Output_section::add_simple_input_section.
8449 (Output_section::discard_states): New method declaration.
8450 (Output_section::adjust_section_offsets): Same.
8451 (Output_section::section_offsets_need_adjustment,
8452 Output_section::set_section_offsets_need_adjustment): New method
8454 (Output_section::section_offsets_need_adjustment_): New data member.
8455 * script-sections.cc
8456 (Output_section_element_input::set_section_address): Adjust code for
8457 renaming of Output_section::add_input_section_for_script.
8458 (Orphan_output_section::set_section_address): Same.
8460 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8462 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
8463 Fix_v4bx enum values .
8464 * gold/options.h (General_options): New option definitions.
8465 (General_options::fix_v4bx): New method.
8466 (General_options::Fix_v4bx): New enum.
8467 * gold/options.cc (General_options::parse_fix_v4bx): New method.
8468 (General_options::parse_fix_v4bx_interworking): New method.
8470 2010-01-22 Doug Kwan <dougkwan@google.com>
8472 * arm.cc (Arm_exidx_fixup): New class.
8474 2010-01-21 Doug Kwan <dougkwan@google.com>
8476 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
8478 (Arm_exidx_section_offset_map): New type.
8480 2010-01-21 Doug Kwan <dougkwan@google.com>
8482 * arm.cc (Arm_exidx_input_section): New class.
8483 (Arm_relobj::exidx_input_section_by_link,
8484 Arm_relobj::exidx_input_section_by_shndx,
8485 Arm_relobj::make_exidx_input_section): New methods.
8486 (read_arm_attributes_section): Remove.
8487 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
8488 information about them.
8489 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
8492 2010-01-20 Doug Kwan <dougkwan@google.com>
8494 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
8495 Input_section_specifier to Section_id.
8496 (Target_arm::new_arm_input_section: Adjust code for change of key
8498 (Target_arm::find_arm_input_section): Ditto.
8499 * gc.h (object.h): Include for Section_id nand Section_id_hash.
8500 (Section_id): Remove.
8501 (Garbage_collection::Section_id_hash): Remove.
8502 * icf.h (object.h): Include for Section_id nand Section_id_hash.
8503 (Section_id): Remove.
8504 (Icf::Section_id_hash): Remove.
8505 * object.h (Section_id, Const_section_id, Section_id_hash,
8506 Const_section_id_hash): New type definitions.
8507 * output.cc (Output_section::add_relaxed_input_section): Change to
8508 use Const_section_id instead of Input_section_specifier as key type.
8509 (Output_section::add_merge_input_section): Ditto.
8510 (Output_section::build_relaxation_map): Change to use Section_id
8511 instead of Input_section_specifier as key type.
8512 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8514 (Output_section::convert_input_sections_to_relaxed_sections): Change
8515 to use Const_section_id instead of Input_section_specifier as key type.
8516 (Output_section::find_merge_section): Ditto.
8517 (Output_section::find_relaxed_input_section): Ditto.
8518 * output.h (Input_section_specifier): Remove class.
8519 (Output_section::Output_section_data_by_input_section_map): Change
8520 key type to Const_section_id.
8521 (Output_section::Output_relaxed_input_section_by_input_section_map):
8523 (Output_section::Relaxation_map): Change key type to Section_id.
8525 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8527 * gold/arm.cc: Added support for R_ARM_V4BX relocation
8528 (class Arm_v4bx_stub): New class.
8529 (DEF_STUBS): Updated definition to support v4_veneer_bx.
8530 (Stub_factory::make_arm_v4bx_stub): New method.
8531 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
8532 (Stub_table::empty): Handle v4bx stubs.
8533 (Stub_table::add_arm_v4bx_stub): New method.
8534 (Stub_table::find_arm_v4bx_stub): New method.
8535 (Arm_relocate_functions::v4bx): New method.
8536 (Target_arm::fix_v4bx): New method.
8537 (Target_arm::Target_arm): Handle R_ARM_V4BX.
8538 (Stub_table::relocate_stubs): Likewise.
8539 (Stub_table::do_write): Likewise.
8540 (Stub_table::update_data_size_and_addralign): Likewise.
8541 (Stub_table::finalize_stubs): Likewise.
8542 (Target_arm::Scan::local): Likewise.
8543 (Target_arm::Scan::global): Likewise.
8544 (Target_arm::do_finalize_sections): Likewise.
8545 (Target_arm::Relocate::relocate): Likewise.
8546 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8548 (Target_arm::scan_reloc_for_stub): Likewise.
8549 (Target_arm::scan_reloc_section_for_stubs): Likewise.
8551 2010-01-19 Ian Lance Taylor <iant@google.com>
8553 * output.cc (Output_section_headers::do_sized_write): Write large
8554 segment count to sh_info field.
8555 (Output_file_header::do_sized_write): For large segment count,
8556 write PN_XNUM to e_phnum field.
8558 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8560 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
8561 (Arm_relocate_functions::thm_jump8): New function.
8562 (Arm_relocate_functions::thm_jump11): New function.
8563 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
8565 (Target_arm::Scan::global): Likewise.
8566 (Target_arm::Relocate::relocate): Likewise.
8567 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8570 2010-01-14 Doug Kwan <dougkwan@google.com>
8572 * arm.cc (map, utility): Include headers.
8573 (Target_arm::apply_cortex_a8_workaround): New method.
8574 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
8575 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
8576 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
8577 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
8578 the --[no-]fix-cortex-a8 command line options.
8579 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
8580 (Target_arm::relocate_stub): Use addend in instruction template.
8581 * options.h (DEFINE_bool): Set the user-set flag.
8582 (General_options): Add --[no-]-fix-cortex options.
8583 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
8584 : Update fast look-up map after conversion.
8586 2010-01-14 Sriraman Tallam <tmsriram@google.com>
8588 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
8589 in the first pass of do_layout.
8591 2010-01-13 Doug Kwan <dougkwan@google.com>
8593 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8594 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
8595 apparent compiler problem of not folding static constant integral
8596 data members of elfcpp::Elf_sizes<32>.
8598 2010-01-13 Doug Kwan <dougkwan@google.com>
8600 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8601 Arm_relobj::section_needs_cortex_a8_stub_scanning,
8602 Arm_relobj::scan_section_for_cortex_a8_erratum,
8603 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
8604 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
8605 sections to scan for relocation stubs into a new method
8606 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
8607 relocation and Cortex-A8 stub scanning.
8608 (Target_arm::do_relax): Force stubs to be after stubbed sections
8609 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
8610 the beginning of a new relaxation pass. Update a comment.
8611 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
8613 2010-01-12 Ian Lance Taylor <iant@google.com>
8615 * target-reloc.h (visibility_error): New inline function.
8616 (relocate_section): Call visibility_error.
8617 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
8618 (MOSTLYCLEANFILES): Likewise.
8619 (protected_4_pic.o, protected_3.err): New targets.
8620 * testsuite/protected_4.cc: New file.
8622 2010-01-12 Doug Kwan <dougkwan@google.com>
8624 * arm.cc (Cortex_a8_reloc): New class.
8625 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
8626 and cortex_a8_relocs_info_.
8627 (Target_arm::fix_cortex_a8): New method definition.
8628 (Target_arm::Cortex_a8_relocs_info): New type.
8629 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
8630 New data member declarations.
8631 (Target_arm::scan_reloc_for_stub): Record information about
8632 relocations for THUMB branches that might be exempted from the
8633 Cortex-A8 workaround.
8634 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
8635 at the beginning of a relaxation pass.
8637 2010-01-12 Doug Kwan <dougkwan@google.com>
8639 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
8640 (Arm_relobj::Mapping_symbol_position,
8641 Arm_reloj::Mapping_symbol_position_less,
8642 Arm_relobj::Mapping_symbols_info): New types.
8643 (Target_arm::is_mapping_symbol_name): New method definition.
8644 (Arm_relobj::do_count_local_symbols): Save information about mapping
8647 2010-01-11 Doug Kwan <dougkwan@google.com>
8649 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
8650 Arm_relocate_functions::thumb32_branch_upper,
8651 Arm_relocate_functions::thumb32_branch_lower,
8652 Arm_relocate_functions::thumb32_cond_branch_offset,
8653 Arm_relocate_functions::thumb32_cond_branch_upper,
8654 Arm_relocate_functions::thumb32_cond_branch_lower,
8655 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
8656 branch offset encoding.
8657 (Arm_relocate_functions::thumb_branch_common): Use new branch
8658 offset encoding methods to avoid code duplication.
8659 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
8660 (Stub_addend_reader::operator()): Use new branch encoding method
8661 to avoid code duplication.
8663 2010-01-11 Doug Kwan <dougkwan@google.com>
8665 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
8666 (Target_arm::do_finalize_sections): Define special EXIDX section
8667 symbols only if referenced.
8668 * gc.h (Garbage_collection::add_reference): New method.
8669 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
8672 2010-01-11 Ian Lance Taylor <iant@google.com>
8674 * script.cc (Version_script_info::build_expression_list_lookup):
8675 Change complaing about duplicate wildcard match from error to
8678 * script.cc (class Lazy_demangler): Recreate--revert part of patch
8680 (Version_script_info::Version_script_info): Initialize globs_,
8681 default_version_, default_is_global_, and exact_. Don't
8682 initialize globals_ or locals_.
8683 (Version_script_info::build_lookup_tables): Build local symbols
8685 (Version_script_info::unquote): New function.
8686 (Version_script_info::add_exact_match): New function.
8687 (Version_script_info::build_expression_list_lookup): Remove lookup
8688 parameter. Add is_global parameter. Change all callers. Handle
8689 wildcard pattern specially. Unquote pattern. Call
8691 (Version_script_info::get_name_to_match): New function.
8692 (Version_script_info::get_symbol_version): New function.
8693 (Version_script_info::get_symbol_version_helper): Remove.
8694 (Version_script_info::check_unmatched_names): Call unquote.
8695 * script.h (class Version_script_info): Change get_symbol_version
8696 to be non-inline and add is_global parameter; change all callers.
8697 Rewrite symbol_is_local. Update declarations. Define struct
8698 Version_tree_match, Exact, Globs. Don't define struct Lookup.
8699 Remove globals_ and locals_ members. Add exact_, globs_,
8700 default_version_, is_global_.
8701 (Version_script_info::Glob): Remove pattern, add expression and
8702 is_global. Update constructor. Change all callers.
8703 * dynobj.cc (Versions::finalize): Mark the version symbol as the
8705 (Versions::symbol_section_contents): If a symbol is undefined, or
8706 defined in a dynamic object, set the version index to
8708 * symtab.cc (Symbol_table::add_from_relobj): Don't call
8710 (Symbol_table::add_from_pluginobj): Likewise.
8711 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
8713 2010-01-11 Doug Kwan <dougkwan@google.com>
8715 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
8716 (incremental_dump_LDADD): Add linking option for libintl.
8717 * Makefile.in: Regenerate.
8719 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
8722 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
8724 * testsuite/Makefile.in: Regenerated.
8726 2010-01-10 Doug Kwan <dougkwan@google.com>
8728 * options.h (DEFINE_var): Use parentheses around argument varname__
8729 in macro body to avoid any unintended subsequent substitutions.
8731 2010-01-10 Ian Lance Taylor <iant@google.com>
8733 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
8734 candidates before doing symbol resolution.
8736 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
8737 ODR candidates if only one is weak.
8739 2010-01-08 Ian Lance Taylor <iant@google.com>
8741 * script.cc (Version_script_info::build_expression_list_lookup):
8742 Don't warn about ambiguous version, just record the ambiguity.
8743 (Version_script_info::get_symbol_version_helper): Give error if
8744 version is ambiguous.
8746 2010-01-08 Doug Kwan <dougkwan@google.com>
8748 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
8749 prev_data_size_ and prev_addralign_. Remove initializer for
8750 deleted data member has_been_changed_.
8751 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
8752 to determine if the table is empty.
8753 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
8755 (Stub_table::add_reloc_stub): Define method in class definition
8756 instead of just declaring it there.
8757 (Stub_table::add_cortex_a8_stub): New method definition.
8758 (Stub_table::update_data_size_and_addralign): Ditto.
8759 (Stub_table::finalize_stubs): Ditto.
8760 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
8761 (Stub_table::do_addralign_): Return address alignment in the
8762 (Stub_table::do_reset_address_and_file_offset): Define method in
8763 class definition instead of declaring it there. Set current data
8764 size to be the data size of the previous pass.
8765 (Stub_table::set_final_data_size): Use current data size as the
8767 (Stub_table::relocate_stub): Change parameter type of stub from
8768 Reloc_stub pointer to Stub pointer.
8769 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
8770 (Stub_table::Cortex_a8_stub_list): New typedef.
8771 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
8772 Stub_table::prev_addralign_): New data member.
8773 (Arm_relobj::Arm_relobj): Initialize data member
8774 section_has_cortex_a8_workaround_.
8775 (Arm_relobj::section_has_cortex_a8_workaround,
8776 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
8778 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
8780 (Target_arm::relocate_stub): Change parameter type of stub from
8781 Reloc_stub pointer to Stub pointer.
8782 (Insn_template::size, Insn_template::alignment): Handle
8783 THUMB16_SPECIAL_TYPE.
8784 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
8785 Stub_table::update_data_size_and_addralign,
8786 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
8788 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
8789 (Stub_table::do_write): Ditto.
8790 (Target_arm::do_relax): Adjust code for changes in Stub_table.
8792 2010-01-08 Ian Lance Taylor <iant@google.com>
8795 * symtab.h (class Symbol): Remove fields is_target_special_ and
8796 has_plt_offset_. Add field is_defined_in_discarded_section_.
8797 (Symbol::is_defined_in_discarded_section): New function.
8798 (Symbol::set_is_defined_in_discarded_section): New function.
8799 (Symbol::has_plt_offset): Rewrite.
8800 (Symbol::set_plt_offset): Verify that new offset is not -1U.
8801 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
8802 Don't initialize is_target_special_ or has_plt_offset_.
8803 Initialize is_defined_in_discarded_section_.
8804 (Symbol_table::add_from_relobj): If appropriate, set
8805 is_defined_in_discarded_section.
8806 * resolve.cc (Symbol::override_base_with_special): Don't test
8807 is_target_special_. Change has_plt_offset_ to has_plt_offset().
8808 * target-reloc.h (relocate_section): Do special handling for
8809 symbols defined in discarded sections for global symbols as well
8812 2010-01-08 Ian Lance Taylor <iant@google.com>
8814 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
8815 the SHT_SYMTAB case.
8817 2010-01-08 Ian Lance Taylor <iant@google.com>
8819 * object.cc (Sized_relobj::do_layout): Don't get confused if
8820 layout_eh_frame returns NULL.
8822 2010-01-08 Ian Lance Taylor <iant@google.com>
8825 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
8826 dynamic symbol table, use the normal symbol table.
8827 (Sized_dynobj::do_read_symbols): Remove assertion about type of
8830 2010-01-08 Ian Lance Taylor <iant@google.com>
8833 * layout.cc (Layout::include_section): Remove .gnu_debuglink
8836 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
8838 * version.cc (print_version): Change to "Copyright 2010".
8840 2010-01-08 Ian Lance Taylor <iant@google.com>
8844 * i386.cc (class Target_i386): Change return type of plt_section
8846 (class Output_data_plt_i386): Add tls_desc_rel_ field.
8847 (Output_data_plt_i386::Output_data_plt_i386): Initialize
8848 tls_desc_rel_ field.
8849 (Output_data_plt_i386::rel_tls_desc): New function.
8850 (Target_i386::rel_tls_desc_section): New function.
8851 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
8852 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
8853 R_386_TLS_DESC reloc in rel_tls_desc_section.
8854 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
8855 Define struct Tlsdesc_info.
8856 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
8857 (Target_x86_64::do_reloc_symbol_index): New function.
8858 (Target_x86_64::add_tlsdesc_info): New function.
8859 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
8860 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
8862 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
8864 (Output_data_plt_x86_64::rela_tlsdesc): New function.
8865 (Target_x86_64::rela_tlsdesc_section): New function.
8866 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
8868 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
8869 (Target_x86_64::do_reloc_addend): New function.
8870 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
8871 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
8872 declarations. Define TARGET_CODE. Add arg field to u1_ union.
8873 (Output_reloc::type): New function.
8874 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
8875 (Output_reloc::is_target_specific): New function.
8876 (Output_reloc::target_arg): New function.
8877 (class Output_reloc) [SHT_RELA]: Add four new constructors for
8878 absolute relocs and target specific relocs.
8879 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
8880 add_target_specific.
8881 (class Output_data_reloc) [SHT_RELA]: Likewise.
8882 * output.cc (Output_reloc::Output_reloc): Add four new versions
8883 for absolute relocs and target specific relocs.
8884 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
8885 (Output_reloc::get_symbol_index): Likewise.
8886 (Output_reloc::local_section_offset): Check that local_sym_index_
8887 is not TARGET_CODE or 0.
8888 (Output_reloc::symbol_value): Likewise.
8889 (Output_reloc::write) [SHT_RELA]: Call target for target specific
8891 * target.h (class Target): Add reloc_symbol_index and reloc_addend
8892 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
8894 * layout.cc (add_target_dynamic_tags): Use output section for
8895 DT_PLTRELSZ and DT_JMPREL.
8897 2010-01-07 Ian Lance Taylor <iant@google.com>
8900 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
8902 (class Output_data_reloc_generic): Define.
8903 (class Output_data_reloc_base): Change base class to
8904 Output_data_reloc_generic. Change add() method to call
8905 bump_relative_reloc_count for a relative reloc. Remove
8907 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
8909 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
8910 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
8912 * layout.h (class Layout): Update declaration.
8914 2010-01-07 Ian Lance Taylor <iant@google.com>
8916 * output.h (class Output_data): Add const version of
8917 output_section and do_output_section.
8918 (class Output_section_data): Add const version of
8920 (class Output_section): Likewise.
8921 * layout.cc (Layout::add_target_dynamic_tags): New function.
8922 * layout.h (class Layout): Update declarations.
8923 * arm.cc (Target_arm::do_finalize_sections): Use
8924 add_target_dynamic_tags.
8925 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8926 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8927 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8928 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8930 2010-01-07 Ian Lance Taylor <iant@google.com>
8933 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
8936 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
8937 Ian Lance Taylor <iant@google.com>
8940 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
8941 Xindex::read_symtab_xindex.
8943 2010-01-07 Doug Kwan <dougkwan@google.com>
8945 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
8946 (Insn_template::thumb16_bcond_insn): New method declaration.
8947 (Insn_template): Fix spelling.
8948 (Stub::thumb16_special): New method declaration.
8949 (Stub::do_write): Define virtual method which was previously pure
8951 (Stub::do_thumb16_special): New method declaration.
8952 (Stub::do_fixed_endian_write): New template member.
8953 (Reloc_stub::do_write): Remove.
8954 (Reloc_stub::do_fixed_endian_write): Remove.
8955 (Cortex_a8_stub): New class definition.
8956 (Stub_factory::make_cortex_a8_stub): New method definition.
8957 (Stub_factory::Stub_factory): Add missing static storage class
8958 qualifier for elf32_arm_stub_a8_veneer_blx.
8960 2010-01-07 Ian Lance Taylor <iant@google.com>
8963 * options.h (class General_options): Add --warn-unresolved-symbols
8964 and --error-unresolved-symbols.
8965 * errors.cc (Errors::undefined_symbol): Implement
8966 --warn-unresolved-symbols.
8968 * options.h (class General_options): Add -z text and -z textoff.
8969 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
8971 2010-01-06 Sriraman Tallam <tmsriram@google.com>
8973 * gc.h (Garbage_collection::Cident_section_map): New typedef.
8974 (Garbage_collection::cident_sections): New function.
8975 (Garbage_collection::add_cident_section): New function.
8976 (Garbage_collection::cident_sections_): New member.
8977 (gc_process_relocs): Add references to sections whose names are C
8979 * gold.h (cident_section_start_prefix): New constant.
8980 (cident_section_stop_prefix): New constant.
8981 (is_cident): New function.
8982 * layout.cc (Layout::define_section_symbols): Replace string constants
8983 with the newly defined constants.
8984 * object.cc (Sized_relobj::do_layout): Track sections whose names are
8986 * testsuite/Makefile.am: Add gc_orphan_section_test.
8987 * testsuite/Makefile.in: Regenerate.
8988 * testsuite/gc_orphan_section_test.cc: New file.
8989 * testsuite/gc_orphan_section_test.sh: New file.
8991 2010-01-06 Ian Lance Taylor <iant@google.com>
8994 * options.h (class General_options): Add --warn-shared-textrel.
8995 * layout.cc (Layout::finish_dynamic_section): Implement
8996 --warn-shared-textrel.
8999 * options.h (class General_options): Add --warn-multiple-gp.
9001 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9003 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
9004 $(THREADSLIB) and $(LIBDL).
9005 * Makefile.in: Rebuild.
9007 2010-01-06 Ian Lance Taylor <iant@google.com>
9010 * options.cc (General_options::parse_section_start): New function.
9011 (General_options::section_start): New function.
9012 (General_options::General_options): Initialize all members.
9013 * options.h: Include <map>
9014 (class General_options): Add --section-start. Add section_starts_
9016 * layout.cc (Layout::attach_allocated_section_to_segment): If
9017 --section-start was used, set the address of the segment. Remove
9018 local sort_sections.
9019 (Layout::relaxation_loop_body): If the address of the load segment
9020 has been set by --section-start, don't use it.
9021 * output.h (Output_segment::update_flags_for_output_section): New
9023 * output.cc (Output_segment::add_output_section): Call
9024 update_flags_for_output_section.
9026 2010-01-05 Ian Lance Taylor <iant@google.com>
9029 * options.h (class General_options): Add --undefined-version.
9030 * script.cc (struct Version_expression): Add was_matched_by_symbol
9032 (Version_script_info::matched_symbol): New function.
9033 (Version_script_info::get_symbol_version_helper): Call
9035 (Version_script_info::check_unmatched_names): New function.
9036 * script.h (class Version_script_info): Update declarations.
9037 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
9039 * options.h (class General_options): Use DEFINE_bool_alias for
9040 allow_multiple_definition.
9041 * resolve.cc (Symbol_table::should_override): Don't test
9042 allow_multiple_definition.
9045 * options.h (class General_options): Add --cref.
9046 * main.cc (main): Print cref table if --cref. Don't close mapfile
9047 until after printing cref table.
9048 * cref.cc: Include "symtab.h".
9049 (class Cref_inputs): Define Cref_table_compare and Cref_table.
9050 (Cref_table_compare::operator()): New function.
9051 (Cref_inputs::gather_cref): New function.
9052 (filecol): New static const.
9053 (Cref_inputs::print_cref): New function.
9054 (Cref::print_cref): New function.
9055 * cref.h: Include <cstdio>.
9056 (class Cref): Update declarations.
9057 * mapfile.h (Mapfile::file): New function.
9058 * object.h (class Object): Define Symbols. Declare virtual
9059 do_get_global_symbols.
9060 (Object::get_global_symbols): New function.
9061 * object.cc (Input_objects::add_object): Pass object to cref_ if
9063 (Input_objects::archive_start): Likewise.
9064 (Input_objects::archive_stop): Likewise.
9065 (Input_objects::print_cref): New function.
9066 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
9067 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
9069 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
9071 * plugin.h (class Sized_pluginobj): Update declarations.
9073 2010-01-05 Ian Lance Taylor <iant@google.com>
9075 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
9076 to is_default_version. Rename insdef to insdefault.
9077 (Symbol_table::add_from_relobj): Rename def to is_default_version
9078 and local to is_forced_local.
9079 (Symbol_table::add_from_pluginobj): Likewise.
9080 (Symbol_table::add_from_dynobj): Likewise.
9081 (Symbol_table::define_special_symbol): Rename insdef to
9084 2010-01-04 Ian Lance Taylor <iant@google.com>
9087 * options.h (class General_options): Add
9088 --allow-multiple-definition and -z muldefs.
9089 * resolve.cc (Symbol_table::should_override): Don't warn about a
9090 multiple symbol definition if --allow-multiple-definition or -z
9094 * options.h (class General_options): Add --add-needed and
9095 --copy-dt-needed-entries. Tweak --as-needed help entry.
9096 * object.cc (Input_objects::check_dynamic_dependencies): Give an
9097 error if --copy-dt-needed-entries aka --add-needed is used and
9098 would cause a change in behaviour.
9101 * options.h (class General_options): Add -G as a short version of
9102 --shared. Add no-op options -assert, -g, and -i.
9104 2010-01-04 Sriraman Tallam <tmsriram@google.com>
9106 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
9107 check for .text or .gnu.linkonce.t sections.
9108 * icf.cc (Icf::find_identical_sections): Ditto.
9109 Change the detection for mangled function name within the section
9111 * icf.h (is_section_foldable_candidate): New function.
9113 2009-12-30 Ian Lance Taylor <iant@google.com>
9116 * options.h (class General_options): Permit two dashes with
9117 --retain-symbols-file.
9119 2009-12-30 Ian Lance Taylor <iant@google.com>
9122 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
9123 don't put the file header and segment headers in the text
9127 * common.cc (Sort_commons::operator()): Stabilize sort when both
9129 (Symbol_table::do_allocate_commons_list): When allocating common
9130 symbols, skip a symbol which is no longer common.
9131 * symtab.h (Symbol::is_common): Test whether the symbol comes from
9132 an object before checking its type.
9133 * testsuite/common_test_2.c: New file.
9134 * testsuite/common_test_3.c: New file.
9135 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
9136 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
9137 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
9138 (common_test_2_pic.o, common_test_2.so): New targets.
9139 (common_test_3_pic.o, common_test_3.so): New targets.
9140 * testsuite/Makefile.in: Rebuild.
9143 * script.cc (read_input_script): If we see a new SECTIONS clause,
9144 and we have added an input section, give an error.
9145 * layout.h (class Layout): Add have_added_input_section function.
9146 Add have_added_input_section_ field.
9147 * layout.cc (Layout::Layout): Initialize
9148 have_added_input_section_.
9149 (Layout::layout): Set have_added_input_section_.
9150 (Layout::layout_eh_frame): Likewise.
9152 2009-12-30 Ian Lance Taylor <iant@google.com>
9155 * options.h (class General_options): Add --sort-common option.
9156 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
9157 * common.cc (Sort_common): Add sort_order parameter to
9158 constructor. Add sort_order_ field.
9159 (Sort_commons::operator): Check sort_order_.
9160 (Symbol_table::allocate_commons): Determine the sort order.
9161 (Symbol_table::do_allocate_commons): Add sort_order parameter.
9163 (Symbol_table::do_allocate_commons_list): Likewise.
9165 2009-12-30 Ian Lance Taylor <iant@google.com>
9168 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
9169 symbols from this object, don't change the visibility of an
9171 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
9173 2009-12-30 Ian Lance Taylor <iant@google.com>
9176 * script.h (class Version_script_info): Define Language enum.
9177 Update declarations. Define Glob, Exact, and Lookup types. Add
9178 new fields globals_, locals_, and is_finalized_.
9179 * script.cc: Various formatting fixes.
9180 (class Parser_closure): Change language_stack_ from a vector of
9181 std::string to one of Version_script_info::Language. Adjust all
9183 (class Lazy_demangler): Remove.
9184 (struct Version_expression): Change language from std::string to
9185 Version_script_info::Language.
9186 (Version_script_info::Version_script_info): New function.
9187 (Version_script_info::~Version_script_info): Don't call clear.
9188 (Version_script_info::finalize): New function.
9189 (Version_script_info::build_lookup_tables): New function.
9190 (Version_script_info::build_expression_list_lookup): New
9192 (Version_script_info::get_symbol_version_helper): Rewrite to use
9194 (Version_script_info::print_expression_list): Adjust to use
9195 Version_script_info::Language.
9196 (script_push_lex_into_version_mode): Check that the version script
9197 has not been finalized.
9198 (version_script_push_lang): Change language string to
9199 Version_script_info::Language.
9200 * options.cc (Command_line::version_script): New function.
9201 * options.h (class General_options): Add finalize_dynamic_list
9202 function. Change version_script from declaration to definition.
9203 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
9204 * testsuite/version_script.map: Remove duplicate def of foo.
9205 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
9207 * testsuite/Makefile.in: Rebuild.
9209 2009-12-30 Ian Lance Taylor <iant@google.com>
9212 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
9213 if the input symbol index is 0, make the output symbol index 0.
9215 2009-12-30 Ian Lance Taylor <iant@google.com>
9218 * options.h (class General_options): Add -x/--discard-all.
9219 * object.cc (Sized_relobj::do_count_local_symbols): Handle
9220 --discard-all. If the local symbol needs a dynamic entry, check
9221 that before handling --discard-locals.
9223 2009-12-30 Ian Lance Taylor <iant@google.com>
9226 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
9228 (Output_segment::add_output_section): Don't change the flags if
9232 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
9233 GNU hash table if they need a dynamic value. Otherwise, don't add
9234 them if they are defined in a dynamic object or are forced local.
9236 2009-12-29 Ian Lance Taylor <iant@google.com>
9239 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
9240 .gnu.hash table for a 32-bit target.
9243 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
9244 regular and a dynamic object only needs a dynamic symbol table
9245 entry if it is externally visible.
9248 * i386.cc (class Target_i386): Initialize global_offset_table_ in
9249 constructor. Add global_offset_table_ field.
9250 (Target_i386::got_section): Set global_offset_table_.
9251 (Target_i386::do_finalize_sections): Set global_offset_table_
9253 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
9254 in constructor. Add global_offset_table_ field.
9255 (Target_x86_64::got_section): Set global_offset_table_.
9256 (Target_x86_64::do_finalize_sections): Set global_offset_table_
9259 * layout.cc (Layout::Layout): Initialize increase_relro_.
9260 (Layout::get_output_section): Add is_relro, is_last_relro, and
9261 is_first_non_relro parameters. Change all callers.
9262 (Layout::choose_output_section): Likewise.
9263 (Layout::add_output_section_data): Likewise.
9264 (Layout::make_output_section): Likewise.
9265 (Layout::set_segment_offsets): Clear increase_relro when using a
9267 * layout.h (class Layout): Add increase_relro method. Add
9268 increase_relro_ field. Update declarations.
9269 * output.cc (Output_section::Output_section): Initialize
9270 is_last_relro_ and is_first_non_relro_.
9271 (Output_segment::add_output_section): Group relro sections is
9272 do_sort is true. Handle is_last_relro and is_first_non_relro.
9273 (Output_segment::maximum_alignment): Remove relro handling.
9274 (Output_segment::set_section_addresses): Add increase_relro
9275 parameter. Change all callers. Add initial alignment to align
9276 relro sections on separate page. Remove old relro handling.
9277 (Output_segment::set_section_list_addresses): Remove in_relro
9278 parameter. Change all callers.
9279 (Output_segment::set_offset): Add increase parameter. Change all
9280 callers. Remove old relro handling.
9281 * output.h (class Output_section): Add new methods: is_last_relro,
9282 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
9283 Add is_last_relro_ and is_first_non_relro_ fields.
9284 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
9285 Create separate .got.plt section. Call increase_relro.
9286 * x86_64.cc (Target_x86_64::got_section): Likewise.
9287 * testsuite/relro_script_test.t: Add .got.plt.
9290 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
9291 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
9292 (Layout::finalize): Call set_dynamic_symbol_size.
9293 (Layout::set_dynamic_symbol_size): New function.
9294 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
9295 set_dynamic_symbol_size.
9298 * output.h (class Output_section): Add is_entsize_zero_ field.
9299 * output.cc (Output_section::Output_section): Initialize
9301 (Output_section::set_entsize): If two different entsizes are
9302 requested, force it to zero.
9303 (Output_section::add_input_section): Set flags for .debug_str
9304 before updating section flags. Set entsize.
9305 (Output_section::update_flags_for_input_section): Set SHF_MERGE
9306 and SHF_STRING if all input sections have those flags.
9308 2009-12-29 Rafael Espindola <espindola@google.com>
9310 * main.cc (main): Fix the sys time reporting.
9311 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
9314 2009-12-29 Sriraman Tallam <tmsriram@google.com>
9316 * options.cc (General_options::parse_version): Allow -v to exit
9317 without an error if there is nothing to link.
9319 2009-12-29 Ian Lance Taylor <iant@google.com>
9321 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
9322 using a version of gcc before 4.1.
9323 * configure: Rebuild.
9325 2009-12-28 Chris Demetriou <cgd@google.com>
9327 * attributes.cc (Output_attributes_section_data::do_write): Use
9328 std::vector::front rather than std::vector::data.
9330 2009-12-28 Ian Lance Taylor <iant@google.com>
9332 * symtab.h (class Symbol_table): Add enum Defined.
9333 * resolve.cc (Symbol_table::should_override): Add defined
9334 parameter. Change all callers. Test whether object is NULL
9335 before calling a method on it.
9336 (Symbol_table::report_resolve_problem): Add defined parameter.
9338 (Symbol_table::should_override_with_special): Likewise.
9339 * symtab.cc (Symbol_table::define_in_output_data): Add defined
9340 parameter. Change all callers.
9341 (Symbol_table::do_define_in_output_data): Likewise.
9342 (Symbol_table::define_in_output_segment): Likewise.
9343 (Symbol_table::do_define_in_output_segment): Likewise.
9344 (Symbol_table::define_as_constant): Likewise.
9345 (Symbol_table::do_define_as_constant): Likewise.
9346 * script.h (class Symbol_assignment): Add is_defsym parameter to
9347 constructor; change all callers.
9348 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
9349 parameter. Change all callers. Add is_defsym_ field.
9350 (class Parser_closure): Add parsing_defsym parameter to
9351 constructor; change all callers. Add parsing_defsym accessor
9352 function. Add parsing_defsym_ field.
9354 2009-12-28 Ian Lance Taylor <iant@google.com>
9356 * gold.cc (queue_middle_tasks): Fix formatting.
9357 * object.cc (Relobj::is_section_name_included): Likewise.
9359 2009-12-23 Ian Lance Taylor <iant@google.com>
9361 * i386.cc (Target_i386::do_calls_non_split): Recognize
9362 -fsplit-stack prologue for a function with a static chain.
9363 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
9364 -fsplit-stack prologue when using %r11.
9366 2009-12-21 Sriraman Tallam <tmsriram@google.com>
9368 * options.cc (General_options::parse_version): Make -v continue and do
9369 the link like GNU ld does.
9371 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
9373 * Makefile.am (CCFILES): Add timer.cc.
9374 (HFILES): Add timer.h.
9375 * configure.ac: Check for sysconf and times.
9376 * main.cc: include timer.h.
9377 (main): Use Timer instead of get_run_time.
9380 * workqueue.cc: include timer.h.
9381 (Workqueue::find_and_run_task):
9382 Report user, sys and wall time.
9383 * Makefile.in: Regenerate.
9384 * config.in: Regenerate.
9385 * configure: Regenerate.
9387 2009-12-16 Doug Kwan <dougkwan@google.com>
9389 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
9391 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
9392 relaxed input sections.
9393 * output.cc (Output_section::find_relaxed_input_section): Change
9394 return type to Output_relaxed_input_section pointer. Adjust code
9395 for new type of relaxed_input_section_map_.
9396 * output.h (Output_section::find_relaxed_input_section): Change
9397 return type to Output_relaxed_input_section pointer.
9398 (Output_section::Output_relaxed_input_section_by_input_section_map):
9400 (Output_section::relaxed_input_section_map_): Change type to
9401 Output_section::Output_relaxed_input_section_by_input_section_map.
9402 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
9405 2009-12-15 Ian Lance Taylor <iant@google.com>
9407 * layout.cc (Layout::create_shstrtab): Only write out after input
9408 sections if we are compressing debug sections.
9410 2009-12-15 Ian Lance Taylor <iant@google.com>
9412 * archive.cc (Archive::add_symbols): Only look up a symbol without
9413 a version if there is, in fact, a version.
9415 2009-12-14 Ian Lance Taylor <iant@google.com>
9417 Revert -Wshadow changes, all changes from:
9418 2009-12-11 Doug Kwan <dougkwan@google.com>
9419 2009-12-11 Nick Clifton <nickc@redhat.com>
9420 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
9422 2009-12-11 Doug Kwan <dougkwan@google.com>
9424 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
9426 * attributes.cc (Object_attribute::size): Ditto.
9427 (Attributes_section_data::size): Ditto.
9428 (Attributes_section_data::Attributes_section_data): Ditto.
9429 (Output_attributes_section_data::do_write): Ditto.
9430 * attributes.h (Object_attribute::set_type): Ditto.
9431 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
9433 2009-12-11 Nick Clifton <nickc@redhat.com>
9435 * archive.cc: Fix shadowed variable warnings.
9437 * compressed_output.cc: Likewise.
9438 * compressed_output.h: Likewise.
9439 * configure: Likewise.
9440 * dwarf_reader.cc: Likewise.
9441 * dynobj.cc: Likewise.
9442 * dynobj.h: Likewise.
9443 * ehframe.cc: Likewise.
9444 * ehframe.h: Likewise.
9445 * errors.cc: Likewise.
9446 * expression.cc: Likewise.
9447 * fileread.cc: Likewise.
9448 * fileread.h: Likewise.
9449 * freebsd.h: Likewise.
9450 * i386.cc: Likewise.
9452 * incremental.h: Likewise.
9453 * layout.cc: Likewise.
9454 * layout.h: Likewise.
9455 * mapfile.cc: Likewise.
9456 * merge.cc: Likewise.
9457 * merge.h: Likewise.
9458 * object.cc: Likewise.
9459 * object.h: Likewise.
9460 * options.h: Likewise.
9461 * output.cc: Likewise.
9462 * output.h: Likewise.
9463 * parameters.cc: Likewise.
9464 * plugin.cc: Likewise.
9465 * powerpc.cc: Likewise.
9466 * reduced_debug_output.cc: Likewise.
9467 * reduced_debug_output.h: Likewise.
9468 * reloc.cc: Likewise.
9469 * reloc.h: Likewise.
9470 * resolve.cc: Likewise.
9471 * script-sections.cc: Likewise.
9472 * script.cc: Likewise.
9473 * script.h: Likewise.
9474 * sparc.cc: Likewise.
9475 * symtab.cc: Likewise.
9476 * symtab.h: Likewise.
9477 * target-select.cc: Likewise.
9478 * target-select.h: Likewise.
9479 * token.h: Likewise.
9480 * workqueue.cc: Likewise.
9481 * workqueue.h: Likewise.
9482 * x86_64.cc: Likewise.
9484 2009-12-10 Doug Kwan <dougkwan@google.com>
9486 * arm.cc (attributes.h): New include.
9487 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
9488 (Arm_relobj::~Arm_relobj): Delete object pointed by
9489 attributes_section_data_.
9490 (Arm_relobj::attributes_section_data): New method definition.
9491 (Arm_relobj::attributes_section_data_): New data member declaration.
9492 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
9493 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
9494 attributes_section_data_.
9495 (Arm_dynobj::attributes_section_data): New method definition.
9496 (Arm_dynobj::attributes_section_data_): New data member declaration.
9497 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
9498 initialization value of may_use_blx_ to false.
9499 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
9500 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
9501 object attributes to compute results instead of hard-coding.
9502 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
9503 Target_arm::get_secondary_compatible_arch,
9504 Target_arm::set_secondary_compatible_arch
9505 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9506 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
9507 New method declarations.
9508 (Target_arm::get_aeabi_object_attribute): New method definition.
9509 (Target_arm::attributes_section_data_): New data member declaration.
9510 (read_arm_attributes_section): New template definition.
9511 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
9512 (Arm_dynobj::do_read_symbols): Ditto.
9513 (Target_arm::do_finalize_sections): Merge attributes sections from
9514 input. Check for BLX use after attributes section merging.
9515 Fix __exidx_start and __exidx_end visibility. Create an
9516 .ARM.attributes section if necessary.
9517 (Target_arm::get_secondary_compatible_arch,
9518 Target_arm::set_secondary_compatible_arch,
9519 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9520 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
9521 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
9522 New method definitions.
9524 2009-12-09 Ian Lance Taylor <iant@google.com>
9526 * plugin.cc (Plugin::load): Don't cast from void* to a function
9529 2009-12-09 Ian Lance Taylor <iant@google.com>
9531 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
9534 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
9536 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
9537 Replace two_file_shared_1.so with two_file_shared_2.so.
9538 * testsuite/Makefile.in: Regenerated.
9540 2009-12-08 Doug Kwan <dougkwan@google.com>
9542 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
9543 (HFILES): Add attributes.h and int_encoding.h.
9544 * Makefile.in: Regenerate.
9545 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
9546 function definitions to int_encoding.cc
9547 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
9548 prototypes to int_encoding.h
9549 * reduced_debug_output.cc (int_encoding.h): New include.
9550 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
9551 function definitions to int_encoding.cc
9552 (insert_into_vector, read_from_pointer): Move template definitions to
9554 * attributes.cc: New file.
9555 * attributes.h: New file.
9556 * int_encoding.cc: New file.
9557 * int_encoding.h: New file.
9559 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
9562 * incremental-dump.cc (dump_incremental_inputs): New.
9563 (main): Use dump_incremental_inputs.
9565 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
9568 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
9569 checking elfcpp::STT_FUNC.
9570 (Target_i386::Relocate::relocate): Likewise.
9571 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
9573 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
9574 symbols from shared libraries into normal FUNC symbols.
9576 * symtab.h (Symbol): Add is_func and use it.
9578 2009-12-05 Doug Kwan <dougkwan@google.com>
9580 * arm.cc (Target_arm::arm_info): Initialize new fields
9581 attributes_section and attributes_vendor.
9582 * i386.cc (Target_i386::i386_info): Same.
9583 * object.cc (Sized_relobj::do_layout): Skip attribute section.
9584 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
9585 fields attributes_section and attributes_vendor.
9586 * sparc.cc (Target_sparc::sparc_info): Same.
9587 * target.h (Target::attributes_section, Target::attributes_vendor,
9588 Target::is_attributes_section, Target::attribute_arg_type,
9589 Target::attributes_order): New method definitions.
9590 (Target::Target_info::attributes_section,
9591 Target::Target_info::attributes_vendor): New fields.
9592 (Target::do_attribute_arg_type, Target::do_attributes_order): New
9593 virtual method definitions.
9594 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
9595 attributes_section and attributes_vendor.
9596 * testsuite/testfile.cc (Target_test::test_target_info): Same.
9598 2009-12-05 Doug Kwan <dougkwan@google.com>
9600 * arm.cc: Update comments about interworking and stub generation.
9601 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
9602 considered as non-PIC.
9603 (Arm_relocate_functions::base_abs): Fix formatting.
9604 (Arm_relocate_functions::got_prel): Fix comment. Change interface
9605 of function to use GOT entry address instead of offset.
9606 (Target_arm::Scan::global): Issue an error if a symbol would need a
9607 PLT does not get one because it is untyped. Remove code to create
9608 dynamic symbols for relative branches.
9609 (Target_arm::Relocate::relocate: Use 0 instead of false since function
9610 takes unsigned integer instead of boolean.
9612 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
9614 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
9615 (two_file_test_LDADD): Likewise.
9616 (common_test_1_LDADD): Likewise.
9617 (exception_test_LDADD) Likewise.
9618 (weak_test_LDADD): Likewise.
9619 (many_sections_test_LDADD): Likewise.
9620 (initpri1_LDADD): Likewise.
9621 (script_test_1_LDADD): Likewise.
9622 (script_test_2_LDADD): Likewise.
9623 (justsyms_LDADD): Likewise.
9624 (binary_test_LDADD): Likewise.
9625 (large_LDADD): Likewise.
9626 * testsuite/Makefile.in: Regenerated.
9628 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
9630 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
9631 (Symbol_table::override_with_special): Likewise.
9632 (Symbol_table::add_from_object): Likewise.
9634 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
9636 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9637 Don't set the data_offset twice.
9639 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
9641 * testsuite/Makefile.in: Regenerate.
9643 2009-12-03 Doug Kwan <dougkwan@google.com>
9645 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
9646 (Target_arm::do_finalize_sections): Add parameter for symbol table
9647 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
9648 * i386.cc (Target_i386::do_finalize_sections): Add an additional
9649 parameter for symbol table pointer.
9650 * layout.cc (Layout::finalize): Call Target::finalize_sections with
9651 an additional parameter for a pointer to symbol table.
9652 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
9653 parameter for a symbol table pointer.
9654 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
9655 * target.h (Target::finalize_sections, Target::do_finalize_sections):
9657 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
9658 parameter for a symbol table pointer.
9660 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
9662 * incremental.cc (Incremental_inputs_header)
9663 (Incremental_inputs_header_write, Incremental_inputs_entry)
9664 (Incremental_inputs_entry_write): Move ...
9665 * incremental.h (Incremental_inputs_header)
9666 (Incremental_inputs_header_write, Incremental_inputs_entry)
9667 (Incremental_inputs_entry_write): here.
9669 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9671 * incremental.cc (make_sized_incremental_binary): Set the target.
9672 Error if it is incompatible.
9673 * output.h (Output_file): Add filename method.
9675 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9677 * incremental.cc (Incremental_inputs_entry): Remove unused argument
9678 from the get_* methods.
9680 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9682 * incremental-dump.cc (main): Check that the offeset of a script is 0.
9683 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9684 Write 0 for the data_offset of scripts.
9686 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9688 * testsuite/Makefile.am: Add the incremental_test.sh test.
9689 * testsuite/incremental_test.sh: New.
9690 * testsuite/incremental_test_1.c: New.
9691 * testsuite/incremental_test_2.c: New.
9693 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
9695 * incremental-dump.cc (main): Fix typos.
9697 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
9700 * incremental-dump.cc (main): Use llu to print 64 bit values.
9702 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
9703 H.J. Lu <hongjiu.lu@intel.com>
9705 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
9707 (incremental_dump_LDADD): Likewise.
9708 * Makefile.in: Regenerated.
9710 2009-11-25 Doug Kwan <dougkwan@google.com>
9714 2009-11-25 Doug Kwan <dougkwan@google.com>
9716 * arm.cc (Target_arm::Target_arm): Move method definition
9717 outside of class definition. Add code to handle
9718 --target1-rel, --target1-abs and --target2= options.
9719 (Target_arm::get_reloc_reloc_type): Change method to be
9720 non-static and const.
9721 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
9722 New data member declaration.
9723 (Target_arm::Scan::local, Target_arm::Scan::global,
9724 Target_arm::Relocate::relocate,
9725 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9726 Adjust call to Target_arm::get_real_reloc_type.
9727 (Target_arm::get_real_reloc_type): Use command line options
9728 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9729 * options.h (--target1-rel, --target1-abs, --target2): New
9732 2009-11-25 Doug Kwan <dougkwan@google.com>
9734 * arm.cc (Target_arm::Target_arm): Move method definition outside of
9735 class definition. Add code to handle --target1-rel, --target1-abs
9736 and --target2= options.
9737 (Target_arm::get_reloc_reloc_type): Change method to be non-static
9739 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
9741 (Target_arm::Scan::local, Target_arm::Scan::global,
9742 Target_arm::Relocate::relocate,
9743 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
9744 call to Target_arm::get_real_reloc_type.
9745 (Target_arm::get_real_reloc_type): Use command line options to
9746 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9747 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
9750 2009-11-25 Doug Kwan <dougkwan@google.com>
9752 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
9753 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
9754 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
9756 (Arm_relocate_functions::thm_call): Replace body with a call to
9757 Arm_relocate_functions::thumb_branch_common.
9758 (Arm_relocate_functions::thm_jump24,
9759 Arm_relocate_functions::thm_xpc22): New method definitions.
9760 (Arm_relocate_functions::thumb_branch_common): New method definition.
9761 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
9763 (Target_arm::Relocate::relocate): Adjust call to thm_call.
9764 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
9766 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
9768 * Makefile.am: Build incremental-dump
9769 * Makefile.in: Regenerate.
9770 * incremental-dump.cc: New.
9771 * incremental.cc (Incremental_inputs_header_data,
9772 Incremental_inputs_entry_data): Move to incremental.h
9773 * incremental.h: (Incremental_inputs_header_data,
9774 Incremental_inputs_entry_data): Move from incremental.cc
9776 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
9778 * incremental.cc (Incremental_inputs_header,
9779 Incremental_inputs_header_write, Incremental_inputs_entry,
9780 Incremental_inputs_entry_write): Add a typedef with the data type.
9782 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
9784 * incremental.cc (Incremental_inputs_header,
9785 Incremental_inputs_header_write, Incremental_inputs_entry,
9786 Incremental_inputs_entry_write): Update comment about which
9787 type has the filed descriptions.
9789 2009-11-15 Doug Kwan <dougkwan@google.com>
9791 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
9792 (Arm_relocate_functions::arm_branch_common): Change method defintion
9793 in class definition to a method declaration and update list of formal
9795 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
9796 Arm_relocation_functions::jump24): Adjust call to
9797 Arm_relocate_functions::arm_branch_common. Update list of formal
9799 (Arm_relocate_functions::xpc25): New method definition.
9800 (Arm_relocate_functions::arm_branch_common): Move method defintion
9801 out from class definition. Use stubs for mode-switching and extending
9803 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
9804 specially. Change code to enable use of stubs in ARM branches.
9806 2009-11-10 Doug Kwan <dougkwan@google.com>
9808 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
9809 in method declaration.
9810 (Target_arm::relocate_stub): New method declaration.
9811 (Target_arm::default_target): Change to return a pointer instead of
9813 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
9814 Target_arm::default_target.
9815 (Arm_Relobj::do_relocate_sections): Remove options paramater in
9817 (Target_arm::relocate_section): Adjust view.
9818 (Target_arm::relocate_stub): New method definition.
9820 2009-11-10 Doug Kwan <dougkwan@google.com>
9822 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
9824 * incremental.cc (open_incremental_binary): Initialized local
9825 variables to avoid warnings.
9826 * object.cc (make_elf_object): Ditto.
9827 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
9830 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
9833 * testsuite/plugin_test.c: Include "config.h".
9835 2009-11-09 Doug Kwan <dougkwan@google.com>
9837 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
9838 (arm_symbol_value): Remove.
9839 (Arm_relocate_functions::arm_branch_common,
9840 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
9841 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
9842 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
9843 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
9844 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
9845 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
9846 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
9847 Arm_relocate_functions::thm_mobw_abs_nc,
9848 Arm_relocate_functions::thm_mov_abs,
9849 Arm_relocate_functions::movw_prel_nc,
9850 Arm_relocate_functions::thm_movt_abs,
9851 Arm_relocate_functions::movt_prel,
9852 Arm_relocate_functions::thm_movw_prel_nc,
9853 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
9854 (Target_arm::Relocate::relocate): Only decompose address into two
9855 parts if relocation type uses the thumb-bit and pass the actual
9856 bit instead of a flag indicating that the thumb-bit is used. Adjust
9857 calls to methods in Arm_relocate_functions for this change.
9859 2009-11-08 Ian Lance Taylor <iant@google.com>
9862 * reloc.cc: Instantiate
9863 Sized_relobj::initialize_input_to_output_maps and
9864 Sized_relobj:free_input_to_output_maps.
9866 2009-11-06 Ian Lance Taylor <iant@google.com>
9869 * defstd.cc (in_segment): Set only_if_ref true for "end".
9871 2009-11-06 Doug Kwan <dougkwan@google.com>
9873 * arm.cc (class Reloc_stub): Correct a comment.
9874 (Target_arm::Target_arm): Initialize arm_input_section_map_.
9875 (Target_arm::scan_section_for_stubs): New method declaration.
9876 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
9877 Change methods from private to protected.
9878 (Target_arm::do_may_relax): New method definition.
9879 (Target_arm::do_relax, Target_arm::group_sections,
9880 Target_arm::scan_reloc_for_stub,
9881 Target_arm::scan_reloc_section_for_stubs): New method declarations.
9882 (Target_arm::arm_input_section_map_): New data member declaration.
9883 (Target_arm::scan_reloc_for_stub,
9884 Target_arm::scan_reloc_section_for_stubs,
9885 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
9886 Target_arm::do_relax): New method definitions.
9888 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
9890 * configure.ac: Check for (struct stat)::st_mtim
9891 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
9892 * config.in: Regenerate.
9893 * configure: Regenerate.
9895 2009-11-05 Ian Lance Taylor <iant@google.com>
9898 * output.cc (Output_segment::add_output_section): Add missing
9901 2009-11-04 Ian Lance Taylor <iant@google.com>
9904 * object.h (class Object): Add is_needed and set_is_needed
9905 methods. Add is_needed_ field. Make bool fields into bitfields.
9906 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
9907 defined in a dynamic object and referenced by a regular object,
9908 set is_needed for the dynamic object.
9909 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
9910 if the file is marked with as_needed and it is not needed.
9912 2009-11-04 Ian Lance Taylor <iant@google.com>
9915 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
9916 tags if data is discarded by linker script.
9917 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9918 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9919 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9920 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9922 2009-11-04 Ian Lance Taylor <iant@google.com>
9924 * layout.cc (Layout::get_output_section): Add is_interp and
9925 is_dynamic_linker_section parameters. Change all callers.
9926 (Layout::choose_output_section): Likewise.
9927 (Layout::make_output_section): Likewise.
9928 (Layout::add_output_section_data): Add is_dynamic_linker_section
9929 parameter. Change all callers.
9930 * layout.h (class Layout): Update declarations.
9931 * output.h (class Output_section): Add is_interp, set_is_interp,
9932 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
9933 Add is_interp_, is_dynamic_linker_section_ fields. Change
9934 generate_code_fills_at_write_ to a bitfield.
9935 * output.cc (Output_section::Output_sections): Initialize new
9937 (Output_segment::add_output_section): Add do_sort parameter.
9940 2009-11-03 Ian Lance Taylor <iant@google.com>
9943 * options.h (class General_options): Add --warn-common.
9944 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
9945 merging two common symbols.
9946 (Symbol_table::should_override): Handle --warn-common when merging
9947 a common symbol with a defined symbol. Use report_resolve_problem
9948 for multiple definitions.
9949 (Symbol_table::report_resolve_problem): New function.
9950 * symtab.h (class Symbol_table): Declare report_resolve_problem.
9952 2009-11-03 Doug Kwan <dougkwan@google.com>
9954 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
9956 (Target_arm::stub_factory): New method definition.
9957 (Target_arm::new_arm_input_section,
9958 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
9959 Target_arm::reloc_uses_thumb_bit): New method declarations.
9960 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
9961 New type definitions.
9962 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
9963 member declarations.
9964 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
9965 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
9966 New method definitions.
9968 2009-11-03 Ian Lance Taylor <iant@google.com>
9970 * options.h (class General_options): Add --warn_constructors.
9972 2009-11-03 Ian Lance Taylor <iant@google.com>
9975 * defstd.cc (in_section): Add entries for __rel_iplt_start,
9976 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
9978 2009-11-03 Ian Lance Taylor <iant@google.com>
9981 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
9982 --msgid-bugs-address.
9983 (install-pdf): New target.
9984 (install-data_yes): Look up one directory to find mkinstalldirs.
9986 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
9988 * po/Make-in (.po.gmo): Don't generate .gmo files in source
9991 2009-10-30 Doug Kwan <dougkwan@google.com>
9993 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
9995 2009-10-30 Doug Kwan <dougkwan@google.com>
9997 * arm.cc (Stub_addend_reader): New struct template definition
9998 and partial specializations.
9999 (Stub_addend_reader::operator()): New method definition for a
10000 partially specialized template.
10002 2009-10-30 Doug Kwan <dougkwan@google.com>
10004 * arm.cc (Arm_relobj::processor_specific_flags): New method
10006 (Arm_relobj::do_read_symbols): New method declaration.
10007 (Arm_relobj::processor_specific_flags_): New data member declaration.
10008 (Arm_dynobj): New class definition.
10009 (Target_arm::do_finalize_sections): Add input_objects parameter.
10010 (Target_arm::do_adjust_elf_header): New method declaration.
10011 (Target_arm::are_eabi_versions_compatible,
10012 (Target_arm::merge_processor_specific_flags): New method declaration.
10013 (Target_arm::do_make_elf_object): New overloaded method definitions
10015 (Arm_relobj::do_read_symbols): New method definition.
10016 (Arm_dynobj::do_read_symbols): Ditto.
10017 (Target_arm::do_finalize_sections): Add input_objects parameters.
10018 Merge processor-specific flags from all input objects.
10019 (Target_arm::are_eabi_versions_compatible,
10020 Target_arm::merge_processor_specific_flags,
10021 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
10022 New method definitions.
10023 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
10024 Input_objects pointer type parameter.
10025 * layout.cc (Layout::finalize): Pass input objects to target's.
10026 finalize_sections function.
10027 * output.cc (Output_file_header::do_sized_write): Set ELF file
10028 header's processor-specific flags.
10029 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
10030 Input_objects pointer type parameter.
10031 * sparc.cc (Target_sparc::do_finalize_sections): Same.
10032 * target.h (Input_objects): New forward class declaration.
10033 (Target::processor_specific_flags,
10034 Target::are_processor_specific_flags_sect): New method definitions.
10035 (Target::finalize_sections): Add input_objects parameter.
10036 (Target::Target): Initialize processor_specific_flags_ and
10037 are_processor_specific_flags_set_.
10038 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
10040 (Target::set_processor_specific_flags): New method definition.
10041 (Target::processor_specific_flags_,
10042 Target::are_processor_specific_flags_set_): New data member
10044 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
10045 Input_objects pointer type parameter.
10047 2009-10-30 Doug Kwan <dougkwan@google.com>
10049 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
10051 2009-10-28 Ian Lance Taylor <iant@google.com>
10053 * object.h (class Relobj): Drop options parameter from
10054 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
10055 do_scan_relocs, do_relocate. Change all callers.
10056 (class Sized_relobj): Drop options parameters from
10057 do_gc_process_relocs, do_scan_relocs, do_relocate,
10058 do_relocate_sections, relocate_sections, emit_relocs_scan,
10059 emit_relocs_scan_reltype. Change all callers.
10060 (struct Relocate_info): Remove options field and all references to
10062 * reloc.h (class Read_relocs): Remove options constructor
10063 parameter and options_ field. Change all callers.
10064 (class Gc_process_relocs, class Scan_relocs): Likewise.
10065 (class Relocate_task): Likewise.
10066 * target-reloc.h (scan_relocs): Remove options parameter. Change
10068 (scan_relocatable_relocs): Likewise.
10069 * target.h (class Sized_target): Remove options parameter from
10070 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
10072 * gc.h (gc_process_relocs): Remove options parameter. Change all
10074 * arm.cc: Update functions to remove options parameters.
10075 * i386.cc: Likewise.
10076 * powerpc.cc: Likewise.
10077 * sparc.cc: Likewise.
10078 * x86_64.cc: Likewise.
10079 * testsuite/testfile.cc: Likewise.
10081 2009-10-28 Doug Kwan <dougkwan@google.com>
10083 * arm.cc (Arm_relobj): New class definition.
10084 (Arm_relobj::scan_sections_for_stubs,
10085 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
10086 New method definitions.
10088 2009-10-28 Cary Coutant <ccoutant@google.com>
10090 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
10091 (Plugin::cleanup_done_): New member.
10092 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
10093 (Plugin_manager::cleanup_done_): Remove.
10094 (Plugin_manager::add_input_file): Edit error message.
10095 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
10096 (Plugin_manager::cleanup): Remove use of cleanup_done_.
10098 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
10100 * fileread.cc: (File_read::View::~View): Use the new
10101 data_ownership_ filed.
10102 (File_read::~File_read): Dispose the new whole_file_view_.
10103 (File_read::open): Mmap the whole file if needed.
10104 (File_read::open): Use whole_file_view_ instead of contents_.
10105 (File_read::find_view): Use whole_file_view_ if applicable.
10106 (File_read::do_read): Use whole_file_view_ instead of contents_.
10107 (File_read::make_view): Use whole_file_view_ instead of contents_,
10108 update File_read::View::View call.
10109 (File_read::find_or_make_view): Update File_read::View::View
10111 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
10113 (File_read::View::Data_ownership): New enum.
10114 (File_read::View::View): Replace bool mapped_ with Data_ownership
10116 (File_read::View::mapped_): Remove (replaced by data_ownership_).
10117 (File_read::View::data_ownership_): New field.
10118 (File_read::contents_): Remove (replaced by whole_file_view_).
10119 (File_read::whole_file_view_): New field.
10120 * options.h (class General_options): Add --keep-files-mapped.
10122 2009-10-27 Cary Coutant <ccoutant@google.com>
10124 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
10125 * testsuite/Makefile.am (plugin_test_5): New test case.
10126 * testsuite/Makefile.in: Regenerate.
10128 2009-10-25 Doug Kwan <dougkwan@google.com>
10130 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
10131 from private to protected to allow access by child class.
10132 (Sized_relobj::do_relocate_sections): New method declaration.
10133 (Sized_relobj::relocate_sections): Virtualize.
10134 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
10135 Sized_relobj::relocate_sections. Instantiate template explicitly
10136 for different target sizes and endianity.
10138 2009-10-24 Doug Kwan <dougkwan@google.com>
10140 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
10141 (Arm_input_section::as_arm_input_section): New method.
10142 (Arm_output_section): New class definition.
10143 (Arm_output_section::create_stub_group,
10144 Arm_output_section::group_sections): New method definitions.
10146 2009-10-22 Doug Kwan <dougkwan@google.com>
10148 * arm.cc (Arm_input_section): New class definition.
10149 (Arm_input_section::init, Arm_input_section:do_write,
10150 Arm_input_section::set_final_data_size,
10151 Arm_input_section::do_reset_address_and_file_offset): New method
10154 2009-10-21 Doug Kwan <dougkwan@google.com>
10156 * arm.cc (Stub_table, Arm_input_section): New forward class
10158 (Stub_table): New class defintion.
10159 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
10160 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
10161 New method definition.
10163 2009-10-21 Doug Kwan <dougkwan@google.com>
10165 * arm.cc: Update copyright comments.
10166 (Target_arm): New forward class template declaration.
10167 (Arm_address): New type.
10168 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
10169 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
10170 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
10172 (Insn_template): Same.
10173 (DEF_STUBS): New macro.
10174 (Stub_type): New enum type.
10175 (Stub_template): New class definition.
10177 (Reloc_stub): Same.
10178 (Stub_factory): Same.
10179 (Target_arm::Target_arm): Initialize may_use_blx_ and
10180 should_force_pic_veneer_.
10181 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
10182 Target_arm::should_force_pic_veneer,
10183 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
10184 Target_arm::using_thumb_only, Target_arm:;default_target): New
10186 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
10187 New data member declarations.
10188 (Insn_template::size, Insn_template::alignment): New method defintions.
10189 (Stub_template::Stub_template): New method definition.
10190 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
10191 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
10192 (Stub_factory::Stub_factory): New method definition.
10193 * gold.h (string_hash): New template.
10194 * output.h (Input_section_specifier::hash_value): Use
10196 (Input_section_specifier::string_hash): Remove.
10197 * stringpool.cc (Stringpool_template::string_hash): Use
10200 2009-10-20 Doug Kwan <dougkwan@google.com>
10202 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
10203 symbols of relaxed input sections.
10204 * output.h (Output_section::find_relaxed_input_section): Make
10207 2009-10-16 Doug Kwan <dougkwan@google.com>
10209 * dynobj.cc (Versions::Versions): Initialize version_script_.
10210 Only insert base version symbol definition for a shared object
10211 if version script defines any version versions.
10212 (Versions::define_base_version): New method definition.
10213 (Versions::add_def): Check that base version is not needed.
10214 (Versions::add_need): Define base version lazily.
10215 * dynobj.h (Versions::define_base_version): New method declaration.
10216 (Versions::needs_base_version_): New data member declaration.
10217 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
10218 (check_DATA): Add no_version_test.stdout.
10219 (libno_version_test.so, no_version_test.o no_version_test.stdout):
10221 * testsuite/Makefile.in: Regenerate.
10222 * testsuite/no_version_test.c: New file.
10223 * testsuite/no_version_test.sh: Ditto.
10225 2009-10-16 Doug Kwan <dougkwan@google.com>
10227 * expression.cc (class Segment_start_expression): New class definition.
10228 (Segment_start_expression::value): New method definition.
10229 (script_exp_function_segment_start): Return a new
10230 Segment_start_expression.
10231 * gold/script-c.h (script_saw_segment_start_expression): New function
10233 * script-sections.cc (Script_sections::Script_sections): Initialize
10234 SAW_SEGMENT_START_EXPRESSION_ to false.
10235 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
10236 and -Tbbs options to specify section addresses if given in
10237 command line and no SEGMENT_START expression is seen in a script.
10238 * script-sections.h (Script_sections::saw_segment_start_expression,
10239 Script_sections::set_saw_segment_start_expression): New method
10241 (Script_sections::saw_segment_start_expression_): New data member
10243 * script.cc (script_saw_segment_start_expression): New function.
10244 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
10245 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
10246 script_test_7.sh and script_test_8.sh.
10247 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
10248 script_test_8.stdout.
10249 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
10250 (script_test_6, script_test_6.stdout, script_test_7,
10251 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
10252 * Makefile.in: Regenerate.
10253 * testsuite/script_test_6.sh: New file.
10254 * testsuite/script_test_6.t: Same.
10255 * testsuite/script_test_7.sh: Same.
10256 * testsuite/script_test_7.t: Same.
10257 * testsuite/script_test_8.sh: Same.
10259 2009-10-16 Doug Kwan <dougkwan@google.com>
10261 * output.cc (Output_segment::set_section_list_address): Cast
10262 expressions to unsigned long long type to avoid format warnings.
10264 2009-10-15 Ian Lance Taylor <iant@google.com>
10266 * script.cc (Script_options::add_symbol_assignment): Always add a
10267 dot assignment to script_sections_.
10268 * script-sections.cc (Script_sections::add_dot_assignment):
10269 Initialize if necessary.
10271 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
10272 program headers with no load segment if there is a linker script.
10274 * layout.cc (Layout::set_segment_offsets): Align the file offset
10275 to the segment aligment for -N or -n with no load segment.
10276 * output.cc (Output_segment::add_output_section): Don't crash if
10277 the first section is a TLS section.
10278 (Output_segment::set_section_list_addresses): Print an error
10279 message if the address moves backward in a linker script.
10280 * script-sections.cc
10281 (Output_section_element_input::set_section_addresses): Don't
10282 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
10283 (Orphan_output_section::set_section_addresses): Likewise.
10285 2009-10-15 Doug Kwan <dougkwan@google.com>
10287 * layout.cc (Layout::finish_dynamic_section): Generate tags
10288 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
10289 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
10290 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
10292 2009-10-14 Ian Lance Taylor <iant@google.com>
10294 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
10296 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
10297 data_shdr fields of relinfo.
10298 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
10299 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
10300 R_386_TLS_LDO_32, adjust based on section flags.
10301 (Target_i386::Relocate::fix_up_ldo): Remove.
10303 2009-10-13 Ian Lance Taylor <iant@google.com>
10305 Add support for -pie.
10306 * options.h (class General_options): Add -pie and
10308 (General_options::output_is_position_independent): Test -pie.
10309 (General_options::output_is_executable): Return true if not shared
10310 and not relocatable.
10311 (General_options::output_is_pie): Remove.
10312 * options.cc (General_options::finalize): Reject incompatible uses
10314 * gold.cc (queue_middle_tasks): A -pie link is not static.
10315 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
10316 * symtab.cc (Symbol::final_value_is_known): Return false if
10317 output_is_position_independent.
10318 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
10319 output_is_position_independent.
10320 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
10321 output_is_position_independent.
10322 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
10323 output_is_position_independent.
10324 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
10326 (basic_pie_test.o, basic_pie_test): New targets.
10327 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
10328 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
10329 (two_file_pie_test): New target.
10330 * testsuite/Makefile.in: Rebuild.
10331 * README: Remove note saying that -pie is not supported.
10333 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
10335 * options.h (class General_options): Add -init and -fini.
10336 * layout.cc (Layout::finish_dynamic_section): Emit
10337 given init and fini functions.
10339 2009-10-13 Sriraman Tallam <tmsriram@google.com>
10341 * gc.h (gc_process_relocs): Check if icf is enabled using new
10343 * gold.cc (queue_initial_tasks): Likewise.
10344 (queue_middle_tasks): Likewise.
10345 * object.cc (do_layout): Likewise.
10346 * symtab.cc (is_section_folded): Likewise.
10347 * main.cc (main): Likewise.
10348 * reloc.cc (Read_relocs::run): Likewise.
10349 (Sized_relobj::do_scan_relocs): Likewise.
10350 * icf.cc (is_function_ctor_or_dtor): New function.
10351 (Icf::find_identical_sections): Check if function is ctor or dtor when
10352 safe icf is chosen.
10353 * options.h (General_options::icf): Change option to be an enum.
10354 (Icf_status): New enum.
10355 (icf_enabled): New method.
10356 (icf_safe_folding): New method.
10357 (set_icf_status): New method.
10358 (icf_status_): New variable.
10359 * (options.cc) (General_options::finalize): Set icf_status_.
10360 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
10361 icf_test and icf_keep_unique_test to use the --icf enum flag.
10362 * testsuite/icf_safe_test.sh: New file.
10363 * testsuite/icf_safe_test.cc: New file.
10365 2009-10-12 Sriraman Tallam <tmsriram@google.com>
10367 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
10368 includes to gc.h and icf.h.
10369 * arm.cc: Include gc.h.
10370 * gold.cc: Likewise.
10371 * i386.cc: Likewise.
10372 * powerpc.cc: Likewise.
10373 * sparc.cc: Likewise.
10374 * x86_64.cc: Likewise.
10375 * gc.h: Include icf.h.
10377 2009-10-11 Ian Lance Taylor <iant@google.com>
10379 * plugin.cc: Include "gold.h" before other header files.
10381 2009-10-10 Chris Demetriou <cgd@google.com>
10383 * options.h (Input_file_argument::Input_file_type): New enum.
10384 (Input_file_argument::is_lib_): Replace with...
10385 (Input_file_argument::type_): New member.
10386 (Input_file_argument::Input_file_argument): Take Input_file_type
10387 'type' rather than boolean 'is_lib' as second argument.
10388 (Input_file_argument::is_lib): Use type_.
10389 (Input_file_argument::is_searched_file): New function.
10390 (Input_file_argument::may_need_search): Handle is_searched_file.
10391 * options.cc (General_options::parse_library): Support -l:filename.
10392 (General_options::parse_just_symbols): Update for Input_file_argument
10394 (Command_line::process): Likewise.
10395 * archive.cc (Archive::get_file_and_offset): Likewise.
10396 * plugin.cc (Plugin_manager::release_input_file): Likewise.
10397 * script.cc (read_script_file, script_add_file): Likewise.
10398 * fileread.cc (Input_file::Input_file): Likewise.
10399 (Input_file::will_search_for): Handle is_searched_file.
10400 (Input_file::open): Likewise.
10401 * readsyms.cc (Read_symbols::get_name): Likewise.
10402 * testsuite/Makefile.am (searched_file_test): New test.
10403 * testsuite/Makefile.in: Regenerate.
10404 * testsuite/searched_file_test.cc: New file.
10405 * testsuite/searched_file_test_lib.cc: New file.
10407 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10408 Ian Lance Taylor <iant@google.com>
10410 * descriptor.cc: Include <cstdio> and "binary-io.h".
10411 (Descriptors::open): Open the files in binary mode always.
10412 * script.cc (Lex::get_token): Treat \r as whitespace.
10414 2009-10-09 Ian Lance Taylor <iant@google.com>
10416 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
10418 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10419 Ian Lance Taylor <iant@google.com>
10421 * configure.ac: Check for readv function also.
10422 * fileread.cc (readv): Define if not HAVE_READV.
10423 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
10425 * config.in: Regenerate.
10426 * configure: Regenerate.
10428 2009-10-09 Doug Kwan <dougkwan@google.com>
10430 * layout.cc (Layout::make_output_section): Call target hook to make
10431 ordinary output section.
10432 (Layout::finalize): Adjust parameter list of call the
10433 Target::may_relax().
10434 * layout.h (class Layout::section_list): New method.
10435 * merge.h (Output_merge_base::entsize): Change visibility to public.
10436 (Output_merge_base::is_string, Output_merge_base::do_is_string):
10438 (Output_merge_string::do_is_string): New method.
10439 * object.cc (Sized_relobj::do_setup): renamed from
10440 Sized_relobj::set_up.
10441 * object.h (Sized_relobj::adjust_shndx,
10442 Sized_relobj::initializ_input_to_output_maps,
10443 Sized_relobj::free_input_to_output_maps): Change visibilities to
10445 (Sized_relobj::setup): Virtualize.
10446 (Sized_relobj::do_setup): New method declaration.
10447 (Sized_relobj::invalidate_section_offset,
10448 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
10449 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
10450 * options.cc (parse_int): New function.
10451 * options.h (parse_int): New declaration.
10452 (DEFINE_int): New macro.
10453 (stub_group_size): New option.
10454 * output.cc (Output_section::Output_section): Initialize memebers
10455 merge_section_map_, merge_section_by_properties_map_,
10456 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
10457 (Output_section::add_input_section): Handled deferred code-fill
10458 generation and remove an old comment.
10459 (Output_section::add_relaxed_input_section): New method definition.
10460 (Output_section::add_merge_input_section): Use merge section by
10461 properties map to speed to search. Update merge section maps
10463 (Output_section::build_relaxation_map): New method definition.
10464 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
10466 (Output_section::relax_input_section): Renamed to
10467 Output_section::convert_input_sections_to_relaxed_sections and change
10468 interface to take a vector of pointers to relaxed sections.
10469 (Output_section::find_merge_section,
10470 Output_section::find_relaxed_input_section): New method definitions.
10471 (Output_section::is_input_address_mapped,
10472 Output_section::output_offset, Output_section::output_address):
10473 Use output section data maps to speed up searching.
10474 (Output_section::find_starting_output_address): Add comments.
10475 (Output_section::do_write,
10476 Output_section::write_to_postprocessing_buffer): Do code-fill
10477 generation as appropriate.
10478 (Output_section::get_input_sections): Invalidate relaxed input section
10480 (Output_section::restore_states): Adjust type of checkpoint .
10481 Invalidate relaxed input section map.
10482 * output.h (Output_merge_base): New class declaration.
10483 (Input_section_specifier): New class defintion.
10484 (class Output_relaxed_input_section) Change base class to
10485 Output_section_data_build.
10486 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
10487 base class initializer.
10488 (Output_section::add_relaxed_input_section): New method declaration.
10489 (Output_section::Input_section): Change visibility to protected.
10490 (Output_section::Input_section::relobj,
10491 Output_section::Input_section::shndx): Handle relaxed input sections.
10492 Output_section::input_sections) Change visibility to protected. Also
10493 define overload to return a non-const pointer.
10494 (Output_section::Merge_section_properties): New class defintion.
10495 (Output_section::Merge_section_by_properties_map,
10496 Output_section::Output_section_data_by_input_section_map,
10497 Output_section::Relaxation_map): New types.
10498 (Output_section::relax_input_section): Rename method to
10499 Output_section::convert_input_sections_to_relaxed_sections and change
10500 interface to take a vector of relaxed section pointers.
10501 (Output_section::find_merge_section,
10502 Output_section::find_relaxed_input_section,
10503 Output_section::build_relaxation_map,
10504 Output_section::convert_input_sections_in_list_to_relaxed_sections):
10505 New method declarations.
10506 (Output_section::merge_section_map_
10507 Output_section::merge_section_by_properties_map_,
10508 Output_section::relaxed_input_section_map_,
10509 Output_section::is_relaxed_input_section_map_valid_,
10510 Output_section::generate_code_fills_at_write_): New data members.
10511 * script-sections.cc
10512 (Output_section_element_input::set_section_addresses): Call
10513 current_data_size and addralign methods of relaxed input sections.
10514 (Orphan_output_section::set_section_addresses): Call current_data_size
10515 and addralign methods of relaxed input sections.
10516 * symtab.cc (Symbol_table::compute_final_value): Extract template
10517 from the body of Symbol_table::sized_finalize_symbol.
10518 (Symbol_table::sized_finalized_symbol): Call
10519 Symbol_table::compute_final_value.
10520 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
10521 (Symbol_table::compute_final_value): New templated method declaration.
10522 * target.cc (Target::do_make_output_section): New method defintion.
10523 * target.h (Target::make_output_section): New method declaration.
10524 (Target::relax): Add more parameters for input objects, symbol table
10525 and layout. Adjust call to do_relax.
10526 (Target::do_make_output_section): New method declaration.
10527 (Target::do_relax): Add parameters for input objects, symbol table
10530 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10532 * pread.c: Include stdio.h.
10534 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10536 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
10539 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10541 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
10542 Change read_shndx type to unsigned int.
10543 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10545 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10546 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
10547 Change read_shndx type to unsigned int.
10548 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10550 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10551 * layout.cc (Layout::create_symtab_sections): Cast the result of
10552 local_symcount * symsize to off_t in the gold_assert.
10554 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10556 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
10557 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
10559 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
10560 (Arm_relocate_functions::thm_abs5): New function.
10561 (Arm_relocate_functions::abs12): New function.
10562 (Arm_relocate_functions::abs16): New function.
10563 (Arm_relocate_functions::base_abs): New function.
10564 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
10565 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
10566 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
10568 (Scan::global): Likewise.
10569 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
10570 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
10571 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
10572 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
10575 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10577 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
10578 (Arm_relocate_functions::movt_prel): New function.
10579 (Arm_relocate_functions::thm_movw_prel_nc): New function.
10580 (Arm_relocate_functions::thm_movt_prel): New function.
10581 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
10582 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
10583 (Scan::global, Relocate::relocate): Likewise.
10584 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10586 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10588 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
10589 Incremental_checker.
10590 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
10592 (class Incremental_inputs_header): New class.
10593 (Incremental_inputs_header_writer): Edit comment.
10594 (Incremental_inputs_entry): New class.
10595 (Incremental_inputs_entry_writer): Edit comment.
10596 (Sized_incremental_binary::do_find_incremental_inputs_section):
10597 Add *strtab_shndx parameter, fill it.
10598 (Sized_incremental_binary::do_check_inputs): New method.
10599 (Incremental_checker::can_incrementally_link_output_file): Use
10600 Sized_incremental_binary::check_inputs.
10601 (Incremental_inputs::report_command_line): Save command line in
10604 (Incremental_binary::find_incremental_inputs_section): New
10606 (Incremental_binary::do_find_incremental_inputs_section): Add
10607 strtab_shndx parameter.
10608 (Incremental_binary::do_check_inputs): New pure virtual method.
10609 (Sized_incremental_binary::do_check_inputs): Declare.
10610 (Incremental_checker::Incremental_checker): Add incremental_inputs
10611 parameter, use it to initialize incremental_inputs_.
10612 (Incremental_checker::incremental_inputs_): New field.
10613 (Incremental_checker::command_line): New method.
10614 (Incremental_checker::inputs): New method.
10615 (Incremental_checker::command_line_): New field.
10617 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10619 * incremental.cc: Include <cstdarg> and "target-select.h".
10620 (vexplain_no_incremental): New function.
10621 (explain_no_incremental): New function.
10622 (Incremental_binary::error): New method.
10623 (Sized_incremental_binary::do_find_incremental_inputs_section): New
10625 (make_sized_incremental_binary): New function.
10626 (open_incremental_binary): New function.
10627 (can_incrementally_link_file): Add checks if output is ELF and has
10629 * incremental.h: Include "elfcpp_file.h" and "output.h".
10630 (Incremental_binary): New class.
10631 (Sized_incremental_binary): New class.
10632 (open_incremental_binary): Declare.
10633 * object.cc (is_elf_object): Use
10634 elfcpp::Elf_recognizer::is_elf_file.
10635 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
10636 * output.h (Output_file::filesize): New method.
10638 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10640 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
10642 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
10643 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
10645 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
10647 (Arm_relocate_functions::movw_abs_nc): New function.
10648 (Arm_relocate_functions::movt_abs): New function.
10649 (Arm_relocate_functions::thm_movw_abs_nc): New function.
10650 (Arm_relocate_functions::thm_movt_abs): New function.
10651 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
10652 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
10653 (Scan::global): Likewise.
10654 (Relocate::relocate): Likewise.
10655 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10657 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10659 * arm.cc (Arm_relocate_functions::got_prel) New function.
10660 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
10661 (Relocate::relocate): Likewise.
10662 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10664 2009-10-06 Ian Lance Taylor <iant@google.com>
10666 * options.h (class General_options): Define
10667 split_stack_adjust_size parameter.
10668 * object.h (class Object): Add uses_split_stack_ and
10669 has_no_split_stack_ fields. Add uses_split_stack and
10670 has_no_split_stack accessor functions. Declare
10671 handle_split_stack_section.
10672 (class Reloc_symbol_changes): Define.
10673 (class Sized_relobj): Define Function_offsets. Declare
10674 split_stack_adjust, split_stack_adjust_reltype, and
10676 * object.cc (Object::handle_split_stack_section): New function.
10677 (Sized_relobj::do_layout): Call handle_split_stack_section.
10678 * dynobj.cc (Sized_dynobj::do_layout): Call
10679 handle_split_stack_section.
10680 * reloc.cc (Sized_relobj::relocate_sections): Call
10681 split_stack_adjust for executable sections in split_stack
10682 objects. Pass reloc_map to relocate_section.
10683 (Sized_relobj::split_stack_adjust): New function.
10684 (Sized_relobj::split_stack_adjust_reltype): New function.
10685 (Sized_relobj::find_functions): New function.
10686 * target-reloc.h: Include "object.h".
10687 (relocate_section): Add reloc_symbol_changes parameter. Change
10689 * target.h (class Target): Add calls_non_split method. Declare
10690 do_calls_non_split virtual method. Declare match_view and
10692 * target.cc: Include "elfcpp.h".
10693 (Target::do_calls_non_split): New function.
10694 (Target::match_view): New function.
10695 (Target::set_view_to_nop): New function.
10696 * gold.cc (queue_middle_tasks): Give an error if mixing
10697 split-stack and non-split-stack objects with -r.
10698 * i386.cc (Target_i386::relocate_section): Add
10699 reloc_symbol_changes parameter.
10700 (Target_i386::do_calls_non_split): New function.
10701 * x86_64.cc (Target_x86_64::relocate_section): Add
10702 reloc_symbol_changes parameter.
10703 (Target_x86_64::do_calls_non_split): New function.
10704 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
10706 * powerpc.cc (Target_powerpc::relocate_section): Add
10707 reloc_symbol_changes parameter.
10708 * sparc.cc (Target_sparc::relocate_section): Add
10709 reloc_symbol_changes parameter.
10710 * configure.ac: Call AM_CONDITIONAL for the default target.
10711 * configure: Rebuild.
10712 * testsuite/Makefile.am (TEST_AS): New variable.
10713 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
10714 (check_DATA): Add split_i386 and split_x86_64 files.
10715 (SPLIT_DEFSYMS): Define.
10716 (split_i386_[1234n].o): New targets.
10717 (split_i386_[124]): New targets.
10718 (split_i386_[1234r].stdout): New targets.
10719 (split_x86_64_[1234n].o): New targets.
10720 (split_x86_64_[124]): New targets.
10721 (split_x86_64_[1234r].stdout): New targets.
10722 (MOSTLYCLEANFILES): Add new executables.
10723 * testsuite/split_i386.sh: New file.
10724 * testsuite/split_x86_64.sh: New file.
10725 * testsuite/split_i386_1.s: New file.
10726 * testsuite/split_i386_2.s: New file.
10727 * testsuite/split_i386_3.s: New file.
10728 * testsuite/split_i386_4.s: New file.
10729 * testsuite/split_i386_n.s: New file.
10730 * testsuite/split_x86_64_1.s: New file.
10731 * testsuite/split_x86_64_2.s: New file.
10732 * testsuite/split_x86_64_3.s: New file.
10733 * testsuite/split_x86_64_4.s: New file.
10734 * testsuite/split_x86_64_n.s: New file.
10735 * testsuite/testfile.cc (Target_test): Update relocation_section
10737 * testsuite/Makefile.in: Rebuild.
10739 2009-10-06 Ian Lance Taylor <iant@google.com>
10741 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
10742 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
10743 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
10744 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
10745 the address on ldo_addrs_.
10746 (Target_i386::Relocate::fix_up_ldo): New function.
10748 2009-10-06 Rafael Espindola <espindola@google.com>
10750 * plugin.cc (add_input_library): New.
10751 (Plugin::load): Add add_input_library to tv.
10752 (Plugin_manager::add_input_file): Add the is_lib argument.
10753 (add_input_file): Update call to Plugin_manager::add_input_file.
10754 (add_input_library): New.
10755 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
10757 2009-09-30 Doug Kwan <dougkwan@google.com>
10759 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
10760 symbol and call Symbol::may_need_copy_reloc to determine if
10761 a copy reloc is needed.
10762 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
10763 nocopyreloc is given in command line.
10764 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
10765 given in command line.
10766 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
10767 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
10768 of the removed Target_i386::may_need_copy_reloc.
10769 * options.h (copyreloc): New option with default value false.
10770 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10771 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
10772 instead of the removed Target_powerpc::may_need_copy_reloc.
10773 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10774 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
10775 instead of the removed Target_sparc::may_need_copy_reloc.
10776 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
10777 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
10778 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
10779 instead of the removed Target_x86_64::may_need_copy_reloc.
10781 2009-09-30 Ian Lance Taylor <iant@google.com>
10783 * object.h (class Object): Remove target_ field, and target,
10784 sized_target, and set_target methods.
10785 (Object::sized_target): Remove.
10786 (class Sized_relobj): Update declarations. Remove sized_target.
10787 * object.cc (Sized_relobj::setup): Remove target parameter.
10788 Change all callers.
10789 (Input_objects::add_object): Don't do anything with the target.
10790 (make_elf_sized_object): Add punconfigured parameter. Change all
10791 callers. Set or test parameter target.
10792 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
10793 Change all callers.
10794 * parameters.cc (Parameters::set_target): Change parameter type to
10796 (Parameters::default_target): Remove.
10797 (set_parameters_target): Change parameter type to be non-const.
10798 (parameters_force_valid_target): New function.
10799 (parameters_clear_target): New function.
10800 * parameters.h (class Parameters): Update declarations. Remove
10801 default_target method. Add sized_target and clear_target
10802 methods. Change target_ to be non-const.
10803 (set_parameters_target): Update declaration.
10804 (parameters_force_valid_target): Declare.
10805 (parameters_clear_target): Declare.
10806 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
10807 as NULL if we aren't searching.
10808 (Add_symbols::run): Don't check for compatible target.
10809 * fileread.cc (Input_file::open_binary): Call
10810 parameters_force_valid_target.
10811 * gold.cc (queue_middle_tasks): Likewise.
10812 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
10813 set_target on object.
10814 * dynobj.h (class Sized_dynobj): Update declarations.
10815 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
10816 make_elf_object returns NULL.
10817 (Archive::include_member): Don't check whether object target is
10819 * output.cc (Output_section::add_input_section): Get target from
10821 (Output_section::relax_input_section): Likewise.
10822 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
10824 (Sized_relobj::do_scan_relocs): Likewise.
10825 (Sized_relobj::relocate_sections): Likewise.
10826 * resolve.cc (Symbol_table::resolve): Likewise.
10827 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
10828 parameter. Change all callers.
10829 (Symbol_table::add_from_object): Get target from parameters.
10830 (Symbol_table::add_from_relobj): Don't check object target.
10831 (Symbol_table::add_from_dynobj): Likewise.
10832 (Symbol_table::define_special_symbol): Get target from
10834 * symtab.h (class Symbol_table): Update declaration.
10835 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
10836 parameter. Change all callers. Clear parameter target.
10837 (Binary_test): Test target here.
10838 * testsuite/object_unittest.cc (gold_testsuite): Remove
10839 target_test_pointer parameter. Change all callers.
10840 (Object_test): Test target here.
10842 2009-09-26 Ian Lance Taylor <iant@google.com>
10844 * testsuite/initpri1.c: Don't try to use constructor priorities if
10845 compiling with gcc before 4.3.
10847 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
10849 * testsuite/retain_symbols_file_test.sh (check_present): Change
10850 output file name to retain_symbols_file_test.stdout.
10851 (check_absent): Likewise.
10853 2009-09-18 Craig Silverstein <csilvers@google.com>
10855 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
10856 * options.cc: Include <cerrno> and <fstream>.
10857 (General_options::finalize): Parse -retain-symbols-file tag.
10858 * options.h: New flag.
10859 (General_options): New method should_retain_symbol, new
10860 variable symbols_to_retain.
10861 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
10862 should_retain_symbol map.
10863 * testsuite/Makefile.am (retain_symbols_file_test): New test.
10864 * testsuite/Makefile.in: Regenerate.
10865 * testsuite/retain_symbols_file_test.sh: New file.
10867 2009-09-18 Nick Clifton <nickc@redhat.com>
10869 * po/es.po: Updated Spanish translation.
10871 2009-09-17 Doug Kwan <dougkwan@google.com>
10873 * debug.h (DEBUG_RELAXATION): New constant.
10874 (DEBUG_ALL): Add DEBUG_RELAXATION.
10875 (debug_string_to_enum): Add relaxation debug option.
10877 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
10878 Layout::Relaxation_debug_check::read_sections,
10879 Layout::Relaxation_debug_check::read_sections): New method definitions.
10880 (Layout::Layout): Initialize data members
10881 record_output_section_data_from_scrips_,
10882 script_output_section_data_list_ and relaxation_debug_check_.
10883 (Layout::save_segments, Layout::restore_segments,
10884 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10885 Layout::relaxation_loop_body): New method definitions.
10886 (Layout::finalize): Support relaxation. Move section layout code to
10887 Layout::relaxation_loop_body.
10888 (Layout::set_asection_address_from_script): Move code for orphan
10889 section placement out.
10890 (Layout::place_orphan_sections_in_script): New method definition.
10891 * layout.h (Output_segment_headers, Output_file_header):
10892 New forward class declarations.
10893 (Layout::~Layout): Define.
10894 (Layout::new_output_section_data_from_script): New method definition.
10895 (Layout::place_orphan_sections_in_script): New method declaration.
10896 (Layout::Segment_states): New type declaration.
10897 (Layout::save_segments, Layout::restore_segments,
10898 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10899 Layout::relaxation_loop_body): New method declarations.
10900 (Layout::Output_section_data_list): New type declaration.
10901 (Layout::Relaxation_debug_check): New class definition.
10902 (Layout::record_output_section_data_from_script_,
10903 Layout::script_output_section_data_list_, Layout::segment_states_,
10904 Layout::relaxation_debug_check_): New data members.
10905 * output.cc: (Output_section_headers::do_size): New method definition.
10906 (Output_section_headers::Output_section_headers): Move size
10907 computation to Output_section_headers::do_size.
10908 (Output_segment_headers::do_size): New method definition.
10909 (Output_file_header::Output_file_header): Move size computation to
10910 Output_file_header::do_size and call it.
10911 (Output_file_header::do_size): New method definition.
10912 (Output_data_group::Output_data_group): Adjust call to
10913 Output_section_data.
10914 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
10915 (Output_symtab_xindex::do_write): Add array bound check.
10916 (Output_section::Input_section::print_to_mapfile): Handle
10917 RELAXED_INPUT_SECTION_CODE.
10918 (Output_section::Output_section): Initialize data member checkpoint_.
10919 (Output_section::~Output_section): Delete checkpoint object pointed
10921 (Output_section::add_input_section): Always add an Input_section if
10923 (Output_section::add_merge_input_section): Add assert.
10924 (Output_section::relax_input_section): New method definition.
10925 (Output_section::set_final_data_size): Set load address to zero for
10926 an unallocated section.
10927 (Output_section::do_address_and_file_offset_have_reset_values):
10928 New method definition.
10929 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
10930 Handle relaxed input section.
10931 (Output_section::sort_attached_input_sections): Checkpoint input
10932 section list lazily.
10933 (Output_section::get_input_sections): Change type of input_sections to
10934 list of Simple_input_section pointers. Checkpoint input section list
10935 lazily. Also handle relaxed input sections.
10936 (Output_section::add_input_section_for_script): Take a reference to
10937 a Simple_input_section object instead of Relobj pointer and section
10938 index as parameter. Handle relaxed input sections.
10939 (Output_section::save_states, Output_section::restore_states): New
10940 method definitions.
10941 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
10942 (Output_data::is_data_size_fixed): New method definition.
10943 (Output_data::reset_addresss_and_file_offset): Do not reset data size
10945 (Output_data::address_and_file_offset_have_reset_values): New method
10947 (Output_data::do_address_and_file_offset_have_reset_values): New method
10949 (Output_data::set_data_size): Check that data size is not fixed.
10950 (Output_data::fix_data_size): New method definition.
10951 (Output_data::is_data_size_fixed_): New data member.
10952 (Output_section_headers::set_final_data_size): New method definition.
10953 (Output_section_headers::do_size): New method declaration.
10954 (Output_segment_headers::set_final_data_size): New method definition.
10955 (Output_segment_headers::do_size): New method declaration.
10956 (Output_file_header::set_final_data_size)::New method definition.
10957 (Output_file_header::do_size)::New method declaration.
10958 (Output_section_data::Output_section_data): Add new parameter
10959 is_data_size_fixed and use it to fix data size.
10960 (Output_data_const::Output_data_const): Adjust call to base class
10961 constructor and fix data size.
10962 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
10963 base class constructor and fix data size.
10964 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
10965 base class constructor and fix data size.
10966 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
10967 class constructor and fix data size.
10968 (Output_data_group::set_final_data_size): New method definition.
10969 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
10970 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
10971 class constructor and fix data size.
10972 (Output_relaxed_input_section): New class definition.
10973 (Output_section::Simple_input_section): New class definition.
10974 (Output_section::get_input_sections): Adjust parameter list.
10975 (Output_section::add_input_section_for_script): Same.
10976 (Output_section::save_states, Output_section::restore_states,
10977 Output_section::do_address_and_file_offset_have_reset_values,
10978 (Output_section::Input_section::Input_section): Handle
10979 RELAXED_INPUT_SECTION_CODE. Add new overload for
10980 Output_relaxed_input_section.
10981 (Output_section::Input_section::is_input_section,
10982 Output_section::Input_section::set_output_section): Handle relaxed
10984 (Output_section::Input_section::is_relaxed_input_section,
10985 Output_section::Input_section::output_section_data,
10986 Output_section::Input_section::relaxed_input_section): New method
10988 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
10990 (Output_section::Input_section::u1_): Update comments.
10991 (Output_section::Input_section::u2_): Add new union member poris.
10992 (Output_section::Checkpoint_output_section): New classs definition.
10993 (Output_section::relax_input_section): New method declaration.
10994 (Output_section::checkpoint_): New data member.
10995 (Output_segment): Update comments.
10996 (Output_segment::Output_segment): Un-privatize copy constructor.
10997 (Output_segment::operator=): Un-privatize.
10998 * script-sections.cc (Output_section_element::Input_section_list):
10999 Change element type to Output_section::Simple_input_section.
11000 (Output_section_element_dot_assignment::set_section_addresses):
11001 Register output section data for relaxation clean up.
11002 (Output_data_exression::Output_data_expression): Adjust call to base
11003 constructor to fix data size.
11004 (Output_section_element_data::set_section_addresses): Register
11005 Output_data_expression object for relaxation clean up.
11006 (struct Input_section_info): Replace Relobj pointer and section index
11007 pair with Output_section::Simple_input_section and Convert struct to a
11009 (Input_section_sorter::operator()): Adjust access to
11010 Input_section_info data member to use accessors.
11011 (Output_section_element_input::set_section_addresses): Use layout
11012 parameter. Adjust code to use Output_section::Simple_input_section
11013 and Input_secction_info classes. Register filler for relaxation
11015 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
11016 and section index pair with Output_section::Simple_input_section
11017 class. Adjust code accordingly.
11018 (Phdrs_element::release_segment): New method definition.
11019 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
11021 (Script_sections::release_segments): New method definition.
11022 * gold/script-sections.h (Script_sections::release_segments): New
11023 method declaration.
11024 * gold/target.h (Target::may_relax, Target::relax,
11025 Target::do_may_relax, Target::do_relax): New method definitions.
11027 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11029 * arm.cc (has_signed_unsigned_overflow): New function.
11030 (Arm_relocate_functions::abs8): New function.
11031 (Target_arm::Scan::local): Handle R_ARM_ABS8.
11032 (Target_arm::Scan::global): Likewise.
11033 (Target_arm::relocate::relocate): Likewise.
11034 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11037 2009-09-16 Cary Coutant <ccoutant@google.com>
11039 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
11040 * testsuite/Makefile.in: Regenerate.
11042 2009-09-11 Nick Clifton <nickc@redhat.com>
11044 * po/gold.pot: Updated by the Translation project.
11046 2009-09-08 Cary Coutant <ccoutant@google.com>
11048 * output.cc (Output_file::open): Add execute permission to empty file.
11049 * testsuite/Makefile.am (permission_test): New test.
11050 * testsuite/Makefile.in: Regenerate.
11052 2009-09-02 Ian Lance Taylor <iant@google.com>
11054 * output.cc (Output_file::resize): Call map_no_anonymous rather
11057 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
11059 * gold.cc: Include "incremental.h".
11060 (queue_initial_tasks): Call Incremental_checker methods.
11061 * incremental.cc: Include "output.h".
11062 (Incremental_checker::can_incrementally_link_output_file): New
11064 * incremental.h (Incremental_checker): New class.
11066 * output.cc (Output_file::open_for_modification): New method.
11067 (Output_file::map_anonymous): Changed return type to bool. Record
11068 map in base_ field.
11069 (Output_file::map_no_anonymous): New method, broken out of map.
11070 (Output_file::map): Use map_no_anonymous and map_anonymous.
11071 * output.h (class Output_file): Update declarations.
11073 2009-08-24 Cary Coutant <ccoutant@google.com>
11075 * options.h (Command_line::Pre_options): New class.
11076 (Command_line::pre_options): New member.
11077 * options.cc (gold::options::ready_to_register): New variable.
11078 (One_option::register_option): Do nothing if not registering options.
11079 Assert if same short option registered twice.
11080 (General_options::General_options): Turn off option registration when
11082 (Command_line::Pre_options::Pre_options): New constructor.
11084 2009-08-24 Cary Coutant <ccoutant@google.com>
11086 * options.h (General_options::no_keep_memory): Remove incorrect
11089 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11091 * Makefile.am (am__skiplex, am__skipyacc): New.
11092 * Makefile.in: Regenerate.
11094 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11096 * Makefile.am (AM_CPPFLAGS): Renamed from ...
11097 (INCLUDES): ... this.
11098 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
11099 (AM_CPPFLAGS): Renamed from ...
11100 (INCLUDE): ... this.
11101 * Makefile.in, testsuite/Makefile.in: Regenerate.
11103 * Makefile.in: Regenerate.
11104 * aclocal.m4: Likewise.
11105 * config.in: Likewise.
11106 * configure: Likewise.
11107 * testsuite/Makefile.in: Likewise.
11109 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11110 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11111 * Makefile.in: Regenerate.
11112 * testsuite/Makefile.in: Regenerate.
11114 2009-08-19 Cary Coutant <ccoutant@google.com>
11116 * resolve.cc (Symbol_table::resolve): Don't complain about defined
11117 symbols in shared libraries overridden by hidden or internal symbols
11118 in the main program.
11120 2009-08-19 Chris Demetriou <cgd@google.com>
11122 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
11123 checking source file names in error messages.
11125 2009-08-18 Doug Kwan <dougkwan@google.com>
11127 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
11128 an elcpp::Ehdr as parameter. Adjust call to set_target.
11129 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
11130 an elfcpp::Ehdr as parameter.
11131 * object.cc (Object::set_target): Remove the version that looks up
11132 a target and sets it.
11133 (Sized_relobj::setup): Take a Target object instead of
11134 an elfcpp::Ehdr as parameter. Adjust call to set_target.
11135 (make_elf_sized_object): Find target and ask target to
11136 make an ELF object.
11137 * object.h: (Object::set_target): Remove the version that looks up
11138 a target and sets it.
11139 (Sized_relobj::setup): Take a Target object instead of
11140 an elfcpp:Ehdr as parameter.
11141 * target.cc: Include dynobj.h.
11142 (Target::do_make_elf_object_implementation): New.
11143 (Target::do_make_elf_object): New.
11144 * target.h (Target::make_elf_object): New template declaration.
11145 (Target::do_make_elf_object): New method declarations.
11146 (Target::do_make_elf_object_implementation): New template declaration.
11148 2009-08-14 Ian Lance Taylor <iant@google.com>
11150 * gold.h (FUNCTION_NAME): Define.
11151 (gold_unreachable): Use FUNCTION_NAME.
11153 2009-08-12 Sriraman Tallam <tmsriram@google.com>
11155 * icf.cc (Icf::find_identical_sections): Issue a warning when a
11156 symbol in the --keep-unique list is not found.
11158 2009-08-12 Sriraman Tallam <tmsriram@google.com>
11160 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
11161 been maked as --keep-unique.
11162 (Icf::unfold_section): New function.
11163 * icf.h (Icf::unfold_section): New function.
11164 * options.h (General_options::keep_unique): New option.
11165 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
11166 * testsuite/Makefile.in: Regenerate.
11167 * testsuite/icf_keep_unique_test.sh: New file.
11168 * testsuite/icf_keep_unique_test.cc: New file.
11170 2009-08-12 Cary Coutant <ccoutant@google.com>
11173 * resolve.cc (Symbol_table::resolve): Check for references from
11174 dynamic objects to hidden and internal symbols.
11175 * testsuite/Makefile.am (hidden_test.sh): New test.
11176 * testsuite/Makefile.in: Regenerate.
11177 * testsuite/hidden_test.sh: New script.
11178 * testsuite/hidden_test_1.c: New test source.
11179 * testsuite/hidden_test_main.c: New test source.
11181 2009-08-11 Doug Kwan <dougkwan@google.com>
11183 * arm.cc: Update comments.
11184 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
11185 segment to locate the .ARM.exidx section if present.
11187 2009-08-09 Doug Kwan <dougkwan@google.com>
11189 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
11192 2009-08-07 Sriraman Tallam <tmsriram@google.com>
11193 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
11196 2009-08-06 Sriraman Tallam <tmsriram@google.com>
11198 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
11199 valid tls_segment only for non-debug-section relocations.
11200 * testsuite/Makefile.am: Add gc_tls_test.
11201 * testsuite/Makefile.in: Regenerate.
11202 * testsuite/gc_tls_test.cc: New file.
11203 * testsuite/gc_tls_test.sh: New file.
11205 2009-08-05 Sriraman Tallam <tmsriram@google.com>
11207 * icf.cc: New file.
11209 * Makefile.am (CCFILES): Add icf.cc.
11210 (HFILES): Add icf.h
11211 * Makefile.in: Regenerate.
11212 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
11213 * gc.h (gc_process_relocs): Populate lists used by icf to contain
11214 section, symbol and addend information for the relocs.
11215 * gold.cc (queue_middle_tasks): Call identical code folding.
11216 * gold.h: Add defines for multimap.
11217 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
11218 to the call of finalize_local_symbols.
11219 * main.cc (main): Create object of class Icf.
11220 * object.cc (Sized_relobj::do_layout): Allow this function to be
11221 called twice during icf.
11222 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
11223 to sections marked as identical by icf.
11224 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
11226 (Sized_relobj::do_section_entsize): New function.
11227 * object.h (Object::section_entsize): New function.
11228 (Object::do_section_entsize): New pure virtual function.
11229 (Relobj::finalize_local_symbols): Add new parameter.
11230 (Relobj::do_section_entsize): New function.
11231 * options.h (General_options::icf): New option.
11232 (General_options::icf_iterations): New option.
11233 (General_options::print_icf_sections): New option.
11234 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
11235 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
11236 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
11238 * symtab.cc (Symbol_table::is_section_folded): New function.
11239 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
11240 to sections marked as identical by icf.
11241 * symtab.h (Symbol_table::set_icf): New function.
11242 (Symbol_table::icf): New function.
11243 (Symbol_table::is_section_folded): New function.
11244 (Symbol_table::icf_): New data member.
11245 * target-reloc.h (relocate_section): Ignore sections folded by icf.
11246 * testsuite/Makefile.am: Add commands to build icf_test.
11247 * testsuite/Makefile.in: Regenerate.
11248 * testsuite/icf_test.sh: New file.
11249 * testsuite/icf_test.cc: New file.
11251 2009-07-24 Chris Demetriou <cgd@google.com>
11253 * layout.cc (is_compressible_debug_section): Fix incorrect
11254 comment about compressed section names.
11256 2009-07-20 Ian Lance Taylor <ian@airs.com>
11259 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
11261 2009-07-16 Ian Lance Taylor <iant@google.com>
11264 * layout.h: #include <map>.
11265 (class Kept_section): Change from struct to class. Add accessors
11266 and setters. Add section size to Comdat_group mapping. Change
11267 Comdat_group to std::map. Add is_comdat_ field. Add
11268 linkonce_size field in union.
11269 (class Layout): Update declaration of find_or_add_kept_section.
11270 Don't declare find_kept_object.
11271 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
11272 parameter. Add object, shndx, is_comdat, and is_group_name
11273 parameters. Change all callers. Adjust for new Kept_section.
11274 (Layout::find_kept_object): Remove.
11275 * object.cc (Sized_relobj::include_section_group): Update use of
11276 Kept_section. Rename secnum to shndx. Only record
11277 Kept_comdat_section if sections are the same size.
11278 (Sized_relobj::include_linkonce_section): Update use of
11279 Kept_section. Only record Kept_comdat_section if sections are the
11280 same size. Set size of linkonce section.
11281 (Sized_relobj::map_to_kept_section): Update call to
11282 get_kept_comdat_section.
11283 * object.h (class Sized_relobj): Rename fields in
11284 Kept_comdat_section to drop trailing underscores; change object
11285 field to Relobj*. Change Kept_comdat_section_table to store
11286 struct rather than pointer.
11287 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
11288 Add kept_object and kept_shndx parameters. Change all callers.
11289 (Sized_relobj::get_kept_comdat_section): Change return type to
11290 bool. Add kept_object and kept_shndx parameters. Change all
11292 * plugin.cc (Pluginobj::include_comdat_group): Update call to
11293 Layout::find_or_add_kept_section.
11295 2009-07-09 Ian Lance Taylor <iant@google.com>
11297 * merge.cc (Object_merge_map::initialize_input_to_output_map):
11298 Reserve space in the hash table.
11300 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
11302 * fileread.cc (File_read::get_mtime): New method.
11303 * fileread.h (Timespec): New structure.
11304 (File_read::get_mtime): New method.
11305 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
11306 Renamed from timestamp_nsec.
11307 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
11309 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
11311 (Incremental_inputs::report_archive): Save mtime; style fix.
11312 (Incremental_inputs::report_obejct): Save mtime; style fix.
11313 (Incremental_inputs::report_script): Save mtime; style fix.
11314 (Incremental_inputs::finalize_inputs): Style fix.
11315 (Incremental_inputs::finalize): Style fix.
11316 (Incremental_inputs::create_input_section_data): Store inputs
11318 * incremental.h (Incremental_inputs::report_script): Add mtime
11320 (Incremental_inputs::Input_info::Input_info): Intialize only one
11322 (Incremental_inputs::Input_info::archive): Move to nameless
11324 (Incremental_inputs::Input_info::obejct): Move to nameless union.
11325 (Incremental_inputs::Input_info::script): Move to nameless union.
11326 (Incremental_inputs::mtime): New field.
11327 * script.cc (read_input_script): Pass file mtime to
11329 * script.h (Script_info::inputs): Style fix.
11331 2009-07-01 Ian Lance Taylor <ian@airs.com>
11333 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
11336 2009-06-24 Ian Lance Taylor <iant@google.com>
11339 * layout.cc (Layout::choose_output_section): If we find an
11340 existing section, update the flags.
11341 (Layout::create_notes): New function, broken out of
11343 (Layout::finalize): Don't create note sections.
11344 (Layout::create_note): Don't crash if linker script discards
11346 (Layout::create_gold_note): Likewise.
11347 (Layout::create_build_id): Likewise. Don't set
11348 after_input_sections on the section.
11349 (Layout::create_executable_stack_info): Remove target parameter.
11351 * layout.h (class Layout): Declare create_notes. Update
11352 declaration of create_executable_stack_info.
11353 * gold.cc (queue_middle_tasks): Call create_notes.
11354 * output.cc (Output_section::update_flags_for_input_section): Move
11355 here from output.h. If SHF_ALLOC flag is newly set, mark address
11357 * output.h (Output_data::mark_address_invalid): New function.
11358 (class Output_section): Only declare, not define,
11359 update_flags_for_input_section. Remove set_flags.
11361 2009-06-24 Ian Lance Taylor <iant@google.com>
11363 * script-sections.cc (Output_section_definition::
11364 set_section_addresses): Rename shadowing local load_address to
11367 2009-06-24 Ian Lance Taylor <iant@google.com>
11370 * reloc.cc (relocate_sections): Skip empty relocation sections.
11372 2009-06-23 Ian Lance Taylor <iant@google.com>
11375 * layout.cc (Layout::create_note): Use choose_output_section
11376 rather than make_output_section.
11378 2009-06-23 Ian Lance Taylor <iant@google.com>
11381 * options.cc (General_options::parse_V): Set printed_version_.
11382 (General_options::General_options): Initialize printed_version_.
11383 * options.h (class General_options): Add printed_version_ field.
11384 * gold.cc (queue_initial_tasks): If there are no input files,
11385 don't give a fatal error if we printed the version information.
11386 (queue_middle_tasks): If using -r with a shared object, give a
11387 fatal error rather than an ordinary error.
11389 2009-06-23 Ian Lance Taylor <iant@google.com>
11392 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
11393 (Layout::make_output_section): Set have_stabstr_section_ if we see
11394 a .stab*str section.
11395 (Layout::finalize): Call link_stabs_sections.
11396 (Layout::link_stabs_sections): New file.
11397 * layout.h (class Layout): Add have_stabstr_section_ field.
11398 Declare link_stabs_sections.
11400 2009-06-23 Doug Kwan <dougkwan@google.com>
11402 * Makefile.am (libgold_a_LIBADD): New.
11403 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
11404 * Makefile.in: Regenerate.
11405 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
11406 * configure: Regenerate.
11407 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
11408 * fileread.cc: Include sys/state.h
11409 * gold.h: Declare memmem and strndup if found missing.
11410 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
11412 2009-06-23 Ian Lance Taylor <iant@google.com>
11414 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
11415 * configure: Rebuild.
11417 2009-06-23 Ian Lance Taylor <iant@google.com>
11420 * object.cc (Object::section_contents): Don't try to get a view if
11421 the section has length zero.
11422 (Object::handle_gnu_warning_section): If the section is empty, use
11423 the name of the section as the warning.
11425 2009-06-23 Ian Lance Taylor <iant@google.com>
11428 * stringpool.h (class Stringpool_template): Add optimize_ field.
11429 (Stringpool_template::set_optimize): New function.
11430 * stringpool.cc (Stringpool_template::Stringpool_template):
11431 Initialize optimize_ field.
11432 (Stringpool_template::set_string_offsets): Test local optimize
11433 fild rather than parameter.
11434 * layout.cc (Layout::Layout): Call set_optimize on the section
11437 2009-06-22 Ian Lance Taylor <iant@google.com>
11440 * yyscript.y: Parse TARGET.
11441 * script.cc (script_set_target): New function.
11442 * script-c.h (script_set_target): Declare.
11443 * options.cc (General_options::string_to_object_format): Rename
11444 from string_to_object_format in anonymous namespace. Change
11446 * options.h (class General_options): Declare
11447 string_to_object_format.
11449 2009-06-22 Ian Lance Taylor <iant@google.com>
11451 * script-sections.cc (Script_sections::create_segments): Don't put
11452 program headers in a PT_LOAD segment if -n or -N.
11454 2009-06-22 Ian Lance Taylor <iant@google.com>
11457 * options.h (class General_options): Add -z lazy and -z now. Sort
11458 -z options into alphabetical order.
11459 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
11461 2009-06-21 Ian Lance Taylor <iant@google.com>
11463 * layout.cc (Layout::make_output_section): Call
11464 Target::new_output_section.
11465 (Layout::attach_allocated_section_to_segment): Put large section
11466 sections in a separate load segment with the large segment flag
11468 (Layout::segment_precedes): Sort large data segments after other
11470 (align_file_offset): New static function.
11471 (Layout::set_segment_offsets): Use align_file_offset.
11472 * output.h (class Output_section): Add is_small_section_ and
11473 is_large_section_ fields.
11474 (Output_section::is_small_section): New function.
11475 (Output_section::set_is_small_section): New function.
11476 (Output_section::is_large_section): New function.
11477 (Output_section::set_is_large_section): New function.
11478 (Output_section::is_large_data_section): New function.
11479 (class Output_segment): Add is_large_data_segment_ field.
11480 (Output_segment::is_large_data_segment): New function.
11481 (Output_segment::set_is_large_data_segment): New function.
11482 * output.cc (Output_section::Output_section): Initialize new
11484 (Output_segment::Output_segment): Likewise.
11485 (Output_segment::add_output_section): Add assertion that large
11486 data sections always go in large data segments. Force small data
11487 sections to the end of the list of data sections. Force small BSS
11488 sections to the start of the list of BSS sections. For large BSS
11489 sections to the end of the list of BSS sections.
11490 * symtab.h (class Symbol): Declare is_common_shndx.
11491 (Symbol::is_defined): Check Symbol::is_common_shndx.
11492 (Symbol::is_common): Likewise.
11493 (class Symbol_table): Define enum Commons_section_type. Update
11494 declarations. Add small_commons_ and large_commons_ fields.
11495 * symtab.cc (Symbol::is_common_shndx): New function.
11496 (Symbol_table::Symbol_table): Initialize new fields.
11497 (Symbol_table::add_from_object): Put small and large common
11498 symbols in the right list.
11499 (Symbol_table::sized_finalized_symbol): Check
11500 Symbol::is_common_shndx.
11501 (Symbol_table::sized_write_globals): Likewise.
11502 * common.cc (Symbol_table::do_allocate_commons): Allocate new
11503 common symbol lists. Don't call do_allocate_commons_list if the
11505 (Symbol_table::do_allocate_commons_list): Remove is_tls
11506 parameter. Add comons_section_type parameter. Change all
11507 callers. Handle small and large common symbols.
11508 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
11509 Symbol::is_common_shndx.
11510 * resolve.cc (symbol_to_bits): Likewise.
11511 * target.h (Target::small_common_shndx): New function.
11512 (Target::small_common_section_flags): New function.
11513 (Target::large_common_shndx): New function.
11514 (Target::large_common_section_flags): New function.
11515 (Target::new_output_section): New function.
11516 (Target::Target_info): Add small_common_shndx, large_common_shndx,
11517 small_common_section_flags, and large_common_section_flags
11519 (Target::do_new_output_section): New virtual function.
11520 * arm.cc (Target_arm::arm_info): Initialize new fields.
11521 * i386.cc (Target_i386::i386_info): Likewise.
11522 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
11524 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
11525 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11526 (Target_x86_64::do_new_output_section): New function.
11527 * configure.ac: Define conditional MCMODEL_MEDIUM.
11528 * testsuite/Makefile.am (check_PROGRAMS): Add large.
11529 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
11530 (large_LDFLAGS): Define.
11531 * testsuite/large.c: New file.
11532 * testsuite/testfile.cc (Target_test::test_target_info):
11533 Initialize new fields.
11534 * configure, testsuite/Makefile.in: Rebuild.
11536 2009-06-05 Doug Kwan <dougkwan@google.com>
11538 * Makefile.am (CCFILES): Add target.cc.
11539 * Makefile.in: Regenerate.
11540 * i386.cc (class Target_i386): Define new virtual method to
11541 override do_is_local_label_name in parent.
11542 * object.cc (Sized_relobj::do_count_local_symbols): Discard
11543 local symbols if --discard-locals or -X is given.
11544 * options.h (class General_options): Declare new options
11545 '--discard-locals' and '-X' for discarding locals.
11546 * target.h (class Target): Define new methods is_local_label_name.
11547 Declare new virtual method do_is_local_label_name.
11548 * target.cc: New file.
11549 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
11550 (check_SCRIPTS): Add discard_locals_test.sh.
11551 (check_DATA): Add discard_local_tests.syms.
11552 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
11553 (discard_local_tests.syms, discard_locals_test.o): New make rules.
11554 * testsuite/Makefile.in: Regenerate.
11555 * testsuite/discard_locals_test.c: New file.
11556 * testsuite/discard_locals_test.sh: Same.
11558 2009-06-05 Doug Kwan <dougkwan@google.com>
11560 * object.cc (Sized_relobj::Sized_relobj): Initialize
11561 discarded_eh_frame_shndx_ to -1U.
11562 (Sized_relobj::do_layout): Record index of a discard .eh_frame
11564 (Sized_relobj::do_count_local_symbols): Skip local symbols in
11565 a discarded .eh_frame section.
11566 (Sized_relobj::do_finalize_local_symbols): Ditto.
11567 * object.h (class Sized_relobj): Declare new member
11568 discarded_eh_frame_shndx_.
11569 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
11570 (local_labels_test.o, local_labels_test): New rules.
11571 * testsuite/Makefile.in: Regenerate.
11573 2009-06-04 Doug Kwan <dougkwan@google.com>
11575 * layout.cc (Layout::section_name_mapping): Add mapping for
11576 special ARM sections.
11578 2009-06-03 Doug Kwan <dougkwan@google.com>
11580 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
11581 (utils::has_overflow): Same.
11583 2009-06-03 Ian Lance Taylor <iant@google.com>
11585 * layout.cc (Layout::section_name_mapping): New array, replacing
11586 Layout::linkonce_mapping.
11587 (Layout::section_name_mapping_count): New variable, replacing
11588 Layout::linkonce_mapping_count.
11589 (Layout::linkonce_output_name): Remove.
11590 (Layout::output_section_name): Rewrite.
11591 * layout.h (class Layout): Rename Linkonce_mapping to
11592 Section_name_mapping, linkonce_mapping to section_name_mapping,
11593 linkonce_mapping_count to section_name_mapping_count. Don't
11594 declare linkonce_output_name.
11596 2009-06-03 Doug Kwan <dougkwan@google.com>
11598 * gold/arm.cc (namespace utils): New.
11599 (Target_arm::reloc_is_non_pic): Define new method.
11600 (class Arm_relocate_functions): New.
11601 (Target_arm::Relocate::relocate): Handle relocation types used by
11604 2009-06-03 Ian Lance Taylor <iant@google.com>
11606 * arm.cc (Target_arm::scan::global): Use || instead of |.
11608 2009-06-02 Doug Kwan <dougkwan@google.com>
11610 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
11611 issued_non_pic_error_.
11612 (class Target_arm::Scan): Declare new method check_non_pic.
11613 Define new method symbol_needs_plt_entry.
11614 Declare new data member issued_non_pic_error_.
11615 (class Target_arm::Relocate): Declare new method
11616 should_apply_static_reloc.
11617 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
11618 (Target_arm::Scan::check_non_pic): Define new method.
11619 (Target_arm::Scan::local): Handle a small subset of reloc types used
11621 (Target_arm::Scan::local): Same.
11622 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
11624 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
11626 * incremental.cc (Incremental_inputs::report_command_line): Filter
11627 out --incremental-* options.
11629 2009-05-29 Doug Kwan <dougkwan@google.com>
11631 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
11633 (class Target_arm): Update comment.
11634 (Target_arm::Target_arm): Initialize new data members GOT_,
11635 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
11636 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
11637 and Target_arm::rel_dyn_section.
11638 Declare new_enum Target_arm::Got_type.
11639 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
11641 Update commments for member do_dynsym_value.
11642 (Target_arm::got_size, Target_arm::plt_section,
11643 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
11644 new methods inside class defintion.
11645 (Target_arm::got_section): Define new method.
11646 (Target_arm::rel_dyn_section): Same.
11647 (Output_data_plt_arm): New template class.
11648 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
11649 (Output_data_plt_arm:do_adjust_output_section): Define new method.
11650 (Output_data_plt_arm::add_entry): Same.
11651 (Output_data_plt_arm::first_plt_entry): Define new
11652 static data member for PLT instruction template.
11653 (Output_data_plt_arm::plt_entry): Same.
11654 (Output_data_plt_arm::do_write): Define new method.
11655 (Target_arm::make_plt_entry): Same.
11656 (Target_arm::do_finalize_sections): Same.
11657 (Target_arm::do_dynsym_value): Same.
11659 2009-05-28 Doug Kwan <dougkwan@google.com>
11661 * Makefile.am (TARGETSOURCES): Add arm.cc.
11662 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
11663 * Makefile.in: Regenerate.
11664 * arm.cc: New file.
11665 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
11667 2009-05-26 Doug Kwan <dougkwan@google.com>
11669 * options.cc (General_options::parse_exclude_libs). Fix a comment.
11670 (General_options::check_excluded_libs): Strip off directories in
11671 archive name before matching like GNU ld does.
11672 * testsuite/Makefile.am (MOSTLYCLEANFILES,
11673 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
11674 (exclude_libs_test_LDFLAGS): Add linker option
11675 -Wl,--exclude-libs,libexclude_libs_test_3
11676 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
11677 an explicit archive without using -l.
11678 (alt/libexclude_libs_test_3.a): New make rule.
11679 * testsuite/Makefile.in: Regenerate.
11680 * testsuite/exclude_libs_test.c : Declare lib3_default().
11682 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
11683 * exclude_libs_test_3.c: New file.
11685 2009-05-26 Nick Clifton <nickc@redhat.com>
11687 * po/id.po: New Indonesian translation.
11688 * po/gold.pot: Updated template file.
11690 2009-05-22 Sriraman Tallam <tmsriram@google.com>
11692 * testsuite/Makefile.am: Add -ffunction-sections to compile
11693 gc_comdat_test files. Add -Wl,--gc-sections to build
11695 * testsuite/Makefile.in: Regenerate.
11696 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
11698 2009-05-21 Sriraman Tallam <tmsriram@google.com>
11700 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
11701 kept comdat section was garbage collected.
11702 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
11703 * testsuite/Makefile.in: Regenerate.
11704 * testsuite/gc_comdat_test.sh: New file.
11705 * testsuite/gc_comdat_test_1.cc: New file.
11706 * testsuite/gc_comdat_test_2.cc: New file.
11708 2009-05-19 Doug Kwan <dougkwan@google.com>
11710 * archive.cc (Archive::Archive): Move constructor from archive.h
11711 to here. Initialize no_export_.
11712 (Archive::get_elf_object_for_member): Set no_export flag of object.
11713 * archive.h (Archive::Archive): Move constructor body to
11715 (Archive::no_export): New method.
11716 (Archive::no_export_): New field.
11717 * object.h (Object::Object): Initialize no_export_ to false.
11718 (Object::no_export, Object::set_no_export): New methods.
11719 (Object::no_export_): New field.
11720 * options.cc (General_options::parse_exclude_libs): New method.
11721 (General_options::check_excluded_libs) Same.
11722 * options.h (exclude_libs): New option.
11723 (General_options::check_excluded_libs): New method declaration.
11724 (General_options::excluded_libs_): New field.
11725 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
11726 default or protected visibility if an object has no-export flag set.
11727 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
11728 (check_SCRIPTS): Add exclude_libs_test.sh.
11729 (check_DATA): Add exclude_libs_test.syms.
11730 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
11731 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
11732 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
11733 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
11734 (exclude_libs_test.syms, libexclude_libs_test_1.a,
11735 libexclude_libs_test_2.a): New rules.
11736 * testsuite/Makefile.in: Regenerate.
11737 * testsuite/exclude_libs_test.c: New file.
11738 * testsuite/exclude_libs_test.sh: Ditto.
11739 * testsuite/exclude_libs_test_1.c: Ditto.
11740 * testsuite/exclude_libs_test_2.c: Ditto.
11742 2009-05-15 Ian Lance Taylor <iant@google.com>
11744 * configure.ac: Check for declarations for cases where libiberty.h
11745 checks HAVE_DECL_xxx.
11746 * configure, config.in: Rebuild.
11748 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
11750 * gold.h (Incremental_argument_list): Remove (invalid) forward
11752 * incremental.cc (Incremental_inputs::report_achive): New method.
11753 (Incremental_inputs::report_object): New method.
11754 (Incremental_inputs::report_script): New method.
11755 (Incremental_inputs::finalize_inputs): New method.
11756 (Incremental_inputs::finalize): Call finalize_inputs().
11757 (Incremental_inputs::sized_create_incremental_inputs_section_data):
11758 Create inputs entries.
11759 * incremental.h (Incremental_input_type): New enum.
11760 (Incremental_inputs::Incremental_input): Initialize new fields.
11761 (Incremental_inputs::report_inputs): New method.
11762 (Incremental_inputs::report_achive): New method.
11763 (Incremental_inputs::report_object): New method.
11764 (Incremental_inputs::report_script): New method.
11765 (Incremental_inputs::finalize_inputs): New method.
11766 (Incremental_inputs::Input_info): New struct.
11767 (Incremental_inputs::Input_info_map): New typedef.
11768 (Incremental_inputs::lock_): New field.
11769 (Incremental_inputs::Inputs_): New field.
11770 (Incremental_inputs::Inputs_map): New field.
11771 * main.cc (main): Call Incremental_input::report_inputs.
11772 * options.h (Input_argument_list): Typedef moved from
11774 (Input_file_group::Files): Remove, use ::Input_argument_list.
11775 (Input_file_group::Input_argument_list): Remove, use
11776 ::Input_argument_list.
11777 * plugin.cc (Plugin_manager::add_input_file): Add error in
11779 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
11781 * script.cc (read_input_script): Call
11782 Incremental_input::report_script.
11783 * script.h (Script_info): New class.
11785 2009-04-27 Ian Lance Taylor <iant@google.com>
11787 * x86_64.cc (do_adjust_output_section): Set entsize to
11790 2009-04-23 Elliott Hughes <enh@google.com>
11792 * output.cc (Output_file::close): After short writes, continue
11793 writing from the correct offset in the buffer being written.
11795 2009-04-23 Chris Demetriou <cgd@google.com>
11797 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
11798 * configure: Regenerate.
11799 * config.in: Regenerate.
11800 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
11801 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
11803 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
11805 * incremental.cc (Incremental_inputs_header_data): Renamed from
11806 Incremental_input_header_data.
11807 (Incremental_inputs_header_data::data_size): New field.
11808 (Incremental_inputs_header_data::put_input_file_count): Renamed
11809 from input_file_count.
11810 (Incremental_inputs_header_data::put_command_line_offset): Renamed
11811 from command_line_offset.
11812 (Incremental_inputs_header_data::put_reserved): Renamed from
11814 (Incremental_inputs_entry_data): Renamed from
11815 Incremental_input_entry_data.
11816 (Incremental_inputs_entry_data::data_size): New field.
11817 (Incremental_inputs::report_command_line): New method.
11818 (Incremental_inputs::finalize): New method.
11819 (Incremental_inputs::create_incremental_inputs_data): New method.
11820 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
11821 * incremental.h: New file.
11822 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
11823 (Layout::finalize): Create incremental inputs section in
11824 incremental builds.
11825 (Layout::create_incremental_info_sections): New method.
11826 * layout.h (Layout::incremental_inputs): New method.
11827 (Layout::create_incremental_info_sections): New method.
11828 (Layout::incremental_inputs_): New field.
11829 * main.cc (main): Notify Incremental_input of the command line.
11831 2009-04-01 Ian Lance Taylor <iant@google.com>
11832 Mikolaj Zalewski <mikolajz@google.com>
11834 * gold.h (reserve_unordered_map): Define, three versions, one for
11835 each version of Unordered_map.
11836 * layout.cc (Layout::Layout): Remove options parameter. Add
11837 number_of_input_files parameter. Don't initialize options_.
11838 Initialize number_of_input_files_ and resized_signatures_. Move
11839 sections_are_attached_.
11840 (Layout::layout_group): Reserve space for group_signatures_.
11841 (Layout::find_or_add_kept_section): Change name parameter to be a
11842 reference. Resize signatures_ map when it gets large enough.
11843 (Layout::layout_eh_frame): Use parameters->options() instead of
11845 (Layout::make_output_section): Likewise.
11846 (Layout::attach_allocated_section_to_segment): Likewise.
11847 (Layout::finalize, Layout::create_executable_stack): Likewise.
11848 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
11849 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
11850 * layout.h (class Layout): Update declarations. Remove options_
11851 field. Add number_of_input_files_ and resized_signatures_
11852 fields. Move sections_are_attached_ field.
11853 * main.cc (main): Pass number of input files to Layout
11854 constructor. Don't pass options.
11856 2009-03-30 Ian Lance Taylor <iant@google.com>
11858 * ffsll.c (ffsll): Correct implementation.
11860 2009-03-27 Ian Lance Taylor <iant@google.com>
11862 * ffsll.c: New file.
11863 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
11864 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
11865 * ftruncate.c (ftruncate): Declare before definition.
11866 * mremap.c (mremap): Likewise.
11867 * pread.c (pread): Likewise.
11868 * configure, Makefile.in, config.in: Rebuild.
11870 * mremap.c: New file.
11871 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
11872 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
11873 (mremap): Declare if HAVE_MREMAP is not defined.
11874 * configure, Makefile.in, config.in: Rebuild.
11876 2009-03-27 Cary Coutant <ccoutant@google.com>
11878 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
11879 position independent.
11880 * sparc.cc (Target_sparc::check_non_pic): Likewise.
11881 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
11883 2009-03-24 Cary Coutant <ccoutant@google.com>
11885 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
11887 (needs_dynamic_reloc): Likewise.
11889 2009-03-24 Ian Lance Taylor <iant@google.com>
11891 * yyscript.y (file_cmd): Recognize EXTERN.
11892 (extern_name_list, extern_name_list_body): New nonterminals.
11893 * script.cc (script_add_extern): Define.
11894 * script-c.h (script_add_extern): Declare.
11896 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
11898 * object.cc (is_elf_object): Define.
11899 * object.h (is_elf_object): Declare.
11900 * archive.cc (Archive::get_elf_object_for_member): Call
11902 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
11904 2009-03-24 Elliott Hughes <enh@google.com>
11906 * output.cc (Output_file::map_anonymous): Define.
11907 (Output_file::map): Use map_anonymous. If the regular mmap fails,
11908 try an anonymous one. Report the size if the mmap fails.
11909 * output.h (class Output_file): Declare map_anonymous.
11911 2009-03-24 Ian Lance Taylor <iant@google.com>
11913 * target-select.cc (instantiate_target): Don't acquire the lock if
11914 the instantiated_target_ field has already been set.
11916 2009-03-23 Ian Lance Taylor <iant@google.com>
11918 * gold-threads.h (class Initialize_lock): Define.
11919 * gold-threads.cc (class Initialize_lock_once): Define.
11920 (initialize_lock_control): New static variable.
11921 (initialize_lock_pointer): New static variable.
11922 (initialize_lock_once): New static function.
11923 (Initialize_lock::Initialize_lock): Define.
11924 (Initialize_lock::initialize): Define.
11925 * target-select.h: Include "gold-threads.h".
11926 (class Target_selector): Add lock_ and initialize_lock_ fields.
11927 Don't define instantiate_target, just declare it.
11928 * target-select.cc (Target_selector::Target_selector): Initialize
11930 (Target_selector::instantiate_target): Define.
11931 * descriptors.h: Include "gold-threads.h".
11932 (class Descriptors): Add initialize_lock_ field.
11933 * descriptors.cc (Descriptors::Descriptors): Initialize new
11935 (Descriptors::open): Use initialize_lock_ field
11936 * errors.h (class Errors): Add initialize_lock_ field.
11937 * errors.cc (Errors::Errors): Initialize new field.
11938 (Errors::initialize_lock): Use initialize_lock_ field.
11939 * powerpc.cc (class Target_selector_powerpc): Remove
11940 instantiated_target_ field. In do_recognize call
11941 instantiate_target rather than do_instantiate_target. In
11942 do_instantiate_target just allocate a new target.
11943 * sparc.cc (class Target_selector_sparc): Likewise.
11945 * freebsd.h: New file.
11946 * i386.cc: Include "freebsd.h".
11947 (Target_i386): Derive from Target_freebsd rather than
11949 (Target_selector_i386): Derive from Target_selector_freebsd rather
11950 than Target_selector.
11951 * x86_64.cc: Include "freebsd.h".
11952 (Target_x86_64): Derive from Target_freebsd rather than
11954 (Target_selector_x86_64): Derive from Target_selector_freebsd
11955 rather than Target_selector.
11956 * target.h (class Target): Add adjust_elf_header and
11957 do_adjust_elf_header.
11958 * output.cc (Output_file_header:: do_sized_write): Call target
11959 adjust_elf_header routine.
11960 * configure.tgt: Set targ_osabi.
11961 * configure.ac: Define GOLD_DEFAULT_OSABI.
11962 * parameters.cc (Parameters::default_target): Pass
11963 GOLD_DEFAULT_OSABI to select_target.
11964 * target-select.h (class Target_selector): Make instantiate_target
11965 protected rather than private.
11966 * Makefile.am (HFILES): Add freebsd.h.
11967 * configure, Makefile.in, config.in: Rebuild.
11969 * merge.cc (do_add_input_section): Correct pend value. Change
11970 message about last entry not being null terminated from error to
11973 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
11975 * incremental.cc: New file.
11976 * Makefile.am (CCFILES): Add incremental.cc.
11977 * Makefile.in: Rebuild.
11979 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
11981 * layout.cc (Layout::output_section_name): Preserve names
11982 of '.note.' sections.
11984 2009-03-19 Ian Lance Taylor <iant@google.com>
11986 * descriptors.cc (Descriptors::open): Check that the options are
11987 valid before using them.
11989 2009-03-18 Ian Lance Taylor <iant@google.com>
11991 * script-sections.h: Include <list>.
11992 (class Script_sections): Change Sections_elements from std::vector
11993 to std::list. Typedef public Elements_iterator. Add
11994 orphan_section_placement_, data_segment_align_start_, and
11995 saw_data_segment_align_ fields. Remove data_segment_align_index_
11997 * script-sections.cc (class Orphan_section_placement): New class.
11998 (class Sections_element): Add virtual functions is_relro and
11999 orphan_section_init. Remove virtual function place_orphan_here.
12000 (class Output_section_definition): Add is_relro and
12001 orphan_section_init. Remove place_orphan_here.
12002 (class Orphan_output_section): Likewise.
12003 (Script_sections::Script_sections): Update for field changes.
12004 (Script_sections::data_segment_align): Set saw_data_segment_align_
12005 and data_segment_align_start_, not data_segment_align_index.
12006 (Script_sections::data_segment_relro_end): Check
12007 saw_data_segment_align_. Use data_segment_align_start_ rather
12008 than data_segment_align_index_.
12009 (Script_sections::place_orphan): Rewrite to use
12010 Orphan_section_placement.
12012 2009-03-17 Ian Lance Taylor <iant@google.com>
12014 * archive.cc (Archive::add_symbols): Check for a version attached
12015 to the symbol name in the archive map.
12016 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
12017 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
12018 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
12019 (ver_test_11.a): New target.
12020 * testsuite/Makefile.in: Rebuild.
12022 * configure.ac: Check for chsize and posix_fallocate. Replace
12024 * ftruncate.c: New file, from gnulib.
12025 * output.cc (posix_fallocate): Define dummy version if not
12026 HAVE_POSIX_FALLOCATE.
12027 (Output_file::map): Call posix_fallocate rather than lseek and
12029 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
12030 * configure, Makefile.in, config.in: Rebuild.
12032 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
12034 * layout.h (Layout::create_note): Add section_name parameter.
12035 * layout.cc (Layout::create_note): Likewise.
12036 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
12038 2009-03-17 Ian Lance Taylor <iant@google.com>
12040 * descriptors.cc: Include "options.h".
12041 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
12042 (Descriptors::open): Always use O_CLOEXEC when opening a new
12043 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
12044 then set FD_CLOEXEC.
12046 * sparc.cc (class Target_sparc): Add has_got_section.
12047 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
12048 make sure we have a GOT section.
12050 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
12051 (Target_sparc::Scan::local): Likewise.
12052 (Target_sparc::Scan::global): Likewise.
12053 (Target_sparc::Relocate::relocate): Likewise.
12054 (Target_sparc::Relocate::relocate_tls): Likewise.
12056 * symtab.cc (Symbol_table::define_default_version): New function,
12057 broken out of add_from_object.
12058 (Symbol_table::add_from_object): Call define_default_version.
12059 (Symbol_table::define_special_symbol): Add resolve_oldsym
12060 parameter. Change all callers. If the version for a symbol comes
12061 from a version script, resolve it with the symbol with the same
12062 name with no version. Also add the symbol without a version if
12064 (do_define_in_output_data): If resolving with oldsym, don't delete
12066 (do_define_in_output_segment): Likewise.
12067 (do_define_as_constant): Likewise.
12068 * symtab.h (class Symbol_table): Update declarations.
12070 2009-03-13 Ian Lance Taylor <iant@google.com>
12072 * readsyms.cc (Read_symbols::incompatible_warning): New function.
12073 (Read_symbols::requeue): New function.
12074 (Read_symbols::do_read_symbols): If make_elf_object fails because
12075 the target type is not configured, and the file was searched for,
12076 issue a warning and retry with the next directory.
12077 (Add_symbols::run): If the file has an incompatible format, and
12078 it was searched for, requeue the Read_symbols task. On error,
12079 release the object.
12080 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
12081 dirindex parameter to constructor. Change all callers. Declare
12082 incompatible_warning and requeue.
12083 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
12084 input_argument_ and input_group_ fields. Add them to
12085 constructor. Change all callers.
12086 (class Read_script): Add dirindex_ field. Add it to constructor.
12087 Change all callers.
12088 * archive.cc (Archive::setup): Remove input_objects parameter.
12089 Change all callers.
12090 (Archive::get_file_and_offset): Likewise.
12091 (Archive::read_all_symbols): Likewise.
12092 (Archive::read_symbols): Likewise.
12093 (Archive::get_elf_object_for_member): Remove input_objects
12094 parameter. Add punconfigured parameter. Change all callers.
12095 (Archive::add_symbols): Change return type to bool. Check return
12096 value of include_member.
12097 (Archive::include_all_members): Likewise.
12098 (Archive::include_member): Change return type to bool. Return
12099 false if first included object has incompatible target. Set
12100 included_member_ field.
12101 (Add_archive_symbols::run): If add_symbols returns false, requeue
12103 * archive.h (class Archive): Add included_member_ field.
12104 Initialize it in constructor. Add input_file and searched_for
12105 methods. Update declarations.
12106 (class Add_archive_symbols): Add dirpath_, dirindex_, and
12107 input_argument_ fields. Add them to constructor. Change all
12109 * script.cc: Include "target-select.h".
12110 (class Parser_closure): Add skip_on_incompatible_target_ and
12111 found_incompatible_target_ fields. Add
12112 skip_on_incompatible_target parameter to constructor. Change all
12113 callers. Add methods skip_on_incompatible_target,
12114 clear_skip_on_incompatible_target, found_incompatible_target, and
12115 set_found_incompatible_target.
12116 (read_input_script): Add dirindex parameter. Change all callers.
12117 If parser finds an incompatible target, requeue Read_symbols
12119 (script_set_symbol): Clear skip_on_incompatible_target in
12121 (script_add_assertion, script_parse_option): Likewise.
12122 (script_start_sections, script_add_phdr): Likewise.
12123 (script_check_output_format): New function.
12124 * script.h (read_input_script): Update declaration.
12125 * script-c.h (script_check_output_format): Declare.
12126 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
12127 (ignore_cmd): Remove OUTPUT_FORMAT.
12128 * fileread.cc (Input_file::Input_file): Add explicit this.
12129 (Input_file::will_search_for): New function.
12130 (Input_file::open): Add pindex parameter. Change all callers.
12131 * fileread.h (class Input_file): Add input_file_argument method.
12132 Declare will_search_for. Update declarations.
12133 * object.cc (make_elf_object): Add punconfigured parameter.
12134 Change all callers.
12135 * object.h (class Object): Make input_file public. Add
12136 searched_for method.
12137 (make_elf_object): Update declaration.
12138 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
12140 * dirsearch.h (class Dirsearch): Update declaration.
12141 * options.h (class General_options): Add --warn-search-mismatch.
12142 * parameters.cc (Parameters::is_compatible_target): New function.
12143 * parameters.h (class Parameters): Declare is_compatible_target.
12144 * workqueue.cc (Workqueue::add_blocker): New function.
12145 * workqueue.h (class Workqueue): Declare add_blocker.
12147 * fileread.cc (Input_file::open): Remove options parameter.
12148 Change all callers.
12149 (Input_file::open_binary): Likewise.
12150 * script.cc (read_input_script): Likewise.
12151 * readsyms.h (class Read_symbols): Remove options_ field. Remove
12152 options parameter from constructor. Change all callers.
12153 (class Read_script): Likewise.
12154 * fileread.h (class Input_file): Update declarations.
12155 * script.h (read_input_script): Update declaration.
12157 2009-03-10 Nick Clifton <nickc@redhat.com>
12159 * po/es.po: New Spanish translation.
12161 2009-03-06 Cary Coutant <ccoutant@google.com>
12163 * options.cc (parse_short_option): Keep dash_z from registering itself.
12165 2009-03-03 Ian Lance Taylor <iant@google.com>
12168 * target-reloc.h (relocate_section): Pass output_section to
12170 * i386.cc (Target_i386::should_apply_static_reloc): Add
12171 output_section parameter. Change all callers.
12172 (Target_i386::Relocate::relocate): Add output_section parameter.
12173 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12174 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
12175 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
12176 * testsuite/two_file_shared.sh: New script.
12177 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
12178 (check_DATA): Add two_file_shared.dbg.
12179 (two_file_shared.dbg): New target.
12180 * testsuite/Makefile.in: Rebuild.
12182 2009-03-01 Ian Lance Taylor <iant@google.com>
12184 * configure.ac: Check for byteswap.h.
12185 * configure: Rebuild.
12186 * config.in: Rebuild.
12188 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
12190 * layout.cc (Layout::find_or_add_kept_section): New function.
12191 (Layout::add_comdat): Removed.
12192 * layout.h (struct Kept_section): Move out of class Layout.
12193 Remove trailing underscores from field names. Add group_sections
12194 field. Rename group_ field to is_group. Change all uses.
12195 (class Layout): Declare find_or_add_kept_section, not add_comdat.
12196 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
12197 comdat_groups_ field.
12198 (Sized_relobj::include_section_group): Use
12199 find_or_add_kept_section and Kept_section::group_sections.
12200 (Sized_relobj::include_linkonce_section): Likewise.
12201 * object.cc (class Sized_relobj): Don't define Comdat_group or
12202 Comdat_group_table. Remove find_comdat_group and
12203 add_comdat_group. Remove comdat_groups_ field.
12204 * plugin.cc (include_comdat_group): Use
12205 Layout::find_or_add_kept_section.
12207 2009-02-28 Ian Lance Taylor <iant@google.com>
12209 * README: --gc-sections and map files are now supported. Document
12210 some build requirements.
12213 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
12214 relocatable link set the value of the section symbol to zero.
12215 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
12216 relocatable link don't include the section address in the local
12219 2009-02-27 Ian Lance Taylor <iant@google.com>
12222 * options.h (class Search_directory): Add is_system_directory.
12223 (class General_options): Declare is_in_system_directory.
12224 * options.cc (get_relative_sysroot): Make static.
12225 (get_default_sysroot): Make static.
12226 (General_optoins::is_in_system_directory): New function.
12227 * fileread.cc (Input_file::is_in_system_directory): New function.
12228 * fileread.h (class Input_file): Declare is_in_system_directory.
12229 * object.h (class Object): Add is_in_system_directory.
12230 (class Input_objects): Remove system_library_directory_ field.
12231 * object.cc (Input_objects::add_object): Don't set
12232 system_library_directory_.
12233 (input_objects::found_in_system_library_directory): Remove.
12234 * symtab.cc (Symbol_table::write_globals): Remove input_objects
12235 parameter. Change all callers.
12236 (Symbol_table::sized_write_globals): Likewise.
12237 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
12238 Call Object::is_in_system_directory.
12239 * symtab.h (class Symbol_table): Update declarations.
12242 * descriptors.h (Open_descriptor): Add is_on_stack field.
12243 * descriptors.cc (Descriptors::open): If the descriptor is on the
12244 top of the stack, remove it. Initialize is_on_stack field.
12245 (Descriptors::release): Only add pod to stack if it is not on the
12247 (Descriptors::close_some_descriptor): Clear stack_next and
12248 is_on_stack fields.
12251 * output.cc (Output_section::find_starting_output_address): Rename
12252 from starting_output_address; add PADDR parameter; change return
12254 * output.h (class Output_section): Declare
12255 find_starting_output_address instead of starting_output_address.
12256 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
12257 section symbol for which we can't find a merge section.
12260 * symtab.cc (Symbol_table::add_from_object): If the visibility is
12261 hidden or internal, force the symbol to be local.
12262 * resolve.cc (Symbol::override_visibility): Define.
12263 (Symbol::override_base): Use override_visibility.
12264 (Symbol_table::resolve): Likewise.
12265 (Symbol::override_base_with_special): Likewise.
12266 (Symbol_table::override_with_special): If the visibility is hidden
12267 or internal, force the symbol to be local.
12268 * symtab.h (class Symbol): Add set_visibility and
12269 override_visibility.
12270 * testsuite/ver_test_1.sh: New file.
12271 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
12272 (check_DATA): Add ver_test_1.syms.
12273 (ver_test_1.syms): New target.
12274 * testsuite/Makefile.in: Rebuild.
12276 2009-02-25 Cary Coutant <ccoutant@google.com>
12278 * layout.cc (Layout::choose_output_section): Don't rename sections
12279 when using a linker script that has a SECTIONS clause.
12280 * Makefile.in: Regenerate.
12282 * testsuite/Makefile.am (script_test_5.sh): New test case.
12283 * testsuite/Makefile.in: Regenerate.
12284 * testsuite/script_test_5.cc: New file.
12285 * testsuite/script_test_5.sh: New file.
12286 * testsuite/script_test_5.t: New file.
12288 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
12290 * archive.cc (Archive::include_member): Update calls to add_symbols.
12291 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
12292 the Layout argument.
12293 * dynobj.h (do_add_symbols): Add the Layout argument.
12294 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
12296 * object.h (Object::add_symbols): Add the Layout argument.
12297 (Object::do_add_symbols): Add the Layout argument.
12298 (Sized_relobj::do_add_symbols): Add the Layout argument.
12299 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
12300 Unify the two versions.
12301 (Add_plugin_symbols): Remove.
12302 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
12303 (Sized_pluginobj::do_add_symbols): Unify the two versions.
12304 (Add_plugin_symbols): Remove.
12305 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
12306 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
12307 (Add_symbols::run): Make it work with Pulginobj.
12309 2009-02-06 Ian Lance Taylor <iant@google.com>
12311 * object.cc (Sized_relobj::do_layout): Make info message start
12312 with lower case letter.
12314 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
12316 * binary.cc: Fix file comment.
12318 * options.h (enum Incremental_disposition): Define.
12319 (class General_options): Add new options: --incremental,
12320 --incremental_changed, --incremental_unchanged,
12321 --incremental_unknown. Add incremental_disposition_ and
12322 implicit_incremental_ fields.
12323 (General_options::incremental_disposition): New function.
12324 (class Position_dependent_options): Add incremental_disposition
12326 (Position_dependent_options::copy_from_options): Set incremental
12328 * options.cc (General_options::parse_incremental_changed): New
12330 (General_options::parse_incremental_unchanged): New function.
12331 (General_options::parse_incremental_unknown): New function.
12332 (General_options::General_options): Initialize new fields
12333 incremental_disposition_ and implicit_incremental_.
12334 (General_options::finalize): Check for uasge of --incremental-*
12335 without --incremental.
12337 2009-02-06 Chris Demetriou <cgd@google.com>
12339 * gold.h (gold_undefined_symbol): Change to take only a Symbol
12340 pointer and to report location as the file name associated with
12342 (gold_undefined_symbol_at_location): New function to replace the
12343 old gold_undefined_symbol functionality.
12344 * target-reloc.h (relocate_section): Update to use
12345 gold_undefined_symbol_at_location.
12346 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12347 Call gold_undefined_symbol function rather than gold_error.
12348 * errors.h (Errors::undefined_symbol): Take location as a
12349 string, rather than calculating it from a relocation.
12350 * errors.cc (Errors::fatal): Print "fatal error:" before the
12352 (Errors::error, Errors::error_at_location): Print "error: "
12353 before the formatted message.
12354 (Errors::undefined_symbol): Take location as a string, rather
12355 than calculating it from a relocation.
12356 (gold_undefined_symbol_at_location): New function akin to
12357 old gold_undefined_symbol, calculates location from relocation.
12358 (gold_undefined_symbol): Change to take only a Symbol pointer
12359 and to report location as the file name associated with the symbol.
12360 * testsuite/debug_msg.sh: Update for changed error messages.
12361 * testsuite/undef_symbol.sh: Likewise.
12363 2009-02-04 Duncan Sands <baldrick@free.fr>
12366 * reduced_debug_output.h
12367 (Output_reduced_debug_abbrev_section::failed): Use format for
12369 (Output_reduced_debug_info_section::faild): Likewise.
12371 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
12373 * script.cc (Lazy_demangler): New class.
12374 (Version_script_info::get_symbol_version_helper): Demangle a
12377 2009-01-29 Cary Coutant <ccoutant@google.com>
12379 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
12381 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12383 2009-01-28 Ian Lance Taylor <iant@google.com>
12385 * version.cc (version_string): Bump to 1.9.
12387 * gold.h: Include <cstring> and <stdint.h>.
12388 * version.cc: Include <cstdio>.
12389 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
12391 * reduced_debug_output.cc (insert_into_vector): Rename from
12392 Insert_into_vector; change all callers. Use Swap_unaligned to
12393 avoid aliasing issue; remove union since it is unnecessary.
12395 2009-01-27 Sriraman Tallam <tmsriram@google.com>
12397 * Makefile.am (CCFILES): Add gc.cc.
12398 (HFILES): Add gc.h.
12399 * Makefile.in: Regenerate.
12400 * gold.cc (Gc_runner): New class.
12401 (queue_initial_tasks): Call garbage collection related tasks
12402 when corresponding options are invoked.
12403 (queue_middle_gc_tasks): New function.
12404 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
12405 processed early before laying out sections during garbage collection.
12406 * gold.h (queue_middle_gc_tasks): New function.
12407 (is_prefix_of): Move from "layout.cc".
12408 * i386.cc (Target_i386::gc_process_relocs): New function.
12409 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
12410 * main.cc (main): Create object of class "Garbage_collection".
12411 * object.cc (Relobj::copy_symbols_data): New function.
12412 (Relobj::is_section_name_included): New function.
12413 (Sized_relobj::do_layout): Allow this function to be called twice
12414 during garbage collection and defer layout of section during the
12416 * object.h (Relobj::get_symbols_data): New function.
12417 (Relobj::is_section_name_included): New function.
12418 (Relobj::copy_symbols_data): New function.
12419 (Relobj::set_symbols_data): New function.
12420 (Relobj::get_relocs_data): New function.
12421 (Relobj::set_relocs_data): New function.
12422 (Relobj::is_output_section_offset_invalid): New pure virtual function.
12423 (Relobj::gc_process_relocs): New function.
12424 (Relobj::do_gc_process_relocs): New pure virtual function.
12425 (Relobj::sd_): New data member.
12426 (Sized_relobj::is_output_section_offset_invalid): New function.
12427 (Sized_relobj::do_gc_process_relocs): New function.
12428 * options.h (General_options::gc_sections): Modify to not be a no-op.
12429 (General_options::print_gc_sections): New option.
12430 * plugin.cc (Plugin_finish::run): Remove function call to
12431 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
12432 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
12433 * reloc.cc (Read_relocs::run): Add task to process relocs and
12434 determine unreferenced sections when doing garbage collection.
12435 (Gc_process_relocs): New class.
12436 (Sized_relobj::do_gc_process_relocs): New function.
12437 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
12438 sections that are garbage collected.
12439 * reloc.h (Gc_process_relocs): New class.
12440 * sparc.cc (Target_sparc::gc_process_relocs): New function.
12441 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
12442 symbols whose corresponding sections are garbage collected.
12443 (Symbol_table::Symbol_table): Add new parameter for the garbage
12445 (Symbol_table::gc_mark_undef_symbols): New function.
12446 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12447 (Symbol_table::gc_mark_dyn_syms): New function.
12448 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
12450 (Symbol_table::add_from_object): Likewise.
12451 (Symbol_table::add_from_relobj): When building shared objects, do not
12452 treat externally visible symbols as garbage.
12453 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
12454 table information for static and relocatable links.
12455 * symtab.h (Symbol_table::set_gc): New function.
12456 (Symbol_table::gc): New function.
12457 (Symbol_table::gc_mark_undef_symbols): New function.
12458 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12459 (Symbol_table::gc_mark_dyn_syms): New function.
12460 (Symbol_table::gc_): New data member.
12461 * target.h (Sized_target::gc_process_relocs): New pure virtual
12463 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
12464 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
12466 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
12468 * options.h (General_options::gc_sections): Define as a no-op for now.
12469 (General_options::no_keep_memory): Ditto.
12470 (General_options::Bshareable): Define.
12471 * options.cc (General_options::finalize): Honor -Bshareable.
12473 2009-01-20 Andreas Schwab <schwab@suse.de>
12475 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
12476 read the value in the contents, since we don't use it. Use the
12477 template endianness when writing.
12478 (Relocate::relocate): Use it for R_PPC_REL16_HA.
12480 2009-01-19 Andreas Schwab <schwab@suse.de>
12482 * configure.tgt (powerpc64-*): Fix targ_obj.
12484 2009-01-15 Ian Lance Taylor <iant@google.com>
12486 * object.cc (Sized_relobj::write_local_symbols): Don't write out
12487 local symbols when stripping all symbols.
12489 2009-01-14 Cary Coutant <ccoutant@google.com>
12491 * output.cc (Output_reloc): Add explicit instantiations.
12493 2009-01-14 Cary Coutant <ccoutant@google.com>
12495 * archive.cc (Archive::get_elf_object_for_member): Remove call
12496 to File_read::claim_for_plugin.
12497 * descriptors.cc (Descriptors::open): Remove reference to
12499 (Descriptors::claim_for_plugin): Remove.
12500 * descriptors.h (Descriptors::claim_for_plugin): Remove.
12501 (Descriptors::is_claimed): Remove.
12502 (claim_descriptor_for_plugin): Remove.
12503 * fileread.cc (File_read::claim_for_plugin): Remove.
12504 * fileread.h (File_read::claim_for_plugin): Remove.
12505 (File_read::descriptor): Reopen descriptor if necessary.
12506 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
12507 (Plugin_manager::all_symbols_read): Add task parameter. Change
12509 (Plugin_manager::get_input_file): New function.
12510 (Plugin_manager::release_input_file): New function.
12511 (Pluginobj::Pluginobj): Add filesize parameter and initialize
12512 corresponding data member.
12513 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
12514 and pass to base constructor. Change all callers.
12515 (get_input_file, release_input_file): New functions.
12516 (make_sized_plugin_object): Add filesize parameter. Change all callers.
12517 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
12518 (Plugin_manager::all_symbols_read): Add task parameter.
12519 (Plugin_manager::get_input_file): New function.
12520 (Plugin_manager::release_input_file): New function.
12521 (Plugin_manager::task_): New data member.
12522 (Pluginobj::Pluginobj): Add filesize parameter.
12523 (Pluginobj::filename): New function.
12524 (Pluginobj::descriptor): New function.
12525 (Pluginobj::filesize): New function.
12526 (Pluginobj::filesize_): New data member.
12527 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
12528 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
12529 File_read::claim_for_plugin; use Object::unlock to unlock the file.
12531 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
12532 with archive libraries.
12533 * testsuite/Makefile.in: Regenerate.
12534 * testsuite/plugin_test.c (struct sym_info): New type.
12535 (get_input_file, release_input_file): New static variables.
12536 (onload): Capture new transfer vector entries.
12537 (claim_file_hook): Stop reading at end of file according to filesize.
12538 Factor out parsing of readelf output into separate function.
12539 (all_symbols_read_hook): Exercise get_input_file and release_input_file
12540 APIs and get the source file name from the symbol table. Convert
12541 source file name to corresponding object file name. Print info
12542 message when adding new input files.
12543 (parse_readelf_line): New function.
12544 * testsuite/plugin_test_1.sh: Add checks for new info messages.
12545 * testsuite/plugin_test_2.sh: Likewise.
12546 * testsuite/plugin_test_3.sh: Likewise.
12547 * testsuite/plugin_test_4.sh: New test case.
12549 2009-01-07 Ian Lance Taylor <iant@google.com>
12551 * version.cc (version_string): Bump to 1.8.
12553 2008-12-23 Cary Coutant <ccoutant@google.com>
12555 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
12556 * plugin.cc (Plugin_manager::finish): Rename as
12557 layout_deferred_objects. Move cleanup to separate function.
12558 (Plugin_manager::cleanup): New function.
12559 (Plugin_finish::run): Call layout_deferred_objects and cleanup
12561 * plugin.h (Plugin_manager::finish): Rename as
12562 layout_deferred_objects.
12563 (Plugin_manager::cleanup): New function.
12564 (Plugin_manager::cleanup_done): New field.
12566 2008-12-23 Cary Coutant <ccoutant@google.com>
12568 * plugin.cc (is_visible_from_outside): New function.
12569 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
12570 so we don't return "IR only" status for exported symbols or -r links.
12572 * testsuite/Makefile.am (plugin_test_3): New test case.
12573 * testsuite/Makefile.in: Regenerate.
12574 * testsuite/plugin_test_3.sh: New file.
12576 2008-12-22 Cary Coutant <ccoutant@google.com>
12578 * object.cc (Sized_relobj::layout_section): New function.
12579 (Sized_relobj::do_layout): Defer layout of input sections until after
12580 plugin has provided replacement files.
12581 (Sized_relobj::do_layout_deferred_sections): New function.
12582 * object.h (Relobj::set_section_offset): Remove virtual keyword.
12583 (Relobj::layout_deferred_sections): New function.
12584 (Relobj::do_layout_deferred_sections): New function.
12585 (Sized_relobj::do_layout_deferred_sections): New function.
12586 (Sized_relobj::layout_section): New function.
12587 (Sized_relobj::Deferred_layout): New structure.
12588 (Sized_relobj::deferred_layout_): New field.
12589 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
12590 Change all callers. Layout deferred sections.
12591 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
12593 (Plugin_hook::run): Move code from do_plugin_hook inline.
12594 (Plugin_hook::do_plugin_hook): Remove.
12595 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
12596 (Plugin_manager::finish): Renamed, was cleanup.
12597 (Plugin_manager::should_defer_layout): New function.
12598 (Plugin_manager::add_deferred_layout_object): New function.
12599 (Plugin_manager::Deferred_layout_list): New type.
12600 (Plugin_manager::deferred_layout_objects_): New field.
12601 (Plugin_hook::do_plugin_hook): Remove.
12603 2008-12-17 Ian Lance Taylor <iant@google.com>
12605 * options.h (class General_options): Add --no case for
12608 2008-12-16 Cary Coutant <ccoutant@google.com>
12610 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
12612 (Plugin_manager::claim_file): Create plugin object even if
12613 plugin did not call the add_symbols callback.
12614 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
12615 asking for more symbols than were added.
12616 * testsuite/Makefile.am (plugin_test_1): Add test case with
12618 (empty.syms): New target.
12619 * testsuite/Makefile.in: Regenerate.
12620 * testsuite/plugin_test.c (claim_file_hook): Add new debug
12621 message. Don't call add_symbols if no globals.
12622 (all_symbols_read_hook): Don't provide replacement for empty
12625 2008-12-12 Ian Lance Taylor <iant@google.com>
12627 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
12628 r_type == 0 for a local symbol with r_sym == 0.
12629 (scan_relocatable_relocs): Pass r_sym to
12630 local_non_section_strategy.
12631 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
12634 * configure.ac: Update test for TLS descriptors: they are
12635 supported as of glibc 2.9.
12636 * configure: Rebuild.
12638 2008-12-11 Ian Lance Taylor <iant@google.com>
12641 * target-reloc.h (Default_scan_relocatable_relocs): For each
12642 function, map r_type == 0 to RELOC_DISCARD.
12644 2008-12-10 Cary Coutant <ccoutant@google.com>
12646 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
12647 object to override a kept COMDAT group from a plugin object.
12649 2008-12-09 Ian Lance Taylor <iant@google.com>
12652 * yyscript.y (file_cmd): Handle INPUT.
12654 * testsuite/initpri1.c: Change all declarations to be full
12655 prototypes by adding void, to avoid compiler warnings.
12657 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
12659 * options.cc (General_options::parse_plugin_opt): New.
12660 (General_options::add_plugin): The argument now is just the filename.
12661 (General_options::add_plugin_option): New.
12662 * options.h (plugin_opt): New.
12663 (add_plugin): Change argument name.
12664 (add_plugin_option): New.
12665 * plugin.cc (Plugin::load): Don't parse the plugin option.
12666 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
12667 (Plugin::add_option): New.
12668 (Plugin::args_): Change type.
12669 (Plugin::filename_): New.
12670 (Plugin_manager::add_plugin_option): New.
12671 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
12672 * testsuite/Makefile.in: Regenerate.
12674 2008-12-05 Cary Coutant <ccoutant@google.com>
12676 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
12677 Handle --strip-lto-sections option.
12678 * options.h (strip_lto_sections): New option.
12680 2008-12-01 Cary Coutant <ccoutant@google.com>
12682 * plugin.cc (ld_plugin_message): Change format parameter to const.
12683 Fix mismatch between new[] and delete.
12685 2008-11-14 Cary Coutant <ccoutant@google.com>
12687 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
12690 2008-11-05 Craig Silverstein <csilvers@google.com>
12692 * options.cc (General_options::parse_dynamic_list): New function.
12693 * options.h (General_options): New flags dynamic_list,
12694 dynamic_list_data, dynamic_list_cpp_new, and
12695 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
12696 (General_options::in_dynamic_list): New function.
12697 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
12698 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
12699 (Lex::can_continue_name): Likewise.
12701 (read_script_file): New parameter script_options.
12702 (read_dynamic_list): New function.
12703 (Script_options::define_dynamic_list): New function.
12704 (dynamic_list_keyword_parsecodes): New variable.
12705 (dynamic_list_keywords): New variable.
12706 * script.h (Script_options::define_dynamic_list): New function
12708 (read_dynamic_list): New function prototype.
12709 * symtab.cc (strprefix): New macro.
12710 (Symbol::should_add_dynsym_entry): Support dynamic_list,
12711 dynamic_list_data, dynamic_list_cpp_new, and
12712 dynamic_list_cpp_typeinfo.
12713 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
12714 (dynamic_list_expr): New rule.
12715 (dynamic_list_nodes): Likewise.
12716 (dynamic_list_node): Likewise.
12717 * testsuite/Makefile.am (dynamic_list): New test.
12718 * testsuite/Makefile.in: Regenerated.
12719 * testsuite/dynamic_list.t: New file.
12720 * testsuite/dynamic_list.sh: New file.
12722 2008-11-05 Craig Silverstein <csilvers@google.com>
12724 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
12725 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
12726 (t11_last): Likewise.
12727 * testsuite/ver_test_6.c (main): Likewise.
12729 2008-10-07 Cary Coutant <ccoutant@google.com>
12731 * options.c (General_options::finalize): Add check for -static and
12733 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
12736 2008-10-02 Cary Coutant <ccoutant@google.com>
12738 * plugin.cc (make_sized_plugin_object): Fix conditional
12739 compilation to work when not all targets are enabled.
12741 2008-09-29 Cary Coutant <ccoutant@google.com>
12743 * archive.cc (Archive::get_file_and_offset): Use filename instead
12744 of name to get library path.
12745 (Archive::include_member): Unlock external member of a thin archive.
12747 * testsuite/Makefile.am (TEST_AR): New variable.
12748 (thin_archive_test_1): New test.
12749 (thin_archive_test_2): New test.
12750 * testsuite/Makefile.in: Regenerate.
12751 * testsuite/thin_archive_main.cc: New file.
12752 * testsuite/thin_archive_test_1.cc: New file.
12753 * testsuite/thin_archive_test_2.cc: New file.
12754 * testsuite/thin_archive_test_3.cc: New file.
12755 * testsuite/thin_archive_test_4.cc: New file.
12757 2008-09-29 Cary Coutant <ccoutant@google.com>
12759 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
12760 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
12762 (Sized_relobj::do_finalize_local_symbols): Likewise.
12763 (Sized_relobj::map_to_kept_section): Likewise.
12764 * object.h (Sized_relobj::invalid_address): New constant.
12765 (Sized_relobj::do_output_section_offset): Check for invalid_address
12767 * output.cc (Output_reloc::local_section_offset): Use constant
12768 invalid_address instead of -1U.
12769 (Output_reloc::get_address): Likewise.
12770 (Output_section::output_address): Change -1U to -1ULL.
12771 * output.h (Output_reloc::invalid_address): New constant.
12772 * reloc.cc (Sized_relobj::write_sections): Use constant
12773 invalid_address instead of -1U.
12774 (Sized_relobj::relocate_sections): Likewise.
12775 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
12776 values for merge sections.
12777 * target-reloc.h (relocate_for_relocatable): Use constant
12778 invalid_address instead of -1U.
12780 2008-09-19 Cary Coutant <ccoutant@google.com>
12782 Add plugin functionality for link-time optimization (LTO).
12783 * configure.ac (plugins): Add --enable-plugins option.
12784 * configure: Regenerate.
12785 * config.in: Regenerate.
12786 * Makefile.am (LIBDL): New variable.
12787 (CCFILES): Add plugin.cc.
12788 (HFILES): Add plugin.h.
12789 (ldadd_var): Add LIBDL.
12790 * Makefile.in: Regenerate.
12792 * archive.cc: Include "plugin.h".
12793 (Archive::setup): Don't preread archive symbols when using a plugin.
12794 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
12795 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
12797 (Archive::include_member): Add symbols from plugin objects.
12798 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
12799 * descriptors.cc (Descriptors::open): Check for file descriptors
12800 abandoned by plugins.
12801 (Descriptors::claim_for_plugin): New function.
12802 * descriptors.h (Descriptors::claim_for_plugin): New function.
12803 (Open_descriptor::is_claimed): New field.
12804 (claim_descriptor_for_plugin): New function.
12805 * fileread.cc (File_read::claim_for_plugin): New function.
12806 * fileread.h (File_read::claim_for_plugin): New function.
12807 (File_read::descriptor): New function.
12808 * gold.cc: Include "plugin.h".
12809 (queue_initial_tasks): Add task to call plugin hooks for generating
12811 * main.cc: Include "plugin.h".
12812 (main): Load plugin libraries.
12813 * object.h (Pluginobj): Declare.
12814 (Object::pluginobj): New function.
12815 (Object::do_pluginobj): New function.
12816 (Object::set_target): New function.
12817 * options.cc: Include "plugin.h".
12818 (General_options::parse_plugin): New function.
12819 (General_options::General_options): Initialize plugins_ field.
12820 (General_options::add_plugin): New function.
12821 * options.h (Plugin_manager): Declare.
12822 (General_options): Add --plugin option.
12823 (General_options::has_plugins): New function.
12824 (General_options::plugins): New function.
12825 (General_options::add_plugin): New function.
12826 (General_options::plugins_): New field.
12827 * plugin.cc: New file.
12828 * plugin.h: New file.
12829 * readsyms.cc: Include "plugin.h".
12830 (Read_symbols::do_read_symbols): Check for archive before checking
12831 for ELF file. Call plugin hooks to claim files.
12832 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
12833 from a real object file; force override when processing replacement
12835 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
12836 (Symbol::init_base_object): Likewise.
12837 (Symbol::init_base_output_data): Likewise.
12838 (Symbol::init_base_output_segment): Likewise.
12839 (Symbol::init_base_constant): Likewise.
12840 (Symbol::init_base_undefined): Likewise.
12841 (Symbol::output_section): Assert that object is not a plugin.
12842 (Symbol_table::add_from_pluginobj): New function.
12843 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
12845 (Symbol_table::sized_write_globals): Likewise.
12846 (Symbol_table::add_from_pluginobj): Instantiate template.
12847 * symtab.h (Sized_pluginobj): Declare.
12848 (Symbol::in_real_elf): New function.
12849 (Symbol::set_in_real_elf): New function.
12850 (Symbol::in_real_elf_): New field.
12851 (Symbol_table::add_from_pluginobj): New function.
12853 * testsuite/Makefile.am (AM_CFLAGS): New variable.
12854 (LIBDL): New variable.
12855 (LDADD): Add LIBDL.
12856 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
12857 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
12858 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
12859 (MOSTLYCLEANFILES): Likewise.
12860 * testsuite/Makefile.in: Regenerate.
12861 * testsuite/plugin_test.c: New file.
12862 * testsuite/plugin_test_1.sh: New file.
12863 * testsuite/plugin_test_2.sh: New file.
12865 2008-09-16 Ian Lance Taylor <iant@google.com>
12867 * target-reloc.h (relocate_section): Check whether a symbol is
12868 defined by the ABI before reporting an undefined symbol error.
12869 * target.h (Target::is_defined_by_abi): Make parameter const.
12870 (Target::do_is_defined_by_abi): Likewise.
12871 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
12872 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
12873 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
12874 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
12875 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
12876 * testsuite/Makefile.in: Rebuild.
12878 * fileread.cc (make_view): Add casts to avoid warning.
12880 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
12882 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
12883 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12885 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
12887 * options.h (General_options::output_is_executable): New.
12888 (General_options::output_is_pie): New.
12889 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
12890 for shared libraries.
12891 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12893 2008-09-11 Chris Demetriou <cgd@google.com>
12895 * options.h (origin): New -z option.
12896 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
12897 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
12900 2008-09-05 Cary Coutant <ccoutant@google.com>
12902 * fileread.cc (File_read::make_view): Add check for attempt to map
12903 beyond end of file.
12905 2008-09-05 Cary Coutant <ccoutant@google.com>
12907 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
12908 explicit instantiations.
12910 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
12913 * options.cc (General_options::finalize): Allow undefined symbols
12914 in shlibs if linking -shared.
12917 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
12918 symbols as not needing a dynsym entry.
12920 2008-08-20 Craig Silverstein <csilvers@google.com>
12922 * fileread.cc (File_read::open): Do not lock the file unless it
12923 was successfully opened.
12925 2008-08-14 Cary Coutant <ccoutant@google.com>
12927 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
12928 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
12929 * testsuite/tls_test.cc (struct int128): 128-bit struct
12930 for testing TLS relocs with non-zero addend.
12931 (v12): New TLS variable.
12933 (t_last): Add check for v12.
12934 * testsuite/tls_test.h (t12): New function.
12935 * testsuite/tls_test_main.cc (thread_routine): Call new test.
12937 2008-08-13 Ian Lance Taylor <iant@google.com>
12939 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
12940 set tls_segment_ or relro_segment_.
12941 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
12943 * output.h (Output_section::clear_is_relro): New function.
12944 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
12945 sections specially even when output_data_ is empty.
12946 (Output_segment::maximum_alignment): When first section is relro,
12947 only force alignment for PT_LOAD segments.
12948 * script.cc (script_data_segment_align): New function.
12949 (script_data_segment_relro_end): New function.
12950 * script-c.h (script_data_segment_align): Declare.
12951 (script_data_segment_relro_end): Declare.
12952 * script-sections.h (class Script_sections): Declare
12953 data_segment_align and data_segment_relro_end. Add fields
12954 segment_align_index_ and saw_relro_end_.
12955 * script-sections.cc (class Sections_element): Add set_is_relro
12956 virtual function. Add new bool* parameter to place_orphan_here.
12957 Add get_output_section virtual function.
12958 (class Output_section_definition): Add set_is_relro. Add new
12959 bool* parameter to place_orphan_here. Add get_output_section.
12960 Add is_relro_ field.
12961 (Output_section_definition::Output_section_definition): Initialize
12962 evaluated_address_, evaluated_load_address, evaluated_addralign_,
12963 and is_relro_ fields.
12964 (Output_section_definition::place_orphan_here): Add is_relro
12966 (Output_section_definition::set_section_addresses): Set relro for
12968 (Output_section_definition::alternate_constraint): Likewise.
12969 (class Orphan_output_section): Add new bool* parameter to
12970 place_orphan_here. Add get_output_section.
12971 (Orphan_output_section::place_orphan_here): Add is_relro
12973 (Script_sections::Script_sections): Initialize
12974 data_segment_align_index_ and saw_relro_end_.
12975 (Script_sections::data_segment_align): New function.
12976 (Script_sections::data_segment_relro_end): New function.
12977 (Script_sections::place_orphan): Set or clear is_relro.
12978 (Script_sections::set_section_addresses): Force alignment of first
12980 * yyscript.y (exp): Call script_data_segment_align and
12981 script_data_segment_relro_end.
12982 * testsuite/relro_script_test.t: New file.
12983 * testsuite/relro_test.cc (using_script): Declare.
12984 (t1, t2): Test using_script.
12985 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
12986 (relro_script_test_SOURCES): Define.
12987 (relro_script_test_DEPENDENCIES): Define.
12988 (relro_script_test_LDFLAGS): Define.
12989 (relro_script_test_LDADD): Define.
12990 (relro_script_test.so): New target.
12991 * testsuite/Makefile.in: Rebuild.
12993 2008-08-06 Cary Coutant <ccoutant@google.com>
12995 * archive.cc (Archive::total_archives, Archive::total_members)
12996 (Archive::total_members_loaded): New variables.
12997 (Archive::setup): Add parameter. Add option to preread
12999 (Archive::read_armap): Add counter.
13000 (Archive::get_file_and_offset): New function.
13001 (Archive::get_elf_object_for_member): New function.
13002 (Archive::read_all_symbols): New function.
13003 (Archive::read_symbols): New function.
13004 (Archive::add_symbols): Add counters.
13005 (Archive::include_all_members): Use armap to find members if it's
13007 (Archive::include_member): Skip reading symbols if already read.
13008 Factored code into Archive::get_file_and_offset and
13009 Archive::get_elf_object_for_member. Changed call to
13010 Mapfile::report_include_archive_member.
13011 (Archive::print_stats): New function.
13012 * archive.h: Declare Object and Read_symbols_data classes.
13013 (Archive::Archive): Add initializers for new members.
13014 (Archive::setup): Add parameter.
13015 (Archive::print_stats): New function.
13016 (Archive::total_archives, Archive::total_members)
13017 (Archive::total_members_loaded): New variables.
13018 (Archive::get_file_and_offset): New function.
13019 (Archive::get_elf_object_for_member): New function.
13020 (Archive::read_all_symbols): New function.
13021 (Archive::read_symbols): New function.
13022 (Archive::Archive_member): New class.
13023 (Archive::members_): New member.
13024 (Archive::num_members_): New member.
13025 * main.cc: Include archive.h.
13026 (main): Call Archive::print_stats.
13027 * mapfile.cc (Mapfile::report_include_archive_member): Delete
13028 archive parameter; member_name is now the fully-decorated name.
13029 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
13030 * options.h: (General_options): Add --preread-archive-symbols option.
13031 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
13034 2008-08-04 Ian Lance Taylor <iant@google.com>
13036 * symtab.h (Symbol::use_plt_offset): New function.
13037 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
13038 * powerpc.cc (Relocate::relocate): Likewise.
13039 * sparc.cc (Relocate::relocate): Likewise.
13040 * x86_64.cc (Relocate::relocate): Likewise.
13041 * testsuite/weak_plt.sh: New test.
13042 * testsuite/weak_plt_main.cc: New test.
13043 * testsuite/weak_plt_shared.cc: New test.
13044 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
13045 (check_PROGRAMS): Add weak_plt.
13046 (check_DATA): Add weak_plt_shared.so.
13047 (weak_plt_main_pic.o, weak_plt): New targets.
13048 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
13049 * testsuite/Makefile.in: Rebuild.
13051 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
13053 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
13054 * testsuite/Makefile.in: Rebuild.
13056 2008-08-04 Alan Modra <amodra@bigpond.net.au>
13058 * Makefile.am (POTFILES.in): Set LC_ALL=C.
13059 * Makefile.in: Regenerate.
13060 * po/POTFILES.in: Regenerate.
13062 2008-07-29 Ian Lance Taylor <iant@google.com>
13064 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
13065 symbols before other symbols.
13066 * testsuite/script_test_2.cc (test_addr): Declare.
13067 (test_addr_alias): Declare.
13068 (main): Check that test_addr and test_addr_alias have the right
13070 * testsuite/script_test_2.t: Define test_addr_alias and
13073 2008-07-24 Ian Lance Taylor <iant@google.com>
13076 * descriptors.cc: New file.
13077 * descriptors.h: New file.
13078 * gold-threads.h (class Hold_optional_lock): New class.
13079 * fileread.cc: Include "descriptors.h".
13080 (File_read::~File_read): Release descriptor rather than closing
13082 (File_read::open) [file]: Call open_descriptor rather than open.
13083 Set is_descriptor_opened_.
13084 (File_read::open) [memory]: Assert that descriptor is not open.
13085 (File_read::reopen_descriptor): New function.
13086 (File_read::release): Release descriptor.
13087 (File_read::do_read): Make non-const. Reopen descriptor.
13088 (File_read::read): Make non-const.
13089 (File_read::make_view): Reopen descriptor.
13090 (File_read::do_readv): Likewise.
13091 * fileread.h (class File_read): Add is_descriptor_opened_ field.
13092 Update declarations.
13093 * layout.cc: Include "descriptors.h".
13094 (Layout::create_build_id): Use open_descriptor rather than open.
13095 * output.cc: Include "descriptors.h".
13096 (Output_file::open): Use open_descriptor rather than open.
13097 * archive.cc (Archive::const_iterator): Change Archive to be
13099 (Archive::begin, Archive::end): Make non-const.
13100 (Archive::count_members): Likewise.
13101 * archive.h (class Archive): Update declarations.
13102 * object.h (Object::read): Make non-const.
13103 * Makefile.am (CCFILES): Add descriptors.cc.
13104 (HFILES): Add descriptors.h.
13105 * Makefile.in: Rebuild.
13108 * gold.h: Always include <clocale>. Add Solaris workarounds
13109 following code in binutils/sysdep.h.
13112 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
13113 this->eh_frame_hdr_ is NULL before using it.
13115 * dynobj.cc (Versions::Versions): Update comment.
13117 * dynobj.cc (Versions::Versions): If there is an soname, use it as
13118 the base version name.
13120 * stringpool.cc (Stringpool_template::add_with_length): Set key to
13121 array size plus one.
13122 (Stringpool_template::set_string_offsets): Subtract one from key
13123 before using it as an array index.
13124 (Stringpool_template::get_offset_with_length): Likewise.
13125 (Stringpool_template::write_to_buffer): Likewise.
13126 * stringpool.h (Stringpool_template::get_offset_from_key):
13129 2008-07-23 Ian Lance Taylor <iant@google.com>
13132 * object.h (Merged_symbol_value::value): Do our best to handle a
13136 * script.cc (Version_script_info::get_versions): Don't add empty
13137 version tag to return value.
13138 (Version_script_info::get_symbol_version_helper): Change return
13139 type to bool. Add pversion parameter. Change all callers.
13140 (script_register_vers_node): Don't require a non-NULL tag.
13141 * script.h (class Version_script_info): Update declarations.
13142 (Version_script_info::get_symbol_version): Change return type to
13143 bool. Add version parameter. Change all callers.
13144 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
13145 handling. Handle an empty version from a version script.
13146 (Symbol_table::define_special_symbol): Likewise.
13147 * testsuite/ver_test_10.script: New file.
13148 * testsuite/ver_test_10.sh: New file.
13149 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
13150 (check_DATA): Add ver_test_10.syms.
13151 (ver_test_10.syms, ver_test_10.so): New target.
13152 * testsuite/Makefile.in: Rebuild.
13154 2008-07-23 Simon Baldwin <simonb@google.com>
13156 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
13157 to zero for undefined symbols from dynamic libraries.
13159 2008-07-23 Ian Lance Taylor <iant@google.com>
13161 * symtab.cc (Symbol_table::resolve): Remove version parameter.
13162 Change all callers.
13163 * symtab.h (class Symbol_table): Update declaration.
13164 * testsuite/ver_test_9.cc: New file.
13165 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
13166 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
13167 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
13168 (ver_test_9.so, ver_test_9.o): New targets.
13169 * testsuite/Makefile.in: Rebuild.
13171 2008-07-22 Ian Lance Taylor <iant@google.com>
13173 * options.h (class General_options): Define --check-sections.
13174 * layout.cc (Layout::set_segment_offsets): Handle
13177 * options.h (class General_options): Define -n/--nmagic and
13179 * options.cc (General_options::finalize): For -n/--nmagic or
13180 -N/--omagic, set -static.
13181 * layout.cc (Layout::attach_allocated_section_to_segment): If
13182 -N/--omagic, don't put read-only and read-write sections in
13183 different segments.
13184 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
13185 finding a read-only segment.
13186 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
13187 don't set the minimum segment alignment to the common page size,
13188 and don't set the file offset to the address modulo the page size.
13189 * script-sections.cc (Script_sections::create_segments): If
13190 -n/--omagic, don't put read-only and read-write sections in
13191 different segments.
13193 * cref.cc: New file.
13194 * cref.h: New file.
13195 * options.h (class General_options): Add --print-symbol-counts.
13196 * main.cc (main): Issue defined symbol report if requested.
13197 * archive.cc (Archive::interpret_header): Make into a const member
13199 (Archive::add_symbols): Call Input_objects::archive_start and
13201 (Archive::const_iterator): Define new class.
13202 (Archive::begin, Archive::end): New functions.
13203 (Archive::include_all_members): Rewrite to use iterator.
13204 (Archive::count_members): New function.
13205 * archive.h (class Archive): Update declarations.
13206 (Archive::filename): New function.
13207 * object.cc: Include "cref.h".
13208 (Sized_relobj::Sized_relobj): Initialize defined_count_.
13209 (Sized_relobj::do_get_global_symbol_counts): New function.
13210 (Input_objects::add_object): Add object to cross-referencer.
13211 (Input_objects::archive_start): New function.
13212 (Input_objects::archive_stop): New function.
13213 (Input_objects::print_symbol_counts): New function.
13214 * object.h: Declare Cref and Archive.
13215 (Object::get_global_symbol_counts): New function.
13216 (Object::do_get_global_symbol_counts): New pure virtual function.
13217 (class Sized_relobj): Add defined_count_ field. Update
13219 (class Input_objects): Add cref_ field. Update constructor.
13220 Update declarations.
13221 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
13223 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
13225 (Sized_dynobj::do_get_global_symbol_counts): New function.
13226 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
13227 defined_count_. Update declarations. Define Symbols typedef.
13228 * symtab.cc (Symbol_table::add_from_relobj): Add defined
13229 parameter. Change all callers.
13230 (Symbol_table::add_from_dynobj): Add sympointers and defined
13231 parameters. Change all callers.
13232 * symtab.h (class Symbol_table): Update declarations.
13233 * Makefile.am (CCFILES): Add cref.cc.
13234 (HFILES): Add cref.h.
13235 * Makefile.in: Rebuild.
13237 2008-07-22 Simon Baldwin <simonb@google.com>
13239 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
13240 to zero when writing undefined symbols.
13242 2008-07-22 Ian Lance Taylor <iant@google.com>
13244 * output.cc (Output_section::add_input_section): Don't try to
13245 merge empty merge sections.
13247 2008-07-21 Craig Silverstein <csilvers@google.com>
13249 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13250 Include symbol version in error message.
13252 2008-07-20 Chris Demetriou <cgd@google.com>
13254 * configure.ac (gold_cv_c_random_seed): New configured variable.
13255 (RANDOM_SEED_CFLAGS): New substituted variable.
13256 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
13257 * configure: Rebuild.
13258 * Makefile.in: Likewise.
13259 * testsuite/Makefile.in: Likewise.
13261 2008-07-18 Ian Lance Taylor <iant@google.com>
13263 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
13264 where we see NAME/NULL and NAME/VERSION as separate symbols.
13265 * testsuite/ver_test_main.cc (main): Call t4.
13266 (t4, t4_2a): Define.
13267 * testsuite/ver_test_2.cc (t4_2): Define.
13268 * testsuite/ver_test_2.script: Put t4_2a in VER2.
13269 * testsuite/ver_test_4.cc (t4_2a): Define.
13270 * testsuite/ver_test_4.script: Put t4_2a in VER2.
13271 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
13273 2008-07-17 Ian Lance Taylor <iant@google.com>
13275 * dynobj.cc (Versions::add_def): If we give an error about a
13276 missing version, go ahead and create the version anyhow.
13278 2008-07-10 Ian Lance Taylor <iant@google.com>
13280 Handle output sections with more than 0x7fffffff bytes.
13281 * object.h (class Relobj): Change map_to_output_ to
13282 output_sections_, and just keep a section pointer. Change all
13283 uses. Move comdat group support to Sized_relobj.
13284 (Relobj::is_section_specially_mapped): Remove.
13285 (Relobj::output_section): Remove poff parameter. Change all
13287 (Relobj::output_section_offset): New function.
13288 (Relobj::set_section_offset): Rewrite.
13289 (Relobj::map_to_output): Remove.
13290 (Relobj::output_sections): New function.
13291 (Relobj::do_output_section_offset): New pure virtual function.
13292 (Relobj::do_set_section_offset): Likewise.
13293 (class Sized_relobj): Add section_offsets_ field. Add comdat
13294 group support from Relobj. Update declarations.
13295 (Sized_relobj::get_output_section_offset): New function.
13296 (Sized_relobj::do_output_section_offset): New function.
13297 (Sized_relobj::do_set_section_offset): New function.
13298 * object.cc (Relobj::output_section_address): Remove.
13299 (Sized_relobj::Sized_relobj): Initialize new fields.
13300 (Sized_relobj::include_section_group): Cast find_kept_object to
13302 (Sized_relobj::include_linkonce_section): Likewise.
13303 (Sized_relobj::do_layout): Use separate arrays for output section
13305 (Sized_relobj::do_count_local_symbols): Change map_to_output to
13307 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
13308 output_sections and section_offsets.
13309 (Sized_relobj::write_local_symbols): Likewise.
13310 (map_to_kept_section): Compute output address directly.
13311 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
13312 output_sections and section_offsets.
13313 (Sized_relobj::write_sections): Likewise.
13314 (Sized_relobj::relocate_sections): Likewise.
13315 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
13316 * output.h (class Output_reloc): Update declarations. Change
13317 u2_.relobj to Sized_relobj*.
13318 (class Output_data_reloc): Change add functions to use
13320 * output.cc (Output_reloc::Output_reloc): Change relobj to
13322 (Output_reloc::local_section_offset): Change return type to
13323 Elf_Addr. Use get_output_section_offset.
13324 (Output_reloc::get_address): Likewise.
13325 (Output_section::is_input_address_mapped): Don't call
13326 is_section_specially_mapped.
13327 (Output_section::output_offset): Likewise.
13328 (Output_section::output_address): Likewise.
13329 (Output_section::starting_output_address): Likewise.
13330 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
13331 parameter to Sized_relobj*.
13332 (Copy_relocs::need_copy_reloc): Likewise.
13333 (Copy_relocs::save): Likewise.
13334 * copy-relocs.h (class Copy_relocs): Update declarations.
13335 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
13336 Sized_relobj*. Change relobj_ field to Sized_relobj*.
13337 * target-reloc.h (relocate_for_relocatable): Change
13338 offset_in_output_section type to Elf_Addr. Change code that uses
13340 * layout.cc (Layout::layout): Always set *off.
13341 * mapfile.cc (Mapfile::print_input_section): Use
13342 output_section_offset.
13343 * i386.cc (Target_i386::copy_reloc): Change object parameter to
13345 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
13346 * sparc.cc (Target_sparc::copy_reloc): Likewise.
13347 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
13349 2008-07-03 Ian Lance Taylor <iant@google.com>
13351 * layout.cc (Layout::include_section): Do not discard unrecognized
13352 SHT_STRTAB sections.
13354 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
13356 * script.cc (Lex::can_continue_name): Make '?' allowable in
13357 version-script names.
13358 * testsuite/version_script.map: Change glob pattern to use '?'
13360 2008-06-30 Manish Singh <yosh@gimp.org>
13363 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
13366 2008-06-30 Ian Lance Taylor <iant@google.com>
13370 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
13371 versions]: Don't try to read the value in the contents, since we
13372 don't use it. Use the template endianness when writing.
13374 2008-06-25 Cary Coutant <ccoutant@google.com>
13376 * fileread.cc (File_read::make_view): Assert on zero-length view.
13377 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
13378 symbol table when there are no symbols to read.
13380 2008-06-23 Craig Silverstein <csilvers@google.com>
13382 * version.cc (version_string): Bump to 1.7
13384 2008-06-18 Craig Silverstein <csilvers@google.com>
13386 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
13387 constant 0xFFFF to type Valtype.
13388 (Powerpc_relocate_functions::rel16_ha): Likewise.
13390 2008-06-17 Ian Lance Taylor <iant@google.com>
13392 * output.h (Output_section::Input_section): Initialize p2align_ to
13393 zero for Output_section_data constructors.
13394 (Output_section::Input_section::addralign): If not an input
13395 section, return the alignment of the Output_section_data.
13396 * testsuite/copy_test.cc: New file.
13397 * testsuite/copy_test_1.cc: New file.
13398 * testsuite/copy_test_2.cc: New file.
13399 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
13400 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
13401 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
13402 (copy_test_1_pic.o, copy_test_1.so): New targets.
13403 (copy_test_2_pic.o, copy_test_2.so): New targets.
13404 * testsuite/Makefile.in: Rebuild.
13406 * script-sections.cc (Script_sections::place_orphan): Initialize
13407 local variable exact.
13409 2008-06-13 David Edelsohn <edelsohn@gnu.org>
13411 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
13413 2008-06-12 David Edelsohn <edelsohn@gnu.org>
13414 David S. Miller <davem@davemloft.net>
13416 * powerpc.cc: New file.
13417 * Makefile.am (TARGETSOURCES): Add powerpc.cc
13418 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
13419 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
13420 * Makefile.in: Rebuild.
13422 2008-06-09 Ian Lance Taylor <iant@google.com>
13424 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
13426 (throwing, orig_terminate): New static variables.
13427 (terminate_handler): New static function.
13428 (t2): Set terminate handler.
13430 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
13433 * binary.cc (Binary_to_elf::sized_convert): Fix .data
13436 2008-05-30 Cary Coutant <ccoutant@google.com>
13438 * archive.cc (Archive::include_all_members) Correct to step
13439 over symbol table and extended name table in thin archives.
13441 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
13444 * target-reloc.h (relocate_for_relocatable): Fix new_offset
13447 2008-05-28 Caleb Howe <cshowe@google.com>
13449 * reduced_debug_output.cc: New file.
13450 * reduced_debug_output.h: New file.
13451 * options.h (class General_options): Add --strip-debug-non-line.
13452 * options.cc (General_options::finalize): Add strip_debug_non_line
13453 to the strip heirarchy.
13454 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
13456 * layout.cc: Include "reduced_debug_output.h".
13457 (Layout::Layout): Initialize new fields.
13458 (line_only_debug_sections): New static array.
13459 (is_lines_only_debug_sections): New static inline function.
13460 (Layout::include_section): Handle --strip-debug-non-line.
13461 (Layout::make_output_section): If --strip-debug-non-line, build
13462 new output sections for .debug_abbrev and .debug_info.
13463 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
13464 gold. Warn about possible overflow.
13465 (read_signed_LEB_128): Likewise.
13466 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
13467 (read_signed_LEB_128): Declare.
13468 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
13469 (HFILES): Add reduced_debug_output.h.
13470 * Makefile.in: Rebuild.
13472 2008-05-21 Ian Lance Taylor <iant@google.com>
13474 * mapfile.cc: New file.
13475 * mapfile.h: New file.
13476 * options.h (class General_options): Add -M/--print-map and -Map.
13477 * options.cc (General_options::finalize): Make -M equivalent to
13479 * main.cc: Include <cstdio> and "mapfile.h".
13480 (main): Open mapfile if requested.
13481 * gold.cc (class Middle_runner): Add mapfile_ field. Update
13482 constructor. Change caller.
13483 (queue_initial_tasks): Add mapfile parameter. Change caller.
13484 (queue_middle_tasks): Likewise.
13485 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
13487 * archive.cc: Include "mapfile.h".
13488 (Archive::add_symbols): Add mapfile parameter. Change all
13489 callers. Pass mapfile, symbol, and reason to include_member.
13490 (Archive::include_all_members): Add mapfile parameter. Change all
13492 (Archive::include_member): Add mapfile, sym, and why parameters.
13493 Change all callers. Report inclusion to map file.
13494 * archive.h: Include "fileread.h".
13495 (class Archive): Update declarations.
13496 (Archive::file): New const method.
13497 (class Add_archive_symbols): Add mapfile_ field. Update
13498 constructor. Change all callers.
13499 * readsyms.h (class Read_symbols): Likewise.
13500 (class Finish_group): Likewise.
13501 (class Read_script): Likewise.
13502 * common.cc: Include "mapfile.h".
13503 (Symbol_table::allocate_commons): Add mapfile parameter. Change
13505 (Symbol_table::do_allocate_commons): Likewise.
13506 (Symbol_table::do_allocate_commons_list): Likewise. Report common
13507 symbol allocation to mapfile.
13508 * common.h (class Allocate_commons_task): Add mapfile_ field.
13509 Update constructor. Change all callers.
13510 * symtab.h (class Symbol_table): Update declarations.
13511 * layout.cc: Include "mapfile.h".
13512 (Layout_task_runner::run): Print information to mapfile.
13513 (Layout::create_gold_note): Change Output_data_fixed_space to
13514 Output_data_zero_fill.
13515 (Layout::create_build_id): Likewise.
13516 (Layout::print_to_mapfile): New function.
13517 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
13518 constructor. Change caller.
13519 (class Layout): Declare print_to_mapfile.
13520 * output.cc (Output_section::Input_section::print_to_mapfile): New
13522 (Output_section::add_input_section): If producing a map, always
13523 add to input_sections_ list.
13524 (Output_section::do_print_to_mapfile): New function.
13525 (Output_segment::print_sections_to_mapfile): New function.
13526 (Output_segment::print_section_list_to_mapfile): New function.
13527 * output.h: Include "mapfile.h".
13528 (Output_data::print_to_mapfile): New function.
13529 (Output_data::do_print_to_mapfile): New virtual function.
13530 (Output_segment_headers::do_print_to_mapfile): New function.
13531 (Output_file_header::do_print_to_mapfile): New function.
13532 (Output_data_const::do_print_to_mapfile): New function.
13533 (class Output_data_const_buffer): Add map_name_ field. Update
13534 constructor. Change all callers. Add do_print_to_mapfile
13536 (class Output_data_fixed_space): Likewise.
13537 (class Output_data_space): Likewise.
13538 (class Output_data_zero_fill): New class.
13539 (Output_data_strtab::do_print_to_mapfile): New function.
13540 (Output_data_reloc_base::do_print_to_mapfile): New function.
13541 (Output_relocatable_relocs::do_print_to_mapfile): New function.
13542 (Output_data_group::do_print_to_mapfile): New function.
13543 (Output_data_got::do_print_to_mapfile): New function.
13544 (Output_data_dynamic::do_print_to_mapfile): New function.
13545 (Output_symtab_xindex::do_print_to_mapfile): New function.
13546 (class Output_section): Declare do_print_to_mapflie. Declare
13547 print_to_mapfile in Input_section.
13548 (class Output_segment): Declare new functions.
13549 * object.h (Sized_relobj::symbol_count): New function.
13550 * script-sections.cc
13551 (Output_section_element_dot_assignment::set_section_addresses):
13552 Change Output_data_fixed_space to Output_data_zero_fill.
13553 (Output_data_expression::do_print_to_mapfile): New function.
13554 * script.cc (read_input_script): Add mapfile parameter. Change
13556 * script.h (read_input_script): Update declaration.
13557 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
13558 (Eh_frame::do_print_to_mapfile): New function.
13559 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
13560 (Output_merge_string::do_print_to_mapfile): New function.
13561 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
13563 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
13565 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
13567 * Makefile.am (CCFILES): Add mapfile.cc.
13568 (HFILES): Add mapfile.h.
13569 * Makefile.in: Rebuild.
13571 2008-05-19 Ian Lance Taylor <iant@google.com>
13573 * options.h (class General_options): Add -z relro.
13574 * layout.cc (Layout::Layout): Initialize relro_segment_.
13575 (Layout::add_output_section_data): Return the output section.
13576 (Layout::make_output_section): Rcognize relro sections and mark
13577 them appropriately.
13578 (Layout::attach_allocated_section_to_segment): Put relro sections
13579 in a PT_GNU_RELRO segment.
13580 (Layout::create_initial_dynamic_sections): Mark the .dynamic
13582 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
13584 (Layout::linkonce_mapping): Map d.rel.ro.local to
13585 .data.rel.ro.local.
13586 (Layout::output_section_name): Us .data.rel.ro.local for any
13587 section which begins with that.
13588 * layout.h (class Layout): Update add_output_section_data
13589 declaration. Add relro_segment_ field.
13590 * output.cc (Output_section::Output_section): Initialize is_relro_
13591 and is_relro_local_ fields.
13592 (Output_segment::add_output_section): Group relro sections.
13593 (Output_segment::is_first_section_relro): New function.
13594 (Output_segment::maximum_alignment): If there is a relro section,
13595 align the segment to the common page size.
13596 (Output_segment::set_section_addresses): Track whether we are
13597 looking at relro sections. If the last section is a relro
13598 section, align to the common page size.
13599 (Output_segment::set_section_list_addresses): Add in_relro
13600 parameter. Change all callers. Align to the page size when
13601 moving from relro to non-relro section.
13602 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
13604 * output.h (class Output_section): Add is_relro_ and
13605 is_relro_local_ fields.
13606 (Output_section::is_relro): New function.
13607 (Output_section::set_is_relro): New function.
13608 (Output_section::is_relro_local): New function.
13609 (Output_section::set_is_relro_local): New function.
13610 (class Output_segment): Update declarations.
13611 * i386.cc (Target_i386::got_section): Mark .got section as relro.
13612 * sparc.cc (Target_sparc::got_section): Likewise.
13613 * x86_64.cc (Target_x86_64::got_section): Likewise.
13614 * testsuite/relro_test_main.cc: New file.
13615 * testsuite/relro_test.cc: New file.
13616 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
13617 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
13618 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
13619 (relro_test.so, relro_test_pic.o): New targets.
13620 * testsuite/Makefile.in: Rebuild.
13622 2008-05-16 Ian Lance Taylor <iant@google.com>
13624 * output.cc (Output_segment::add_output_section): Remove front
13626 * output.h (class Output_segment): Remove
13627 add_initial_output_section and overloaded add_output_section.
13628 Update declaration of remaining add_output_section.
13629 * layout.cc (Layout::create_interp): Call add_output_section
13630 rather than add_initial_output_section.
13631 (Layout::finish_dynamic_section): Likewise.
13633 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
13634 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
13635 know the dynamic type.
13636 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
13637 field. Initialize it in constructor.
13638 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
13639 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
13640 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
13643 * output.cc (Output_reloc::get_address): Change return type to
13645 * output.h (class Output_reloc): Update get_address declaration.
13646 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
13647 for section addresses.
13649 2008-05-09 Ian Lance Taylor <iant@google.com>
13652 * gold.cc (gold_nomem): Use return value of write.
13654 2008-05-08 Ian Lance Taylor <iant@google.com>
13656 * symtab.c (Symbol::init_base_output_data): Add version
13657 parameter. Change all callers.
13658 (Symbol::init_base_output_segment): Likewise.
13659 (Symbol::init_base_constant): Likewise.
13660 (Symbol::init_base_undefined): Likewise.
13661 (Sized_symbol::init_output_data): Likewise.
13662 (Sized_symbol::init_output_segment): Likewise.
13663 (Sized_symbol::init_constant): Likewise.
13664 (Sized_symbol::init_undefined): Likewise.
13665 (Symbol_table::do_define_in_output_data): If the new symbol has a
13666 version, mark it as the default.
13667 (Symbol_table::do_define_in_output_segment): Likewise.
13668 (Symbol_table::do_define_as_constant): Likewise.
13669 * symtab.h (class Symbol): Update declarations.
13670 (class Sized_symbol): Likewise.
13671 * resolve.cc (Symbol::override_version): New function.
13672 (Symbol::override_base): Call override_version.
13673 (Symbol::override_base_with_special): Likewise.
13674 * testsuite/ver_script_8.script: New file.
13675 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
13676 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
13677 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
13678 (ver_test_8_1.so, ver_test_8_2.so): New targets.
13680 2008-05-06 Ian Lance Taylor <iant@google.com>
13683 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
13685 (class General_options): Remove existing --undefined, and add
13686 --no-undefined instead. Add new --undefined as synonym for -u.
13687 * archive.cc (Archive::add_symbols): Check whether symbol was
13689 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
13690 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
13691 all uses. Add IS_UNDEFINED. Update declarations to split
13692 different versions of init_base. Declare init_base_undefined.
13693 (Symbol::is_defined): Handle IS_UNDEFINED.
13694 (Symbol::is_undefined): Likewise.
13695 (Symbol::is_weak_undefined): Call is_undefined.
13696 (Symbol::is_absolute): Handle IS_CONSTANT.
13697 (class Sized_symbol): Update declarations to split different
13698 versions of init. Declare init_undefined.
13699 (class Symbol_table): Declare new functions.
13700 * symtab.cc (Symbol::init_base_object): Rename from init_base.
13701 Change all callers.
13702 (Symbol::init_base_output_data): Likewise.
13703 (Symbol::init_base_output_segment): Likewise.
13704 (Symbol::init_base_constant): Likewise.
13705 (Symbol::init_base_undefined): New function.
13706 (Sized_symbol::init_object): Rename from init. Change all
13708 (Sized_symbol::init_output_data): Likewise.
13709 (Sized_symbol::init_output_segment): Likewise.
13710 (Sized_symbol::init_constant): Likewise.
13711 (Sized_symbol::init_undefined): New function.
13712 (Symbol_table::add_undefined_symbols_from_command_line): New
13714 (Symbol_table::do_add_undefined_symbols_from_command_line): New
13716 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
13717 (Symbol::output_section): Likewise.
13718 (Symbol::set_output_section): Likewise.
13719 (Symbol_table::sized_finalize_symbol): Likewise.
13720 (Symbol_table::sized_write_globals): Likewise.
13721 * resolve.cc (Symbol_table::should_override): Likewise.
13722 (Symbol::override_base_with_special): Likewise.
13724 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
13725 symbol, change it to have default visibility.
13726 * testsuite/protected_1.cc: New file.
13727 * testsuite/protected_2.cc: New file.
13728 * testsuite/protected_3.cc: New file.
13729 * testsuite/protected_main_1.cc: New file.
13730 * testsuite/protected_main_2.cc: New file.
13731 * testsuite/protected_main_3.cc: New file.
13732 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
13733 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
13734 (protected_1_LDFLAGS, protected_1_LDADD): Define.
13735 (protected_1.so): New target.
13736 (protected_1_pic.o, protected_2_pic.o): New targets.
13737 (protected_3_pic.o): New target.
13738 (check_PROGRAMS): Add protected_2.
13739 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
13740 (protected_2_LDFLAGS, protected_2_LDADD): Define.
13741 * testsuite/Makefile.in: Rebuild.
13743 * options.h (DEFINE_var): Add set_user_set_##varname__.
13744 (DEFINE_bool_alias): New macro.
13745 (class General_options): Define -Bstatic using DEFINE_bool_alias
13746 rather than DEFINE_special. Add --undefined as an alias for -z
13748 * options.cc (General_options::parse_Bstatic): Remove.
13750 * options.h (class General_options): Add --fatal-warnings.
13751 * main.cc (main): Implement --fatal-warnings.
13752 * errors.h (Errors::warning_count): New function.
13754 * options.h (class General_options): Add -Bsymbolic-functions.
13755 * symtab.h (Symbol::is_preemptible): Check for
13756 -Bsymbolic-functions.
13758 2008-05-05 Ian Lance Taylor <iant@google.com>
13760 * options.h (DEFINE_bool): For DASH_Z, create the negative option
13761 as noVARNAME rather than no-VARNAME.
13762 (class General_options): Add option -z combreloc.
13763 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
13765 (Output_reloc::sort_before) [SHT_REL]: New function.
13766 (Output_reloc::sort_before) [SHT_RELA]: New function.
13767 (class Output_data_reloc_base): Add sort_relocs_ field. Define
13768 Sort_relocs_comparison.
13769 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
13770 parameter. Change all callers.
13771 (Output_data_reloc::Output_data_reloc) [both versions]: Add
13772 sort_relocs parameter. Change all callers.
13773 * output.cc (Output_reloc::get_address): New function, broken out
13775 (Output_reloc::write_rel): Call it.
13776 (Output_reloc::compare): New function.
13777 (Output_data_reloc_base::do_write): Optionally sort relocs.
13779 * configure.ac: If targ_extra_obj is set, link it in.
13780 * configure.tgt: Initialize all variables.
13781 (x86_64*): Set targ_extra_obj and targ_extra_size.
13782 * configure: Rebuild.
13784 * object.cc (Sized_relobj::include_section_group): Adjust section
13785 indexes read from group data. Build vector to pass to
13787 * layout.cc (Layout::layout_group): Add flags and shndxes
13788 parameters. Remove contents parameter. Change caller. Update
13789 explicit instantiations.
13790 * layout.h (class Layout): Update layout_group declaration.
13791 * output.cc (Output_data_group::Output_data_group): Add flags and
13792 input_shndxes parameters. Remove contents parameter. Change
13794 (Output_data_group::do_write): Change input_sections_ to
13796 * output.h (class Output_data_group): Update constructor
13797 declaration. Rename input_sections_ to input_shndxes_.
13798 * testsuite/many_sections_test.cc: Add template.
13800 2008-04-30 Cary Coutant <ccoutant@google.com>
13802 * target-reloc.h (relocate_section): Fix dead-pointer bug.
13804 * layout.cc (Layout::include_section): Refactored check for debug
13806 (Layout::add_comdat): Add new parameters. Change type
13807 of signature parameter. Add object and shndx to signatures table.
13808 (Layout::find_kept_object): New function.
13809 * layout.h: Include <cstring>.
13810 (Layout::is_debug_info_section): New function.
13811 (Layout::add_comdat): Add new parameters.
13812 (Layout::find_kept_object): New function.
13813 (Layout::Kept_section): New struct.
13814 (Layout::Signatures): Change type of map range.
13815 * object.cc (Relobj::output_section_address): New function.
13816 (Sized_relobj::include_section_group): Add new parameters. Change
13817 calls to Layout::add_comdat. Change to build table of kept comdat
13818 groups and table mapping discarded sections to kept sections.
13819 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
13820 (Sized_relobj::do_layout): Change calls to include_section_group and
13821 include_linkonce_section.
13822 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
13823 value to zero when section is discarded.
13824 (Sized_relobj::map_to_kept_section): New function.
13825 * object.h (Relobj::output_section_address): New function.
13826 (Relobj::Comdat_group): New type.
13827 (Relobj::find_comdat_group): New function.
13828 (Relobj::Comdat_group_table): New type.
13829 (Relobj::Kept_comdat_section): New type.
13830 (Relobj::Kept_comdat_section_table): New type.
13831 (Relobj::add_comdat_group): New function.
13832 (Relobj::set_kept_comdat_section): New function.
13833 (Relobj::get_kept_comdat_section): New function.
13834 (Relobj::comdat_groups_): New field.
13835 (Relobj::kept_comdat_sections_): New field.
13836 (Symbol_value::input_value): Update comment.
13837 (Sized_relobj::map_to_kept_section) New function.
13838 (Sized_relobj::include_linkonce_section): Add new parameter.
13839 * target-reloc.h (Comdat_behavior): New type.
13840 (get_comdat_behavior): New function.
13841 (relocate_section): Add code to map a discarded section to the
13842 corresponding kept section when applying a relocation.
13844 2008-04-30 Craig Silverstein <csilvers@google.com>
13846 * dwarf_reader.cc (next_generation_count): New static var.
13847 (Addr2line_cache_entry): New struct.
13848 (addr2line_cache): New static var.
13849 (Dwarf_line_info::one_addr2line): Added caching.
13850 (Dwarf_line_info::clear_addr2line_cache): New function.
13851 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
13852 cache-size parameter.
13853 (Dwarf_line_info::one_addr2line_cache): New function.
13854 * symtab.cc (Symbol_table::detect_odr_violations): Pass
13855 new cache-size argument to one_addr2line(), and clear cache.
13857 2008-04-28 Cary Coutant <ccoutant@google.com>
13859 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
13860 R_386_PC8 relocations.
13862 2008-04-23 Ian Lance Taylor <iant@google.com>
13864 * object.cc (Sized_relobj::include_section_group): Check for
13865 invalid section group.
13867 * object.cc (make_elf_object): Correct test for 64-bit ELF file
13870 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
13871 than read for file header.
13872 * archive.cc (Archive::include_member): Likewise.
13874 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
13876 * aclocal.m4: Regenerate.
13877 * configure: Regenerate.
13879 2008-04-19 Ian Lance Taylor <iant@google.com>
13881 * version.cc (version_string): Bump to 1.6.
13883 * testsuite/Makefile.am (many_sections_r_test): New target.
13884 (many_sections_r_test_SOURCES): Remove.
13885 (many_sections_r_test_DEPENDENCIES): Remove.
13886 (many_sections_r_test_LDFLAGS): Remove.
13887 (many_sections_r_test_LDADD): Remove.
13889 * object.cc (Sized_relobj::do_add_symbols): Always pass
13890 local_symbol_count_ to add_from_relobj.
13892 * testsuite/Makefile.am (many_sections_check.h): Only check one in
13893 every thousand variables.
13894 * testsuite/Makefile.in: Rebuild.
13896 * object.cc (Xindex::initialize_symtab_xindex): New function.
13897 (Xindex::read_symtab_xindex): New function.
13898 (Xindex::sym_xindex_to_shndx): New function.
13899 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
13901 (Sized_relobj::do_initialize_xindex): New function.
13902 (Sized_relobj::do_read_symbols): Adjust section links.
13903 (Sized_relobj::symbol_section_and_value): Add is_ordinary
13904 parameter. Change all callers.
13905 (Sized_relobj::include_section_group): Adjust section links and
13906 symbol section indexes.
13907 (Sized_relobj::do_layout): Adjust section links.
13908 (Sized_relobj::do_count_local_symbols): Adjust section links and
13909 symbol section indexes.
13910 (Sized_relobj::do_finalize_local_symbols): Distinguish between
13911 ordinary and special symbols.
13912 (Sized_relobj::write_local_symbols): Add symtab_xindex and
13913 dynsym_xindex parameters. Change all callers. Adjust section
13914 links. Use SHN_XINDEX when needed.
13915 (Sized_relobj::get_symbol_location_info): Adjust section links.
13916 Don't get fooled by special symbols.
13917 * object.h (class Xindex): Define.
13918 (class Object): Add xindex_ parameter. Declare virtual functoin
13919 do_initialize_xindex.
13920 (Object::adjust_sym_shndx): New function.
13921 (Object::set_xindex): New protected function.
13922 (class Symbol_value): Add is_ordinary_shndx_ field.
13923 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
13924 (Symbol_value::value): Assert ordinary section.
13925 (Symbol_value::initialize_input_to_output_map): Likewise.
13926 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
13927 Change all callers.
13928 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
13930 (class Sized_relobj): Update declarations.
13931 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
13932 parameter. Change all callers.
13933 (Sized_relobj::adjust_shndx): New function.
13934 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
13936 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
13937 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
13938 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
13939 (Sized_dynobj::read_dynsym_section): Adjust section links.
13940 (Sized_dynobj::read_dynamic): Likewise.
13941 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
13943 (Sized_dynobj::do_initialize_xindex): New function.
13944 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
13945 do_initialize_xindex.
13946 (Sized_dynobj::adjust_shndx): New function.
13947 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
13948 dynsym_xindex_ fields.
13949 (Layout::finalize): Add a call to set_section_indexes before
13950 creating the symtab sections.
13951 (Layout::set_section_indexes): Don't do anything if the section
13952 already has a section index.
13953 (Layout::create_symtab_sections): Add shnum parameter. Change
13954 caller. Create .symtab_shndx section if needed.
13955 (Layout::create_shdrs): Add shstrtab_section parameter. Change
13957 (Layout::allocated_output_section_count): New function.
13958 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
13960 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
13961 fields. Update declarations.
13962 (Layout::symtab_xindex): New function.
13963 (Layout::dynsym_xindex): New function.
13964 (class Write_symbols_task): Add layout_ field.
13965 (Write_symbols_task::Write_symbols_task): Add layout parameter.
13967 * output.cc (Output_section_headers::Output_section_headers): Add
13968 shstrtab_section parameter. Change all callers.
13969 (Output_section_headers::do_sized_write): Store overflow values
13970 for section count and section string table section index in
13971 section header zero.
13972 (Output_file_header::do_sized_write): Check for overflow of
13973 section count and section string table section index.
13974 (Output_symtab_xindex::do_write): New function.
13975 (Output_symtab_xindex::endian_do_write): New function.
13976 * output.h (class Output_section_headers): Add shstrtab_section_.
13977 Update declarations.
13978 (class Output_symtab_xindex): Define.
13979 (Output_section::has_out_shndx): New function.
13980 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
13982 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
13983 Change all callers.
13984 (Sized_symbol::init): Likewise.
13985 (Symbol::output_section): Check for ordinary symbol.
13986 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
13987 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
13989 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
13990 Change all callers. Simplify handling of symbols from sections
13991 not included in the link.
13992 (Symbol_table::add_from_dynobj): Handle ordinary symbol
13994 (Weak_alias_sorter::operator()): Assert that symbols are
13996 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
13998 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
13999 parameters. Change all callers.
14000 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
14001 symbol distinction. Use SHN_XINDEX when needed.
14002 (Symbol_table::write_section_symbol): Add symtab_xindex
14003 parameter. Change all callers.
14004 (Symbol_table::sized_write_section_symbol): Likewise. Use
14005 SHN_XINDEX when needed.
14006 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
14008 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
14009 (Symbol::is_defined): Check is_ordinary.
14010 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
14011 (Symbol::is_absolute, Symbol::is_common): Likewise.
14012 (class Sized_symbol): Update declarations.
14013 (class Symbol_table): Update declarations.
14014 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
14015 parameters. Change all callers.
14016 (Sized_symbol::override): Likewise.
14017 (Symbol_table::override): Likewise.
14018 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
14019 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
14020 is_ordinary, and orig_st_shndx parameters. Change all callers.
14021 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
14022 to be in an ordinary section.
14023 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
14024 object and is_ordinary parameters. Change all callers.
14025 (Sized_dwarf_line_info::read_relocs): Add object parameter.
14026 Change all callers. Don't add undefined or non-ordinary symbols
14028 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
14029 Change all callers.
14030 * dwarf_reader.h (class Sized_dwarf_line_info): Update
14032 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
14033 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
14034 (Sized_relobj::relocate_sections): Likewise.
14035 * target-reloc.h (scan_relocs): Adjust section symbol index.
14036 (scan_relocatable_relocs): Likewise.
14037 * i386.cc (Scan::local): Check for ordinary symbols.
14038 * sparc.cc (Scan::local): Likewise.
14039 * x86_64.cc (Scan::local): Likewise.
14040 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
14041 to symbol_section_and_value.
14042 * testsuite/many_sections_test.cc: New file.
14043 * testsuite/Makefile.am (BUILT_SOURCES): Define.
14044 (check_PROGRAMS): Add many_sections_test.
14045 (many_sections_test_SOURCES): Define.
14046 (many_sections_test_DEPENDENCIES): Define.
14047 (many_sections_test_LDFLAGS): Define.
14048 (BUILT_SOURCES): Add many_sections_define.h.
14049 (many_sections_define.h): New target.
14050 (BUILT_SOURCES): Add many_sections_check.h.
14051 (many_sections_check.h): New target.
14052 (check_PROGRAMS): Add many_sections_r_test.
14053 (many_sections_r_test_SOURCES): Define.
14054 (many_sections_r_test_DEPENDENCIES): Define.
14055 (many_sections_r_test_LDFLAGS): Define.
14056 (many_sections_r_test_LDADD): Define.
14057 (many_sections_r_test.o): New target.
14058 * testsuite/Makefile.in: Rebuild.
14060 2008-04-17 Cary Coutant <ccoutant@google.com>
14062 * errors.cc (Errors::info): New function.
14063 (gold_info): New function.
14064 * errors.h (Errors::info): New function.
14065 * gold.h (gold_info): New function.
14066 * object.cc (Input_objects::add_object): Print trace output.
14067 * options.cc (options::parse_set): New function.
14068 (General_options::parse_wrap): Deleted.
14069 (General_options::General_options): Deleted initializer.
14070 * options.h (options::String_set): New typedef.
14071 (options::parse_set): New function.
14072 (DEFINE_set): New macro.
14073 (General_options::wrap): Changed to use DEFINE_set. Changed
14074 callers of any_wrap_symbols and is_wrap_symbol.
14075 (General_options::trace, General_options::trace_symbol):
14077 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
14078 (General_options::wrap_symbols_): Deleted.
14079 * symtab.cc (Symbol_table::add_from_object): Print trace output.
14081 2008-04-17 David S. Miller <davem@davemloft.net>
14083 * options.cc (General_options::parse_V): New function.
14084 * options.h: Add entries for -V and -Qy.
14086 2008-04-17 Ian Lance Taylor <iant@google.com>
14088 * common.cc (Symbol_table::allocate_commons): Remove options
14089 parameter. Change caller.
14090 (Symbol_table::do_allocate_commons): Remove options parameter.
14091 Change caller. Just call do_allocate_commons_list twice.
14092 (Symbol_table::do_allocate_commons_list): New function, broken out
14093 of do_allocate_commons.
14094 * common.h (class Allocate_commons_task): Remove options_ field.
14095 Update constructor.
14096 * symtab.cc (Symbol_table::Symbol_table): Initialize
14098 (Symbol_table::add_from_object): Put TLS common symbols on
14100 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
14101 which are IN_OUTPUT_DATA.
14102 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
14103 allocate_commons and do_allocate_commons declarations. Declare
14104 do_allocate_commons_list.
14105 * gold.cc (queue_middle_tasks): Update creation of
14106 Allocate_commons_task to not pass options.
14107 * testsuite/Makefile.am (INCLUDES): Add -I.. .
14108 (TLS_TEST_C_FLAGS): New variable.
14109 (tls_test_c_pic.o): New target.
14110 (tls_test_shared.so): Link in tls_test_c_pic.o.
14111 (tls_test_c_pic_ie.o): New target.
14112 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
14113 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
14114 (tls_test_c.o): New target.
14115 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
14116 (tls_pic_test_LDADD): Likewise.
14117 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
14118 (tls_shared_gd_to_ie_test_LDADD): Likewise.
14119 (tls_test_c_gnu2.o): New target.
14120 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
14122 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
14123 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
14124 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
14125 * testsuite/tls_test.cc: Include "config.h".
14126 (t_last): Call t11_last.
14127 * testsuite/tls_test.h (t11, t11_last): Declare.
14128 * testsuite/tls_test_c.c: New file.
14129 * testsuite/tls_test_main.cc (thread_routine): Call t11.
14130 * configure.ac: Check for OpenMP support.
14131 * configure, config.in, Makefile.in: Rebuild.
14132 * testsuite/Makefile.in: Rebuild.
14134 2008-04-16 Cary Coutant <ccoutant@google.com>
14136 * i386.cc (Target_i386::define_tls_base_symbol): New function.
14137 (Target_i386::tls_base_symbol_defined_): New field.
14138 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14139 (Target_i386::Scan::global): Likewise.
14140 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
14141 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
14142 (Target_x86_64::tls_base_symbol_defined_): New field.
14143 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14144 (Target_x86_64::Scan::global): Likewise.
14146 2008-04-16 Cary Coutant <ccoutant@google.com>
14148 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
14149 (Symbol::needs_plt_entry): Allow weak undefined symbols.
14150 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
14151 building shared libraries.
14152 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
14153 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
14154 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
14155 * testsuite/Makefile.in: Rebuild.
14156 * testsuite/weak_undef.h: New file.
14157 * testsuite/weak_undef_file1.cc: Add extra test cases.
14158 * testsuite/weak_undef_file2.cc: Likewise.
14159 * testsuite/weak_undef_test.cc: Likewise.
14161 2008-04-16 David S. Miller <davem@davemloft.net>
14163 * sparc.cc (Target_sparc::Scan): Change from struct to class.
14164 Add issued_non_pic_error_ field. Declare check_non_pic.
14165 (Target_sparc::Scan::check_non_pic): New function.
14166 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
14167 (Target_sparc::Scan::global): Likewise.
14169 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
14170 * configure: Rebuild.
14172 * options.h (DEFINE_enable): New macro.
14173 (new_dtags): New enable option.
14174 (initfirst, interpose, loadfltr, nodefaultlib,
14175 nodelete, nodlopen, nodump): New -z options.
14176 * layout.cc (Layout:finish_dynamic_section): If new
14177 dtags enabled, emit DT_RUNPATH. Also, emit a
14178 DT_FLAGS_1 containing any specified -z flags.
14180 2008-04-16 Ian Lance Taylor <iant@google.com>
14182 * copy-relocs.cc: New file.
14183 * copy-relocs.h: New file.
14184 * reloc.cc: Remove Copy_relocs code.
14185 * reloc.h: Likewise.
14186 * reloc-types.h (struct Reloc_types) [both versions]: Add
14187 get_reloc_addend_noerror.
14188 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
14189 variants of add_global which take an addend which must be zero.
14190 * i386.cc: Include "copy-relocs.h".
14191 (class Target_i386): Change type of copy_relocs_ to variable,
14192 update initializer.
14193 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
14194 Change all callers.
14195 (Target_i386::do_finalize_sections): Change handling of
14197 * sparc.cc: Include "copy-relocs.h".
14198 (class Target_sparc): Change type of copy_relocs_ to variable,
14199 update initializer.
14200 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
14201 Change all callers.
14202 (Target_sparc::do_finalize_sections): Change handling of
14204 * x86_64.cc: Include "copy-relocs.h".
14205 (class Target_x86_64): Change type of copy_relocs_ to variable,
14206 update initializer.
14207 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
14208 class. Change all callers.
14209 (Target_x86_64::do_finalize_sections): Change handling of
14211 * Makefile.am (CCFILES): Add copy-relocs.cc.
14212 (HFILES): Add copy-relocs.h.
14214 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
14216 * testsuite/script_test_4.sh: Permit leading zeroes.
14218 2008-04-15 Ian Lance Taylor <iant@google.com>
14220 * script-sections.cc (Script_sections::create_segments): Use
14221 header_size_adjustment even when there is enough room for the
14223 * testsuite/script_test_4.sh: New file.
14224 * testsuite/script_test_4.t: New file.
14225 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
14226 (check_DATA): Add script_test_4.stdout.
14227 (MOSTLYCLEANFILES): Likewise.
14228 (script_test_4): New target.
14229 (script_test_4.stdout): New target.
14230 * testsuite/Makefile.in: Rebuild.
14232 * sparc.cc: Add definitions for Output_data_plt_sparc class
14235 2008-04-14 David S. Miller <davem@davemloft.net>
14237 * sparc.cc: New file.
14238 * Makefile.am (TARGETSOURCES): Add sparc.cc
14239 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
14240 * configure.tgt: Document targ_extra_size and
14241 targ_extra_big_endian. Add entries for sparc-* and
14243 * configure.ac: Handle targ_extra_size and
14244 targ_extra_big_endian.
14245 * Makefile.in: Rebuild.
14246 * configure: Likewise.
14247 * po/POTFILES.in: Likewise.
14248 * po/gold.pot: Likewise.
14250 2008-04-14 Ian Lance Taylor <iant@google.com>
14252 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
14253 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
14254 in the name/type/flags to section mapping. Don't call
14255 allocate_output_section.
14256 (Layout::choose_output_section): Change parameter from adjust_name
14257 to is_input_section. Don't permit input sections after sections
14258 are attached to segments. Don't call allocate_output_section.
14259 (Layout::layout_eh_frame): Call update_flags_for_input_section,
14260 not write_enable_output_section.
14261 (Layout::make_output_section): Don't push to
14262 unattached_section_list_ nor call attach_to_segment. Call
14263 attach_section_to_segment if sections are attached.
14264 (Layout::attach_sections_to_segments): New function.
14265 (Layout::attach_section_to_segment): New function.
14266 (Layout::attach_allocated_section_to_segment): Rename from
14267 attach_to_segment. Remove flags parameter.
14268 (Layout::allocate_output_section): Remove function.
14269 (Layout::write_enable_output_section): Remove function.
14270 * layout.h (class Layout): Update for above changes. Add new
14271 field sections_are_attached_.
14272 * output.h (Output_section::update_flags_for_input_section): New
14274 * output.cc (Output_section::add_input_section): Call
14275 update_flags_for_input_section.
14276 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
14278 2008-04-11 Cary Coutant <ccoutant@google.com>
14280 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
14281 thought unnecessary.
14282 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
14284 2008-04-11 Ian Lance Taylor <iant@google.com>
14286 * output.h (class Output_section_data): Remove inline definition
14288 * output.cc (Output_section_data::set_addralign): New function.
14290 2008-04-11 Cary Coutant <ccoutant@google.com>
14292 Add support for TLS descriptors for i386 and x86_64.
14293 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
14294 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
14295 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
14297 (Target_i386::got_mod_index_entry): Remove unnecessary code.
14298 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
14299 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
14301 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
14302 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
14303 Fix problem with initial-exec relocations.
14304 (Target_i386::Relocate::relocate_tls): Likewise.
14305 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
14307 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
14308 support for section-plus-offset dynamic table entries.
14309 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
14310 (Output_data_dynamic::Dynamic_entry): Add support for
14311 section-plus-offset dynamic table entries.
14312 (Output_data_dynamic::Classification): Likewise.
14313 (Output_data_dynamic::classification_): Renamed offset_.
14314 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
14315 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
14316 (Target_x86_64::make_plt_section): New function.
14317 (Target_x86_64::reserve_tlsdesc_entries): New function.
14318 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
14319 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
14320 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
14321 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
14322 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
14323 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
14324 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
14325 add extra PLT entry for TLS descriptors.
14326 (Output_data_plt_x86_64::got_): New field.
14327 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
14328 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
14330 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
14332 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
14333 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
14334 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
14335 R_386_TLS_DESC_CALL relocations.
14336 (Target_x86_64::Scan::global): Likewise.
14337 (Target_x86_64::do_finalize_sections): Add dynamic table entries
14338 for TLS descriptors.
14339 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
14340 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
14341 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
14342 GD-to-IE relaxation.
14343 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
14344 and TLS_DESCRIPTORS.
14345 * Makefile.in: Rebuild.
14346 * configure: Rebuild.
14347 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
14348 (tls_test_shared2.so): New target.
14349 (tls_shared_gd_to_ie_test_SOURCES): New variable.
14350 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
14351 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
14352 (tls_shared_gd_to_ie_test_LDADD): New variable.
14353 (tls_shared_gnu2_gd_to_ie_test): New target.
14354 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
14356 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
14357 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
14358 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
14359 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
14360 (tls_shared_gnu2_test): New target.
14361 (tls_test_gnu2_shared.so): New target.
14362 (tls_shared_gnu2_test_SOURCES): New variable.
14363 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
14364 (tls_shared_gnu2_test_LDFLAGS): New variable.
14365 (tls_shared_gnu2_test_LDADD): New variable.
14366 * testsuite/Makefile.in: Rebuild.
14367 * testsuite/Makefile.
14369 2008-04-11 Ian Lance Taylor <iant@google.com>
14371 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
14373 * testsuite/Makefile.in: Rebuild.
14375 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
14377 * testsuite/script_test_2.cc (main): Adjust test.
14379 2008-04-11 David S. Miller <davem@davemloft.net>
14380 Ian Lance Taylor <iant@google.com>
14382 * options.h (General_options): Add entries for '-Y' and
14384 * options.cc (General_options:finalize): If -Y was used, add those
14385 entries to the library path instead of the default "/lib" and
14388 2008-04-11 David S. Miller <davem@davemloft.net>
14390 * testsuite/justsyms.t: Start at 0x100.
14391 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
14392 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
14394 * testsuite/script_test_2.cc: Adjust string and section length
14397 2008-04-09 Ian Lance Taylor <iant@google.com>
14400 * script-sections.cc (Sections_element::allocate_to_segment): Add
14402 (Output_section_definition::allocate_to_segment): Likewise.
14403 (Orphan_output_section::allocate_to_segment): Likewise.
14404 (Script_sections::attach_sections_using_phdrs_clause): Don't
14405 propagate non-PT_LOAD segments to orphan sections.
14406 * testsuite/Makefile.am (script_test_3.stdout): Generate using
14407 readelf rather than objdump.
14408 * testsuite/script_test_3.sh: Adjust accordingly. Test that
14409 .interp section and PT_INTERP segment are the same size.
14410 * testsuite/Makefile.in: Rebuild.
14412 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
14413 aliases for symbols defined in the same object.
14414 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
14415 (weak_alias_test_SOURCES): New variable.
14416 (weak_alias_test_DEPENDENCIES): New variable.
14417 (weak_alias_test_LDFLAGS): New variable.
14418 (weak_alias_test_LDADD): New variable.
14419 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
14420 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
14421 (weak_alias_test_3.o): New target.
14422 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
14423 * testsuite/weak_alias_test_main.cc: New file.
14424 * testsuite/weak_alias_test_1.cc: New file.
14425 * testsuite/weak_alias_test_2.cc: New file.
14426 * testsuite/weak_alias_test_3.cc: New file.
14428 2008-04-08 Ian Lance Taylor <iant@google.com>
14430 * options.h (class General_options): Add --noinhibit-exec option.
14431 * main.cc (main): Check --noinhibit-exec.
14433 * options.h (class General_options): Define --wrap as a special
14434 option. Add wrap_symbols_ field.
14435 (General_options::any_wrap_symbols): New function.
14436 (General_options::is_wrap_symbol): New function.
14437 * options.cc (General_options::parse_wrap): New function.
14438 (General_options::General_options): Initialize wrap_symbols_.
14439 * symtab.cc (Symbol_table::wrap_symbol): New function.
14440 (Symbol_table::add_from_object): Handle --wrap.
14441 * symtab.h (class Symbol_table): Declare wrap_symbol.
14442 * target.h (Target::wrap_char): New function.
14443 (Target::Target_info): Add wrap_char field.
14444 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
14445 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14446 * testsuite/testfile.cc (Target_test::test_target_info):
14449 * errors.cc (Errors::undefined_symbol): Mention symbol version if
14452 * layout.h (class Layout): Add added_eh_frame_data_ field.
14453 * layout.cc (Layout::Layout): Initialize new field.
14454 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
14455 output section until we find a section we merged successfully.
14456 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
14457 that the size be non-zero.
14459 * merge.cc (Object_merge_map::get_output_offset): Remove inline
14462 2008-04-08 Craig Silverstein <csilvers@google.com>
14464 * configure.ac: Export new conditional variable HAVE_ZLIB.
14465 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
14467 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
14468 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14470 2008-04-07 Ian Lance Taylor <iant@google.com>
14472 * version.cc (version_string): Set to "1.5".
14474 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
14475 Add issued_non_pic_error_ field. Declare check_non_pic.
14476 (Target_x86_64::Scan::check_non_pic): New function.
14477 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
14478 (Target_x86_64::Scan::global): Likewise.
14480 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
14481 addend parameter. Change caller. Handle merge sections.
14482 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
14483 Address to Addend. Don't add in the result of
14484 local_section_offset, pass down the addend and use the returned
14486 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
14487 Update declarations of local_section_offset and symbol_value.
14488 * testsuite/two_file_test_1.cc (t18): New function.
14489 * testsuite/two_file_test_2.cc (f18): New function.
14490 * testsuite/two_file_test_main.cc (main): Call t18.
14491 * testsuite/two_file_test.h (t18, f18): Declare.
14493 * configure.ac: Don't test for objdump, c++filt, or readelf.
14494 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
14496 (TEST_READELF): New variable.
14497 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
14498 (check_PROGRAMS): Add two_file_strip_test.
14499 (two_file_strip_test): New target.
14500 (check_PROGRAMS): Add two_file_same_shared_strip_test.
14501 (two_file_same_shared_strip_test_SOURCES): New variable.
14502 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
14503 (two_file_same_shared_strip_test_LDFLAGS): New variable.
14504 (two_file_same_shared_strip_test_LDADD): New variable.
14505 (two_file_shared_strip.so): New target.
14506 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
14507 (ver_test_5.syms, ver_test_7.syms): Likewise.
14508 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
14509 (strip_test_3.stdout): Use TEST_OBJDUMP.
14510 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14512 2008-04-04 Cary Coutant <ccoutant@google.com>
14514 * symtab.h (Symbol::is_weak_undefined): New function.
14515 (Symbol::is_strong_undefined): New function.
14516 (Symbol::is_absolute): New function.
14517 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
14518 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
14520 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
14521 (weak_undef_test): New target.
14522 * testsuite/Makefile.in: Rebuild.
14523 * testsuite/weak_undef_file1.cc: New file.
14524 * testsuite/weak_undef_file2.cc: New file.
14525 * testsuite/weak_undef_test.cc: New file.
14527 2008-04-03 Craig Silverstein <csilvers@google.com>
14529 * compressed_output.h (class Output_compressed_section): Use
14531 * compressed_output.cc (zlib_compress): Use unsigned buffers,
14533 (zlib_compressed_suffix): Removed.
14534 (Output_compressed_section::set_final_data_size): Use unsigned
14536 * testsuite/Makefile.am (flagstest_compress_debug_sections):
14537 Fix linker invocation.
14538 (flagstest_o_specialfile_and_compress_debug_sections):
14540 * testsuite/Makefile.in: Regenerated.
14542 2008-04-02 David S. Miller <davem@davemloft.net>
14544 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
14545 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
14547 2008-04-02 Craig Silverstein <csilvers@google.com>
14551 2008-04-02 Ian Lance Taylor <iant@google.com>
14553 * fileread.cc (File_read::find_view): Add byteshift and vshifted
14554 parameters. Update for new key type to views_. Change all
14556 (File_read::read): Adjust for byteshift in returned view.
14557 (File_read::add_view): New function, broken out of
14558 find_and_make_view.
14559 (File_read::make_view): New function, broken out of
14560 find_and_make_view.
14561 (File_read::find_or_make_view): Add offset and aligned
14562 parameters. Rewrite accordingly. Change all callers.
14563 (File_read::get_view): Add offset and aligned parameters. Adjust
14564 for byteshift in return value.
14565 (File_read::get_lasting_view): Likewise.
14566 * fileread.h (class File_read): Update declarations.
14567 (class File_read::View): Add byteshift_ field. Add byteshift to
14568 constructor. Add byteshift method.
14569 * archive.h (Archive::clear_uncached_views): New function.
14570 (Archive::get_view): Add aligned parameter. Change all callers.
14571 * object.h (Object::get_view): Add aligned parameter. Change all
14573 (Object::get_lasting_view): Likewise.
14575 * fileread.cc (File_read::release): Don't call clear_views if
14576 there are multiple objects.
14577 * fileread.h (File_read::clear_uncached_views): New function.
14578 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
14581 2008-03-31 Cary Coutant <ccoutant@google.com>
14583 Add thin archive support.
14584 * archive.cc (Archive::armagt): New const.
14585 (Archive::setup): Remove task parameter and calls to unlock.
14586 (Archive::unlock_nested_archives): New function.
14587 (Archive::read_header): Add nested_off parameter. Change
14589 (Archive::interpret_header): Likewise.
14590 (Archive::include_all_members): Change to handle thin
14592 (Archive::include_member): Likewise.
14593 * archive.h (Archive::Archive): Add new parameters and
14595 (Archive::armagt): New const.
14596 (Archive::setup): Remove task parameter.
14597 (Archive::unlock_nested_archives): New function.
14598 (Archive::read_header): Add nested_off parameter.
14599 (Archive::interpret_header): Likewise.
14600 (Archive::Nested_archive_table): New typedef.
14601 (Archive::is_thin_archive_): New field.
14602 (Archive::nested_archives_): New field.
14603 (Archive::options_): New field.
14604 (Archive::dirpath_): New field.
14605 (Archive::task_): New field.
14606 * readsyms.cc (Read_symbols::do_read_symbols): Add check
14607 for thin archives. Pass additional parameters to
14608 Archive::Archive. Unlock the archive file after calling
14611 2008-03-29 Ian Lance Taylor <iant@google.com>
14613 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
14614 version symbol to be local.
14615 * testsuite/ver_test_4.sh: New file.
14616 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
14617 (check_DATA): Add ver_test_4.syms.
14618 (ver_test_4.syms): New target.
14619 * testsuite/Makefile.in: Rebuild.
14622 (Output_section::Input_section_sort_entry::has_priority): New
14624 (Output_section::Input_section_sort_entry::match_file_name): New
14626 (Output_section::Input_section_sort_entry::match_section_name):
14628 (Output_section::Input_section_sort_entry::match_section_name_prefix):
14630 (Output_section::Input_section_sort_entry::match_section_file):
14632 (Output_section::Input_section_sort_compare::operator()): Rewrite
14633 using new Input_section_sort_entry functions. Sort crtbegin and
14634 crtend first. Sort sections with no priority before sections with
14636 * testsuite/initpri1.c (d3): Check j != 4.
14637 (cd5): New constructor/destructor function.
14638 (main): Check j != 2.
14640 * symtab.cc (Symbol_table::add_from_object): If we don't use the
14641 new symbol when resolving, don't call set_is_default.
14642 * testsuite/ver_test_7.cc: New file.
14643 * testsuite/ver_test_7.sh: New file.
14644 * testsuite/Makefile.am (ver_test_7.so): New target.
14645 (ver_test_7.o): New target.
14646 (check_SCRIPTS): Add ver_test_7.sh.
14647 (check_DATA): Add ver_test_7.syms.
14648 (ver_test_7.syms): New target.
14650 2008-03-28 Ian Lance Taylor <iant@google.com>
14652 * layout.cc (Layout::layout): If we see an input section with a
14653 name that needs sorting, set the must_sort flag for the output
14655 (Layout::make_output_section): If the name of the output section
14656 indicates that it might require sorting, set the may_sort flag.
14657 * output.h (Output_section::may_sort_attached_input_sections): New
14659 (Output_section::set_may_sort_attached_input_sections): New
14661 (Output_section::must_sort_attached_input_sections): New
14663 (Output_section::set_must_sort_attached_input_sections): New
14665 (class Output_section): Declare Input_section_sort_entry. Define
14666 Input_section_sort_compare. Declare
14667 sort_attached_input_sections. Add new fields:
14668 may_sort_attached_input_sections_,
14669 must_sort_attached_input_sections_,
14670 attached_input_sections_are_sorted_.
14671 * output.cc (Output_section::Output_section): Initialize new
14673 (Output_section::add_input_section): Add an entry to
14674 input_sections_ if may_sort or must_sort are true.
14675 (Output_section::set_final_data_size): Call
14676 sort_attached_input_sections if necessary.
14677 (Output_section::Input_section_sort_entry): Define new class.
14678 (Output_section::Input_section_sort_compare::operator()): New
14680 (Output_section::sort_attached_input_sections): New function.
14681 * configure.ac: Check whether the compiler supports constructor
14682 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
14683 * testsuite/initpri1.c: New file.
14684 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
14685 CONSTRUCTOR_PRIORITY.
14686 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
14687 (initpri1_LDFLAGS): New variable.
14688 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14690 2008-03-27 Ian Lance Taylor <iant@google.com>
14692 * common.cc (Sort_commons::operator): Correct sorting algorithm.
14693 * testsuite/common_test_1.c: New file.
14694 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
14695 (common_test_1_SOURCES): New variable.
14696 (common_test_1_DEPENDENCIES): New variable.
14697 (common_test_1_LDFLAGS): New variable.
14699 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
14700 and commons_ correctly when NAME/VERSION does not override
14702 * testsuite/ver_test_6.c: New file.
14703 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
14704 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
14705 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
14707 2008-03-26 Ian Lance Taylor <iant@google.com>
14709 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
14710 of an undefined symbol from a version script.
14711 * testsuite/Makefile.am (ver_test_5.so): New target.
14712 (ver_test_5.o): New target.
14713 (check_SCRIPTS): Add ver_test_5.sh.
14714 (check_DATA): Add ver_test_5.syms.
14715 (ver_test_5.syms): New target.
14716 * testsuite/ver_test_5.cc: New file.
14717 * testsuite/ver_test_5.script: New file.
14718 * testsuite/ver_test_5.sh: New file.
14719 * Makefile.in, testsuite/Makefile.in: Rebuild.
14722 Fix problems building gold with gcc 4.3.0.
14723 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
14724 (gold_error_at_location, gold_warning_at_location): Use it.
14725 * configure.ac: Check whether we can compile and use a template
14726 function with a printf attribute.
14727 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
14728 when jumping over bytes.
14729 * object.cc: Instantiate Object::read_section_data.
14730 * debug.h: Include <cstring>
14731 * dwarf_reader.cc: Include <algorithm>
14732 * main.cc: Include <cstring>.
14733 * options.cc: Include <cstring>.
14734 * output.cc: Include <cstring>.
14735 * script.cc: Include <cstring>.
14736 * script.h: Include <string>.
14737 * symtab.cc: Include <cstring> and <algorithm>.
14738 * target-select.cc: Include <cstring>.
14739 * version.cc: Include <string>.
14740 * testsuite/testmain.cc: Include <cstdlib>.
14741 * configure, config.in: Rebuild.
14743 2008-03-25 Ian Lance Taylor <iant@google.com>
14745 * options.cc: Include "../bfd/bfdver.h".
14746 (options::help): Print bug reporting address.
14748 * version.cc (print_version): Adjust output for current value of
14749 BFD_VERSION_STRING.
14753 * options.cc (options::help): Print list of supported targets.
14754 * target-select.h: Include <vector>.
14755 (class Target_selector): Make machine_, size_, and is_big_endian_
14756 fields const. Add bfd_name_ and instantiated_target_ fields.
14757 (Target_selector::Target_selector): Add bfd_name parameter.
14758 (Target_selector::recognize): Make non-virtual, call
14760 (Target_selector::recognize_by_name): Make non-virtual, call
14761 do_recognize_by_name.
14762 (Target_selector::supported_names): New function.
14763 (Target_selector::bfd_name): New function.
14764 (Target_selector::do_instantiate_target): New pure virtual
14766 (Target_selector::do_recognize): New virtual function.
14767 (Target_selector::do_recognize_by_name): New virtual function.
14768 (Target_selector::instantiate_target): New private function.
14769 (supported_target_names): Declare.
14770 * target-select.cc (Target_selector::Target_selector): Update for
14771 new parameter and fields.
14772 (select_target_by_name): Check that the name matches before
14773 calling recognize_by_name.
14774 (supported_target_names): New function.
14775 * i386.cc (class Target_selector_i386): Update Target_selector
14776 constructor call. Remove recognize and recognize_by_name. Add
14777 do_instantiate_target.
14778 * x86_64.cc (class Target_selector_x86_64): Likewise.
14779 * testsuite/testfile.cc (class Target_selector_test): Update for
14780 changes to Target_selector.
14782 * README: Rewrite, with some notes on unsupported features.
14784 2008-03-24 Cary Coutant <ccoutant@google.com>
14786 * i386.cc (Target_i386::Got_type): New enum declaration.
14787 (Target_i386::Scan::local): Updated callers of Output_data_got
14789 (Target_i386::Scan::global): Likewise.
14790 (Target_i386::Relocate::relocate): Likewise.
14791 (Target_i386::Relocate::relocate_tls): Likewise.
14792 * object.h (Got_offset_list): New class.
14793 (Sized_relobj::local_has_got_offset): Added got_type parameter.
14794 (Sized_relobj::local_got_offset): Likewise.
14795 (Sized_relobj::set_local_got_offset): Likewise.
14796 (Sized_relobj::local_has_tls_got_offset): Removed.
14797 (Sized_relobj::local_tls_got_offset): Removed.
14798 (Sized_relobj::set_local_tls_got_offset): Removed.
14799 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
14800 * output.cc (Output_data_got::add_global): Added got_type parameter.
14801 (Output_data_got::add_global_with_rel): Likewise.
14802 (Output_data_got::add_global_with_rela): Likewise.
14803 (Output_data_got::add_global_pair_with_rel): New function.
14804 (Output_data_got::add_global_pair_with_rela): New function.
14805 (Output_data_got::add_local): Added got_type parameter.
14806 (Output_data_got::add_local_with_rel): Likewise.
14807 (Output_data_got::add_local_with_rela): Likewise.
14808 (Output_data_got::add_local_pair_with_rel): New function.
14809 (Output_data_got::add_local_pair_with_rela): New function.
14810 (Output_data_got::add_global_tls): Removed.
14811 (Output_data_got::add_global_tls_with_rel): Removed.
14812 (Output_data_got::add_global_tls_with_rela): Removed.
14813 (Output_data_got::add_local_tls): Removed.
14814 (Output_data_got::add_local_tls_with_rel): Removed.
14815 (Output_data_got::add_local_tls_with_rela): Removed.
14816 * output.h (Output_data_got::add_global): Added got_type parameter.
14817 (Output_data_got::add_global_with_rel): Likewise.
14818 (Output_data_got::add_global_with_rela): Likewise.
14819 (Output_data_got::add_global_pair_with_rel): New function.
14820 (Output_data_got::add_global_pair_with_rela): New function.
14821 (Output_data_got::add_local): Added got_type parameter.
14822 (Output_data_got::add_local_with_rel): Likewise.
14823 (Output_data_got::add_local_with_rela): Likewise.
14824 (Output_data_got::add_local_pair_with_rel): New function.
14825 (Output_data_got::add_local_pair_with_rela): New function.
14826 (Output_data_got::add_global_tls): Removed.
14827 (Output_data_got::add_global_tls_with_rel): Removed.
14828 (Output_data_got::add_global_tls_with_rela): Removed.
14829 (Output_data_got::add_local_tls): Removed.
14830 (Output_data_got::add_local_tls_with_rel): Removed.
14831 (Output_data_got::add_local_tls_with_rela): Removed.
14832 * resolve.cc (Symbol::override_base_with_special): Removed
14833 reference to has_got_offset_ field.
14834 * symtab.cc (Symbol::init_fields): Replaced initialization
14835 of got_offset_ with got_offsets_. Removed initialization
14837 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
14838 (Symbol::got_offset): Likewise.
14839 (Symbol::set_got_offset): Likewise.
14840 (Symbol::has_tls_got_offset): Removed.
14841 (Symbol::tls_got_offset): Removed.
14842 (Symbol::set_tls_got_offset): Removed.
14843 (Symbol::got_offset_): Removed.
14844 (Symbol::tls_mod_got_offset_): Removed.
14845 (Symbol::tls_pair_got_offset_): Removed.
14846 (Symbol::got_offsets_): New field.
14847 (Symbol::has_got_offset): Removed.
14848 (Symbol::has_tls_mod_got_offset): Removed.
14849 (Symbol::has_tls_pair_got_offset): Removed.
14850 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
14851 (Target_x86_64::Scan::local): Updated callers of Output_data_got
14853 (Target_x86_64::Scan::global): Likewise.
14854 (Target_x86_64::Relocate::relocate): Likewise.
14855 (Target_x86_64::Relocate::relocate_tls): Likewise.
14857 2008-03-25 Ben Elliston <bje@au.ibm.com>
14859 * yyscript.y: Fix spelling error in comment.
14861 2008-03-24 Ian Lance Taylor <iant@google.com>
14863 * options.h (class General_options): Define build_id option.
14864 * layout.h (class Layout): Declare write_build_id, create_note,
14865 create_build_id. Add build_id_note_ member.
14866 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
14867 "libiberty.h", "md5.h", "sha1.h".
14868 (Layout::Layout): Initialize eh_frame_data_,
14869 eh_frame_hdr_section_, and build_id_note_.
14870 (Layout::finalize): Call create_build_id.
14871 (Layout::create_note): New function, broken out of
14872 Layout::create_gold_note.
14873 (Layout::create_gold_note): Call create_note.
14874 (Layout::create_build_id): New function.
14875 (Layout::write_build_id): New function.
14876 (Close_task_runner::run): Call write_build_id.
14878 * x86_64.cc: Correct license to GPLv3.
14880 2008-03-23 Ian Lance Taylor <iant@google.com>
14882 * options.cc: Include "demangle.h".
14883 (parse_optional_string): New function.
14884 (parse_long_option): Handle takes_optional_argument.
14885 (parse_short_option): Update dash_z initializer. Handle
14886 takes_optional_argument.
14887 (General_options::General_options): Initialize do_demangle_.
14888 (General_options::finalize): Set do_demangle_. Handle demangling
14890 * options.h (parse_optional_string): Declare.
14891 (struct One_option): Add optional_arg field. Update constructor.
14892 Update call constructor calls. Add takes_optional_argument
14894 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
14895 (DEFINE_optional_string): Define.
14896 (General_options::demangle): Change from DEFINE_bool to
14897 DEFINE_optional_string.
14898 (General_options::no_demangle): New function.
14899 (General_options::do_demangle): New function.
14900 (General_options::set_do_demangle): New function.
14901 (General_options::execstack_status_): Move definition to end of
14903 (General_options::static_): Likewise.
14904 (General_options::do_demangle_): New field.
14905 * object.cc (big_endian>::get_symbol_location_info): Call
14906 Options::do_demangle, not Options::demangle.
14907 * symtab.cc (demangle): Likewise.
14909 2008-03-22 Ian Lance Taylor <iant@google.com>
14911 * gold.h: Include <cstddef> and <sys/types.h>
14912 * options.h: Include <cstring>.
14914 2008-03-21 Ian Lance Taylor <iant@google.com>
14916 * Added source code to GNU binutils.
14918 Copyright (C) 2008-2013 Free Software Foundation, Inc.
14920 Copying and distribution of this file, with or without modification,
14921 are permitted in any medium without royalty provided the copyright
14922 notice and this notice are preserved.
14928 version-control: never