1 2013-07-03 Alan Modra <amodra@gmail.com>
3 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
6 2013-07-01 Cary Coutant <ccoutant@google.com>
8 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
10 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
11 (Dwarf_ranges_table::lookup_reloc): New function.
12 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
14 (Dwarf_ranges_table::lookup_reloc): New function.
15 (Dwarf_ranges_table::reloc_type_): New data member.
17 2013-06-27 Jing Yu <jingyu@google.com>
20 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
22 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
23 (Target_powerpc::do_relax): Call the above.
25 2013-06-27 Cary Coutant <ccoutant@google.com>
27 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
28 on garbage collected .opd section.
30 2013-06-27 Alan Modra <amodra@gmail.com>
32 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
34 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
35 (Target_powerpc::do_function_location): Likewise for loc->shndx.
37 2013-06-14 Cary Coutant <ccoutant@google.com>
39 * resolve.cc (Symbol::override_base): Don't override st_type
40 from plugin placeholder symbols.
41 (Symbol_table::resolve): Likewise.
42 (Symbol_table::should_override): Don't complain about TLS mismatch
43 if the TO symbol is a plugin placeholder.
44 * testsuite/Makefile.am (plugin_test_tls): New test.
45 * testsuite/Makefile.in: Regenerate.
46 * testsuite/plugin_test_tls.sh: New test script.
47 * testsuite/two_file_test_2_tls.cc: New test source.
48 * testsuite/two_file_test_tls.cc: New test source.
50 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
52 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
53 the maximum segment alignment is larger than the page size.
54 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
55 correctly aligns the symbols with large alignemnt.
56 * testsuite/Makefile.in: Regenerate.
57 * testsuite/large_symbol_alignment.cc: New file.
59 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
60 Sriraman Tallam <tmsriram@google.com>
62 * options.h (sort_section): New option.
63 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
64 Rename from Input_section_sort_section_name_special_ordering_compare.
65 (Input_section_sort_section_name_compare): New struct.
66 * output.cc (Output_section::Input_section_sort_section_name_compare::
67 operator()): New function.
68 (Output_section::sort_attached_input_sections): Use new sort function
69 for .text if --sort-section=name is specified.
70 * layout.cc (Layout::make_output_section):
71 Add sorting by name when --sort-section=name is specified.
72 * testsuite/Makefile.am (text_section_grouping): Test option
74 * testsuite/Makefile.in: Regenerate.
75 * testsuite/section_sorting_name.cc: New file.
76 * testsuite/section_sorting_name.sh: New file.
78 2013-05-21 Cary Coutant <ccoutant@google.com>
80 * symtab.h (Symbol::is_cxx_vtable): New function.
81 * target-reloc.h (relocate_section): Check for vtable symbol.
82 * testsuite/Makefile.am (missing_key_func.sh): New test case.
83 * testsuite/Makefile.in: Regenerate.
84 * testsuite/missing_key_func.cc: New test source.
85 * testsuite/missing_key_func.sh: New test script.
87 2013-05-21 Cary Coutant <ccoutant@google.com>
89 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
90 type of enclosing symbol.
91 (Relocate_info::location): Check symbol type when describing symbol.
92 * object.h (Symbol_location_info): Remove unused line_number;
93 add enclosing_symbol_type.
94 * testsuite/debug_msg.sh: Adjust expected output.
96 2013-05-13 Cary Coutant <ccoutant@google.com>
98 * configure.ac: Export DEFAULT_TARGET.
99 * configure: Regenerate.
100 * Makefile.in: Regenerate.
101 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
102 * testsuite/Makefile.in: Regenerate.
103 * testsuite/debug_msg.sh: Delete duplicate tests.
104 Don't check undef_int error message match for powerpc where the
105 source file and line number aren't available.
107 2013-05-10 Roland McGrath <mcgrathr@google.com>
109 * options.h (General_options): Add --rosegment-gap option.
110 * options.cc (finalize): --rosegment-gap implies --rosegment.
111 * layout.cc (set_segment_offsets): Let user option override
112 target->rosegment_gap().
114 2013-05-10 Roland McGrath <mcgrathr@google.com>
116 * options.h (General_options): Remove leading space from help
117 messages for -nostdlib and --rosegment.
119 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
122 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
124 2013-05-03 Alan Modra <amodra@gmail.com>
126 * merge.cc (Output_merge_string::do_add_input_section): Correct
127 scan for number of strings. Rename vars to avoid shadowing.
128 Include missing terminator in input_size_.
130 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
132 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
133 Restore empty string handling.
135 2013-05-01 Cary Coutant <ccoutant@google.com>
137 * stringpool.cc (Stringpool_template::new_key_offset): Fix
138 uninitialized warning.
140 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
142 * output.cc (Output_section::add_merge_input_section): Allow
143 to merge sections if the alignment is more than character size.
144 * merge.h (Output_merge_string::Output_merge_string): Remove
146 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
147 only not-null strings. Check the alignment of strings.
149 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
150 alignment as the argument.
151 (Stringpool_template<Stringpool_char>::addralign_): New class member.
152 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
153 Align non-zero length strings according to the addralign_.
154 (Stringpool_template<Stringpool_char>::set_string_offsets):
155 Updating offsets according to the given alignment.
156 * testsuite/Makefile.am (text_section_grouping): Test if string
157 literals are getting merged.
158 * testsuite/Makefile.in: Regenerate.
159 * testsuite/merge_string_literals_1.c: New file.
160 * testsuite/merge_string_literals_2.c: Ditto.
161 * testsuite/merge_string_literals.sh: Ditto.
163 2013-04-26 Ian Lance Taylor <iant@google.com>
165 * target-reloc.h (relocate_section): If the reloc offset is out of
166 range, pass VIEW as NULL to relocate.relocate.
167 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
168 * i386.cc (Target_i386::Relocate::relocate): Likewise.
169 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
170 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
171 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
172 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
174 2013-04-26 Geoff Pike <gpike@chromium.org>
176 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
177 * layout.cc (Hash_task): New class.
178 (Layout::queue_build_id_tasks): New function.
179 (Layout::write_build_id): Handle single-thread portion of build ID
180 computation. (In some cases, all of it is single-threaded.) Replace
181 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
182 functionality in fewer lines of code.
183 * layout.h (Layout::queue_build_id_tasks): New function declaration.
184 * options.h (General_options): make "--build-id" default to tree
185 rather than sha1. Add two new options related to --build-id=tree:
186 --build-id-chunk-size-for-treehash and
187 --build-id-min-file-size-for-treehash.
188 * Makefile.am: add testing of --build-id=tree and related new options
189 (these tests will be invoked by "make check").
190 * Makefile.in: Regenerate.
192 2013-04-25 Alan Modra <amodra@gmail.com>
194 * configure.tgt: Add powerpcle and powerpc64le.
196 2013-04-22 Alan Modra <amodra@gmail.com>
199 * layout.cc (Layout::segment_precedes): Allow more than one
200 segment with the same type and flags.
202 2013-04-15 Cary Coutant <ccoutant@google.com>
204 * layout.cc (Layout::set_relocatable_section_offsets): Don't
205 allocate space in file for BSS sections.
207 2013-04-15 Cary Coutant <ccoutant@google.com>
209 * script-sections.cc (Orphan_output_section): Reset address
210 to zero after each orphaned section for relocatable links.
212 2013-04-15 Cary Coutant <ccoutant@google.com>
214 * symtab.cc (Symbol_table::sized_write_globals): Subtract
215 section starting address for relocatable link.
216 * testsuite/Makefile.am (script_test_11): New test.
217 * testsuite/Makefile.in: Regenerate.
218 * testsuite/script_test_11.c: New source file.
219 * testsuite/script_test_11.t: New linker script.
221 2013-04-13 Alan Modra <amodra@gmail.com>
223 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
224 owner when sections are not adjacent and exceed group size.
225 (Target_powerpc::group_sections): Handle corner case.
226 (Target_powerpc::Branch_info::make_stub): Handle case where
227 stub table doesn't exist due to branches in non-exec sections.
228 (Target_powerpc::Relocate::relocate): Likewise.
230 2013-04-11 Alan Modra <amodra@gmail.com>
233 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
234 .branch_lt to match bfd ld. Adjust comments throughout file.
236 2013-04-04 Ian Lance Taylor <iant@google.com>
239 * object.cc (do_layout_deferred_sections): Handle .eh_frame
240 sections before checking whether they are included in the link.
242 2013-03-29 Sriraman Tallam <tmsriram@google.com>
244 * archive.cc (Archive::get_elf_object_for_member): Create the elf
245 object before calling the plugin claim_file handler. Pass the elf
246 object of the archive to the plugin. Delete the elf object if the
247 plugin claims the file.
249 2013-03-21 Alan Modra <amodra@gmail.com>
251 * layout.cc (Layout::set_segment_offsets): Accept writable .text
254 2013-03-21 Alan Modra <amodra@gmail.com>
256 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
258 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
259 uninitialized" warning.
261 2013-03-20 Alan Modra <amodra@gmail.com>
263 * symtab.h (Symbol::clear_version): New function.
264 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
265 is_needed by weak references. Clear version for symbols defined
266 in as-needed objects that are not needed.
268 2013-03-15 Alan Modra <amodra@gmail.com>
270 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
271 static and public. Add report_err param. Return false for data refs.
272 (Target_powerpc::rela_dyn_section): New overloaded function.
273 (Target_powerpc::plt_, iplt_): Elucidate.
274 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
275 (Output_data_plt_powerpc::do_write): Don't write .iplt.
276 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
277 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
278 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
279 push_branch and make_plt_entry for ifunc syms when
280 reloc_needs_plt_for_ifunc.
281 (Target_powerpc::Relocate::relocate): Don't use plt entry value
282 for ifunc unless reloc_needs_plt_for_ifunc.
284 2013-03-15 Alan Modra <amodra@gmail.com>
286 * gc.h (gc_process_relocs): Don't look through function descriptors.
287 * icf.cc (get_section_contents): Do so here instead.
289 2013-03-13 Alan Modra <amodra@gmail.com>
291 * powerpc.cc (is_branch_reloc): Forward declare.
292 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
293 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
294 false for 64-bit, true for 32-bit non-branch relocs.
295 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
296 * testsuite/Makefile.am (icf_test): Use linker map file instead of
298 (icf_safe_test): Generate linker map file as well as nm output.
299 (icf_safe_so_test): Likewise.
300 * testsuite/Makefile.in: Regenerate.
301 * testsuite/icf_test.sh: Parse linker map file to determine
303 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
304 * testsuite/icf_safe_so_test.sh: Likewise.
305 (X86_32_or_ARM_specific_safe_fold): Merge into..
306 (arch_specific_safe_fold): ..this.
307 (X86_64_specific_safe_fold): Delete unused function.
309 2013-03-12 Alan Modra <amodra@gmail.com>
311 * gc.h (gc_process_relocs): Look through function descriptors
312 to determine shndx, symvalue and addend used by ICF. Tidy
313 variable duplication.
315 2013-03-11 Alan Modra <amodra@gmail.com>
317 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
318 * layout.cc (Layout_task_runner::run): ..to here.
319 * symtab.h (struct Symbol_location): Extract from..
320 (class Symbol_table): ..here.
321 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
322 * target.h (class Target): Add function_location and
323 do_function_location functions.
324 (class Sized_target): Add do_function_location.
325 * object.h (class Sized_relobj_file): Move find_shdr..
326 (class Object): ..to here.
327 * object.cc: Likewise. Update to suit. Instantiate.
328 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
329 * powerpc.cc (class Powerpc_dynobj): New.
330 (Target_powerpc::do_function_location): New function.
331 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
332 (Powerpc_dynobj::do_read_symbols): New function.
333 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
335 2013-03-08 Ian Lance Taylor <iant@google.com>
337 * options.cc (General_options::string_to_object_format): Accept
340 2013-03-08 Alan Modra <amodra@gmail.com>
342 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
344 (struct Post_fde): Move definition to here..
345 * ehframe.cc (struct Post_fde): ..from here.
346 (Cie::write): Don't alloc Post_fde.
347 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
349 2013-03-07 Alan Modra <amodra@gmail.com>
351 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
352 relocation referencing .LC0.
353 * testsuite/discard_locals_test.sh: Remove FIXMEs.
355 2013-03-07 Alan Modra <amodra@gmail.com>
357 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
358 always_inline. Add assembly for powerpc to avoid GOT.
360 2013-03-07 Alan Modra <amodra@gmail.com>
362 * testsuite/script_test_10.sh: Don't test .bss section
365 2013-03-06 Alan Modra <amodra@gmail.com>
367 * powerpc.cc (class Powerpc_relobj): Move some member functions.
368 (Target_powerpc::symval_for_branch): Add symtab param. Update
369 all callers. Handle folded sections.
370 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
372 (Global_symbol_visitor_opd::operator()): Likewise.
374 2013-03-04 Alan Modra <amodra@gmail.com>
376 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
377 * testsuite/Makefile.in: Regenerate.
379 2013-03-01 Cary Coutant <ccoutant@google.com>
381 Add dwp support for v2 DWARF package file format.
382 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
383 tu_length parameter. Adjust all callers.
384 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
385 * dwp.cc: Include dwarf.h.
386 (Section_bounds): New struct type.
387 (Unit_set): New struct type.
388 (Dwo_file::Dwo_file): Initialize new data member.
389 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
390 Combine and rename to...
391 (Dwo_file::read_unit_index): ...this.
392 (Dwo_file::sized_read_compunit_index)
393 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
394 (Dwo_file::sized_read_unit_index): ...this.
395 (Dwo_file::copy_section): Remove section_name, is_str_offsets
396 parameters; add section_id parameter.
397 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
398 (Dwo_file::add_unit_set): ...this.
399 (Dwo_file::shndx_map_): Remove.
400 (Dwo_file::sect_offsets_): New data member.
401 (Dwp_output_file::Dwp_output_file): Initialize new data members.
402 (Dwp_output_file::add_section): Rename to...
403 (Dwp_output_file::add_contribution): ...this.
404 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
405 (Dwp_output_file::add_tu_set): Likewise.
406 (Dwp_output_file::Contribution): New type.
407 (Dwp_output_file::Section::contributions): New data member.
408 (Dwp_output_file::Cu_or_tu_set): Remove.
409 (Dwp_output_file::Section::Section): New ctor.
410 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
411 (Dwp_output_file::Dwp_index::Section_table): New type.
412 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
413 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
415 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
416 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
417 (Dwp_output_file::Dwp_index::section_table): New member function.
418 (Dwp_output_file::Dwp_index::section_table_end): New member function.
419 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
420 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
421 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
422 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
423 (Dwp_output_file::Dwp_index::section_table_): New data member.
424 (Dwp_output_file::Dwp_index::section_mask_): New data member.
425 (Dwp_output_file::add_output_section): New member function.
426 (Dwp_output_file::write_new_section): New member function.
427 (Dwp_output_file::write_contributions): New member function.
428 (Dwp_output_file::section_id_map_): New data member.
429 (class Dwo_id_info_reader): Remove.
430 (class Unit_reader): New class.
431 (get_dwarf_section_name): New function.
432 (Dwo_file::read_executable): Adjust initializations of class data.
433 (Dwo_file::read): Add support for v2 package file format.
434 (Dwo_file::read_unit_index): Likewise.
435 (Dwo_file::sized_read_unit_index): Likewise.
436 (Dwo_file::copy_section): Likewise.
437 (Dwo_file::add_unit_set): Likewise.
438 (Dwp_output_file::add_output_section): Likewise.
439 (Dwp_output_file::add_contribution): Likewise.
440 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
442 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
444 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
446 (Dwp_output_file::initialize): Remove unused function.
447 (Dwp_output_file::finalize): Add support for v2 package file format.
448 (Dwp_output_file::write_index): Likewise.
449 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
452 2013-03-01 Cary Coutant <ccoutant@google.com>
454 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
455 function into class definition in header file.
456 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
457 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
459 (Dwarf_info_reader::check_buffer): Move here from .cc file.
461 2013-02-28 Alan Modra <amodra@gmail.com>
463 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
464 * target.cc (Target::do_plt_fde_location): New function.
465 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
466 accessor function, and constructor param.
467 (struct Post_fde, Post_fdes): Declare.
468 (Cie::write): Add post_fdes param.
469 * ehframe.cc (Fde::write): Use plt_fde_location.
470 (struct Post_fde): Define.
471 (Cie::write): Stash FDEs added post merge mapping.
472 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
473 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
474 (Eh_frame::do_sized_write): Arrange to write post map FDES after
476 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
477 (Target_powerpc::has_glink): New function.
478 (Target_powerpc::do_relax): Add eh_frame info for stubs.
479 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
480 glink_eh_frame_fde_32, default_fde): New data.
481 (Stub_table::eh_frame_added_): New var.
482 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
484 (Stub_table::add_eh_frame): New function.
485 (Output_data_glink::add_eh_frame): New function.
486 (Target_powerpc::make_glink_section): Call add_eh_frame.
488 2013-02-15 Ian Lance Taylor <iant@google.com>
490 * options.h (DEFINE_uint64_alias): Define.
491 (class General_options): Add -Ttext-segment as an alias for
494 2013-02-15 Alan Modra <amodra@gmail.com>
496 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
497 (Stub_table::do_write): ..here, two places.
498 (Stub_table::plt_call_size): Use it here too.
500 2013-02-11 Ian Lance Taylor <iant@google.com>
502 * descriptors.cc (Descriptors::close_all): New function.
503 * descriptors.h (class Descriptors): Declare close_all.
504 (close_all_descriptors): New inline function.
505 * plugin.cc: Include "descriptors.h".
506 (Plugin_manager::cleanup): Call close_all_descriptors.
508 2013-02-06 Alan Modra <amodra@gmail.com>
510 * README: Update coding style link.
512 2013-01-28 Cary Coutant <ccoutant@google.com>
514 * dwp.cc (File_list): New typedef.
515 (Dwo_name_info_reader): New class.
516 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
517 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
518 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
519 (Dwo_file::read_executable): New function.
520 (Dwo_file::read): Move common setup code to ...
521 (Dwo_file::make_object): ... here.
522 (dwp_options): Add --exec/-e.
526 2013-01-24 Sriraman Tallam <tmsriram@google.com>
528 * layout.cc (Layout::layout): Check for option text_reorder.
529 (Layout::make_output_section): Ditto.
530 * options.h (text_reorder): New option.
531 * output.cc (Input_section_sort_compare): Remove special ordering
534 Input_section_sort_section_name_special_ordering_compare::
535 operator()): New function.
536 (Output_section::sort_attached_input_sections): Use new sort function
538 * output.h (Input_section_sort_section_name_special_ordering_compare):
540 * testsuite/Makefile.am (text_section_grouping): Test option
542 * testsuite/Makefile.in: Regenerate.
543 * testsuite/text_section_grouping.sh: Check order of functions without
544 default text reordering.
546 2013-01-18 Mike Frysinger <vapier@gentoo.org>
548 * options.h (General_options): Change default to true for new_dtags.
550 2013-01-18 Mike Frysinger <vapier@gentoo.org>
552 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
553 when enable_new_dtags is false. Only add DT_RUNPATH when
554 enable_new_dtags is true.
556 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
558 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
559 used in declaration and definition consistent.
560 (Target_powerpc::symval_for_branch): Ditto.
562 2013-01-16 Sriraman Tallam <tmsriram@google.com>
564 * testsuite/plugin_final_layout.cc: Fix comment.
566 2013-01-16 Sriraman Tallam <tmsriram@google.com>
568 * layout.cc (Layout::layout): Do not do default sorting for
569 text sections when section ordering is specified.
570 (make_output_section): Ditto.
571 * testsuite/plugin_final_layout.cc: Name the function sections
572 to catch reordering issues.
574 2013-01-15 Alan Modra <amodra@gmail.com>
576 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
579 2013-01-15 Alan Modra <amodra@gmail.com>
581 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
582 * testsuite/Makefile.in: Regenerate.
584 2013-01-14 Alan Modra <amodra@gmail.com>
586 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
587 * testsuite/Makefile.in: Regenerate.
589 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
592 Fix mingw gold build with plugins enabled
593 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
594 * configure.ac: Export DLOPEN_LIBS and add headers check.
595 * plugin.cc: Handle non-dlfcn case.
596 * Makefile.in: Regenerate.
597 * config.in: Regenerate.
598 * configure: Regenerate.
599 * testsuite/Makefile.in: Regenerate.
601 2013-01-09 Sriraman Tallam <tmsriram@google.com>
603 * output.h (sort_attached_input_sections): Change to be public.
605 (Output_section_definition::set_section_addresses): Sort
606 attached input sections according to section order before linker
607 script assigns section addresses.
608 (Orphan_output_section::set_section_addresses): Sort
609 attached input sections according to section order before linker
610 script assigns section addresses.
611 * Makefile.am (final_layout.sh): Use a simple linker script to
612 check if section ordering still works.
613 * Makefile.in: Regenerate.
615 2013-01-09 Ben Cheng <bccheng@google.com>
617 * arm.cc (Target_arm::attributes_accept_div): New function.
618 (Target_arm::attributes_forbid_div): New function.
619 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
620 attribute using the same new functions as what bfd/elf32_arm.c
623 2013-01-07 Cary Coutant <ccoutant@google.com>
626 * output.cc (Output_section::add_input_section): For incremental
627 updates, don't track input sections that are allocated from patch
630 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
631 Ian Lance Taylor <iant@google.com>
634 * configure.ac (--enable-ld): Removed.
635 (install_as_default): Set to yes only for --enable-gold=default
637 * configure: Regenerated.
639 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
641 * options.h (General_options): Add -fuse-ld= for GCC linker
642 option compatibility.
644 2013-01-04 Cary Coutant <ccoutant@google.com>
646 * configure.ac: Fix typo restoring CXXFLAGS.
647 * configure: Regenerate.
649 2013-01-04 Cary Coutant <ccoutant@google.com>
651 * testsuite/Makefile.am (CXXLINK_S): New macro.
652 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
653 * testsuite/Makefile.in: Regenerate.
655 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
657 * version.cc (print_version): Update copyright year to 2013.
659 2012-12-20 Ian Lance Taylor <iant@google.com>
661 * layout.cc (Layout::special_ordering_of_input_section): New
663 (Layout::layout): If input section requires special ordering, must
665 (Layout::make_output_section): May sort .text input sections.
666 (Layout::is_section_name_prefix_grouped): Remove.
667 * layout.h (class Layout): Declare
668 special_ordering_of_input_section. Don't declare
669 is_section_name_prefix_grouped.
670 * output.cc (Output_section::add_input_section): Revert last
672 (Output_section::Input_section_sort::match_file_name): Don't crash
673 if called on output section data.
674 (Output_section::Input_section_sort_compare): Sort based on
676 (Output_section::Input_section_sort_section_order_index_compare):
678 (Output_section::sort_attached_input_sections): Likewise.
680 2012-12-18 Sriraman Tallam <tmsriram@google.com>
682 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
683 * layout.h (Layout::is_section_name_prefix_grouped): New function.
684 * output.cc (Output_section::add_input_section): Check if section
685 name contains special prefix. Keep input sections to sort such
687 (Output_section::Input_section_sort_section_order_index_compare
688 ::operator()): Group sections according to prefixes.
689 (Output_section::sort_attached_input_sections): Add condition to
690 Input_section_entry constructor call.
691 * testsuite/Makefile.am (text_section_grouping): New test.
692 * testsuite/Makefile.in: Regenerate.
693 * testsuite/text_section_grouping.cc: New file.
694 * testsuite/text_section_grouping.sh: New file.
696 2012-12-17 Nick Clifton <nickc@redhat.com>
698 * Makefile.am: Add copyright notice.
701 * configure.ac: Likewise.
702 * ftruncate.c: Likewise.
703 * Makefile.in: Regenerate.
705 2012-12-14 Cary Coutant <ccoutant@google.com>
707 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
709 (exception_separate_shared_12_test): Likewise.
710 (incremental_copy_test): Likewise.
711 * testsuite/Makefile.in: Regenerate.
713 2012-12-14 Cary Coutant <ccoutant@google.com>
715 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
716 (Dwp_output_file::Dwp_index::enter_set): Add assert.
718 2012-12-12 Alan Modra <amodra@gmail.com>
720 * powerpc.cc (class Track_tls): New.
721 (class Relocate, class Scan): Inherit Track_tls.
722 (Target_powerpc::Scan::local, global): Track tls optimization
723 and avoid creating plt entry for __tls_get_addr if all uses
725 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
727 2012-12-12 Alan Modra <amodra@gmail.com>
729 * options.h (General_options): Add --toc-sort/--no-toc-sort.
730 Replace no_toc_optimize with toc_optimize.
731 * output.h (Output_section::input_sections): Provide non-const variant.
732 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
733 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
735 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
736 (class Sort_toc_sections): New.
737 (Target_powerpc::do_finalize_sections): Sort toc sections.
738 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
740 2012-12-10 Roland McGrath <mcgrathr@google.com>
742 * testsuite/binary_unittest.cc (read_all): New function.
743 (Sized_binary_test): Use it instead of ::read.
744 * fileread.cc (do_read): Don't assume pread always reads the whole
745 amount in a single call.
747 2012-12-10 Alan Modra <amodra@gmail.com>
749 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
750 Set EM_PPC64 or EM_PPC here.
751 (Target_selector_powerpc::do_recognize): Delete.
753 2012-12-10 Alan Modra <amodra@gmail.com>
755 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
757 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
759 2012-12-07 Roland McGrath <mcgrathr@google.com>
761 * testsuite/binary_unittest.cc (Sized_binary_test):
762 Use open_descriptor rather than ::open.
764 2012-12-07 Alan Modra <amodra@gmail.com>
766 * powerpc.cc (Stub_table::do_write): Delete redundant Address
767 typedef and invalid_address constant.
768 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
769 instantiate constants.
771 2012-12-06 Roland McGrath <mcgrathr@google.com>
773 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
774 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
775 * aclocal.m4: Regenerate.
776 * configure: Regenerate.
777 * Makefile.in: Regenerate.
778 * testsuite/Makefile.in: Regenerate.
780 2012-12-07 Alan Modra <amodra@gmail.com>
782 * options.h (General_options): Add no_toc_optimize.
783 * powerpc.cc (ok_lo_toc_insn): New function.
784 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
786 2012-12-06 Alan Modra <amodra@gmail.com>
788 * options.h (General_options): Add plt_align, plt_static_chain,
789 plt_thread_safe. Update stub_group_size help text.
790 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
791 for new plt_thread_safe_ var.
792 (use_plt_offset): Correct comments.
793 (Target_powerpc::do_relax): Look for thread creation symbols to
794 determine default plt_thread_safe value. Clear plt call stubs
795 as well as branch stubs each iteration.
796 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
798 (l, hi, ha, write_insn): Move earlier.
799 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
800 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
802 (Stub_table::update_size): Adjust.
803 (Stub_table::prev_size, set_prev_size): Delete.
804 (Stub_table::stub_align): Let --plt-align affect result.
805 (Stub_table::plt_call_size): Calculate sizes for various stubs.
806 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
807 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
808 (Stub_table::do_write): Support more stub variants.
810 2012-12-04 Alan Modra <amodra@gmail.com>
812 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
813 (Target_powerpc::do_define_standard_symbols): New function.
815 2012-12-03 Alan Modra <amodra@gmail.com>
817 * output.h: Formatting, whitespace.
819 2012-12-03 Alan Modra <amodra@gmail.com>
821 * layout.h (Layout::get_executable_sections): Declare.
822 * layout.cc (Layout::get_executable_sections): New function.
823 * arm.cc (Target_arm::group_sections): Use it.
824 (Arm_output_section::group_sections): Delete now redundant test.
825 * output.cc (Output_reloc::Output_reloc): Add is_relative.
826 param to handle relative relocs.
827 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
828 (Output_data_reloc::add_absolute): Adjust.
829 (Output_data_reloc::add_relative): New function.
830 (Output_data::reset_data_size): New function.
831 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
832 (Output_section::set_addralign): New function.
833 (Output_section::checkpoint_set_addralign): New function.
834 (Output_section::clear_section_offsets_need_adjustment): New function.
835 (Output_section::input_sections): Make public.
836 * powerpc.cc (class Output_data_brlt_powerpc): New.
837 (class Stub_table, class Stub_control): New.
838 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
839 stub_table_, set_stub_table, stub_table): New vectors and accessor
841 (Target_powerpc::do_may_relax, do_relax, push_branch,
842 new_stub_table, stub_tables, brlt_section, group_sections,
843 add_branch_lookup_table, find_branch_lookup_table,
844 write_branch_lookup_table, make_brlt_section): New functions.
845 (Target_powerpc::struct Sort_sections, class Branch_info): New.
846 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
847 branch_info_): New vars.
848 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
849 make call stubs here.
850 (Output_data_glink): Remove all call stub handling from this class.
851 (Target_powerpc::Scan::local, global): Save interesting branch
852 relocs and relocs for ifunc. Adjust calls to plt entry functions.
853 (Target_powerpc::do_finalize_sections): Only make reg save/restore
854 functions on final link.
855 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
856 Handle long branch destinations too.
857 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
858 do_plt_address_for_local): Adjust lookup of plt call stubs.
860 2012-11-30 Alan Modra <amodra@gmail.com>
862 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
863 relocs against protected symbols when building 32-bit shared libs.
865 2012-11-30 Alan Modra <amodra@gmail.com>
867 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
868 param. Call got_section() to make .got. Update all callers
869 and their callers and so on.
871 2012-11-30 Alan Modra <amodra@gmail.com>
873 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
874 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
875 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
876 value if it already exists.
878 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
881 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
883 2012-11-14 Roland McGrath <mcgrathr@google.com>
885 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
886 than bfc instruction for data sandboxing.
888 2012-11-08 Alan Modra <amodra@gmail.com>
890 * po/POTFILES.in: Regenerate.
892 2012-11-05 Alan Modra <amodra@gmail.com>
894 * configure.ac: Apply 2012-09-10 change to config.in here.
895 * configure: Regenerate.
897 2012-11-05 Alan Modra <amodra@gmail.com>
899 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
900 (struct Opd_ent): Use "Address" rather than "Offset".
901 (Output_data_got_powerpc::got_base_offset): Return Valtype.
902 (Target_powerpc::got_section): Make public.
903 (Target_powerpc::scan_relocs): Move code setting symbols..
904 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
905 Create _SDA_BASE_ only when referenced.
907 2012-11-02 Roland McGrath <mcgrathr@google.com>
909 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
912 2012-11-01 Roland McGrath <mcgrathr@google.com>
914 * target.h (Sized_target::relocate_relocs): Use Elf_Off
915 for offset_in_output_section parameter.
916 (Sized_target::relocate_special_relocatable): Likewise.
917 * arm.cc (Target_arm::relocate_relocs): Likewise.
918 (Target_arm::relocate_special_relocatable): Likewise.
919 * i386.cc (Target_i386::relocate_relocs): Likewise.
920 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
921 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
922 * target-reloc.h (relocate_relocs): Likewise.
923 * testsuite/testfile.cc (Target_test): Likewise.
924 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
925 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
927 * system.h: Move inclusion of <clocale> to after <libintl.h> in
928 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
930 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
931 parameter, which is unused in the [!F_SETFD] case.
933 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
934 SYMNDX to off_t before comparing it to this->data_size().
935 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
936 * incremental.cc (Output_section_incremental_inputs::do_write):
937 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
939 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
941 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
943 * gold.cc (Target_arm::do_adjust_elf_header): Add the
944 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
947 2012-10-29 Cary Coutant <ccoutant@google.com>
949 * dwp.cc (usage): Add file and exit status parameters;
950 add --help and --version options.
951 (print_version): New function.
952 (main): Add --help and --version options.
954 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
956 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
957 final_layout_sequence.txt.
958 * testsuite/Makefile.in: Regenerated.
960 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
962 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
963 COMPILE generated by automake.
965 (CXXCOMPILE1): Likewise.
966 (CXXLINK1): Likewise.
967 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
969 (CXXCOMPILE): Likewise.
971 * testsuite/Makefile.in: Regenerated.
973 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
975 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
976 on bad fwrite return.
978 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
980 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
983 2012-10-23 Cary Coutant <ccoutant@google.com>
985 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
986 * testsuite/Makefile.in: Regenerate.
987 * testsuite/dwp_test.h: New source file.
988 * testsuite/dwp_test_1.cc: New source file.
989 * testsuite/dwp_test_1.s: New source file.
990 * testsuite/dwp_test_1.sh: New source file.
991 * testsuite/dwp_test_1b.cc: New source file.
992 * testsuite/dwp_test_1b.s: New source file.
993 * testsuite/dwp_test_2.cc: New source file.
994 * testsuite/dwp_test_2.s: New source file.
995 * testsuite/dwp_test_2.sh: New source file.
996 * testsuite/dwp_test_main.cc: New source file.
997 * testsuite/dwp_test_main.s: New source file.
999 2012-10-23 Cary Coutant <ccoutant@google.com>
1001 * dwp.h: New header file.
1002 * dwp.cc: New source file.
1003 * gold.h: Move shared declarations to system.h.
1004 * system.h: New header file.
1005 * Makefile.am: Add dwp.
1006 * Makefile.in: Regenerate.
1008 2012-10-23 Cary Coutant <ccoutant@google.com>
1010 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
1011 Dwarf_info_reader::read_from_pointer.
1012 (Dwarf_pubnames_table::read_header): Likewise.
1013 (Dwarf_pubnames_table::next_name): Likewise.
1014 (Dwarf_die::read_attributes): Likewise.
1015 (Dwarf_die::skip_attributes): Likewise.
1016 (Dwarf_info_reader::read_from_pointer): New function template.
1017 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
1018 (Dwarf_pubnames_table): Likewise.
1019 (Dwarf_info_reader::read_from_pointer): New function template.
1020 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
1021 Dwarf_pubnames_table ctor.
1023 2012-10-23 Cary Coutant <ccoutant@google.com>
1025 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
1027 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
1029 (Dwarf_info_reader::set_abbrev_shndx): New method.
1030 (Dwarf_info_reader::abbrev_shndx_): New data member.
1032 2012-10-23 Cary Coutant <ccoutant@google.com>
1034 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
1035 from object, not parameters.
1036 (Dwarf_info_reader::parse): Likewise.
1037 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
1038 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
1039 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
1042 2012-10-23 Cary Coutant <ccoutant@google.com>
1044 * fileread.cc (Input_file::Input_file): New constructor.
1045 * fileread.h (class Input_file): Add new constructor.
1047 2012-10-18 Alan Modra <amodra@gmail.com>
1050 * object.cc (Relobj::is_section_name_included): Also match
1051 .sdata personality section.
1053 2012-10-18 Alan Modra <amodra@gmail.com>
1055 * target-reloc.h (class Default_comdat_behavior): New, package up..
1056 (get_comdat_behaviour): ..this.
1057 (relocate_section): Add Relocate_comdat_behavior template arg,
1058 adjust code to suit.
1059 * arm.cc (Target_arm::relocate_section): Adjust to suit.
1060 (Target_arm::scan_reloc_section): Likewise.
1061 * i386.cc (Target_i386::relocate_section): Likewise.
1062 * sparc.cc (Target_sparc::relocate_section): Likewise.
1063 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
1064 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
1065 * powerpc.cc (class Relocate_comdat_behavior): New.
1066 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
1067 gold::relocate_section with new template arg.
1069 2012-10-18 Alan Modra <amodra@gmail.com>
1071 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
1072 dynamic relocs for GOT_TPREL got entries, without symbol if
1074 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
1075 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
1076 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
1078 2012-10-17 Alan Modra <amodra@gmail.com>
1081 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
1083 2012-10-16 Sriraman Tallam <tmsriram@google.com>
1085 * layout.cc (Layout::include_section): Keep sections marked
1086 SHF_EXCLUDE when doing relocatable links.
1088 2012-10-16 Alan Modra <amodra@gmail.com>
1090 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
1091 (Target_powerpc::do_finalize_sections): Call it.
1092 (Output_data_save_res): New class and supporting functions.
1093 (Target_powerpc::symval_for_branch): Only look up .opd entry for
1094 normal symbols defined in object files.
1096 2012-10-12 Alan Modra <amodra@gmail.com>
1098 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
1099 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
1100 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
1101 section if scan_opd_relocs not yet called.
1102 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
1104 2012-10-12 Alan Modra <amodra@gmail.com>
1106 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1107 add_local_ifunc_entry): Revert last change.
1108 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
1110 2012-10-05 Alan Modra <amodra@gmail.com>
1112 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
1113 do_plt_address_for_global): New functions.
1114 (Output_data_got_powerpc::do_write): Don't segfault when linking
1116 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1117 add_local_ifunc_entry): Return true on adding entry..
1118 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
1119 glink->add_entry call. Remove unused symtab param. Adjust calls.
1120 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
1121 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
1122 set up symbols here.
1123 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
1124 syms here. Do so even when no .iplt. Don't segfault when linking
1126 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
1127 new variants without reloc param.
1128 (Glink_sym_ent::Glink_sym_ent): Likewise.
1129 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
1130 reloc when refs will resolve to plt call stub.
1131 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
1132 R_PPC_PLTREL24 to resolve locally.
1133 (Target_powerpc::Scan::global): Correct ifunc handling.
1134 (Target_powerpc::Relocate::relocate): Correct local sym glink
1135 lookup. Don't destroy "value" when we have a plt call stub,
1136 and when checking plt call validity.
1137 (Target_powerpc::do_dynsym_value): Simplify.
1139 2012-10-05 Alan Modra <amodra@gmail.com>
1141 * i386.cc (Output_data_plt_i386::address_for_global,
1142 address_for_local): Add plt offset to returned value. Adjust uses.
1143 * sparc.cc (Output_data_plt_sparc::address_for_global,
1144 address_for_local): Likewise.
1145 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
1146 address_for_local): Likewise.
1147 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
1148 address_for_local): Likewise.
1149 * target.h (Target::plt_address_for_global, plt_address_for_local):
1151 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
1152 (Output_data_got::Got_entry::write): Nor here.
1153 * output.h: Comment fix.
1155 2012-10-02 Jiong Wang <jiwang@tilera.com>
1157 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
1158 global_offset_table_ value for larget got.
1159 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
1161 2012-09-29 Alan Modra <amodra@gmail.com>
1163 * powerpc.cc (Target_powerpc::iplt_): New output section.
1164 (Target_powerpc::iplt_section, make_iplt_section,
1165 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
1166 (Target_powerpc::make_plt_entry): Handle ifunc syms.
1167 Target_powerpc::plt_entry_count): Count iplt entries too.
1168 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
1169 reloc section in constructor. New params.
1170 (Target_powerpc::make_plt_section): Create reloc section here instead.
1171 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
1173 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
1174 (Output_data_glink::add_entry, find_entry): New functions to
1175 deal with local syms.
1176 (Glink_sym_ent): Add support for local syms.
1177 (Output_data_glink::do_write): Handle ifunc plt entries.
1178 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1179 (Target_powerpc::Scan::local, global): Handle ifunc syms.
1180 (Target_powerpc::Relocate::relocate): Likewise.
1181 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
1183 2012-09-25 Alan Modra <amodra@gmail.com>
1185 * object.h (Sized_relobj_file::adjust_local_symbol,
1186 do_adjust_local_symbol): New functions.
1187 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
1188 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
1189 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
1190 and irregular opd entry spacing.
1191 (Powerpc_relobj::do_read_relocs): Add opd size checks.
1192 (Global_symbol_visitor_opd): New functor.
1193 (Target_powerpc::do_finalize_sections): Omit global symbols defined
1194 on deleted opd entries.
1196 2012-09-15 Jiong Wang <jiwang@tilera.com>
1198 * tilegx.cc: New file.
1199 * Makefile.am (TARGETSOURCES): Add tilegx.cc
1200 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
1201 * configure.tgt: Add entries for tilegx*.
1202 * configure.ac: Likewise.
1203 * Makefile.in: Rebuild.
1204 * configure: Likewise.
1205 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
1208 2012-09-13 Alan Modra <amodra@gmail.com>
1210 * target-reloc.h (scan_relocs): Call scan.local for relocs
1211 against symbols in discarded sections. Pass is_discarded
1213 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
1214 Add is_discarded param.
1215 * powerpc (Target_powerpc::Scan::local): Likewise. Use
1216 is_discarded to flag opd entry as discarded. Don't emit dyn
1217 relocs on such entries.
1218 (Target_powerpc::Scan::global): Similarly detect and handle
1220 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
1221 opd_ent_. Update all uses.
1222 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
1223 (Target_powerpc::relocate_section): Zero out discarded opd
1226 2012-09-12 Ian Lance Taylor <iant@google.com>
1229 * output.cc: Rename Output_data_got template parameter from size
1230 to got_size for all functions. Compile all variants of
1232 (Output_data_got::Got_entry::write): Correct use of size for
1233 symbol value. Use local_is_tls rather than casting to
1235 * object.h (class Object): Add local_is_tls and do_local_is_tls.
1236 (class Sized_relobj_file): Add do_local_is_tls.
1237 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
1239 2012-09-11 Alan Modra <amodra@gmail.com>
1242 * layout.cc (Layout::set_segment_offsets): When using
1243 common-page-size alignment, ensure we are on a new max-page-size
1245 * output.cc (Output_segment::set_section_addresses): Use
1246 abi_pagesize, not common_pagesize for relro boundary.
1247 (Output_segment::set_offset): Likewise.
1249 2012-09-11 Alan Modra <amodra@gmail.com>
1251 * output.h (Output_data_got::add_global_tls, add_local_tls,
1252 add_local_tls_pair): New functions.
1253 (Output_data_got::add_local_pair_with_rel): Remove second
1254 reloc param. Expand comment.
1255 (Output_data_got::Got_entry): Rename use_plt_offset_ to
1256 use_plt_or_tls_offset_, similarly for constructor param.
1257 (Output_data_got::Got_entry::write): Add got_index param.
1258 * output.cc (Output_data_got::add_global_tls, add_local_tls,
1259 add_local_tls_pair): New functions.
1260 (Output_data_got::Got_entry::write): Handle tls symbols
1261 with use_plt_or_tls_offset_ set specially.
1262 (Output_data_got::add_local_pair_with_rel): Only one reloc.
1263 (Output_data_got::do_write): Replace iterator with index, pass
1264 index to entry write function.
1265 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
1266 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
1267 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
1269 * i386.cc (Target_i386::Scan::local): Likewise.
1270 * sparc.cc (Target_sparc::Scan::local): Likewise.
1271 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
1272 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
1273 do_tls_offset_for_global): New functions.
1274 (Target_powerpc::Scan::local): Correct TLS relocations and got
1276 (Target_powerpc::Scan::global): Don't emit unnecessary
1277 dynamic relocations on TLS GOT entries.
1279 2012-09-10 Matthias Klose <doko@ubuntu.com>
1281 * config.in: Disable sanity check for kfreebsd.
1283 2012-09-10 Sterling Augustine <saugustine@google.com>
1285 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
1286 (Gdb_index::pubtypes_read): New parameter.
1287 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
1289 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
1292 2012-09-09 Alan Modra <amodra@gmail.com>
1294 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
1295 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
1296 * gc.h (gc_process_relocs): Call target gc_add_reference.
1297 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
1298 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
1299 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
1301 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
1302 to cater for when we don't need code offset. Update use.
1303 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
1304 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
1305 set_opd_valid): New functions.
1306 (Target_powerpc::do_gc_add_reference): New function.
1307 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
1309 (Target_powerpc::do_gc_mark_symbol): New function.
1311 2012-09-06 Cary Coutant <ccoutant@google.com>
1313 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
1314 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
1315 (Dwarf_die::skip_attributes): Likewise.
1316 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
1317 * testsuite/gdb_index_test.cc (inline_func_1): New function.
1319 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
1321 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
1323 * testsuite/script_test_3.t: Add .got.plt output section
1325 * testsuite/script_test_4.t: Likewise.
1327 2012-09-05 Alan Modra <amodra@gmail.com>
1329 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
1330 update all uses and lose "enum" when using type.
1332 2012-09-05 Alan Modra <amodra@gmail.com>
1334 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
1335 * configure: Regenerate.
1336 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
1337 (plugin_final_layout.stdout): Likewise.
1338 (memory_test): Set page sizes to 0x1000.
1339 * testsuite/Makefile.in: Regenerate.
1340 * testsuite/discard_locals_test.sh: Add FIXME comment.
1341 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
1342 * testsuite/pr14265.t: Add .got output section statement.
1343 * testsuite/script_test_2.t: Likewise.
1344 * testsuite/script_test_3.t: Likewise.
1345 * testsuite/script_test_4.t: Likewise.
1346 * testsuite/script_test_5.t: Likewise.
1347 * testsuite/script_test_6.t: Likewise.
1348 * testsuite/script_test_7.t: Likewise.
1349 * testsuite/script_test_9.t: Likewise.
1351 2012-09-05 Alan Modra <amodra@gmail.com>
1353 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
1354 (Powerpc_relocate_functions::Status): New typedef.
1355 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1356 (Target_powerpc::Scan::local): Handle REL64.
1357 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
1358 for REL32 and REL64.
1359 (Target_powerpc::symval_for_branch): New function, extracted from..
1360 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
1361 checks. Report overflow errors.
1363 2012-09-05 Alan Modra <amodra@gmail.com>
1365 * object.h (Sized_relobj_file::emit_relocs): Delete.
1366 (Sized_relobj_file::emit_relocs_reltype): Delete.
1367 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
1368 relocate_relocs for --emit-relocs.
1369 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
1370 * output.h: Update comment.
1371 (Output_segment::first_section): New function.
1372 (Output_segment::first_section_load_address): Use first_section.
1373 * output.cc (Output_segment::first_section): New function extracted..
1374 (Output_segment::first_section_load_address): ..from here. Delete.
1375 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
1376 * target.h (Sized_target::relocate_for_relocatable): Likewise.
1377 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
1378 adjust call to target.h function.
1379 * i386.cc (Target_i386): Likewise.
1380 * sparc.cc (Target_sparc): Likewise.
1381 * x86_64.cc (Target_x86_64): Likewise.
1382 * powerpc.cc (Target_powerpc): Likewise.
1383 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
1384 first tls section has section symbol for optimised local dynamic
1386 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
1387 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
1389 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
1390 Rename to relocate_relocs. Update error message.
1392 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
1394 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
1397 2012-08-31 Alan Modra <amodra@gmail.com>
1399 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
1400 (Powerpc_relobj::toc_base_offset): New stub function.
1401 (Target_powerpc): Add tp_offset, dtp_offset. Rename
1402 got_mod_index_offset to tlsld_got_offset. Update all refs.
1403 (Target_powerpc::Relocate::enum skip_tls): New.
1404 (Target_powerpc::call_tls_get_addr_): New var.
1405 (Target_powerpc::is_branch_reloc): Move to file scope.
1406 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
1407 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
1409 (Target_powerpc::enum Got_type): Delete old values, add new ones.
1410 (powerpc_info): Correct common_pagesize for ppc64.
1411 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
1412 (Powerpc_relocate_functions): Add overflow check enums and functions.
1413 Add non-shift version of rela, rela_ua. Delete all rel public
1414 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
1415 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
1416 addr16_ha3, addr14 functions.
1417 (Output_data_got_powerpc::add_constant_pair): New function.
1418 (Output_data_got_powerpc::got_base_offset): Likewise.
1419 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
1420 (instruction constants): Sort, add some more.
1421 (Output_data_glink::do_write): Add and use Address typedef. Use
1422 object->toc_base_offset() stub for 64-bit.
1423 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
1424 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1425 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
1426 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
1427 Always treat .opd relocs as against locally defined symbol.
1428 Correct condition for RELATIVE relocs.
1429 (Target_powerpc::do_finalize_sections): Test for NULL sections.
1430 (Target_powerpc::Relocate::relocate): Use plt call stub as value
1431 for 32-bit syms with a plt entry. Correct ppc64 toc base
1432 calculations. Handle TLS relocs, and more. Add overflow
1433 checking and adjust for Powerpc_relocate_functions changes.
1434 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
1435 Reinstate --emit-relocs code with FIXME.
1437 2012-08-30 Alan Modra <amodra@gmail.com>
1439 * layout.cc (Layout::set_segment_offsets): Set p_align to
1440 abi_pagesize, not common_pagesize.
1441 (Layout::relaxation_loop_body): Similarly use abi_pagesize
1442 to determine whether file header can go in segment.
1444 2012-08-30 Alan Modra <amodra@gmail.com>
1446 * output.h (Output_reloc::Output_reloc <output section>): Add
1447 is_relative param. Adjust calls.
1448 (Output_reloc::add_output_section_relative): New functions.
1449 * output.cc (Output_reloc::Output_reloc <output section>): Handle
1451 (Output_reloc::symbol_value): Handle SECTION_CODE.
1453 2012-08-24 Sriraman Tallam <tmsriram@google.com>
1455 * gold.cc (queue_middle_tasks): Call layout again when unique
1456 segments for sections is desired.
1457 * layout.cc (Layout::Layout): Initialize new members.
1458 (Layout::get_output_section_flags): New function.
1459 (Layout::choose_output_section): Call get_output_section_flags.
1460 (Layout::layout): Make output section for mapping to a unique segment.
1461 (Layout::insert_section_segment_map): New function.
1462 (Layout::attach_allocated_section_to_segment): Make unique segment for
1463 output sections marked so.
1464 (Layout::segment_precedes): Check for unique segments when sorting.
1465 * layout.h (Layout::Unique_segment_info): New struct.
1466 (Layout::Section_segment_map): New typedef.
1467 (Layout::insert_section_segment_map): New function.
1468 (Layout::get_output_section_flags): New function.
1469 (Layout::is_unique_segment_for_sections_specified): New function.
1470 (Layout::set_unique_segment_for_sections_specified): New function.
1471 (Layout::unique_segment_for_sections_specified_): New member.
1472 (Layout::section_segment_map_): New member.
1473 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
1474 Rename is_gc_pass_one to is_pass_one.
1475 Rename is_gc_pass_two to is_pass_two.
1476 Rename is_gc_or_icf to is_two_pass.
1477 Check for which pass based on whether symbols data is present.
1478 Make it two pass when unique segments for sections is desired.
1479 * output.cc (Output_section::Output_section): Initialize new
1481 * output.h (Output_section::is_unique_segment): New function.
1482 (Output_section::set_is_unique_segment): New function.
1483 (Output_section::is_unique_segment_): New member.
1484 (Output_section::extra_segment_flags): New function.
1485 (Output_section::set_extra_segment_flags): New function.
1486 (Output_section::extra_segment_flags_): New member.
1487 (Output_section::segment_alignment): New function.
1488 (Output_section::set_segment_alignment): New function.
1489 (Output_section::segment_alignment_): New member.
1490 (Output_segment::Output_segment): Initialize is_unique_segment_.
1491 (Output_segment::is_unique_segment): New function.
1492 (Output_segment::set_is_unique_segment): New function.
1493 (Output_segment::is_unique_segment_): New member.
1494 * plugin.cc (allow_unique_segment_for_sections): New function.
1495 (unique_segment_for_sections): New function.
1496 (Plugin::load): Add new functions to transfer vector.
1497 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
1498 * Makefile.in: Regenerate.
1499 * testsuite/plugin_final_layout.sh: Check if unique segment
1500 functionality works.
1501 * testsuite/plugin_section_order.c (onload): Check if new interfaces
1503 (allow_unique_segment_for_sections): New global.
1504 (unique_segment_for_sections): New global.
1505 (claim_file_hook): Call allow_unique_segment_for_sections.
1506 (all_symbols_read_hook): Call unique_segment_for_sections.
1508 2012-08-22 Cary Coutant <ccoutant@google.com>
1510 * layout.cc (Layout::include_section): Don't assert on GROUP
1511 sections with --emit-relocs.
1513 2012-08-21 Cary Coutant <ccoutant@google.com>
1515 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
1516 if --export-dynamic-symbol names an undef symbol.
1518 2012-08-18 Alan Modra <amodra@gmail.com>
1520 * powerpc.cc: Formatting and white space.
1521 (Powerpc_relobj): Rename got2_section_ to special_.
1522 Add opd_ent_shndx_ and opd_ent_off_ vectors.
1523 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
1524 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
1525 (Target_powerpc): Add Address typedef and invalid_address. Use
1527 (Target_powerpc::is_branch_reloc): New function.
1528 (Powerpc_relocate_functions): Add Address typedef, use throughout.
1529 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
1530 for dst_mask, value and addend.
1531 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
1532 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
1533 (Output_data_glink::do_write): Correct toc base. Don't try to use
1534 uint16_t for 24-bit offset. Use get_output_section_offset and
1536 (Target_powerpc::Scan::local): Handle more relocs.
1537 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
1538 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
1539 Plug in toc restoring insn after plt calls. Translate branches
1540 to function descriptor symbols to corresponding entry point.
1541 (Target_powerpc::relocate_for_relocatable): Check return from
1542 get_output_section_offset.
1543 * symtab.h: Comment typo.
1545 2012-08-14 Ian Lance Taylor <iant@google.com>
1547 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
1548 unsupported_relocal_local to call unsupported_reloc_global.
1550 2012-08-14 Nick Clifton <nickc@redhat.com>
1553 * script-sections.cc (Sections_element::output_section_name): Add
1554 keep return parameter.
1555 (Output_section_element::match_name): Add keep return parameter.
1556 Return the value of the keep_ member.
1557 * script-sections.h (class Output_section): Update
1558 output_section_name prototype.
1559 * layout.cc (Layout::keep_input_section): New public member
1561 (Layout::choose_output_section): Pass keep parameter to
1562 output_section_name.
1563 * layout.h (class Layout): Add keep_input_section.
1564 * object.cc (Sized_relobj_file::do_layout): Check for kept input
1566 * testsuite/Makefile.am: Add a test.
1567 * testsuite/Makefile.in: Regenerate.
1568 * testsuite/pr14265.c: Source file for the test.
1569 * testsuite/pr14265.t: Linker script for the test.
1570 * testsuite/pr14265.sh: Shell script for the test.
1572 2012-08-14 Alan Modra <amodra@gmail.com>
1574 * target.h (Target::output_section_name): New function.
1575 (Target::do_output_section_name): New function.
1576 * layout.cc (Layout::choose_output_section): Call the above.
1577 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
1579 2012-08-14 Alan Modra <amodra@gmail.com>
1581 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
1582 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
1583 for replace_constant call.
1584 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
1585 (Output_data_glink::do_print_to_mapfile): New function.
1586 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
1587 (Target_powerpc::Relocate::relocate): Likewise.
1589 2012-08-14 Alan Modra <amodra@gmail.com>
1591 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
1592 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
1593 (Output_data_glink::add_entry,find_entry): Remove shndx param.
1594 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
1595 all references to shndx_. Handle special case for R_PPC_PLTREL24
1597 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
1598 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
1599 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
1601 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
1602 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
1604 2012-08-12 Alan Modra <amodra@gmail.com>
1606 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
1607 (glink insn constants): Use uint32_t.
1608 (Output_data_glink::add_entry): Use insert, not [] operator.
1610 2012-08-11 Alan Modra <amodra@gmail.com>
1612 * object.h (Sized_relobj_file::find_shdr): New function.
1613 (Sized_relobj_file::find_special_sections): New function.
1614 * object.cc (Sized_relobj_file::find_shdr): New function.
1615 (Sized_relobj_file::find_eh_frame): Use find_shdr.
1616 (Sized_relobj_file::find_special_sections): New function, split out..
1617 (Sized_relobj_file::do_read_symbols): ..from here.
1618 * output.h (Output_data_got::replace_constant): New function.
1619 (Output_data_got::num_entries): New function.
1620 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
1621 (Output_data_got::got_offset): Protected rather than private.
1622 (Output_data_got::replace_got_entry): New function.
1623 * output.cc (Output_data_got::replace_got_entry): New function.
1624 * powerpc.cc (class Powerpc_relobj): New.
1625 (class Powerpc_relocate_functions): Delete all psymval variants or
1626 convert to value,addend type. Delete pcrela, pcrela_unaligned.
1627 Implement _ha functions using corresponding _hi function.
1628 (Powerpc_relobj::find_special_sections): New function.
1629 (Target_powerpc::do_make_elf_object): New function.
1630 (class Output_data_got_powerpc): New.
1631 (class Output_data_glink): New.
1632 (class Powerpc_scan_relocatable_reloc): New.
1633 Many more changes througout file.
1635 2012-08-09 Nick Clifton <nickc@redhat.com>
1637 * po/vi.po: Updated Vietnamese translation.
1639 2012-08-07 Ian Lance Taylor <iant@google.com>
1641 * layout.cc (Layout::add_target_dynamic_tags): If
1642 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
1645 2012-07-30 Nick Clifton <nickc@redhat.com>
1647 * po/gold.pot: Updated template.
1648 * po/es.po: Updated Spanish translation.
1650 2012-07-18 Cary Coutant <ccoutant@google.com>
1653 * configure.ac: Add check for -gpubnames support.
1654 * configure: Regenerate.
1655 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
1656 support; force -gno-pubnames.
1657 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
1659 (gdb_index_test_4): New test.
1660 * testsuite/Makefile.in: Regenerate.
1661 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
1662 * testsuite/gdb_index_test_2.sh: Likewise.
1663 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
1664 * testsuite/gdb_index_test_4.sh: New script.
1665 * testsuite/gdb_index_test_comm.sh: New script with common code;
1666 don't look for space after colon.
1668 2012-07-16 Sriraman Tallam <tmsriram@google.com>
1670 * gold.cc (queue_middle_tasks): Update function order only after
1671 deferred objects due to plugins are processed.
1673 2012-07-11 Ian Lance Taylor <iant@google.com>
1675 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
1676 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
1677 (Target_arm::scan_reloc_for_stub): Likewise.
1678 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
1679 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
1680 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
1681 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
1682 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
1684 2012-07-10 Dodji Seketeli <dodji@redhat.com>
1685 Ian Lance Taylor <iant@google.com>
1688 * configure.ac: Test whether std::tr1::hash<off_t> works.
1689 * gold.h: Add a specialization for std::tr1::hash<off_t> if
1691 * output.h (class Output_fill): Add virtual destructor.
1692 * configure, config.in: Rebuild.
1694 2012-06-22 Roland McGrath <mcgrathr@google.com>
1696 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
1698 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
1700 * plugin.cc (Plugin::load): Handle position independent executables.
1702 2012-06-06 Cary Coutant <ccoutant@google.com>
1704 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
1706 (lines_only_debug_sections): Likewise.
1707 (gdb_fast_lookup_sections): New static array.
1708 (is_gdb_debug_section): Rename formal parameter.
1709 (is_lines_only_debug_section): Likewise.
1710 (is_gdb_fast_lookup_section): New function.
1711 (Layout::include_section): Check for ".zdebug_" prefix; pass
1712 section name suffix to is_gdb_debug_section, et al.; check for
1713 fast-lookup sections when building .gdb_index.
1714 * options.h (--strip-debug-gdb): Update GDB version number.
1716 2012-06-06 Cary Coutant <ccoutant@google.com>
1718 * configure.ac: Add check for fallocate.
1719 * configure: Regenerate.
1720 * config.in: Regenerate.
1722 * options.h (class General_options): Add --mmap-output-file and
1723 --posix-fallocate options.
1724 * output.cc: (posix_fallocate): Remove; replace with...
1725 (gold_fallocate): New function.
1726 (Output_file::map_no_anonymous): Call gold_fallocate.
1727 (Output_file::map): Check --mmap-output-file option.
1729 2012-06-05 Jing Yu <jingyu@google.com>
1731 * gold.h (textdomain): Add do {} to empty while(0).
1732 (bindtextdomain): Likewise.
1734 2012-06-04 Cary Coutant <ccoutant@google.com>
1736 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
1739 2012-05-25 Sriraman Tallam <tmsriram@google.com>
1741 * symtab.cc (Symbol_table::define_special_symbol):
1742 Initialize *poldsym to prevent uninitialized variable errors.
1744 2012-05-23 Cary Coutant <ccoutant@google.com>
1746 * layout.cc (Layout::section_name_mapping): Add rules to handle
1747 exact match on .data.rel.ro.local or .data.rel.ro.
1748 (Layout::output_section_name): Check for exact matches.
1750 2012-05-23 Cary Coutant <ccoutant@google.com>
1752 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
1755 2012-05-22 Cary Coutant <ccoutant@google.com>
1757 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
1758 object before exporting symbol.
1760 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
1762 * testsuite/tls_test.cc: Include "config.h" first.
1763 * testsuite/tls_test_c.c: Likewise.
1765 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
1766 Nick Clifton <nickc@redhat.com>
1769 * configure.in: Add check that sysdep.h has been included before
1770 any system header files.
1771 * configure: Regenerate.
1772 * config.in: Regenerate.
1774 2012-05-14 Cary Coutant <ccoutant@google.com>
1776 * layout.cc (Layout::make_output_section): Mark .tdata section
1778 * testsuite/relro_test.cc: Add a TLS variable.
1780 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
1783 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
1784 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
1787 2012-05-08 Cary Coutant <ccoutant@google.com>
1789 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
1790 (lines_only_debug_sections): Likewise.
1792 2012-05-02 Roland McGrath <mcgrathr@google.com>
1794 * nacl.cc: New file.
1796 * Makefile.am (CCFILES, HFILES): Add them.
1797 * Makefile.in: Regenerate.
1798 * i386.cc (Output_data_plt_i386_nacl): New class.
1799 (Output_data_plt_i386_nacl_exec): New class.
1800 (Output_data_plt_i386_nacl_dyn): New class.
1801 (Target_i386_nacl): New class.
1802 (Target_selector_i386_nacl): New class.
1803 (target_selector_i386): Use it instead of Target_selector_i386.
1804 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
1805 (Target_x86_64_nacl): New class.
1806 (Target_selector_x86_64_nacl): New class.
1807 (target_selector_x86_64, target_selector_x32): Use it instead of
1808 Target_selector_x86_64.
1809 * arm.cc (Output_data_plt_arm_nacl): New class.
1810 (Target_arm_nacl): New class.
1811 (Target_selector_arm_nacl): New class.
1812 (target_selector_arm, target_selector_armbe): Use it instead of
1813 Target_selector_arm.
1815 * target-select.cc (select_target): Take new Input_file* and off_t
1816 arguments, pass them on to recognize method of selector.
1817 * object.cc (make_elf_sized_object): Update caller.
1818 * parameters.cc (parameters_force_valid_target): Likewise.
1819 * incremental.cc (make_sized_incremental_binary): Likewise.
1820 * target-select.h: Update decl.
1821 (Target_selector::recognize): Take new Input_file* argument,
1822 pass it on to do_recognize.
1823 (Target_selector::do_recognize): Take new Input_file* argument.
1824 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
1825 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
1826 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
1827 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
1829 * target.h (Target::Target_info): New members isolate_execinstr
1831 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
1832 * arm.cc (Target_arm::arm_info): Update initializer.
1833 * i386.cc (Target_i386::i386_info): Likewise.
1834 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
1835 * sparc.cc (Target_sparc::sparc_info): Likewise.
1836 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1837 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1838 * layout.cc (Layout::attach_allocated_section_to_segment):
1839 Take new const Target* argument. If target->isolate_execinstr(), act
1841 (Layout::find_first_load_seg): Take new const Target* argument;
1842 if target->isolate_execinstr(), reject PF_X segments.
1843 (Layout::relaxation_loop_body): Update caller.
1844 (Layout::set_segment_offsets): If target->isolate_execinstr(),
1845 reset file offset to zero when we hit LOAD_SEG, and then do a second
1846 loop over the segments before LOAD_SEG to reassign offsets after
1847 addresses have been determined. Handle target->rosegment_gap().
1848 (Layout::attach_section_to_segment): Take new const Target* argument;
1849 pass it to attach_allocated_section_to_segment.
1850 (Layout::make_output_section): Update caller.
1851 (Layout::attach_sections_to_segments): Take new const Target* argument;
1852 pass it to attach_section_to_segment.
1853 * gold.cc (queue_middle_tasks): Update caller.
1854 * layout.h (Layout): Update method decls with new arguments.
1856 * arm.cc (Target_arm::Target_arm): Take optional argument for the
1857 Target_info pointer to use.
1858 (Target_arm::do_make_data_plt): New virtual method.
1859 (Target_arm::make_data_plt): New method that calls it.
1860 (Target_arm::make_plt_entry): Use it.
1861 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
1862 for the section alignment.
1863 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
1865 (Output_data_plt_arm::first_plt_entry_offset): Call it.
1866 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
1868 (Output_data_plt_arm::get_plt_entry_size): Call it.
1869 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
1870 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
1871 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
1873 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
1874 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
1875 method instead of sizeof(plt_entry).
1876 (Output_data_plt_arm::add_entry): Likewise.
1877 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
1878 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
1880 (Target_arm::plt_entry_size): Likewise.
1881 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
1883 (Output_data_plt_arm_standard): ... here, new class.
1884 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
1885 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
1886 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
1888 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1889 Take additional argument for the PLT entry size.
1890 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
1891 Use get_plt_entry_size method rather than plt_entry_size variable.
1892 (Output_data_plt_x86_64::reserve_slot): Likewise.
1893 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
1894 (Output_data_plt_x86_64::add_entry): Likewise.
1895 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
1896 (Output_data_plt_x86_64::address_for_global): Likewise.
1897 (Output_data_plt_x86_64::address_for_local): Likewise.
1898 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1899 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
1900 Make method non-static.
1901 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
1903 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
1904 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
1905 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
1906 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
1908 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
1909 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
1911 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
1912 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
1914 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
1915 (Output_data_plt_x86_64::plt_entry_size)
1916 (Output_data_plt_x86_64::first_plt_entry)
1917 (Output_data_plt_x86_64::plt_entry)
1918 (Output_data_plt_x86_64::tlsdesc_plt_entry)
1919 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
1920 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
1921 (Output_data_plt_x86_64_standard): ... here, new class.
1922 (Target_x86_64::Target_x86_64): Take optional argument for the
1923 Target_info pointer to use.
1924 (Target_x86_64::do_make_data_plt): New virtual method.
1925 (Target_x86_64::make_data_plt): New method to call it.
1926 (Target_x86_64::init_got_plt_for_update): Use that.
1927 Call this->plt_->add_eh_frame method here.
1928 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
1929 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
1930 rather than static method.
1931 (Target_x86_64::plt_entry_size): Likewise.
1932 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
1933 rather than plt_entry_size variable. Move guts of PLT filling to...
1934 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
1935 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
1936 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
1938 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
1939 additional argument for the section alignment.
1940 Don't do add_eh_frame_for_plt here.
1941 (Output_data_plt_i386::first_plt_entry_offset): Make the method
1942 non-static. Use get_plt_entry_size method rather than plt_entry_size
1944 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
1946 (Output_data_plt_i386::get_plt_entry_size): Call it.
1947 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
1948 (Output_data_plt_i386::add_eh_frame): New method to call it.
1949 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
1951 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
1952 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
1954 (Output_data_plt_i386::fill_plt_entry): New method to call it.
1955 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
1956 method instead of plt_entry_size.
1957 (Output_data_plt_i386::plt_entry_size)
1958 (Output_data_plt_i386::plt_eh_frame_fde_size)
1959 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
1960 (Output_data_plt_i386_standard): ... here, new class.
1961 (Output_data_plt_i386_exec): New class.
1962 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
1963 (Output_data_plt_i386_exec::first_plt_entry): ... here.
1964 (Output_data_plt_i386::exec_plt_entry): Move to ...
1965 (Output_data_plt_i386_exec::plt_entry): ... here.
1966 (Output_data_plt_i386_dyn): New class.
1967 (Output_data_plt_i386::first_plt_entry): Move to ...
1968 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
1969 (Output_data_plt_i386::dyn_plt_entry): Move to ...
1970 (Output_data_plt_i386_dyn::plt_entry): ... here.
1971 (Target_i386::Target_i386): Take optional argument for the Target_info
1973 (Target_i386::do_make_data_plt): New virtual method.
1974 (Target_i386::make_data_plt): New method to call it.
1975 (Target_i386::make_plt_section): Use that.
1976 Call this->plt_->add_eh_frame method here.
1977 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
1978 rather than plt_entry_size variable.
1979 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
1980 (Output_data_plt_i386::address_for_local): Likewise.
1981 (Output_data_plt_i386::do_write): Likewise.
1982 Move guts of PLT filling to...
1983 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
1984 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
1985 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
1986 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
1988 2012-05-01 Cary Coutant <ccoutant@google.com>
1990 * dwarf_reader.cc (Dwarf_die::read_attributes)
1991 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
1992 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
1993 * reduced_debug_output.cc
1994 (Output_reduced_debug_info_section::get_die_end): Remove
1995 DW_FORM_GNU_ref_index. Add default case.
1997 2012-04-26 Mark Wielaard <mjw@redhat.com>
1999 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
2000 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
2001 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
2002 DW_AT_high_pc as offset from DW_AT_low_pc.
2004 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
2005 * testsuite/Makefile.in: Regenerate.
2006 * testsuite/gdb_index_test_3.c: New test source file.
2007 * testsuite/gdb_index_test_3.sh: New test source file.
2009 2012-04-25 Ian Lance Taylor <iant@google.com>
2011 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
2013 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
2014 as a class, not a struct.
2015 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
2016 (Target_arm::apply_cortex_a8_workaround): Likewise.
2017 * gc.h: Declare Reloc_types as a struct, not a class.
2018 * object.h: Declare Symbols_data as a struct.
2019 * reloc.h: Declare Read_relocs_data as a struct.
2020 * target.h: Declare Relocate_info as a struct.
2022 2012-04-24 David S. Miller <davem@davemloft.net>
2024 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
2025 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
2028 2012-04-24 Cary Coutant <ccoutant@google.com>
2030 * incremental-dump.cc (find_input_containing_global): Replace
2031 magic number with symbolic constant.
2032 (dump_incremental_inputs): Update version number.
2033 * incremental.cc (Output_section_incremental_inputs): Update version
2034 number; import symbolic constants from Incremental_inputs_reader.
2035 (Incremental_inputs::create_data_sections): Align relocations
2036 section correctly for 64-bit targets.
2037 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
2038 constants; add padding.
2039 (Output_section_incremental_inputs::write_header): Add assert for
2041 (Output_section_incremental_inputs::write_input_files): Add assert
2042 for input_entry_size.
2043 (Output_section_incremental_inputs::write_info_blocks): Add padding;
2044 add assert for object_info_size, input_section_entry_size,
2045 global_sym_entry_size.
2046 * incremental.h (Incremental_inputs_reader): Add symbolic constants
2047 for data structure sizes; use them.
2048 (Incremental_input_entry_reader): Import symbolic constants from
2049 Incremental_inputs_reader; use them.
2051 2012-04-23 David S. Miller <davem@davemloft.net>
2053 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
2055 (Target_sparc::Target_sparc): Initialize new fields.
2056 (Target_sparc::do_make_elf_object): New function.
2057 (Target_sparc::do_adjust_elf_header): New function.
2059 2012-04-23 Cary Coutant <ccoutant@google.com>
2061 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
2062 CU range table of gdb index.
2064 2012-04-20 David S. Miller <davem@davemloft.net>
2066 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
2069 2012-04-16 David S. Miller <davem@davemloft.net>
2071 * sparc.cc (Target_sparc::got_address): New function.
2072 (Sparc_relocate_functions::gdop_hix22): New function.
2073 (Sparc_relocate_functions::gdop_lox10): New function.
2074 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
2076 (Target_sparc::Scan::local): Likewise if the global symbol is not
2077 preemptible and is not IFUNC.
2078 (Target_sparc::Relocate::relocate): Perform GOTDATA code
2079 transformations for local and non-preemptible non-IFUNC global
2082 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
2083 writing out 64-bit part of ranges.
2085 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
2086 -fpic and -fpie respectively.
2087 * Makefile.in: Regenerate.
2089 * sparc.cc (class Target_sparc): Add rela_ifunc_.
2090 (Target_sparc::Target_sparc): Initialize new field.
2091 (Target_sparc::do_plt_section_for_global): New function.
2092 (Target_sparc::do_plt_section_for_local): New function.
2093 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
2094 (Target_sparc::make_plt_section): New function, broken out of
2095 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
2096 (Target_sparc::make_plt_entry): Call make_plt_section.
2097 (Target_sparc::make_local_ifunc_plt_entry): New function.
2098 (Target_sparc::rela_ifunc_section): New function.
2099 (Target_sparc::plt_section): Remove const.
2100 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
2101 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
2102 and ifunc_count_ fields.
2103 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
2104 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
2105 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
2106 (Output_data_plt_sparc::rela_ifunc): New function.
2107 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
2108 (Output_data_plt_sparc::has_ifunc_section): New function.
2109 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
2110 (Output_data_plt_sparc::address_for_global): New function.
2111 (Output_data_plt_sparc::address_for_local): New function.
2112 (Output_data_plt_sparc::plt_index_to_offset): New function.
2113 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
2115 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
2117 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
2118 R_SPARC_JMP_IREL to switch.
2119 (Target_sparc::Scan::check_non_pic): Likewise.
2120 (Target_sparc::Scan::local): Handle IFUNC symbols.
2121 (Target_sparc::Scan::local): Likewise.
2122 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
2123 and plt_address_for_local.
2124 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
2125 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
2127 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
2128 (class Output_data_reloc): Adjust calls to Output_reloc_type.
2129 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
2130 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
2132 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
2133 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
2135 * sparc.cc (Target_sparc::Scan::global): Likewise.
2136 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2138 2012-04-16 Cary Coutant <ccoutant@google.com>
2140 * archive.cc (Library_base::should_include_member): Check for
2141 --export-dynamic-symbol.
2142 * options.h (class General_options): Add --export-dynamic-symbol.
2143 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
2144 --export-dynamic-symbol.
2145 (Symbol_table::gc_mark_undef_symbols): Likewise.
2146 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
2148 2012-04-12 David S. Miller <davem@davemloft.net>
2150 * sparc.cc (Reloc::wdisp10): New relocation method.
2151 (Reloc::h34): Likewise.
2152 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
2153 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
2155 (Target_sparc::Scan::local): Likewise.
2156 (Target_sparc::Scan::global): Likewise.
2157 (Target_sparc::Relocate::relocate): Likewise.
2159 2012-04-09 Cary Coutant <ccoutant@google.com>
2161 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
2164 2012-04-06 Ian Lance Taylor <iant@google.com>
2166 * timer.cc: #include <unistd.h>.
2168 2012-04-06 Roland McGrath <mcgrathr@google.com>
2170 * configure.in (AC_CHECK_HEADERS): Add locale.h.
2171 * config.in: Regenerate.
2172 * configure: Regenerate.
2174 2012-04-05 Nick Clifton <nickc@redhat.com>
2176 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
2177 (AM_LC_MESSAGES): Add.
2178 * aclocal.m4: Regenerate.
2179 * config.in: Regenerate.
2180 * configure: Regenerate.
2182 2012-03-21 Cary Coutant <ccoutant@google.com>
2184 * Makefile.am: Add gdb-index.cc, gdb-index.h.
2185 * Makefile.in: Regenerate.
2186 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
2187 (Sized_elf_reloc_mapper::symbol_section): New function.
2188 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
2189 (make_elf_reloc_mapper): New function.
2190 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
2191 (Dwarf_abbrev_table::do_read_abbrevs): New function.
2192 (Dwarf_abbrev_table::do_get_abbrev): New function.
2193 (Dwarf_ranges_table::read_ranges_table): New function.
2194 (Dwarf_ranges_table::read_range_list): New function.
2195 (Dwarf_pubnames_table::read_section): New function.
2196 (Dwarf_pubnames_table::read_header): New function.
2197 (Dwarf_pubnames_table::next_name): New function.
2198 (Dwarf_die::Dwarf_die): New function.
2199 (Dwarf_die::read_attributes): New function.
2200 (Dwarf_die::skip_attributes): New function.
2201 (Dwarf_die::set_name): New function.
2202 (Dwarf_die::set_linkage_name): New function.
2203 (Dwarf_die::attribute): New function.
2204 (Dwarf_die::string_attribute): New function.
2205 (Dwarf_die::int_attribute): New function.
2206 (Dwarf_die::uint_attribute): New function.
2207 (Dwarf_die::ref_attribute): New function.
2208 (Dwarf_die::child_offset): New function.
2209 (Dwarf_die::sibling_offset): New function.
2210 (Dwarf_info_reader::check_buffer): New function.
2211 (Dwarf_info_reader::parse): New function.
2212 (Dwarf_info_reader::do_parse): New function.
2213 (Dwarf_info_reader::do_read_string_table): New function.
2214 (Dwarf_info_reader::lookup_reloc): New function.
2215 (Dwarf_info_reader::get_string): New function.
2216 (Dwarf_info_reader::visit_compilation_unit): New function.
2217 (Dwarf_info_reader::visit_type_unit): New function.
2218 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
2219 Sized_elf_reloc_mapper.
2220 (Sized_dwarf_line_info::symbol_section): Remove function.
2221 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
2222 (Sized_dwarf_line_info::read_line_mappings): Remove object
2223 parameter, adjust callers.
2224 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
2225 * dwarf_reader.h: Include <sys/types.h>.
2226 (class Track_relocs): Remove forward declaration.
2227 (class Elf_reloc_mapper): New class.
2228 (class Sized_elf_reloc_mapper): New class.
2229 (class Dwarf_abbrev_table): New class.
2230 (class Dwarf_range_list): New class.
2231 (class Dwarf_ranges_table): New class.
2232 (class Dwarf_pubnames_table): New class.
2233 (class Dwarf_die): New class.
2234 (class Dwarf_info_reader): New class.
2235 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
2236 (Sized_dwarf_line_info::symbol_section): Remove member function.
2237 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
2239 * gdb-index.cc: New source file.
2240 * gdb-index.h: New source file.
2241 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
2242 and .debug_types sections, call Layout::add_to_gdb_index.
2243 (Sized_relobj_incr::do_section_name): Implement.
2244 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
2245 return type; Implement.
2246 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
2248 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
2249 parameter list and return type.
2250 (Sized_incr_dynobj::do_section_contents): Likewise.
2251 * layout.cc: Include gdb-index.h.
2252 (Layout::Layout): Initialize gdb_index_data_.
2253 (Layout::init_fixed_output_section): Check for .gdb_index section.
2254 (Layout::add_to_gdb_index): New function. Instantiate.
2255 * layout.h: Add forward declaration for class Gdb_index.
2256 (Layout::add_to_gdb_index): New member function.
2257 (Layout::gdb_index_data_): New data member.
2258 * main.cc: Include gdb-index.h.
2259 (main): Print statistics for gdb index.
2260 * object.cc (Object::section_contents): Move code into
2261 do_section_contents.
2262 (need_decompressed_section): Check for sections needed when building
2264 (build_compressed_section_map): Likewise.
2265 (Sized_relobj_file::do_read_symbols): Need local symbols when building
2267 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
2268 sections; call Layout::add_to_gdb_index.
2269 (Sized_relobj_file::do_decompressed_section_contents): Call
2270 do_section_contents directly.
2271 * object.h (Object::do_section_contents): Adjust parameter list and
2273 (Object::do_decompressed_section_contents): Call do_section_contents
2275 (Sized_relobj_file::do_section_contents): Adjust parameter list and
2277 * options.h (class General_options): Add --gdb-index option.
2278 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
2279 list and return type.
2280 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
2281 * reloc.h (Track_relocs::checkpoint): New function.
2282 (Track_relocs::reset): New function.
2284 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
2286 * testsuite/Makefile.in: Regenerate.
2287 * testsuite/gdb_index_test.cc: New test source file.
2288 * testsuite/gdb_index_test_1.sh: New test source file.
2289 * testsuite/gdb_index_test_2.sh: New test source file.
2291 2012-03-19 Doug Kwan <dougkwan@google.com>
2293 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2294 (Target_arm::do_finalize_sections): Remove code which defines
2295 __exidx_start and __exidx_end. Make symbol table parameter
2296 anonymous as it is not used.
2297 * gold.cc (queue_middle_tasks): Call target hook to define any
2298 target-specific symbols.
2299 * target.h (Target::define_standard_symbols): New method.
2300 (Target::do_define_standard_symbols): Same.
2301 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
2302 * testsuite/Makefile.in: Regenerate.
2303 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
2305 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
2306 relocations are generated for __exidx_start and __exidx_end.
2308 2012-03-16 Doug Kwan <dougkwan@google.com>
2310 * testsuite/Makefile.am: Disable test initpri3b.
2311 * testsuite/Makefile.in: Regenerate.
2313 2012-03-15 Doug Kwan <dougkwan@google.com>
2315 * arm.cc (Target_arm::got_section): Make .got section read-only
2318 2012-03-15 Ian Lance Taylor <iant@google.com>
2321 * layout.cc (Layout::make_output_section): Correctly mark
2322 SHT_INIT_ARRAY, et. al., as relro.
2324 2012-03-14 Doug Kwan <dougkwan@google.com>
2326 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
2327 dynamic relocations for protected symbols in shared objects.
2329 2012-03-13 Ian Lance Taylor <iant@google.com>
2331 * resolve.cc (Symbol_table::resolve): When merging common symbols,
2332 keep the larger alignment.
2334 2012-03-12 Cary Coutant <ccoutant@google.com>
2336 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
2337 handling of DW_LNE_define_file.
2339 2012-03-12 Cary Coutant <ccoutant@google.com>
2341 * reduced_debug_output.cc
2342 (Output_reduced_debug_info_section::get_die_end): Add new FORM
2345 2012-02-29 Cary Coutant <ccoutant@google.com>
2347 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
2349 2012-02-29 Cary Coutant <ccoutant@google.com>
2351 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2352 Call Object::decompressed_section_contents.
2353 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
2355 (Sized_dwarf_line_info::buffer_start_): New data member.
2356 * merge.cc (Output_merge_data::do_add_input_section): Call
2357 Object::decompressed_section_contents.
2358 (Output_merge_string::do_add_input_section): Likewise.
2359 * object.cc (need_decompressed_section): New function.
2360 (build_compressed_section_map): Decompress sections needed later.
2361 (Sized_relobj_file::do_decompressed_section_contents): New function.
2362 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2363 * object.h (Object::decompressed_section_contents): New function.
2364 (Object::discard_decompressed_sections): New function.
2365 (Object::do_decompressed_section_contents): New function.
2366 (Object::do_discard_decompressed_sections): New function.
2367 (Compressed_section_info): New type.
2368 (Compressed_section_map): Include decompressed section contents.
2369 (Sized_relobj_file::do_decompressed_section_contents): New function.
2370 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2372 2012-02-16 Cary Coutant <ccoutant@google.com>
2374 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
2375 * testsuite/Makefile.in: Regenerate.
2377 2012-02-14 Cary Coutant <ccoutant@google.com>
2379 * options.cc (General_options::finalize): Disallow -pie and -static.
2381 2012-02-03 Doug Kwan <dougkwan@google.com>
2383 * arm.cc (Arm_relocate_functions::abs8,
2384 Arm_relocate_functions::abs16): Use
2385 Bits::has_signed_unsigned_overflow32.
2386 (Arm_relocate_functions::thm_abs8): Correct range of
2388 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
2391 2012-02-02 Doug Kwan <dougkwan@google.com>
2393 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
2394 position independent outputs, not just shared objects.
2396 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
2398 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
2399 * configure: Regenerated.
2401 2012-01-27 Ian Lance Taylor <iant@google.com>
2403 * reloc.h (Bits): New class with static functions, copied from
2404 namespace utils in arm.cc.
2405 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
2408 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2410 * incremental.cc (write_info_blocks): Correct relocation offset.
2412 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2414 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
2415 (Relocate::tls_gd_to_le): Likewise.
2417 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2419 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
2421 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2423 * configure.ac: Check if -mcmodel=medium works.
2424 * configure: Regenerated.
2426 2012-01-24 Cary Coutant <ccoutant@google.com>
2428 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
2430 (read_unsigned_LEB_128_x): ... this new function.
2431 (read_signed_LEB_128): Replaced with inline definition and ...
2432 (read_signed_LEB_128_x): ... this new function.
2433 * int_encoding.h (read_unsigned_LEB_128_x): New function.
2434 (read_unsigned_LEB_128): Add inline definition.
2435 (read_signed_LEB_128_x): New function.
2436 (read_signed_LEB_128): Add inline definition.
2437 * testsuite/Makefile.am (leb128_unittest): New unit test.
2438 * testsuite/Makefile.in: Regenerate.
2439 * testsuite/leb128_unittest.cc: New unit test.
2441 2012-01-23 Ian Lance Taylor <iant@google.com>
2444 * i386.cc (Target_i386::do_code_fill): When using a jmp
2445 instruction, pad with nop instructions.
2446 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2448 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
2450 * x86_64.cc (gc_process_relocs): Add typename on types used in
2452 (scan_relocs): Likewise.
2453 (relocate_section): Likewise.
2454 (apply_relocation): Likewise.
2456 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
2458 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
2459 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
2462 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
2464 * x86_64.cc: Initial support for x32.
2466 2012-01-03 Cary Coutant <ccoutant@google.com>
2468 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
2469 Use abstract base class for GOT.
2470 * gold/output.h (class Output_data_got_base): New abstract base class.
2471 (class Output_data_got): Derive from new base class, adjust ctors.
2472 (Output_data_got::reserve_slot): Make virtual; rename to
2473 do_reserve_slot; Adjust callers.
2474 * gold/target.h (Sized_target::init_got_plt_for_update): Return
2475 pointer to abstract base class.
2476 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
2478 2011-12-18 Ian Lance Taylor <iant@google.com>
2480 * object.h (Relobj::local_symbol_value): New function.
2481 (Relobj::local_plt_offset): New function.
2482 (Relobj::local_has_got_offset): New function.
2483 (Relobj::local_got_offset): New function.
2484 (Relobj::set_local_got_offset): New function.
2485 (Relobj::do_local_symbol_value): New pure virtual function.
2486 (Relobj::do_local_plt_offset): Likewise.
2487 (Relobj::do_local_has_got_offset): Likewise.
2488 (Relobj::do_local_got_offset): Likewise.
2489 (Relobj::do_set_local_got_offset): Likewise.
2490 (Sized_relobj::do_local_has_got_offset): Rename from
2491 local_has_got_offset.
2492 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
2493 (Sized_relobj::do_set_local_got_offset): Rename from
2494 set_local_got_offset.
2495 (Sized_relobj_file::do_local_plt_offset): Rename from
2497 (Sized_relobj_file::do_local_symbol_value): New function.
2498 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
2500 * output.cc (Output_data_got::Got_entry::write): Change object to
2501 Relobj. Use local_symbol_value.
2502 (Output_data_got::add_global_with_rel): Change rel_dyn to
2503 Output_data_reloc_generic*. Use add_global_generic.
2504 (Output_data_got::add_global_with_rela): Remove. Change all
2505 callers to use add_global_with_rel.
2506 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
2507 Output_data_reloc_generic*. Use add_global_generic.
2508 (Output_data_got::add_global_pair_with_rela): Remove. Change all
2509 callers to use add_global_pair_with_rel.
2510 (Output_data_got::add_local): Change object to Relobj*.
2511 (Output_data_got::add_local_plt): Likewise.
2512 (Output_data_got::add_local_with_rel): Change object to Relobj*,
2513 change rel_dyn to Output_data_reloc_generic*. Use
2515 (Output_data_got::add_local_with_rela): Remove. Change all
2516 callers to use all_local_with_rel.
2517 (Output_data_got::add_local_pair_with_rel): Change object to
2518 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
2519 add_output_section_generic.
2520 (Output_data_got::add_local_pair_with_rela): Remove. Change all
2521 callers to use add_local_pair_with_rel.
2522 (Output_data_got::reserve_local): Change object to Relobj*.
2523 * output.h: (class Output_data_reloc_generic): Add pure virtual
2524 declarations for add_global_generic, add_local_generic,
2525 add_output_section_generic.
2526 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
2527 functions for Output_data_reloc_generic. Update declarations for
2528 changes listed in output.cc.
2529 (class Output_data_got): Change template parameter to got_size.
2530 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
2531 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
2533 (Sized_relobj_incr::do_local_plt_offset): New function.
2534 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
2537 2011-12-17 Cary Coutant <ccoutant@google.com>
2539 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
2540 * resolve.cc (Symbol_table::resolve): Likewise.
2541 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
2543 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2545 2011-12-16 Ian Lance Taylor <iant@google.com>
2547 * output.h (Output_data_reloc_generic::add): Only call
2548 add_dynamic_reloc if this is a dynamic reloc section.
2550 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
2553 * target-reloc.h (apply_relocation): Replace <64, false> with
2556 2011-11-25 Nick Clifton <nickc@redhat.com>
2558 * po/it.po: New Italian translation.
2560 2011-11-17 Sterling Augustine <saugustine@google.com>
2562 * script.cc (script_include_directive): Implement.
2563 (read_script_file): New local variables name and search_path. Update
2564 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
2565 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
2566 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
2568 2011-11-11 Sterling Augustine <saugustine@google.com>
2570 * yyscript.y (section_cmd): Add support for INCLUDE directive.
2571 (file_or_sections_cmd): Likewise.
2573 2011-11-11 Doug Kwan <dougkwan@google.com>
2575 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
2576 if --just-symbols is given.
2578 2011-11-10 Doug Kwan <dougkwan@google.com>
2581 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
2582 when processing data relocs.
2583 * reloc.h (Relocate_functions::rel_unaligned): New method.
2584 (Relocate_functions::pcrel_unaligned): Ditto.
2585 (Relocate_functions::rel32_unaligned): Ditto.
2586 (Relocate_functions::pcrel32_unaligned): Ditto.
2588 2011-11-09 Doug Kwan <dougkwan@google.com>
2591 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
2592 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
2593 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
2594 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2595 (Relocate_functions::rel_unaligned): New.
2596 (Relocate_functions::rel32_unaligned): New.
2597 * target-reloc.h (relocate_for_relocatable): Add code to handle
2598 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2599 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
2600 arm_unaligned_reloc_r): New targets.
2601 * testsuite/Makefile.in: Regenerate.
2602 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
2605 2011-11-02 Ian Lance Taylor <iant@google.com>
2607 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
2609 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
2610 * options.cc (General_options::finalize): Use library search path
2611 from configure script if specified. If not native and no sysroot,
2612 only search TOOLLIBDIR.
2613 * options.h (Search_directory::Search_directory): Change name to
2615 (General_options::add_to_library_path_with_sysroot): Change arg to
2617 * configure, Makefile.in, config.in: Rebuild.
2619 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2621 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
2622 we are working around the ARM1176 Erratum.
2623 * options.h (General_options::fix_arm1176): Add option.
2624 * testsuite/Makefile.am: Add testcases, and keep current ones
2626 * testsuite/Makefile.in: Regenerate.
2627 * testsuite/arm_fix_1176.s: New file.
2628 * testsuite/arm_fix_1176.sh: Likewise.
2630 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2632 * arm.cc (Target_arm::Target_arm): Remove initialisation of
2634 (Target_arm::may_use_blx): Remove method.
2635 (Target_arm::set_may_use_blx): Likewise.
2636 (Target_arm::may_use_v4t_interworking): New method.
2637 (Target_arm::may_use_v5t_interworking): Likewise.
2638 (Target_arm::may_use_blx_): Remove member variable.
2639 (Arm_relocate_functions::arm_branch_common): Check for v5T
2641 (Arm_relocate_functions::thumb_branch_common): Likewise.
2642 (Reloc_stub::stub_type_for_reloc): Likewise.
2643 (Target_arm::do_finalize_sections): Correct interworking checks.
2644 * testsuite/Makefile.am: Add new tests.
2645 * testsuite/Makefile.in: Regenerate.
2646 * testsuite/arm_farcall_arm_arm.s: New test.
2647 * testsuite/arm_farcall_arm_arm.sh: Likewise.
2648 * testsuite/arm_farcall_arm_thumb.s: Likewise.
2649 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
2650 * testsuite/arm_farcall_thumb_arm.s: Likewise.
2651 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
2652 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
2653 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
2655 2011-10-31 Cary Coutant <ccoutant@google.com>
2658 * expression.cc (Expression::eval_with_dot): Add
2659 is_section_dot_assignment parameter.
2660 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
2661 absolute and assigning to dot within a section.
2662 * script-sections.cc
2663 (Output_section_element_assignment::set_section_addresses): Pass
2664 dot_section to set_if_absolute.
2665 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
2666 as is_section_dot_assignment flag to eval_with_dot.
2667 (Output_section_element_dot_assignment::set_section_addresses):
2669 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
2670 parameter. Also set value if relative to dot_section; set the
2671 symbol's output_section.
2672 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
2673 parameter. Adjust all callers.
2674 (Expression::eval_maybe_dot): Likewise.
2675 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
2677 * testsuite/script_test_2.t: Test assignment of an absolute value
2678 to dot within an output section element.
2680 2011-10-31 Cary Coutant <ccoutant@google.com>
2682 * options.h (class General_options): Add --[no-]gnu-unique options.
2683 * symtab.cc (Symbol_table::sized_write_globals): Convert
2684 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
2686 2011-10-31 Cary Coutant <ccoutant@google.com>
2689 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
2690 unnecessary assertion.
2691 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
2693 2011-10-31 Sriraman Tallam <tmsriram@google.com>
2695 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2697 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2699 Change to just keep the section associated with symbol.
2700 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
2701 they are externally visible and --export-dynamic is turned on.
2702 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
2704 2011-10-19 Ian Lance Taylor <iant@google.com>
2707 * script-sections.cc
2708 (Output_section_element_dot_assignment::needs_output_section): New
2711 2011-10-19 Ian Lance Taylor <iant@google.com>
2714 * layout.cc (Layout::segment_precedes): Don't assert failure if a
2715 --section-start option was seen.
2716 * options.h (General_options::any_section_start): New function.
2718 2011-10-18 David S. Miller <davem@davemloft.net>
2721 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
2722 member to track relocation locations that have moved during TLS
2723 reloc optimizations.
2724 (Target_sparc::Relocate::Relocate): Initialize to NULL.
2725 (Target_sparc::Relocate::relocate): Adjust view down by 4
2726 bytes if it matches reloc_adjust_addr_.
2727 (Target_sparc::Relocate::relocate_tls): Always move the
2728 __tls_get_addr call delay slot instruction forward 4 bytes when
2729 performing relaxation.
2731 2011-10-18 Cary Coutant <ccoutant@google.com>
2733 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
2734 (Output_file::map_no_anonymous): Check for non-zero
2735 return code from posix_fallocate.
2737 2011-10-17 Cary Coutant <ccoutant@google.com>
2740 * plugin.cc (is_visible_from_outside): Check for symbols
2741 referenced from dynamic objects.
2742 * resolve.cc (Symbol_table::resolve): Don't count references
2743 from dynamic objects as references from real ELF files.
2744 * testsuite/plugin_test_2.sh: Adjust expected result.
2746 2011-10-17 Cary Coutant <ccoutant@google.com>
2748 * gold.cc: Include timer.h.
2749 (queue_middle_tasks): Stamp time.
2750 (queue_final_tasks): Likewise.
2751 * main.cc (main): Store timer in parameters. Print timers
2753 * parameters.cc (Parameters::Parameters): Initialize timer_.
2754 (Parameters::set_timer): New function.
2755 (set_parameters_timer): New function.
2756 * parameters.h (Parameters::set_timer): New function.
2757 (Parameters::timer): New function.
2758 (Parameters::timer_): New data member.
2759 (set_parameters_timer): New function.
2760 * timer.cc (Timer::stamp): New function.
2761 (Timer::get_pass_time): New function.
2762 * timer.h (Timer::stamp): New function.
2763 (Timer::get_pass_time): New function.
2764 (Timer::pass_times_): New data member.
2766 2011-10-17 Cary Coutant <ccoutant@google.com>
2768 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
2769 task for members of lib groups.
2771 2011-10-17 Cary Coutant <ccoutant@google.com>
2774 * fileread.cc (File_read::find_view): Add assert.
2775 (File_read::make_view): Move bounds check (replace with assert)...
2776 (File_read::find_or_make_view): ... to here.
2778 2011-10-12 Cary Coutant <ccoutant@google.com>
2780 * output.cc (Output_file::open_base_file): Handle case where
2781 ::read returns less than requested size.
2783 2011-10-10 Cary Coutant <ccoutant@google.com>
2785 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
2786 Initialize defined_count_.
2787 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
2788 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
2789 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
2790 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
2791 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
2792 * incremental.h (Sized_relobj_incr::defined_count_): New data
2794 (Sized_incr_dynobj::defined_count_): New data member.
2795 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
2796 Return zeroes instead of internal error.
2798 2011-10-10 Cary Coutant <ccoutant@google.com>
2801 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
2802 (Output_reloc::symbol_value): Return PLT offset if flag is set.
2803 * output.h (class Output_reloc): Add use_plt_offset flag.
2804 (Output_reloc::type_): Adjust size of bit field.
2805 (Output_reloc::use_plt_offset_): New bit field.
2806 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
2807 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
2808 flag. Adjust all callers.
2809 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
2810 creating RELATIVE relocations.
2812 2011-10-10 Nick Clifton <nickc@redhat.com>
2814 * po/es.po: Updated Spanish translation.
2815 * po/fi.po: Updated Finnish translation.
2817 2011-10-03 Diego Novillo <dnovillo@google.com>
2819 * options.cc (parse_uint): Fix dereference of RETVAL.
2821 2011-09-29 Sriraman Tallam <tmsriram@google.com>
2823 * layout.h (section_order_map_): New member.
2824 (get_section_order_map): New member function.
2825 * output.cc (Output_section::add_input_section): Check for patterns
2826 only when --section-ordering-file is specified.
2827 * gold.cc (queue_middle_tasks): Delay updating order of sections till
2828 output_sections have been formed.
2829 * layout.cc (Layout_Layout): Initialize section_order_map_.
2830 * plugin.cc (update_section_order): Store order in order_map. Do not
2832 * testsuite/Makefile.am: Add test case for plugin_final_layout.
2833 * testsuite/Makefile.in: Regenerate.
2834 * testsuite/plugin_section_order.c: New file.
2835 * testsuite/plugin_final_layout.cc: New file.
2836 * testsuite/plugin_final_layout.sh: New file.
2838 2011-09-29 Cary Coutant <ccoutant@google.com>
2840 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2842 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
2843 symbols during incremental update.
2844 (Symbol_table::add_from_dynobj): Likewise.
2846 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2847 Ian Lance Taylor <iant@google.com>
2849 * symtab.cc (Symbol_table::define_special_symbol): Always
2850 canonicalize version string.
2852 2011-09-26 Cary Coutant <ccoutant@google.com>
2854 * gold.cc (queue_initial_tasks): Move option checks ...
2855 * options.cc (General_options::finalize): ... to here. Disable
2856 some options; make others fatal.
2858 2011-09-26 Cary Coutant <ccoutant@google.com>
2861 * plugin.cc (get_symbols_v2): New function.
2862 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
2863 (is_referenced_from_outside): New function.
2864 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
2865 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
2866 (get_symbols): Pass version parameter.
2867 (get_symbols_v2): New function.
2868 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
2870 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
2871 (onload): Add LDPT_GET_SYMBOLS_V2.
2872 (all_symbols_read_hook): Use get_symbols_v2; check for
2873 LDPR_PREVAILING_DEF_IRONLY_EXP.
2874 * testsuite/plugin_test_3.sh: Update expected results.
2876 2011-09-23 Simon Baldwin <simonb@google.com>
2878 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
2879 configuration options.
2880 * configure: Regenerate.
2881 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
2882 * Makefile.in: Regenerate.
2883 * testsuite/Makefile.in: Regenerate.
2885 2011-09-19 Sriraman Tallam <tmsriram@google.com>
2887 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
2889 2011-09-19 Cary Coutant <ccoutant@google.com>
2891 * incremental.cc (can_incremental_update): Fix typo in comment.
2892 * incremental.h (can_incremental_update): Likewise.
2894 2011-09-18 Cary Coutant <ccoutant@google.com>
2896 * incremental.cc (can_incremental_update): New function.
2897 * incremental.h (can_incremental_update): New function.
2898 * layout.cc (Layout::init_fixed_output_section): Call it.
2899 (Layout::make_output_section): Don't allow patch space in .eh_frame.
2900 * object.cc (Sized_relobj_file::do_layout): Call
2901 can_incremental_update.
2903 2011-09-13 Cary Coutant <ccoutant@google.com>
2905 * configure.ac: Check for glibc support for gnu_indirect_function
2906 support with static linking, setting automake conditional
2908 * Makefile.in: Regenerate.
2909 * configure: Regenerate.
2911 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
2912 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
2914 * testsuite/Makefile.in: Regenerate.
2916 2011-09-13 Cary Coutant <ccoutant@google.com>
2918 * incremental.cc (Sized_relobj_incr::do_layout): Call
2919 report_comdat_group for kept comdat sections.
2920 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
2921 * testsuite/Makefile.in: Regenerate.
2922 * testsuite/incr_comdat_test_1.cc: New source file.
2923 * testsuite/incr_comdat_test_2_v1.cc: New source file.
2924 * testsuite/incr_comdat_test_2_v2.cc: New source file.
2925 * testsuite/incr_comdat_test_2_v3.cc: New source file.
2927 2011-09-13 Ian Lance Taylor <iant@google.com>
2929 * object.cc (Sized_relobj_file::do_layout): Remove unused local
2930 variable external_symbols_offset.
2932 2011-09-12 Ian Lance Taylor <iant@google.com>
2934 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
2935 triggered if object has no symbols.
2937 2011-09-09 David S. Miller <davem@davemloft.net>
2939 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
2940 (Output_fill_debug_line::do_write): Likewise.
2942 2011-08-29 Cary Coutant <ccoutant@google.com>
2944 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
2945 casts to match formatting specs.
2946 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
2948 2011-08-26 Cary Coutant <ccoutant@google.com>
2950 * layout.cc (Free_list::allocate): Provide guarantee of minimum
2951 remaining hole size when allocating.
2952 (Layout::make_output_section): Set fill methods for debug sections.
2953 * layout.h (Free_list::Free_list_node): Move from private to
2955 (Free_list::set_min_hole_size): New function.
2956 (Free_list::begin, Free_list::end): New functions.
2957 (Free_list::min_hole_): New data member.
2958 * output.cc: Include dwarf.h.
2959 (Output_fill_debug_info::do_minimum_hole_size): New function.
2960 (Output_fill_debug_info::do_write): New function.
2961 (Output_fill_debug_line::do_minimum_hole_size): New function.
2962 (Output_fill_debug_line::do_write): New function.
2963 (Output_section::Output_section): Initialize new data member.
2964 (Output_section::set_final_data_size): Ensure patch space is larger
2965 than minimum hole size.
2966 (Output_section::do_write): Fill holes in debug sections.
2967 * output.h (Output_fill): New class.
2968 (Output_fill_debug_info): New class.
2969 (Output_fill_debug_line): New class.
2970 (Output_section::set_free_space_fill): New function.
2971 (Output_section::free_space_fill_): New data member.
2972 * testsuite/Makefile.am (incremental_test_3): Add
2973 --incremental-patch option.
2974 (incremental_test_4): Likewise.
2975 (incremental_test_5): Likewise.
2976 (incremental_test_6): Likewise.
2977 (incremental_copy_test): Likewise.
2978 (incremental_common_test_1): Likewise.
2979 * testsuite/Makefile.in: Regenerate.
2981 2011-08-26 Nick Clifton <nickc@redhat.com>
2983 * po/es.po: Updated Spanish translation.
2985 2011-08-01 Cary Coutant <ccoutant@google.com>
2987 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
2988 * gold/testsuite/Makefile.in: Regenerate.
2989 * gold/testsuite/justsyms_exec.c: New source file.
2990 * gold/testsuite/justsyms_lib.c: New source file.
2992 2011-08-01 Cary Coutant <ccoutant@google.com>
2994 * layout.cc (Layout::set_segment_offsets): Don't realign text
2995 segment if -Ttext was specified.
2996 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
2998 * object.h (Sized_relobj_file::e_type): New function.
2999 (Sized_relobj_file::e_type_): New data member.
3000 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
3001 base address for ET_EXEC files.
3002 * target.cc (Target::do_make_elf_object_implementation): Allow
3003 ET_EXEC files with --just-symbols option.
3005 2011-07-28 Cary Coutant <ccoutant@google.com>
3007 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
3008 Add thread_number parameter.
3009 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
3010 * workqueue-threads.cc
3011 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
3012 current thread if its thread number is greater than desired thread
3014 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
3015 Add thread_number parameter.
3016 (Workqueue::should_cancel_thread): Likewise.
3017 (Workqueue::find_runnable_or_wait): Pass thread_number to
3018 should_cancel_thread.
3019 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
3022 2011-07-22 Sriraman Tallam <tmsriram@google.com>
3024 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
3025 only after checking if it cannot be forced local.
3026 * symtab.h (is_externally_visible): Check if the symbol is not forced
3029 2011-07-15 Ian Lance Taylor <iant@google.com>
3031 * options.h (class General_options): Add --print-output-format.
3032 Move -EL next to -EB, for better --help output.
3033 * target-select.cc: Include <cstdio>, "options.h", and
3035 (Target_selector::do_target_bfd_name): New function.
3036 (print_output_format): New function.
3037 * target-select.h (class Target_selector): Update declarations.
3038 (Target_selector::target_bfd_name): New function.
3039 (print_output_format): Declare.
3040 * main.cc: Include "target-select.h".
3041 (main): Handle --print-output-format.
3042 * gold.cc: Include "target-select.h".
3043 (queue_initial_tasks): Handle --print-output-format when there are
3045 * parameters.cc (parameters_force_valid_target): Give a better
3046 error message if -EB/-EL does not match target.
3047 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
3050 2011-07-15 Ian Lance Taylor <iant@google.com>
3052 * i386.cc (class Output_data_plt_i386): Add layout_ field.
3053 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
3054 (Output_data_plt_i386::do_write): Write address of .dynamic
3055 section to first entry in .got.plt section.
3056 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
3057 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3059 (Output_data_plt_x86_64::do_write): Write address of .dynamic
3060 section to first entry in .got.plt section.
3061 * layout.h (Layout::dynamic_section): New function.
3063 2011-07-13 Sriraman Tallam <tmsriram@google.com>
3065 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
3067 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
3068 input_section_position_, and input_section_glob_.
3069 (read_layout_from_file): Call function section_ordering_specified.
3070 * layout.h (is_section_ordering_specified): New function.
3071 (section_ordering_specified): New function.
3072 (section_ordering_specified_): New boolean member.
3073 * main.cc(main): Call load_plugins after layout object is defined.
3074 * output.cc (Output_section::add_input_section): Use
3075 function section_ordering_specified to check if section ordering is
3077 * output.cc (Output_section::add_relaxed_input_section): Use
3078 function section_ordering_specified to check if section ordering is
3080 (Output_section::update_section_layout): New function.
3081 (Output_section::sort_attached_input_sections): Check if input section
3083 * output.h (Output_section::update_section_layout): New function.
3084 * plugin.cc (get_section_count): New function.
3085 (get_section_type): New function.
3086 (get_section_name): New function.
3087 (get_section_contents): New function.
3088 (update_section_order): New function.
3089 (allow_section_ordering): New function.
3090 (Plugin::load): Add the new interfaces to the transfer vector.
3091 (Plugin_manager::load_plugins): New parameter.
3092 (Plugin_manager::all_symbols_read): New parameter.
3093 (Plugin_manager::claim_file): New parameter. Save the elf object for
3095 (Plugin_manager::get_elf_object): New function.
3096 (Plugin_manager::get_view): Change to directly use the bool to check
3097 if get_view is called from claim_file_hook.
3098 * plugin.h (input_objects): New function
3099 (Plugin__manager::load_plugins): New parameter.
3100 (Plugin_manager::claim_file): New parameter.
3101 (Plugin_manager::get_elf_object): New function.
3102 (Plugin_manager::in_claim_file_handler): New function.
3103 (Plugin_manager::in_claim_file_handler_): New member.
3104 (layout): New function.
3105 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
3106 handler with an extra parameter. Make the elf object before calling
3108 * testsuite/plugin_test.c (get_section_count): New function pointer.
3109 (get_section_type): New function pointer.
3110 (get_section_name): New function pointer.
3111 (get_section_contents): New function pointer.
3112 (update_section_order): New function pointer.
3113 (allow_section_ordering): New function pointer.
3114 (onload): Check if the new interfaces exist.
3116 2011-07-13 Ian Lance Taylor <iant@google.com>
3118 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
3120 * x86_64.cc (Target_x86_64::got_section): Likewise.
3121 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
3122 (relro_now_test_SOURCES): New variable.
3123 (relro_now_test_DEPENDENCIES): New variable.
3124 (relro_now_test_LDFLAGS): New variable.
3125 (relro_now_test_LDADD): New variable.
3126 (relro_now_test.so): New target.
3127 * testsuite/Makefile.in: Rebuild.
3129 2011-07-12 Ian Lance Taylor <iant@google.com>
3132 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
3133 GLOB_DAT relocation rather than a RELATIVE relocation for a
3134 protected symbol when creating a shared library.
3135 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3136 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
3137 * testsuite/protected_main_1.cc (main): Test that protected
3138 function has same address.
3140 2011-07-11 Ian Lance Taylor <iant@google.com>
3143 * options.h (class General_options): Add -Bgroup.
3144 * options.cc (General_options::finalize): If -Bgroup is set,
3145 default to --unresolved-symbols=report-all.
3146 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
3147 * target-reloc.h (issue_undefined_symbol_error): Handle
3148 --unresolved-symbols=report-all.
3150 2011-07-08 Ian Lance Taylor <iant@google.com>
3153 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
3154 if linker script discards key sections.
3155 (Layout::create_dynamic_symtab): Likewise.
3156 (Layout::assign_local_dynsym_offsets): Likewise.
3157 (Layout::sized_create_version_sections): Likewise.
3158 (Layout::create_interp): Likewise.
3159 (Layout::finish_dynamic_section): Likewise.
3160 (Layout::set_dynamic_symbol_size): Likewise.
3162 2011-07-08 Ian Lance Taylor <iant@google.com>
3165 * options.h (class General_options): Add --unresolved-symbols.
3166 * target-reloc.h (issue_undefined_symbol_error): Check
3167 --unresolved-symbols. Add comments.
3169 2011-07-08 Ian Lance Taylor <iant@google.com>
3171 * testsuite/odr_violation2.cc (Ordering::operator()): Make
3172 expression more complex.
3174 2011-07-08 Ian Lance Taylor <iant@google.com>
3177 * target-reloc.h (issue_undefined_symbol_error): New inline
3178 function, broken out of relocate_section.
3179 (relocate_section): Call issue_undefined_symbol_error.
3180 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3181 there is no TLS segment if we are about to issue an undefined
3183 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3185 2011-07-08 Ian Lance Taylor <iant@google.com>
3188 * resolve.cc (Symbol_table::should_override): Add fromtype
3189 parameter. Change all callers. Give error when linking together
3190 TLS and non-TLS symbol.
3191 (Symbol_table::should_override_with_special): Add fromtype
3192 parameter. Change all callers.
3193 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3194 there is no TLS segment if we have reported some errors.
3195 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3197 2011-07-08 Ian Lance Taylor <iant@google.com>
3200 * target.h (Target::plt_address_for_global): New function.
3201 (Target::plt_address_for_local): New function.
3202 (Target::plt_section_for_global): Remove.
3203 (Target::plt_section_for_local): Remove.
3204 (Target::do_plt_address_for_global): New virtual function.
3205 (Target::do_plt_address_for_local): New virtual function.
3206 (Target::do_plt_section_for_global): Remove.
3207 (Target::do_plt_section_for_local): Remove.
3208 (Target::register_global_plt_entry): Add Symbol_table and Layout
3210 * output.cc (Output_data_got::Got_entry::write): Use
3211 plt_address_for_global and plt_address_for_local.
3212 * layout.cc (Layout::add_target_dynamic_tags): Use size and
3213 address of output section.
3214 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
3215 got_irelative_, and irelative_count_ fields. Update
3217 (Output_data_plt_i386::has_irelative_section): New function.
3218 (Output_data_plt_i386::entry_count): Add irelative_count_.
3219 (Output_data_plt_i386::set_final_data_size): Likewise.
3220 (class Target_i386): Add got_irelative_ and rel_irelative_
3221 fields. Update declarations.
3222 (Target_i386::Target_i386): Initialize new fields.
3223 (Target_i386::do_plt_address_for_global): New function replacing
3224 do_plt_section_for_global.
3225 (Target_i386::do_plt_address_for_local): New function replacing
3226 do_plt_section_for_local.
3227 (Target_i386::got_section): Create got_irelative_.
3228 (Target_i386::rel_irelative_section): New function.
3229 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
3230 fields. Don't define __rel_iplt_{start,end}.
3231 (Output_data_plt_i386::add_entry): Add symtab and layout
3232 parameters. Change all callers. Use different PLT and GOT for
3234 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
3235 layout parameters. Change all callers. Use different PLT and
3237 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
3238 (Output_data_plt_i386::rel_irelative): New function.
3239 (Output_data_plt_i386::address_for_global): New function.
3240 (Output_data_plt_i386::address_for_local): New function.
3241 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
3242 IRELATIVE GOT when changing IFUNC GOT entries.
3243 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
3245 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
3246 if we didn't create an IRELATIVE GOT.
3247 (Target_i386::Relocate::relocate): Use plt_address_for_global and
3248 plt_address_for_local.
3249 (Target_i386::do_dynsym_value): Use plt_address_for_global.
3250 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
3251 got_irelative_, and irelative_count_ fields. Update
3253 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3254 Initialize new fields. Remove symtab parameter. Change all
3256 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
3258 (Output_data_plt_x86_64::has_irelative_section): New function.
3259 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
3260 (class Target_x86_64): Add got_irelative_ and rel_irelative_
3261 fields. Update declarations.
3262 (Target_x86_64::Target_x86_64): Initialize new fields.
3263 (Target_x86_64::do_plt_address_for_global): New function replacing
3264 do_plt_section_for_global.
3265 (Target_x86_64::do_plt_address_for_local): New function replacing
3266 do_plt_section_for_local.
3267 (Target_x86_64::got_section): Create got_irelative_.
3268 (Target_x86_64::rela_irelative_section): New function.
3269 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
3270 all callers. Don't create __rel_iplt_{start,end}.
3271 (Output_data_plt_x86_64::add_entry): Add symtab and layout
3272 parameters. Change all callers. Use different PLT and GOT for
3274 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
3275 layout parameters. Change all callers. Use different PLT and
3277 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
3278 parameters. Change all callers. Use different PLT and GOT for
3280 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
3281 (Output_data_plt_x86_64::rela_irelative): New function.
3282 (Output_data_plt_x86_64::address_for_global): New function.
3283 (Output_data_plt_x86_64::address_for_local): New function.
3284 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3285 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
3286 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
3287 (Target_x86_64::register_global_plt_entry): Add symtab and layout
3289 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
3291 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
3292 symbols if we didn't create an IRELATIVE GOT.
3293 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
3294 plt_address_for_local.
3295 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
3296 * testsuite/ifuncvar1.c: New test file.
3297 * testsuite/ifuncvar2.c: New test file.
3298 * testsuite/ifuncvar3.c: New test file.
3299 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
3300 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
3301 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
3302 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
3303 * testsuite/Makefile.in: Rebuild.
3305 2011-07-07 Cary Coutant <ccoutant@google.com>
3307 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
3308 (two_file_test_1_ndebug.o): Likewise.
3309 (two_file_test_1b_ndebug.o): Likewise.
3310 (two_file_test_2_ndebug.o): Likewise.
3311 (two_file_test_main_ndebug.o): Likewise.
3312 (incremental_test_2): Link with no-debug versions.
3314 2011-07-06 Cary Coutant <ccoutant@google.com>
3316 * gold/incremental.cc
3317 (Output_section_incremental_inputs::write_info_blocks): Check for
3318 hidden and internal symbols.
3320 2011-07-06 Cary Coutant <ccoutant@google.com>
3322 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
3323 Check disposition for startup file.
3324 (Incremental_inputs::report_command_line): Ignore
3325 --incremental-startup-unchanged option.
3326 * options.cc (General_options::parse_incremental_startup_unchanged):
3328 (General_options::General_options): Initialize new data member.
3329 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
3330 (General_options): Add --incremental-startup-unchanged option.
3331 (General_options::incremental_startup_disposition): New function.
3332 (General_options::incremental_startup_disposition_): New data member.
3334 2011-07-06 Cary Coutant <ccoutant@google.com>
3336 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
3337 input file index to Script_info ctor.
3338 (Sized_incremental_binary::do_file_has_changed): Find the
3339 command-line argument for files named in scripts.
3340 * incremental.h (Script_info::Script_info): New ctor
3341 with input file index.
3342 (Script_info::input_file_index): New function.
3343 (Script_info::input_file_index_): New data member.
3344 (Incremental_binary::get_library): Add const.
3345 (Incremental_binary::get_script_info): Add const.
3346 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
3347 * testsuite/Makefile.am (incremental_test_5): New test case.
3348 (incremental_test_6): New test case.
3349 * testsuite/Makefile.in: Regenerate.
3351 2011-07-06 Cary Coutant <ccoutant@google.com>
3353 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
3354 debug output when command lines differ.
3356 2011-07-06 Cary Coutant <ccoutant@google.com>
3358 * incremental.cc (Incremental_inputs::report_command_line): Ignore
3359 --incremental-patch option.
3360 * layout.cc (Free_list::allocate): Extend allocation beyond original
3362 (Layout::make_output_section): Mark sections that should get
3364 * options.cc (parse_percent): New function.
3365 * options.h (parse_percent): New function.
3366 (DEFINE_percent): New macro.
3367 (General_options): Add --incremental-patch option.
3368 * output.cc (Output_section::Output_section): Initialize new data
3370 (Output_section::add_input_section): Print section name when out
3372 (Output_section::add_output_section_data): Likewise.
3373 (Output_section::set_final_data_size): Add patch space when
3374 doing --incremental-full.
3375 (Output_section::do_reset_address_and_file_offset): Remove patch
3377 (Output_segment::set_section_list_addresses): Print debug output
3378 only if --incremental-update.
3379 * output.h (Output_section::set_is_patch_space_allowed): New function.
3380 (Output_section::is_patch_space_allowed_): New data member.
3381 (Output_section::patch_space_): New data member.
3382 * parameters.cc (Parameters::incremental_full): New function.
3383 * parameters.h (Parameters::incremental_full): New function
3384 * testsuite/Makefile.am (incremental_test_2): Add test for
3385 --incremental-patch option.
3386 * testsuite/Makefile.in: Regenerate.
3387 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
3388 (t18): Remove function body.
3390 2011-07-05 Doug Kwan <dougkwan@google.com>
3393 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
3394 Arm_Address type for relocation result.
3395 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
3397 (Arm_relocate_functions::abs32): Use unaligned access.
3398 (Arm_relocate_functions::rel32): Ditto.
3399 (Arm_relocate_functions::prel31): Ditto.
3400 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
3401 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
3402 static data relocations.
3403 * testsuite/Makefile.in: Regnerate.
3404 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
3406 2011-07-05 Ian Lance Taylor <iant@google.com>
3409 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
3410 symbols if necessary.
3411 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3413 2011-07-05 Ian Lance Taylor <iant@google.com>
3416 * resolve.cc (Symbol::override_base_with_special): Simply override
3417 version with special symbol version, ignoring previous version.
3419 2011-07-05 Ian Lance Taylor <iant@google.com>
3421 * object.cc (Sized_relobj_file::include_section_group): Add
3422 information to comment about signature location.
3424 2011-07-02 Ian Lance Taylor <iant@google.com>
3427 * options.h (class General_options): Add -f and -F.
3428 * options.cc (General_options::finalize): Fatal error if -f/-F
3429 are used without -shared.
3430 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
3432 2011-07-02 Ian Lance Taylor <iant@google.com>
3434 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
3436 2011-07-01 Ian Lance Taylor <iant@google.com>
3440 * resolve.cc (Symbol::override_base_with_special): Don't override
3441 the version if the overriding symbol has a different name.
3442 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
3443 all callers. If we give an error about an undefined version,
3444 define the base version if necessary.
3445 * dynobj.h (class Versions): Update declaration.
3446 * testsuite/weak_alias_test_5.cc: New file.
3447 * testsuite/weak_alias_test.script: New file.
3448 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
3449 and versioned_alias have the right value, and call t2.
3450 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
3451 weak_alias_test_5.so.
3452 (weak_alias_test_LDADD): Likewise.
3453 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
3454 * testsuite/Makefile.in: Rebuild.
3456 2011-07-01 Ian Lance Taylor <iant@google.com>
3459 * options.h (class General_options): Support -z notext.
3460 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
3462 (two_file_shared_nonpic.so): Likewise.
3463 (two_file_shared_mixed.so): Likewise.
3464 (two_file_shared_mixed_1.so): Likewise.
3465 (weak_undef_lib_nonpic.so): Likewise.
3466 (alt/weak_undef_lib_nonpic.so): Likewise.
3467 (tls_test_shared_nonpic.so): Likewise.
3468 * testsuite/Makefile.in: Rebuild.
3470 2011-07-01 Ian Lance Taylor <iant@google.com>
3473 * configure.ac: Test whether static linking works, setting
3474 the automake conditional HAVE_STATIC.
3475 * testsuite/Makefile.am: Disable tests using -static if
3476 HAVE_STATIC is not true.
3477 * configure, testsuite/Makefile.in: Rebuild.
3479 2011-07-01 Ian Lance Taylor <iant@google.com>
3482 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
3483 Assert if we see DW_EH_PE_indirect.
3484 * target.h (Target::ehframe_datarel_base): New function.
3485 (Target::do_ehframe_datarel_base): New target function.
3486 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
3487 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
3490 2011-07-01 Ian Lance Taylor <iant@google.com>
3493 * options.h (class General_options): Add
3494 --ld-generated-unwind-info.
3495 * ehframe.cc (Fde::write): Add address parameter. Change all
3496 callers. If associated with PLT, fill in address and size.
3497 (Cie::set_output_offset): Only add merge mapping if there is an
3499 (Cie::write): Add address parameter. Change all callers.
3500 (Eh_frame::add_ehframe_for_plt): New function.
3501 * ehframe.h (class Fde): Update declarations. Move shndx_ and
3502 input_offset_ fields into union u_, with new plt field.
3503 (Fde::Fde): Adjust for new union field.
3504 (Fde::Fde) [Output_data version]: New constructor.
3505 (Fde::add_mapping): Only add merge mapping if there is an object.
3506 (class Cie): Update declarations.
3507 (class Eh_frame): Declare add_ehframe_for_plt.
3508 * layout.cc (Layout::layout_eh_frame): Break out code into
3509 make_eh_frame_section, and call it.
3510 (Layout::make_eh_frame_section): New function.
3511 (Layout::add_eh_frame_for_plt): New function.
3512 * layout.h (class Layout): Update declarations.
3513 * merge.cc (Merge_map::add_mapping): Add assertion.
3514 * i386.cc: Include "dwarf.h".
3515 (class Output_data_plt_i386): Make first_plt_entry,
3516 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
3517 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3518 and plt_eh_frame_fde.
3519 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
3520 boundary. Call add_eh_frame_for_plt if appropriate.
3521 * x86_64.cc: Include "dwarf.h".
3522 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
3523 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
3524 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3525 and plt_eh_frame_fde.
3526 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
3529 2011-06-29 Ian Lance Taylor <iant@google.com>
3532 * object.cc (Sized_relobj_file::layout_section): Change shdr
3533 parameter to be const.
3534 (Sized_relobj_file::layout_eh_frame_section): New function, broken
3536 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
3537 appropriate. Call layout_eh_frame_section.
3538 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
3540 * object.h (class Sized_relobj_file): Update declarations.
3542 2011-06-29 Ian Lance Taylor <iant@google.com>
3545 * script.cc (Token::integer_value): Accept trailing M/m/K/k
3547 (Lex::gather_token): Accept trailing M/m/K/k for integers.
3549 2011-06-29 Ian Lance Taylor <iant@google.com>
3552 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
3554 * layout.cc (Layout::layout_eh_frame): Likewise.
3556 2011-06-29 Ian Lance Taylor <iant@google.com>
3559 * layout.cc (Layout::symtab_section_shndx): New function.
3560 * layout.h (class Layout): Declare symtab_section_shndx.
3561 * output.cc (Output_section::write_header): Call it.
3563 2011-06-29 Ian Lance Taylor <iant@google.com>
3566 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
3567 symbols which are not used in a relocation.
3569 2011-06-28 Ian Lance Taylor <iant@google.com>
3572 * layout.cc (Layout::segment_precedes): Don't crash if a linker
3573 script create indistinguishable segments.
3574 (Layout::set_segment_offsets): Use stable_sort when sorting
3575 segments. Pass this to Compare_segments constructor.
3576 * layout.h (class Layout): Make segment_precedes non-static.
3577 (class Compare_segments): Change from struct to class. Add
3578 layout_ field. Add constructor.
3579 * script-sections.cc
3580 (Script_sections::attach_sections_using_phdrs_clause): Rename
3581 local orphan to is_orphan. Don't report failure to put empty
3582 section in segment. On attachment failure, report name of
3583 section, and attach to first PT_LOAD segment.
3585 2011-06-28 Ian Lance Taylor <iant@google.com>
3588 * target-select.cc (Target_selector::Target_selector): Add
3589 emulation parameter. Change all callers.
3590 (select_target_by_bfd_name): Rename from select_target_by_name.
3592 (select_target_by_emulation): New function.
3593 (supported_emulation_names): New function.
3594 * target-select.h (class Target_selector): Add emulation_ field.
3595 Update declarations.
3596 (Target_selector::recognize_by_bfd_name): Rename from
3597 recognize_by_name. Change all callers.
3598 (Target_selector::supported_bfd_names): Rename from
3599 supported_names. Change all callers.
3600 (Target_selector::recognize_by_emulation): New function.
3601 (Target_selector::supported_emulations): New function.
3602 (Target_selector::emulation): New function.
3603 (Target_selector::do_recognize_by_bfd_name): Rename from
3604 do_recognize_by_name. Change all callers.
3605 (Target_selector::do_supported_bfd_names): Rename from
3606 do_supported_names. Change all callers.
3607 (Target_selector::do_recognize_by_emulation): New function.
3608 (Target_selector::do_supported_emulations): New function.
3609 (select_target_by_bfd_name): Change name in declaration.
3610 (select_target_by_emulation): Declare.
3611 (supported_emulation_names): Declare.
3612 * parameters.cc (parameters_force_valid_target): Try to find
3613 target based on emulation from -m option.
3614 * options.h (class General_options): Change doc string for -m.
3615 * options.cc (help): Print emulations.
3616 (General_options::parse_V): Likewise.
3617 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
3618 Add emulation parameter. Change all callers.
3620 2011-06-28 Ian Lance Taylor <iant@google.com>
3622 * target.h (class Target): Add osabi_ field.
3623 (Target::osabi): New function.
3624 (Target::set_osabi): New function.
3625 (Target::Target): Initialize osabi_.
3626 (Target::do_adjust_elf_header): Make pure virtual.
3627 (Sized_target::do_adjust_elf_header): Declare.
3628 * target.cc (Sized_target::do_adjust_elf_header): New function.
3629 (class Sized_target): Instantiate all versions.
3630 * freebsd.h (class Target_freebsd): Remove.
3631 (Target_selector_freebsd::do_recognize): Call set_osabi on
3633 (Target_selector_freebsd::do_recognize_by_name): Likewise.
3634 (Target_selector_freebsd::set_osabi): Remove.
3635 * i386.cc (class Target_i386): Inherit from Sized_target rather
3636 than Target_freebsd.
3637 * x86_64.cc (class Target_x86_64): Likewise.
3639 2011-06-28 Ian Lance Taylor <iant@google.com>
3641 * target.h (Target::can_check_for_function_pointers): Rewrite.
3643 (Target::can_icf_inline_merge_sections): Likewise.
3644 (Target::section_may_have_icf_unsafe_poineters): Likewise.
3645 (Target::Target_info): Add can_icf_inline_merge_sections field.
3646 (Target::do_can_check_for_function_pointers): New virtual
3648 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
3649 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
3650 from can_check_for_function_pointers, move in file.
3651 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
3652 section_may_have_icf_unsafe_poineters, move in file.
3653 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
3654 * i386.cc (Target_i386::do_can_check_for_function_pointers):
3655 Rename from can_check_for_function_pointers, move in file.
3656 (Target_i386::can_icf_inline_merge_sections): Remove.
3657 (Target_i386::i386_info): Initialize
3658 can_icf_inline_merge_sections.
3659 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
3660 Initialize can_icf_inline_merge_sections.
3661 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
3662 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
3663 Rename from can_check_for_function_pointers, move in file.
3664 (Target_x86_64::can_icf_inline_merge_sections): Remove.
3665 (Target_x86_64::x86_64_info): Initialize
3666 can_icf_inline_merge_sections.
3667 * testsuite/testfile.cc (Target_test::test_target_info):
3669 * icf.cc (get_section_contents): Correct formatting.
3671 2011-06-27 Ian Lance Taylor <iant@google.com>
3673 * symtab.cc (Symbol::versioned_name): New function.
3674 (Symbol_table::add_to_final_symtab): Use versioned_name when
3676 (Symbol_table::sized_write_symbol): Likewise.
3677 * symtab.h (class Symbol): Declare versioned_name.
3678 * stringpool.h (class Stringpool_template): Add variant of add
3679 which takes a std::basic_string.
3680 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
3681 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
3682 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
3683 (ver_test_12.o): New target.
3684 * testsuite/Makefile.in: Rebuild.
3686 2011-06-27 Doug Kwan <dougkwan@google.com>
3688 * arm.cc (Arm_relocate_functions::thm_jump8,
3689 Arm_relocate_functions::thm_jump11): Use a wider signed
3690 type to compute offset.
3691 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
3693 * testsuite/Makefile.in: Regenerate.
3694 * testsuite/arm_branch_in_range.sh: Check test results of
3695 arm_thm_jump11 and arm_thm_jump8.
3696 * testsuite/arm_thm_jump11.s: New test source file.
3697 * testsuite/arm_thm_jump11.t: New linker script.
3698 * testsuite/arm_thm_jump8.s: New test source file.
3699 * testsuite/arm_thm_jump8.t: New linker script.
3701 2011-06-24 Ian Lance Taylor <iant@google.com>
3703 * layout.cc: Include "object.h".
3704 (ctors_sections_in_init_array): New static variable.
3705 (Layout::is_ctors_in_init_array): New function.
3706 (Layout::layout): Add entry to ctors_sections_in_init_array if
3708 * layout.h (class Layout): Declare is_ctors_in_init_array.
3709 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
3710 is_ctors_reverse_view is set.
3711 (Sized_relobj_file::write_sections): Add layout parameter. Change
3712 all callers. Set is_ctors_reverse_view field of View_size.
3713 (Sized_relobj_file::reverse_words): New function.
3714 * object.h (Sized_relobj_file::View_size): Add
3715 is_ctors_reverse_view field.
3716 (class Sized_relobj_file): Update declarations.
3717 * testsuite/initpri3.c: New test.
3718 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
3720 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
3721 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
3722 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
3723 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
3724 * testsuite/Makefile.in: Rebuild.
3726 2011-06-24 Cary Coutant <ccoutant@google.com>
3728 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
3729 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
3730 (debug_msg_cdebug.err): New targets.
3731 * testsuite/Makefile.in: Regenerate.
3732 * testsuite/debug_msg.sh: Check output of link with compressed debug.
3733 Fix checks for link with shared library.
3735 2011-06-24 Doug Kwan <dougkwan@google.com>
3737 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
3738 skip empty text sections.
3739 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
3741 2011-06-22 Ian Lance Taylor <iant@google.com>
3744 * options.h (class General_options): Add --ctors-in-init-array.
3745 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
3746 friends as SHT_PROGBITS for merging sections.
3747 (Layout::layout): Remove special handling of .init_array and
3748 friends. Don't sort if doing relocatable link. Sort for .ctors
3749 and .dtors if ctors_in_init_array.
3750 (Layout::make_output_section): Force correct section types for
3751 .init_array and friends. Don't sort if doing relocatable link,
3752 Don't sort .ctors and .dtors if ctors_in_init_array.
3753 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
3754 (Layout::output_section_name): Add relobj parameter. Change all
3755 callers. Handle .ctors. and .dtors. in code rather than table.
3756 Handle .ctors and .dtors if ctors_in_init_array.
3757 (Layout::match_file_name): New function, moved from output.cc.
3758 * layout.h (class Layout): Update declarations.
3759 * output.cc: Include "layout.h".
3760 (Input_section_sort_entry::get_priority): New function.
3761 (Input_section_sort_entry::match_file_name): Just call
3762 Layout::match_file_name.
3763 (Output_section::Input_section_sort_init_fini_compare::operator()):
3764 Handle .ctors and .dtors. Sort by explicit priority rather than
3766 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
3767 * testsuite/initpri2.c: New test.
3768 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
3769 (check_PROGRAMS): Add initpri2.
3770 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
3771 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
3772 * configure, testsuite/Makefile.in: Rebuild.
3774 2011-06-19 Ian Lance Taylor <iant@google.com>
3777 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
3778 .interp section to a PT_INTERP segment even if we have seen a
3779 --dynamic-linker option. Don't do it if we have seen a PHDRS
3780 clause in a linker script.
3781 (Layout::finalize): Don't create a .interp section if we've
3782 already create a PT_INTERP segment.
3783 (Layout::create_interp): Always call choose_output_section (revert
3784 patch of 2011-06-17). Don't create PT_INTERP segment.
3785 * script-sections.cc
3786 (Script_sections::create_note_and_tls_segments): Add a .interp
3787 section to a PT_INTERP segment even if we have seen a
3788 --dynamic-linker option.
3790 2011-06-18 Ian Lance Taylor <iant@google.com>
3792 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
3793 merely because a non-PT_LOAD segment has a dynamic reloc.
3795 2011-06-18 Ian Lance Taylor <iant@google.com>
3797 * layout.cc (Layout::finish_dynamic_section): Don't create
3798 DT_FLAGS entry if not needed.
3800 2011-06-18 Ian Lance Taylor <iant@google.com>
3803 * layout.cc (Layout::layout_eh_frame): Correct handling of
3804 writable .eh_frame section.
3806 2011-06-17 Ian Lance Taylor <iant@google.com>
3809 * resolve.cc (Symbol_table::resolve): Don't give an error if a
3810 symbol is redefined with the exact same object and value.
3812 2011-06-17 Ian Lance Taylor <iant@google.com>
3815 * layout.h (class Layout): Add interp_segment_ field.
3816 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
3817 (Layout::attach_allocated_section_to_segment): If making shared
3818 library, put .interp section in PT_INTERP segment.
3819 (Layout::finalize): Also call create_interp if -dynamic-linker
3821 (Layout::create_interp): Assert that there is no PT_INTERP
3822 segment. If not using a SECTIONS clause, use make_output_section.
3823 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
3824 * script-sections.cc
3825 (Script_sections::create_note_and_tls_segments): If making shared
3826 library, put .interp section in PT_INTERP segment.
3828 2011-06-17 Ian Lance Taylor <iant@google.com>
3830 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
3831 when making a shared library.
3833 2011-06-17 Ian Lance Taylor <iant@google.com>
3835 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
3836 parameter. Change all callers. Don't issue warning about PC32
3837 against locally defined symbol.
3839 2011-06-16 Ian Lance Taylor <iant@google.com>
3841 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
3842 occurs in same object.
3844 2011-06-14 Alan Modra <amodra@gmail.com>
3846 * po/POTFILES.in: Regenerate.
3848 2011-06-09 Ian Lance Taylor <iant@google.com>
3850 * script-sections.cc
3851 (Orphan_output_section::set_section_addresses): For a relocatable
3852 link set address to 0.
3854 2011-06-09 Cary Coutant <ccoutant@google.com>
3857 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
3858 used with --compress-debug-sections.
3859 * gold/object.cc (Sized_relobj_file::do_layout): Report
3860 uncompressed size of compressed input sections.
3862 2011-06-08 Cary Coutant <ccoutant@google.com>
3865 * testsuite/two_file_test_2_v1.cc: Change initialization of
3866 v2 to keep it in .data.
3868 2011-06-07 Cary Coutant <ccoutant@google.com>
3870 * common.cc (Symbol_table::do_allocate_commons_list): Call
3872 * errors.cc (Errors::fatal): Adjust call to gold_exit.
3873 (Errors::fallback): New function.
3874 (gold_fallback): New function.
3875 * errors.h (Errors::fallback): New function.
3876 * gold.cc (gold_exit): Change status parameter to enum; adjust
3878 (queue_initial_tasks): Call gold_fallback.
3879 * gold.h: Include cstdlib.
3880 (Exit_status): New enum type.
3881 (gold_exit): Change status parameter to enum.
3882 (gold_fallback): New function.
3883 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
3884 (Layout::create_symtab_sections): Likewise.
3885 (Layout::create_shdrs): Likewise.
3886 * main.cc (main): Adjust call to gold_exit.
3887 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
3888 (Output_data_got::add_got_entry_pair): Likewise.
3889 (Output_section::add_input_section): Likewise.
3890 (Output_section::add_output_section_data): Likewise.
3891 (Output_segment::set_section_list_addresses): Likewise.
3892 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
3894 2011-06-07 Cary Coutant <ccoutant@google.com>
3896 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
3897 for incremental links.
3898 * output.cc (Output_segment::set_section_list_addresses): Remove
3899 FIXME and test for TLS or BSS.
3901 2011-06-07 Cary Coutant <ccoutant@google.com>
3903 * testsuite/Makefile.am: Add incremental_copy_test,
3904 incremental_common_test_1.
3905 * testsuite/Makefile.in: Regenerate.
3906 * testsuite/common_test_1_v1.c: New source file.
3907 * testsuite/common_test_1_v2.c: New source file.
3908 * testsuite/copy_test_v1.cc: New source file.
3910 2011-06-07 Cary Coutant <ccoutant@google.com>
3912 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
3913 update, allocate common from bss section's free list.
3914 * incremental-dump.cc (dump_incremental_inputs): Print flag for
3915 linker-defined symbols.
3916 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3917 Skip GOT and PLT entries that are no longer referenced.
3918 (Output_section_incremental_inputs::write_info_blocks): Mark
3919 linker-defined symbols.
3920 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
3921 * output.cc (Output_section::allocate): New function.
3922 * output.h (Output_section::allocate): New function.
3923 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
3924 linker-defined symbols.
3925 (Symbol::override_base_with_special): Copy is_predefined_ flag.
3926 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
3927 (Symbol::init_base_output_data): Likewise.
3928 (Symbol::init_base_output_segment): Likewise.
3929 (Symbol::init_base_constant): Likewise.
3930 (Sized_symbol::init_output_data): Likewise.
3931 (Sized_symbol::init_output_segment): Likewise.
3932 (Sized_symbol::init_constant): Likewise.
3933 (Symbol_table::do_define_in_output_data): Likewise.
3934 (Symbol_table::do_define_in_output_segment): Likewise.
3935 (Symbol_table::do_define_as_constant): Likewise.
3936 * symtab.h (Symbol::is_predefined): New function.
3937 (Symbol::init_base_output_data): Add is_predefined parameter.
3938 (Symbol::init_base_output_segment): Likewise.
3939 (Symbol::init_base_constant): Likewise.
3940 (Symbol::is_predefined_): New data member.
3941 (Sized_symbol::init_output_data): Add is_predefined parameter.
3942 (Sized_symbol::init_output_segment): Likewise.
3943 (Sized_symbol::init_constant): Likewise.
3944 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
3946 2011-06-07 Cary Coutant <ccoutant@google.com>
3948 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
3949 instead of emit_copy_reloc.
3950 (Copy_relocs::emit_copy_reloc): Refactor.
3951 (Copy_relocs::make_copy_reloc): New function.
3952 (Copy_relocs::add_copy_reloc): Remove.
3953 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
3955 (Copy_relocs::make_copy_reloc): New function.
3956 (Copy_relocs::add_copy_reloc): Remove.
3957 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
3958 unchanged input files.
3959 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
3960 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
3961 Reserve BSS space for COPY relocations.
3962 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3963 (Output_section_incremental_inputs::write_info_blocks): Record
3964 whether a symbol is copied from a shared object.
3965 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
3966 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
3967 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
3968 (Incremental_input_entry_reader::get_output_symbol_index): Add
3970 (Incremental_binary::emit_copy_relocs): New function.
3971 (Incremental_binary::do_emit_copy_relocs): New function.
3972 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3974 (Sized_incremental_binary::add_copy_reloc): New function.
3975 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3976 (Sized_incremental_binary::Copy_reloc): New struct.
3977 (Sized_incremental_binary::Copy_relocs): New typedef.
3978 (Sized_incremental_binary::copy_relocs_): New data member.
3979 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
3980 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
3981 * target.h (Sized_target::emit_copy_reloc): New function.
3982 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
3984 2011-06-02 Cary Coutant <ccoutant@google.com>
3987 * gold/archive.cc (Archive::Archive): Initialize new data member.
3988 (Archive::include_all_members): Return if archive has already been
3990 * gold/archive.h (Archive::include_all_members_): New data member.
3992 2011-06-02 Nick Clifton <nickc@redhat.com>
3994 * dynobj.h: Fix spelling mistake in comment.
3995 * output.cc: Likewise.
3997 2011-05-31 Doug Kwan <dougkwan@google.com>
4001 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
4002 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
4003 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
4004 redundant arm_exidx_test.so.
4005 * testsuite/Makefile.in: Regenerate.
4006 (check_SCRIPTS): Add pr12826.sh
4007 (check_DATA): Add pr12826.stdout
4008 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
4009 * testsuite/pr12826.sh: New file.
4010 * testsuite/pr12826_1.s: Ditto.
4011 * testsuite/pr12826_1.s: Ditto.
4013 2011-05-30 Ian Lance Taylor <iant@google.com>
4015 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
4018 2011-05-29 Ian Lance Taylor <iant@google.com>
4021 * testsuite/Makefile.am: Use different file name for two_file_test
4022 temporary file for each incremental test.
4023 * testsuite/Makefile.in: Rebuild.
4025 2011-05-29 Ian Lance Taylor <iant@google.com>
4027 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
4028 binary input file is empty.
4030 2011-05-27 Ian Lance Taylor <iant@google.com>
4032 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
4033 (ver_test_9.so): Likewise.
4034 * testsuite/Makefile.in: Rebuild.
4036 2011-05-26 Cary Coutant <ccoutant@google.com>
4038 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
4039 * incremental.cc (Incremental_inputs::report_input_section): Fix
4040 comment, indentation.
4041 (Incremental_inputs::report_comdat_group): New function.
4042 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4043 of data for incremental input file entry.
4044 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
4045 group count, COMDAT group signatures.
4046 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
4047 an unchanged input file.
4048 * incremental.h (Incremental_object_entry::Incremental_object_entry):
4049 Initialize new data member.
4050 (Incremental_object_entry::add_comdat_group): New function.
4051 (Incremental_object_entry::get_comdat_group_count): New function.
4052 (Incremental_object_entry::get_comdat_signature_key): New function.
4053 (Incremental_object_entry::groups_): New data member.
4054 (Incremental_inputs::report_comdat_group): New function.
4055 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
4056 data for incremental input file entry.
4057 (Incremental_input_entry_reader::get_comdat_group_count): New function.
4058 (Incremental_input_entry_reader::get_input_section): Adjust size of
4059 data for incremental input file entry.
4060 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
4061 (Incremental_input_entry_reader::get_comdat_group_signature): New
4063 * object.cc (Sized_relobj::include_section_group): Report kept
4064 COMDAT groups for incremental links.
4066 2011-05-24 David Meyer <pdox@google.com>
4068 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
4069 with name parameter. Add found_name parameter.
4070 * fileread.cc (Input_file::find_file): Adjust code accordingly.
4071 * dirsearch.h (class Dirsearch): Update declaration.
4073 2011-05-24 Ian Lance Taylor <iant@google.com>
4075 * archive.cc (Library_base::should_include_member): Pull in object
4076 from archive if it defines the entry symbol.
4077 * parameters.cc (Parameters::entry): New function.
4078 * parameters.h (class Parameters): Declare entry.
4079 * output.h (class Output_file_header): Remove entry_ field.
4080 * output.cc (Output_file_header::Output_file_header): Remove entry
4081 parameter. Change all callers.
4082 (Output_file_header::entry): Use parameters->entry.
4083 * gold.cc (queue_middle_tasks): Likewise.
4084 * plugin.cc (Plugin_hook::run): Likewise.
4086 2011-05-24 Cary Coutant <ccoutant@google.com>
4088 * gold.cc (queue_initial_tasks): Pass incremental base filename
4089 to Output_file::open_base_file; don't print error message.
4090 * incremental-dump.cc (main): Adjust call to
4091 Output_file::open_for_modification.
4092 * incremental-dump.cc (main): Likewise.
4093 * incremental.cc (Incremental_inputs::report_command_line):
4094 Ignore --incremental-base option when comparing command lines.
4095 Ignore parameter when given as separate argument.
4096 * options.h (class General_options): Add --incremental-base.
4097 * output.cc (Output_file::Output_file):
4098 (Output_file::open_base_file): Add base_name and writable parameters;
4099 read base file into new file; print error message here.
4100 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4102 * output.h (Output_file::open_for_modification): Rename to...
4103 (Output_file::open_base_file): ...this; add base_name and
4104 writable parameters; adjust all callers.
4105 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4107 * testsuite/Makefile.am (incremental_test_4): Test
4109 * testsuite/Makefile.in: Regenerate.
4111 2011-05-24 Cary Coutant <ccoutant@google.com>
4113 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
4115 * testsuite/Makefile.in: Regenerate.
4116 * testsuite/two_file_test_1_v1.cc: New test source file.
4117 * testsuite/two_file_test_1b_v1.cc: New test source file.
4118 * testsuite/two_file_test_2_v1.cc: New test source file.
4120 2011-05-24 Cary Coutant <ccoutant@google.com>
4122 * dynobj.h (Dynobj::do_dynobj): New function.
4123 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
4124 flag and soname for shared objects.
4125 * incremental.cc (Incremental_inputs::report_object): Make
4126 either Incremental_object_entry or Incremental_dynobj_entry; add
4127 soname to string table.
4128 (Incremental_inputs::report_input_section): Add assertion.
4129 (Output_section_incremental_inputs::set_final_data_size): Adjust
4130 type of input file entry for shared libraries; adjust size of
4131 shared library info entry.
4132 (Output_section_incremental_inputs::write_input_files): Write
4133 as_needed flag for shared libraries.
4134 (Output_section_incremental_inputs::write_info_blocks): Adjust type
4135 of input file entry for shared libraries; write soname.
4136 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
4137 soname from incremental info.
4138 * incremental.h (enum Incremental_input_flags): Add
4139 INCREMENTAL_INPUT_AS_NEEDED.
4140 (Incremental_input_entry::Incremental_input_entry): Initialize new
4142 (Incremental_input_entry::set_as_needed): New function.
4143 (Incremental_input_entry::as_needed): New function.
4144 (Incremental_input_entry::do_dynobj_entry): New function.
4145 (Incremental_input_entry::as_needed_): New data member.
4146 (Incremental_object_entry::Incremental_object_entry): Don't check
4148 (Incremental_object_entry::do_type): Likewise.
4149 (class Incremental_dynobj_entry): New class.
4150 (Incremental_input_entry_reader::as_needed): New function.
4151 (Incremental_input_entry_reader::get_soname): New function.
4152 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
4153 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
4154 size of shared library info entry.
4155 * layout.cc (Layout::finish_dynamic_section): Don't test for
4156 incremental link when adding DT_NEEDED entries.
4157 * object.h (Object::Object): Initialize new data member.
4158 (Object::dynobj): New function.
4159 (Object::set_as_needed): New function.
4160 (Object::as_needed): New function.
4161 (Object::do_dynobj): New function.
4162 (Object::as_needed_): New data member.
4164 2011-05-24 Cary Coutant <ccoutant@google.com>
4166 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
4167 info; adjust display of GOT entries.
4168 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4169 vector of input objects; remove file_status_.
4170 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
4171 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
4172 got_plt reader; call target hooks to reserve GOT entries.
4173 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4174 of input file info header and GOT info entry.
4175 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
4177 (Got_plt_view_info::got_descriptor): Remove.
4178 (Got_plt_view_info::sym_index): New data member.
4179 (Got_plt_view_info::input_index): New data member.
4180 (Local_got_offset_visitor::visit): Write input file index.
4181 (Global_got_offset_visitor::visit): Write 0 for input file index.
4182 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
4183 with sym_index and input_index.
4184 (Output_section_incremental_inputs::write_got_plt): Adjust size of
4185 incremental info GOT entry; replace got_descriptor with input_index.
4186 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
4187 map from input file index to object.
4188 (Sized_relobj_incr::do_layout): Replace direct data member reference
4189 with accessor function.
4190 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
4191 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
4192 Adjust size of input file info header.
4193 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
4194 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
4195 (Incremental_input_entry_reader::get_input_section): Adjust size of
4196 input file info header.
4197 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
4198 of incremental info GOT entry.
4199 (Incremental_got_plt_reader::get_got_desc): Remove.
4200 (Incremental_got_plt_reader::get_got_symndx): New function.
4201 (Incremental_got_plt_reader::get_got_input_index): New function.
4202 (Sized_incremental_binary::Sized_incremental_binary): Remove
4203 file_status_; add input_objects_.
4204 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
4205 (Sized_incremental_binary::set_file_is_unchanged): Remove.
4206 (Sized_incremental_binary::file_is_unchanged): Remove.
4207 (Sized_incremental_binary::set_input_object): New function.
4208 (Sized_incremental_binary::input_object): New function.
4209 (Sized_incremental_binary::file_status_): Remove.
4210 (Sized_incremental_binary::input_objects_): New data member.
4211 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
4213 (Sized_relobj_incr::invalid_address): Move to base class.
4214 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
4216 (Sized_relobj_incr::do_output_section_offset): Likewise.
4217 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
4218 (Sized_relobj_incr::section_offsets_): Likewise.
4219 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
4221 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
4222 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
4223 with accessor function.
4224 (Sized_relobj_file::do_layout): Likewise.
4225 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
4226 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
4227 (Sized_relobj_file::compute_final_local_value): Replace refs to
4228 section_offsets_ with accessor function.
4229 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
4230 * object.h (Relobj::Relobj): Initialize new data members.
4231 (Relobj::add_dyn_reloc): New function.
4232 (Relobj::first_dyn_reloc): New function.
4233 (Relobj::dyn_reloc_count): New function.
4234 (Relobj::first_dyn_reloc_): New data member.
4235 (Relobj::dyn_reloc_count_): New data member.
4236 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
4238 (Sized_relobj::Address): New typedef.
4239 (Sized_relobj::invalid_address): Move here from child class.
4240 (Sized_relobj::Sized_relobj): Initialize new data members.
4241 (Sized_relobj::sized_relobj): New function.
4242 (Sized_relobj::is_output_section_offset_invalid): Move here from
4244 (Sized_relobj::get_output_section_offset): Likewise.
4245 (Sized_relobj::local_has_got_offset): Likewise.
4246 (Sized_relobj::local_got_offset): Likewise.
4247 (Sized_relobj::set_local_got_offset): Likewise.
4248 (Sized_relobj::do_for_all_local_got_entries): Likewise.
4249 (Sized_relobj::clear_got_offsets): New function.
4250 (Sized_relobj::section_offsets): Move here from child class.
4251 (Sized_relobj::do_output_section_offset): Likewise.
4252 (Sized_relobj::do_set_section_offset): Likewise.
4253 (Sized_relobj::Local_got_offsets): Likewise.
4254 (Sized_relobj::local_got_offsets_): Likewise.
4255 (Sized_relobj::section_offsets_): Likewise.
4256 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
4258 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
4260 (Sized_relobj_file::sized_relobj): New function
4261 (Sized_relobj_file::local_has_got_offset): Move to base class.
4262 (Sized_relobj_file::local_got_offset): Likewise.
4263 (Sized_relobj_file::set_local_got_offset): Likewise.
4264 (Sized_relobj_file::get_output_section_offset): Likewise.
4265 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
4266 (Sized_relobj_file::do_output_section_offset): Likewise.
4267 (Sized_relobj_file::do_set_section_offset): Likewise.
4268 (Sized_relobj_file::Local_got_offsets): Likewise.
4269 (Sized_relobj_file::local_got_offsets_): Likewise.
4270 (Sized_relobj_file::section_offsets_): Likewise.
4271 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
4273 (set_needs_dynsym_index): Convert relobj to derived class pointer.
4274 (Output_reloc::get_symbol_index): Likewise.
4275 (Output_reloc::local_section_offset): Likewise.
4276 (Output_reloc::get_address): Likewise.
4277 (Output_reloc::symbol_value): Likewise.
4278 (Output_data_got::reserve_slot): Move to class definition.
4279 (Output_data_got::reserve_local): New function.
4280 (Output_data_got::reserve_slot_for_global): Remove.
4281 (Output_data_got::reserve_global): New function.
4282 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
4283 (all constructors, two instantiations).
4284 (Output_reloc::get_relobj): New function (two instantiations).
4285 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
4286 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
4287 (Output_data_reloc::add_global): Adjust type of relobj.
4288 (Output_data_reloc::add_global_relative): Likewise.
4289 (Output_data_reloc::add_symbolless_global_addend): Likewise.
4290 (Output_data_reloc::add_local): Likewise.
4291 (Output_data_reloc::add_local_relative): Likewise.
4292 (Output_data_reloc::add_symbolless_local_addend): Likewise.
4293 (Output_data_reloc::add_local_section): Likewise.
4294 (Output_data_reloc::add_output_section): Likewise.
4295 (Output_data_reloc::add_absolute): Likewise.
4296 (Output_data_reloc::add_target_specific): Likewise.
4297 (Output_data_got::reserve_slot): Move definition here.
4298 (Output_data_got::reserve_local): New function.
4299 (Output_data_got::reserve_global): New function.
4300 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
4301 section_offsets_ with accessor function.
4302 (Sized_relobj_file::write_sections): Likewise.
4303 (Sized_relobj_file::do_relocate_sections): Likewise.
4304 * target.h (Sized_target::reserve_local_got_entry): New function.
4305 (Sized_target::reserve_global_got_entry): New function.
4306 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
4307 (Target_x86_64::reserve_global_got_entry): New function.
4308 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
4310 2011-05-23 Cary Coutant <ccoutant@google.com>
4312 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
4313 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
4314 bit when checking got_type.
4315 * incremental.cc (Sized_incremental_binary::setup_readers):
4316 Store symbol table and string table locations; initialize bit vector
4317 of file status flags.
4318 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
4320 (Sized_incremental_binary::do_process_got_plt): New function.
4321 (Sized_incremental_binary::get_symtab_view): Use stored locations.
4322 (Output_section_incremental_inputs::set_final_data_size): Record
4323 file index for each input file.
4324 (Output_section_incremental_inputs::write_got_plt): Store file index
4325 instead of input entry offset for each GOT entry.
4327 (Incremental_input_entry::Incremental_input_entry): Initialize new
4329 (Incremental_input_entry::set_offset): Store file index.
4330 (Incremental_input_entry::get_file_index): New function.
4331 (Incremental_input_entry::file_index_): New data member.
4332 (Incremental_binary::process_got_plt): New function.
4333 (Incremental_binary::do_process_got_plt): New function.
4334 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4336 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
4337 (Sized_incremental_binary::set_file_is_unchanged): New function.
4338 (Sized_incremental_binary::file_is_unchanged): New function.
4339 (Sized_incremental_binary::do_process_got_plt): New function.
4340 (Sized_incremental_binary::file_status_): New data member.
4341 (Sized_incremental_binary::main_symtab_loc_): New data member.
4342 (Sized_incremental_binary::main_strtab_loc_): New data member.
4343 * output.cc (Output_data_got::Got_entry::write): Add case
4345 (Output_data_got::add_global): Call add_got_entry.
4346 (Output_data_got::add_global_plt): Likewise.
4347 (Output_data_got::add_global_with_rel): Likewise.
4348 (Output_data_got::add_global_with_rela): Likewise.
4349 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
4350 (Output_data_got::add_global_pair_with_rela): Likewise.
4351 (Output_data_got::add_local): Call add_got_entry.
4352 (Output_data_got::add_local_plt): Likewise.
4353 (Output_data_got::add_local_with_rel): Likewise.
4354 (Output_data_got::add_local_with_rela): Likewise.
4355 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
4356 (Output_data_got::add_local_pair_with_rela): Likewise.
4357 (Output_data_got::reserve_slot): New function.
4358 (Output_data_got::reserve_slot_for_global): New function.
4359 (Output_data_got::add_got_entry): New function.
4360 (Output_data_got::add_got_entry_pair): New function.
4361 (Output_section::add_output_section_data): Edit FIXME.
4363 (Output_section_data_build::Output_section_data_build): New
4364 constructor with size parameter.
4365 (Output_data_space::Output_data_space): Likewise.
4366 (Output_data_got::Output_data_got): Initialize new data member; new
4367 constructor with size parameter.
4368 (Output_data_got::add_constant): Call add_got_entry.
4369 (Output_data_got::reserve_slot): New function.
4370 (Output_data_got::reserve_slot_for_global): New function.
4371 (class Output_data_got::Got_entry): Add RESERVED_CODE.
4372 (Output_data_got::add_got_entry): New function.
4373 (Output_data_got::add_got_entry_pair): New function.
4374 (Output_data_got::free_list_): New data member.
4375 * target.h (Sized_target::init_got_plt_for_update): New function.
4376 (Sized_target::register_global_plt_entry): New function.
4377 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4378 Initialize new data member; call init; add constructor with PLT count.
4379 (Output_data_plt_x86_64::init): New function.
4380 (Output_data_plt_x86_64::add_relocation): New function.
4381 (Output_data_plt_x86_64::reserve_slot): New function.
4382 (Output_data_plt_x86_64::free_list_): New data member.
4383 (Target_x86_64::init_got_plt_for_update): New function.
4384 (Target_x86_64::register_global_plt_entry): New function.
4385 (Output_data_plt_x86_64::add_entry): Allocate from free list for
4386 incremental updates.
4387 (Output_data_plt_x86_64::add_relocation): New function.
4388 * testsuite/object_unittest.cc (Object_test): Set default options.
4390 2011-05-16 Ian Lance Taylor <iant@google.com>
4392 * options.h (class General_options): Make -i a synonym for -r.
4394 2011-05-16 Ian Lance Taylor <iant@google.com>
4396 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
4398 2011-05-10 Cary Coutant <ccoutant@google.com>
4400 * object.cc (Sized_relobj::do_count_local_symbols): Check for
4403 2011-05-06 Ian Lance Taylor <iant@google.com>
4405 * layout.cc (Layout::layout): If the output section flags change,
4406 update the ordering.
4408 2011-04-25 Cary Coutant <ccoutant@google.com>
4410 * incremental-dump.cc (dump_incremental_inputs): Print local
4411 symbol info for each input file.
4413 (Output_section_incremental_inputs::set_final_data_size): Add local
4414 symbol info to input file entries in incremental info.
4415 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4416 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
4417 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
4418 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
4420 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
4421 (Sized_incr_relobj::do_relocate): Write the local symbols.
4422 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
4423 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
4424 Adjust size of input file header.
4425 (Incremental_inputs_reader::get_local_symbol_offset): New function.
4426 (Incremental_inputs_reader::get_local_symbol_count): New function.
4427 (Incremental_inputs_reader::get_input_section): Adjust size of input
4429 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
4430 (Sized_incr_relobj::This): New typedef.
4431 (Sized_incr_relobj::sym_size): New const data member.
4432 (Sized_incr_relobj::Local_symbol): New struct.
4433 (Sized_incr_relobj::do_output_local_symbol_count): New function.
4434 (Sized_incr_relobj::do_local_symbol_offset): New function.
4435 (Sized_incr_relobj::local_symbol_count_): New data member.
4436 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
4437 (Sized_incr_relobj::local_symbol_index_): New data member.
4438 (Sized_incr_relobj::local_symbol_offset_): New data member.
4439 (Sized_incr_relobj::local_dynsym_offset_): New data member.
4440 (Sized_incr_relobj::local_symbols_): New data member.
4441 * object.h (Relobj::output_local_symbol_count): New function.
4442 (Relobj::local_symbol_offset): New function.
4443 (Relobj::do_output_local_symbol_count): New function.
4444 (Relobj::do_local_symbol_offset): New function.
4445 (Sized_relobj::do_output_local_symbol_count): New function.
4446 (Sized_relobj::do_local_symbol_offset): New function.
4448 2011-04-22 Vladimir Simonov <sv@sw.ru>
4450 * descriptors.cc (set_close_on_exec): New function.
4451 (Descriptors::open): Use set_close_on_exec.
4452 * output.cc (S_ISLNK): Define if not defined.
4454 2011-04-22 Cary Coutant <ccoutant@google.com>
4456 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4458 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4459 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
4460 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
4462 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
4463 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
4464 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
4466 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
4468 (Incremental_binary::apply_incremental_relocs): New function.
4469 (Incremental_binary::do_apply_incremental_relocs): New function.
4470 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4472 (Sized_incremental_binary::add_global_symbol): New function.
4473 (Sized_incremental_binary::global_symbol): New function.
4474 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4475 (Sized_incremental_binary::symbol_map_): New data member.
4476 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
4477 * target.h (Sized_target::apply_relocation): New function.
4478 * target-reloc.h (apply_relocation): New function.
4479 * x86_64.cc (Target_x86_64::apply_relocation): New function.
4481 2011-04-22 Doug Kwan <dougkwan@google.com>
4483 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
4484 flag of a SHT_ARM_EXIDX section.
4485 * testsuite/Makefile.am (arm_exidx_test): New test rules.
4486 * testsuite/Makefile.in: Regenerate.
4487 * testsuite/arm_exidx_test.s: New file.
4488 * testsuite/arm_exidx_test.sh: Same.
4490 2011-04-20 Cary Coutant <ccoutant@google.com>
4493 * archive.h (Incremental_archive_entry::Archive_member):
4494 Initialize arg_serial_ (second constructor).
4496 2011-04-17 Ian Lance Taylor <iant@google.com>
4498 * object.cc (Relocate_info::location): Simplify location string.
4499 * errors.cc (Errors::error_at_location): Don't print program
4501 (Errors::warning_at_location): Likewise.
4502 (Errors::undefined_symbol): Likewise.
4503 * testsuite/debug_msg.sh: Update accordingly.
4505 2011-04-14 Cary Coutant <ccoutant@google.com>
4507 * gold/layout.cc (Layout::symtab_section_offset): New function.
4508 * gold/layout.h (Layout::symtab_section_offset): New function.
4509 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
4511 2011-04-12 Ian Lance Taylor <iant@google.com>
4513 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
4514 with MREMAP_MAYMOVE.
4515 * output.h (class Output_file): Add map_is_allocated_ field.
4516 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
4517 not available, provide stubs. If mremap is not available, #define
4519 (MREMAP_MAYMOVE): Define if not defined.
4520 (Output_file::Output_file): Initialize map_is_allocated_.
4521 (Output_file::resize): Check map_is_allocated_.
4522 (Output_file::map_anonymous): If mmap fails, use malloc.
4523 (Output_file::unmap): Don't do anything for an anonymous map.
4524 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
4525 is not available, provide stubs.
4526 (File_read::View::~View): Use free rather than delete[].
4527 (File_read::make_view): Use malloc rather than new[]. If mmap
4529 (File_read::find_or_make_view): Use malloc rather than new[].
4530 * gold.h: Remove HAVE_REMAP code.
4531 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
4532 exists. Rename mremap to gold_mremap. If mmap is not available
4534 * configure, config.in: Rebuild.
4536 2011-04-11 Ian Lance Taylor <iant@google.com>
4538 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
4539 initialize local variable v.
4541 2011-04-11 Cary Coutant <ccoutant@google.com>
4543 * archive.cc (Archive::include_member): Adjust call to
4545 (Add_archive_symbols::run): Track argument serial numbers.
4546 (Lib_group::include_member): Likewise.
4547 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
4548 * archive.h (Incremental_archive_entry::Archive_member):
4549 Initialize arg_serial_.
4550 (Archive_member::arg_serial_): New data member.
4551 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
4552 (Sized_dynobj::do_add_symbols): Track symbols when doing an
4554 (Sized_dynobj::do_for_all_local_got_entries): New function.
4555 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
4557 * fileread.cc (get_mtime): New function.
4558 * fileread.h (get_mtime): New function.
4559 * gold.cc (queue_initial_tasks): Check for incremental update.
4560 (process_incremental_input): New function.
4561 (queue_middle_tasks): Don't force valid target for incremental
4563 * incremental-dump.cc (find_input_containing_global): Adjust
4564 size of symbol info entry.
4565 (dump_incremental_inputs): Dump argument serial number and
4566 in_system_directory flag; bias shndx by 1; print symbol names
4567 when dumping per-file symbol lists; use new symbol info readers.
4569 (Output_section_incremental_inputs:update_data_size): New function.
4570 (Sized_incremental_binary::setup_readers): Setup input readers
4571 for each input file; build maps for files added from libraries
4573 (Sized_incremental_binary::check_input_args): New function.
4574 (Sized_incremental_binary::do_check_inputs): Build map of argument
4575 serial numbers to input arguments.
4576 (Sized_incremental_binary::do_file_has_changed): Rename
4577 do_file_is_unchanged to this; compare file modification times.
4578 (Sized_incremental_binary::do_init_layout): New function.
4579 (Sized_incremental_binary::do_reserve_layout): New function.
4580 (Sized_incremental_binary::do_get_input_reader): Remove.
4581 (Sized_incremental_binary::get_symtab_view): New function.
4582 (Incremental_checker::can_incrementally_link_output_file): Remove.
4583 (Incremental_inputs::report_command_line): Exclude --debug options.
4584 (Incremental_inputs::report_archive_begin): Add parameter; track
4585 argument serial numbers; don't put input file entry for archive
4586 before archive members.
4587 (Incremental_inputs::report_archive_end): Put input file entry
4588 for archive after archive members.
4589 (Incremental_inputs::report_object): Add parameter; track argument
4590 serial numbers and in_system_directory flag.
4591 (Incremental_inputs::report_script): Add parameter; track argument
4593 (Output_section_incremental_inputs::set_final_data_size): Adjust
4594 size of symbol info entry; check for forwarding symbols.
4595 (Output_section_incremental_inputs::write_input_files): Write
4596 in_system_directory flag and argument serial number.
4597 (Output_section_incremental_inputs::write_info_blocks): Map section
4598 indices between incremental info and original input file; store
4599 input section index for each symbol.
4600 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
4601 change operator() to visit().
4602 (class Global_got_offset_visitor): Likewise.
4603 (class Global_symbol_visitor_got_plt):
4604 (Output_section_incremental_inputs::write_got_plt): Use new visitor
4606 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
4607 (Sized_incr_relobj::do_read_symbols): New function.
4608 (Sized_incr_relobj::do_layout): New function.
4609 (Sized_incr_relobj::do_layout_deferred_sections): New function.
4610 (Sized_incr_relobj::do_add_symbols): New function.
4611 (Sized_incr_relobj::do_should_include_member): New function.
4612 (Sized_incr_relobj::do_for_all_global_symbols): New function.
4613 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
4614 (Sized_incr_relobj::do_section_size): New function.
4615 (Sized_incr_relobj::do_section_name): New function.
4616 (Sized_incr_relobj::do_section_contents): New function.
4617 (Sized_incr_relobj::do_section_flags): New function.
4618 (Sized_incr_relobj::do_section_entsize): New function.
4619 (Sized_incr_relobj::do_section_address): New function.
4620 (Sized_incr_relobj::do_section_type): New function.
4621 (Sized_incr_relobj::do_section_link): New function.
4622 (Sized_incr_relobj::do_section_info): New function.
4623 (Sized_incr_relobj::do_section_addralign): New function.
4624 (Sized_incr_relobj::do_initialize_xindex): New function.
4625 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
4626 (Sized_incr_relobj::do_read_relocs): New function.
4627 (Sized_incr_relobj::do_gc_process_relocs): New function.
4628 (Sized_incr_relobj::do_scan_relocs): New function.
4629 (Sized_incr_relobj::do_count_local_symbols): New function.
4630 (Sized_incr_relobj::do_finalize_local_symbols): New function.
4631 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
4632 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
4633 (Sized_incr_relobj::do_relocate): New function.
4634 (Sized_incr_relobj::do_set_section_offset): New function.
4635 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
4636 (Sized_incr_dynobj::do_read_symbols): New function.
4637 (Sized_incr_dynobj::do_layout): New function.
4638 (Sized_incr_dynobj::do_add_symbols): New function.
4639 (Sized_incr_dynobj::do_should_include_member): New function.
4640 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
4641 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
4642 (Sized_incr_dynobj::do_section_size): New function.
4643 (Sized_incr_dynobj::do_section_name): New function.
4644 (Sized_incr_dynobj::do_section_contents): New function.
4645 (Sized_incr_dynobj::do_section_flags): New function.
4646 (Sized_incr_dynobj::do_section_entsize): New function.
4647 (Sized_incr_dynobj::do_section_address): New function.
4648 (Sized_incr_dynobj::do_section_type): New function.
4649 (Sized_incr_dynobj::do_section_link): New function.
4650 (Sized_incr_dynobj::do_section_info): New function.
4651 (Sized_incr_dynobj::do_section_addralign): New function.
4652 (Sized_incr_dynobj::do_initialize_xindex): New function.
4653 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
4654 (make_sized_incremental_object): New function.
4655 (Incremental_library::copy_unused_symbols): New function.
4656 (Incremental_library::do_for_all_unused_symbols): New function.
4657 * incremental.h (enum Incremental_input_flags): New type.
4658 (class Incremental_checker): Remove.
4659 (Incremental_input_entry::Incremental_input_entry): Add argument
4661 (Incremental_input_entry::arg_serial): New function.
4662 (Incremental_input_entry::set_is_in_system_directory): New function.
4663 (Incremental_input_entry::is_in_system_directory): New function.
4664 (Incremental_input_entry::arg_serial_): New data member.
4665 (Incremental_input_entry::is_in_system_directory_): New data member.
4666 (class Script_info): Move here from script.h.
4667 (Script_info::Script_info): Add filename parameter.
4668 (Script_info::filename): New function.
4669 (Script_info::filename_): New data member.
4670 (Incremental_script_entry::Incremental_script_entry): Add argument
4672 (Incremental_object_entry::Incremental_object_entry): Likewise.
4673 (Incremental_object_entry::add_input_section): Build list of input
4674 sections with map to original shndx.
4675 (Incremental_object_entry::get_input_section_index): New function.
4676 (Incremental_object_entry::shndx_): New data member.
4677 (Incremental_object_entry::name_key_): Rename; adjust all refs.
4678 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
4679 (Incremental_archive_entry::Incremental_archive_entry): Add argument
4681 (Incremental_inputs::report_archive_begin): Likewise.
4682 (Incremental_inputs::report_object): Likewise.
4683 (Incremental_inputs::report_script): Likewise.
4684 (class Incremental_global_symbol_reader): New class.
4685 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
4686 and store flags and input file type.
4687 (Incremental_input_entry_reader::arg_serial): New function.
4688 (Incremental_input_entry_reader::type): Extract type from flags.
4689 (Incremental_input_entry_reader::is_in_system_directory): New function.
4690 (Incremental_input_entry_reader::get_input_section_count): Call
4691 accessor function for type.
4692 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
4693 function for type; adjust size of global symbol entry.
4694 (Incremental_input_entry_reader::get_global_symbol_count): Call
4695 accessor function for type.
4696 (Incremental_input_entry_reader::get_object_count): Likewise.
4697 (Incremental_input_entry_reader::get_object_offset): Likewise.
4698 (Incremental_input_entry_reader::get_member_count): Likewise.
4699 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
4700 (Incremental_input_entry_reader::get_member_offset): Likewise.
4701 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
4702 (Incremental_input_entry_reader::Global_symbol_info): Remove.
4703 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
4704 (Incremental_input_entry_reader::get_global_symbol_reader): New
4706 (Incremental_input_entry_reader::get_output_symbol_index): New
4708 (Incremental_input_entry_reader::type_): Remove.
4709 (Incremental_input_entry_reader::flags_): New data member.
4710 (Incremental_inputs_reader::input_file_offset): New function.
4711 (Incremental_inputs_reader::input_file_index): New function.
4712 (Incremental_inputs_reader::input_file): Call input_file_offset.
4713 (Incremental_inputs_reader::input_file_at_offset): New function.
4714 (Incremental_relocs_reader::get_r_type): Reformat.
4715 (Incremental_relocs_reader::get_r_shndx): Reformat.
4716 (Incremental_relocs_reader::get_r_offset): Reformat.
4717 (Incremental_relocs_reader::data): New function.
4718 (Incremental_binary::Incremental_binary): Initialize new data members.
4719 (Incremental_binary::check_inputs): Add cmdline parameter.
4720 (Incremental_binary::file_is_unchanged): Remove.
4721 (Input_reader::arg_serial): New function.
4722 (Input_reader::get_unused_symbol_count): New function.
4723 (Input_reader::get_unused_symbol): New function.
4724 (Input_reader::do_arg_serial): New function.
4725 (Input_reader::do_get_unused_symbol_count): New function.
4726 (Input_reader::do_get_unused_symbol): New function.
4727 (Incremental_binary::input_file_count): New function.
4728 (Incremental_binary::get_input_reader): Change signature to use
4729 index instead of filename.
4730 (Incremental_binary::file_has_changed): New function.
4731 (Incremental_binary::get_input_argument): New function.
4732 (Incremental_binary::get_library): New function.
4733 (Incremental_binary::get_script_info): New function.
4734 (Incremental_binary::init_layout): New function.
4735 (Incremental_binary::reserve_layout): New function.
4736 (Incremental_binary::output_file): New function.
4737 (Incremental_binary::do_check_inputs): New function.
4738 (Incremental_binary::do_file_is_unchanged): Remove.
4739 (Incremental_binary::do_file_has_changed): New function.
4740 (Incremental_binary::do_init_layout): New function.
4741 (Incremental_binary::do_reserve_layout): New function.
4742 (Incremental_binary::do_input_file_count): New function.
4743 (Incremental_binary::do_get_input_reader): Change signature.
4744 (Incremental_binary::input_args_map_): New data member.
4745 (Incremental_binary::library_map_): New data member.
4746 (Incremental_binary::script_map_): New data member.
4747 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4749 (Sized_incremental_binary::output_section): New function.
4750 (Sized_incremental_binary::inputs_reader): Add const.
4751 (Sized_incremental_binary::symtab_reader): Add const.
4752 (Sized_incremental_binary::relocs_reader): Add const.
4753 (Sized_incremental_binary::got_plt_reader): Add const.
4754 (Sized_incremental_binary::get_symtab_view): New function.
4755 (Sized_incremental_binary::Inputs_reader): New typedef.
4756 (Sized_incremental_binary::Input_entry_reader): New typedef.
4757 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
4758 (Sized_incremental_binary::do_file_is_unchanged): Remove.
4759 (Sized_incremental_binary::do_file_has_changed): New function.
4760 (Sized_incremental_binary::do_init_layout): New function.
4761 (Sized_incremental_binary::do_reserve_layout): New function.
4762 (Sized_input_reader::Inputs_reader): Remove.
4763 (Sized_input_reader::Input_entry_reader): Remove.
4764 (Sized_input_reader::do_arg_serial): New function.
4765 (Sized_input_reader::do_get_unused_symbol_count): New function.
4766 (Sized_input_reader::do_get_unused_symbol): New function.
4767 (Sized_incremental_binary::do_input_file_count): New function.
4768 (Sized_incremental_binary::do_get_input_reader): Change signature;
4769 use index instead of filename.
4770 (Sized_incremental_binary::section_map_): New data member.
4771 (Sized_incremental_binary::input_entry_readers_): New data member.
4772 (class Sized_incr_relobj): New class.
4773 (class Sized_incr_dynobj): New class.
4774 (make_sized_incremental_object): New function.
4775 (class Incremental_library): New class.
4776 * layout.cc (Free_list::num_lists): New static data member.
4777 (Free_list::num_nodes): New static data member.
4778 (Free_list::num_removes): New static data member.
4779 (Free_list::num_remove_visits): New static data member.
4780 (Free_list::num_allocates): New static data member.
4781 (Free_list::num_allocate_visits): New static data member.
4782 (Free_list::init): New function.
4783 (Free_list::remove): New function.
4784 (Free_list::allocate): New function.
4785 (Free_list::dump): New function.
4786 (Free_list::print_stats): New function.
4787 (Layout_task_runner::run): Resize output file for incremental updates.
4788 (Layout::Layout): Initialize new data members.
4789 (Layout::set_incremental_base): New function.
4790 (Layout::init_fixed_output_section): New function.
4791 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
4792 incremental updates.
4793 (Layout::create_gold_note): Do not create gold note section for
4794 incremental updates.
4795 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
4796 for incremental updates.
4797 (Layout::set_section_offsets): For incremental updates, allocate space
4799 (Layout::create_symtab_sections): Layout with offsets relative to
4800 start of section; for incremental updates, allocate space from free
4802 (Layout::create_shdrs): For incremental updates, allocate space from
4804 (Layout::finish_dynamic_section): For incremental updates, do not
4805 check --as-needed (fixed in subsequent patch).
4806 * layout.h (class Free_list): New class.
4807 (Layout::set_incremental_base): New function.
4808 (Layout::incremental_base): New function.
4809 (Layout::init_fixed_output_section): New function.
4810 (Layout::allocate): New function.
4811 (Layout::incremental_base_): New data member.
4812 (Layout::free_list_): New data member.
4813 * main.cc (main): Print Free_list statistics.
4814 * object.cc (Relobj::finalize_incremental_relocs): Add
4815 clear_counts parameter; clear counts only when clear_counts is set.
4816 (Sized_relobj::Sized_relobj): Initialize new base class.
4817 (Sized_relobj::do_layout): Don't report special sections.
4818 (Sized_relobj::do_for_all_local_got_entries): New function.
4819 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
4820 symtab_off to all symbol table offsets.
4821 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
4822 * object.h (class Got_offset_list): Move to top of file.
4823 (Object::Object): Allow case where input_file == NULL.
4824 (Object::~Object): Likewise.
4825 (Object::input_file): Assert that input_file != NULL.
4826 (Object::lock): Allow case where input_file == NULL.
4827 (Object::unlock): Likewise.
4828 (Object::is_locked): Likewise.
4829 (Object::token): Likewise.
4830 (Object::release): Likewise.
4831 (Object::is_incremental): New function.
4832 (Object::get_mtime): New function.
4833 (Object::for_all_local_got_entries): New function.
4834 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
4835 (Object::set_is_in_system_directory): New function.
4836 (Object::is_in_system_directory): New function.
4837 (Object::do_is_incremental): New function.
4838 (Object::do_get_mtime): New function.
4839 (Object::do_for_all_local_got_entries): New function.
4840 (Object::is_in_system_directory_): New data member.
4841 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
4842 (class Sized_relobj_base): New class.
4843 (class Sized_relobj): Derive from Sized_relobj_base.
4844 (class Sized_relobj::Symbols): Redeclare from base class.
4845 (class Sized_relobj::local_got_offset_list): Remove.
4846 (class Sized_relobj::Output_sections): Redeclare from base class.
4847 (class Sized_relobj::do_for_all_local_got_entries): New function.
4848 (class Sized_relobj::write_local_symbols): Add offset parameter.
4849 (class Sized_relobj::local_symbol_offset_): Update comment.
4850 (class Sized_relobj::local_dynsym_offset_): Update comment.
4851 * options.cc (Input_arguments::add_file): Remove const.
4852 * options.h (Input_file_argument::Input_file_argument):
4853 Initialize arg_serial_ (all constructors).
4854 (Input_file_argument::set_arg_serial): New function.
4855 (Input_file_argument::arg_serial): New function.
4856 (Input_file_argument::arg_serial_): New data member.
4857 (Input_arguments::Input_arguments): Initialize file_count_.
4858 (Input_arguments::add_file): Remove const.
4859 (Input_arguments::number_of_input_files): New function.
4860 (Input_arguments::file_count_): New data member.
4861 (Command_line::number_of_input_files): Call
4862 Input_arguments::number_of_input_files.
4863 * output.cc (Output_segment_headers::Output_segment_headers):
4865 (Output_section::Input_section::current_data_size): New function.
4866 (Output_section::Output_section): Initialize new data members.
4867 (Output_section::add_input_section): Don't do merge sections for
4868 an incremental link; allocate space from free list for an
4870 (Output_section::add_output_section_data): Allocate space from
4871 free list for an incremental update.
4872 (Output_section::update_data_size): New function.
4873 (Output_section::set_fixed_layout): New function.
4874 (Output_section::reserve): New function.
4875 (Output_segment::set_section_addresses): Remove const.
4876 (Output_segment::set_section_list_addresses): Remove const; allocate
4877 space from free list for an incremental update.
4878 (Output_segment::set_offset): Adjust size of RELRO segment for an
4880 * output.h (Output_data::current_data_size): Move here from
4882 (Output_data::pre_finalize_data_size): New function.
4883 (Output_data::update_data_size): New function.
4884 (Output_section_headers::update_data_size): new function.
4885 (Output_section_data_build::current_data_size): Move to Output_data.
4886 (Output_data_strtab::update_data_size): New function.
4887 (Output_section::current_data_size): Move to Output_data.
4888 (Output_section::set_fixed_layout): New function.
4889 (Output_section::has_fixed_layout): New function.
4890 (Output_section::reserve): New function.
4891 (Output_section::update_data_size): New function.
4892 (Output_section::has_fixed_layout_): New data member.
4893 (Output_section::free_list_): New data member.
4894 (Output_segment::set_section_addresses): Remove const.
4895 (Output_segment::set_section_list_addresses): Remove const.
4896 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
4898 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
4900 * readsyms.cc (Read_symbols::do_read_symbols): Add library
4901 parameter when calling Add_symbols constructor; store argument
4902 serial number for members of a lib group.
4903 (Add_symbols::locks): Allow case where token == NULL.
4904 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
4905 (Read_member::~Read_member): New function.
4906 (Read_member::is_runnable): New function.
4907 (Read_member::locks): New function.
4908 (Read_member::run): New function.
4909 (Check_script::~Check_script): New function.
4910 (Check_script::is_runnable): New function.
4911 (Check_script::locks): New function.
4912 (Check_script::run): New function.
4913 (Check_library::~Check_library): New function.
4914 (Check_library::is_runnable): New function.
4915 (Check_library::locks): New function.
4916 (Check_library::run): New function.
4917 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
4918 (Add_symbols::library_): New data member.
4919 (class Read_member): New class.
4920 (class Check_script): New class.
4921 (class Check_library): New class.
4922 * reloc.cc (Read_relocs::is_runnable): Allow case where
4924 (Read_relocs::locks): Likewise.
4925 (Scan_relocs::locks): Likewise.
4926 (Relocate_task::locks): Likewise.
4927 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
4929 (Sized_relobj::incremental_relocs_scan): Fix comment.
4930 (Sized_relobj::do_relocate): Pass output file offset to
4931 write_local_symbols.
4932 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
4933 from class declaration.
4934 * script.cc (read_input_script): Allocate Script_info; pass
4935 argument serial number to report_script.
4936 * script.h (class Script_info): Move to incremental.h.
4937 * symtab.cc (Symbol_table::add_from_incrobj): New function.
4938 * symtab.h (Symbol_table::add_from_incrobj): New function.
4939 (Symbol_table::set_file_offset): New function.
4941 2011-04-05 Cary Coutant <ccoutant@google.com>
4943 * incremental-dump.cc (dump_incremental_inputs): Change signature
4944 to take a Sized_incremental_binary; change caller. Use readers
4945 in Sized_incremental_binary.
4947 (Sized_incremental_binary::find_incremental_inputs_sections):
4948 Rename do_find_incremental_inputs_sections to this.
4949 (Sized_incremental_binary::setup_readers): New function.
4950 (Sized_incremental_binary::do_check_inputs): Check
4951 has_incremental_info_ flag; move setup code to setup_readers;
4953 (Sized_incremental_binary::do_file_is_unchanged): New function.
4954 (Sized_incremental_binary::do_get_input_reader): New function.
4955 * incremental.h (class Incremental_binary): Move to end of file.
4956 (Incremental_binary::file_is_unchanged): New function.
4957 (Incremental_binary::do_file_is_unchanged): New function.
4958 (Incremental_binary::Input_reader): New class.
4959 (Incremental_binary::get_input_reader): New function.
4960 (class Sized_incremental_binary): Move to end of file.
4961 (Sized_incremental_binary::Sized_incremental_binary): Setup the
4962 input section reader classes.
4963 (Sized_incremental_binary::has_incremental_info): New function.
4964 (Sized_incremental_binary::inputs_reader): New function.
4965 (Sized_incremental_binary::symtab_reader): New function.
4966 (Sized_incremental_binary::relocs_reader): New function.
4967 (Sized_incremental_binary::got_plt_reader): New function.
4968 (Sized_incremental_binary::do_file_is_unchanged): New function.
4969 (Sized_incremental_binary::Sized_input_reader): New class.
4970 (Sized_incremental_binary::get_input_reader): New function.
4971 (Sized_incremental_binary::find_incremental_inputs_sections):
4972 Rename do_find_incremental_inputs_sections to this.
4973 (Sized_incremental_binary::setup_readers): New function.
4974 (Sized_incremental_binary::has_incremental_info_): New data member.
4975 (Sized_incremental_binary::inputs_reader_): New data member.
4976 (Sized_incremental_binary::symtab_reader_): New data member.
4977 (Sized_incremental_binary::relocs_reader_): New data member.
4978 (Sized_incremental_binary::got_plt_reader_): New data member.
4979 (Sized_incremental_binary::current_input_file_): New data member.
4981 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
4984 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
4987 2011-03-30 Cary Coutant <ccoutant@google.com>
4989 * archive.cc (Archive::include_member): Adjust call to report_object.
4990 (Add_archive_symbols::run): Add script_info to call to
4991 report_archive_begin.
4992 (Lib_group::include_member): Adjust call to report_object.
4993 (Add_lib_group_symbols::run): Adjust call to report_object.
4994 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
4995 blocks. Add object count for script input files.
4996 * incremental.cc (Incremental_inputs::report_archive_begin): Add
4997 script_info parameter; change all callers.
4998 (Incremental_inputs::report_object): Add script_info parameter;
5000 (Incremental_inputs::report_script): Store backpointer to
5001 incremental info entry.
5002 (Output_section_incremental_inputs::set_final_data_size): Record
5003 additional information for scripts.
5004 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5005 * incremental.h (Incremental_script_entry::add_object): New function.
5006 (Incremental_script_entry::get_object_count): New function.
5007 (Incremental_script_entry::get_object): New function.
5008 (Incremental_script_entry::objects_): New data member; adjust
5010 (Incremental_inputs::report_archive_begin): Add script_info parameter.
5011 (Incremental_inputs::report_object): Add script_info parameter.
5012 (Incremental_inputs_reader::get_object_count): New function.
5013 (Incremental_inputs_reader::get_object_offset): New function.
5014 * options.cc (Input_arguments::add_file): Return reference to
5016 * options.h (Input_argument::set_script_info): New function.
5017 (Input_argument::script_info): New function.
5018 (Input_argument::script_info_): New data member; adjust all
5020 (Input_file_group::add_file): Return reference to new input argument.
5021 (Input_file_lib::add_file): Likewise.
5022 (Input_arguments::add_file): Likewise.
5023 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
5024 * script.cc (Parser_closure::Parser_closure): Add script_info
5025 parameter; adjust all callers.
5026 (Parser_closure::script_info): New function.
5027 (Parser_closure::script_info_): New data member.
5028 (read_input_script): Report scripts earlier to incremental info.
5029 (script_add_file): Set script_info in Input_argument.
5030 (script_add_library): Likewise.
5031 * script.h (Script_options::Script_info): Rewrite class.
5033 2011-03-29 Cary Coutant <ccoutant@google.com>
5035 * archive.cc (Library_base::should_include_member): Move
5036 method here from class Archive.
5037 (Archive::Archive): Initialize base class.
5038 (Archive::should_include_member): Move to base class.
5039 (Archive::do_for_all_unused_symbols): New function.
5040 (Add_archive_symbols::run): Remove redundant access to
5042 (Lib_group::Lib_group): Initialize base class.
5043 (Lib_group::do_filename): New function.
5044 (Lib_group::include_member): Pass pointer to Lib_group to
5046 (Lib_group::do_for_all_unused_symbols): New function.
5047 (Add_lib_group_symbols::run): Report archive information for
5049 * archive.h (class Library_base): New base class.
5050 (class Archive): Derive from Library_base.
5051 (Archive::filename): Move to base class.
5052 (Archive::set_incremental_info): Likewise.
5053 (Archive::incremental_info): Likewise.
5054 (Archive::Should_include): Likewise.
5055 (Archive::should_include_member): Likewise.
5056 (Archive::Armap_entry): Remove.
5057 (Archive::Unused_symbol_iterator): Remove.
5058 (Archive::unused_symbols_begin): Remove.
5059 (Archive::unused_symbols_end): Remove.
5060 (Archive::do_filename): New function.
5061 (Archive::do_get_mtime): New function.
5062 (Archive::do_for_all_unused_symbols): New function.
5063 (Archive::task_): Move to base class.
5064 (Archive::incremental_info_): Likewise.
5065 (class Lib_group): Derive from Library_base.
5066 (Lib_group::do_filename): New function.
5067 (Lib_group::do_get_mtime): New function.
5068 (Lib_group::do_for_all_unused_symbols): New function.
5069 (Lib_group::task_): Move to base class.
5070 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
5072 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
5074 * incremental.cc (Incremental_inputs::report_archive_begin):
5075 Use Library_base; call library's get_mtime; add incremental inputs
5076 entry before members.
5077 (class Unused_symbol_visitor): New class.
5078 (Incremental_inputs::report_archive_end): Use Library_base; use
5079 visitor class to record unused symbols; don't add incremental inputs
5080 entry after members.
5081 (Incremental_inputs::report_object): Use Library_base.
5083 (Incremental_archive_entry::Incremental_archive_entry): Remove
5084 unused Archive parameter.
5085 (Incremental_inputs::report_archive_begin): Use Library_base.
5086 (Incremental_inputs::report_archive_end): Likewise.
5087 (Incremental_inputs::report_object): Likewise.
5088 * object.cc (Sized_relobj::do_for_all_global_symbols): New
5090 * object.h (Object::for_all_global_symbols): New function.
5091 (Object::do_for_all_global_symbols): New function.
5092 (Sized_relobj::do_for_all_global_symbols): New function.
5093 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
5095 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
5098 2011-03-27 Ian Lance Taylor <iant@google.com>
5100 * archive.cc (Archive::interpret_header): Return -1 if something
5101 goes wrong. Change callers accordingly.
5103 2011-03-25 Cary Coutant <ccoutant@google.com>
5105 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
5106 * testsuite/Makefile.in: Regenerate.
5108 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
5110 * plugin.cc (get_view): New.
5111 (Plugin::load): Pass get_view to the plugin.
5112 (Plugin_manager::get_view): New.
5114 2011-03-21 Ian Lance Taylor <iant@google.com>
5116 * testsuite/final_layout.sh: Rewrite to not use dc.
5117 * testsuite/relro_test.sh: Fail if dc is not present.
5119 2011-03-21 Sriraman Tallam <tmsriram@google.com>
5121 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
5123 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
5124 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
5126 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
5127 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
5129 2011-03-14 Ian Lance Taylor <iant@google.com>
5131 * script-sections.cc (Sort_output_sections::script_compare):
5132 Rename from is_before, change return type.
5133 (Sort_output_sections::operator()): Adjust accordingly.
5135 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
5138 * testsuite/odr_violation2.cc: Add comment to make all error line
5139 numbers double digits.
5140 * testsuite/debug_msg.sh: Adjust expected errors.
5142 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
5144 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
5145 but mark earlier ones as non-canonical
5146 (offset_to_iterator): Update search target and example
5147 (do_addr2line): Return extra lines in a vector*
5148 (format_file_lineno): Extract from do_addr2line
5149 (one_addr2line): Add vector* out-param
5150 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
5151 when a lineno entry appeared last for its instruction
5152 (Dwarf_line_info): Add vector* out-param
5153 * object.cc (Relocate_info): Pass NULL for the vector* out-param
5154 * symtab.cc (Odr_violation_compare): Include the lineno in the
5156 (linenos_from_loc): New. Combine the canonical line for an
5157 address with its other lines.
5158 (True_if_intersect): New. Helper functor to make
5159 std::set_intersection a query.
5160 (detect_odr_violations): Compare sets of lines instead of just
5161 one line for each function. This became less deterministic, but
5162 has fewer false positives.
5163 * symtab.h: Declarations.
5164 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
5165 mix an optimized and non-optimized object in the same binary
5166 (odr_violation2.so): Same.
5167 * testsuite/Makefile.in: Regenerate from Makefile.am.
5168 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
5169 * testsuite/debug_msg.sh: Update line numbers and add
5171 * testsuite/odr_violation1.cc: Use OdrDerived, in a
5172 non-optimized context.
5173 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
5174 isn't inlined, and use OdrDerived in an optimized context.
5175 * testsuite/odr_header1.h: Defines OdrDerived, where
5176 optimization will change the
5177 first-instruction-in-the-destructor's file and line number.
5178 * testsuite/odr_header2.h: Defines OdrBase.
5180 2011-03-09 Ian Lance Taylor <iant@google.com>
5182 * fileread.cc (File_read::clear_views): Don't delete the whole
5185 2011-03-08 Ian Lance Taylor <iant@google.com>
5188 * fileread.cc: #include <climits>.
5189 (GOLD_IOV_MAX): Define.
5190 (File_read::read_multiple): Limit number of entries by iov_max.
5191 * fileread.h (class File_read): Always set max_readv_entries to
5194 2011-03-07 Ian Lance Taylor <iant@google.com>
5197 * options.h (class General_options): Add -dy and -dn.
5199 2011-03-02 Cary Coutant <ccoutant@google.com>
5201 * testsuite/script_test_9.t: Add TLS segment.
5203 2011-03-02 Simon Baldwin <simonb@google.com>
5205 * configure.ac: Add check for gnu_indirect_function support in
5206 the toolchain building binutils.
5207 * configure: Rebuild.
5209 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
5211 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
5212 plugin only symbols.
5213 (Symbol_table::sized_finalize_symbol) Mark symbol only present
5214 in plugin files as not needed in the symbol table.
5216 2011-02-11 Sriraman Tallam <tmsriram@google.com>
5218 * output.cc (Output_section::add_input_section): Delay fill
5219 generation for section ordering.
5221 2011-02-09 Ian Lance Taylor <iant@google.com>
5224 * object.h (class Sized_relobj): Remove clear_local_symbols.
5225 * reloc.cc (Sized_relobj::do_relocate): Don't call
5226 clear_local_symbols.
5228 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
5230 * plugin.cc (is_visible_from_outside): Return true for symbols
5233 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
5235 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
5238 2011-02-02 Sriraman Tallam <tmsriram@google.com>
5240 * icf.h (is_section_foldable_candidate): Change type of parameter
5242 * icf.cc (Icf::find_identical_sections): Change type of local variable
5243 section_name to be std::string.
5244 (is_function_ctor_or_dtor): Change type of parameter to std::string.
5246 2011-01-25 Ian Lance Taylor <iant@google.com>
5248 * script.cc (script_add_extern): Rewrite to use
5249 add_symbol_reference.
5251 2011-01-25 Doug Kwan <dougkwan@google.com>
5253 * icf.cc (get_section_contents): Always lock section's object.
5255 2011-01-24 Ian Lance Taylor <iant@google.com>
5257 * options.h (class General_options): Accept
5258 --no-detect-odr-violations.
5260 2011-01-24 Ian Lance Taylor <iant@google.com>
5262 * version.cc (version_string): Bump to 1.11.
5264 2011-01-24 Ian Lance Taylor <iant@google.com>
5266 * plugin.cc (class Plugin_rescan): Define new class.
5267 (Plugin_manager::claim_file): Set any_claimed_.
5268 (Plugin_manager::save_archive): New function.
5269 (Plugin_manager::save_input_group): New function.
5270 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
5272 (Plugin_manager::new_undefined_symbol): New function.
5273 (Plugin_manager::rescan): New function.
5274 (Plugin_manager::rescannable_defines): New function.
5275 (Plugin_manager::add_input_file): Set any_added_.
5276 * plugin.h (class Plugin_manager): define new fields rescannable_,
5277 undefined_symbols_, any_claimed_, and any_added_. Declare
5278 Plugin_rescan as friend. Declare new functions.
5279 (Plugin_manager::Rescannable): Define type.
5280 (Plugin_manager::Rescannable_list): Define type.
5281 (Plugin_manager::Undefined_symbol_list): Define type.
5282 (Plugin_manager::Plugin_manager): Initialize new fields.
5283 * archive.cc (Archive::defines_symbol): New function.
5284 (Add_archive_symbols::run): Pass archive to plugins if any.
5285 * archive.h (class Archive): Declare defines_symbol.
5286 * readsyms.cc (Input_group::~Input_group): New function.
5287 (Finish_group::run): Pass input_group to plugins if any.
5288 * readsyms.h (class Input_group): Declare destructor.
5289 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
5292 2011-01-10 Ian Lance Taylor <iant@google.com>
5294 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
5296 (Layout::set_segment_offsets): Reset increase_relro before calling
5297 set_section_addresses a second time.
5299 2011-01-04 Cary Coutant <ccoutant@google.com>
5301 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
5302 sections before NOBITS sections.
5304 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
5306 * version.cc (print_version): Update copyright to 2011.
5308 2010-12-23 Cary Coutant <ccoutant@google.com>
5310 * output.h (Output_data_reloc::add_output_section): Pass OD instead
5311 of OS to this->add. Add OD parameter to second form of the function.
5313 2010-12-20 Ian Lance Taylor <iant@google.com>
5315 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
5316 second of two consecutive entries with same offset.
5318 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5320 * testsuite/Makefile.am (ifuncmain2static_LDADD)
5321 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
5322 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
5323 to avoid unneeded links against $(LDADD).
5324 * testsuite/Makefile.in: Regenerate.
5326 2010-12-15 Ian Lance Taylor <iant@google.com>
5329 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
5330 for R_X86_64_32 and R_X86_64_PC32.
5331 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
5332 ver_matching_def_pic.o.
5333 (ver_matching_def_pic.o): New target.
5335 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5337 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
5338 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
5339 Move definition before File_read::View member definitions.
5340 (File_read::View::~View): Initialize and hold lock before
5341 updating current_mapped_bytes.
5343 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5345 * dwarf_reader.cc: Remove outdated comment.
5346 * gold-threads.cc: Fix typo in error message.
5347 * archive.cc: Fix typos in comments.
5348 * archive.h: Likewise.
5349 * arm-reloc-property.cc: Likewise.
5350 * arm-reloc-property.h: Likewise.
5351 * arm-reloc.def: Likewise.
5353 * attributes.h: Likewise.
5354 * cref.cc: Likewise.
5355 * ehframe.cc: Likewise.
5356 * fileread.h: Likewise.
5358 * i386.cc: Likewise.
5360 * incremental.h: Likewise.
5361 * int_encoding.cc: Likewise.
5362 * layout.h: Likewise.
5363 * main.cc: Likewise.
5364 * merge.h: Likewise.
5365 * object.cc: Likewise.
5366 * object.h: Likewise.
5367 * options.cc: Likewise.
5368 * readsyms.cc: Likewise.
5369 * reduced_debug_output.cc: Likewise.
5370 * reloc.cc: Likewise.
5371 * script-sections.cc: Likewise.
5372 * sparc.cc: Likewise.
5373 * symtab.h: Likewise.
5374 * target-reloc.h: Likewise.
5375 * target.cc: Likewise.
5376 * target.h: Likewise.
5377 * timer.cc: Likewise.
5378 * timer.h: Likewise.
5379 * x86_64.cc: Likewise.
5381 2010-12-09 Cary Coutant <ccoutant@google.com>
5383 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
5385 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
5386 parameter; change all callers.
5387 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
5388 * options.h (warn_execstack): New option.
5390 2010-12-07 Doug Kwan <dougkwan@google.com>
5392 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
5393 like function call relocations.
5395 2010-12-07 Ian Lance Taylor <iant@google.com>
5397 * archive.cc (Archive::get_elf_object_for_member): Permit
5398 punconfigured to be NULL.
5399 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
5400 (Archive::include_member): Pass NULL to get_elf_object_for_member
5401 if we searched for the archive and this is the first included
5404 2010-12-01 Ian Lance Taylor <iant@google.com>
5406 * dwarf_reader.h (class Sized_dwarf_line_info): Add
5407 track_relocs_type_ field.
5408 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5409 Set track_relocs_type_.
5410 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
5411 contents when using RELA relocs.
5412 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
5414 * reloc.cc (Track_relocs::next_addend): New function.
5415 * reloc.h (class Track_relocs): Declare next_addend.
5417 2010-12-01 Ian Lance Taylor <iant@google.com>
5419 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
5422 2010-12-01 Ian Lance Taylor <iant@google.com>
5424 * README: Update compilers known to work and fail.
5426 2010-11-23 Matthias Klose <doko@ubuntu.com>
5428 * configure.in: For --enable-gold, handle value `default' instead of
5429 `both*'. Always install ld as ld.bfd, install as ld if gold is
5431 * configure: Regenerate.
5433 2010-11-18 Doug Kwan <dougkwan@google.com>
5435 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
5436 and right_alignment to be zero. Store result alignment only if it is
5437 greater than existing alignment.
5439 2010-11-16 Cary Coutant <ccoutant@google.com>
5442 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5443 Check for ".zdebug_line".
5445 2010-11-16 Doug Kwan <dougkwan@google.com>
5446 Cary Coutant <ccoutant@google.com>
5448 * output.h (Output_segment::set_section_addresses): Pass increase_relro
5449 by reference; adjust all callers.
5450 * output.cc (Output_segment::set_section_addresses): Adjust references
5451 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
5453 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
5454 end at page boundary.
5456 2010-11-16 Cary Coutant <ccoutant@google.com>
5459 * layout.cc (Layout::choose_output_section): Transform names of
5460 compressed sections even when using a script with a SECTIONS clause.
5461 (Layout::output_section_name): Remove code to transform
5462 compressed debug section names.
5463 * output.cc (Output_section::add_input_section): Use uncompressed
5464 section size when tracking input sections.
5466 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
5468 * symtab.h (Symbol::NON_PIC_REF): Remove.
5469 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
5470 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
5471 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
5472 (Symbol::use_plt_offset): Take a flags argument and pass it
5473 directly to needs_dynamic_reloc. Restrict check for undefined
5474 weak symbols to function calls.
5475 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
5476 (Target_arm::Scan::global): Use it.
5477 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
5478 (Target_arm::Relocate::relocate): Likewise.
5479 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
5480 parameter with an r_type parameter. Use get_reference_flags
5482 (Target_arm::Relocate::relocate): Update accordingly.
5483 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
5484 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
5485 (Target_i386::Scan::global): Likewise.
5486 (Target_i386::Relocate::relocate): Likewise.
5487 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
5488 parameter with an r_type parameter. Use get_reference_flags
5490 (Target_i386::Relocate::relocate): Update accordingly.
5491 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
5492 (Target_powerpc::Scan::global): Use it.
5493 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
5494 (Target_powerpc::Relocate::relocate): Likewise.
5495 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
5496 (Target_sparc::Scan::global): Use it.
5497 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
5498 (Target_sparc::Relocate::relocate): Likewise.
5499 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
5500 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
5501 (Target_x86_64::Scan::global): Likewise.
5502 (Target_x86_64::Relocate::relocate): Likewise.
5504 2010-11-08 Doug Kwan <dougkwan@google.com>
5505 Cary Coutant <ccoutant@google.com>
5507 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
5508 (Arm_exidx_merge_section::section_contents_): New data member.
5509 (Arm_input_section::Arm_input_section): Initialize original_contents_.
5510 (Arm_input_section::~Arm_input_section): De-allocate memory.
5511 (Arm_input_section::original_contents_): New data member.
5512 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
5513 in parameters instead of calling Object::section_contents without
5515 (Arm_output_section::group_section): New parameter TASK. Pass it
5516 to callees that need locking objects.
5517 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
5518 to lock EXIDX input sections. Fix a formatting issue. Call
5519 Arm_exidx_merged_section::build_contents to create merged section
5521 (Arm_output_section::create_stub_group): New parameter TASK. Use it
5522 to lock object of stub table owner.
5523 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
5524 TEXT_SIZE to initialize data member TEXT_SIZE_.
5525 (Arm_exidx_input_section::addralign): Fix typo in comment.
5526 (Arm_exidx_input_section::text_size): New method.
5527 (Target_arm::do_relax): New parameter TASK. Pass it to callees
5528 that require locking objects. Lock objects before scanning for stubs
5529 and updating local symbols.
5530 (Arm_input_section<big_endian>::init): Copy contents of original
5532 (Arm_input_section<big_endian>::do_write): Use saved contents of
5533 original input section instead of calling Object::section_contents
5535 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
5536 size without calling Object::section_size().
5537 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
5538 for size. Allocate a buffer for merged EXIDX entries.
5539 (Arm_exidx_merged_section::build_contents): New method.
5540 (Arm_exidx_merged_section::do_write): Move merge section contents
5541 building code to Arm_exidx_merged_section::build_contetns. Write
5542 out contetns in buffer instead of building it on the fly.
5543 (Arm_relobj::make_exidx_input_section): Also pass text section size
5544 to Arm_exidx_input_section constructor.
5545 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
5546 (Arm_dynobj::do_read_symbols): Fix memory leak.
5547 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
5548 * target.h: (class Task): Add forward declaration.
5549 (Target::relax): Add new parameter TASK and pass it to
5551 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
5553 2010-11-05 Cary Coutant <ccoutant@google.com>
5556 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
5557 object when reading from the file.
5558 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
5560 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
5561 when reading section contents.
5562 (get_section_contents): Likewise.
5563 (icf::find_identical_sections): Likewise.
5564 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
5565 object when reading from the file.
5566 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
5567 the object when doing deferred section layout.
5569 2010-11-03 Nick Clifton <nickc@redhat.com>
5572 * script.h (class Symbol_assignment: name): New member. Returns
5573 the name of the symbol.
5574 * scrfipt.cc (Script_options::is_pending_assignment): New member.
5575 Returns true if the given symbol name is on the list of
5576 assignments wating to be processed.
5577 * archive.cc (should_incldue_member): If the symbol is undefined,
5578 check to see if it is on the list of symbols pending assignment.
5580 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
5582 * script-sections.cc (Script_sections::find_memory_region): Check
5583 for a NULL output section pointer.
5585 2010-10-29 Doug Kwan <dougkwan@google.com>
5587 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
5588 Output_section::add_relaxed_input_section.
5589 * output.cc (Output_section::add_relaxed_input_section): Add new
5590 arguments LAYOUT and NAME. Set section order index.
5591 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5592 Copy section order index.
5593 * output.h (Output_section::add_relaxed_input_section): Add new
5594 arguments LAYOUT and NAME.
5596 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5598 * testsuite/Makefile.am: Move gcctestdir/ld rule to
5599 NATIVE_OR_CROSS_LINKER.
5600 * testsuite/Makefile.in: Regenerate.
5602 2010-10-20 Doug Kwan <dougkwan@google.com>
5604 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
5605 without SHF_LINK_ORDER flags.
5606 * layout.cc (Layout::choose_output_section): Do not filter
5607 SHF_LINK_ORDER flag in a relocatable link.
5609 2010-10-17 Cary Coutant <ccoutant@google.com>
5611 * output.h (Output_segment::set_section_addresses): Change function
5612 signature. Update all callers.
5613 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
5615 (Output_segment::set_section_addresses): Align after last TLS
5616 section. Add padding before last relro section instead of after.
5618 2010-10-17 Doug Kwan <dougkwan@google.com>
5620 * gold/arm.cc (Target_arm::got_section): Use correct order and set
5621 GOT output section to be writable.
5623 2010-10-14 Cary Coutant <ccoutant@google.com>
5625 * debug.h (DEBUG_INCREMENTAL): New flag.
5626 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
5627 * gold.cc (queue_initial_tasks): Check parameters for incremental link
5629 * incremental.cc (report_command_line): Ignore all forms of
5631 * layout.cc (Layout::Layout): Check parameters for incremental link
5633 * options.cc (General_options::parse_incremental): New function.
5634 (General_options::parse_no_incremental): New function.
5635 (General_options::parse_incremental_full): New function.
5636 (General_options::parse_incremental_update): New function.
5637 (General_options::incremental_mode_): New data member.
5638 (General_options::finalize): Check incremental_mode_.
5639 * options.h (General_options): Update help text for --incremental.
5640 Add --no-incremental, --incremental-full, --incremental-update.
5641 (General_options::Incremental_mode): New enum type.
5642 (General_options::incremental_mode): New function.
5643 (General_options::incremental_mode_): New data member.
5644 * parameters.cc (Parameters::incremental_mode_): New data member.
5645 (Parameters::set_options): Set incremental_mode_.
5646 (Parameters::set_incremental_full): New function.
5647 (Parameters::incremental): New function.
5648 (Parameters::incremental_update): New function.
5649 (set_parameters_incremental_full): New function.
5650 * parameters.h (Parameters::set_incremental_full): New function.
5651 (Parameters::incremental): New function.
5652 (Parameters::incremental_update): New function.
5653 (Parameters::incremental_mode_): New data member.
5654 (set_parameters_incremental_full): New function.
5655 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
5656 incremental link mode.
5657 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
5658 (Sized_relobj::do_relocate_sections): Likewise.
5659 * testsuite/Makefile.am (incremental_test): Use --incremental-full
5661 * testsuite/Makefile.in: Regenerate.
5662 * testsuite/incremental_test.sh: Filter all forms of --incremental.
5664 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5666 * script-sections.h (class Script_sections): Make
5667 Sections_elements typedef public.
5668 * script-sections.cc (class Sort_output_sections): Add elements_
5669 field. Add constructor which sets it; change all callers.
5670 (Sort_output_sections::is_before): New function.
5671 (Sort_output_sections::operator()): Call is_before.
5672 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
5674 * testsuite/script_test_10.sh: New test. Test script section
5676 * testsuite/script_test_10.t: Likewise.
5677 * testsuite/script_test_10.s: Likewise.
5678 * testsuite/Makefile.am: Wrap the cross linker tests and the
5679 common tests into NATIVE_OR_CROSS_LINKER.
5680 (check_SCRIPTS): Add script_test_10.sh.
5681 (check_DATA): Add script_test_10.stdout.
5682 (script_test_10.o, script_test_10): New targets.
5683 (script_test_10.stdout): New target.
5684 * configure, testsuite/Makefile.in: Regenerate.
5686 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5688 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
5689 error for the deprecated relocations.
5690 (Target_arm::Scan::global): Likewise.
5691 (Target_arm::Relocate::relocate): Likewise.
5693 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
5695 * fileread.cc (Input_file::find_file): Initialize *found_name
5696 and *namep when using the fallback search for case 4.
5698 2010-10-11 Cary Coutant <ccoutant@google.com>
5700 * options.h (class General_options): Redefine -z lazy as an alias for
5701 the negation of -z now.
5703 2010-10-11 Ian Lance Taylor <iant@google.com>
5705 * resolve.cc (symbol_to_bits): Report the value of the unsupported
5708 2010-10-06 Nick Clifton <nickc@redhat.com>
5710 * script-sections.cc(class Memory_region): Remove
5711 current_lma_offset_ field. Rename current_vma_offset_ to
5712 current_offset_. Add last_section_ field.
5713 (Memory_region::get_current_vma_address): Rename to
5714 get_current_address.
5715 (Memory_region::get_current_lma_address): Delete.
5716 (Memory_region::increment_vma_offset): Rename to
5718 (Memory_region::increment_lma_offset): Delete.
5719 (Memory_region::attributes_compatible): New method. Returns
5720 true if the provided section is compatible with the region.
5721 (Memory_region::get_last_section): New method. Returns the last
5722 section to use the region.
5723 (Memory_region::set_last_section): New method. Stores the last
5724 section to use the region.
5725 (Script_sections::block_in_region): New method. Returns true if
5726 a block of memory is contained within a region.
5727 (Script_sections::find_memory_region): New method. Locates a
5728 memory region to be used to set a VMA or LMA address.
5729 (Output_section_definition::set_section_addresses): Add code to
5730 check for addresses set by memory regions.
5731 (Output_segment::set_section_addresses): Remove memory region
5733 (Script_sections::create_segment): Add a warning if a header
5734 segment is created outside of any region.
5735 * script-sections.h (class Script_sections): Add prototypes for
5736 find_memory_region and block_in_region methods.
5737 * testsuite/memory_test.s: Use .long instead of .word.
5738 * testsuite/memory_test.t: Add some more output sections.
5739 * testsuite/memory_test.sh: Update expected output.
5741 2010-10-02 Doug Kwan <dougkwan@google.com>
5743 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
5744 defintion to symtab.h
5745 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
5746 declaration to defintion.
5748 2010-10-01 Nick Clifton <nickc@redhat.com>
5750 * expression.cc (eval): Replace dummy argument with NULL.
5751 (eval_maybe_dot): Check for a NULL result section pointer.
5752 (Symbol_expression::value): Likewise.
5753 (Dot_expression::value): Likewise.
5754 (BINARY_EXPRESSION): Likewise.
5755 (Max_expression::value): Likewise.
5756 (Min_expression::value): Likewise.
5757 (Absolute_expression::value): Likewise.
5758 (Addr_expression::value_from_output_section): Likewise.
5759 (Loaddddr_expression::value_from_output_section): Likewise.
5760 (Segment_start_expression::value): Likewise.
5761 * script-sections.cc
5762 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
5764 (Sections_elememt_dot_assignment::set_section_addresses):
5766 (Output_data_expression::do_write_to_buffer): Likewise.
5767 (Output_section_definition::finalize_symbols): Likewise.
5768 (Output_section_definition::set_section_addresses): Likewise.
5770 2010-09-30 Doug Kwan <dougkwan@google.com>
5772 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
5774 2010-09-28 Sriraman Tallam <tmsriram@google.com>
5776 * target.h (Target::can_icf_inline_merge_sections): New virtual
5778 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
5780 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
5782 * icf.cc (get_section_contents): Inline merge sections only when
5785 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5787 * configure: Regenerate.
5789 2010-09-17 Ian Lance Taylor <iant@google.com>
5791 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
5792 * testsuite/Makefile.am (memory_test.o): New target.
5793 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
5795 * testsuite/Makefile.in: Rebuild.
5797 2010-09-17 Doug Kwan <dougkwan@google.com>
5799 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
5800 defintion if relocation uses GOT entries of the symbol.
5801 * testsuite/icf_safe_test.sh: Fix test.
5802 * testsuite/icf_safe_so_test.sh: Fix test.
5804 2010-09-16 Cary Coutant <ccoutant@google.com>
5806 * script_sections.cc (class Memory_region): Remove "NULL" from
5807 vector initializations.
5809 2010-09-15 Cary Coutant <ccoutant@google.com>
5811 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
5812 Resolve forwarding symbols.
5814 2010-09-15 Doug Kwan <dougkwan@google.com>
5816 * gold/testsuite/script_test_3.t: Add ARM special sections.
5817 * gold/testsuite/script_test_4.t: Same.
5818 * gold/testsuite/script_test_5.t: Same.
5819 * gold/testsuite/script_test_6.t: Same.
5820 * gold/testsuite/script_test_7.t: Same.
5821 * gold/testsuite/script_test_7.t: Same.
5822 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
5824 2010-09-14 Cary Coutant <ccoutant@google.com>
5826 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
5827 (Target_x86_64::Relocate::relocate_tls): Replace check for
5828 saw_tls_block_reloc_ with test for executable section.
5830 2010-09-12 Cary Coutant <ccoutant@google.com>
5832 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
5833 position-independent executables to shared libraries need dynamic
5835 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
5836 position-independent executables.
5837 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
5838 * testsuite/Makefile.in: Regenerate.
5840 2010-09-10 Nick Clifton <nickc@redhat.com>
5843 * testsuite/memory_test.t: Discard any sections that are not
5846 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
5849 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
5850 "This::" to work around a bug in gcc 4.2.
5852 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
5854 2010-09-09 Rafael Espindola <espindola@google.com>
5856 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
5857 sections with different PF_X flags in the same segment.
5858 (Layout::find_first_load_seg): Search all segments to find the first
5860 * options.h (rosegment): New.
5862 2010-09-08 Rafael Espindola <espindola@google.com>
5864 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
5866 2010-09-08 Doug Kwan <dougkwan@google.com>
5868 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
5869 (Arm_relobj::do_relocate_sections): Add new parameter for output
5870 file to match the parent.
5871 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
5872 of local symbols instead of input values. Update code to track
5873 changes in gold::relocate_section.
5874 * object.cc (Sized_relobj::compute_final_local_value): New methods.
5875 (Sized_relobj::compute_final_local_value_internal): New methods.
5876 (Sized_relobj::do_finalize_local_symbols): Move code from loop
5877 body into private version of Sized_relobj::compute_final_local_value.
5878 Call the inline method.
5879 * object.h (Symbol_value::Symbol_value): Define destructor. Free
5880 merged symbol value if there is one.
5881 (Symbol_value::has_output_value): New method defintiion.
5882 (Sized_relobj::Compute_final_local_value_status): New enum type.
5883 (Sized_relobj::compute_final_local_value): New methods.
5884 (Sized_relobj::compute_final_local_value_internal): New methods.
5885 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
5886 and arm_cortex_a8.sh.
5887 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
5888 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
5890 * Makefile.in: Regenerate.
5891 * testsuite/arm_bl_out_of_range.s: Update test.
5892 * testsuite/thumb_bl_out_of_range.s: Ditto.
5893 * testsuite/thumb_blx_out_of_range.s: Ditto.
5894 * testsuite/arm_branch_out_of_range.sh: New file.
5895 * testsuite/arm_cortex_a8.sh: Ditto.
5896 * testsuite/arm_cortex_a8_b.s: Ditto.
5897 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
5898 * testsuite/arm_cortex_a8_b_local.s: Ditto.
5899 * testsuite/arm_cortex_a8_bl.s: Ditto.
5900 * testsuite/arm_cortex_a8_blx.s: Ditto.
5901 * testsuite/arm_cortex_a8_local.s: Ditto.
5902 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
5903 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
5905 2010-09-08 Rafael Espindola <espindola@google.com>
5907 * Makefile.am (memory_test.stdout): Run readelf with -W.
5908 * Makefile.in: Regenerate.
5909 * testsuite/memory_test.sh: Make the regexps accept both 32 and
5912 2010-09-08 Rafael Espindola <espindola@google.com>
5914 * script-sections.cc (Script_sections::add_memory_region): Convert
5915 field precision to int.
5916 * script.cc (script_set_section_region, script_set_section_region):
5917 Convert field precision to int.
5919 2010-09-08 Rafael Espindola <espindola@google.com>
5921 * arm.cc (do_finalize_sections): Create the __exidx_start and
5922 __exdix_end symbols even when the section is missing.
5924 2010-09-08 Nick Clifton <nickc@redhat.com>
5926 * README: Remove claim that MEMORY is not supported.
5927 * expression.cc (script_exp_function_origin)
5928 (script_exp_function_length): Move from here to ...
5929 * script.cc: ... here.
5930 (script_set_section_region, script_add_memory)
5931 (script_parse_memory_attr, script_include_directive): New
5933 * script-sections.cc
5934 (class Memory_region): New class.
5935 (class Output_section_definition): Add set_memory_region,
5936 set_section_vma, set_section_lma and get_section_name methods.
5937 (class Script_Sections): Add add_memory_region,
5938 find_memory_region, find_memory_region_origin,
5939 find_memory_region_length and set_memory_region methods.
5940 Have set_section_addresses method walk the list of set memory
5942 Extend the print methos to display memory regions.
5943 * script-sections.h: Add prototypes for new methods.
5944 Add enum for MEMORY region attributes.
5945 * yyscript.y: Add support for parsing MEMORY regions.
5946 * script-c.h: Add prototypes for new functions.
5947 * testsuite/Makefile.am: Add test of MEMORY region functionality.
5948 * testsuite/Makefile.in: Regenerate.
5949 * testsuite/memory_test.sh: New script.
5950 * testsuite/memory_test.s: New assembler source file.
5951 * testsuite/memory_test.t: New linker script.
5953 2010-08-27 Doug Kwan <dougkwan@google.com>
5955 * gold/resolve.cc (Symbol_table::should_override): Let a weak
5956 reference override an existing dynamic weak reference.
5957 * testsuite/Makefile.am: Add new test dyn_weak_ref.
5958 * testsuite/Makefile.in: Regenerate.
5959 * testsuite/dyn_weak_ref.sh: New file.
5960 * testsuite/dyn_weak_ref_1.c: Ditto.
5961 * testsuite/dyn_weak_ref_2.c: Ditto.
5963 2010-08-27 Ian Lance Taylor <iant@google.com>
5965 * incremental.h (class Incremental_input_entry): Add virtual
5968 2010-08-27 Ian Lance Taylor <iant@google.com>
5970 * testsuite/start_lib_test_3.c: Mark t3 as used.
5972 2010-08-27 Nick Clifton <nickc@redhat.com>
5974 * options.cc (version_script): Fix small typo in previous
5977 2010-08-25 Nick Clifton <nickc@redhat.com>
5979 * archive.cc: Formatting fixes: Remove whitespace between
5980 typename and following asterisk. Remove whitespace between
5981 function name and opening parenthesis.
5982 * archive.h: Likewise.
5984 * attributes.cc: Likewise.
5985 * attributes.h: Likewise.
5986 * common.cc: Likewise.
5987 * copy-relocs.cc: Likewise.
5988 * dirsearch.h: Likewise.
5989 * dynobj.cc: Likewise.
5990 * ehframe.cc: Likewise.
5991 * ehframe.h: Likewise.
5992 * expression.cc: Likewise.
5993 * fileread.cc: Likewise.
5994 * fileread.h: Likewise.
5996 * gold-threads.cc: Likewise.
5997 * gold.cc: Likewise.
5998 * i386.cc: Likewise.
6000 * incremental-dump.cc: Likewise.
6001 * incremental.cc: Likewise.
6002 * layout.cc: Likewise.
6003 * layout.h: Likewise.
6004 * main.cc: Likewise.
6005 * merge.cc: Likewise.
6006 * merge.h: Likewise.
6007 * object.cc: Likewise.
6008 * object.h: Likewise.
6009 * options.cc: Likewise.
6010 * options.h: Likewise.
6011 * output.cc: Likewise.
6012 * output.h: Likewise.
6013 * plugin.cc: Likewise.
6014 * plugin.h: Likewise.
6015 * powerpc.cc: Likewise.
6016 * reloc.cc: Likewise.
6017 * script-c.h: Likewise.
6018 * script-sections.cc: Likewise.
6019 * script.cc: Likewise.
6020 * stringpool.cc: Likewise.
6021 * symtab.cc: Likewise.
6022 * symtab.h: Likewise.
6023 * target.cc: Likewise.
6024 * timer.cc: Likewise.
6025 * timer.h: Likewise.
6026 * version.cc: Likewise.
6027 * x86_64.cc: Likewise.
6029 2010-08-24 Nick Clifton <nickc@redhat.com>
6032 * layout.cc (segment_precedes): Sort segments by their physical
6033 addresses, if they have been set.
6035 2010-08-23 Cary Coutant <ccoutant@google.com>
6037 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
6039 (Lib_group::include_member): Unlock object after deleting its
6041 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
6044 2010-08-19 Neil Vachharajani <nvachhar@google.com>
6045 Cary Coutant <ccoutant@google.com>
6047 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
6048 constructor, and set_blocker.
6049 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
6051 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
6052 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
6053 * testsuite/Makefile.am (start_lib_test): New test case.
6054 * testsuite/Makefile.in: Regenerate.
6055 * testsuite/start_lib_test_main.c: New file.
6056 * testsuite/start_lib_test_1.c: New file.
6057 * testsuite/start_lib_test_2.c: New file.
6058 * testsuite/start_lib_test_3.c: New file.
6060 2010-08-19 Ian Lance Taylor <iant@google.com>
6062 * Makefile.in: Rebuild with automake 1.11.1.
6063 * aclocal.m4: Likewise.
6064 * testsuite/Makefile.in: Likewise.
6066 2010-08-19 Ian Lance Taylor <iant@google.com>
6069 * i386.cc (class Output_data_plt_i386): Update declarations.
6070 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
6071 local_ifuncs_ fields.
6072 (Target_i386::do_plt_section_for_global): New function.
6073 (Target_i386::do_plt_section_for_local): New function.
6074 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
6075 parameter; change all callers. Initialize global_ifuncs_ and
6076 local_ifuncs_. If doing a static link define __rel_iplt_start and
6078 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
6079 (Output_data_plt_i386::add_local_ifunc_entry): New function.
6080 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
6082 (Target_i386::make_plt_section): New function, broken out of
6083 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
6084 (Target_i386::make_plt_entry): Call make_plt_section.
6085 (Target_i386::make_local_ifunc_plt_entry): New function.
6086 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
6087 (Target_i386::Scan::local): Handle IFUNC symbols. Add
6088 R_386_IRELATIVE to switch.
6089 (Target_i386::Scan::global): Likewise.
6090 (Target_i386::Relocate::relocate): Likewise.
6091 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
6093 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
6094 (Target_x86_64::do_plt_section_for_global): New function.
6095 (Target_x86_64::do_plt_section_for_local): New function.
6096 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
6097 parameter; change all callers. If doing a static link define
6098 __rela_iplt_start and __rela_iplt_end.
6099 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
6100 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
6101 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
6103 (Target_x86_64::make_local_ifunc_plt_entry): New function.
6104 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
6106 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
6107 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
6108 R_X86_64_IRELATIVE to switch.
6109 (Target_x86_64::Scan::global): Likewise.
6110 (Target_x86_64::Relocate::relocate): Likewise.
6111 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
6113 * target.h (class Target): Add plt_section_for_global and
6114 plt_section_for_local functions. Add do_plt_section_for_global
6115 and do_plt_section_for_local virtual functions.
6116 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
6117 clarifying comments.
6118 (Symbol::use_plt_offset): Handle IFUNC symbol.
6119 * object.cc (Sized_relobj::Sized_relobj): Initialize
6121 (Sized_relobj::local_has_plt_offset): New function.
6122 (Sized_relobj::local_plt_offset): New function.
6123 (Sized_relobj::set_local_plt_offset): New function.
6124 (Sized_relobj::do_count): Handle IFUNC symbol.
6125 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
6126 a bit away from input_shndx_ field. Add set_is_func_symbol and
6127 is_ifunc_symbol functions.
6128 (class Sized_relobj): Update declarations. Remove Tls_got_entry
6129 and Local_tls_got_offsets. Define Local_plt_offsets. Add
6130 local_plt_offsets_ field.
6131 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
6132 * output.h (class Output_section_data): Add non-const
6133 output_section function.
6134 (class Output_data_got): Update declarations.
6135 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
6136 Add use_plt_offset parameter to global and local constructors.
6137 Change all callers. Change local_sym_index_ field to 31 bits.
6138 Change GSYM_CODE and CONSTANT_CODE accordingly.
6139 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
6140 doing a static link don't set sh_link field.
6141 (Output_data_got::Got_entry::write): Use PLT offset if
6143 (Output_data_got::add_global_plt): New function.
6144 (Output_data_got::add_local_plt): New function.
6145 * target-reloc.h (relocate_section): Handle IFUNC symbol.
6146 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
6147 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
6148 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
6149 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
6151 * testsuite/ifunc-sel.h: New file.
6152 * testsuite/ifuncmain1.c: New file.
6153 * testsuite/ifuncmain1vis.c: New file.
6154 * testsuite/ifuncmod1.c: New file.
6155 * testsuite/ifuncdep2.c: New file.
6156 * testsuite/ifuncmain2.c: New file.
6157 * testsuite/ifuncmain3.c: New file.
6158 * testsuite/ifuncmod3.c: New file.
6159 * testsuite/ifuncmain4.c: New file.
6160 * testsuite/ifuncmain5.c: New file.
6161 * testsuite/ifuncmod5.c: New file.
6162 * testsuite/ifuncmain6pie.c: New file.
6163 * testsuite/ifuncmod6.c: New file.
6164 * testsuite/ifuncmain7.c: New file.
6165 * configure, testsuite/Makefile.in: Rebuild.
6167 2010-08-18 Ian Lance Taylor <iant@google.com>
6170 (Output_section_incremental_inputs::write_input_files): Add cast
6171 to avoid signed/unsigned comparison warning.
6172 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6174 2010-08-12 Cary Coutant <ccoutant@google.com>
6176 * common.cc (Sort_commons::operator()): Remove unnecessary code.
6178 2010-08-13 Ian Lance Taylor <iant@google.com>
6180 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
6182 2010-08-12 Cary Coutant <ccoutant@google.com>
6183 Doug Kwan <dougkwan@google.com>
6185 * resolve.cc (Symbol_table::should_override): When a weak dynamic
6186 defintion overrides non-weak undef, remember that the original undef
6188 * symtab.cc (Symbol_table::sized_write_global): For undef without
6189 an original weak binding, set binding to global in output.
6190 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
6191 * testsuite/Makefile.in: Regenerate.
6192 * testsuite/strong_ref_weak_def.sh: New file.
6193 * testsuite/strong_ref_weak_def_1.c: Ditto.
6194 * testsuite/strong_ref_weak_def_2.c: Ditto.
6196 2010-08-12 Cary Coutant <ccoutant@google.com>
6198 * testsuite/incremental_test.sh: Rewrite.
6199 * testsuite/incremental_test_1.c: Rewrite.
6200 * testsuite/incremental_test_2.c: Rewrite.
6202 2010-08-12 Cary Coutant <ccoutant@google.com>
6204 * arm.cc (Target_arm::got_size): Add const.
6205 (Target_arm::got_entry_count): New function.
6206 (Target_arm::plt_entry_count): New function.
6207 (Target_arm::first_plt_entry_offset): New function.
6208 (Target_arm::plt_entry_size): New function.
6209 (Output_data_plt_arm::entry_count): New function.
6210 (Output_data_plt_arm::first_plt_entry_offset): New function.
6211 (Output_data_plt_arm::get_plt_entry_size): New function.
6212 * i386.cc (Target_i386::got_size): Add const.
6213 (Target_i386::got_entry_count): New function.
6214 (Target_i386::plt_entry_count): New function.
6215 (Target_i386::first_plt_entry_offset): New function.
6216 (Target_i386::plt_entry_size): New function.
6217 (Output_data_plt_i386::entry_count): New function.
6218 (Output_data_plt_i386::first_plt_entry_offset): New function.
6219 (Output_data_plt_i386::get_plt_entry_size): New function.
6220 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
6221 find_incremental_inputs_sections. Dump incremental_got_plt section.
6222 * incremental.cc: Include target.h.
6223 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
6224 parameter. Adjust all callers. Find incremental_got_plt section.
6225 (Incremental_inputs::create_data_sections): Create incremental_got_plt
6227 (Output_section_incremental_inputs::set_final_data_size): Calculate
6228 size of incremental_got_plt section.
6229 (Output_section_incremental_inputs::do_write): Write the
6230 incremental_got_plt section.
6231 (Got_plt_view_info): New struct.
6232 (Local_got_offset_visitor): New class.
6233 (Global_got_offset_visitor): New class.
6234 (Global_symbol_visitor_got_plt): New class.
6235 (Output_section_incremental_inputs::write_got_plt): New function.
6236 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
6237 Add parameter. Adjust all callers.
6238 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6239 (Incremental_inputs::got_plt_section): New function.
6240 (Incremental_inputs::got_plt_section_): New data member.
6241 (Incremental_got_plt_reader): New class.
6242 * layout.cc (Layout::create_incremental_info_sections): Add the
6243 incremental_got_plt section.
6244 * object.h (Got_offset_list::get_list): New function.
6245 (Got offset_list::for_all_got_offsets): New function.
6246 (Sized_relobj::local_got_offset_list): New function.
6247 * powerpc.cc (Target_powerpc::got_size): Add const.
6248 (Target_powerpc::got_entry_count): New function.
6249 (Target_powerpc::plt_entry_count): New function.
6250 (Target_powerpc::first_plt_entry_offset): New function.
6251 (Target_powerpc::plt_entry_size): New function.
6252 (Output_data_plt_powerpc::entry_count): New function.
6253 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
6254 (Output_data_plt_powerpc::get_plt_entry_size): New function.
6255 * sparc.cc (Target_sparc::got_size): Add const.
6256 (Target_sparc::got_entry_count): New function.
6257 (Target_sparc::plt_entry_count): New function.
6258 (Target_sparc::first_plt_entry_offset): New function.
6259 (Target_sparc::plt_entry_size): New function.
6260 (Output_data_plt_sparc::entry_count): New function.
6261 (Output_data_plt_sparc::first_plt_entry_offset): New function.
6262 (Output_data_plt_sparc::get_plt_entry_size): New function.
6263 * symtab.h (Symbol::got_offset_list): New function.
6264 (Symbol_table::for_all_symbols): New function.
6265 * target.h (Sized_target::got_entry_count): New function.
6266 (Sized_target::plt_entry_count): New function.
6267 (Sized_target::plt_entry_size): New function.
6268 * x86_64.cc (Target_x86_64::got_size): Add const.
6269 (Target_x86_64::got_entry_count): New function.
6270 (Target_x86_64::plt_entry_count): New function.
6271 (Target_x86_64::first_plt_entry_offset): New function.
6272 (Target_x86_64::plt_entry_size): New function.
6273 (Output_data_plt_x86_64::entry_count): New function.
6274 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
6275 (Output_data_plt_x86_64::get_plt_entry_size): New function.
6277 2010-08-12 Cary Coutant <ccoutant@google.com>
6279 * archive.cc: Include incremental.h.
6280 (Archive::Archive): Initialize incremental_info_.
6281 (Archive::include_member): Record archive members in incremental info.
6282 (Add_archive_symbols::run): Record begin and end of an archive in
6284 (Lib_group::include_member): Record objects in incremental info.
6285 * archive.h (Incremental_archive_entry): Forward declaration.
6286 (Archive::set_incremental_info): New member function.
6287 (Archive::incremental_info): New member function.
6288 (Archive::Unused_symbol_iterator): New class.
6289 (Archive::unused_symbols_begin): New member function.
6290 (Archive::unused_symbols_end): New member function.
6291 (Archive::incremental_info_): New data member.
6292 * incremental-dump.cc (find_input_containing_global): New function.
6293 (dump_incremental_inputs): Dump new incremental info sections.
6294 * incremental.cc: Include symtab.h.
6295 (Output_section_incremental_inputs): New class.
6296 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
6297 new incremental info sections.
6298 (Sized_incremental_binary::do_check_inputs): Likewise.
6299 (Incremental_inputs::report_archive): Remove.
6300 (Incremental_inputs::report_archive_begin): New function.
6301 (Incremental_inputs::report_archive_end): New function.
6302 (Incremental_inputs::report_object): New function.
6303 (Incremental_inputs::finalize_inputs): Remove.
6304 (Incremental_inputs::report_input_section): New function.
6305 (Incremental_inputs::report_script): Rewrite.
6306 (Incremental_inputs::finalize): Do nothing but finalize string table.
6307 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6308 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6309 (Incremental_inputs::create_data_sections): New function.
6310 (Incremental_inputs::relocs_entsize): New function.
6311 (Output_section_incremental_inputs::set_final_data_size): New function.
6312 (Output_section_incremental_inputs::do_write): New function.
6313 (Output_section_incremental_inputs::write_header): New function.
6314 (Output_section_incremental_inputs::write_input_files): New function.
6315 (Output_section_incremental_inputs::write_info_blocks): New function.
6316 (Output_section_incremental_inputs::write_symtab): New function.
6317 * incremental.h (Incremental_script_entry): Forward declaration.
6318 (Incremental_object_entry): Forward declaration.
6319 (Incremental_archive_entry): Forward declaration.
6320 (Incremental_inputs): Forward declaration.
6321 (Incremental_inputs_header_data): Remove.
6322 (Incremental_inputs_header): Remove.
6323 (Incremental_inputs_header_write): Remove.
6324 (Incremental_inputs_entry_data): Remove.
6325 (Incremental_inputs_entry): Remove.
6326 (Incremental_inputs_entry_write): Remove.
6327 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
6328 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
6329 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6330 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
6332 (Incremental_input_entry): New class.
6333 (Incremental_script_entry): New class.
6334 (Incremental_object_entry): New class.
6335 (Incremental_archive_entry): New class.
6336 (Incremental_inputs::Incremental_inputs): Initialize new data members.
6337 (Incremental_inputs::report_inputs): Remove.
6338 (Incremental_inputs::report_archive): Remove.
6339 (Incremental_inputs::report_archive_begin): New function.
6340 (Incremental_inputs::report_archive_end): New function.
6341 (Incremental_inputs::report_object): Change prototype.
6342 (Incremental_inputs::report_input_section): New function.
6343 (Incremental_inputs::report_script): Change prototype.
6344 (Incremental_inputs::get_reloc_count): New function.
6345 (Incremental_inputs::set_reloc_count): New function.
6346 (Incremental_inputs::create_data_sections): New function.
6347 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6348 (Incremental_inputs::inputs_section): New function.
6349 (Incremental_inputs::symtab_section): New function.
6350 (Incremental_inputs::relocs_section): New function.
6351 (Incremental_inputs::get_stringpool): Add const.
6352 (Incremental_inputs::command_line): Add const.
6353 (Incremental_inputs::inputs): Remove.
6354 (Incremental_inputs::command_line_key): New function.
6355 (Incremental_inputs::input_file_count): New function.
6356 (Incremental_inputs::input_files): New function.
6357 (Incremental_inputs::relocs_entsize): New function.
6358 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6359 (Incremental_inputs::finalize_inputs): Remove.
6360 (Incremental_inputs::Input_info): Remove.
6361 (Incremental_inputs::lock_): Remove.
6362 (Incremental_inputs::inputs_): Change type.
6363 (Incremental_inputs::inputs_map_): Remove.
6364 (Incremental_inputs::current_object_entry_): New data member.
6365 (Incremental_inputs::inputs_section_): New data member.
6366 (Incremental_inputs::symtab_section_): New data member.
6367 (Incremental_inputs::relocs_section_): New data member.
6368 (Incremental_inputs::reloc_count_): New data member.
6369 (Incremental_inputs_reader): New class.
6370 (Incremental_symtab_reader): New class.
6371 (Incremental_relocs_reader): New class.
6372 * layout.cc (Layout::finalize): Move finalization of incremental info
6373 and creation of incremental info sections to follow finalization of
6374 symbol table. Set offsets for postprocessing sections.
6375 (Layout::create_incremental_info_sections): Call
6376 Incremental_inputs::create_data_sections. Add incremental symtab
6377 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
6378 sections to layout after input sections.
6379 * layout.h (struct Timespec): Forward declaration.
6380 (Layout::incremental_inputs): Add const.
6381 (Layout::create_incremental_info_sections): Add parameter.
6382 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
6383 * object.cc: Include incremental.h.
6384 (Relobj::finalize_incremental_relocs): New function.
6385 (Sized_relobj::do_layout): Record input sections in incremental info.
6386 * object.h (Object::output_section): New function.
6387 (Object::output_section_offset): Moved from Relobj.
6388 (Object::get_incremental_reloc_base): New function.
6389 (Object::get_incremental_reloc_count): New function.
6390 (Object::do_output_section): New function.
6391 (Object::do_output_section_offset): Moved from Relobj.
6392 (Object::do_get_incremental_reloc_base): New function.
6393 (Object::do_get_incremental_reloc_count): New function.
6394 (Object::Object): Initialize new data members.
6395 (Relobj::output_section): Renamed do_output_section and moved to
6397 (Relobj::output_section_offset): Moved to Object.
6398 (Relobj::do_get_incremental_reloc_base): New function.
6399 (Relobj::do_get_incremental_reloc_count): New function.
6400 (Relobj::allocate_incremental_reloc_counts): New function.
6401 (Relobj::count_incremental_reloc): New function.
6402 (Relobj::finalize_incremental_relocs): New function.
6403 (Relobj::next_incremental_reloc_index): New function.
6404 (Relobj::reloc_counts_): New data member.
6405 (Relobj::reloc_bases_): New data member.
6406 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
6407 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
6408 (Sized_relobj::incremental_relocs_scan): New function.
6409 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6410 (Sized_relobj::incremental_relocs_write): New function.
6411 (Sized_relobj::incremental_relocs_write_reltype): New function.
6412 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
6414 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
6415 archives and object files elsewhere.
6416 (Add_symbols::run): Report object files here.
6417 (Finish_group::run): Report end of archive at end of group.
6418 * reloc.cc: Include layout.h, incremental.h.
6419 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
6420 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
6421 (Sized_relobj::incremental_relocs_scan): New function.
6422 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6423 (Sized_relobj::do_relocate_sections): Write incremental relocations.
6424 (Sized_relobj::incremental_relocs_write): New function.
6425 (Sized_relobj::incremental_relocs_write_reltype): New function.
6426 * script.cc (read_input_script): Rewrite test for incremental link.
6427 Change call to Incremental_inputs::report_script.
6428 * symtab.h (Symbol_table::first_global_index): New function.
6429 (Symbol_table::output_count): New function.
6431 2010-08-12 Doug Kwan <dougkwan@google.com>
6433 * arm.cc (Target_arm::merge_object_attributes): Check command line
6434 options --no-wchar-size-warning and --no-enum-size-warning.
6435 * options.h (General_options): Add ld-compatible options
6436 --no-enum-size-warning and --no-wchar-size-warning.
6438 2010-08-04 Ian Lance Taylor <iant@google.com>
6440 * x86_64.cc (Target_x86_64::Scan::local): Use
6441 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
6442 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
6443 (Target_x86_64::Scan::global): Likewise.
6444 (Target_x86_64::Relocate::relocate): Likewise.
6445 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
6448 2010-08-03 Cary Coutant <ccoutant@google.com>
6450 * merge.cc (Output_merge_string::do_add_input_section): Count strings
6451 to reserve space in merged_strings vector. Keep total input size
6453 (Output_merge_string::do_print_merge_stats): Print total input size.
6454 * merge.h (Output_merge_string): Add input_size_ field.
6455 * stringpool.cc (Stringpool_template::string_length): Move
6456 implementations out of Stringpool_template class and place in
6458 * stringpool.h (string_length): Move out of Stringpool_template.
6460 2010-08-03 Ian Lance Taylor <iant@google.com>
6463 * layout.cc (relaxation_loop_body): If address of load segment is
6464 set, adjust address to include headers if possible.
6466 2010-08-03 Ian Lance Taylor <iant@google.com>
6468 * version.cc (version_string): Bump to 1.10.
6470 2010-08-03 Ian Lance Taylor <iant@google.com>
6473 * layout.h (enum Output_section_order): Define.
6474 (class Layout): Update declarations.
6475 * layout.cc (Layout::get_output_section): Add order parameter.
6476 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
6477 is_first_non_relro parameters. Change all callers.
6478 (Layout::choose_output_section): Likewise.
6479 (Layout::add_output_section_data): Likewise.
6480 (Layout::make_output_section): Likewise. Set order.
6481 (Layout::default_section_order): New function.
6482 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
6483 * output.cc (Output_section::Output_section): Initialize order_.
6484 Don't initialize deleted fields.
6485 (Output_segment::Output_segment): Don't initialize deleted
6487 (Output_segment::add_output_section_to_load): New function
6488 replacing add_output_section. Change all callers to call this or
6489 add_output_section_to_nonload.
6490 (Output_segment::add_output_section_to_nonload): New function.
6491 (Output_segment::remove_output_section): Rewrite.
6492 (Output_segment::add_initial_output_data): Likewise.
6493 (Output_segment::has_any_data_sections): Likewise.
6494 (Output_segment::is_first_section_relro): Likewise.
6495 (Output_segment::maximum_alignment): Likewise.
6496 (Output_segment::has_dynamic_reloc): New function replacing
6497 dynamic_reloc_count. Change all callers.
6498 (Output_segment::has_dynamic_reloc_list): New function replacing
6499 dynamic_reloc_count_list. Change all callers.
6500 (Output_segment::set_section_addresses): Rewrite.
6501 (Output_segment::set_offset): Rewrite.
6502 (Output_segment::find_first_and_last_list): Remove.
6503 (Output_segment::set_tls_offsets): Rewrite.
6504 (Output_segment::first_section_load_address): Likewise.
6505 (Output_segment::output_section_count): Likewise.
6506 (Output_segment::section_with_lowest_load_address): Likewise.
6507 (Output_segment::write_section_headers): Likewise.
6508 (Output_segment::print_sections_to_map): Likewise.
6509 * output.h (class Output_data): Remove dynamic_reloc_count_
6510 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
6511 (Output_data::add_dynamic_reloc): Rewrite.
6512 (Output_data::has_dynamic_reloc): New function.
6513 (Output_data::dynamic_reloc_count): Remove.
6514 (class Output_section): Add order_ field. Remvoe is_relro_local_,
6515 is_last_relro_, is_first_non_relro_, is_interp_,
6516 is_dynamic_linker_section_ fields. Add order and set_order
6517 functions. Remove is_relro_local, set_is_relro_local,
6518 is_last_relro, set_is_last_relro, is_first_non_relro,
6519 set_is_first_non_relro functions, is_interp, set_is_interp,
6520 is_dynamic_linker_section, and set_is_dynamic_linker_section
6522 (class Output_segment): Change Output_data_list from std::list to
6523 std:;vector. Add output_lists_ field. Remove output_data_ and
6524 output_bss_ fields. Update declarations.
6526 2010-08-02 Ian Lance Taylor <iant@google.com>
6528 * arm.cc (Target_arm::gc_process_relocs): Use typename.
6529 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
6530 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
6532 2010-08-02 Ian Lance Taylor <iant@google.com>
6535 * script.cc (Script_options::Script_options): Initialize
6536 symbol_definitions_ and symbol_references_.
6537 (Script_options::add_symbol_assignment): Update
6538 symbol_definitions_ and symbol_references_.
6539 (Script_options::add_symbol_reference): New function.
6540 (script_symbol): New function.
6541 * script.h (class Script_options): Add symbol_definitions_ and
6542 symbol_references_ fields.
6543 (Script_options::referenced_const_iterator): New type.
6544 (Script_options::referenced_begin): New function.
6545 (Script_options::referenced_end): New function.
6546 (Script_options::is_referenced): New function.
6547 (Script_options::any_unreferenced): New function.
6548 * script-c.h (script_symbol): Declare.
6549 * yyscript.y (exp): Call script_symbol.
6550 * symtab.cc: Include "script.h".
6551 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
6552 Change all callers. Check symbols referenced by scripts.
6553 (Symbol_table::add_undefined_symbols_from_command_line): Add
6554 layout parameter. Change all callers.
6555 (Symbol_table::do_add_undefined_symbols_from_command_line):
6556 Likewise. Break out loop body. Check symbols referenced by
6558 (Symbol_table::add_undefined_symbol_from_command_line): New
6559 function broken out of
6560 do_add_undefined_symbols_from_command_line.
6561 * symtab.h (class Symbol_table): Update declarations.
6562 * archive.cc: Include "layout.h".
6563 (Archive::should_include_member): Add layout parameter. Change
6564 all callers. Check for symbol mentioned in expression.
6565 * archive.h (class Archive): Update declaration.
6566 * object.cc (Sized_relobj::do_should_include_member): Add layout
6568 * object.h (Object::should_include_member): Add layout parameter.
6570 (Object::do_should_include_member): Add layout parameter.
6571 (class Sized_relobj): Update declaration.
6572 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
6574 * dynobj.h (class Sized_dynobj): Update declaration.
6575 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
6577 * plugin.h (class Sized_pluginobj): Update declaration.
6579 2010-08-02 Ian Lance Taylor <iant@google.com>
6582 * output.cc (Output_segment::set_offset): Search for the first and
6583 last sections rather than assuming that the list is in order.
6584 (Output_segment::find_first_and_last_list): New function.
6585 * output.h (class Output_segment): Update declarations.
6586 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
6587 (relro_strip_test_SOURCES): New variable.
6588 (relro_strip_test_DEPENDENCIES): New variable.
6589 (relro_strip_test_LDFLAGS): New variable.
6590 (relro_strip_test_LDADD): New variable.
6591 (relro_strip_test.so): New target.
6593 2010-08-02 Ian Lance Taylor <iant@google.com>
6595 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
6596 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
6597 (Target_i386::got_tlsdesc_section): New function.
6598 (Target_i386::got_section): Create space for GOT entries for
6599 TLSDESC relocations.
6600 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
6602 (Target_i386::Scan::global): Likewise.
6603 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
6605 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
6606 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
6607 (Target_x86_64::got_tlsdesc_section): New function.
6608 (Target_x86_64::got_section): Create space for GOT entries for
6609 TLSDESC relocations.
6610 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
6612 (Target_x86_64::Scan::global): Likewise.
6613 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
6616 2010-08-02 Ian Lance Taylor <iant@google.com>
6618 * testsuite/final_layout.sh: Use dc to convert from hex to
6621 2010-07-29 Sriraman Tallam <tmsriram@google.com>
6623 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
6624 paramter to the call to gold::gc_process_relocs.
6625 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
6626 paramter to the call to gold::gc_process_relocs.
6627 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
6628 parameter to the call to gold::gc_process_relocs.
6629 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
6630 template parameter to the call to gold::gc_process_relocs.
6631 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
6632 paramter to the call to gold::gc_process_relocs.
6633 * gc.h (get_embedded_addend_size): New function.
6634 (gc_process_relocs): Save the size of the reloc for use by ICF.
6635 * icf.cc (get_section_contents): Get the addend from the text section
6636 for SHT_REL relocation sections.
6637 * icf.h (Icf::Reloc_addend_size_info): New typedef.
6638 (Icf::Reloc_info): Add new member reloc_addend_size_info.
6639 * int_encoding.h (read_from_pointer): New overloaded function.
6640 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
6641 * testsuite/icf_sht_rel_addend_test.sh: New file.
6642 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
6643 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
6645 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6647 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
6648 * Makefile.in: Regenerate.
6649 * testsuite/Makefile.in: Regenerate.
6651 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
6653 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
6654 * gold/testsuite/debug_msg.cc: Likewise.
6655 * gold/testsuite/odr_violation1.cc
6656 * gold/testsuite/odr_violation2.cc
6658 2010-07-21 Cary Coutant <ccoutant@google.com>
6660 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
6661 string, and length fields.
6662 (Output_merge_string::Merged_strings_list): New type.
6663 (Output_merge_string::Merged_strings_lists): New typedef.
6664 (Output_merge_string): Replace merged_strings_ with
6665 merged_strings_lists_.
6666 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
6667 Merged_strings_list per input object and section. Don't store pointer
6668 to the string. Don't store length with each merged string entry.
6669 (Output_merge_string::finalize_merged_data): Loop over list of merged
6670 strings lists. Recompute length of each merged string.
6672 2010-07-15 Cary Coutant <ccoutant@google.com>
6674 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
6677 2010-07-14 Ian Lance Taylor <iant@google.com>
6679 * descriptors.cc (Descriptors::open): Report correct name in error
6682 2010-07-13 Doug Kwan <dougkwan@google.com>
6684 * arm.cc (Arm_input_section::Arm_input_section): For a
6685 SHT_ARM_EXIDX section, always keeps the input sections.
6686 (Arm_input_section::set_exidx_section_link): New method.
6687 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
6688 has_errors_ to false.
6689 (Arm_exidx_input_section::has_errors,
6690 Arm_exidx_input_section::set_has_errors): New methods.
6691 (Arm_exidx_input_section::has_errors_): New data member.
6692 (Arm_relobj::get_exidx_shndx_list): New method.
6693 (Arm_output_section::append_text_sections_to_list): Do not skip
6694 section without SHF_EXECINSTR.
6695 (Arm_output_section::fix_exidx_coverage): Skip input sections with
6697 (Arm_relobj::make_exidx_input_section): Add new parameter for text
6698 section header. Make error messages more verbose. Check for
6699 a non-executable section linked to an EXIDX section.
6700 (Arm_relobj::do_read_symbols): Remove error checking, which has been
6701 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
6702 check that there is no deferred EXIDX section if we exit early.
6703 Instead of not making an EXIDX section in case of an error, make one
6704 and set the has_errors flag of it.
6705 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
6706 in a relocatable link.
6707 (Target_arm::do_relax): Look for the EXIDX output section instead of
6708 assuming that it is called .ARM.exidx.
6709 (Target_arm::fix_exidx_coverage): Add a new parameter for input
6710 section list. Do not check for SHF_EXECINSTR section flags but
6711 skip any input section with errors.
6712 * output.cc (Output_section::Output_section): Initialize
6713 always_keeps_input_sections_ to false.
6714 (Output_section::add_input_section): Check for
6715 always_keeps_input_sections_.
6716 * output.h (Output_section::always_keeps_input_sections,
6717 Output_section::set_always_keeps_input_sections): New methods.
6718 (Output_section::always_keeps_input_sections): New data member.
6720 2010-07-13 Rafael Espindola <espindola@google.com>
6722 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
6723 * fileread.h (Input_file): Add try_extra_search_path and find_file.
6725 2010-07-13 Philip Herron <herron.philip@googlemail.com>
6726 Ian Lance Taylor <iant@google.com>
6728 * output.h (Output_section_lookup_maps::add_merge_section):
6729 Correct check of whether value was inserted.
6730 (Output_section_lookup_maps::add_merge_input_section): Likewise.
6731 (Output_section_lookup_maps::add_relaxed_input_section):
6733 * arm.cc (Target_arm::got_section): Remove used local os.
6734 * i386.cc (Target_i386::got_section): Likewise.
6735 * x86_64.cc (Target_x86_64::got_section): Likewise.
6736 * sparc.cc (Target_sparc::got_section): Likewise.
6737 (Target_sparc::relocate): Remove unused local have_got_offset.
6738 * powerpc.cc (Target_powerpc::relocate): Likewise.
6740 2010-07-13 Ian Lance Taylor <iant@google.com>
6742 * compressed_output.cc (zlib_decompress): Fix signature in
6745 * archive.cc (Archive::include_member): Unlock an external member
6746 of a thin archive. Don't bother to delete an object we know is
6749 2010-07-12 Cary Coutant <ccoutant@google.com>
6751 * compressed_output.cc (zlib_decompress): New function.
6752 (get_uncompressed_size): New function.
6753 (decompress_input_section): New function.
6754 * compressed_output.h (get_uncompressed_size): New function.
6755 (decompress_input_section): New function.
6756 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
6757 Handle compressed debug sections.
6758 * layout.cc (is_compressed_debug_section): New function.
6759 (Layout::output_section_name): Map compressed section names to
6761 * layout.h (is_compressed_debug_section): New function.
6762 (is_debug_info_section): Recognize compressed debug sections.
6763 * merge.cc: Include compressed_output.h.
6764 (Output_merge_data::do_add_input_section): Handle compressed
6766 (Output_merge_string::do_add_input_section): Handle compressed
6768 * object.cc: Include compressed_output.h.
6769 (Sized_relobj::Sized_relobj): Initialize new data members.
6770 (build_compressed_section_map): New function.
6771 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
6772 * object.h (Object::section_is_compressed): New method.
6773 (Object::do_section_is_compressed): New method.
6774 (Sized_relobj::Compressed_section_map): New type.
6775 (Sized_relobj::do_section_is_compressed): New method.
6776 (Sized_relobj::compressed_sections_): New data member.
6777 * output.cc (Output_section::add_input_section): Handle compressed
6779 * reloc.cc: Include compressed_output.h.
6780 (Sized_relobj::write_sections): Handle compressed debug sections.
6782 2010-07-08 Cary Coutant <ccoutant@google.com>
6784 * resolve.cc (Symbol_table::resolve): Remember whether undef was
6785 weak when resolving to a dynamic def.
6786 (Symbol_table::should_override): Add adjust_dyndef flag; set it
6787 for weak undef/dynamic def cases. Adjust callers.
6788 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
6789 undef_binding_weak_.
6790 (Symbol_table::sized_write_globals): Adjust symbol binding.
6791 (Symbol_table::sized_write_symbol): Add binding parameter.
6792 * symtab.h (Symbol::set_undef_binding): New method.
6793 (Symbol::is_undef_binding_weak): New method.
6794 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
6795 (Symbol_table::should_override): Add new parameter.
6796 (Symbol_table::sized_write_symbol): Add new parameter.
6798 * testsuite/weak_undef_file1.cc: Add new test case.
6799 * testsuite/weak_undef_file2.cc: Fix header comment.
6800 * testsuite/weak_undef_test.cc: Add new test case.
6802 2010-06-29 Doug Kwan <dougkwan@google.com>
6804 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
6805 Initialize USE_SYMBOL_.
6806 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
6808 (Arm_reloc_property::uses_symbol_): New data member declaration.
6809 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
6810 uses symbol value and symbol is undefined but not weakly undefined.
6812 2010-06-28 Rafael Espindola <espindola@google.com>
6814 * plugin.cc (Plugin::load): Use dlerror.
6816 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
6818 * symtab.cc (detect_odr_violations): When reporting an ODR
6819 violation, report an object where the symbol is defined.
6821 2010-06-25 Doug Kwan <dougkwan@google.com>
6823 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
6824 (Target_arm::section_may_have_icf_unsafe_pointers): New method
6826 (Target_arm::Scan::local_reloc_may_be_function_pointer,
6827 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
6828 target hook to detect function points.
6829 (Target_arm::Scan::possible_function_pointer_reloc): New method.
6830 * icf.h (Icf::check_section_for_function_pointers): Change type of
6831 parameter SECTION_NAME to const reference to std::string. Use
6832 target hook to determine if section may have unsafe pointers.
6833 * target.h (Target::section_may_have_icf_unsafe_pointers): New
6836 2010-06-21 Rafael Espindola <espindola@google.com>
6838 * fileread.cc (Input_file::find_fie): New
6839 (Input_file::open): Use Input_file::find_fie.
6840 * fileread.h (Input_file::find_fie): New
6841 * plugin.cc (set_extra_library_path): New.
6842 (Plugin::load): Add set_extra_library_path to the transfer vector.
6843 (Plugin_manager::set_extra_library_path): New.
6844 (Plugin_manager::add_input_file): Use the extra search path if set.
6845 (set_extra_library_path(): New.
6846 * plugin.h (Plugin_manager): Add set_extra_library_path and
6849 2010-06-19 Cary Coutant <ccoutant@google.com>
6851 * layout.cc (gdb_sections): Add .debug_types.
6852 (lines_only_debug_sections): Likewise.
6854 2010-06-18 Rafael Espindola <espindola@google.com>
6856 * plugin.cc (add_input_file,add_input_library)
6857 (Plugin_manager::add_input_file): Make filename arguments const.
6858 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
6861 2010-06-16 Doug Kwan <dougkwan@google.com>
6863 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
6864 .ARM.attributes section if we have not merged any input
6865 attributes sections.
6867 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6869 * arm.cc: Allow combining objects with no EABI version
6872 2010-06-15 Rafael Espindola <espindola@google.com>
6874 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
6876 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6878 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
6879 (struct iovec): Correct !HAVE_READV definition.
6881 2010-06-10 Cary Coutant <ccoutant@google.com>
6883 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
6884 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
6886 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
6889 * symtab.h (Symbol::is_placeholder): New member function.
6890 * target-reloc.h (relocate_section): Check for placeholder symbols.
6892 * testsuite/Makefile.am (plugin_test_8): New test.
6893 (plugin_test_9): New test.
6894 * testsuite/Makefile.in: Regenerate.
6896 2010-06-09 Nick Clifton <nickc@redhat.com>
6898 * yyscript.y (input_list_element): Allow strings prefixed with
6899 the '-' character. Treat these as libraries.
6900 * script.cc (script_add_library): New function. Adds a library
6901 specified by "-l<name>" found in an input script.
6902 * script-c.h: Add prototype for script_add_library.
6904 2010-06-07 Doug Kwan <dougkwan@google.com>
6906 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
6907 Restrict stub-group size to be within long conditional branch
6908 range when working around cortex-A8 erratum.
6910 2010-06-07 Damien Diederen <dd@crosstwine.com>
6912 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
6915 2010-06-03 Sriraman Tallam <tmsriram@google.com>
6919 (Output_section::Input_section_sort_entry::compare_section_ordering):
6920 Change to return non-zero correctly.
6921 (Output_section::Input_section_sort_section_order_index_compare
6922 ::operator()): Change to fix ambiguity in comparisons.
6924 2010-06-01 Sriraman Tallam <tmsriram@google.com>
6926 * gold.h (is_wildcard_string): New function.
6927 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
6928 (Layout::layout_eh_frame): Ditto.
6929 (Layout::find_section_order_index): New method.
6930 (Layout::read_layout_from_file): New method.
6931 * layout.h (Layout::find_section_order_index): New method.
6932 (Layout::read_layout_from_file): New method.
6933 (Layout::input_section_position_): New private member.
6934 (Layout::input_section_glob_): New private member.
6935 * main.cc (main): Call read_layout_from_file here.
6936 * options.h (--section-ordering-file): New option.
6937 * output.cc (Output_section::input_section_order_specified_): New
6939 (Output_section::Output_section): Initialize new member.
6940 (Output_section::add_input_section): Add new parameter.
6941 Keep input sections when --section-ordering-file is used.
6942 (Output_section::set_final_data_size): Sort input sections when
6943 section ordering file is specified.
6944 (Output_section::Input_section_sort_entry): Add new parameter.
6946 (Output_section::Input_section_sort_entry::compare_section_ordering):
6948 (Output_section::Input_section_sort_compare::operator()): Change to
6949 consider section_order_index.
6950 (Output_section::Input_section_sort_init_fini_compare::operator()):
6951 Change to consider section_order_index.
6952 (Output_section::Input_section_sort_section_order_index_compare
6953 ::operator()): New method.
6954 (Output_section::sort_attached_input_sections): Change to sort
6955 according to section order when specified.
6956 (Output_section::add_input_section<32, true>): Add new parameter.
6957 (Output_section::add_input_section<64, true>): Add new parameter.
6958 (Output_section::add_input_section<32, false>): Add new parameter.
6959 (Output_section::add_input_section<64, false>): Add new parameter.
6960 * output.h (Output_section::add_input_section): Add new parameter.
6961 (Output_section::input_section_order_specified): New
6963 (Output_section::set_input_section_order_specified): New method.
6964 (Input_section::Input_section): Initialize section_order_index_.
6965 (Input_section::section_order_index): New method.
6966 (Input_section::set_section_order_index): New method.
6967 (Input_section::section_order_index_): New member.
6968 (Input_section::Input_section_sort_section_order_index_compare): New
6970 (Output_section::input_section_order_specified_): New member.
6971 * script-sections.cc (is_wildcard_string): Delete and move modified
6973 (Output_section_element_input::Output_section_element_input): Modify
6974 call to is_wildcard_string.
6975 (Output_section_element_input::Input_section_pattern
6976 ::Input_section_pattern): Ditto.
6977 (Output_section_element_input::Output_section_element_input): Ditto.
6978 * testsuite/Makefile.am (final_layout): New test case.
6979 * testsuite/Makefile.in: Regenerate.
6980 * testsuite/final_layout.cc: New file.
6981 * testsuite/final_layout.sh: New file.
6983 2010-06-01 Rafael Espindola <espindola@google.com>
6985 * plugin.cc (Plugin::load): Pass the output name to the plugin.
6987 2010-06-01 Rafael Espindola <espindola@google.com>
6989 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
6990 visibility of symbols.
6992 2010-05-27 Doug Kwan <dougkwan@google.com>
6994 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
6995 from start of output section instead of address for a local symbol
6996 in a merged or relaxed section when doing a relocatable link.
6998 2010-05-26 Rafael Espindola <espindola@google.com>
7001 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
7002 adding sections the garbage collector removed.
7003 * gold/testsuite/Makefile.am: Add test.
7004 * gold/testsuite/Makefile.in: Regenerate.
7005 * gold/testsuite/plugin_test_7.sh: New.
7006 * gold/testsuite/plugin_test_7_1.c: New.
7007 * gold/testsuite/plugin_test_7_2.c: New.
7009 2010-05-26 Rafael Espindola <espindola@google.com>
7011 * script-sections.cc (Output_section_definition::set_section_addresses):
7012 Check for --section-start.
7014 2010-05-26 Doug Kwan <dougkwan@google.com>
7016 * arm.cc (Arm_scan_relocatable_relocs): New class.
7017 (Target_arm::relocate_special_relocatable): New method.
7018 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
7019 (Arm_relocate_functions::thumb_branch_common): Same.
7020 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
7021 instead of Default_scan_relocatable_relocs.
7022 * target-reloc.h (relocate_for_relocatable): Let target handle
7023 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
7024 * target.h (Sized_target::relocate_special_relocatable): New method.
7026 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7028 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
7030 2010-05-23 Doug Kwan <dougkwan@google.com>
7032 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
7034 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
7035 with a direct branch, not a conditional branch, to a stub.
7036 * merge.cc (Output_merge_base::record_input_section): New method
7038 (Output_merge_data::do_add_input_section): Record input section if
7039 keeps-input-sections flag is set.
7040 (Output_merge_string::do_add_input_section): Ditto.
7041 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
7042 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
7044 (Output_merge_base::keeps_input_sections,
7045 Output_merge_base::set_keeps_input_sections,
7046 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
7048 (Output_merge_base::Input_sections): New type declaration.
7049 (Output_merge_base::input_sections_begin,
7050 Output_merge_base::input_sections_end,
7051 Output_merge_base::do_set_keeps_input_sections): New method definitions.
7052 (Output_merge_base::bool keeps_input_sections_,
7053 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
7054 Output_merge_base::input_sections_): New data members.
7055 (Output_merge_data::do_set_keeps_input_sections): New method
7057 (Output_merge_string::do_set_keeps_input_sections): Ditto.
7058 * output.cc (Output_section::Input_section::relobj): Move method
7059 defintion from class declaration to here and handle merge sections.
7060 (Output_section::Input_section::shndx): Ditto.
7061 (Output_section::Output_section): Remove initializations of removed
7062 data members and initialize new data member LOOKUP_MAPS_.
7063 (Output_section::add_input_section): Set keeps-input-sections flag
7064 for a newly created merge output section as appropriate. Adjust code
7065 to use Output_section_lookup_maps class.
7066 (Output_section::add_relaxed_input_section): Adjst code for lookup
7067 maps code refactoring.
7068 (Output_section::add_merge_input_section): Add a new parameter
7069 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
7070 class. If adding input section to a newly created merge output
7071 section fails, remove the new merge section.
7072 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
7073 Adjust code for use of the Output_section_lookup_maps class.
7074 (Output_section::find_merge_section): Ditto.
7075 (Output_section::build_lookup_maps): New method defintion.
7076 (Output_section::find_relaxed_input_section): Adjust code to use
7077 Output_section_lookup_maps class.
7078 (Output_section::get_input_sections): Export merge sections. Adjust
7079 code to use Output_section_lookup_maps class.
7080 (Output_section:::add_script_input_section): Adjust code to use
7081 Output_section_lookup_maps class. Update lookup maps for merge
7083 (Output_section::discard_states): Use Output_section_lookup_maps.
7084 (Output_section::restore_states): Same.
7085 * output.h (Merge_section_properties): Move class defintion out of
7087 (Output_section_lookup_maps): New class.
7088 (Output_section::Input_section::is_merge_section): New method
7090 (Output_section::Input_section::relobj): Move defintion out of class
7091 defintion. Declare method only.
7092 (Output_section::Input_section::shndx): Ditto.
7093 (Output_section::Input_section::output_merge_base): New method defintion.
7094 (Output_section::Input_section::u2_.pomb): New union field.
7095 (Output_section::Merge_section_by_properties_map,
7096 Output_section::Output_section_data_by_input_section_map,
7097 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
7099 (Output_section::add_merge_input_section): Add new parameter
7100 KEEPS_INPUT_SECTIONS.
7101 (Output_section::build_lookup_maps): New method declaration.
7102 (Output_section::merge_section_map_,
7103 Output_section::merge_section_by_properties_map_,
7104 Output_section::relaxed_input_section_map_,
7105 Output_section::is_relaxed_input_section_map_valid_): Remove data
7107 (Output_section::lookup_maps_): New data member.
7109 2010-05-21 Doug Kwan <dougkwan@google.com>
7112 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
7113 avoid a compilation error.
7115 2010-05-19 Rafael Espindola <espindola@google.com>
7117 * script-sections.cc (Output_section_definition::allocate_to_segment):
7118 Update the phdrs_list even when the output section is NULL.
7119 * testsuite/Makefile.am: Add test.
7120 * testsuite/Makefile.in: Regenerate.
7121 * testsuite/script_test_9.cc: New.
7122 * testsuite/script_test_9.sh: New.
7123 * testsuite/script_test_9.t: New.
7125 2010-05-19 Doug Kwan <dougkwan@google.com>
7127 * arm.cc (Arm_input_section::original_size): New method.
7128 (Arm_input_section::do_addralign): Add a cast.
7129 (Arm_input_section::do_output_offset): Remove static cast.
7130 (Arm_input_section::original_addralign,
7131 Arm_input_section::original_size_): Change type to uint32_t.
7132 (Arm_input_section::init): Add safe casts for section alignment
7134 (Arm_input_section::set_final_data_size): Do not set address and
7135 offset of stub table.
7136 (Arm_output_section::fix_exidx_coverage): Change use of of
7137 Output_section::Simple_input_section to that of
7138 Output_section::Input_section.
7139 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
7140 except for the first pass.
7141 * output.cc (Output_section::get_input_sections): Change type of
7142 input_sections to std::list<Input_section>.
7143 (Output_section::add_script_input_section): Rename from
7144 Output_section::add_simple_input_section. Change type of SIS
7145 parameter from Simple_input_section to Input_section.
7146 * output.h (Output_section::Simple_input_section): Remove class.
7147 (Output_section::Input_section): Change class visibility to public.
7148 (Output_section::Input_section::addralign): Use stored alignments
7149 for special input sections if set.
7150 (Output_section::Input_section::set_addralign): New method.
7151 (Output_section::get_input_sections): Change parameter type from
7152 list of Simple_input_section to list of Input_section.
7153 (Output_section::add_script_input_section): Rename from
7154 Output_section::add_simple_input_section. Change first parameter's
7155 type from Simple_input_section to Input_section and remove the
7156 second and third parameters.
7157 * script-sections.cc (Input_section::Input_section_list): Change
7158 type to list of Output_section::Input_section/
7159 (Input_section_info::Input_section_info): Change parameter type of
7160 INPUT_SECTION to Output_section::Input_section.
7161 (Input_section_info::input_section): Change return type.
7162 (Input_section_info::input_section_): Change type to
7163 Output_section::Input_section.
7164 (Output_section_element_input::set_section_addresses): Adjust code
7165 to use Output_section::Input_section instead of
7166 Output_section::Simple_input_section. Adjust code for renaming
7167 of Output_section::add_simple_input_section.
7168 (Orphan_output_section::set_section_addresses): Ditto.
7170 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7172 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
7173 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
7175 2010-05-18 Rafael Espindola <espindola@google.com>
7177 * options.cc (General_options::finalize): Handle -nostdlib.
7178 * options.h (nostdlib): New option.
7179 * script.cc (script_add_search_dir): Handle -nostdlib.
7181 2010-05-12 Doug Kwan <dougkwan@google.com>
7183 * arm.cc (Target_arm::do_finalize_sections): Create an empty
7184 attributes section only if there no attributes section after merging.
7185 (Target_arm::merge_object_attributes): Move value of
7186 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
7187 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
7188 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
7189 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
7190 and arm_attr_merge_7.stdout.
7191 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
7192 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
7193 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
7194 arm_attr_merge_7b.o): New rules.
7195 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
7197 * testsuite/Makefile.in: Regenerate.
7198 * testsuite/arm_attr_merge.sh: New file.
7199 * testsuite/arm_attr_merge_[67][ab].s: Same.
7201 2010-05-05 Nick Clifton <nickc@redhat.com>
7203 * po/es.po: Updated Spanish translation.
7205 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7207 * Makefile.am (install-exec-local): Properly install gold as
7208 default cross linker.
7209 * Makefile.in: Regenerated.
7211 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7212 Nick Clifton <nickc@redhat.com>
7214 * configure.ac (install_as_default): Define and set to false
7215 unless --enable-gold or --enable-gold=both/gold has been
7217 * configure: Regenerate.
7219 * Makefile.am (install-exec-local): Install the executable as
7220 'ld.gold'. If install_as_default is true then also install it as
7222 * Makefile.in: Regenerated.
7224 2010-04-24 Ian Lance Taylor <iant@google.com>
7226 * layout.cc (Layout::layout_reloc): In relocatable link don't
7227 combine reloc sections for grouped sections.
7229 2010-04-23 Sriraman Tallam <tmsriram@google.com>
7231 * gc.h (gc_process_relocs): Pass information on relocs pointing to
7232 sections that are not ordinary to icf.
7233 * icf.cc (get_section_contents): Handle relocation pointing to section
7234 with no object or shndx information.
7235 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
7236 * testsuite/Makefile.in: Regenerate.
7237 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
7238 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
7240 2010-04-22 Ian Lance Taylor <iant@google.com>
7242 * expression.cc (Expression::Expression_eval_info): Add
7243 result_alignment_pointer field.
7244 (Expression::eval_with_dot): Add result_alignment_pointer
7245 parameter. Change all callers.
7246 (Expression::eval_maybe_dot): Likewise.
7247 (class Binary_expression): Add alignment_pointer parameter to
7248 left_value and right_value. Change all callers.
7249 (BINARY_EXPRESSION): Set result alignment.
7250 (class Trinary_expression): Add alignment_pointer parameter to
7251 arg2_value and arg3_value. Change all callers.
7252 (Trinary_cond::value): Set result alignment.
7253 (Max_expression::value, Min_expression::value): Likewise.
7254 (Align_expression::value): Likewise.
7255 * script-sections.cc (class Sections_element): Add dot_alignment
7256 parameter to set_section_addresses virtual function. Update
7258 (class Output_section_element): Likewise.
7259 (Script_sections::create_segments): Add dot_alignment parameter.
7261 (Script_sections::create_segments_from_phdrs_clause): Likewise.
7262 (Script_sections::set_phdrs_clause_addresses): Likewise.
7263 * script-sections.h: Update declarations.
7264 * script.h: Update declarations.
7265 * output.h (Output_segment::set_minimum_p_align): Don't decrease
7267 * testsuite/script_test_3.t: Set large alignment.
7268 * testsuite/script_test_3.sh: Make sure that at least one LOAD
7269 segment has expected alignment.
7271 2010-04-22 Nick Clifton <nickc@redhat.com>
7273 * po/gold.pot: Updated by the Translation project.
7274 * po/vi.po: Updated Vietnamese translation.
7276 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
7278 * testsuite/Makefile.am (check_PROGRAMS): Add
7279 icf_virtual_function_folding_test.
7280 * testsuite/Makefile.in: Regenerated.
7282 2010-04-15 Andrew Haley <aph@redhat.com>
7284 * options.h (merge_exidx_entries): New option.
7285 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
7286 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
7287 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
7288 (Target_arm::merge_exidx_entries): New function.
7289 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
7290 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
7291 to Arm_exidx_fixup constructor.
7292 Add new arg, merge_exidx_entries.
7293 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
7294 Arm_output_section::fix_exidx_coverage.
7296 2010-04-18 Sriraman Tallam <tmsriram@google.com>
7298 * icf.cc (get_section_contents): Check for preemptible functions.
7299 Ignore addend when appropriate.
7300 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
7302 (add_from_relobj): Check for section folded.
7303 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
7304 * symtab.h (should_add_dynsym_entry): Add new parameter.
7305 * target-reloc.h (scan_relocs): Check for section folded.
7306 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
7307 Check reloc types for function pointers in shared objects.
7308 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
7310 (icf_preemptible_functions_test): New test case.
7311 (icf_string_merge_test): New test case.
7312 * testsuite.Makefile.in: Regenerate.
7313 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
7314 bar_glob. Refactor code.
7315 * testsuite/icf_preemptible_functions_test.cc: New file.
7316 * testsuite/icf_preemptible_functions_test.sh: New file.
7317 * testsuite/icf_string_merge_test.cc: New file.
7318 * testsuite/icf_string_merge_test.sh: New file.
7319 * testsuite/icf_virtual_function_folding_test.cc: New file.
7320 * testsuite/icf_virtual_function_folding_test.sh: New file.
7322 2010-04-14 Doug Kwan <dougkwan@google.com>
7324 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
7325 for local symbol recounting if we remove a section due to ICF.
7326 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
7327 there are no regular objects in input.
7329 2010-04-13 Doug Kwan <dougkwan@google.com>
7331 * arm.cc (Arm_input_section::set_final_data_size): Compute
7332 accurate final data size instead of using current data size.
7334 2010-04-09 Doug Kwan <dougkwan@google.com>
7336 * layout.cc (Layout::choose_output_section): Handle script section
7338 (Layout::make_output_section_for_script): Add section type parameter.
7339 Handle script section types.
7340 * layout.h (Layout::make_output_section_for_script): Add section
7342 * output.cc (Output_section::Output_section): Initialize data member
7344 (Output_section::do_reset_address_and_file_offset): Do not set address
7345 to 0 if section is a NOLOAD section.
7346 * output.h (Output_section::is_noload): New method.
7347 (Output_section::set_is_noload): Ditto.
7348 (Output_section::is_noload_): New data member.
7349 * script-c.h (Script_section_type): New enum type.
7350 (struct Parser_output_section_header): Add new file section_type.
7351 * script-sections.cc (Sections_element::output_section_name): Add
7352 parameter for returning script section type.
7353 (Output_section_definition::output_section_name): Ditto.
7354 (Output_section_definition::section_type)P; New method.
7355 (Output_section_definiton::script_section_type_name): Ditto.
7356 (Output_section_definition::script_section_type_): New data member.
7357 (Output_section_definition::Output_section_definition): Initialize
7358 data member Output_section_definition::script_section_type_.
7359 (Output_section_definition::create_sections): Pass script section type
7360 to Layout::make_output_section_for_script.
7361 (Output_section_definition::output_section_name): Return script
7362 section type to caller.
7363 (Output_section_definition::set_section_address): Do not advance
7364 dot value and load address if section type is NOLOAD. Set address
7365 of NOLOAD sections regardless of section flags.
7366 (Output_section_definition::print): Print section type if it is
7367 not SCRIPT_SECTION_TYPE_NONE.
7368 (Output_section_definition::section_type): New method.
7369 (Output_section_definition::script_section_type_name): Ditto.
7370 (Script_sections::output_section_name): Add new parameter
7371 PSECTION_TYPE for returning script section type. Pass it to
7372 section elements. Handle discard sections.
7373 (Sort_output_sections::operator()): Handle NOLOAD sections.
7374 * script-sections.h (Script_sections::Section_type): New enum type.
7375 (Script_sections::output_section_name): Add a new parameter for
7376 returning script section type.
7377 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
7379 * yyscript.y (union): Add new field SECTION_TYPE.
7380 (COPY, DSECT, INFO, NOLOAD): New tokens.
7381 (opt_address_and_section_type): Change type to output_section_header.
7382 (section_type): New non-terminal
7383 (section_header): Handle section type.
7384 (opt_address_and_section_type): Return section type value.
7386 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
7388 * testsuite/plugin_common_test_1.c (foo): Add prototype.
7389 * testsuite/plugin_common_test_2.c (foo): Likewise.
7391 2010-04-08 Doug Kwan <dougkwan@google.com>
7393 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
7395 * output.cc (Output_section::add_merge_input_section): Simplify
7396 code and return status of Output_merge_base::add_input_section.
7397 Update merge section map only if Output_merge_base::add_input_section
7400 2010-04-07 Doug Kwan <dougkwan@google.com>
7402 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
7403 if section is marked as containing instructions but has no mapping
7405 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
7406 correct section index.
7407 (Arm_relobj::find_linked_text_section): Ditto.
7409 2010-04-07 Cary Coutant <ccoutant@google.com>
7411 * archive.cc (include_member): Destroy Read_symbols_data object before
7413 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
7414 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
7415 (Read_symbols_data::~Read_symbols_data) New destructor.
7416 (Section_relocs::Section_relocs) New constructor.
7417 (Section_relocs::~Section_relocs) New destructor.
7418 (Read_relocs_data::Read_relocs_data) New constructor.
7419 (Read_relocs_data::~Read_relocs_data) New destructor.
7420 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
7421 pointers to NULL after deleting.
7423 2010-04-07 Doug Kwan <dougkwan@google.com>
7425 * arm.cc: Replace "endianity" with "endianness" in comments.
7426 (Arm_exidx_cantunwind): Ditto.
7427 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
7428 (Arm_relobj::merge_flags_and_attributes): New method.
7429 (Arm_relobj::merge_flags_and_attributes_): New data member.
7430 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
7431 (Arm_relobj::scan_sections_for_stubs): Ditto.
7432 (Arm_relobj::do_read_symbols): Check to see if we really want to
7433 merge processor-specific flags and attributes. Exit early if
7434 an object is empty except for section names and the undefined symbol.
7435 (Target_arm::do_finalize_sections): Move check for ELF format to
7436 Arm_relobj::do_read_symbols. Merge processor specific flags and
7437 attributes from a regular object only when we have determined that
7438 it is aapropriate. Do not create an .ARM.attributes section in
7439 output if there is no regular input object.
7440 (Target_arm::merge_processor_specific_flags): Check
7441 --warn-mismatch before printing any error.
7442 (Target_arm::merge_object_attributes): Ditto.
7443 * gold.cc (queue_middle_tasks): Handle the case in which there is
7444 no regular object in input.
7445 * options.cc (General_options::parse_EB): New method.
7446 (General_options::parse_EL): Same.
7447 (General_options::General_options): Initialize endianness_.
7448 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
7450 (General_options::Endianness): New enum.
7451 (General_options::endianness): New method.
7452 (General_options::endianness_): New data member.
7453 * parameters.cc (Parameters::set_options): Check target endianness.
7454 (Parameters::set_target_once): Ditto.
7455 (Parameters::check_target_endianness): New method.
7456 (parameters_force_valid_target): If either -EL or -EB is specified,
7457 use it to define endianness of default target.
7458 * parameters.h (Parameters::check_target_endianness): New method
7460 * target.h (class Target): Change "endianity" to "endianness"
7463 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7465 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
7466 * configure: Regenerate.
7467 * Makefile.in: Regenerate.
7468 * testsuite/Makefile.in: Regenerate.
7470 2010-04-06 Cary Coutant <ccoutant@google.com>
7473 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
7474 prevailing definitions of common symbols.
7475 * testsuite/plugin_test_6.sh: New test case.
7476 * testsuite/plugin_common_test_1.c: New test case.
7477 * testsuite/plugin_common_test_2.c: New test case.
7478 * testsuite/Makefile.am (plugin_test_6): New test case.
7479 * testsuite/Makefile.in: Regenerate.
7481 2010-04-06 Nick Clifton <nickc@redhat.com>
7483 * po/vi.po: New Vietnamese translation.
7485 2010-03-30 Doug Kwan <dougkwan@google.com>
7487 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
7489 2010-03-25 Doug Kwan <dougkwan@google.com>
7491 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
7492 to avoid a conversion warning on a 32-bit host.
7494 2010-03-24 Ian Lance Taylor <iant@google.com>
7496 * testsuite/script_test_3.t: Add a TLS segment.
7497 * testsuite/Makefile.am (check_PROGRAMS): Add
7498 tls_phdrs_script_test.
7499 (tls_phdrs_script_test_SOURCES): Define.
7500 (tls_phdrs_script_test_DEPENDENCIES): Define.
7501 (tls_phdrs_script_test_LDFLAGS): Define.
7502 (tls_phdrs_script_test_LDADD): Define.
7503 * testsuite/Makefile.in: Rebuild.
7505 2010-03-23 Cary Coutant <ccoutant@google.com>
7507 * fileread.cc (find_or_make_view): Fix comment.
7509 2010-03-23 Ian Lance Taylor <iant@google.com>
7511 * script-sections.cc (class Orphan_section_placement): Define
7512 PLACE_TLS and PLACE_TLS_BSS.
7513 (Orphan_section_placement::Orphan_section_placement): Initialize
7515 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
7516 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
7517 (tls_script_test_SOURCES): Define.
7518 (tls_script_test_DEPENDENCIES): Define.
7519 (tls_script_test_LDFLAGS): Define.
7520 (tls_script_test_LDADD): Define.
7521 * testsuite/Makefile.in: Rebuild.
7523 2010-03-22 Doug Kwan <dougkwan@google.com>
7525 * arm.cc (Arm_relocate_functions::abs8,
7526 Arm_relocate_functions::abs16): Use correct check for overflow
7527 specified in the ARM ELF specs.
7528 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
7529 target of a BLX instruction specially.
7530 (Reloc_stub::stub_type_for_reloc): Ditto.
7531 (Relocate::relocate): Use symbolic names instead of numeric relocation
7532 codes to report error.
7533 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
7535 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
7536 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
7537 thumb2_blx_out_of_range.stdout
7538 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
7539 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
7540 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
7541 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
7542 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
7543 thumb2_blx_in_range, thumb2_blx_in_range.o,
7544 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
7545 thumb2_blx_out_of_range.o): New rules.
7546 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
7547 thumb2_blx_in_range and thumb2_blx_out_of_range.
7548 * testsuite/Makefile.in: Regenerate.
7549 * arm_branch_in_range.sh: Add tests for THUMB BLX.
7550 * testsuite/thumb_blx_in_range.s: New file.
7551 * testsuite/thumb_blx_out_of_range.s: New file.
7553 2010-03-22 Rafael Espindola <espindola@google.com>
7555 * archive.cc (Should_include): Move to archive.h.
7556 (should_include_member): Make it a member of Archive.
7558 (Add_lib_group_symbols): New.
7559 * archive.h: Include options.h.
7560 (Archive_member): Moved from Archive.
7561 (Should_include): Moved from archive.cc.
7563 (Add_lib_group_symbols): New.
7564 * dynobj.cc (do_should_include_member): New.
7565 * dynobj.h (do_should_include_member): New.
7566 * gold.cc (queue_initial_tasks): Update call to queue.
7567 * main.cc (main): Print lib group stats.
7568 * object.cc (do_should_include_member): New.
7569 * object.h: Include archive.h.
7570 (Object::should_include_member): New.
7571 (Object::do_should_include_member): New.
7572 (Sized_relobj::do_should_include_member): New.
7573 * options.cc (General_options::parse_start_lib): New.
7574 (General_options::parse_end_lib): New.
7575 (Input_arguments::add_file): Handle lib groups.
7576 (Input_arguments::start_group): Check we are not in a lib.
7577 (Input_arguments::start_lib): New.
7578 (Input_arguments::end_lib): New.
7579 * options.h (General_options): Add start_lib and end_lib.
7580 (Input_argument::lib_): New.
7581 (Input_argument::lib): New.
7582 (Input_argument::is_lib): New.
7583 (Input_file_lib): New.
7584 (Input_arguments::in_lib_): New.
7585 (Input_arguments::in_lib): New.
7586 (Input_arguments::start_lib): New.
7587 (Input_arguments::end_lib_): New.
7588 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
7589 in unused members as preempted.
7590 (Sized_pluginobj::do_should_include_member): New.
7591 * plugin.h (Sized_pluginobj::do_should_include_member): New.
7592 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
7594 (Read_symbols::do_whole_lib_group): New.
7595 (Read_symbols::do_lib_group): New.
7596 (Read_symbols::do_read_symbols): Handle lib groups.
7597 (Read_symbols::get_name): Handle lib groups.
7598 * readsyms.h (Read_symbols): Add an archive member pointer.
7599 (Read_symbols::do_whole_lib_group): New.
7600 (Read_symbols::do_lib_group): New.
7601 (Read_symbols::member_): New.
7602 * script.cc (read_input_script): Update call to queue_soon.
7604 2010-03-19 Doug Kwan <dougkwan@google.com>
7606 * arm.cc (Stub_table::Stub_table): Initialize new data members
7607 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7608 (Stub_table::add_reloc_stub): Assign stub offset and update
7609 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7610 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
7612 (Stub_table::update_data_size_and_addralign): Use
7613 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
7614 instead of going over all reloc stubs.
7615 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
7616 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7617 Stringpool_template::offset_ to size of Stringpool_char.
7618 (Stringpool_template::new_key_offset): Remove code to initialize
7619 Stringpool_template::offset_.
7620 * stringpool.h (Stringpool_template::set_no_zero_null): Set
7621 Stringpool_template::offset_ to zero.
7623 2010-03-15 Doug Kwan <dougkwan@google.com>
7625 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7627 (Stringpool_template::new_key_offset): New method.
7628 (Stringpool_template::add_string): Assign offsets when adding new
7630 (Stringpool_template::set_string_offsets): Do not set string offsets
7631 when not optimizing.
7632 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
7634 (Chunked_vector::clear): Clear size_.
7635 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
7636 (Chunked_vector::size): Return size_.
7637 (Chunked_vector::push_back): Use size_ to find insert position.
7638 (Chunked_vector::size_): New data member.
7639 (Stringpool_template::set_no_zero_null): Assert string set is empty.
7640 (Stringpool_template::new_key_offset): New method declaration.
7641 (Stringpool_template::offset_): New data member.
7643 2010-03-15 Rafael Espindola <espindola@google.com>
7645 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
7646 Add_symbols' constructor.
7647 * readsyms.h (Add_symbols): Remove the input_group member.
7649 2010-03-10 Ian Lance Taylor <iant@google.com>
7651 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
7652 target to ask whether a reference to a symbol requires a stack
7654 * target.h (Target::is_call_to_non_split): New function.
7655 (Target::do_is_call_to_non_split): Declare virtual function.
7656 * target.cc: Include "symtab.h".
7657 (Target::do_is_call_to_non_split): New function.
7658 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
7660 2010-03-10 Cary Coutant <ccoutant@google.com>
7662 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
7663 (File_read::open[1]): Remove initial mapping of whole_file_view_.
7664 (File_read::open[2]): Add whole_file_view_ to list of views.
7665 (File_read::make_view): Remove test of whole_file_view_.
7666 (File_read::find_or_make_view): Create whole_file_view_ if
7668 (File_read::clear_views): Replace bool parameter with enum;
7669 adjust all callers. Don't delete views with permanent data;
7670 do delete cached views and views from archives if
7671 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
7672 if clearing the corresponding view.
7673 * fileread.h (File_read::Clear_views_mode): New enum.
7674 (File_read::View::is_permanent_view): New method.
7675 (File_read::clear_views): Replace bool parameter
7676 with enum; adjust all callers.
7677 * options.h (General_options): Change keep_files_mapped option;
7678 add map_whole_files.
7679 * readsyms.cc (Add_symbols::run): Delete sd_ object before
7681 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
7684 2010-03-10 David S. Miller <davem@davemloft.net>
7686 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
7688 2010-03-09 Sriraman Tallam <tmsriram@google.com>
7690 * icf.cc (get_section_contents): Add '@' marker after processing the
7693 2010-03-08 Doug Kwan <dougkwan@google.com>
7695 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
7696 due to a conversion warning.
7697 (Arm_relobj::update_output_local_symbol_count): Check for local
7698 symbol with unset output index.
7700 2010-03-05 Ian Lance Taylor <iant@google.com>
7702 * options.h (class General_options): Add --spare-dynamic-tags.
7703 * output.cc (Output_data_dynamic::set_final_data_size): Implement
7704 --spare-dynamic-tags.
7706 2010-03-05 Ian Lance Taylor <iant@google.com>
7708 * incremental.cc: Include "libiberty.h".
7710 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
7712 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
7713 function, is_info_ member.
7714 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
7715 (Versions::Versions): Update caller.
7716 (Versions::define_base_version): Likewise.
7717 (Versions::add_def): Likewise.
7719 2010-03-03 Sriraman Tallam <tmsriram@google.com>
7721 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
7722 (Scan::possible_function_pointer_reloc): New function.
7723 (Scan::local_reloc_may_be_function_pointer): Change to call
7724 possible_function_pointer_reloc.
7725 (Scan::global_reloc_may_be_function_pointer): Ditto.
7726 * icf.h (Icf::check_section_for_function_pointers): Change to reject
7727 relocations in ".data.rel.ro._ZTV" section.
7728 * testsuite/icf_safe_so_test.sh: Change to pass i386.
7729 * testsuite/icf_safe_so_test.cc: Ditto.
7730 * testsuite/icf_safe_test.cc: Ditto.
7731 * testsuite/icf_safe_test.sh: Ditto.
7733 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7734 Ian Lance Taylor <iant@google.com>
7736 * target-reloc.h (relocate_section): Check the symbol table index
7737 for -1U before setting the local symbol index.
7738 (scan_relocatable_relocs): If copying the relocation, record that
7739 the local symbol is required.
7740 * object.h (Symbol_value::is_output_symtab_index_set): New
7742 (Symbol_value::may_be_discarded_from_output_symtab): New
7744 (Symbol_value::has_output_symtab_entry): New function.
7745 (Symbol_value::needs_output_symtab_entry): Remove.
7746 (Symbol_value::output_symtab_index): Make sure the symbol index is
7748 (Symbol_value::set_output_symtab_index): Make sure the symbol
7749 index is not set. Make sure the new index is valid.
7750 (Symbol_value::set_must_have_output_symtab_entry): New function.
7751 (Symbol_value::has_output_dynsym_entry): New function.
7752 (Symbol_value::set_output_dynsym_index): Make sure the new index
7754 (Sized_relobj::set_must_have_output_symtab_entry): New function.
7755 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
7756 local symbol if permitted.
7757 (Sized_relobj::do_finalize_local_symbols): Call
7758 is_output_symtab_index_set rather than needs_output_symtab_entry.
7759 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
7760 rather than needs_output_symtab_entry. Call
7761 has_output_dynsym_entry rather than needs_output_dynsym_entry.
7762 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
7763 is_output_symtab_index_set rather than needs_output_symtab_entry.
7764 * testsuite/discard_locals_relocatable_test.c: New file.
7765 * testsuite/discard_locals_test.sh: Test -r.
7766 * testsuite/Makefile.am (check_DATA): Add
7767 discard_locals_relocatable_test1.syms,
7768 discard_local_relocatable_test2.syms.
7769 (MOSTLYCLEANFILES): Likewise. Also add
7770 discard_locals_relocatable_test1.lout and
7771 discard_locals_relocatable_test2.out.
7772 (discard_locals_relocatable_test1.syms): New target.
7773 (discard_locals_relocatable_test.o): New target.
7774 (discard_locals_relocatable_test1.out): New target.
7775 (discard_locals_relocatable_test2.syms): New target.
7776 (discard_locals_relocatable_test2.out): New target.
7777 (various): Add missing ../ld-new dependencies.
7778 * testsuite/Makefile.in: Rebuild.
7780 2010-03-03 Nick Clifton <nickc@redhat.com>
7782 * po/fi.po: New Finnish translation.
7784 2010-03-01 Doug Kwan <dougkwan@google.com>
7786 * layout.cc (Layout::Layout): Force section types of .init_array*,
7787 .preinit_array* and .fini_array* sections.
7788 * output.cc (Output_section::Input_section_sort_entry::has_priority):
7789 Fix check of return value of std::string::find.().
7790 (Output_section::Input_section_sort_compare::operator()): Remove
7791 comment about .init_array.
7792 (Output_section::Input_section_sort_init_fini_compare::operator()):
7794 (Output_section::sort_attached_input_sections): Handle .init_array
7795 and .fini_array specially.
7796 * output.h (Output_section::Inut_section_sort_compare): Update
7798 (Output_section::Input_section_sort_init_fini_compare): New struct.
7800 2010-02-26 Doug Kwan <dougkwan@google.com>
7802 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
7803 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
7804 * testsuite/debug_msg.sh: Avoid matching source line number for
7805 use of global variable undef_int.
7807 2010-02-26 Doug Kwan <dougkwan@google.com>
7809 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
7810 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
7811 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
7812 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
7813 * options.cc (General_options::General_options): Initialize member
7815 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
7816 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
7817 and rm_no_fix_v4bx.stdout
7818 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
7819 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
7820 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
7821 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
7822 and arm_no_fix_v4bx.
7823 * Makefile.in: Regenerate.
7824 * testsuite/arm_fix_v4bx.s: New file.
7825 * testsuite/arm_fix_v4bx.sh: Ditto.
7827 2010-02-24 Doug Kwan <dougkwan@google.com>
7829 * arm.cc (Target_arm::got_section): Make the .got section the first
7830 non RELRO section in the data segment.
7831 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
7832 suffixes of section names.
7834 2010-02-24 Doug Kwan <dougkwan@google.com>
7836 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
7837 flags and attributes merging if an input file is a binary file.
7838 * fileread.cc (Input_file::open): Record format of original file.
7839 * fileread.h (Input_file::Format): New enum type.
7840 (Input_file::Input_file): Initialize data member format_.
7841 (Input_file::format): New method definition.
7842 (Input_file::format_):: New data member.
7844 2010-02-24 Doug Kwan <dougkwan@google.com>
7846 * arm.cc (Arm_output_data_got): New class.
7847 (ARM_TCB_SIZE): New constant
7848 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
7849 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
7850 If user uses a script with a SECTIONS clause, issue only a warning
7851 for a misplaced EXIDX input section. Otherwise, issue an error.
7852 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
7854 (Target_arm::got_mode_index_entry): Handle static linking.
7855 (Target_arm::Scan::local): Ditto.
7856 (Target_arm::Scan::global): Ditto.
7857 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
7858 all incorrectly implemented relocations.
7859 (Target_arm::fix_exidx_coverage): Pass layout to
7860 Arm_output_section::fix_exidx_coverage.
7861 * layout.cc (Layout::section_name_mapping): Remove trailing dots
7862 from ".ARM.exidx." and ".ARM.extab.".
7864 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7866 * arm.cc (Target_arm::do_finalize_sections): Create attribute
7867 section if it does not already exist.
7868 * attributes.cc (Attributes_section_data::Attributes_section_data):
7869 Don't crash if size is zero.
7871 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7872 Ian Lance Taylor <iant@google.com>
7874 * gold.cc (queue_middle_tasks): If no input files were opened,
7876 * workqueue.h (Task_function::Task_function): Assert that there is
7879 2010-02-22 Doug Kwan <dougkwan@google.com>
7881 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
7882 * icf.cc (get_section_contents): Cast snprintf arguments to long long
7883 types to avoid warnings due to different uint64_t implementations
7886 2010-02-21 Doug Kwan <dougkwan@google.com>
7888 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
7889 handling of the maximum backward branch offset.
7890 (Arm_relocate_functions::thumb_branch_common): Ditto.
7891 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
7892 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
7893 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
7894 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
7895 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
7896 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
7897 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
7898 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
7899 thumb_bl_out_of_range thumb_bl_out_of_range.o,
7900 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
7901 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
7902 thumb2_bl_out_of_range.o): New rules.
7903 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
7904 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
7905 thumb2_bl_out_of_range
7906 * testsuite/Makefile.in: Regenerate.
7907 * testsuite/arm_bl_in_range.s: New file.
7908 * testsuite/arm_bl_out_of_range.s: Ditto.
7909 * testsuite/arm_branch_in_range.sh: Ditto.
7910 * testsuite/arm_branch_range.t: Ditto.
7911 * testsuite/thumb2_branch_range.t: Ditto.
7912 * testsuite/thumb_bl_in_range.s: Ditto.
7913 * testsuite/thumb_bl_out_of_range.s: Ditto.
7914 * testsuite/thumb_branch_range.t: Ditto.
7916 2010-02-20 Sriraman Tallam <tmsriram@google.com>
7918 * gc.h (gc_process_relocs): Change vectors to point to the new list.
7919 Add reloc offset information.
7920 * icf.cc (get_section_contents): Change iterators to point to the new
7921 vectors. Add reloc offset information to the contents.
7922 * icf.h (Icf::Sections_reachable_info): New typedef.
7923 (Icf::Sections_reachable_list): New typedef.
7924 (Icf::Offset_info): New typedef.
7925 (Icf::Reloc_info): New struct typedef.
7926 (Icf::Reloc_info_list): New typedef.
7927 (Icf::symbol_reloc_list): Delete method.
7928 (Icf::addend_reloc_list): Delete method.
7929 (Icf::section_reloc_list): Delete method.
7930 (Icf::reloc_info_list): New method.
7931 (Icf::reloc_info_list_): New member.
7933 2010-02-19 Doug Kwan <dougkwan@google.com>
7935 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
7936 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
7937 * arm.cc (Arm_relocation_functions): New forward declaration.
7938 (Target_arm::Target_arm): Initialize new data members
7939 got_mod_index_offset_ and tls_base_symbol_defined_.
7940 (Target_arm::Relocate::relocate_tls): New method.
7941 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
7942 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
7944 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
7945 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
7946 (Target_arm::got_mod_index_offset_,
7947 Target_arm::tls_base_symbol_defined_): New data members.
7948 (Target_arm::Scan::local, Target::Scan::global,
7949 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
7952 2010-02-18 Doug Kwan <dougkwan@google.com>
7954 * arm.cc (Arm_relobj::find_linked_text_section): New method.
7955 (Arm_relobj::make_exidx_input_section): Pass section index of linked
7956 text section as a parameter becuase some broken tools may not set
7957 the link in section header.
7958 (Target_arm::has_got_section): New method.
7959 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
7960 without any mapping symbol as data only. Remove warning.
7961 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
7962 link in its section header, try to discover the link by inspecting the
7963 REL31 relocation at the beginning of the section.
7964 (Target_arm::Scan::check_non_pic): Report name of offending relocation
7966 (Target_arm::Scan::global): Treat any reference to the symbol
7967 _GLOBAL_OFFSET_TABLE_ as a GOT access.
7969 2010-02-12 Sriraman Tallam <tmsriram@google.com>
7971 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
7972 (Scan::global_reloc_may_be_function_pointer): New function.
7973 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7974 (Scan::global_reloc_may_be_function_pointer): New function.
7975 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7976 (Scan::global_reloc_may_be_function_pointer): New function.
7977 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
7978 (Scan::global_reloc_may_be_function_pointer): New function.
7979 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
7980 (Scan::global_reloc_may_be_function_pointer): New function.
7981 (Scan::possible_function_pointer_reloc): New function.
7982 (Target_x86_64::can_check_for_function_pointers): New function.
7983 * gc.h (gc_process_relocs): Scan relocation types to determine if
7984 function pointers were taken for targets that support it.
7985 * icf.cc (Icf::find_identical_sections): Include functions for
7986 folding in safe ICF whose pointer is not taken.
7987 * icf.h (Secn_fptr_taken_set): New typedef.
7988 (fptr_section_id_): New member.
7989 (section_has_function_pointers): New function.
7990 (set_section_has_function_pointers): New function.
7991 (check_section_for_function_pointers): New function.
7992 * options.h: Fix comment for safe ICF option.
7993 * target.h (can_check_for_function_pointers): New function.
7994 * testsuite/Makefile.am: Add icf_safe_so_test test case.
7995 Modify icf_safe_test for X86-64.
7996 * testsuite/Makefile.in: Regenerate.
7997 * testsuite/icf_safe_so_test.cc: New file.
7998 * testsuite/icf_safe_so_test.sh: New file.
7999 * testsuite/icf_safe_test.cc (kept_func_3): New function.
8000 (main): Change to take pointer to function kept_func_3.
8001 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
8002 folding is done correctly for X86-64.
8004 2010-02-12 David S. Miller <davem@davemloft.net>
8006 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
8007 is_symbolless parameter.
8008 (Output_reloc<SHT_REL>::is_symbolless): New.
8009 (Output_reloc<SHT_REL>::is_symbolless_): New.
8010 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
8011 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
8012 (Output_reloc<SHT_RELA>::is_symbolless): New.
8013 (Output_data_reloc::add_global): Handle is_symbolless.
8014 (Output_data_reloc::add_global_relative): Likewise.
8015 (Output_data_reloc::add_local): Likewise.
8016 (Output_data_reloc::add_local_relative): Likewise.
8017 (Output_data_reloc::add_symbolless_global_addend): New.
8018 (Output_data_reloc::add_symbolless_local_addend): New.
8019 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
8021 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
8022 instead of ->is_relative_
8023 (Output_reloc::write): Likewise.
8024 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
8025 (Output_reloc::write_rel): Simplify.
8027 * sparc.cc (Target_sparc::Scan::local): Use
8028 ->add_symbolless_local_addend as needed.
8029 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
8030 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
8031 based upon relocation offset.
8033 2010-02-11 Doug Kwan <dougkwan@google.com>
8035 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
8036 (Target_arm::Scan::global): Ditto. Also remove a comment before the
8037 beginning of function.
8038 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
8039 and MOVT_ABS relocations. Those are non issued in scanning. Fix
8040 parameter is_32bit in calls to should_apply_static_reloc.
8041 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
8042 (check_DATA): Add arm_abs_global.stdout.
8043 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
8044 arm_abs_global.stdout): New rules.
8045 (MOSTLLYCLEANFILES): Add arm_abs_global
8046 * Makefile.in: Regenerate.
8047 * testsuite/arm_abs_global.s: New file.
8048 * testsuite/arm_abs_global.sh: Ditto.
8049 * testsuite/arm_abs_lib.s: Ditto.
8051 2010-02-11 Ian Lance Taylor <iant@google.com>
8053 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
8055 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
8056 Allocate_commons_task first.
8057 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
8058 task, rather than symtab_lock_.
8059 (Gc_process_relocs::~Gc_process_relocs): New function.
8060 (Gc_process_relocs::is_runnable): Check this_blocker_.
8061 (Gc_process_relocs::locks): Use next_blocker_ rather than
8063 (Scan_relocs::~Scan_relocs): New function.
8064 (Scan_relocs::is_runnable): Check this_blocker_ rather than
8066 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
8068 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
8069 fields. Add this_blocker_ and next_blocker_ fields. Adjust
8070 constructor accordingly.
8071 (class Gc_process_relocs): Likewise.
8072 (class Scan_relocs): Likewise.
8073 * common.h (class Allocate_commons_task): Remove symtab_lock_
8074 field, and corresponding constructor parameter.
8075 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
8077 (Allocate_commons_task::locks): Likewise.
8079 2010-02-11 Ian Lance Taylor <iant@google.com>
8081 * gold-threads.h (class Once): Define.
8082 (class Initialize_lock): Rewrite as child of Once.
8083 * gold-threads.cc (class Once_initialize): Define.
8084 (once_pointer_control): New static variable.
8085 (once_pointer, once_arg): New static variables.
8086 (c_run_once): New static function.
8087 (Once::Once, Once::run_once, Once::internal_run): New functions.
8088 (class Initialize_lock_once): Remove.
8089 (initialize_lock_control): Remove.
8090 (initialize_lock_pointer): Remove.
8091 (initialize_lock_once): Remove.
8092 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
8093 (Initialize_lock::initialize): Rewrite.
8094 (Initialize_lock::do_run_once): New function.
8095 * archive.cc (Archive::interpret_header): Only clear name if it is
8097 * fileread.cc: Include "gold-threads.h"
8098 (file_counts_lock): New static variable.
8099 (file_counts_initialize_lock): Likewise.
8100 (File_read::release): Only increment counts when using --stats.
8101 Use a lock around the increment.
8102 * parameters.cc (class Set_parameters_target_once): Define.
8103 (set_parameters_target_once): New static variable.
8104 (Parameters::Parameters): Move here from parameters.h.
8105 (Parameters::set_target): Rewrite.
8106 (Parameters::set_target_once): New function.
8107 (Parameters::clear_target): Move here and rewrite.
8108 * parameters.h (class Parameters): Update declarations. Add
8109 set_parameters_target_once_ field.
8110 (Parameters::Parameters): Move to parameters.cc.
8111 (Parameters::clear_target): Likewise.
8112 * readsyms.cc (Read_symbols::do_group): Create a Start_group
8114 (Start_group::~Start_group): New function.
8115 (Start_group::is_runnable): New function.
8116 (Start_group::locks, Start_group::run): New functions.
8117 (Finish_group::run): Change saw_undefined to size_t.
8118 * readsyms.h (class Start_group): Define.
8119 (class Finish_group): Change saw_undefined_ field to size_t.
8120 (Finish_group::Finish_group): Remove saw_undefined and
8121 this_blocker parameters. Change all callers.
8122 (Finish_group::set_saw_undefined): New function.
8123 (Finish_group::set_blocker): New function.
8124 * symtab.h (class Symbol_table): Change saw_undefined to return
8125 size_t. Change saw_undefined_ field to size_t.
8126 * target-select.cc (Set_target_once::do_run_once): New function.
8127 (Target_selector::Target_selector): Initialize set_target_once_
8128 field. Don't initialize lock_ and initialize_lock_ fields.
8129 (Target_selector::instantiate_target): Rewrite.
8130 (Target_selector::set_target): New function.
8131 * target-select.h (class Set_target_once): Define.
8132 (class Target_selector): Update declarations. Make
8133 Set_target_once a friend. Remove lock_ and initialize_lock_
8134 fields. Add set_target_once_ field.
8136 2010-02-10 Ian Lance Taylor <iant@google.com>
8138 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
8140 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
8141 (queue_middle_tasks): Add all blockers before queueing any tasks.
8142 (queue_final_tasks): Likewise.
8143 * token.h (Task_token::add_blockers): New function.
8144 * object.h (Input_objects::number_of_relobjs): New function.
8146 2010-02-10 Ian Lance Taylor <iant@google.com>
8148 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
8149 shared, not if not position independent.
8150 * x86_64.cc (Relocate::relocate_tls): Likewise.
8151 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
8152 (tls_pie_pic_test): New target.
8153 * testsuite/Makefile.in: Rebuild.
8155 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
8156 (tls_test_main_pie.o, tls_test_pie.o): New targets.
8157 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
8158 * testsuite/Makefile.in: Rebuild.
8160 2010-02-09 David S. Miller <davem@davemloft.net>
8162 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
8163 R_SPARC_RELATIVE using ->add_local_relative().
8164 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
8166 * output.h (Output_data_dynamic::add_section_size): New method
8167 that takes two Output_data objects.
8168 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
8169 entry param. Handle it in initializers.
8170 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
8171 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
8172 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
8174 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
8175 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
8176 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
8177 for dynrel_includes_plt.
8178 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8179 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8180 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
8182 (Target_sparc::do_finalize_sections): Update to pass true for
8183 dynrel_includes_plt.
8184 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
8185 output before .rela.plt
8186 (Target_powerpc::do_finalize_sections): Update to pass true for
8187 dynrel_includes_plt when 32-bit.
8189 2010-02-08 Doug Kwan <dougkwan@google.com>
8191 * arm.cc (Arm_relobj::simple_input_section_output_address): New
8193 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
8194 Arm_relobj::scan_section_for_cortex_a8_stubs,
8195 Arm_relobj::do_relocation_section): Instead of calling
8196 Output_section::output_address, use faster
8197 Arm_relobj::simple_input_section_output_address.
8199 2010-02-08 David S. Miller <davem@davemloft.net>
8201 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
8202 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
8203 relocation helper function.
8205 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
8206 just like R_SPARC_GOT{10,13,22}.
8207 (Target_sparc::Scan::local): Likewise.
8208 (Target_sparc::Relocate:relocate): Likewise.
8210 2010-02-06 Ian Lance Taylor <iant@google.com>
8212 * configure.ac: Rewrite targetobjs duplicate removal code to use
8213 only shell constructs.
8214 * configure: Rebuild.
8216 2010-02-05 Doug Kwan <dougkwan@google.com>
8219 * arm.cc (Arm_relobj::section_is_scannable): New method.
8220 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
8221 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
8223 2010-02-04 Doug Kwan <dougkwan@google.com>
8226 * arm-reloc-property.cc (cstdio): Include.
8227 * configure.ac (targetobjs): Remove duplicates.
8228 * configure: Regenerate.
8229 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
8230 big and little endian version for a given address size.
8232 2010-02-03 Doug Kwan <dougkwan@google.com>
8234 * arm-reloc-property.cc
8235 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8237 * arm-reloc-property.h
8238 (Arm_reloc_property_table::get_implemented_static_reloc_property):
8239 New method definition.
8240 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8242 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
8244 (GOT_PREL): Change implemented to Y.
8245 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
8246 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
8247 (Arm_relocate_functions::movw_abs_nc): Remove method.
8248 (Arm_relocate_functions::movt_abs): Ditto.
8249 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
8250 (Arm_relocate_functions::thm_movt_abs): Ditto.
8251 (Arm_relocate_functions::movw_rel_nc): Ditto.
8252 (Arm_relocate_functions::movw_rel): Ditto.
8253 (Arm_relocate_functions::movt_rel): Ditto.
8254 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
8255 (Arm_relocate_functions:thm_movw_rel): Ditto.
8256 (Arm_relocate_functions:thm_movt_rel): Ditto.
8257 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
8258 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
8259 New method definitions.
8260 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
8261 (Arm_relocation_functions::arm_grp_ldr): Ditto.
8262 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
8263 (Arm_relocation_functions::arm_grp_ldc): Ditto.
8264 (Target_arm::Relocate::relocate): Check for non-static or
8265 unimplemented relocation code and exit early. Change calls to
8266 Target_arm::reloc_uses_thumb_bit and
8267 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
8268 instead. Refactor code to handle similar relocations to increase
8269 code sharing. Remove check for unsupported relocation code in switch
8271 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
8272 relocation property table to find out size. Change error message to
8273 print out the name of a relocation code instead of the numeric value.
8274 (Target_arm::scan_reloc_for_stub): Use relocation property table
8275 instead of calling Target_arm::reloc_uses_thumb_bit().
8277 2010-02-02 Doug Kwan <dougkwan@google.com>
8279 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
8280 types of relaxed input section.
8282 2010-02-02 Doug Kwan <dougkwan@google.com>
8284 * Makefile.am (HFILES): Add arm-reloc-property.h.
8286 (TARGETSOURCES): Add arm-reloc-property.cc
8287 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
8288 (libgold_a_SOURCES): $(DEFFILES)
8289 * Makefile.in: Regenerate.
8290 * arm-reloc-property.cc: New file.
8291 * arm-reloc-property.h: New file.
8292 * arm-reloc.def: New file.
8293 * arm.cc: Update comments.
8294 (arm-reloc-property.h): New included header.
8295 (arm_reloc_property_table): New global variable.
8296 (Target_arm::do_select_as_default_target): New method definition.
8297 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
8298 arm-reloc-property to targ_extra_obj.
8299 * parameters.cc (set_parameters_target): Call
8300 Target::select_as_default_target().
8301 * target.h (Target::select_as_default_target): New method definition.
8302 (Target::do_select_as_default_target): Same.
8304 2010-02-01 Doug Kwan <dougkwan@google.com>
8306 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
8307 first_output_text_section_.
8308 (Arm_exidx_fixup::first_output_text_section): New method definition.
8309 (Arm_exidx_fixup::first_output_text_section_): New data member.
8310 (Arm_exidx_fixup::process_exidx_section): Record the first text
8311 output section seen.
8312 (Arm_output_section::fix_exidx_coverage): Set correct linked section
8313 and entsize in output section header.
8315 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8317 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
8318 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
8319 (Arm_relocate_functions::thm_alu11): New Method.
8320 (Arm_relocate_functions::thm_pc8): New Method.
8321 (Arm_relocate_functions::thm_pc12): New Method.
8322 (Target_arm::Scan::local): Handle the relocations.
8323 (Target_arm::Scan::global): Likewise.
8324 (Target_arm::Relocate::relocate): Likewise.
8325 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8327 2010-01-29 Doug Kwan <dougkwan@google.com>
8329 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
8330 of relocation types as ld.
8332 2010-01-29 Doug Kwan <dougkwan@google.com>
8334 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
8336 (Arm_relocate_functions::thumb_branch_common): Ditto.
8337 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
8338 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
8339 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
8340 Arm_relocate_functions::jump24): Remove.
8341 (Target_arm::Relocate::relocate): Adjust code to call
8342 Arm_relocation_functions::arm_branch_common and
8343 Arm_relocation_functions::thumb_branch_common instead of their removed
8344 wrappers. Merge switch-cases together to reduce source code size.
8346 2010-01-29 Doug Kwan <dougkwan@google.com>
8348 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
8349 output_local_symbol_count_needs_update_.
8350 (Arm_relobj::output_local_symbol_count_needs_update,
8351 Arm_relobj::set_output_local_symbol_count_needs_update,
8352 Arm_relobj::update_output_local_symbol_count): New methods.
8353 (Arm_relobj::output_local_symbol_count_needs_update_): New data
8355 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
8356 of pointed function as in a R_ARM_PREL31 relocation.
8357 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
8358 for output local symbol count updating.
8359 (Target_arm::do_relax): Update output local symbol counts in objects
8361 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
8363 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8365 * arm.cc: Added support for the ARM relocations:
8366 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
8367 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
8368 (Arm_relocate_functions::movw_rel_nc): Renamed (was
8370 (Arm_relocate_functions::movw_rel): New method.
8371 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
8372 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
8374 (Arm_relocate_functions::thm_movw_rel): New method.
8375 (Arm_relocate_functions::thm_movt_rel): Renamed (was
8377 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
8379 (Target_arm::Scan::global): Likewise.
8380 (Target_arm::Relocate::relocate): Likewise.
8381 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8384 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8386 * arm.cc: Added support for ARM group relocations.
8387 (Target_arm::reloc_needs_sym_origin): New method.
8388 (Arm_relocate_functions::calc_grp_kn): New method.
8389 (Arm_relocate_functions::calc_grp_residual): New method.
8390 (Arm_relocate_functions::calc_grp_gn): New method.
8391 (Arm_relocate_functions::arm_grp_alu): New Method.
8392 (Arm_relocate_functions::arm_grp_ldr): New Method.
8393 (Arm_relocate_functions::arm_grp_ldrs): New Method.
8394 (Arm_relocate_functions::arm_grp_ldc): New Method.
8395 (Target_arm::Scan::local): Handle the ARM group relocations.
8396 (Target_arm::Scan::global): Likewise.
8397 (Target_arm::Relocate::relocate): Likewise.
8398 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8401 2010-01-26 Doug Kwan <dougkwan@google.com>
8403 * arm.cc (set): Include.
8404 (class Arm_exidx_fixup): Change type of last_input_section_ to const
8406 (Arm_output_section::Text_section_list): New type.
8407 (Arm_output_section::append_text_sections_to_list): New method.
8408 (Arm_output_section::fix_exidx_coverage): Ditto.
8409 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
8410 (Arm_relobj::convert_input_section_to_relaxed_section): Use
8411 Relobj::set_section_offset() instead of
8412 Sized_relobj::invalidate_section_offset().
8413 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
8414 parameter for section headers. Ignore relocation sections for
8415 unallocated sections and EXIDX sections.
8416 (Target_arm::fix_exidx_coverage): New method.
8417 (Target_arm::output_section_address_less_than): New type.
8418 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
8419 linked text section instead of the EXIDX section.
8420 (Arm_output_section::create_stub_group): Add an assertion to check
8421 that this is not an EXIDX output section.
8422 (Arm_output_section::append_text_sections_to_list): New method.
8423 (Arm_output_section::fix_exidx_coverage): Ditto.
8424 (Arm_relobj::scan_sections_for_stubs): Adjust call to
8425 Arm_relobj::section_needs_reloc_stub_scanning.
8426 (Target_arm::do_relax): Fix EXIDX output section coverage in the
8428 (Target_arm::fix_exidx_coverage): New method.
8429 * object.h (Relobj::set_output_section): New method.
8430 (Sized_relobj::invalidate_section_offset): Remove method.
8431 (Sized_relobj::do_invalidate_section_offset): Remove method.
8432 (Sized_relobj::do_set_section_offset): Handle offset value -1.
8434 2010-01-25 Doug Kwan <dougkwan@google.com>
8436 * arm.cc (Arm_exidx_merged_section::do_output_offset):
8437 Fix warning due to signed and unsigned comparison on a 32-bit host.
8439 2010-01-22 Doug Kwan <dougkwan@google.com>
8441 * arm.cc (Target_arm::do_relax): Record an output section for section
8442 offset adjustment it contains any stub table that has changed.
8443 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
8444 offsets in an output section if necessary.
8445 * output.cc (Output_section::Output_section): Initialize
8446 section_offsets_need_adjustments_.
8447 (Output_section::add_input_section_for_script): Renamed to
8448 Output_section::add_simple_input_section.
8449 (Output_section::save_states): Add a comment.
8450 (Output_section::discard_states): New method defintion.
8451 (Output_section::adjust_section_offsets): Same.
8452 * output.h (Output_section::add_input_section_for_script): Renamed to
8453 Output_section::add_simple_input_section.
8454 (Output_section::discard_states): New method declaration.
8455 (Output_section::adjust_section_offsets): Same.
8456 (Output_section::section_offsets_need_adjustment,
8457 Output_section::set_section_offsets_need_adjustment): New method
8459 (Output_section::section_offsets_need_adjustment_): New data member.
8460 * script-sections.cc
8461 (Output_section_element_input::set_section_address): Adjust code for
8462 renaming of Output_section::add_input_section_for_script.
8463 (Orphan_output_section::set_section_address): Same.
8465 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8467 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
8468 Fix_v4bx enum values .
8469 * gold/options.h (General_options): New option definitions.
8470 (General_options::fix_v4bx): New method.
8471 (General_options::Fix_v4bx): New enum.
8472 * gold/options.cc (General_options::parse_fix_v4bx): New method.
8473 (General_options::parse_fix_v4bx_interworking): New method.
8475 2010-01-22 Doug Kwan <dougkwan@google.com>
8477 * arm.cc (Arm_exidx_fixup): New class.
8479 2010-01-21 Doug Kwan <dougkwan@google.com>
8481 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
8483 (Arm_exidx_section_offset_map): New type.
8485 2010-01-21 Doug Kwan <dougkwan@google.com>
8487 * arm.cc (Arm_exidx_input_section): New class.
8488 (Arm_relobj::exidx_input_section_by_link,
8489 Arm_relobj::exidx_input_section_by_shndx,
8490 Arm_relobj::make_exidx_input_section): New methods.
8491 (read_arm_attributes_section): Remove.
8492 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
8493 information about them.
8494 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
8497 2010-01-20 Doug Kwan <dougkwan@google.com>
8499 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
8500 Input_section_specifier to Section_id.
8501 (Target_arm::new_arm_input_section: Adjust code for change of key
8503 (Target_arm::find_arm_input_section): Ditto.
8504 * gc.h (object.h): Include for Section_id nand Section_id_hash.
8505 (Section_id): Remove.
8506 (Garbage_collection::Section_id_hash): Remove.
8507 * icf.h (object.h): Include for Section_id nand Section_id_hash.
8508 (Section_id): Remove.
8509 (Icf::Section_id_hash): Remove.
8510 * object.h (Section_id, Const_section_id, Section_id_hash,
8511 Const_section_id_hash): New type definitions.
8512 * output.cc (Output_section::add_relaxed_input_section): Change to
8513 use Const_section_id instead of Input_section_specifier as key type.
8514 (Output_section::add_merge_input_section): Ditto.
8515 (Output_section::build_relaxation_map): Change to use Section_id
8516 instead of Input_section_specifier as key type.
8517 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8519 (Output_section::convert_input_sections_to_relaxed_sections): Change
8520 to use Const_section_id instead of Input_section_specifier as key type.
8521 (Output_section::find_merge_section): Ditto.
8522 (Output_section::find_relaxed_input_section): Ditto.
8523 * output.h (Input_section_specifier): Remove class.
8524 (Output_section::Output_section_data_by_input_section_map): Change
8525 key type to Const_section_id.
8526 (Output_section::Output_relaxed_input_section_by_input_section_map):
8528 (Output_section::Relaxation_map): Change key type to Section_id.
8530 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8532 * gold/arm.cc: Added support for R_ARM_V4BX relocation
8533 (class Arm_v4bx_stub): New class.
8534 (DEF_STUBS): Updated definition to support v4_veneer_bx.
8535 (Stub_factory::make_arm_v4bx_stub): New method.
8536 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
8537 (Stub_table::empty): Handle v4bx stubs.
8538 (Stub_table::add_arm_v4bx_stub): New method.
8539 (Stub_table::find_arm_v4bx_stub): New method.
8540 (Arm_relocate_functions::v4bx): New method.
8541 (Target_arm::fix_v4bx): New method.
8542 (Target_arm::Target_arm): Handle R_ARM_V4BX.
8543 (Stub_table::relocate_stubs): Likewise.
8544 (Stub_table::do_write): Likewise.
8545 (Stub_table::update_data_size_and_addralign): Likewise.
8546 (Stub_table::finalize_stubs): Likewise.
8547 (Target_arm::Scan::local): Likewise.
8548 (Target_arm::Scan::global): Likewise.
8549 (Target_arm::do_finalize_sections): Likewise.
8550 (Target_arm::Relocate::relocate): Likewise.
8551 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8553 (Target_arm::scan_reloc_for_stub): Likewise.
8554 (Target_arm::scan_reloc_section_for_stubs): Likewise.
8556 2010-01-19 Ian Lance Taylor <iant@google.com>
8558 * output.cc (Output_section_headers::do_sized_write): Write large
8559 segment count to sh_info field.
8560 (Output_file_header::do_sized_write): For large segment count,
8561 write PN_XNUM to e_phnum field.
8563 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8565 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
8566 (Arm_relocate_functions::thm_jump8): New function.
8567 (Arm_relocate_functions::thm_jump11): New function.
8568 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
8570 (Target_arm::Scan::global): Likewise.
8571 (Target_arm::Relocate::relocate): Likewise.
8572 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8575 2010-01-14 Doug Kwan <dougkwan@google.com>
8577 * arm.cc (map, utility): Include headers.
8578 (Target_arm::apply_cortex_a8_workaround): New method.
8579 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
8580 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
8581 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
8582 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
8583 the --[no-]fix-cortex-a8 command line options.
8584 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
8585 (Target_arm::relocate_stub): Use addend in instruction template.
8586 * options.h (DEFINE_bool): Set the user-set flag.
8587 (General_options): Add --[no-]-fix-cortex options.
8588 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
8589 : Update fast look-up map after conversion.
8591 2010-01-14 Sriraman Tallam <tmsriram@google.com>
8593 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
8594 in the first pass of do_layout.
8596 2010-01-13 Doug Kwan <dougkwan@google.com>
8598 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8599 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
8600 apparent compiler problem of not folding static constant integral
8601 data members of elfcpp::Elf_sizes<32>.
8603 2010-01-13 Doug Kwan <dougkwan@google.com>
8605 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8606 Arm_relobj::section_needs_cortex_a8_stub_scanning,
8607 Arm_relobj::scan_section_for_cortex_a8_erratum,
8608 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
8609 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
8610 sections to scan for relocation stubs into a new method
8611 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
8612 relocation and Cortex-A8 stub scanning.
8613 (Target_arm::do_relax): Force stubs to be after stubbed sections
8614 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
8615 the beginning of a new relaxation pass. Update a comment.
8616 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
8618 2010-01-12 Ian Lance Taylor <iant@google.com>
8620 * target-reloc.h (visibility_error): New inline function.
8621 (relocate_section): Call visibility_error.
8622 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
8623 (MOSTLYCLEANFILES): Likewise.
8624 (protected_4_pic.o, protected_3.err): New targets.
8625 * testsuite/protected_4.cc: New file.
8627 2010-01-12 Doug Kwan <dougkwan@google.com>
8629 * arm.cc (Cortex_a8_reloc): New class.
8630 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
8631 and cortex_a8_relocs_info_.
8632 (Target_arm::fix_cortex_a8): New method definition.
8633 (Target_arm::Cortex_a8_relocs_info): New type.
8634 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
8635 New data member declarations.
8636 (Target_arm::scan_reloc_for_stub): Record information about
8637 relocations for THUMB branches that might be exempted from the
8638 Cortex-A8 workaround.
8639 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
8640 at the beginning of a relaxation pass.
8642 2010-01-12 Doug Kwan <dougkwan@google.com>
8644 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
8645 (Arm_relobj::Mapping_symbol_position,
8646 Arm_reloj::Mapping_symbol_position_less,
8647 Arm_relobj::Mapping_symbols_info): New types.
8648 (Target_arm::is_mapping_symbol_name): New method definition.
8649 (Arm_relobj::do_count_local_symbols): Save information about mapping
8652 2010-01-11 Doug Kwan <dougkwan@google.com>
8654 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
8655 Arm_relocate_functions::thumb32_branch_upper,
8656 Arm_relocate_functions::thumb32_branch_lower,
8657 Arm_relocate_functions::thumb32_cond_branch_offset,
8658 Arm_relocate_functions::thumb32_cond_branch_upper,
8659 Arm_relocate_functions::thumb32_cond_branch_lower,
8660 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
8661 branch offset encoding.
8662 (Arm_relocate_functions::thumb_branch_common): Use new branch
8663 offset encoding methods to avoid code duplication.
8664 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
8665 (Stub_addend_reader::operator()): Use new branch encoding method
8666 to avoid code duplication.
8668 2010-01-11 Doug Kwan <dougkwan@google.com>
8670 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
8671 (Target_arm::do_finalize_sections): Define special EXIDX section
8672 symbols only if referenced.
8673 * gc.h (Garbage_collection::add_reference): New method.
8674 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
8677 2010-01-11 Ian Lance Taylor <iant@google.com>
8679 * script.cc (Version_script_info::build_expression_list_lookup):
8680 Change complaing about duplicate wildcard match from error to
8683 * script.cc (class Lazy_demangler): Recreate--revert part of patch
8685 (Version_script_info::Version_script_info): Initialize globs_,
8686 default_version_, default_is_global_, and exact_. Don't
8687 initialize globals_ or locals_.
8688 (Version_script_info::build_lookup_tables): Build local symbols
8690 (Version_script_info::unquote): New function.
8691 (Version_script_info::add_exact_match): New function.
8692 (Version_script_info::build_expression_list_lookup): Remove lookup
8693 parameter. Add is_global parameter. Change all callers. Handle
8694 wildcard pattern specially. Unquote pattern. Call
8696 (Version_script_info::get_name_to_match): New function.
8697 (Version_script_info::get_symbol_version): New function.
8698 (Version_script_info::get_symbol_version_helper): Remove.
8699 (Version_script_info::check_unmatched_names): Call unquote.
8700 * script.h (class Version_script_info): Change get_symbol_version
8701 to be non-inline and add is_global parameter; change all callers.
8702 Rewrite symbol_is_local. Update declarations. Define struct
8703 Version_tree_match, Exact, Globs. Don't define struct Lookup.
8704 Remove globals_ and locals_ members. Add exact_, globs_,
8705 default_version_, is_global_.
8706 (Version_script_info::Glob): Remove pattern, add expression and
8707 is_global. Update constructor. Change all callers.
8708 * dynobj.cc (Versions::finalize): Mark the version symbol as the
8710 (Versions::symbol_section_contents): If a symbol is undefined, or
8711 defined in a dynamic object, set the version index to
8713 * symtab.cc (Symbol_table::add_from_relobj): Don't call
8715 (Symbol_table::add_from_pluginobj): Likewise.
8716 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
8718 2010-01-11 Doug Kwan <dougkwan@google.com>
8720 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
8721 (incremental_dump_LDADD): Add linking option for libintl.
8722 * Makefile.in: Regenerate.
8724 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
8727 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
8729 * testsuite/Makefile.in: Regenerated.
8731 2010-01-10 Doug Kwan <dougkwan@google.com>
8733 * options.h (DEFINE_var): Use parentheses around argument varname__
8734 in macro body to avoid any unintended subsequent substitutions.
8736 2010-01-10 Ian Lance Taylor <iant@google.com>
8738 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
8739 candidates before doing symbol resolution.
8741 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
8742 ODR candidates if only one is weak.
8744 2010-01-08 Ian Lance Taylor <iant@google.com>
8746 * script.cc (Version_script_info::build_expression_list_lookup):
8747 Don't warn about ambiguous version, just record the ambiguity.
8748 (Version_script_info::get_symbol_version_helper): Give error if
8749 version is ambiguous.
8751 2010-01-08 Doug Kwan <dougkwan@google.com>
8753 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
8754 prev_data_size_ and prev_addralign_. Remove initializer for
8755 deleted data member has_been_changed_.
8756 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
8757 to determine if the table is empty.
8758 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
8760 (Stub_table::add_reloc_stub): Define method in class definition
8761 instead of just declaring it there.
8762 (Stub_table::add_cortex_a8_stub): New method definition.
8763 (Stub_table::update_data_size_and_addralign): Ditto.
8764 (Stub_table::finalize_stubs): Ditto.
8765 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
8766 (Stub_table::do_addralign_): Return address alignment in the
8767 (Stub_table::do_reset_address_and_file_offset): Define method in
8768 class definition instead of declaring it there. Set current data
8769 size to be the data size of the previous pass.
8770 (Stub_table::set_final_data_size): Use current data size as the
8772 (Stub_table::relocate_stub): Change parameter type of stub from
8773 Reloc_stub pointer to Stub pointer.
8774 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
8775 (Stub_table::Cortex_a8_stub_list): New typedef.
8776 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
8777 Stub_table::prev_addralign_): New data member.
8778 (Arm_relobj::Arm_relobj): Initialize data member
8779 section_has_cortex_a8_workaround_.
8780 (Arm_relobj::section_has_cortex_a8_workaround,
8781 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
8783 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
8785 (Target_arm::relocate_stub): Change parameter type of stub from
8786 Reloc_stub pointer to Stub pointer.
8787 (Insn_template::size, Insn_template::alignment): Handle
8788 THUMB16_SPECIAL_TYPE.
8789 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
8790 Stub_table::update_data_size_and_addralign,
8791 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
8793 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
8794 (Stub_table::do_write): Ditto.
8795 (Target_arm::do_relax): Adjust code for changes in Stub_table.
8797 2010-01-08 Ian Lance Taylor <iant@google.com>
8800 * symtab.h (class Symbol): Remove fields is_target_special_ and
8801 has_plt_offset_. Add field is_defined_in_discarded_section_.
8802 (Symbol::is_defined_in_discarded_section): New function.
8803 (Symbol::set_is_defined_in_discarded_section): New function.
8804 (Symbol::has_plt_offset): Rewrite.
8805 (Symbol::set_plt_offset): Verify that new offset is not -1U.
8806 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
8807 Don't initialize is_target_special_ or has_plt_offset_.
8808 Initialize is_defined_in_discarded_section_.
8809 (Symbol_table::add_from_relobj): If appropriate, set
8810 is_defined_in_discarded_section.
8811 * resolve.cc (Symbol::override_base_with_special): Don't test
8812 is_target_special_. Change has_plt_offset_ to has_plt_offset().
8813 * target-reloc.h (relocate_section): Do special handling for
8814 symbols defined in discarded sections for global symbols as well
8817 2010-01-08 Ian Lance Taylor <iant@google.com>
8819 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
8820 the SHT_SYMTAB case.
8822 2010-01-08 Ian Lance Taylor <iant@google.com>
8824 * object.cc (Sized_relobj::do_layout): Don't get confused if
8825 layout_eh_frame returns NULL.
8827 2010-01-08 Ian Lance Taylor <iant@google.com>
8830 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
8831 dynamic symbol table, use the normal symbol table.
8832 (Sized_dynobj::do_read_symbols): Remove assertion about type of
8835 2010-01-08 Ian Lance Taylor <iant@google.com>
8838 * layout.cc (Layout::include_section): Remove .gnu_debuglink
8841 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
8843 * version.cc (print_version): Change to "Copyright 2010".
8845 2010-01-08 Ian Lance Taylor <iant@google.com>
8849 * i386.cc (class Target_i386): Change return type of plt_section
8851 (class Output_data_plt_i386): Add tls_desc_rel_ field.
8852 (Output_data_plt_i386::Output_data_plt_i386): Initialize
8853 tls_desc_rel_ field.
8854 (Output_data_plt_i386::rel_tls_desc): New function.
8855 (Target_i386::rel_tls_desc_section): New function.
8856 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
8857 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
8858 R_386_TLS_DESC reloc in rel_tls_desc_section.
8859 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
8860 Define struct Tlsdesc_info.
8861 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
8862 (Target_x86_64::do_reloc_symbol_index): New function.
8863 (Target_x86_64::add_tlsdesc_info): New function.
8864 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
8865 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
8867 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
8869 (Output_data_plt_x86_64::rela_tlsdesc): New function.
8870 (Target_x86_64::rela_tlsdesc_section): New function.
8871 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
8873 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
8874 (Target_x86_64::do_reloc_addend): New function.
8875 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
8876 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
8877 declarations. Define TARGET_CODE. Add arg field to u1_ union.
8878 (Output_reloc::type): New function.
8879 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
8880 (Output_reloc::is_target_specific): New function.
8881 (Output_reloc::target_arg): New function.
8882 (class Output_reloc) [SHT_RELA]: Add four new constructors for
8883 absolute relocs and target specific relocs.
8884 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
8885 add_target_specific.
8886 (class Output_data_reloc) [SHT_RELA]: Likewise.
8887 * output.cc (Output_reloc::Output_reloc): Add four new versions
8888 for absolute relocs and target specific relocs.
8889 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
8890 (Output_reloc::get_symbol_index): Likewise.
8891 (Output_reloc::local_section_offset): Check that local_sym_index_
8892 is not TARGET_CODE or 0.
8893 (Output_reloc::symbol_value): Likewise.
8894 (Output_reloc::write) [SHT_RELA]: Call target for target specific
8896 * target.h (class Target): Add reloc_symbol_index and reloc_addend
8897 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
8899 * layout.cc (add_target_dynamic_tags): Use output section for
8900 DT_PLTRELSZ and DT_JMPREL.
8902 2010-01-07 Ian Lance Taylor <iant@google.com>
8905 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
8907 (class Output_data_reloc_generic): Define.
8908 (class Output_data_reloc_base): Change base class to
8909 Output_data_reloc_generic. Change add() method to call
8910 bump_relative_reloc_count for a relative reloc. Remove
8912 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
8914 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
8915 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
8917 * layout.h (class Layout): Update declaration.
8919 2010-01-07 Ian Lance Taylor <iant@google.com>
8921 * output.h (class Output_data): Add const version of
8922 output_section and do_output_section.
8923 (class Output_section_data): Add const version of
8925 (class Output_section): Likewise.
8926 * layout.cc (Layout::add_target_dynamic_tags): New function.
8927 * layout.h (class Layout): Update declarations.
8928 * arm.cc (Target_arm::do_finalize_sections): Use
8929 add_target_dynamic_tags.
8930 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8931 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8932 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8933 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8935 2010-01-07 Ian Lance Taylor <iant@google.com>
8938 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
8941 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
8942 Ian Lance Taylor <iant@google.com>
8945 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
8946 Xindex::read_symtab_xindex.
8948 2010-01-07 Doug Kwan <dougkwan@google.com>
8950 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
8951 (Insn_template::thumb16_bcond_insn): New method declaration.
8952 (Insn_template): Fix spelling.
8953 (Stub::thumb16_special): New method declaration.
8954 (Stub::do_write): Define virtual method which was previously pure
8956 (Stub::do_thumb16_special): New method declaration.
8957 (Stub::do_fixed_endian_write): New template member.
8958 (Reloc_stub::do_write): Remove.
8959 (Reloc_stub::do_fixed_endian_write): Remove.
8960 (Cortex_a8_stub): New class definition.
8961 (Stub_factory::make_cortex_a8_stub): New method definition.
8962 (Stub_factory::Stub_factory): Add missing static storage class
8963 qualifier for elf32_arm_stub_a8_veneer_blx.
8965 2010-01-07 Ian Lance Taylor <iant@google.com>
8968 * options.h (class General_options): Add --warn-unresolved-symbols
8969 and --error-unresolved-symbols.
8970 * errors.cc (Errors::undefined_symbol): Implement
8971 --warn-unresolved-symbols.
8973 * options.h (class General_options): Add -z text and -z textoff.
8974 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
8976 2010-01-06 Sriraman Tallam <tmsriram@google.com>
8978 * gc.h (Garbage_collection::Cident_section_map): New typedef.
8979 (Garbage_collection::cident_sections): New function.
8980 (Garbage_collection::add_cident_section): New function.
8981 (Garbage_collection::cident_sections_): New member.
8982 (gc_process_relocs): Add references to sections whose names are C
8984 * gold.h (cident_section_start_prefix): New constant.
8985 (cident_section_stop_prefix): New constant.
8986 (is_cident): New function.
8987 * layout.cc (Layout::define_section_symbols): Replace string constants
8988 with the newly defined constants.
8989 * object.cc (Sized_relobj::do_layout): Track sections whose names are
8991 * testsuite/Makefile.am: Add gc_orphan_section_test.
8992 * testsuite/Makefile.in: Regenerate.
8993 * testsuite/gc_orphan_section_test.cc: New file.
8994 * testsuite/gc_orphan_section_test.sh: New file.
8996 2010-01-06 Ian Lance Taylor <iant@google.com>
8999 * options.h (class General_options): Add --warn-shared-textrel.
9000 * layout.cc (Layout::finish_dynamic_section): Implement
9001 --warn-shared-textrel.
9004 * options.h (class General_options): Add --warn-multiple-gp.
9006 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9008 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
9009 $(THREADSLIB) and $(LIBDL).
9010 * Makefile.in: Rebuild.
9012 2010-01-06 Ian Lance Taylor <iant@google.com>
9015 * options.cc (General_options::parse_section_start): New function.
9016 (General_options::section_start): New function.
9017 (General_options::General_options): Initialize all members.
9018 * options.h: Include <map>
9019 (class General_options): Add --section-start. Add section_starts_
9021 * layout.cc (Layout::attach_allocated_section_to_segment): If
9022 --section-start was used, set the address of the segment. Remove
9023 local sort_sections.
9024 (Layout::relaxation_loop_body): If the address of the load segment
9025 has been set by --section-start, don't use it.
9026 * output.h (Output_segment::update_flags_for_output_section): New
9028 * output.cc (Output_segment::add_output_section): Call
9029 update_flags_for_output_section.
9031 2010-01-05 Ian Lance Taylor <iant@google.com>
9034 * options.h (class General_options): Add --undefined-version.
9035 * script.cc (struct Version_expression): Add was_matched_by_symbol
9037 (Version_script_info::matched_symbol): New function.
9038 (Version_script_info::get_symbol_version_helper): Call
9040 (Version_script_info::check_unmatched_names): New function.
9041 * script.h (class Version_script_info): Update declarations.
9042 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
9044 * options.h (class General_options): Use DEFINE_bool_alias for
9045 allow_multiple_definition.
9046 * resolve.cc (Symbol_table::should_override): Don't test
9047 allow_multiple_definition.
9050 * options.h (class General_options): Add --cref.
9051 * main.cc (main): Print cref table if --cref. Don't close mapfile
9052 until after printing cref table.
9053 * cref.cc: Include "symtab.h".
9054 (class Cref_inputs): Define Cref_table_compare and Cref_table.
9055 (Cref_table_compare::operator()): New function.
9056 (Cref_inputs::gather_cref): New function.
9057 (filecol): New static const.
9058 (Cref_inputs::print_cref): New function.
9059 (Cref::print_cref): New function.
9060 * cref.h: Include <cstdio>.
9061 (class Cref): Update declarations.
9062 * mapfile.h (Mapfile::file): New function.
9063 * object.h (class Object): Define Symbols. Declare virtual
9064 do_get_global_symbols.
9065 (Object::get_global_symbols): New function.
9066 * object.cc (Input_objects::add_object): Pass object to cref_ if
9068 (Input_objects::archive_start): Likewise.
9069 (Input_objects::archive_stop): Likewise.
9070 (Input_objects::print_cref): New function.
9071 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
9072 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
9074 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
9076 * plugin.h (class Sized_pluginobj): Update declarations.
9078 2010-01-05 Ian Lance Taylor <iant@google.com>
9080 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
9081 to is_default_version. Rename insdef to insdefault.
9082 (Symbol_table::add_from_relobj): Rename def to is_default_version
9083 and local to is_forced_local.
9084 (Symbol_table::add_from_pluginobj): Likewise.
9085 (Symbol_table::add_from_dynobj): Likewise.
9086 (Symbol_table::define_special_symbol): Rename insdef to
9089 2010-01-04 Ian Lance Taylor <iant@google.com>
9092 * options.h (class General_options): Add
9093 --allow-multiple-definition and -z muldefs.
9094 * resolve.cc (Symbol_table::should_override): Don't warn about a
9095 multiple symbol definition if --allow-multiple-definition or -z
9099 * options.h (class General_options): Add --add-needed and
9100 --copy-dt-needed-entries. Tweak --as-needed help entry.
9101 * object.cc (Input_objects::check_dynamic_dependencies): Give an
9102 error if --copy-dt-needed-entries aka --add-needed is used and
9103 would cause a change in behaviour.
9106 * options.h (class General_options): Add -G as a short version of
9107 --shared. Add no-op options -assert, -g, and -i.
9109 2010-01-04 Sriraman Tallam <tmsriram@google.com>
9111 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
9112 check for .text or .gnu.linkonce.t sections.
9113 * icf.cc (Icf::find_identical_sections): Ditto.
9114 Change the detection for mangled function name within the section
9116 * icf.h (is_section_foldable_candidate): New function.
9118 2009-12-30 Ian Lance Taylor <iant@google.com>
9121 * options.h (class General_options): Permit two dashes with
9122 --retain-symbols-file.
9124 2009-12-30 Ian Lance Taylor <iant@google.com>
9127 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
9128 don't put the file header and segment headers in the text
9132 * common.cc (Sort_commons::operator()): Stabilize sort when both
9134 (Symbol_table::do_allocate_commons_list): When allocating common
9135 symbols, skip a symbol which is no longer common.
9136 * symtab.h (Symbol::is_common): Test whether the symbol comes from
9137 an object before checking its type.
9138 * testsuite/common_test_2.c: New file.
9139 * testsuite/common_test_3.c: New file.
9140 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
9141 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
9142 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
9143 (common_test_2_pic.o, common_test_2.so): New targets.
9144 (common_test_3_pic.o, common_test_3.so): New targets.
9145 * testsuite/Makefile.in: Rebuild.
9148 * script.cc (read_input_script): If we see a new SECTIONS clause,
9149 and we have added an input section, give an error.
9150 * layout.h (class Layout): Add have_added_input_section function.
9151 Add have_added_input_section_ field.
9152 * layout.cc (Layout::Layout): Initialize
9153 have_added_input_section_.
9154 (Layout::layout): Set have_added_input_section_.
9155 (Layout::layout_eh_frame): Likewise.
9157 2009-12-30 Ian Lance Taylor <iant@google.com>
9160 * options.h (class General_options): Add --sort-common option.
9161 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
9162 * common.cc (Sort_common): Add sort_order parameter to
9163 constructor. Add sort_order_ field.
9164 (Sort_commons::operator): Check sort_order_.
9165 (Symbol_table::allocate_commons): Determine the sort order.
9166 (Symbol_table::do_allocate_commons): Add sort_order parameter.
9168 (Symbol_table::do_allocate_commons_list): Likewise.
9170 2009-12-30 Ian Lance Taylor <iant@google.com>
9173 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
9174 symbols from this object, don't change the visibility of an
9176 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
9178 2009-12-30 Ian Lance Taylor <iant@google.com>
9181 * script.h (class Version_script_info): Define Language enum.
9182 Update declarations. Define Glob, Exact, and Lookup types. Add
9183 new fields globals_, locals_, and is_finalized_.
9184 * script.cc: Various formatting fixes.
9185 (class Parser_closure): Change language_stack_ from a vector of
9186 std::string to one of Version_script_info::Language. Adjust all
9188 (class Lazy_demangler): Remove.
9189 (struct Version_expression): Change language from std::string to
9190 Version_script_info::Language.
9191 (Version_script_info::Version_script_info): New function.
9192 (Version_script_info::~Version_script_info): Don't call clear.
9193 (Version_script_info::finalize): New function.
9194 (Version_script_info::build_lookup_tables): New function.
9195 (Version_script_info::build_expression_list_lookup): New
9197 (Version_script_info::get_symbol_version_helper): Rewrite to use
9199 (Version_script_info::print_expression_list): Adjust to use
9200 Version_script_info::Language.
9201 (script_push_lex_into_version_mode): Check that the version script
9202 has not been finalized.
9203 (version_script_push_lang): Change language string to
9204 Version_script_info::Language.
9205 * options.cc (Command_line::version_script): New function.
9206 * options.h (class General_options): Add finalize_dynamic_list
9207 function. Change version_script from declaration to definition.
9208 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
9209 * testsuite/version_script.map: Remove duplicate def of foo.
9210 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
9212 * testsuite/Makefile.in: Rebuild.
9214 2009-12-30 Ian Lance Taylor <iant@google.com>
9217 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
9218 if the input symbol index is 0, make the output symbol index 0.
9220 2009-12-30 Ian Lance Taylor <iant@google.com>
9223 * options.h (class General_options): Add -x/--discard-all.
9224 * object.cc (Sized_relobj::do_count_local_symbols): Handle
9225 --discard-all. If the local symbol needs a dynamic entry, check
9226 that before handling --discard-locals.
9228 2009-12-30 Ian Lance Taylor <iant@google.com>
9231 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
9233 (Output_segment::add_output_section): Don't change the flags if
9237 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
9238 GNU hash table if they need a dynamic value. Otherwise, don't add
9239 them if they are defined in a dynamic object or are forced local.
9241 2009-12-29 Ian Lance Taylor <iant@google.com>
9244 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
9245 .gnu.hash table for a 32-bit target.
9248 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
9249 regular and a dynamic object only needs a dynamic symbol table
9250 entry if it is externally visible.
9253 * i386.cc (class Target_i386): Initialize global_offset_table_ in
9254 constructor. Add global_offset_table_ field.
9255 (Target_i386::got_section): Set global_offset_table_.
9256 (Target_i386::do_finalize_sections): Set global_offset_table_
9258 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
9259 in constructor. Add global_offset_table_ field.
9260 (Target_x86_64::got_section): Set global_offset_table_.
9261 (Target_x86_64::do_finalize_sections): Set global_offset_table_
9264 * layout.cc (Layout::Layout): Initialize increase_relro_.
9265 (Layout::get_output_section): Add is_relro, is_last_relro, and
9266 is_first_non_relro parameters. Change all callers.
9267 (Layout::choose_output_section): Likewise.
9268 (Layout::add_output_section_data): Likewise.
9269 (Layout::make_output_section): Likewise.
9270 (Layout::set_segment_offsets): Clear increase_relro when using a
9272 * layout.h (class Layout): Add increase_relro method. Add
9273 increase_relro_ field. Update declarations.
9274 * output.cc (Output_section::Output_section): Initialize
9275 is_last_relro_ and is_first_non_relro_.
9276 (Output_segment::add_output_section): Group relro sections is
9277 do_sort is true. Handle is_last_relro and is_first_non_relro.
9278 (Output_segment::maximum_alignment): Remove relro handling.
9279 (Output_segment::set_section_addresses): Add increase_relro
9280 parameter. Change all callers. Add initial alignment to align
9281 relro sections on separate page. Remove old relro handling.
9282 (Output_segment::set_section_list_addresses): Remove in_relro
9283 parameter. Change all callers.
9284 (Output_segment::set_offset): Add increase parameter. Change all
9285 callers. Remove old relro handling.
9286 * output.h (class Output_section): Add new methods: is_last_relro,
9287 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
9288 Add is_last_relro_ and is_first_non_relro_ fields.
9289 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
9290 Create separate .got.plt section. Call increase_relro.
9291 * x86_64.cc (Target_x86_64::got_section): Likewise.
9292 * testsuite/relro_script_test.t: Add .got.plt.
9295 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
9296 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
9297 (Layout::finalize): Call set_dynamic_symbol_size.
9298 (Layout::set_dynamic_symbol_size): New function.
9299 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
9300 set_dynamic_symbol_size.
9303 * output.h (class Output_section): Add is_entsize_zero_ field.
9304 * output.cc (Output_section::Output_section): Initialize
9306 (Output_section::set_entsize): If two different entsizes are
9307 requested, force it to zero.
9308 (Output_section::add_input_section): Set flags for .debug_str
9309 before updating section flags. Set entsize.
9310 (Output_section::update_flags_for_input_section): Set SHF_MERGE
9311 and SHF_STRING if all input sections have those flags.
9313 2009-12-29 Rafael Espindola <espindola@google.com>
9315 * main.cc (main): Fix the sys time reporting.
9316 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
9319 2009-12-29 Sriraman Tallam <tmsriram@google.com>
9321 * options.cc (General_options::parse_version): Allow -v to exit
9322 without an error if there is nothing to link.
9324 2009-12-29 Ian Lance Taylor <iant@google.com>
9326 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
9327 using a version of gcc before 4.1.
9328 * configure: Rebuild.
9330 2009-12-28 Chris Demetriou <cgd@google.com>
9332 * attributes.cc (Output_attributes_section_data::do_write): Use
9333 std::vector::front rather than std::vector::data.
9335 2009-12-28 Ian Lance Taylor <iant@google.com>
9337 * symtab.h (class Symbol_table): Add enum Defined.
9338 * resolve.cc (Symbol_table::should_override): Add defined
9339 parameter. Change all callers. Test whether object is NULL
9340 before calling a method on it.
9341 (Symbol_table::report_resolve_problem): Add defined parameter.
9343 (Symbol_table::should_override_with_special): Likewise.
9344 * symtab.cc (Symbol_table::define_in_output_data): Add defined
9345 parameter. Change all callers.
9346 (Symbol_table::do_define_in_output_data): Likewise.
9347 (Symbol_table::define_in_output_segment): Likewise.
9348 (Symbol_table::do_define_in_output_segment): Likewise.
9349 (Symbol_table::define_as_constant): Likewise.
9350 (Symbol_table::do_define_as_constant): Likewise.
9351 * script.h (class Symbol_assignment): Add is_defsym parameter to
9352 constructor; change all callers.
9353 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
9354 parameter. Change all callers. Add is_defsym_ field.
9355 (class Parser_closure): Add parsing_defsym parameter to
9356 constructor; change all callers. Add parsing_defsym accessor
9357 function. Add parsing_defsym_ field.
9359 2009-12-28 Ian Lance Taylor <iant@google.com>
9361 * gold.cc (queue_middle_tasks): Fix formatting.
9362 * object.cc (Relobj::is_section_name_included): Likewise.
9364 2009-12-23 Ian Lance Taylor <iant@google.com>
9366 * i386.cc (Target_i386::do_calls_non_split): Recognize
9367 -fsplit-stack prologue for a function with a static chain.
9368 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
9369 -fsplit-stack prologue when using %r11.
9371 2009-12-21 Sriraman Tallam <tmsriram@google.com>
9373 * options.cc (General_options::parse_version): Make -v continue and do
9374 the link like GNU ld does.
9376 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
9378 * Makefile.am (CCFILES): Add timer.cc.
9379 (HFILES): Add timer.h.
9380 * configure.ac: Check for sysconf and times.
9381 * main.cc: include timer.h.
9382 (main): Use Timer instead of get_run_time.
9385 * workqueue.cc: include timer.h.
9386 (Workqueue::find_and_run_task):
9387 Report user, sys and wall time.
9388 * Makefile.in: Regenerate.
9389 * config.in: Regenerate.
9390 * configure: Regenerate.
9392 2009-12-16 Doug Kwan <dougkwan@google.com>
9394 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
9396 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
9397 relaxed input sections.
9398 * output.cc (Output_section::find_relaxed_input_section): Change
9399 return type to Output_relaxed_input_section pointer. Adjust code
9400 for new type of relaxed_input_section_map_.
9401 * output.h (Output_section::find_relaxed_input_section): Change
9402 return type to Output_relaxed_input_section pointer.
9403 (Output_section::Output_relaxed_input_section_by_input_section_map):
9405 (Output_section::relaxed_input_section_map_): Change type to
9406 Output_section::Output_relaxed_input_section_by_input_section_map.
9407 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
9410 2009-12-15 Ian Lance Taylor <iant@google.com>
9412 * layout.cc (Layout::create_shstrtab): Only write out after input
9413 sections if we are compressing debug sections.
9415 2009-12-15 Ian Lance Taylor <iant@google.com>
9417 * archive.cc (Archive::add_symbols): Only look up a symbol without
9418 a version if there is, in fact, a version.
9420 2009-12-14 Ian Lance Taylor <iant@google.com>
9422 Revert -Wshadow changes, all changes from:
9423 2009-12-11 Doug Kwan <dougkwan@google.com>
9424 2009-12-11 Nick Clifton <nickc@redhat.com>
9425 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
9427 2009-12-11 Doug Kwan <dougkwan@google.com>
9429 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
9431 * attributes.cc (Object_attribute::size): Ditto.
9432 (Attributes_section_data::size): Ditto.
9433 (Attributes_section_data::Attributes_section_data): Ditto.
9434 (Output_attributes_section_data::do_write): Ditto.
9435 * attributes.h (Object_attribute::set_type): Ditto.
9436 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
9438 2009-12-11 Nick Clifton <nickc@redhat.com>
9440 * archive.cc: Fix shadowed variable warnings.
9442 * compressed_output.cc: Likewise.
9443 * compressed_output.h: Likewise.
9444 * configure: Likewise.
9445 * dwarf_reader.cc: Likewise.
9446 * dynobj.cc: Likewise.
9447 * dynobj.h: Likewise.
9448 * ehframe.cc: Likewise.
9449 * ehframe.h: Likewise.
9450 * errors.cc: Likewise.
9451 * expression.cc: Likewise.
9452 * fileread.cc: Likewise.
9453 * fileread.h: Likewise.
9454 * freebsd.h: Likewise.
9455 * i386.cc: Likewise.
9457 * incremental.h: Likewise.
9458 * layout.cc: Likewise.
9459 * layout.h: Likewise.
9460 * mapfile.cc: Likewise.
9461 * merge.cc: Likewise.
9462 * merge.h: Likewise.
9463 * object.cc: Likewise.
9464 * object.h: Likewise.
9465 * options.h: Likewise.
9466 * output.cc: Likewise.
9467 * output.h: Likewise.
9468 * parameters.cc: Likewise.
9469 * plugin.cc: Likewise.
9470 * powerpc.cc: Likewise.
9471 * reduced_debug_output.cc: Likewise.
9472 * reduced_debug_output.h: Likewise.
9473 * reloc.cc: Likewise.
9474 * reloc.h: Likewise.
9475 * resolve.cc: Likewise.
9476 * script-sections.cc: Likewise.
9477 * script.cc: Likewise.
9478 * script.h: Likewise.
9479 * sparc.cc: Likewise.
9480 * symtab.cc: Likewise.
9481 * symtab.h: Likewise.
9482 * target-select.cc: Likewise.
9483 * target-select.h: Likewise.
9484 * token.h: Likewise.
9485 * workqueue.cc: Likewise.
9486 * workqueue.h: Likewise.
9487 * x86_64.cc: Likewise.
9489 2009-12-10 Doug Kwan <dougkwan@google.com>
9491 * arm.cc (attributes.h): New include.
9492 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
9493 (Arm_relobj::~Arm_relobj): Delete object pointed by
9494 attributes_section_data_.
9495 (Arm_relobj::attributes_section_data): New method definition.
9496 (Arm_relobj::attributes_section_data_): New data member declaration.
9497 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
9498 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
9499 attributes_section_data_.
9500 (Arm_dynobj::attributes_section_data): New method definition.
9501 (Arm_dynobj::attributes_section_data_): New data member declaration.
9502 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
9503 initialization value of may_use_blx_ to false.
9504 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
9505 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
9506 object attributes to compute results instead of hard-coding.
9507 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
9508 Target_arm::get_secondary_compatible_arch,
9509 Target_arm::set_secondary_compatible_arch
9510 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9511 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
9512 New method declarations.
9513 (Target_arm::get_aeabi_object_attribute): New method definition.
9514 (Target_arm::attributes_section_data_): New data member declaration.
9515 (read_arm_attributes_section): New template definition.
9516 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
9517 (Arm_dynobj::do_read_symbols): Ditto.
9518 (Target_arm::do_finalize_sections): Merge attributes sections from
9519 input. Check for BLX use after attributes section merging.
9520 Fix __exidx_start and __exidx_end visibility. Create an
9521 .ARM.attributes section if necessary.
9522 (Target_arm::get_secondary_compatible_arch,
9523 Target_arm::set_secondary_compatible_arch,
9524 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9525 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
9526 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
9527 New method definitions.
9529 2009-12-09 Ian Lance Taylor <iant@google.com>
9531 * plugin.cc (Plugin::load): Don't cast from void* to a function
9534 2009-12-09 Ian Lance Taylor <iant@google.com>
9536 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
9539 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
9541 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
9542 Replace two_file_shared_1.so with two_file_shared_2.so.
9543 * testsuite/Makefile.in: Regenerated.
9545 2009-12-08 Doug Kwan <dougkwan@google.com>
9547 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
9548 (HFILES): Add attributes.h and int_encoding.h.
9549 * Makefile.in: Regenerate.
9550 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
9551 function definitions to int_encoding.cc
9552 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
9553 prototypes to int_encoding.h
9554 * reduced_debug_output.cc (int_encoding.h): New include.
9555 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
9556 function definitions to int_encoding.cc
9557 (insert_into_vector, read_from_pointer): Move template definitions to
9559 * attributes.cc: New file.
9560 * attributes.h: New file.
9561 * int_encoding.cc: New file.
9562 * int_encoding.h: New file.
9564 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
9567 * incremental-dump.cc (dump_incremental_inputs): New.
9568 (main): Use dump_incremental_inputs.
9570 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
9573 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
9574 checking elfcpp::STT_FUNC.
9575 (Target_i386::Relocate::relocate): Likewise.
9576 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
9578 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
9579 symbols from shared libraries into normal FUNC symbols.
9581 * symtab.h (Symbol): Add is_func and use it.
9583 2009-12-05 Doug Kwan <dougkwan@google.com>
9585 * arm.cc (Target_arm::arm_info): Initialize new fields
9586 attributes_section and attributes_vendor.
9587 * i386.cc (Target_i386::i386_info): Same.
9588 * object.cc (Sized_relobj::do_layout): Skip attribute section.
9589 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
9590 fields attributes_section and attributes_vendor.
9591 * sparc.cc (Target_sparc::sparc_info): Same.
9592 * target.h (Target::attributes_section, Target::attributes_vendor,
9593 Target::is_attributes_section, Target::attribute_arg_type,
9594 Target::attributes_order): New method definitions.
9595 (Target::Target_info::attributes_section,
9596 Target::Target_info::attributes_vendor): New fields.
9597 (Target::do_attribute_arg_type, Target::do_attributes_order): New
9598 virtual method definitions.
9599 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
9600 attributes_section and attributes_vendor.
9601 * testsuite/testfile.cc (Target_test::test_target_info): Same.
9603 2009-12-05 Doug Kwan <dougkwan@google.com>
9605 * arm.cc: Update comments about interworking and stub generation.
9606 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
9607 considered as non-PIC.
9608 (Arm_relocate_functions::base_abs): Fix formatting.
9609 (Arm_relocate_functions::got_prel): Fix comment. Change interface
9610 of function to use GOT entry address instead of offset.
9611 (Target_arm::Scan::global): Issue an error if a symbol would need a
9612 PLT does not get one because it is untyped. Remove code to create
9613 dynamic symbols for relative branches.
9614 (Target_arm::Relocate::relocate: Use 0 instead of false since function
9615 takes unsigned integer instead of boolean.
9617 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
9619 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
9620 (two_file_test_LDADD): Likewise.
9621 (common_test_1_LDADD): Likewise.
9622 (exception_test_LDADD) Likewise.
9623 (weak_test_LDADD): Likewise.
9624 (many_sections_test_LDADD): Likewise.
9625 (initpri1_LDADD): Likewise.
9626 (script_test_1_LDADD): Likewise.
9627 (script_test_2_LDADD): Likewise.
9628 (justsyms_LDADD): Likewise.
9629 (binary_test_LDADD): Likewise.
9630 (large_LDADD): Likewise.
9631 * testsuite/Makefile.in: Regenerated.
9633 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
9635 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
9636 (Symbol_table::override_with_special): Likewise.
9637 (Symbol_table::add_from_object): Likewise.
9639 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
9641 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9642 Don't set the data_offset twice.
9644 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
9646 * testsuite/Makefile.in: Regenerate.
9648 2009-12-03 Doug Kwan <dougkwan@google.com>
9650 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
9651 (Target_arm::do_finalize_sections): Add parameter for symbol table
9652 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
9653 * i386.cc (Target_i386::do_finalize_sections): Add an additional
9654 parameter for symbol table pointer.
9655 * layout.cc (Layout::finalize): Call Target::finalize_sections with
9656 an additional parameter for a pointer to symbol table.
9657 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
9658 parameter for a symbol table pointer.
9659 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
9660 * target.h (Target::finalize_sections, Target::do_finalize_sections):
9662 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
9663 parameter for a symbol table pointer.
9665 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
9667 * incremental.cc (Incremental_inputs_header)
9668 (Incremental_inputs_header_write, Incremental_inputs_entry)
9669 (Incremental_inputs_entry_write): Move ...
9670 * incremental.h (Incremental_inputs_header)
9671 (Incremental_inputs_header_write, Incremental_inputs_entry)
9672 (Incremental_inputs_entry_write): here.
9674 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9676 * incremental.cc (make_sized_incremental_binary): Set the target.
9677 Error if it is incompatible.
9678 * output.h (Output_file): Add filename method.
9680 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9682 * incremental.cc (Incremental_inputs_entry): Remove unused argument
9683 from the get_* methods.
9685 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9687 * incremental-dump.cc (main): Check that the offeset of a script is 0.
9688 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9689 Write 0 for the data_offset of scripts.
9691 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9693 * testsuite/Makefile.am: Add the incremental_test.sh test.
9694 * testsuite/incremental_test.sh: New.
9695 * testsuite/incremental_test_1.c: New.
9696 * testsuite/incremental_test_2.c: New.
9698 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
9700 * incremental-dump.cc (main): Fix typos.
9702 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
9705 * incremental-dump.cc (main): Use llu to print 64 bit values.
9707 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
9708 H.J. Lu <hongjiu.lu@intel.com>
9710 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
9712 (incremental_dump_LDADD): Likewise.
9713 * Makefile.in: Regenerated.
9715 2009-11-25 Doug Kwan <dougkwan@google.com>
9719 2009-11-25 Doug Kwan <dougkwan@google.com>
9721 * arm.cc (Target_arm::Target_arm): Move method definition
9722 outside of class definition. Add code to handle
9723 --target1-rel, --target1-abs and --target2= options.
9724 (Target_arm::get_reloc_reloc_type): Change method to be
9725 non-static and const.
9726 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
9727 New data member declaration.
9728 (Target_arm::Scan::local, Target_arm::Scan::global,
9729 Target_arm::Relocate::relocate,
9730 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9731 Adjust call to Target_arm::get_real_reloc_type.
9732 (Target_arm::get_real_reloc_type): Use command line options
9733 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9734 * options.h (--target1-rel, --target1-abs, --target2): New
9737 2009-11-25 Doug Kwan <dougkwan@google.com>
9739 * arm.cc (Target_arm::Target_arm): Move method definition outside of
9740 class definition. Add code to handle --target1-rel, --target1-abs
9741 and --target2= options.
9742 (Target_arm::get_reloc_reloc_type): Change method to be non-static
9744 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
9746 (Target_arm::Scan::local, Target_arm::Scan::global,
9747 Target_arm::Relocate::relocate,
9748 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
9749 call to Target_arm::get_real_reloc_type.
9750 (Target_arm::get_real_reloc_type): Use command line options to
9751 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9752 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
9755 2009-11-25 Doug Kwan <dougkwan@google.com>
9757 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
9758 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
9759 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
9761 (Arm_relocate_functions::thm_call): Replace body with a call to
9762 Arm_relocate_functions::thumb_branch_common.
9763 (Arm_relocate_functions::thm_jump24,
9764 Arm_relocate_functions::thm_xpc22): New method definitions.
9765 (Arm_relocate_functions::thumb_branch_common): New method definition.
9766 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
9768 (Target_arm::Relocate::relocate): Adjust call to thm_call.
9769 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
9771 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
9773 * Makefile.am: Build incremental-dump
9774 * Makefile.in: Regenerate.
9775 * incremental-dump.cc: New.
9776 * incremental.cc (Incremental_inputs_header_data,
9777 Incremental_inputs_entry_data): Move to incremental.h
9778 * incremental.h: (Incremental_inputs_header_data,
9779 Incremental_inputs_entry_data): Move from incremental.cc
9781 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
9783 * incremental.cc (Incremental_inputs_header,
9784 Incremental_inputs_header_write, Incremental_inputs_entry,
9785 Incremental_inputs_entry_write): Add a typedef with the data type.
9787 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
9789 * incremental.cc (Incremental_inputs_header,
9790 Incremental_inputs_header_write, Incremental_inputs_entry,
9791 Incremental_inputs_entry_write): Update comment about which
9792 type has the filed descriptions.
9794 2009-11-15 Doug Kwan <dougkwan@google.com>
9796 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
9797 (Arm_relocate_functions::arm_branch_common): Change method defintion
9798 in class definition to a method declaration and update list of formal
9800 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
9801 Arm_relocation_functions::jump24): Adjust call to
9802 Arm_relocate_functions::arm_branch_common. Update list of formal
9804 (Arm_relocate_functions::xpc25): New method definition.
9805 (Arm_relocate_functions::arm_branch_common): Move method defintion
9806 out from class definition. Use stubs for mode-switching and extending
9808 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
9809 specially. Change code to enable use of stubs in ARM branches.
9811 2009-11-10 Doug Kwan <dougkwan@google.com>
9813 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
9814 in method declaration.
9815 (Target_arm::relocate_stub): New method declaration.
9816 (Target_arm::default_target): Change to return a pointer instead of
9818 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
9819 Target_arm::default_target.
9820 (Arm_Relobj::do_relocate_sections): Remove options paramater in
9822 (Target_arm::relocate_section): Adjust view.
9823 (Target_arm::relocate_stub): New method definition.
9825 2009-11-10 Doug Kwan <dougkwan@google.com>
9827 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
9829 * incremental.cc (open_incremental_binary): Initialized local
9830 variables to avoid warnings.
9831 * object.cc (make_elf_object): Ditto.
9832 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
9835 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
9838 * testsuite/plugin_test.c: Include "config.h".
9840 2009-11-09 Doug Kwan <dougkwan@google.com>
9842 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
9843 (arm_symbol_value): Remove.
9844 (Arm_relocate_functions::arm_branch_common,
9845 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
9846 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
9847 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
9848 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
9849 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
9850 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
9851 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
9852 Arm_relocate_functions::thm_mobw_abs_nc,
9853 Arm_relocate_functions::thm_mov_abs,
9854 Arm_relocate_functions::movw_prel_nc,
9855 Arm_relocate_functions::thm_movt_abs,
9856 Arm_relocate_functions::movt_prel,
9857 Arm_relocate_functions::thm_movw_prel_nc,
9858 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
9859 (Target_arm::Relocate::relocate): Only decompose address into two
9860 parts if relocation type uses the thumb-bit and pass the actual
9861 bit instead of a flag indicating that the thumb-bit is used. Adjust
9862 calls to methods in Arm_relocate_functions for this change.
9864 2009-11-08 Ian Lance Taylor <iant@google.com>
9867 * reloc.cc: Instantiate
9868 Sized_relobj::initialize_input_to_output_maps and
9869 Sized_relobj:free_input_to_output_maps.
9871 2009-11-06 Ian Lance Taylor <iant@google.com>
9874 * defstd.cc (in_segment): Set only_if_ref true for "end".
9876 2009-11-06 Doug Kwan <dougkwan@google.com>
9878 * arm.cc (class Reloc_stub): Correct a comment.
9879 (Target_arm::Target_arm): Initialize arm_input_section_map_.
9880 (Target_arm::scan_section_for_stubs): New method declaration.
9881 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
9882 Change methods from private to protected.
9883 (Target_arm::do_may_relax): New method definition.
9884 (Target_arm::do_relax, Target_arm::group_sections,
9885 Target_arm::scan_reloc_for_stub,
9886 Target_arm::scan_reloc_section_for_stubs): New method declarations.
9887 (Target_arm::arm_input_section_map_): New data member declaration.
9888 (Target_arm::scan_reloc_for_stub,
9889 Target_arm::scan_reloc_section_for_stubs,
9890 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
9891 Target_arm::do_relax): New method definitions.
9893 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
9895 * configure.ac: Check for (struct stat)::st_mtim
9896 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
9897 * config.in: Regenerate.
9898 * configure: Regenerate.
9900 2009-11-05 Ian Lance Taylor <iant@google.com>
9903 * output.cc (Output_segment::add_output_section): Add missing
9906 2009-11-04 Ian Lance Taylor <iant@google.com>
9909 * object.h (class Object): Add is_needed and set_is_needed
9910 methods. Add is_needed_ field. Make bool fields into bitfields.
9911 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
9912 defined in a dynamic object and referenced by a regular object,
9913 set is_needed for the dynamic object.
9914 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
9915 if the file is marked with as_needed and it is not needed.
9917 2009-11-04 Ian Lance Taylor <iant@google.com>
9920 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
9921 tags if data is discarded by linker script.
9922 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9923 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9924 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9925 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9927 2009-11-04 Ian Lance Taylor <iant@google.com>
9929 * layout.cc (Layout::get_output_section): Add is_interp and
9930 is_dynamic_linker_section parameters. Change all callers.
9931 (Layout::choose_output_section): Likewise.
9932 (Layout::make_output_section): Likewise.
9933 (Layout::add_output_section_data): Add is_dynamic_linker_section
9934 parameter. Change all callers.
9935 * layout.h (class Layout): Update declarations.
9936 * output.h (class Output_section): Add is_interp, set_is_interp,
9937 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
9938 Add is_interp_, is_dynamic_linker_section_ fields. Change
9939 generate_code_fills_at_write_ to a bitfield.
9940 * output.cc (Output_section::Output_sections): Initialize new
9942 (Output_segment::add_output_section): Add do_sort parameter.
9945 2009-11-03 Ian Lance Taylor <iant@google.com>
9948 * options.h (class General_options): Add --warn-common.
9949 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
9950 merging two common symbols.
9951 (Symbol_table::should_override): Handle --warn-common when merging
9952 a common symbol with a defined symbol. Use report_resolve_problem
9953 for multiple definitions.
9954 (Symbol_table::report_resolve_problem): New function.
9955 * symtab.h (class Symbol_table): Declare report_resolve_problem.
9957 2009-11-03 Doug Kwan <dougkwan@google.com>
9959 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
9961 (Target_arm::stub_factory): New method definition.
9962 (Target_arm::new_arm_input_section,
9963 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
9964 Target_arm::reloc_uses_thumb_bit): New method declarations.
9965 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
9966 New type definitions.
9967 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
9968 member declarations.
9969 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
9970 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
9971 New method definitions.
9973 2009-11-03 Ian Lance Taylor <iant@google.com>
9975 * options.h (class General_options): Add --warn_constructors.
9977 2009-11-03 Ian Lance Taylor <iant@google.com>
9980 * defstd.cc (in_section): Add entries for __rel_iplt_start,
9981 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
9983 2009-11-03 Ian Lance Taylor <iant@google.com>
9986 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
9987 --msgid-bugs-address.
9988 (install-pdf): New target.
9989 (install-data_yes): Look up one directory to find mkinstalldirs.
9991 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
9993 * po/Make-in (.po.gmo): Don't generate .gmo files in source
9996 2009-10-30 Doug Kwan <dougkwan@google.com>
9998 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
10000 2009-10-30 Doug Kwan <dougkwan@google.com>
10002 * arm.cc (Stub_addend_reader): New struct template definition
10003 and partial specializations.
10004 (Stub_addend_reader::operator()): New method definition for a
10005 partially specialized template.
10007 2009-10-30 Doug Kwan <dougkwan@google.com>
10009 * arm.cc (Arm_relobj::processor_specific_flags): New method
10011 (Arm_relobj::do_read_symbols): New method declaration.
10012 (Arm_relobj::processor_specific_flags_): New data member declaration.
10013 (Arm_dynobj): New class definition.
10014 (Target_arm::do_finalize_sections): Add input_objects parameter.
10015 (Target_arm::do_adjust_elf_header): New method declaration.
10016 (Target_arm::are_eabi_versions_compatible,
10017 (Target_arm::merge_processor_specific_flags): New method declaration.
10018 (Target_arm::do_make_elf_object): New overloaded method definitions
10020 (Arm_relobj::do_read_symbols): New method definition.
10021 (Arm_dynobj::do_read_symbols): Ditto.
10022 (Target_arm::do_finalize_sections): Add input_objects parameters.
10023 Merge processor-specific flags from all input objects.
10024 (Target_arm::are_eabi_versions_compatible,
10025 Target_arm::merge_processor_specific_flags,
10026 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
10027 New method definitions.
10028 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
10029 Input_objects pointer type parameter.
10030 * layout.cc (Layout::finalize): Pass input objects to target's.
10031 finalize_sections function.
10032 * output.cc (Output_file_header::do_sized_write): Set ELF file
10033 header's processor-specific flags.
10034 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
10035 Input_objects pointer type parameter.
10036 * sparc.cc (Target_sparc::do_finalize_sections): Same.
10037 * target.h (Input_objects): New forward class declaration.
10038 (Target::processor_specific_flags,
10039 Target::are_processor_specific_flags_sect): New method definitions.
10040 (Target::finalize_sections): Add input_objects parameter.
10041 (Target::Target): Initialize processor_specific_flags_ and
10042 are_processor_specific_flags_set_.
10043 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
10045 (Target::set_processor_specific_flags): New method definition.
10046 (Target::processor_specific_flags_,
10047 Target::are_processor_specific_flags_set_): New data member
10049 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
10050 Input_objects pointer type parameter.
10052 2009-10-30 Doug Kwan <dougkwan@google.com>
10054 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
10056 2009-10-28 Ian Lance Taylor <iant@google.com>
10058 * object.h (class Relobj): Drop options parameter from
10059 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
10060 do_scan_relocs, do_relocate. Change all callers.
10061 (class Sized_relobj): Drop options parameters from
10062 do_gc_process_relocs, do_scan_relocs, do_relocate,
10063 do_relocate_sections, relocate_sections, emit_relocs_scan,
10064 emit_relocs_scan_reltype. Change all callers.
10065 (struct Relocate_info): Remove options field and all references to
10067 * reloc.h (class Read_relocs): Remove options constructor
10068 parameter and options_ field. Change all callers.
10069 (class Gc_process_relocs, class Scan_relocs): Likewise.
10070 (class Relocate_task): Likewise.
10071 * target-reloc.h (scan_relocs): Remove options parameter. Change
10073 (scan_relocatable_relocs): Likewise.
10074 * target.h (class Sized_target): Remove options parameter from
10075 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
10077 * gc.h (gc_process_relocs): Remove options parameter. Change all
10079 * arm.cc: Update functions to remove options parameters.
10080 * i386.cc: Likewise.
10081 * powerpc.cc: Likewise.
10082 * sparc.cc: Likewise.
10083 * x86_64.cc: Likewise.
10084 * testsuite/testfile.cc: Likewise.
10086 2009-10-28 Doug Kwan <dougkwan@google.com>
10088 * arm.cc (Arm_relobj): New class definition.
10089 (Arm_relobj::scan_sections_for_stubs,
10090 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
10091 New method definitions.
10093 2009-10-28 Cary Coutant <ccoutant@google.com>
10095 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
10096 (Plugin::cleanup_done_): New member.
10097 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
10098 (Plugin_manager::cleanup_done_): Remove.
10099 (Plugin_manager::add_input_file): Edit error message.
10100 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
10101 (Plugin_manager::cleanup): Remove use of cleanup_done_.
10103 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
10105 * fileread.cc: (File_read::View::~View): Use the new
10106 data_ownership_ filed.
10107 (File_read::~File_read): Dispose the new whole_file_view_.
10108 (File_read::open): Mmap the whole file if needed.
10109 (File_read::open): Use whole_file_view_ instead of contents_.
10110 (File_read::find_view): Use whole_file_view_ if applicable.
10111 (File_read::do_read): Use whole_file_view_ instead of contents_.
10112 (File_read::make_view): Use whole_file_view_ instead of contents_,
10113 update File_read::View::View call.
10114 (File_read::find_or_make_view): Update File_read::View::View
10116 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
10118 (File_read::View::Data_ownership): New enum.
10119 (File_read::View::View): Replace bool mapped_ with Data_ownership
10121 (File_read::View::mapped_): Remove (replaced by data_ownership_).
10122 (File_read::View::data_ownership_): New field.
10123 (File_read::contents_): Remove (replaced by whole_file_view_).
10124 (File_read::whole_file_view_): New field.
10125 * options.h (class General_options): Add --keep-files-mapped.
10127 2009-10-27 Cary Coutant <ccoutant@google.com>
10129 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
10130 * testsuite/Makefile.am (plugin_test_5): New test case.
10131 * testsuite/Makefile.in: Regenerate.
10133 2009-10-25 Doug Kwan <dougkwan@google.com>
10135 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
10136 from private to protected to allow access by child class.
10137 (Sized_relobj::do_relocate_sections): New method declaration.
10138 (Sized_relobj::relocate_sections): Virtualize.
10139 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
10140 Sized_relobj::relocate_sections. Instantiate template explicitly
10141 for different target sizes and endianity.
10143 2009-10-24 Doug Kwan <dougkwan@google.com>
10145 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
10146 (Arm_input_section::as_arm_input_section): New method.
10147 (Arm_output_section): New class definition.
10148 (Arm_output_section::create_stub_group,
10149 Arm_output_section::group_sections): New method definitions.
10151 2009-10-22 Doug Kwan <dougkwan@google.com>
10153 * arm.cc (Arm_input_section): New class definition.
10154 (Arm_input_section::init, Arm_input_section:do_write,
10155 Arm_input_section::set_final_data_size,
10156 Arm_input_section::do_reset_address_and_file_offset): New method
10159 2009-10-21 Doug Kwan <dougkwan@google.com>
10161 * arm.cc (Stub_table, Arm_input_section): New forward class
10163 (Stub_table): New class defintion.
10164 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
10165 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
10166 New method definition.
10168 2009-10-21 Doug Kwan <dougkwan@google.com>
10170 * arm.cc: Update copyright comments.
10171 (Target_arm): New forward class template declaration.
10172 (Arm_address): New type.
10173 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
10174 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
10175 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
10177 (Insn_template): Same.
10178 (DEF_STUBS): New macro.
10179 (Stub_type): New enum type.
10180 (Stub_template): New class definition.
10182 (Reloc_stub): Same.
10183 (Stub_factory): Same.
10184 (Target_arm::Target_arm): Initialize may_use_blx_ and
10185 should_force_pic_veneer_.
10186 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
10187 Target_arm::should_force_pic_veneer,
10188 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
10189 Target_arm::using_thumb_only, Target_arm:;default_target): New
10191 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
10192 New data member declarations.
10193 (Insn_template::size, Insn_template::alignment): New method defintions.
10194 (Stub_template::Stub_template): New method definition.
10195 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
10196 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
10197 (Stub_factory::Stub_factory): New method definition.
10198 * gold.h (string_hash): New template.
10199 * output.h (Input_section_specifier::hash_value): Use
10201 (Input_section_specifier::string_hash): Remove.
10202 * stringpool.cc (Stringpool_template::string_hash): Use
10205 2009-10-20 Doug Kwan <dougkwan@google.com>
10207 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
10208 symbols of relaxed input sections.
10209 * output.h (Output_section::find_relaxed_input_section): Make
10212 2009-10-16 Doug Kwan <dougkwan@google.com>
10214 * dynobj.cc (Versions::Versions): Initialize version_script_.
10215 Only insert base version symbol definition for a shared object
10216 if version script defines any version versions.
10217 (Versions::define_base_version): New method definition.
10218 (Versions::add_def): Check that base version is not needed.
10219 (Versions::add_need): Define base version lazily.
10220 * dynobj.h (Versions::define_base_version): New method declaration.
10221 (Versions::needs_base_version_): New data member declaration.
10222 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
10223 (check_DATA): Add no_version_test.stdout.
10224 (libno_version_test.so, no_version_test.o no_version_test.stdout):
10226 * testsuite/Makefile.in: Regenerate.
10227 * testsuite/no_version_test.c: New file.
10228 * testsuite/no_version_test.sh: Ditto.
10230 2009-10-16 Doug Kwan <dougkwan@google.com>
10232 * expression.cc (class Segment_start_expression): New class definition.
10233 (Segment_start_expression::value): New method definition.
10234 (script_exp_function_segment_start): Return a new
10235 Segment_start_expression.
10236 * gold/script-c.h (script_saw_segment_start_expression): New function
10238 * script-sections.cc (Script_sections::Script_sections): Initialize
10239 SAW_SEGMENT_START_EXPRESSION_ to false.
10240 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
10241 and -Tbbs options to specify section addresses if given in
10242 command line and no SEGMENT_START expression is seen in a script.
10243 * script-sections.h (Script_sections::saw_segment_start_expression,
10244 Script_sections::set_saw_segment_start_expression): New method
10246 (Script_sections::saw_segment_start_expression_): New data member
10248 * script.cc (script_saw_segment_start_expression): New function.
10249 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
10250 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
10251 script_test_7.sh and script_test_8.sh.
10252 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
10253 script_test_8.stdout.
10254 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
10255 (script_test_6, script_test_6.stdout, script_test_7,
10256 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
10257 * Makefile.in: Regenerate.
10258 * testsuite/script_test_6.sh: New file.
10259 * testsuite/script_test_6.t: Same.
10260 * testsuite/script_test_7.sh: Same.
10261 * testsuite/script_test_7.t: Same.
10262 * testsuite/script_test_8.sh: Same.
10264 2009-10-16 Doug Kwan <dougkwan@google.com>
10266 * output.cc (Output_segment::set_section_list_address): Cast
10267 expressions to unsigned long long type to avoid format warnings.
10269 2009-10-15 Ian Lance Taylor <iant@google.com>
10271 * script.cc (Script_options::add_symbol_assignment): Always add a
10272 dot assignment to script_sections_.
10273 * script-sections.cc (Script_sections::add_dot_assignment):
10274 Initialize if necessary.
10276 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
10277 program headers with no load segment if there is a linker script.
10279 * layout.cc (Layout::set_segment_offsets): Align the file offset
10280 to the segment aligment for -N or -n with no load segment.
10281 * output.cc (Output_segment::add_output_section): Don't crash if
10282 the first section is a TLS section.
10283 (Output_segment::set_section_list_addresses): Print an error
10284 message if the address moves backward in a linker script.
10285 * script-sections.cc
10286 (Output_section_element_input::set_section_addresses): Don't
10287 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
10288 (Orphan_output_section::set_section_addresses): Likewise.
10290 2009-10-15 Doug Kwan <dougkwan@google.com>
10292 * layout.cc (Layout::finish_dynamic_section): Generate tags
10293 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
10294 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
10295 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
10297 2009-10-14 Ian Lance Taylor <iant@google.com>
10299 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
10301 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
10302 data_shdr fields of relinfo.
10303 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
10304 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
10305 R_386_TLS_LDO_32, adjust based on section flags.
10306 (Target_i386::Relocate::fix_up_ldo): Remove.
10308 2009-10-13 Ian Lance Taylor <iant@google.com>
10310 Add support for -pie.
10311 * options.h (class General_options): Add -pie and
10313 (General_options::output_is_position_independent): Test -pie.
10314 (General_options::output_is_executable): Return true if not shared
10315 and not relocatable.
10316 (General_options::output_is_pie): Remove.
10317 * options.cc (General_options::finalize): Reject incompatible uses
10319 * gold.cc (queue_middle_tasks): A -pie link is not static.
10320 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
10321 * symtab.cc (Symbol::final_value_is_known): Return false if
10322 output_is_position_independent.
10323 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
10324 output_is_position_independent.
10325 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
10326 output_is_position_independent.
10327 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
10328 output_is_position_independent.
10329 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
10331 (basic_pie_test.o, basic_pie_test): New targets.
10332 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
10333 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
10334 (two_file_pie_test): New target.
10335 * testsuite/Makefile.in: Rebuild.
10336 * README: Remove note saying that -pie is not supported.
10338 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
10340 * options.h (class General_options): Add -init and -fini.
10341 * layout.cc (Layout::finish_dynamic_section): Emit
10342 given init and fini functions.
10344 2009-10-13 Sriraman Tallam <tmsriram@google.com>
10346 * gc.h (gc_process_relocs): Check if icf is enabled using new
10348 * gold.cc (queue_initial_tasks): Likewise.
10349 (queue_middle_tasks): Likewise.
10350 * object.cc (do_layout): Likewise.
10351 * symtab.cc (is_section_folded): Likewise.
10352 * main.cc (main): Likewise.
10353 * reloc.cc (Read_relocs::run): Likewise.
10354 (Sized_relobj::do_scan_relocs): Likewise.
10355 * icf.cc (is_function_ctor_or_dtor): New function.
10356 (Icf::find_identical_sections): Check if function is ctor or dtor when
10357 safe icf is chosen.
10358 * options.h (General_options::icf): Change option to be an enum.
10359 (Icf_status): New enum.
10360 (icf_enabled): New method.
10361 (icf_safe_folding): New method.
10362 (set_icf_status): New method.
10363 (icf_status_): New variable.
10364 * (options.cc) (General_options::finalize): Set icf_status_.
10365 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
10366 icf_test and icf_keep_unique_test to use the --icf enum flag.
10367 * testsuite/icf_safe_test.sh: New file.
10368 * testsuite/icf_safe_test.cc: New file.
10370 2009-10-12 Sriraman Tallam <tmsriram@google.com>
10372 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
10373 includes to gc.h and icf.h.
10374 * arm.cc: Include gc.h.
10375 * gold.cc: Likewise.
10376 * i386.cc: Likewise.
10377 * powerpc.cc: Likewise.
10378 * sparc.cc: Likewise.
10379 * x86_64.cc: Likewise.
10380 * gc.h: Include icf.h.
10382 2009-10-11 Ian Lance Taylor <iant@google.com>
10384 * plugin.cc: Include "gold.h" before other header files.
10386 2009-10-10 Chris Demetriou <cgd@google.com>
10388 * options.h (Input_file_argument::Input_file_type): New enum.
10389 (Input_file_argument::is_lib_): Replace with...
10390 (Input_file_argument::type_): New member.
10391 (Input_file_argument::Input_file_argument): Take Input_file_type
10392 'type' rather than boolean 'is_lib' as second argument.
10393 (Input_file_argument::is_lib): Use type_.
10394 (Input_file_argument::is_searched_file): New function.
10395 (Input_file_argument::may_need_search): Handle is_searched_file.
10396 * options.cc (General_options::parse_library): Support -l:filename.
10397 (General_options::parse_just_symbols): Update for Input_file_argument
10399 (Command_line::process): Likewise.
10400 * archive.cc (Archive::get_file_and_offset): Likewise.
10401 * plugin.cc (Plugin_manager::release_input_file): Likewise.
10402 * script.cc (read_script_file, script_add_file): Likewise.
10403 * fileread.cc (Input_file::Input_file): Likewise.
10404 (Input_file::will_search_for): Handle is_searched_file.
10405 (Input_file::open): Likewise.
10406 * readsyms.cc (Read_symbols::get_name): Likewise.
10407 * testsuite/Makefile.am (searched_file_test): New test.
10408 * testsuite/Makefile.in: Regenerate.
10409 * testsuite/searched_file_test.cc: New file.
10410 * testsuite/searched_file_test_lib.cc: New file.
10412 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10413 Ian Lance Taylor <iant@google.com>
10415 * descriptor.cc: Include <cstdio> and "binary-io.h".
10416 (Descriptors::open): Open the files in binary mode always.
10417 * script.cc (Lex::get_token): Treat \r as whitespace.
10419 2009-10-09 Ian Lance Taylor <iant@google.com>
10421 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
10423 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10424 Ian Lance Taylor <iant@google.com>
10426 * configure.ac: Check for readv function also.
10427 * fileread.cc (readv): Define if not HAVE_READV.
10428 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
10430 * config.in: Regenerate.
10431 * configure: Regenerate.
10433 2009-10-09 Doug Kwan <dougkwan@google.com>
10435 * layout.cc (Layout::make_output_section): Call target hook to make
10436 ordinary output section.
10437 (Layout::finalize): Adjust parameter list of call the
10438 Target::may_relax().
10439 * layout.h (class Layout::section_list): New method.
10440 * merge.h (Output_merge_base::entsize): Change visibility to public.
10441 (Output_merge_base::is_string, Output_merge_base::do_is_string):
10443 (Output_merge_string::do_is_string): New method.
10444 * object.cc (Sized_relobj::do_setup): renamed from
10445 Sized_relobj::set_up.
10446 * object.h (Sized_relobj::adjust_shndx,
10447 Sized_relobj::initializ_input_to_output_maps,
10448 Sized_relobj::free_input_to_output_maps): Change visibilities to
10450 (Sized_relobj::setup): Virtualize.
10451 (Sized_relobj::do_setup): New method declaration.
10452 (Sized_relobj::invalidate_section_offset,
10453 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
10454 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
10455 * options.cc (parse_int): New function.
10456 * options.h (parse_int): New declaration.
10457 (DEFINE_int): New macro.
10458 (stub_group_size): New option.
10459 * output.cc (Output_section::Output_section): Initialize memebers
10460 merge_section_map_, merge_section_by_properties_map_,
10461 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
10462 (Output_section::add_input_section): Handled deferred code-fill
10463 generation and remove an old comment.
10464 (Output_section::add_relaxed_input_section): New method definition.
10465 (Output_section::add_merge_input_section): Use merge section by
10466 properties map to speed to search. Update merge section maps
10468 (Output_section::build_relaxation_map): New method definition.
10469 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
10471 (Output_section::relax_input_section): Renamed to
10472 Output_section::convert_input_sections_to_relaxed_sections and change
10473 interface to take a vector of pointers to relaxed sections.
10474 (Output_section::find_merge_section,
10475 Output_section::find_relaxed_input_section): New method definitions.
10476 (Output_section::is_input_address_mapped,
10477 Output_section::output_offset, Output_section::output_address):
10478 Use output section data maps to speed up searching.
10479 (Output_section::find_starting_output_address): Add comments.
10480 (Output_section::do_write,
10481 Output_section::write_to_postprocessing_buffer): Do code-fill
10482 generation as appropriate.
10483 (Output_section::get_input_sections): Invalidate relaxed input section
10485 (Output_section::restore_states): Adjust type of checkpoint .
10486 Invalidate relaxed input section map.
10487 * output.h (Output_merge_base): New class declaration.
10488 (Input_section_specifier): New class defintion.
10489 (class Output_relaxed_input_section) Change base class to
10490 Output_section_data_build.
10491 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
10492 base class initializer.
10493 (Output_section::add_relaxed_input_section): New method declaration.
10494 (Output_section::Input_section): Change visibility to protected.
10495 (Output_section::Input_section::relobj,
10496 Output_section::Input_section::shndx): Handle relaxed input sections.
10497 Output_section::input_sections) Change visibility to protected. Also
10498 define overload to return a non-const pointer.
10499 (Output_section::Merge_section_properties): New class defintion.
10500 (Output_section::Merge_section_by_properties_map,
10501 Output_section::Output_section_data_by_input_section_map,
10502 Output_section::Relaxation_map): New types.
10503 (Output_section::relax_input_section): Rename method to
10504 Output_section::convert_input_sections_to_relaxed_sections and change
10505 interface to take a vector of relaxed section pointers.
10506 (Output_section::find_merge_section,
10507 Output_section::find_relaxed_input_section,
10508 Output_section::build_relaxation_map,
10509 Output_section::convert_input_sections_in_list_to_relaxed_sections):
10510 New method declarations.
10511 (Output_section::merge_section_map_
10512 Output_section::merge_section_by_properties_map_,
10513 Output_section::relaxed_input_section_map_,
10514 Output_section::is_relaxed_input_section_map_valid_,
10515 Output_section::generate_code_fills_at_write_): New data members.
10516 * script-sections.cc
10517 (Output_section_element_input::set_section_addresses): Call
10518 current_data_size and addralign methods of relaxed input sections.
10519 (Orphan_output_section::set_section_addresses): Call current_data_size
10520 and addralign methods of relaxed input sections.
10521 * symtab.cc (Symbol_table::compute_final_value): Extract template
10522 from the body of Symbol_table::sized_finalize_symbol.
10523 (Symbol_table::sized_finalized_symbol): Call
10524 Symbol_table::compute_final_value.
10525 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
10526 (Symbol_table::compute_final_value): New templated method declaration.
10527 * target.cc (Target::do_make_output_section): New method defintion.
10528 * target.h (Target::make_output_section): New method declaration.
10529 (Target::relax): Add more parameters for input objects, symbol table
10530 and layout. Adjust call to do_relax.
10531 (Target::do_make_output_section): New method declaration.
10532 (Target::do_relax): Add parameters for input objects, symbol table
10535 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10537 * pread.c: Include stdio.h.
10539 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10541 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
10544 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10546 * dwarf_reader.cc (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 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
10552 Change read_shndx type to unsigned int.
10553 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10555 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10556 * layout.cc (Layout::create_symtab_sections): Cast the result of
10557 local_symcount * symsize to off_t in the gold_assert.
10559 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10561 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
10562 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
10564 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
10565 (Arm_relocate_functions::thm_abs5): New function.
10566 (Arm_relocate_functions::abs12): New function.
10567 (Arm_relocate_functions::abs16): New function.
10568 (Arm_relocate_functions::base_abs): New function.
10569 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
10570 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
10571 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
10573 (Scan::global): Likewise.
10574 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
10575 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
10576 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
10577 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
10580 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10582 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
10583 (Arm_relocate_functions::movt_prel): New function.
10584 (Arm_relocate_functions::thm_movw_prel_nc): New function.
10585 (Arm_relocate_functions::thm_movt_prel): New function.
10586 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
10587 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
10588 (Scan::global, Relocate::relocate): Likewise.
10589 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10591 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10593 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
10594 Incremental_checker.
10595 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
10597 (class Incremental_inputs_header): New class.
10598 (Incremental_inputs_header_writer): Edit comment.
10599 (Incremental_inputs_entry): New class.
10600 (Incremental_inputs_entry_writer): Edit comment.
10601 (Sized_incremental_binary::do_find_incremental_inputs_section):
10602 Add *strtab_shndx parameter, fill it.
10603 (Sized_incremental_binary::do_check_inputs): New method.
10604 (Incremental_checker::can_incrementally_link_output_file): Use
10605 Sized_incremental_binary::check_inputs.
10606 (Incremental_inputs::report_command_line): Save command line in
10609 (Incremental_binary::find_incremental_inputs_section): New
10611 (Incremental_binary::do_find_incremental_inputs_section): Add
10612 strtab_shndx parameter.
10613 (Incremental_binary::do_check_inputs): New pure virtual method.
10614 (Sized_incremental_binary::do_check_inputs): Declare.
10615 (Incremental_checker::Incremental_checker): Add incremental_inputs
10616 parameter, use it to initialize incremental_inputs_.
10617 (Incremental_checker::incremental_inputs_): New field.
10618 (Incremental_checker::command_line): New method.
10619 (Incremental_checker::inputs): New method.
10620 (Incremental_checker::command_line_): New field.
10622 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10624 * incremental.cc: Include <cstdarg> and "target-select.h".
10625 (vexplain_no_incremental): New function.
10626 (explain_no_incremental): New function.
10627 (Incremental_binary::error): New method.
10628 (Sized_incremental_binary::do_find_incremental_inputs_section): New
10630 (make_sized_incremental_binary): New function.
10631 (open_incremental_binary): New function.
10632 (can_incrementally_link_file): Add checks if output is ELF and has
10634 * incremental.h: Include "elfcpp_file.h" and "output.h".
10635 (Incremental_binary): New class.
10636 (Sized_incremental_binary): New class.
10637 (open_incremental_binary): Declare.
10638 * object.cc (is_elf_object): Use
10639 elfcpp::Elf_recognizer::is_elf_file.
10640 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
10641 * output.h (Output_file::filesize): New method.
10643 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10645 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
10647 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
10648 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
10650 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
10652 (Arm_relocate_functions::movw_abs_nc): New function.
10653 (Arm_relocate_functions::movt_abs): New function.
10654 (Arm_relocate_functions::thm_movw_abs_nc): New function.
10655 (Arm_relocate_functions::thm_movt_abs): New function.
10656 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
10657 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
10658 (Scan::global): Likewise.
10659 (Relocate::relocate): Likewise.
10660 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10662 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10664 * arm.cc (Arm_relocate_functions::got_prel) New function.
10665 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
10666 (Relocate::relocate): Likewise.
10667 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10669 2009-10-06 Ian Lance Taylor <iant@google.com>
10671 * options.h (class General_options): Define
10672 split_stack_adjust_size parameter.
10673 * object.h (class Object): Add uses_split_stack_ and
10674 has_no_split_stack_ fields. Add uses_split_stack and
10675 has_no_split_stack accessor functions. Declare
10676 handle_split_stack_section.
10677 (class Reloc_symbol_changes): Define.
10678 (class Sized_relobj): Define Function_offsets. Declare
10679 split_stack_adjust, split_stack_adjust_reltype, and
10681 * object.cc (Object::handle_split_stack_section): New function.
10682 (Sized_relobj::do_layout): Call handle_split_stack_section.
10683 * dynobj.cc (Sized_dynobj::do_layout): Call
10684 handle_split_stack_section.
10685 * reloc.cc (Sized_relobj::relocate_sections): Call
10686 split_stack_adjust for executable sections in split_stack
10687 objects. Pass reloc_map to relocate_section.
10688 (Sized_relobj::split_stack_adjust): New function.
10689 (Sized_relobj::split_stack_adjust_reltype): New function.
10690 (Sized_relobj::find_functions): New function.
10691 * target-reloc.h: Include "object.h".
10692 (relocate_section): Add reloc_symbol_changes parameter. Change
10694 * target.h (class Target): Add calls_non_split method. Declare
10695 do_calls_non_split virtual method. Declare match_view and
10697 * target.cc: Include "elfcpp.h".
10698 (Target::do_calls_non_split): New function.
10699 (Target::match_view): New function.
10700 (Target::set_view_to_nop): New function.
10701 * gold.cc (queue_middle_tasks): Give an error if mixing
10702 split-stack and non-split-stack objects with -r.
10703 * i386.cc (Target_i386::relocate_section): Add
10704 reloc_symbol_changes parameter.
10705 (Target_i386::do_calls_non_split): New function.
10706 * x86_64.cc (Target_x86_64::relocate_section): Add
10707 reloc_symbol_changes parameter.
10708 (Target_x86_64::do_calls_non_split): New function.
10709 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
10711 * powerpc.cc (Target_powerpc::relocate_section): Add
10712 reloc_symbol_changes parameter.
10713 * sparc.cc (Target_sparc::relocate_section): Add
10714 reloc_symbol_changes parameter.
10715 * configure.ac: Call AM_CONDITIONAL for the default target.
10716 * configure: Rebuild.
10717 * testsuite/Makefile.am (TEST_AS): New variable.
10718 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
10719 (check_DATA): Add split_i386 and split_x86_64 files.
10720 (SPLIT_DEFSYMS): Define.
10721 (split_i386_[1234n].o): New targets.
10722 (split_i386_[124]): New targets.
10723 (split_i386_[1234r].stdout): New targets.
10724 (split_x86_64_[1234n].o): New targets.
10725 (split_x86_64_[124]): New targets.
10726 (split_x86_64_[1234r].stdout): New targets.
10727 (MOSTLYCLEANFILES): Add new executables.
10728 * testsuite/split_i386.sh: New file.
10729 * testsuite/split_x86_64.sh: New file.
10730 * testsuite/split_i386_1.s: New file.
10731 * testsuite/split_i386_2.s: New file.
10732 * testsuite/split_i386_3.s: New file.
10733 * testsuite/split_i386_4.s: New file.
10734 * testsuite/split_i386_n.s: New file.
10735 * testsuite/split_x86_64_1.s: New file.
10736 * testsuite/split_x86_64_2.s: New file.
10737 * testsuite/split_x86_64_3.s: New file.
10738 * testsuite/split_x86_64_4.s: New file.
10739 * testsuite/split_x86_64_n.s: New file.
10740 * testsuite/testfile.cc (Target_test): Update relocation_section
10742 * testsuite/Makefile.in: Rebuild.
10744 2009-10-06 Ian Lance Taylor <iant@google.com>
10746 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
10747 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
10748 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
10749 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
10750 the address on ldo_addrs_.
10751 (Target_i386::Relocate::fix_up_ldo): New function.
10753 2009-10-06 Rafael Espindola <espindola@google.com>
10755 * plugin.cc (add_input_library): New.
10756 (Plugin::load): Add add_input_library to tv.
10757 (Plugin_manager::add_input_file): Add the is_lib argument.
10758 (add_input_file): Update call to Plugin_manager::add_input_file.
10759 (add_input_library): New.
10760 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
10762 2009-09-30 Doug Kwan <dougkwan@google.com>
10764 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
10765 symbol and call Symbol::may_need_copy_reloc to determine if
10766 a copy reloc is needed.
10767 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
10768 nocopyreloc is given in command line.
10769 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
10770 given in command line.
10771 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
10772 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
10773 of the removed Target_i386::may_need_copy_reloc.
10774 * options.h (copyreloc): New option with default value false.
10775 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10776 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
10777 instead of the removed Target_powerpc::may_need_copy_reloc.
10778 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10779 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
10780 instead of the removed Target_sparc::may_need_copy_reloc.
10781 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
10782 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
10783 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
10784 instead of the removed Target_x86_64::may_need_copy_reloc.
10786 2009-09-30 Ian Lance Taylor <iant@google.com>
10788 * object.h (class Object): Remove target_ field, and target,
10789 sized_target, and set_target methods.
10790 (Object::sized_target): Remove.
10791 (class Sized_relobj): Update declarations. Remove sized_target.
10792 * object.cc (Sized_relobj::setup): Remove target parameter.
10793 Change all callers.
10794 (Input_objects::add_object): Don't do anything with the target.
10795 (make_elf_sized_object): Add punconfigured parameter. Change all
10796 callers. Set or test parameter target.
10797 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
10798 Change all callers.
10799 * parameters.cc (Parameters::set_target): Change parameter type to
10801 (Parameters::default_target): Remove.
10802 (set_parameters_target): Change parameter type to be non-const.
10803 (parameters_force_valid_target): New function.
10804 (parameters_clear_target): New function.
10805 * parameters.h (class Parameters): Update declarations. Remove
10806 default_target method. Add sized_target and clear_target
10807 methods. Change target_ to be non-const.
10808 (set_parameters_target): Update declaration.
10809 (parameters_force_valid_target): Declare.
10810 (parameters_clear_target): Declare.
10811 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
10812 as NULL if we aren't searching.
10813 (Add_symbols::run): Don't check for compatible target.
10814 * fileread.cc (Input_file::open_binary): Call
10815 parameters_force_valid_target.
10816 * gold.cc (queue_middle_tasks): Likewise.
10817 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
10818 set_target on object.
10819 * dynobj.h (class Sized_dynobj): Update declarations.
10820 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
10821 make_elf_object returns NULL.
10822 (Archive::include_member): Don't check whether object target is
10824 * output.cc (Output_section::add_input_section): Get target from
10826 (Output_section::relax_input_section): Likewise.
10827 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
10829 (Sized_relobj::do_scan_relocs): Likewise.
10830 (Sized_relobj::relocate_sections): Likewise.
10831 * resolve.cc (Symbol_table::resolve): Likewise.
10832 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
10833 parameter. Change all callers.
10834 (Symbol_table::add_from_object): Get target from parameters.
10835 (Symbol_table::add_from_relobj): Don't check object target.
10836 (Symbol_table::add_from_dynobj): Likewise.
10837 (Symbol_table::define_special_symbol): Get target from
10839 * symtab.h (class Symbol_table): Update declaration.
10840 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
10841 parameter. Change all callers. Clear parameter target.
10842 (Binary_test): Test target here.
10843 * testsuite/object_unittest.cc (gold_testsuite): Remove
10844 target_test_pointer parameter. Change all callers.
10845 (Object_test): Test target here.
10847 2009-09-26 Ian Lance Taylor <iant@google.com>
10849 * testsuite/initpri1.c: Don't try to use constructor priorities if
10850 compiling with gcc before 4.3.
10852 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
10854 * testsuite/retain_symbols_file_test.sh (check_present): Change
10855 output file name to retain_symbols_file_test.stdout.
10856 (check_absent): Likewise.
10858 2009-09-18 Craig Silverstein <csilvers@google.com>
10860 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
10861 * options.cc: Include <cerrno> and <fstream>.
10862 (General_options::finalize): Parse -retain-symbols-file tag.
10863 * options.h: New flag.
10864 (General_options): New method should_retain_symbol, new
10865 variable symbols_to_retain.
10866 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
10867 should_retain_symbol map.
10868 * testsuite/Makefile.am (retain_symbols_file_test): New test.
10869 * testsuite/Makefile.in: Regenerate.
10870 * testsuite/retain_symbols_file_test.sh: New file.
10872 2009-09-18 Nick Clifton <nickc@redhat.com>
10874 * po/es.po: Updated Spanish translation.
10876 2009-09-17 Doug Kwan <dougkwan@google.com>
10878 * debug.h (DEBUG_RELAXATION): New constant.
10879 (DEBUG_ALL): Add DEBUG_RELAXATION.
10880 (debug_string_to_enum): Add relaxation debug option.
10882 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
10883 Layout::Relaxation_debug_check::read_sections,
10884 Layout::Relaxation_debug_check::read_sections): New method definitions.
10885 (Layout::Layout): Initialize data members
10886 record_output_section_data_from_scrips_,
10887 script_output_section_data_list_ and relaxation_debug_check_.
10888 (Layout::save_segments, Layout::restore_segments,
10889 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10890 Layout::relaxation_loop_body): New method definitions.
10891 (Layout::finalize): Support relaxation. Move section layout code to
10892 Layout::relaxation_loop_body.
10893 (Layout::set_asection_address_from_script): Move code for orphan
10894 section placement out.
10895 (Layout::place_orphan_sections_in_script): New method definition.
10896 * layout.h (Output_segment_headers, Output_file_header):
10897 New forward class declarations.
10898 (Layout::~Layout): Define.
10899 (Layout::new_output_section_data_from_script): New method definition.
10900 (Layout::place_orphan_sections_in_script): New method declaration.
10901 (Layout::Segment_states): New type declaration.
10902 (Layout::save_segments, Layout::restore_segments,
10903 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10904 Layout::relaxation_loop_body): New method declarations.
10905 (Layout::Output_section_data_list): New type declaration.
10906 (Layout::Relaxation_debug_check): New class definition.
10907 (Layout::record_output_section_data_from_script_,
10908 Layout::script_output_section_data_list_, Layout::segment_states_,
10909 Layout::relaxation_debug_check_): New data members.
10910 * output.cc: (Output_section_headers::do_size): New method definition.
10911 (Output_section_headers::Output_section_headers): Move size
10912 computation to Output_section_headers::do_size.
10913 (Output_segment_headers::do_size): New method definition.
10914 (Output_file_header::Output_file_header): Move size computation to
10915 Output_file_header::do_size and call it.
10916 (Output_file_header::do_size): New method definition.
10917 (Output_data_group::Output_data_group): Adjust call to
10918 Output_section_data.
10919 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
10920 (Output_symtab_xindex::do_write): Add array bound check.
10921 (Output_section::Input_section::print_to_mapfile): Handle
10922 RELAXED_INPUT_SECTION_CODE.
10923 (Output_section::Output_section): Initialize data member checkpoint_.
10924 (Output_section::~Output_section): Delete checkpoint object pointed
10926 (Output_section::add_input_section): Always add an Input_section if
10928 (Output_section::add_merge_input_section): Add assert.
10929 (Output_section::relax_input_section): New method definition.
10930 (Output_section::set_final_data_size): Set load address to zero for
10931 an unallocated section.
10932 (Output_section::do_address_and_file_offset_have_reset_values):
10933 New method definition.
10934 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
10935 Handle relaxed input section.
10936 (Output_section::sort_attached_input_sections): Checkpoint input
10937 section list lazily.
10938 (Output_section::get_input_sections): Change type of input_sections to
10939 list of Simple_input_section pointers. Checkpoint input section list
10940 lazily. Also handle relaxed input sections.
10941 (Output_section::add_input_section_for_script): Take a reference to
10942 a Simple_input_section object instead of Relobj pointer and section
10943 index as parameter. Handle relaxed input sections.
10944 (Output_section::save_states, Output_section::restore_states): New
10945 method definitions.
10946 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
10947 (Output_data::is_data_size_fixed): New method definition.
10948 (Output_data::reset_addresss_and_file_offset): Do not reset data size
10950 (Output_data::address_and_file_offset_have_reset_values): New method
10952 (Output_data::do_address_and_file_offset_have_reset_values): New method
10954 (Output_data::set_data_size): Check that data size is not fixed.
10955 (Output_data::fix_data_size): New method definition.
10956 (Output_data::is_data_size_fixed_): New data member.
10957 (Output_section_headers::set_final_data_size): New method definition.
10958 (Output_section_headers::do_size): New method declaration.
10959 (Output_segment_headers::set_final_data_size): New method definition.
10960 (Output_segment_headers::do_size): New method declaration.
10961 (Output_file_header::set_final_data_size)::New method definition.
10962 (Output_file_header::do_size)::New method declaration.
10963 (Output_section_data::Output_section_data): Add new parameter
10964 is_data_size_fixed and use it to fix data size.
10965 (Output_data_const::Output_data_const): Adjust call to base class
10966 constructor and fix data size.
10967 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
10968 base class constructor and fix data size.
10969 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
10970 base class constructor and fix data size.
10971 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
10972 class constructor and fix data size.
10973 (Output_data_group::set_final_data_size): New method definition.
10974 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
10975 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
10976 class constructor and fix data size.
10977 (Output_relaxed_input_section): New class definition.
10978 (Output_section::Simple_input_section): New class definition.
10979 (Output_section::get_input_sections): Adjust parameter list.
10980 (Output_section::add_input_section_for_script): Same.
10981 (Output_section::save_states, Output_section::restore_states,
10982 Output_section::do_address_and_file_offset_have_reset_values,
10983 (Output_section::Input_section::Input_section): Handle
10984 RELAXED_INPUT_SECTION_CODE. Add new overload for
10985 Output_relaxed_input_section.
10986 (Output_section::Input_section::is_input_section,
10987 Output_section::Input_section::set_output_section): Handle relaxed
10989 (Output_section::Input_section::is_relaxed_input_section,
10990 Output_section::Input_section::output_section_data,
10991 Output_section::Input_section::relaxed_input_section): New method
10993 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
10995 (Output_section::Input_section::u1_): Update comments.
10996 (Output_section::Input_section::u2_): Add new union member poris.
10997 (Output_section::Checkpoint_output_section): New classs definition.
10998 (Output_section::relax_input_section): New method declaration.
10999 (Output_section::checkpoint_): New data member.
11000 (Output_segment): Update comments.
11001 (Output_segment::Output_segment): Un-privatize copy constructor.
11002 (Output_segment::operator=): Un-privatize.
11003 * script-sections.cc (Output_section_element::Input_section_list):
11004 Change element type to Output_section::Simple_input_section.
11005 (Output_section_element_dot_assignment::set_section_addresses):
11006 Register output section data for relaxation clean up.
11007 (Output_data_exression::Output_data_expression): Adjust call to base
11008 constructor to fix data size.
11009 (Output_section_element_data::set_section_addresses): Register
11010 Output_data_expression object for relaxation clean up.
11011 (struct Input_section_info): Replace Relobj pointer and section index
11012 pair with Output_section::Simple_input_section and Convert struct to a
11014 (Input_section_sorter::operator()): Adjust access to
11015 Input_section_info data member to use accessors.
11016 (Output_section_element_input::set_section_addresses): Use layout
11017 parameter. Adjust code to use Output_section::Simple_input_section
11018 and Input_secction_info classes. Register filler for relaxation
11020 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
11021 and section index pair with Output_section::Simple_input_section
11022 class. Adjust code accordingly.
11023 (Phdrs_element::release_segment): New method definition.
11024 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
11026 (Script_sections::release_segments): New method definition.
11027 * gold/script-sections.h (Script_sections::release_segments): New
11028 method declaration.
11029 * gold/target.h (Target::may_relax, Target::relax,
11030 Target::do_may_relax, Target::do_relax): New method definitions.
11032 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11034 * arm.cc (has_signed_unsigned_overflow): New function.
11035 (Arm_relocate_functions::abs8): New function.
11036 (Target_arm::Scan::local): Handle R_ARM_ABS8.
11037 (Target_arm::Scan::global): Likewise.
11038 (Target_arm::relocate::relocate): Likewise.
11039 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11042 2009-09-16 Cary Coutant <ccoutant@google.com>
11044 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
11045 * testsuite/Makefile.in: Regenerate.
11047 2009-09-11 Nick Clifton <nickc@redhat.com>
11049 * po/gold.pot: Updated by the Translation project.
11051 2009-09-08 Cary Coutant <ccoutant@google.com>
11053 * output.cc (Output_file::open): Add execute permission to empty file.
11054 * testsuite/Makefile.am (permission_test): New test.
11055 * testsuite/Makefile.in: Regenerate.
11057 2009-09-02 Ian Lance Taylor <iant@google.com>
11059 * output.cc (Output_file::resize): Call map_no_anonymous rather
11062 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
11064 * gold.cc: Include "incremental.h".
11065 (queue_initial_tasks): Call Incremental_checker methods.
11066 * incremental.cc: Include "output.h".
11067 (Incremental_checker::can_incrementally_link_output_file): New
11069 * incremental.h (Incremental_checker): New class.
11071 * output.cc (Output_file::open_for_modification): New method.
11072 (Output_file::map_anonymous): Changed return type to bool. Record
11073 map in base_ field.
11074 (Output_file::map_no_anonymous): New method, broken out of map.
11075 (Output_file::map): Use map_no_anonymous and map_anonymous.
11076 * output.h (class Output_file): Update declarations.
11078 2009-08-24 Cary Coutant <ccoutant@google.com>
11080 * options.h (Command_line::Pre_options): New class.
11081 (Command_line::pre_options): New member.
11082 * options.cc (gold::options::ready_to_register): New variable.
11083 (One_option::register_option): Do nothing if not registering options.
11084 Assert if same short option registered twice.
11085 (General_options::General_options): Turn off option registration when
11087 (Command_line::Pre_options::Pre_options): New constructor.
11089 2009-08-24 Cary Coutant <ccoutant@google.com>
11091 * options.h (General_options::no_keep_memory): Remove incorrect
11094 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11096 * Makefile.am (am__skiplex, am__skipyacc): New.
11097 * Makefile.in: Regenerate.
11099 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11101 * Makefile.am (AM_CPPFLAGS): Renamed from ...
11102 (INCLUDES): ... this.
11103 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
11104 (AM_CPPFLAGS): Renamed from ...
11105 (INCLUDE): ... this.
11106 * Makefile.in, testsuite/Makefile.in: Regenerate.
11108 * Makefile.in: Regenerate.
11109 * aclocal.m4: Likewise.
11110 * config.in: Likewise.
11111 * configure: Likewise.
11112 * testsuite/Makefile.in: Likewise.
11114 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11115 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11116 * Makefile.in: Regenerate.
11117 * testsuite/Makefile.in: Regenerate.
11119 2009-08-19 Cary Coutant <ccoutant@google.com>
11121 * resolve.cc (Symbol_table::resolve): Don't complain about defined
11122 symbols in shared libraries overridden by hidden or internal symbols
11123 in the main program.
11125 2009-08-19 Chris Demetriou <cgd@google.com>
11127 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
11128 checking source file names in error messages.
11130 2009-08-18 Doug Kwan <dougkwan@google.com>
11132 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
11133 an elcpp::Ehdr as parameter. Adjust call to set_target.
11134 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
11135 an elfcpp::Ehdr as parameter.
11136 * object.cc (Object::set_target): Remove the version that looks up
11137 a target and sets it.
11138 (Sized_relobj::setup): Take a Target object instead of
11139 an elfcpp::Ehdr as parameter. Adjust call to set_target.
11140 (make_elf_sized_object): Find target and ask target to
11141 make an ELF object.
11142 * object.h: (Object::set_target): Remove the version that looks up
11143 a target and sets it.
11144 (Sized_relobj::setup): Take a Target object instead of
11145 an elfcpp:Ehdr as parameter.
11146 * target.cc: Include dynobj.h.
11147 (Target::do_make_elf_object_implementation): New.
11148 (Target::do_make_elf_object): New.
11149 * target.h (Target::make_elf_object): New template declaration.
11150 (Target::do_make_elf_object): New method declarations.
11151 (Target::do_make_elf_object_implementation): New template declaration.
11153 2009-08-14 Ian Lance Taylor <iant@google.com>
11155 * gold.h (FUNCTION_NAME): Define.
11156 (gold_unreachable): Use FUNCTION_NAME.
11158 2009-08-12 Sriraman Tallam <tmsriram@google.com>
11160 * icf.cc (Icf::find_identical_sections): Issue a warning when a
11161 symbol in the --keep-unique list is not found.
11163 2009-08-12 Sriraman Tallam <tmsriram@google.com>
11165 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
11166 been maked as --keep-unique.
11167 (Icf::unfold_section): New function.
11168 * icf.h (Icf::unfold_section): New function.
11169 * options.h (General_options::keep_unique): New option.
11170 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
11171 * testsuite/Makefile.in: Regenerate.
11172 * testsuite/icf_keep_unique_test.sh: New file.
11173 * testsuite/icf_keep_unique_test.cc: New file.
11175 2009-08-12 Cary Coutant <ccoutant@google.com>
11178 * resolve.cc (Symbol_table::resolve): Check for references from
11179 dynamic objects to hidden and internal symbols.
11180 * testsuite/Makefile.am (hidden_test.sh): New test.
11181 * testsuite/Makefile.in: Regenerate.
11182 * testsuite/hidden_test.sh: New script.
11183 * testsuite/hidden_test_1.c: New test source.
11184 * testsuite/hidden_test_main.c: New test source.
11186 2009-08-11 Doug Kwan <dougkwan@google.com>
11188 * arm.cc: Update comments.
11189 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
11190 segment to locate the .ARM.exidx section if present.
11192 2009-08-09 Doug Kwan <dougkwan@google.com>
11194 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
11197 2009-08-07 Sriraman Tallam <tmsriram@google.com>
11198 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
11201 2009-08-06 Sriraman Tallam <tmsriram@google.com>
11203 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
11204 valid tls_segment only for non-debug-section relocations.
11205 * testsuite/Makefile.am: Add gc_tls_test.
11206 * testsuite/Makefile.in: Regenerate.
11207 * testsuite/gc_tls_test.cc: New file.
11208 * testsuite/gc_tls_test.sh: New file.
11210 2009-08-05 Sriraman Tallam <tmsriram@google.com>
11212 * icf.cc: New file.
11214 * Makefile.am (CCFILES): Add icf.cc.
11215 (HFILES): Add icf.h
11216 * Makefile.in: Regenerate.
11217 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
11218 * gc.h (gc_process_relocs): Populate lists used by icf to contain
11219 section, symbol and addend information for the relocs.
11220 * gold.cc (queue_middle_tasks): Call identical code folding.
11221 * gold.h: Add defines for multimap.
11222 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
11223 to the call of finalize_local_symbols.
11224 * main.cc (main): Create object of class Icf.
11225 * object.cc (Sized_relobj::do_layout): Allow this function to be
11226 called twice during icf.
11227 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
11228 to sections marked as identical by icf.
11229 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
11231 (Sized_relobj::do_section_entsize): New function.
11232 * object.h (Object::section_entsize): New function.
11233 (Object::do_section_entsize): New pure virtual function.
11234 (Relobj::finalize_local_symbols): Add new parameter.
11235 (Relobj::do_section_entsize): New function.
11236 * options.h (General_options::icf): New option.
11237 (General_options::icf_iterations): New option.
11238 (General_options::print_icf_sections): New option.
11239 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
11240 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
11241 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
11243 * symtab.cc (Symbol_table::is_section_folded): New function.
11244 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
11245 to sections marked as identical by icf.
11246 * symtab.h (Symbol_table::set_icf): New function.
11247 (Symbol_table::icf): New function.
11248 (Symbol_table::is_section_folded): New function.
11249 (Symbol_table::icf_): New data member.
11250 * target-reloc.h (relocate_section): Ignore sections folded by icf.
11251 * testsuite/Makefile.am: Add commands to build icf_test.
11252 * testsuite/Makefile.in: Regenerate.
11253 * testsuite/icf_test.sh: New file.
11254 * testsuite/icf_test.cc: New file.
11256 2009-07-24 Chris Demetriou <cgd@google.com>
11258 * layout.cc (is_compressible_debug_section): Fix incorrect
11259 comment about compressed section names.
11261 2009-07-20 Ian Lance Taylor <ian@airs.com>
11264 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
11266 2009-07-16 Ian Lance Taylor <iant@google.com>
11269 * layout.h: #include <map>.
11270 (class Kept_section): Change from struct to class. Add accessors
11271 and setters. Add section size to Comdat_group mapping. Change
11272 Comdat_group to std::map. Add is_comdat_ field. Add
11273 linkonce_size field in union.
11274 (class Layout): Update declaration of find_or_add_kept_section.
11275 Don't declare find_kept_object.
11276 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
11277 parameter. Add object, shndx, is_comdat, and is_group_name
11278 parameters. Change all callers. Adjust for new Kept_section.
11279 (Layout::find_kept_object): Remove.
11280 * object.cc (Sized_relobj::include_section_group): Update use of
11281 Kept_section. Rename secnum to shndx. Only record
11282 Kept_comdat_section if sections are the same size.
11283 (Sized_relobj::include_linkonce_section): Update use of
11284 Kept_section. Only record Kept_comdat_section if sections are the
11285 same size. Set size of linkonce section.
11286 (Sized_relobj::map_to_kept_section): Update call to
11287 get_kept_comdat_section.
11288 * object.h (class Sized_relobj): Rename fields in
11289 Kept_comdat_section to drop trailing underscores; change object
11290 field to Relobj*. Change Kept_comdat_section_table to store
11291 struct rather than pointer.
11292 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
11293 Add kept_object and kept_shndx parameters. Change all callers.
11294 (Sized_relobj::get_kept_comdat_section): Change return type to
11295 bool. Add kept_object and kept_shndx parameters. Change all
11297 * plugin.cc (Pluginobj::include_comdat_group): Update call to
11298 Layout::find_or_add_kept_section.
11300 2009-07-09 Ian Lance Taylor <iant@google.com>
11302 * merge.cc (Object_merge_map::initialize_input_to_output_map):
11303 Reserve space in the hash table.
11305 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
11307 * fileread.cc (File_read::get_mtime): New method.
11308 * fileread.h (Timespec): New structure.
11309 (File_read::get_mtime): New method.
11310 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
11311 Renamed from timestamp_nsec.
11312 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
11314 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
11316 (Incremental_inputs::report_archive): Save mtime; style fix.
11317 (Incremental_inputs::report_obejct): Save mtime; style fix.
11318 (Incremental_inputs::report_script): Save mtime; style fix.
11319 (Incremental_inputs::finalize_inputs): Style fix.
11320 (Incremental_inputs::finalize): Style fix.
11321 (Incremental_inputs::create_input_section_data): Store inputs
11323 * incremental.h (Incremental_inputs::report_script): Add mtime
11325 (Incremental_inputs::Input_info::Input_info): Intialize only one
11327 (Incremental_inputs::Input_info::archive): Move to nameless
11329 (Incremental_inputs::Input_info::obejct): Move to nameless union.
11330 (Incremental_inputs::Input_info::script): Move to nameless union.
11331 (Incremental_inputs::mtime): New field.
11332 * script.cc (read_input_script): Pass file mtime to
11334 * script.h (Script_info::inputs): Style fix.
11336 2009-07-01 Ian Lance Taylor <ian@airs.com>
11338 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
11341 2009-06-24 Ian Lance Taylor <iant@google.com>
11344 * layout.cc (Layout::choose_output_section): If we find an
11345 existing section, update the flags.
11346 (Layout::create_notes): New function, broken out of
11348 (Layout::finalize): Don't create note sections.
11349 (Layout::create_note): Don't crash if linker script discards
11351 (Layout::create_gold_note): Likewise.
11352 (Layout::create_build_id): Likewise. Don't set
11353 after_input_sections on the section.
11354 (Layout::create_executable_stack_info): Remove target parameter.
11356 * layout.h (class Layout): Declare create_notes. Update
11357 declaration of create_executable_stack_info.
11358 * gold.cc (queue_middle_tasks): Call create_notes.
11359 * output.cc (Output_section::update_flags_for_input_section): Move
11360 here from output.h. If SHF_ALLOC flag is newly set, mark address
11362 * output.h (Output_data::mark_address_invalid): New function.
11363 (class Output_section): Only declare, not define,
11364 update_flags_for_input_section. Remove set_flags.
11366 2009-06-24 Ian Lance Taylor <iant@google.com>
11368 * script-sections.cc (Output_section_definition::
11369 set_section_addresses): Rename shadowing local load_address to
11372 2009-06-24 Ian Lance Taylor <iant@google.com>
11375 * reloc.cc (relocate_sections): Skip empty relocation sections.
11377 2009-06-23 Ian Lance Taylor <iant@google.com>
11380 * layout.cc (Layout::create_note): Use choose_output_section
11381 rather than make_output_section.
11383 2009-06-23 Ian Lance Taylor <iant@google.com>
11386 * options.cc (General_options::parse_V): Set printed_version_.
11387 (General_options::General_options): Initialize printed_version_.
11388 * options.h (class General_options): Add printed_version_ field.
11389 * gold.cc (queue_initial_tasks): If there are no input files,
11390 don't give a fatal error if we printed the version information.
11391 (queue_middle_tasks): If using -r with a shared object, give a
11392 fatal error rather than an ordinary error.
11394 2009-06-23 Ian Lance Taylor <iant@google.com>
11397 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
11398 (Layout::make_output_section): Set have_stabstr_section_ if we see
11399 a .stab*str section.
11400 (Layout::finalize): Call link_stabs_sections.
11401 (Layout::link_stabs_sections): New file.
11402 * layout.h (class Layout): Add have_stabstr_section_ field.
11403 Declare link_stabs_sections.
11405 2009-06-23 Doug Kwan <dougkwan@google.com>
11407 * Makefile.am (libgold_a_LIBADD): New.
11408 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
11409 * Makefile.in: Regenerate.
11410 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
11411 * configure: Regenerate.
11412 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
11413 * fileread.cc: Include sys/state.h
11414 * gold.h: Declare memmem and strndup if found missing.
11415 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
11417 2009-06-23 Ian Lance Taylor <iant@google.com>
11419 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
11420 * configure: Rebuild.
11422 2009-06-23 Ian Lance Taylor <iant@google.com>
11425 * object.cc (Object::section_contents): Don't try to get a view if
11426 the section has length zero.
11427 (Object::handle_gnu_warning_section): If the section is empty, use
11428 the name of the section as the warning.
11430 2009-06-23 Ian Lance Taylor <iant@google.com>
11433 * stringpool.h (class Stringpool_template): Add optimize_ field.
11434 (Stringpool_template::set_optimize): New function.
11435 * stringpool.cc (Stringpool_template::Stringpool_template):
11436 Initialize optimize_ field.
11437 (Stringpool_template::set_string_offsets): Test local optimize
11438 fild rather than parameter.
11439 * layout.cc (Layout::Layout): Call set_optimize on the section
11442 2009-06-22 Ian Lance Taylor <iant@google.com>
11445 * yyscript.y: Parse TARGET.
11446 * script.cc (script_set_target): New function.
11447 * script-c.h (script_set_target): Declare.
11448 * options.cc (General_options::string_to_object_format): Rename
11449 from string_to_object_format in anonymous namespace. Change
11451 * options.h (class General_options): Declare
11452 string_to_object_format.
11454 2009-06-22 Ian Lance Taylor <iant@google.com>
11456 * script-sections.cc (Script_sections::create_segments): Don't put
11457 program headers in a PT_LOAD segment if -n or -N.
11459 2009-06-22 Ian Lance Taylor <iant@google.com>
11462 * options.h (class General_options): Add -z lazy and -z now. Sort
11463 -z options into alphabetical order.
11464 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
11466 2009-06-21 Ian Lance Taylor <iant@google.com>
11468 * layout.cc (Layout::make_output_section): Call
11469 Target::new_output_section.
11470 (Layout::attach_allocated_section_to_segment): Put large section
11471 sections in a separate load segment with the large segment flag
11473 (Layout::segment_precedes): Sort large data segments after other
11475 (align_file_offset): New static function.
11476 (Layout::set_segment_offsets): Use align_file_offset.
11477 * output.h (class Output_section): Add is_small_section_ and
11478 is_large_section_ fields.
11479 (Output_section::is_small_section): New function.
11480 (Output_section::set_is_small_section): New function.
11481 (Output_section::is_large_section): New function.
11482 (Output_section::set_is_large_section): New function.
11483 (Output_section::is_large_data_section): New function.
11484 (class Output_segment): Add is_large_data_segment_ field.
11485 (Output_segment::is_large_data_segment): New function.
11486 (Output_segment::set_is_large_data_segment): New function.
11487 * output.cc (Output_section::Output_section): Initialize new
11489 (Output_segment::Output_segment): Likewise.
11490 (Output_segment::add_output_section): Add assertion that large
11491 data sections always go in large data segments. Force small data
11492 sections to the end of the list of data sections. Force small BSS
11493 sections to the start of the list of BSS sections. For large BSS
11494 sections to the end of the list of BSS sections.
11495 * symtab.h (class Symbol): Declare is_common_shndx.
11496 (Symbol::is_defined): Check Symbol::is_common_shndx.
11497 (Symbol::is_common): Likewise.
11498 (class Symbol_table): Define enum Commons_section_type. Update
11499 declarations. Add small_commons_ and large_commons_ fields.
11500 * symtab.cc (Symbol::is_common_shndx): New function.
11501 (Symbol_table::Symbol_table): Initialize new fields.
11502 (Symbol_table::add_from_object): Put small and large common
11503 symbols in the right list.
11504 (Symbol_table::sized_finalized_symbol): Check
11505 Symbol::is_common_shndx.
11506 (Symbol_table::sized_write_globals): Likewise.
11507 * common.cc (Symbol_table::do_allocate_commons): Allocate new
11508 common symbol lists. Don't call do_allocate_commons_list if the
11510 (Symbol_table::do_allocate_commons_list): Remove is_tls
11511 parameter. Add comons_section_type parameter. Change all
11512 callers. Handle small and large common symbols.
11513 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
11514 Symbol::is_common_shndx.
11515 * resolve.cc (symbol_to_bits): Likewise.
11516 * target.h (Target::small_common_shndx): New function.
11517 (Target::small_common_section_flags): New function.
11518 (Target::large_common_shndx): New function.
11519 (Target::large_common_section_flags): New function.
11520 (Target::new_output_section): New function.
11521 (Target::Target_info): Add small_common_shndx, large_common_shndx,
11522 small_common_section_flags, and large_common_section_flags
11524 (Target::do_new_output_section): New virtual function.
11525 * arm.cc (Target_arm::arm_info): Initialize new fields.
11526 * i386.cc (Target_i386::i386_info): Likewise.
11527 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
11529 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
11530 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11531 (Target_x86_64::do_new_output_section): New function.
11532 * configure.ac: Define conditional MCMODEL_MEDIUM.
11533 * testsuite/Makefile.am (check_PROGRAMS): Add large.
11534 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
11535 (large_LDFLAGS): Define.
11536 * testsuite/large.c: New file.
11537 * testsuite/testfile.cc (Target_test::test_target_info):
11538 Initialize new fields.
11539 * configure, testsuite/Makefile.in: Rebuild.
11541 2009-06-05 Doug Kwan <dougkwan@google.com>
11543 * Makefile.am (CCFILES): Add target.cc.
11544 * Makefile.in: Regenerate.
11545 * i386.cc (class Target_i386): Define new virtual method to
11546 override do_is_local_label_name in parent.
11547 * object.cc (Sized_relobj::do_count_local_symbols): Discard
11548 local symbols if --discard-locals or -X is given.
11549 * options.h (class General_options): Declare new options
11550 '--discard-locals' and '-X' for discarding locals.
11551 * target.h (class Target): Define new methods is_local_label_name.
11552 Declare new virtual method do_is_local_label_name.
11553 * target.cc: New file.
11554 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
11555 (check_SCRIPTS): Add discard_locals_test.sh.
11556 (check_DATA): Add discard_local_tests.syms.
11557 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
11558 (discard_local_tests.syms, discard_locals_test.o): New make rules.
11559 * testsuite/Makefile.in: Regenerate.
11560 * testsuite/discard_locals_test.c: New file.
11561 * testsuite/discard_locals_test.sh: Same.
11563 2009-06-05 Doug Kwan <dougkwan@google.com>
11565 * object.cc (Sized_relobj::Sized_relobj): Initialize
11566 discarded_eh_frame_shndx_ to -1U.
11567 (Sized_relobj::do_layout): Record index of a discard .eh_frame
11569 (Sized_relobj::do_count_local_symbols): Skip local symbols in
11570 a discarded .eh_frame section.
11571 (Sized_relobj::do_finalize_local_symbols): Ditto.
11572 * object.h (class Sized_relobj): Declare new member
11573 discarded_eh_frame_shndx_.
11574 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
11575 (local_labels_test.o, local_labels_test): New rules.
11576 * testsuite/Makefile.in: Regenerate.
11578 2009-06-04 Doug Kwan <dougkwan@google.com>
11580 * layout.cc (Layout::section_name_mapping): Add mapping for
11581 special ARM sections.
11583 2009-06-03 Doug Kwan <dougkwan@google.com>
11585 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
11586 (utils::has_overflow): Same.
11588 2009-06-03 Ian Lance Taylor <iant@google.com>
11590 * layout.cc (Layout::section_name_mapping): New array, replacing
11591 Layout::linkonce_mapping.
11592 (Layout::section_name_mapping_count): New variable, replacing
11593 Layout::linkonce_mapping_count.
11594 (Layout::linkonce_output_name): Remove.
11595 (Layout::output_section_name): Rewrite.
11596 * layout.h (class Layout): Rename Linkonce_mapping to
11597 Section_name_mapping, linkonce_mapping to section_name_mapping,
11598 linkonce_mapping_count to section_name_mapping_count. Don't
11599 declare linkonce_output_name.
11601 2009-06-03 Doug Kwan <dougkwan@google.com>
11603 * gold/arm.cc (namespace utils): New.
11604 (Target_arm::reloc_is_non_pic): Define new method.
11605 (class Arm_relocate_functions): New.
11606 (Target_arm::Relocate::relocate): Handle relocation types used by
11609 2009-06-03 Ian Lance Taylor <iant@google.com>
11611 * arm.cc (Target_arm::scan::global): Use || instead of |.
11613 2009-06-02 Doug Kwan <dougkwan@google.com>
11615 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
11616 issued_non_pic_error_.
11617 (class Target_arm::Scan): Declare new method check_non_pic.
11618 Define new method symbol_needs_plt_entry.
11619 Declare new data member issued_non_pic_error_.
11620 (class Target_arm::Relocate): Declare new method
11621 should_apply_static_reloc.
11622 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
11623 (Target_arm::Scan::check_non_pic): Define new method.
11624 (Target_arm::Scan::local): Handle a small subset of reloc types used
11626 (Target_arm::Scan::local): Same.
11627 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
11629 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
11631 * incremental.cc (Incremental_inputs::report_command_line): Filter
11632 out --incremental-* options.
11634 2009-05-29 Doug Kwan <dougkwan@google.com>
11636 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
11638 (class Target_arm): Update comment.
11639 (Target_arm::Target_arm): Initialize new data members GOT_,
11640 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
11641 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
11642 and Target_arm::rel_dyn_section.
11643 Declare new_enum Target_arm::Got_type.
11644 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
11646 Update commments for member do_dynsym_value.
11647 (Target_arm::got_size, Target_arm::plt_section,
11648 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
11649 new methods inside class defintion.
11650 (Target_arm::got_section): Define new method.
11651 (Target_arm::rel_dyn_section): Same.
11652 (Output_data_plt_arm): New template class.
11653 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
11654 (Output_data_plt_arm:do_adjust_output_section): Define new method.
11655 (Output_data_plt_arm::add_entry): Same.
11656 (Output_data_plt_arm::first_plt_entry): Define new
11657 static data member for PLT instruction template.
11658 (Output_data_plt_arm::plt_entry): Same.
11659 (Output_data_plt_arm::do_write): Define new method.
11660 (Target_arm::make_plt_entry): Same.
11661 (Target_arm::do_finalize_sections): Same.
11662 (Target_arm::do_dynsym_value): Same.
11664 2009-05-28 Doug Kwan <dougkwan@google.com>
11666 * Makefile.am (TARGETSOURCES): Add arm.cc.
11667 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
11668 * Makefile.in: Regenerate.
11669 * arm.cc: New file.
11670 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
11672 2009-05-26 Doug Kwan <dougkwan@google.com>
11674 * options.cc (General_options::parse_exclude_libs). Fix a comment.
11675 (General_options::check_excluded_libs): Strip off directories in
11676 archive name before matching like GNU ld does.
11677 * testsuite/Makefile.am (MOSTLYCLEANFILES,
11678 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
11679 (exclude_libs_test_LDFLAGS): Add linker option
11680 -Wl,--exclude-libs,libexclude_libs_test_3
11681 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
11682 an explicit archive without using -l.
11683 (alt/libexclude_libs_test_3.a): New make rule.
11684 * testsuite/Makefile.in: Regenerate.
11685 * testsuite/exclude_libs_test.c : Declare lib3_default().
11687 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
11688 * exclude_libs_test_3.c: New file.
11690 2009-05-26 Nick Clifton <nickc@redhat.com>
11692 * po/id.po: New Indonesian translation.
11693 * po/gold.pot: Updated template file.
11695 2009-05-22 Sriraman Tallam <tmsriram@google.com>
11697 * testsuite/Makefile.am: Add -ffunction-sections to compile
11698 gc_comdat_test files. Add -Wl,--gc-sections to build
11700 * testsuite/Makefile.in: Regenerate.
11701 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
11703 2009-05-21 Sriraman Tallam <tmsriram@google.com>
11705 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
11706 kept comdat section was garbage collected.
11707 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
11708 * testsuite/Makefile.in: Regenerate.
11709 * testsuite/gc_comdat_test.sh: New file.
11710 * testsuite/gc_comdat_test_1.cc: New file.
11711 * testsuite/gc_comdat_test_2.cc: New file.
11713 2009-05-19 Doug Kwan <dougkwan@google.com>
11715 * archive.cc (Archive::Archive): Move constructor from archive.h
11716 to here. Initialize no_export_.
11717 (Archive::get_elf_object_for_member): Set no_export flag of object.
11718 * archive.h (Archive::Archive): Move constructor body to
11720 (Archive::no_export): New method.
11721 (Archive::no_export_): New field.
11722 * object.h (Object::Object): Initialize no_export_ to false.
11723 (Object::no_export, Object::set_no_export): New methods.
11724 (Object::no_export_): New field.
11725 * options.cc (General_options::parse_exclude_libs): New method.
11726 (General_options::check_excluded_libs) Same.
11727 * options.h (exclude_libs): New option.
11728 (General_options::check_excluded_libs): New method declaration.
11729 (General_options::excluded_libs_): New field.
11730 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
11731 default or protected visibility if an object has no-export flag set.
11732 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
11733 (check_SCRIPTS): Add exclude_libs_test.sh.
11734 (check_DATA): Add exclude_libs_test.syms.
11735 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
11736 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
11737 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
11738 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
11739 (exclude_libs_test.syms, libexclude_libs_test_1.a,
11740 libexclude_libs_test_2.a): New rules.
11741 * testsuite/Makefile.in: Regenerate.
11742 * testsuite/exclude_libs_test.c: New file.
11743 * testsuite/exclude_libs_test.sh: Ditto.
11744 * testsuite/exclude_libs_test_1.c: Ditto.
11745 * testsuite/exclude_libs_test_2.c: Ditto.
11747 2009-05-15 Ian Lance Taylor <iant@google.com>
11749 * configure.ac: Check for declarations for cases where libiberty.h
11750 checks HAVE_DECL_xxx.
11751 * configure, config.in: Rebuild.
11753 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
11755 * gold.h (Incremental_argument_list): Remove (invalid) forward
11757 * incremental.cc (Incremental_inputs::report_achive): New method.
11758 (Incremental_inputs::report_object): New method.
11759 (Incremental_inputs::report_script): New method.
11760 (Incremental_inputs::finalize_inputs): New method.
11761 (Incremental_inputs::finalize): Call finalize_inputs().
11762 (Incremental_inputs::sized_create_incremental_inputs_section_data):
11763 Create inputs entries.
11764 * incremental.h (Incremental_input_type): New enum.
11765 (Incremental_inputs::Incremental_input): Initialize new fields.
11766 (Incremental_inputs::report_inputs): New method.
11767 (Incremental_inputs::report_achive): New method.
11768 (Incremental_inputs::report_object): New method.
11769 (Incremental_inputs::report_script): New method.
11770 (Incremental_inputs::finalize_inputs): New method.
11771 (Incremental_inputs::Input_info): New struct.
11772 (Incremental_inputs::Input_info_map): New typedef.
11773 (Incremental_inputs::lock_): New field.
11774 (Incremental_inputs::Inputs_): New field.
11775 (Incremental_inputs::Inputs_map): New field.
11776 * main.cc (main): Call Incremental_input::report_inputs.
11777 * options.h (Input_argument_list): Typedef moved from
11779 (Input_file_group::Files): Remove, use ::Input_argument_list.
11780 (Input_file_group::Input_argument_list): Remove, use
11781 ::Input_argument_list.
11782 * plugin.cc (Plugin_manager::add_input_file): Add error in
11784 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
11786 * script.cc (read_input_script): Call
11787 Incremental_input::report_script.
11788 * script.h (Script_info): New class.
11790 2009-04-27 Ian Lance Taylor <iant@google.com>
11792 * x86_64.cc (do_adjust_output_section): Set entsize to
11795 2009-04-23 Elliott Hughes <enh@google.com>
11797 * output.cc (Output_file::close): After short writes, continue
11798 writing from the correct offset in the buffer being written.
11800 2009-04-23 Chris Demetriou <cgd@google.com>
11802 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
11803 * configure: Regenerate.
11804 * config.in: Regenerate.
11805 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
11806 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
11808 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
11810 * incremental.cc (Incremental_inputs_header_data): Renamed from
11811 Incremental_input_header_data.
11812 (Incremental_inputs_header_data::data_size): New field.
11813 (Incremental_inputs_header_data::put_input_file_count): Renamed
11814 from input_file_count.
11815 (Incremental_inputs_header_data::put_command_line_offset): Renamed
11816 from command_line_offset.
11817 (Incremental_inputs_header_data::put_reserved): Renamed from
11819 (Incremental_inputs_entry_data): Renamed from
11820 Incremental_input_entry_data.
11821 (Incremental_inputs_entry_data::data_size): New field.
11822 (Incremental_inputs::report_command_line): New method.
11823 (Incremental_inputs::finalize): New method.
11824 (Incremental_inputs::create_incremental_inputs_data): New method.
11825 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
11826 * incremental.h: New file.
11827 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
11828 (Layout::finalize): Create incremental inputs section in
11829 incremental builds.
11830 (Layout::create_incremental_info_sections): New method.
11831 * layout.h (Layout::incremental_inputs): New method.
11832 (Layout::create_incremental_info_sections): New method.
11833 (Layout::incremental_inputs_): New field.
11834 * main.cc (main): Notify Incremental_input of the command line.
11836 2009-04-01 Ian Lance Taylor <iant@google.com>
11837 Mikolaj Zalewski <mikolajz@google.com>
11839 * gold.h (reserve_unordered_map): Define, three versions, one for
11840 each version of Unordered_map.
11841 * layout.cc (Layout::Layout): Remove options parameter. Add
11842 number_of_input_files parameter. Don't initialize options_.
11843 Initialize number_of_input_files_ and resized_signatures_. Move
11844 sections_are_attached_.
11845 (Layout::layout_group): Reserve space for group_signatures_.
11846 (Layout::find_or_add_kept_section): Change name parameter to be a
11847 reference. Resize signatures_ map when it gets large enough.
11848 (Layout::layout_eh_frame): Use parameters->options() instead of
11850 (Layout::make_output_section): Likewise.
11851 (Layout::attach_allocated_section_to_segment): Likewise.
11852 (Layout::finalize, Layout::create_executable_stack): Likewise.
11853 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
11854 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
11855 * layout.h (class Layout): Update declarations. Remove options_
11856 field. Add number_of_input_files_ and resized_signatures_
11857 fields. Move sections_are_attached_ field.
11858 * main.cc (main): Pass number of input files to Layout
11859 constructor. Don't pass options.
11861 2009-03-30 Ian Lance Taylor <iant@google.com>
11863 * ffsll.c (ffsll): Correct implementation.
11865 2009-03-27 Ian Lance Taylor <iant@google.com>
11867 * ffsll.c: New file.
11868 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
11869 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
11870 * ftruncate.c (ftruncate): Declare before definition.
11871 * mremap.c (mremap): Likewise.
11872 * pread.c (pread): Likewise.
11873 * configure, Makefile.in, config.in: Rebuild.
11875 * mremap.c: New file.
11876 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
11877 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
11878 (mremap): Declare if HAVE_MREMAP is not defined.
11879 * configure, Makefile.in, config.in: Rebuild.
11881 2009-03-27 Cary Coutant <ccoutant@google.com>
11883 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
11884 position independent.
11885 * sparc.cc (Target_sparc::check_non_pic): Likewise.
11886 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
11888 2009-03-24 Cary Coutant <ccoutant@google.com>
11890 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
11892 (needs_dynamic_reloc): Likewise.
11894 2009-03-24 Ian Lance Taylor <iant@google.com>
11896 * yyscript.y (file_cmd): Recognize EXTERN.
11897 (extern_name_list, extern_name_list_body): New nonterminals.
11898 * script.cc (script_add_extern): Define.
11899 * script-c.h (script_add_extern): Declare.
11901 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
11903 * object.cc (is_elf_object): Define.
11904 * object.h (is_elf_object): Declare.
11905 * archive.cc (Archive::get_elf_object_for_member): Call
11907 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
11909 2009-03-24 Elliott Hughes <enh@google.com>
11911 * output.cc (Output_file::map_anonymous): Define.
11912 (Output_file::map): Use map_anonymous. If the regular mmap fails,
11913 try an anonymous one. Report the size if the mmap fails.
11914 * output.h (class Output_file): Declare map_anonymous.
11916 2009-03-24 Ian Lance Taylor <iant@google.com>
11918 * target-select.cc (instantiate_target): Don't acquire the lock if
11919 the instantiated_target_ field has already been set.
11921 2009-03-23 Ian Lance Taylor <iant@google.com>
11923 * gold-threads.h (class Initialize_lock): Define.
11924 * gold-threads.cc (class Initialize_lock_once): Define.
11925 (initialize_lock_control): New static variable.
11926 (initialize_lock_pointer): New static variable.
11927 (initialize_lock_once): New static function.
11928 (Initialize_lock::Initialize_lock): Define.
11929 (Initialize_lock::initialize): Define.
11930 * target-select.h: Include "gold-threads.h".
11931 (class Target_selector): Add lock_ and initialize_lock_ fields.
11932 Don't define instantiate_target, just declare it.
11933 * target-select.cc (Target_selector::Target_selector): Initialize
11935 (Target_selector::instantiate_target): Define.
11936 * descriptors.h: Include "gold-threads.h".
11937 (class Descriptors): Add initialize_lock_ field.
11938 * descriptors.cc (Descriptors::Descriptors): Initialize new
11940 (Descriptors::open): Use initialize_lock_ field
11941 * errors.h (class Errors): Add initialize_lock_ field.
11942 * errors.cc (Errors::Errors): Initialize new field.
11943 (Errors::initialize_lock): Use initialize_lock_ field.
11944 * powerpc.cc (class Target_selector_powerpc): Remove
11945 instantiated_target_ field. In do_recognize call
11946 instantiate_target rather than do_instantiate_target. In
11947 do_instantiate_target just allocate a new target.
11948 * sparc.cc (class Target_selector_sparc): Likewise.
11950 * freebsd.h: New file.
11951 * i386.cc: Include "freebsd.h".
11952 (Target_i386): Derive from Target_freebsd rather than
11954 (Target_selector_i386): Derive from Target_selector_freebsd rather
11955 than Target_selector.
11956 * x86_64.cc: Include "freebsd.h".
11957 (Target_x86_64): Derive from Target_freebsd rather than
11959 (Target_selector_x86_64): Derive from Target_selector_freebsd
11960 rather than Target_selector.
11961 * target.h (class Target): Add adjust_elf_header and
11962 do_adjust_elf_header.
11963 * output.cc (Output_file_header:: do_sized_write): Call target
11964 adjust_elf_header routine.
11965 * configure.tgt: Set targ_osabi.
11966 * configure.ac: Define GOLD_DEFAULT_OSABI.
11967 * parameters.cc (Parameters::default_target): Pass
11968 GOLD_DEFAULT_OSABI to select_target.
11969 * target-select.h (class Target_selector): Make instantiate_target
11970 protected rather than private.
11971 * Makefile.am (HFILES): Add freebsd.h.
11972 * configure, Makefile.in, config.in: Rebuild.
11974 * merge.cc (do_add_input_section): Correct pend value. Change
11975 message about last entry not being null terminated from error to
11978 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
11980 * incremental.cc: New file.
11981 * Makefile.am (CCFILES): Add incremental.cc.
11982 * Makefile.in: Rebuild.
11984 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
11986 * layout.cc (Layout::output_section_name): Preserve names
11987 of '.note.' sections.
11989 2009-03-19 Ian Lance Taylor <iant@google.com>
11991 * descriptors.cc (Descriptors::open): Check that the options are
11992 valid before using them.
11994 2009-03-18 Ian Lance Taylor <iant@google.com>
11996 * script-sections.h: Include <list>.
11997 (class Script_sections): Change Sections_elements from std::vector
11998 to std::list. Typedef public Elements_iterator. Add
11999 orphan_section_placement_, data_segment_align_start_, and
12000 saw_data_segment_align_ fields. Remove data_segment_align_index_
12002 * script-sections.cc (class Orphan_section_placement): New class.
12003 (class Sections_element): Add virtual functions is_relro and
12004 orphan_section_init. Remove virtual function place_orphan_here.
12005 (class Output_section_definition): Add is_relro and
12006 orphan_section_init. Remove place_orphan_here.
12007 (class Orphan_output_section): Likewise.
12008 (Script_sections::Script_sections): Update for field changes.
12009 (Script_sections::data_segment_align): Set saw_data_segment_align_
12010 and data_segment_align_start_, not data_segment_align_index.
12011 (Script_sections::data_segment_relro_end): Check
12012 saw_data_segment_align_. Use data_segment_align_start_ rather
12013 than data_segment_align_index_.
12014 (Script_sections::place_orphan): Rewrite to use
12015 Orphan_section_placement.
12017 2009-03-17 Ian Lance Taylor <iant@google.com>
12019 * archive.cc (Archive::add_symbols): Check for a version attached
12020 to the symbol name in the archive map.
12021 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
12022 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
12023 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
12024 (ver_test_11.a): New target.
12025 * testsuite/Makefile.in: Rebuild.
12027 * configure.ac: Check for chsize and posix_fallocate. Replace
12029 * ftruncate.c: New file, from gnulib.
12030 * output.cc (posix_fallocate): Define dummy version if not
12031 HAVE_POSIX_FALLOCATE.
12032 (Output_file::map): Call posix_fallocate rather than lseek and
12034 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
12035 * configure, Makefile.in, config.in: Rebuild.
12037 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
12039 * layout.h (Layout::create_note): Add section_name parameter.
12040 * layout.cc (Layout::create_note): Likewise.
12041 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
12043 2009-03-17 Ian Lance Taylor <iant@google.com>
12045 * descriptors.cc: Include "options.h".
12046 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
12047 (Descriptors::open): Always use O_CLOEXEC when opening a new
12048 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
12049 then set FD_CLOEXEC.
12051 * sparc.cc (class Target_sparc): Add has_got_section.
12052 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
12053 make sure we have a GOT section.
12055 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
12056 (Target_sparc::Scan::local): Likewise.
12057 (Target_sparc::Scan::global): Likewise.
12058 (Target_sparc::Relocate::relocate): Likewise.
12059 (Target_sparc::Relocate::relocate_tls): Likewise.
12061 * symtab.cc (Symbol_table::define_default_version): New function,
12062 broken out of add_from_object.
12063 (Symbol_table::add_from_object): Call define_default_version.
12064 (Symbol_table::define_special_symbol): Add resolve_oldsym
12065 parameter. Change all callers. If the version for a symbol comes
12066 from a version script, resolve it with the symbol with the same
12067 name with no version. Also add the symbol without a version if
12069 (do_define_in_output_data): If resolving with oldsym, don't delete
12071 (do_define_in_output_segment): Likewise.
12072 (do_define_as_constant): Likewise.
12073 * symtab.h (class Symbol_table): Update declarations.
12075 2009-03-13 Ian Lance Taylor <iant@google.com>
12077 * readsyms.cc (Read_symbols::incompatible_warning): New function.
12078 (Read_symbols::requeue): New function.
12079 (Read_symbols::do_read_symbols): If make_elf_object fails because
12080 the target type is not configured, and the file was searched for,
12081 issue a warning and retry with the next directory.
12082 (Add_symbols::run): If the file has an incompatible format, and
12083 it was searched for, requeue the Read_symbols task. On error,
12084 release the object.
12085 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
12086 dirindex parameter to constructor. Change all callers. Declare
12087 incompatible_warning and requeue.
12088 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
12089 input_argument_ and input_group_ fields. Add them to
12090 constructor. Change all callers.
12091 (class Read_script): Add dirindex_ field. Add it to constructor.
12092 Change all callers.
12093 * archive.cc (Archive::setup): Remove input_objects parameter.
12094 Change all callers.
12095 (Archive::get_file_and_offset): Likewise.
12096 (Archive::read_all_symbols): Likewise.
12097 (Archive::read_symbols): Likewise.
12098 (Archive::get_elf_object_for_member): Remove input_objects
12099 parameter. Add punconfigured parameter. Change all callers.
12100 (Archive::add_symbols): Change return type to bool. Check return
12101 value of include_member.
12102 (Archive::include_all_members): Likewise.
12103 (Archive::include_member): Change return type to bool. Return
12104 false if first included object has incompatible target. Set
12105 included_member_ field.
12106 (Add_archive_symbols::run): If add_symbols returns false, requeue
12108 * archive.h (class Archive): Add included_member_ field.
12109 Initialize it in constructor. Add input_file and searched_for
12110 methods. Update declarations.
12111 (class Add_archive_symbols): Add dirpath_, dirindex_, and
12112 input_argument_ fields. Add them to constructor. Change all
12114 * script.cc: Include "target-select.h".
12115 (class Parser_closure): Add skip_on_incompatible_target_ and
12116 found_incompatible_target_ fields. Add
12117 skip_on_incompatible_target parameter to constructor. Change all
12118 callers. Add methods skip_on_incompatible_target,
12119 clear_skip_on_incompatible_target, found_incompatible_target, and
12120 set_found_incompatible_target.
12121 (read_input_script): Add dirindex parameter. Change all callers.
12122 If parser finds an incompatible target, requeue Read_symbols
12124 (script_set_symbol): Clear skip_on_incompatible_target in
12126 (script_add_assertion, script_parse_option): Likewise.
12127 (script_start_sections, script_add_phdr): Likewise.
12128 (script_check_output_format): New function.
12129 * script.h (read_input_script): Update declaration.
12130 * script-c.h (script_check_output_format): Declare.
12131 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
12132 (ignore_cmd): Remove OUTPUT_FORMAT.
12133 * fileread.cc (Input_file::Input_file): Add explicit this.
12134 (Input_file::will_search_for): New function.
12135 (Input_file::open): Add pindex parameter. Change all callers.
12136 * fileread.h (class Input_file): Add input_file_argument method.
12137 Declare will_search_for. Update declarations.
12138 * object.cc (make_elf_object): Add punconfigured parameter.
12139 Change all callers.
12140 * object.h (class Object): Make input_file public. Add
12141 searched_for method.
12142 (make_elf_object): Update declaration.
12143 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
12145 * dirsearch.h (class Dirsearch): Update declaration.
12146 * options.h (class General_options): Add --warn-search-mismatch.
12147 * parameters.cc (Parameters::is_compatible_target): New function.
12148 * parameters.h (class Parameters): Declare is_compatible_target.
12149 * workqueue.cc (Workqueue::add_blocker): New function.
12150 * workqueue.h (class Workqueue): Declare add_blocker.
12152 * fileread.cc (Input_file::open): Remove options parameter.
12153 Change all callers.
12154 (Input_file::open_binary): Likewise.
12155 * script.cc (read_input_script): Likewise.
12156 * readsyms.h (class Read_symbols): Remove options_ field. Remove
12157 options parameter from constructor. Change all callers.
12158 (class Read_script): Likewise.
12159 * fileread.h (class Input_file): Update declarations.
12160 * script.h (read_input_script): Update declaration.
12162 2009-03-10 Nick Clifton <nickc@redhat.com>
12164 * po/es.po: New Spanish translation.
12166 2009-03-06 Cary Coutant <ccoutant@google.com>
12168 * options.cc (parse_short_option): Keep dash_z from registering itself.
12170 2009-03-03 Ian Lance Taylor <iant@google.com>
12173 * target-reloc.h (relocate_section): Pass output_section to
12175 * i386.cc (Target_i386::should_apply_static_reloc): Add
12176 output_section parameter. Change all callers.
12177 (Target_i386::Relocate::relocate): Add output_section parameter.
12178 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12179 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
12180 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
12181 * testsuite/two_file_shared.sh: New script.
12182 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
12183 (check_DATA): Add two_file_shared.dbg.
12184 (two_file_shared.dbg): New target.
12185 * testsuite/Makefile.in: Rebuild.
12187 2009-03-01 Ian Lance Taylor <iant@google.com>
12189 * configure.ac: Check for byteswap.h.
12190 * configure: Rebuild.
12191 * config.in: Rebuild.
12193 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
12195 * layout.cc (Layout::find_or_add_kept_section): New function.
12196 (Layout::add_comdat): Removed.
12197 * layout.h (struct Kept_section): Move out of class Layout.
12198 Remove trailing underscores from field names. Add group_sections
12199 field. Rename group_ field to is_group. Change all uses.
12200 (class Layout): Declare find_or_add_kept_section, not add_comdat.
12201 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
12202 comdat_groups_ field.
12203 (Sized_relobj::include_section_group): Use
12204 find_or_add_kept_section and Kept_section::group_sections.
12205 (Sized_relobj::include_linkonce_section): Likewise.
12206 * object.cc (class Sized_relobj): Don't define Comdat_group or
12207 Comdat_group_table. Remove find_comdat_group and
12208 add_comdat_group. Remove comdat_groups_ field.
12209 * plugin.cc (include_comdat_group): Use
12210 Layout::find_or_add_kept_section.
12212 2009-02-28 Ian Lance Taylor <iant@google.com>
12214 * README: --gc-sections and map files are now supported. Document
12215 some build requirements.
12218 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
12219 relocatable link set the value of the section symbol to zero.
12220 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
12221 relocatable link don't include the section address in the local
12224 2009-02-27 Ian Lance Taylor <iant@google.com>
12227 * options.h (class Search_directory): Add is_system_directory.
12228 (class General_options): Declare is_in_system_directory.
12229 * options.cc (get_relative_sysroot): Make static.
12230 (get_default_sysroot): Make static.
12231 (General_optoins::is_in_system_directory): New function.
12232 * fileread.cc (Input_file::is_in_system_directory): New function.
12233 * fileread.h (class Input_file): Declare is_in_system_directory.
12234 * object.h (class Object): Add is_in_system_directory.
12235 (class Input_objects): Remove system_library_directory_ field.
12236 * object.cc (Input_objects::add_object): Don't set
12237 system_library_directory_.
12238 (input_objects::found_in_system_library_directory): Remove.
12239 * symtab.cc (Symbol_table::write_globals): Remove input_objects
12240 parameter. Change all callers.
12241 (Symbol_table::sized_write_globals): Likewise.
12242 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
12243 Call Object::is_in_system_directory.
12244 * symtab.h (class Symbol_table): Update declarations.
12247 * descriptors.h (Open_descriptor): Add is_on_stack field.
12248 * descriptors.cc (Descriptors::open): If the descriptor is on the
12249 top of the stack, remove it. Initialize is_on_stack field.
12250 (Descriptors::release): Only add pod to stack if it is not on the
12252 (Descriptors::close_some_descriptor): Clear stack_next and
12253 is_on_stack fields.
12256 * output.cc (Output_section::find_starting_output_address): Rename
12257 from starting_output_address; add PADDR parameter; change return
12259 * output.h (class Output_section): Declare
12260 find_starting_output_address instead of starting_output_address.
12261 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
12262 section symbol for which we can't find a merge section.
12265 * symtab.cc (Symbol_table::add_from_object): If the visibility is
12266 hidden or internal, force the symbol to be local.
12267 * resolve.cc (Symbol::override_visibility): Define.
12268 (Symbol::override_base): Use override_visibility.
12269 (Symbol_table::resolve): Likewise.
12270 (Symbol::override_base_with_special): Likewise.
12271 (Symbol_table::override_with_special): If the visibility is hidden
12272 or internal, force the symbol to be local.
12273 * symtab.h (class Symbol): Add set_visibility and
12274 override_visibility.
12275 * testsuite/ver_test_1.sh: New file.
12276 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
12277 (check_DATA): Add ver_test_1.syms.
12278 (ver_test_1.syms): New target.
12279 * testsuite/Makefile.in: Rebuild.
12281 2009-02-25 Cary Coutant <ccoutant@google.com>
12283 * layout.cc (Layout::choose_output_section): Don't rename sections
12284 when using a linker script that has a SECTIONS clause.
12285 * Makefile.in: Regenerate.
12287 * testsuite/Makefile.am (script_test_5.sh): New test case.
12288 * testsuite/Makefile.in: Regenerate.
12289 * testsuite/script_test_5.cc: New file.
12290 * testsuite/script_test_5.sh: New file.
12291 * testsuite/script_test_5.t: New file.
12293 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
12295 * archive.cc (Archive::include_member): Update calls to add_symbols.
12296 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
12297 the Layout argument.
12298 * dynobj.h (do_add_symbols): Add the Layout argument.
12299 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
12301 * object.h (Object::add_symbols): Add the Layout argument.
12302 (Object::do_add_symbols): Add the Layout argument.
12303 (Sized_relobj::do_add_symbols): Add the Layout argument.
12304 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
12305 Unify the two versions.
12306 (Add_plugin_symbols): Remove.
12307 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
12308 (Sized_pluginobj::do_add_symbols): Unify the two versions.
12309 (Add_plugin_symbols): Remove.
12310 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
12311 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
12312 (Add_symbols::run): Make it work with Pulginobj.
12314 2009-02-06 Ian Lance Taylor <iant@google.com>
12316 * object.cc (Sized_relobj::do_layout): Make info message start
12317 with lower case letter.
12319 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
12321 * binary.cc: Fix file comment.
12323 * options.h (enum Incremental_disposition): Define.
12324 (class General_options): Add new options: --incremental,
12325 --incremental_changed, --incremental_unchanged,
12326 --incremental_unknown. Add incremental_disposition_ and
12327 implicit_incremental_ fields.
12328 (General_options::incremental_disposition): New function.
12329 (class Position_dependent_options): Add incremental_disposition
12331 (Position_dependent_options::copy_from_options): Set incremental
12333 * options.cc (General_options::parse_incremental_changed): New
12335 (General_options::parse_incremental_unchanged): New function.
12336 (General_options::parse_incremental_unknown): New function.
12337 (General_options::General_options): Initialize new fields
12338 incremental_disposition_ and implicit_incremental_.
12339 (General_options::finalize): Check for uasge of --incremental-*
12340 without --incremental.
12342 2009-02-06 Chris Demetriou <cgd@google.com>
12344 * gold.h (gold_undefined_symbol): Change to take only a Symbol
12345 pointer and to report location as the file name associated with
12347 (gold_undefined_symbol_at_location): New function to replace the
12348 old gold_undefined_symbol functionality.
12349 * target-reloc.h (relocate_section): Update to use
12350 gold_undefined_symbol_at_location.
12351 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12352 Call gold_undefined_symbol function rather than gold_error.
12353 * errors.h (Errors::undefined_symbol): Take location as a
12354 string, rather than calculating it from a relocation.
12355 * errors.cc (Errors::fatal): Print "fatal error:" before the
12357 (Errors::error, Errors::error_at_location): Print "error: "
12358 before the formatted message.
12359 (Errors::undefined_symbol): Take location as a string, rather
12360 than calculating it from a relocation.
12361 (gold_undefined_symbol_at_location): New function akin to
12362 old gold_undefined_symbol, calculates location from relocation.
12363 (gold_undefined_symbol): Change to take only a Symbol pointer
12364 and to report location as the file name associated with the symbol.
12365 * testsuite/debug_msg.sh: Update for changed error messages.
12366 * testsuite/undef_symbol.sh: Likewise.
12368 2009-02-04 Duncan Sands <baldrick@free.fr>
12371 * reduced_debug_output.h
12372 (Output_reduced_debug_abbrev_section::failed): Use format for
12374 (Output_reduced_debug_info_section::faild): Likewise.
12376 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
12378 * script.cc (Lazy_demangler): New class.
12379 (Version_script_info::get_symbol_version_helper): Demangle a
12382 2009-01-29 Cary Coutant <ccoutant@google.com>
12384 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
12386 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12388 2009-01-28 Ian Lance Taylor <iant@google.com>
12390 * version.cc (version_string): Bump to 1.9.
12392 * gold.h: Include <cstring> and <stdint.h>.
12393 * version.cc: Include <cstdio>.
12394 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
12396 * reduced_debug_output.cc (insert_into_vector): Rename from
12397 Insert_into_vector; change all callers. Use Swap_unaligned to
12398 avoid aliasing issue; remove union since it is unnecessary.
12400 2009-01-27 Sriraman Tallam <tmsriram@google.com>
12402 * Makefile.am (CCFILES): Add gc.cc.
12403 (HFILES): Add gc.h.
12404 * Makefile.in: Regenerate.
12405 * gold.cc (Gc_runner): New class.
12406 (queue_initial_tasks): Call garbage collection related tasks
12407 when corresponding options are invoked.
12408 (queue_middle_gc_tasks): New function.
12409 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
12410 processed early before laying out sections during garbage collection.
12411 * gold.h (queue_middle_gc_tasks): New function.
12412 (is_prefix_of): Move from "layout.cc".
12413 * i386.cc (Target_i386::gc_process_relocs): New function.
12414 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
12415 * main.cc (main): Create object of class "Garbage_collection".
12416 * object.cc (Relobj::copy_symbols_data): New function.
12417 (Relobj::is_section_name_included): New function.
12418 (Sized_relobj::do_layout): Allow this function to be called twice
12419 during garbage collection and defer layout of section during the
12421 * object.h (Relobj::get_symbols_data): New function.
12422 (Relobj::is_section_name_included): New function.
12423 (Relobj::copy_symbols_data): New function.
12424 (Relobj::set_symbols_data): New function.
12425 (Relobj::get_relocs_data): New function.
12426 (Relobj::set_relocs_data): New function.
12427 (Relobj::is_output_section_offset_invalid): New pure virtual function.
12428 (Relobj::gc_process_relocs): New function.
12429 (Relobj::do_gc_process_relocs): New pure virtual function.
12430 (Relobj::sd_): New data member.
12431 (Sized_relobj::is_output_section_offset_invalid): New function.
12432 (Sized_relobj::do_gc_process_relocs): New function.
12433 * options.h (General_options::gc_sections): Modify to not be a no-op.
12434 (General_options::print_gc_sections): New option.
12435 * plugin.cc (Plugin_finish::run): Remove function call to
12436 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
12437 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
12438 * reloc.cc (Read_relocs::run): Add task to process relocs and
12439 determine unreferenced sections when doing garbage collection.
12440 (Gc_process_relocs): New class.
12441 (Sized_relobj::do_gc_process_relocs): New function.
12442 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
12443 sections that are garbage collected.
12444 * reloc.h (Gc_process_relocs): New class.
12445 * sparc.cc (Target_sparc::gc_process_relocs): New function.
12446 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
12447 symbols whose corresponding sections are garbage collected.
12448 (Symbol_table::Symbol_table): Add new parameter for the garbage
12450 (Symbol_table::gc_mark_undef_symbols): New function.
12451 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12452 (Symbol_table::gc_mark_dyn_syms): New function.
12453 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
12455 (Symbol_table::add_from_object): Likewise.
12456 (Symbol_table::add_from_relobj): When building shared objects, do not
12457 treat externally visible symbols as garbage.
12458 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
12459 table information for static and relocatable links.
12460 * symtab.h (Symbol_table::set_gc): New function.
12461 (Symbol_table::gc): New function.
12462 (Symbol_table::gc_mark_undef_symbols): New function.
12463 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12464 (Symbol_table::gc_mark_dyn_syms): New function.
12465 (Symbol_table::gc_): New data member.
12466 * target.h (Sized_target::gc_process_relocs): New pure virtual
12468 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
12469 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
12471 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
12473 * options.h (General_options::gc_sections): Define as a no-op for now.
12474 (General_options::no_keep_memory): Ditto.
12475 (General_options::Bshareable): Define.
12476 * options.cc (General_options::finalize): Honor -Bshareable.
12478 2009-01-20 Andreas Schwab <schwab@suse.de>
12480 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
12481 read the value in the contents, since we don't use it. Use the
12482 template endianness when writing.
12483 (Relocate::relocate): Use it for R_PPC_REL16_HA.
12485 2009-01-19 Andreas Schwab <schwab@suse.de>
12487 * configure.tgt (powerpc64-*): Fix targ_obj.
12489 2009-01-15 Ian Lance Taylor <iant@google.com>
12491 * object.cc (Sized_relobj::write_local_symbols): Don't write out
12492 local symbols when stripping all symbols.
12494 2009-01-14 Cary Coutant <ccoutant@google.com>
12496 * output.cc (Output_reloc): Add explicit instantiations.
12498 2009-01-14 Cary Coutant <ccoutant@google.com>
12500 * archive.cc (Archive::get_elf_object_for_member): Remove call
12501 to File_read::claim_for_plugin.
12502 * descriptors.cc (Descriptors::open): Remove reference to
12504 (Descriptors::claim_for_plugin): Remove.
12505 * descriptors.h (Descriptors::claim_for_plugin): Remove.
12506 (Descriptors::is_claimed): Remove.
12507 (claim_descriptor_for_plugin): Remove.
12508 * fileread.cc (File_read::claim_for_plugin): Remove.
12509 * fileread.h (File_read::claim_for_plugin): Remove.
12510 (File_read::descriptor): Reopen descriptor if necessary.
12511 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
12512 (Plugin_manager::all_symbols_read): Add task parameter. Change
12514 (Plugin_manager::get_input_file): New function.
12515 (Plugin_manager::release_input_file): New function.
12516 (Pluginobj::Pluginobj): Add filesize parameter and initialize
12517 corresponding data member.
12518 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
12519 and pass to base constructor. Change all callers.
12520 (get_input_file, release_input_file): New functions.
12521 (make_sized_plugin_object): Add filesize parameter. Change all callers.
12522 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
12523 (Plugin_manager::all_symbols_read): Add task parameter.
12524 (Plugin_manager::get_input_file): New function.
12525 (Plugin_manager::release_input_file): New function.
12526 (Plugin_manager::task_): New data member.
12527 (Pluginobj::Pluginobj): Add filesize parameter.
12528 (Pluginobj::filename): New function.
12529 (Pluginobj::descriptor): New function.
12530 (Pluginobj::filesize): New function.
12531 (Pluginobj::filesize_): New data member.
12532 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
12533 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
12534 File_read::claim_for_plugin; use Object::unlock to unlock the file.
12536 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
12537 with archive libraries.
12538 * testsuite/Makefile.in: Regenerate.
12539 * testsuite/plugin_test.c (struct sym_info): New type.
12540 (get_input_file, release_input_file): New static variables.
12541 (onload): Capture new transfer vector entries.
12542 (claim_file_hook): Stop reading at end of file according to filesize.
12543 Factor out parsing of readelf output into separate function.
12544 (all_symbols_read_hook): Exercise get_input_file and release_input_file
12545 APIs and get the source file name from the symbol table. Convert
12546 source file name to corresponding object file name. Print info
12547 message when adding new input files.
12548 (parse_readelf_line): New function.
12549 * testsuite/plugin_test_1.sh: Add checks for new info messages.
12550 * testsuite/plugin_test_2.sh: Likewise.
12551 * testsuite/plugin_test_3.sh: Likewise.
12552 * testsuite/plugin_test_4.sh: New test case.
12554 2009-01-07 Ian Lance Taylor <iant@google.com>
12556 * version.cc (version_string): Bump to 1.8.
12558 2008-12-23 Cary Coutant <ccoutant@google.com>
12560 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
12561 * plugin.cc (Plugin_manager::finish): Rename as
12562 layout_deferred_objects. Move cleanup to separate function.
12563 (Plugin_manager::cleanup): New function.
12564 (Plugin_finish::run): Call layout_deferred_objects and cleanup
12566 * plugin.h (Plugin_manager::finish): Rename as
12567 layout_deferred_objects.
12568 (Plugin_manager::cleanup): New function.
12569 (Plugin_manager::cleanup_done): New field.
12571 2008-12-23 Cary Coutant <ccoutant@google.com>
12573 * plugin.cc (is_visible_from_outside): New function.
12574 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
12575 so we don't return "IR only" status for exported symbols or -r links.
12577 * testsuite/Makefile.am (plugin_test_3): New test case.
12578 * testsuite/Makefile.in: Regenerate.
12579 * testsuite/plugin_test_3.sh: New file.
12581 2008-12-22 Cary Coutant <ccoutant@google.com>
12583 * object.cc (Sized_relobj::layout_section): New function.
12584 (Sized_relobj::do_layout): Defer layout of input sections until after
12585 plugin has provided replacement files.
12586 (Sized_relobj::do_layout_deferred_sections): New function.
12587 * object.h (Relobj::set_section_offset): Remove virtual keyword.
12588 (Relobj::layout_deferred_sections): New function.
12589 (Relobj::do_layout_deferred_sections): New function.
12590 (Sized_relobj::do_layout_deferred_sections): New function.
12591 (Sized_relobj::layout_section): New function.
12592 (Sized_relobj::Deferred_layout): New structure.
12593 (Sized_relobj::deferred_layout_): New field.
12594 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
12595 Change all callers. Layout deferred sections.
12596 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
12598 (Plugin_hook::run): Move code from do_plugin_hook inline.
12599 (Plugin_hook::do_plugin_hook): Remove.
12600 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
12601 (Plugin_manager::finish): Renamed, was cleanup.
12602 (Plugin_manager::should_defer_layout): New function.
12603 (Plugin_manager::add_deferred_layout_object): New function.
12604 (Plugin_manager::Deferred_layout_list): New type.
12605 (Plugin_manager::deferred_layout_objects_): New field.
12606 (Plugin_hook::do_plugin_hook): Remove.
12608 2008-12-17 Ian Lance Taylor <iant@google.com>
12610 * options.h (class General_options): Add --no case for
12613 2008-12-16 Cary Coutant <ccoutant@google.com>
12615 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
12617 (Plugin_manager::claim_file): Create plugin object even if
12618 plugin did not call the add_symbols callback.
12619 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
12620 asking for more symbols than were added.
12621 * testsuite/Makefile.am (plugin_test_1): Add test case with
12623 (empty.syms): New target.
12624 * testsuite/Makefile.in: Regenerate.
12625 * testsuite/plugin_test.c (claim_file_hook): Add new debug
12626 message. Don't call add_symbols if no globals.
12627 (all_symbols_read_hook): Don't provide replacement for empty
12630 2008-12-12 Ian Lance Taylor <iant@google.com>
12632 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
12633 r_type == 0 for a local symbol with r_sym == 0.
12634 (scan_relocatable_relocs): Pass r_sym to
12635 local_non_section_strategy.
12636 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
12639 * configure.ac: Update test for TLS descriptors: they are
12640 supported as of glibc 2.9.
12641 * configure: Rebuild.
12643 2008-12-11 Ian Lance Taylor <iant@google.com>
12646 * target-reloc.h (Default_scan_relocatable_relocs): For each
12647 function, map r_type == 0 to RELOC_DISCARD.
12649 2008-12-10 Cary Coutant <ccoutant@google.com>
12651 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
12652 object to override a kept COMDAT group from a plugin object.
12654 2008-12-09 Ian Lance Taylor <iant@google.com>
12657 * yyscript.y (file_cmd): Handle INPUT.
12659 * testsuite/initpri1.c: Change all declarations to be full
12660 prototypes by adding void, to avoid compiler warnings.
12662 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
12664 * options.cc (General_options::parse_plugin_opt): New.
12665 (General_options::add_plugin): The argument now is just the filename.
12666 (General_options::add_plugin_option): New.
12667 * options.h (plugin_opt): New.
12668 (add_plugin): Change argument name.
12669 (add_plugin_option): New.
12670 * plugin.cc (Plugin::load): Don't parse the plugin option.
12671 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
12672 (Plugin::add_option): New.
12673 (Plugin::args_): Change type.
12674 (Plugin::filename_): New.
12675 (Plugin_manager::add_plugin_option): New.
12676 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
12677 * testsuite/Makefile.in: Regenerate.
12679 2008-12-05 Cary Coutant <ccoutant@google.com>
12681 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
12682 Handle --strip-lto-sections option.
12683 * options.h (strip_lto_sections): New option.
12685 2008-12-01 Cary Coutant <ccoutant@google.com>
12687 * plugin.cc (ld_plugin_message): Change format parameter to const.
12688 Fix mismatch between new[] and delete.
12690 2008-11-14 Cary Coutant <ccoutant@google.com>
12692 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
12695 2008-11-05 Craig Silverstein <csilvers@google.com>
12697 * options.cc (General_options::parse_dynamic_list): New function.
12698 * options.h (General_options): New flags dynamic_list,
12699 dynamic_list_data, dynamic_list_cpp_new, and
12700 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
12701 (General_options::in_dynamic_list): New function.
12702 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
12703 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
12704 (Lex::can_continue_name): Likewise.
12706 (read_script_file): New parameter script_options.
12707 (read_dynamic_list): New function.
12708 (Script_options::define_dynamic_list): New function.
12709 (dynamic_list_keyword_parsecodes): New variable.
12710 (dynamic_list_keywords): New variable.
12711 * script.h (Script_options::define_dynamic_list): New function
12713 (read_dynamic_list): New function prototype.
12714 * symtab.cc (strprefix): New macro.
12715 (Symbol::should_add_dynsym_entry): Support dynamic_list,
12716 dynamic_list_data, dynamic_list_cpp_new, and
12717 dynamic_list_cpp_typeinfo.
12718 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
12719 (dynamic_list_expr): New rule.
12720 (dynamic_list_nodes): Likewise.
12721 (dynamic_list_node): Likewise.
12722 * testsuite/Makefile.am (dynamic_list): New test.
12723 * testsuite/Makefile.in: Regenerated.
12724 * testsuite/dynamic_list.t: New file.
12725 * testsuite/dynamic_list.sh: New file.
12727 2008-11-05 Craig Silverstein <csilvers@google.com>
12729 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
12730 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
12731 (t11_last): Likewise.
12732 * testsuite/ver_test_6.c (main): Likewise.
12734 2008-10-07 Cary Coutant <ccoutant@google.com>
12736 * options.c (General_options::finalize): Add check for -static and
12738 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
12741 2008-10-02 Cary Coutant <ccoutant@google.com>
12743 * plugin.cc (make_sized_plugin_object): Fix conditional
12744 compilation to work when not all targets are enabled.
12746 2008-09-29 Cary Coutant <ccoutant@google.com>
12748 * archive.cc (Archive::get_file_and_offset): Use filename instead
12749 of name to get library path.
12750 (Archive::include_member): Unlock external member of a thin archive.
12752 * testsuite/Makefile.am (TEST_AR): New variable.
12753 (thin_archive_test_1): New test.
12754 (thin_archive_test_2): New test.
12755 * testsuite/Makefile.in: Regenerate.
12756 * testsuite/thin_archive_main.cc: New file.
12757 * testsuite/thin_archive_test_1.cc: New file.
12758 * testsuite/thin_archive_test_2.cc: New file.
12759 * testsuite/thin_archive_test_3.cc: New file.
12760 * testsuite/thin_archive_test_4.cc: New file.
12762 2008-09-29 Cary Coutant <ccoutant@google.com>
12764 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
12765 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
12767 (Sized_relobj::do_finalize_local_symbols): Likewise.
12768 (Sized_relobj::map_to_kept_section): Likewise.
12769 * object.h (Sized_relobj::invalid_address): New constant.
12770 (Sized_relobj::do_output_section_offset): Check for invalid_address
12772 * output.cc (Output_reloc::local_section_offset): Use constant
12773 invalid_address instead of -1U.
12774 (Output_reloc::get_address): Likewise.
12775 (Output_section::output_address): Change -1U to -1ULL.
12776 * output.h (Output_reloc::invalid_address): New constant.
12777 * reloc.cc (Sized_relobj::write_sections): Use constant
12778 invalid_address instead of -1U.
12779 (Sized_relobj::relocate_sections): Likewise.
12780 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
12781 values for merge sections.
12782 * target-reloc.h (relocate_for_relocatable): Use constant
12783 invalid_address instead of -1U.
12785 2008-09-19 Cary Coutant <ccoutant@google.com>
12787 Add plugin functionality for link-time optimization (LTO).
12788 * configure.ac (plugins): Add --enable-plugins option.
12789 * configure: Regenerate.
12790 * config.in: Regenerate.
12791 * Makefile.am (LIBDL): New variable.
12792 (CCFILES): Add plugin.cc.
12793 (HFILES): Add plugin.h.
12794 (ldadd_var): Add LIBDL.
12795 * Makefile.in: Regenerate.
12797 * archive.cc: Include "plugin.h".
12798 (Archive::setup): Don't preread archive symbols when using a plugin.
12799 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
12800 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
12802 (Archive::include_member): Add symbols from plugin objects.
12803 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
12804 * descriptors.cc (Descriptors::open): Check for file descriptors
12805 abandoned by plugins.
12806 (Descriptors::claim_for_plugin): New function.
12807 * descriptors.h (Descriptors::claim_for_plugin): New function.
12808 (Open_descriptor::is_claimed): New field.
12809 (claim_descriptor_for_plugin): New function.
12810 * fileread.cc (File_read::claim_for_plugin): New function.
12811 * fileread.h (File_read::claim_for_plugin): New function.
12812 (File_read::descriptor): New function.
12813 * gold.cc: Include "plugin.h".
12814 (queue_initial_tasks): Add task to call plugin hooks for generating
12816 * main.cc: Include "plugin.h".
12817 (main): Load plugin libraries.
12818 * object.h (Pluginobj): Declare.
12819 (Object::pluginobj): New function.
12820 (Object::do_pluginobj): New function.
12821 (Object::set_target): New function.
12822 * options.cc: Include "plugin.h".
12823 (General_options::parse_plugin): New function.
12824 (General_options::General_options): Initialize plugins_ field.
12825 (General_options::add_plugin): New function.
12826 * options.h (Plugin_manager): Declare.
12827 (General_options): Add --plugin option.
12828 (General_options::has_plugins): New function.
12829 (General_options::plugins): New function.
12830 (General_options::add_plugin): New function.
12831 (General_options::plugins_): New field.
12832 * plugin.cc: New file.
12833 * plugin.h: New file.
12834 * readsyms.cc: Include "plugin.h".
12835 (Read_symbols::do_read_symbols): Check for archive before checking
12836 for ELF file. Call plugin hooks to claim files.
12837 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
12838 from a real object file; force override when processing replacement
12840 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
12841 (Symbol::init_base_object): Likewise.
12842 (Symbol::init_base_output_data): Likewise.
12843 (Symbol::init_base_output_segment): Likewise.
12844 (Symbol::init_base_constant): Likewise.
12845 (Symbol::init_base_undefined): Likewise.
12846 (Symbol::output_section): Assert that object is not a plugin.
12847 (Symbol_table::add_from_pluginobj): New function.
12848 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
12850 (Symbol_table::sized_write_globals): Likewise.
12851 (Symbol_table::add_from_pluginobj): Instantiate template.
12852 * symtab.h (Sized_pluginobj): Declare.
12853 (Symbol::in_real_elf): New function.
12854 (Symbol::set_in_real_elf): New function.
12855 (Symbol::in_real_elf_): New field.
12856 (Symbol_table::add_from_pluginobj): New function.
12858 * testsuite/Makefile.am (AM_CFLAGS): New variable.
12859 (LIBDL): New variable.
12860 (LDADD): Add LIBDL.
12861 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
12862 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
12863 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
12864 (MOSTLYCLEANFILES): Likewise.
12865 * testsuite/Makefile.in: Regenerate.
12866 * testsuite/plugin_test.c: New file.
12867 * testsuite/plugin_test_1.sh: New file.
12868 * testsuite/plugin_test_2.sh: New file.
12870 2008-09-16 Ian Lance Taylor <iant@google.com>
12872 * target-reloc.h (relocate_section): Check whether a symbol is
12873 defined by the ABI before reporting an undefined symbol error.
12874 * target.h (Target::is_defined_by_abi): Make parameter const.
12875 (Target::do_is_defined_by_abi): Likewise.
12876 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
12877 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
12878 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
12879 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
12880 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
12881 * testsuite/Makefile.in: Rebuild.
12883 * fileread.cc (make_view): Add casts to avoid warning.
12885 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
12887 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
12888 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12890 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
12892 * options.h (General_options::output_is_executable): New.
12893 (General_options::output_is_pie): New.
12894 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
12895 for shared libraries.
12896 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12898 2008-09-11 Chris Demetriou <cgd@google.com>
12900 * options.h (origin): New -z option.
12901 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
12902 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
12905 2008-09-05 Cary Coutant <ccoutant@google.com>
12907 * fileread.cc (File_read::make_view): Add check for attempt to map
12908 beyond end of file.
12910 2008-09-05 Cary Coutant <ccoutant@google.com>
12912 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
12913 explicit instantiations.
12915 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
12918 * options.cc (General_options::finalize): Allow undefined symbols
12919 in shlibs if linking -shared.
12922 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
12923 symbols as not needing a dynsym entry.
12925 2008-08-20 Craig Silverstein <csilvers@google.com>
12927 * fileread.cc (File_read::open): Do not lock the file unless it
12928 was successfully opened.
12930 2008-08-14 Cary Coutant <ccoutant@google.com>
12932 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
12933 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
12934 * testsuite/tls_test.cc (struct int128): 128-bit struct
12935 for testing TLS relocs with non-zero addend.
12936 (v12): New TLS variable.
12938 (t_last): Add check for v12.
12939 * testsuite/tls_test.h (t12): New function.
12940 * testsuite/tls_test_main.cc (thread_routine): Call new test.
12942 2008-08-13 Ian Lance Taylor <iant@google.com>
12944 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
12945 set tls_segment_ or relro_segment_.
12946 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
12948 * output.h (Output_section::clear_is_relro): New function.
12949 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
12950 sections specially even when output_data_ is empty.
12951 (Output_segment::maximum_alignment): When first section is relro,
12952 only force alignment for PT_LOAD segments.
12953 * script.cc (script_data_segment_align): New function.
12954 (script_data_segment_relro_end): New function.
12955 * script-c.h (script_data_segment_align): Declare.
12956 (script_data_segment_relro_end): Declare.
12957 * script-sections.h (class Script_sections): Declare
12958 data_segment_align and data_segment_relro_end. Add fields
12959 segment_align_index_ and saw_relro_end_.
12960 * script-sections.cc (class Sections_element): Add set_is_relro
12961 virtual function. Add new bool* parameter to place_orphan_here.
12962 Add get_output_section virtual function.
12963 (class Output_section_definition): Add set_is_relro. Add new
12964 bool* parameter to place_orphan_here. Add get_output_section.
12965 Add is_relro_ field.
12966 (Output_section_definition::Output_section_definition): Initialize
12967 evaluated_address_, evaluated_load_address, evaluated_addralign_,
12968 and is_relro_ fields.
12969 (Output_section_definition::place_orphan_here): Add is_relro
12971 (Output_section_definition::set_section_addresses): Set relro for
12973 (Output_section_definition::alternate_constraint): Likewise.
12974 (class Orphan_output_section): Add new bool* parameter to
12975 place_orphan_here. Add get_output_section.
12976 (Orphan_output_section::place_orphan_here): Add is_relro
12978 (Script_sections::Script_sections): Initialize
12979 data_segment_align_index_ and saw_relro_end_.
12980 (Script_sections::data_segment_align): New function.
12981 (Script_sections::data_segment_relro_end): New function.
12982 (Script_sections::place_orphan): Set or clear is_relro.
12983 (Script_sections::set_section_addresses): Force alignment of first
12985 * yyscript.y (exp): Call script_data_segment_align and
12986 script_data_segment_relro_end.
12987 * testsuite/relro_script_test.t: New file.
12988 * testsuite/relro_test.cc (using_script): Declare.
12989 (t1, t2): Test using_script.
12990 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
12991 (relro_script_test_SOURCES): Define.
12992 (relro_script_test_DEPENDENCIES): Define.
12993 (relro_script_test_LDFLAGS): Define.
12994 (relro_script_test_LDADD): Define.
12995 (relro_script_test.so): New target.
12996 * testsuite/Makefile.in: Rebuild.
12998 2008-08-06 Cary Coutant <ccoutant@google.com>
13000 * archive.cc (Archive::total_archives, Archive::total_members)
13001 (Archive::total_members_loaded): New variables.
13002 (Archive::setup): Add parameter. Add option to preread
13004 (Archive::read_armap): Add counter.
13005 (Archive::get_file_and_offset): New function.
13006 (Archive::get_elf_object_for_member): New function.
13007 (Archive::read_all_symbols): New function.
13008 (Archive::read_symbols): New function.
13009 (Archive::add_symbols): Add counters.
13010 (Archive::include_all_members): Use armap to find members if it's
13012 (Archive::include_member): Skip reading symbols if already read.
13013 Factored code into Archive::get_file_and_offset and
13014 Archive::get_elf_object_for_member. Changed call to
13015 Mapfile::report_include_archive_member.
13016 (Archive::print_stats): New function.
13017 * archive.h: Declare Object and Read_symbols_data classes.
13018 (Archive::Archive): Add initializers for new members.
13019 (Archive::setup): Add parameter.
13020 (Archive::print_stats): New function.
13021 (Archive::total_archives, Archive::total_members)
13022 (Archive::total_members_loaded): New variables.
13023 (Archive::get_file_and_offset): New function.
13024 (Archive::get_elf_object_for_member): New function.
13025 (Archive::read_all_symbols): New function.
13026 (Archive::read_symbols): New function.
13027 (Archive::Archive_member): New class.
13028 (Archive::members_): New member.
13029 (Archive::num_members_): New member.
13030 * main.cc: Include archive.h.
13031 (main): Call Archive::print_stats.
13032 * mapfile.cc (Mapfile::report_include_archive_member): Delete
13033 archive parameter; member_name is now the fully-decorated name.
13034 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
13035 * options.h: (General_options): Add --preread-archive-symbols option.
13036 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
13039 2008-08-04 Ian Lance Taylor <iant@google.com>
13041 * symtab.h (Symbol::use_plt_offset): New function.
13042 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
13043 * powerpc.cc (Relocate::relocate): Likewise.
13044 * sparc.cc (Relocate::relocate): Likewise.
13045 * x86_64.cc (Relocate::relocate): Likewise.
13046 * testsuite/weak_plt.sh: New test.
13047 * testsuite/weak_plt_main.cc: New test.
13048 * testsuite/weak_plt_shared.cc: New test.
13049 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
13050 (check_PROGRAMS): Add weak_plt.
13051 (check_DATA): Add weak_plt_shared.so.
13052 (weak_plt_main_pic.o, weak_plt): New targets.
13053 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
13054 * testsuite/Makefile.in: Rebuild.
13056 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
13058 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
13059 * testsuite/Makefile.in: Rebuild.
13061 2008-08-04 Alan Modra <amodra@bigpond.net.au>
13063 * Makefile.am (POTFILES.in): Set LC_ALL=C.
13064 * Makefile.in: Regenerate.
13065 * po/POTFILES.in: Regenerate.
13067 2008-07-29 Ian Lance Taylor <iant@google.com>
13069 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
13070 symbols before other symbols.
13071 * testsuite/script_test_2.cc (test_addr): Declare.
13072 (test_addr_alias): Declare.
13073 (main): Check that test_addr and test_addr_alias have the right
13075 * testsuite/script_test_2.t: Define test_addr_alias and
13078 2008-07-24 Ian Lance Taylor <iant@google.com>
13081 * descriptors.cc: New file.
13082 * descriptors.h: New file.
13083 * gold-threads.h (class Hold_optional_lock): New class.
13084 * fileread.cc: Include "descriptors.h".
13085 (File_read::~File_read): Release descriptor rather than closing
13087 (File_read::open) [file]: Call open_descriptor rather than open.
13088 Set is_descriptor_opened_.
13089 (File_read::open) [memory]: Assert that descriptor is not open.
13090 (File_read::reopen_descriptor): New function.
13091 (File_read::release): Release descriptor.
13092 (File_read::do_read): Make non-const. Reopen descriptor.
13093 (File_read::read): Make non-const.
13094 (File_read::make_view): Reopen descriptor.
13095 (File_read::do_readv): Likewise.
13096 * fileread.h (class File_read): Add is_descriptor_opened_ field.
13097 Update declarations.
13098 * layout.cc: Include "descriptors.h".
13099 (Layout::create_build_id): Use open_descriptor rather than open.
13100 * output.cc: Include "descriptors.h".
13101 (Output_file::open): Use open_descriptor rather than open.
13102 * archive.cc (Archive::const_iterator): Change Archive to be
13104 (Archive::begin, Archive::end): Make non-const.
13105 (Archive::count_members): Likewise.
13106 * archive.h (class Archive): Update declarations.
13107 * object.h (Object::read): Make non-const.
13108 * Makefile.am (CCFILES): Add descriptors.cc.
13109 (HFILES): Add descriptors.h.
13110 * Makefile.in: Rebuild.
13113 * gold.h: Always include <clocale>. Add Solaris workarounds
13114 following code in binutils/sysdep.h.
13117 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
13118 this->eh_frame_hdr_ is NULL before using it.
13120 * dynobj.cc (Versions::Versions): Update comment.
13122 * dynobj.cc (Versions::Versions): If there is an soname, use it as
13123 the base version name.
13125 * stringpool.cc (Stringpool_template::add_with_length): Set key to
13126 array size plus one.
13127 (Stringpool_template::set_string_offsets): Subtract one from key
13128 before using it as an array index.
13129 (Stringpool_template::get_offset_with_length): Likewise.
13130 (Stringpool_template::write_to_buffer): Likewise.
13131 * stringpool.h (Stringpool_template::get_offset_from_key):
13134 2008-07-23 Ian Lance Taylor <iant@google.com>
13137 * object.h (Merged_symbol_value::value): Do our best to handle a
13141 * script.cc (Version_script_info::get_versions): Don't add empty
13142 version tag to return value.
13143 (Version_script_info::get_symbol_version_helper): Change return
13144 type to bool. Add pversion parameter. Change all callers.
13145 (script_register_vers_node): Don't require a non-NULL tag.
13146 * script.h (class Version_script_info): Update declarations.
13147 (Version_script_info::get_symbol_version): Change return type to
13148 bool. Add version parameter. Change all callers.
13149 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
13150 handling. Handle an empty version from a version script.
13151 (Symbol_table::define_special_symbol): Likewise.
13152 * testsuite/ver_test_10.script: New file.
13153 * testsuite/ver_test_10.sh: New file.
13154 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
13155 (check_DATA): Add ver_test_10.syms.
13156 (ver_test_10.syms, ver_test_10.so): New target.
13157 * testsuite/Makefile.in: Rebuild.
13159 2008-07-23 Simon Baldwin <simonb@google.com>
13161 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
13162 to zero for undefined symbols from dynamic libraries.
13164 2008-07-23 Ian Lance Taylor <iant@google.com>
13166 * symtab.cc (Symbol_table::resolve): Remove version parameter.
13167 Change all callers.
13168 * symtab.h (class Symbol_table): Update declaration.
13169 * testsuite/ver_test_9.cc: New file.
13170 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
13171 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
13172 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
13173 (ver_test_9.so, ver_test_9.o): New targets.
13174 * testsuite/Makefile.in: Rebuild.
13176 2008-07-22 Ian Lance Taylor <iant@google.com>
13178 * options.h (class General_options): Define --check-sections.
13179 * layout.cc (Layout::set_segment_offsets): Handle
13182 * options.h (class General_options): Define -n/--nmagic and
13184 * options.cc (General_options::finalize): For -n/--nmagic or
13185 -N/--omagic, set -static.
13186 * layout.cc (Layout::attach_allocated_section_to_segment): If
13187 -N/--omagic, don't put read-only and read-write sections in
13188 different segments.
13189 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
13190 finding a read-only segment.
13191 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
13192 don't set the minimum segment alignment to the common page size,
13193 and don't set the file offset to the address modulo the page size.
13194 * script-sections.cc (Script_sections::create_segments): If
13195 -n/--omagic, don't put read-only and read-write sections in
13196 different segments.
13198 * cref.cc: New file.
13199 * cref.h: New file.
13200 * options.h (class General_options): Add --print-symbol-counts.
13201 * main.cc (main): Issue defined symbol report if requested.
13202 * archive.cc (Archive::interpret_header): Make into a const member
13204 (Archive::add_symbols): Call Input_objects::archive_start and
13206 (Archive::const_iterator): Define new class.
13207 (Archive::begin, Archive::end): New functions.
13208 (Archive::include_all_members): Rewrite to use iterator.
13209 (Archive::count_members): New function.
13210 * archive.h (class Archive): Update declarations.
13211 (Archive::filename): New function.
13212 * object.cc: Include "cref.h".
13213 (Sized_relobj::Sized_relobj): Initialize defined_count_.
13214 (Sized_relobj::do_get_global_symbol_counts): New function.
13215 (Input_objects::add_object): Add object to cross-referencer.
13216 (Input_objects::archive_start): New function.
13217 (Input_objects::archive_stop): New function.
13218 (Input_objects::print_symbol_counts): New function.
13219 * object.h: Declare Cref and Archive.
13220 (Object::get_global_symbol_counts): New function.
13221 (Object::do_get_global_symbol_counts): New pure virtual function.
13222 (class Sized_relobj): Add defined_count_ field. Update
13224 (class Input_objects): Add cref_ field. Update constructor.
13225 Update declarations.
13226 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
13228 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
13230 (Sized_dynobj::do_get_global_symbol_counts): New function.
13231 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
13232 defined_count_. Update declarations. Define Symbols typedef.
13233 * symtab.cc (Symbol_table::add_from_relobj): Add defined
13234 parameter. Change all callers.
13235 (Symbol_table::add_from_dynobj): Add sympointers and defined
13236 parameters. Change all callers.
13237 * symtab.h (class Symbol_table): Update declarations.
13238 * Makefile.am (CCFILES): Add cref.cc.
13239 (HFILES): Add cref.h.
13240 * Makefile.in: Rebuild.
13242 2008-07-22 Simon Baldwin <simonb@google.com>
13244 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
13245 to zero when writing undefined symbols.
13247 2008-07-22 Ian Lance Taylor <iant@google.com>
13249 * output.cc (Output_section::add_input_section): Don't try to
13250 merge empty merge sections.
13252 2008-07-21 Craig Silverstein <csilvers@google.com>
13254 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13255 Include symbol version in error message.
13257 2008-07-20 Chris Demetriou <cgd@google.com>
13259 * configure.ac (gold_cv_c_random_seed): New configured variable.
13260 (RANDOM_SEED_CFLAGS): New substituted variable.
13261 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
13262 * configure: Rebuild.
13263 * Makefile.in: Likewise.
13264 * testsuite/Makefile.in: Likewise.
13266 2008-07-18 Ian Lance Taylor <iant@google.com>
13268 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
13269 where we see NAME/NULL and NAME/VERSION as separate symbols.
13270 * testsuite/ver_test_main.cc (main): Call t4.
13271 (t4, t4_2a): Define.
13272 * testsuite/ver_test_2.cc (t4_2): Define.
13273 * testsuite/ver_test_2.script: Put t4_2a in VER2.
13274 * testsuite/ver_test_4.cc (t4_2a): Define.
13275 * testsuite/ver_test_4.script: Put t4_2a in VER2.
13276 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
13278 2008-07-17 Ian Lance Taylor <iant@google.com>
13280 * dynobj.cc (Versions::add_def): If we give an error about a
13281 missing version, go ahead and create the version anyhow.
13283 2008-07-10 Ian Lance Taylor <iant@google.com>
13285 Handle output sections with more than 0x7fffffff bytes.
13286 * object.h (class Relobj): Change map_to_output_ to
13287 output_sections_, and just keep a section pointer. Change all
13288 uses. Move comdat group support to Sized_relobj.
13289 (Relobj::is_section_specially_mapped): Remove.
13290 (Relobj::output_section): Remove poff parameter. Change all
13292 (Relobj::output_section_offset): New function.
13293 (Relobj::set_section_offset): Rewrite.
13294 (Relobj::map_to_output): Remove.
13295 (Relobj::output_sections): New function.
13296 (Relobj::do_output_section_offset): New pure virtual function.
13297 (Relobj::do_set_section_offset): Likewise.
13298 (class Sized_relobj): Add section_offsets_ field. Add comdat
13299 group support from Relobj. Update declarations.
13300 (Sized_relobj::get_output_section_offset): New function.
13301 (Sized_relobj::do_output_section_offset): New function.
13302 (Sized_relobj::do_set_section_offset): New function.
13303 * object.cc (Relobj::output_section_address): Remove.
13304 (Sized_relobj::Sized_relobj): Initialize new fields.
13305 (Sized_relobj::include_section_group): Cast find_kept_object to
13307 (Sized_relobj::include_linkonce_section): Likewise.
13308 (Sized_relobj::do_layout): Use separate arrays for output section
13310 (Sized_relobj::do_count_local_symbols): Change map_to_output to
13312 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
13313 output_sections and section_offsets.
13314 (Sized_relobj::write_local_symbols): Likewise.
13315 (map_to_kept_section): Compute output address directly.
13316 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
13317 output_sections and section_offsets.
13318 (Sized_relobj::write_sections): Likewise.
13319 (Sized_relobj::relocate_sections): Likewise.
13320 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
13321 * output.h (class Output_reloc): Update declarations. Change
13322 u2_.relobj to Sized_relobj*.
13323 (class Output_data_reloc): Change add functions to use
13325 * output.cc (Output_reloc::Output_reloc): Change relobj to
13327 (Output_reloc::local_section_offset): Change return type to
13328 Elf_Addr. Use get_output_section_offset.
13329 (Output_reloc::get_address): Likewise.
13330 (Output_section::is_input_address_mapped): Don't call
13331 is_section_specially_mapped.
13332 (Output_section::output_offset): Likewise.
13333 (Output_section::output_address): Likewise.
13334 (Output_section::starting_output_address): Likewise.
13335 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
13336 parameter to Sized_relobj*.
13337 (Copy_relocs::need_copy_reloc): Likewise.
13338 (Copy_relocs::save): Likewise.
13339 * copy-relocs.h (class Copy_relocs): Update declarations.
13340 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
13341 Sized_relobj*. Change relobj_ field to Sized_relobj*.
13342 * target-reloc.h (relocate_for_relocatable): Change
13343 offset_in_output_section type to Elf_Addr. Change code that uses
13345 * layout.cc (Layout::layout): Always set *off.
13346 * mapfile.cc (Mapfile::print_input_section): Use
13347 output_section_offset.
13348 * i386.cc (Target_i386::copy_reloc): Change object parameter to
13350 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
13351 * sparc.cc (Target_sparc::copy_reloc): Likewise.
13352 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
13354 2008-07-03 Ian Lance Taylor <iant@google.com>
13356 * layout.cc (Layout::include_section): Do not discard unrecognized
13357 SHT_STRTAB sections.
13359 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
13361 * script.cc (Lex::can_continue_name): Make '?' allowable in
13362 version-script names.
13363 * testsuite/version_script.map: Change glob pattern to use '?'
13365 2008-06-30 Manish Singh <yosh@gimp.org>
13368 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
13371 2008-06-30 Ian Lance Taylor <iant@google.com>
13375 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
13376 versions]: Don't try to read the value in the contents, since we
13377 don't use it. Use the template endianness when writing.
13379 2008-06-25 Cary Coutant <ccoutant@google.com>
13381 * fileread.cc (File_read::make_view): Assert on zero-length view.
13382 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
13383 symbol table when there are no symbols to read.
13385 2008-06-23 Craig Silverstein <csilvers@google.com>
13387 * version.cc (version_string): Bump to 1.7
13389 2008-06-18 Craig Silverstein <csilvers@google.com>
13391 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
13392 constant 0xFFFF to type Valtype.
13393 (Powerpc_relocate_functions::rel16_ha): Likewise.
13395 2008-06-17 Ian Lance Taylor <iant@google.com>
13397 * output.h (Output_section::Input_section): Initialize p2align_ to
13398 zero for Output_section_data constructors.
13399 (Output_section::Input_section::addralign): If not an input
13400 section, return the alignment of the Output_section_data.
13401 * testsuite/copy_test.cc: New file.
13402 * testsuite/copy_test_1.cc: New file.
13403 * testsuite/copy_test_2.cc: New file.
13404 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
13405 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
13406 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
13407 (copy_test_1_pic.o, copy_test_1.so): New targets.
13408 (copy_test_2_pic.o, copy_test_2.so): New targets.
13409 * testsuite/Makefile.in: Rebuild.
13411 * script-sections.cc (Script_sections::place_orphan): Initialize
13412 local variable exact.
13414 2008-06-13 David Edelsohn <edelsohn@gnu.org>
13416 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
13418 2008-06-12 David Edelsohn <edelsohn@gnu.org>
13419 David S. Miller <davem@davemloft.net>
13421 * powerpc.cc: New file.
13422 * Makefile.am (TARGETSOURCES): Add powerpc.cc
13423 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
13424 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
13425 * Makefile.in: Rebuild.
13427 2008-06-09 Ian Lance Taylor <iant@google.com>
13429 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
13431 (throwing, orig_terminate): New static variables.
13432 (terminate_handler): New static function.
13433 (t2): Set terminate handler.
13435 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
13438 * binary.cc (Binary_to_elf::sized_convert): Fix .data
13441 2008-05-30 Cary Coutant <ccoutant@google.com>
13443 * archive.cc (Archive::include_all_members) Correct to step
13444 over symbol table and extended name table in thin archives.
13446 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
13449 * target-reloc.h (relocate_for_relocatable): Fix new_offset
13452 2008-05-28 Caleb Howe <cshowe@google.com>
13454 * reduced_debug_output.cc: New file.
13455 * reduced_debug_output.h: New file.
13456 * options.h (class General_options): Add --strip-debug-non-line.
13457 * options.cc (General_options::finalize): Add strip_debug_non_line
13458 to the strip heirarchy.
13459 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
13461 * layout.cc: Include "reduced_debug_output.h".
13462 (Layout::Layout): Initialize new fields.
13463 (line_only_debug_sections): New static array.
13464 (is_lines_only_debug_sections): New static inline function.
13465 (Layout::include_section): Handle --strip-debug-non-line.
13466 (Layout::make_output_section): If --strip-debug-non-line, build
13467 new output sections for .debug_abbrev and .debug_info.
13468 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
13469 gold. Warn about possible overflow.
13470 (read_signed_LEB_128): Likewise.
13471 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
13472 (read_signed_LEB_128): Declare.
13473 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
13474 (HFILES): Add reduced_debug_output.h.
13475 * Makefile.in: Rebuild.
13477 2008-05-21 Ian Lance Taylor <iant@google.com>
13479 * mapfile.cc: New file.
13480 * mapfile.h: New file.
13481 * options.h (class General_options): Add -M/--print-map and -Map.
13482 * options.cc (General_options::finalize): Make -M equivalent to
13484 * main.cc: Include <cstdio> and "mapfile.h".
13485 (main): Open mapfile if requested.
13486 * gold.cc (class Middle_runner): Add mapfile_ field. Update
13487 constructor. Change caller.
13488 (queue_initial_tasks): Add mapfile parameter. Change caller.
13489 (queue_middle_tasks): Likewise.
13490 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
13492 * archive.cc: Include "mapfile.h".
13493 (Archive::add_symbols): Add mapfile parameter. Change all
13494 callers. Pass mapfile, symbol, and reason to include_member.
13495 (Archive::include_all_members): Add mapfile parameter. Change all
13497 (Archive::include_member): Add mapfile, sym, and why parameters.
13498 Change all callers. Report inclusion to map file.
13499 * archive.h: Include "fileread.h".
13500 (class Archive): Update declarations.
13501 (Archive::file): New const method.
13502 (class Add_archive_symbols): Add mapfile_ field. Update
13503 constructor. Change all callers.
13504 * readsyms.h (class Read_symbols): Likewise.
13505 (class Finish_group): Likewise.
13506 (class Read_script): Likewise.
13507 * common.cc: Include "mapfile.h".
13508 (Symbol_table::allocate_commons): Add mapfile parameter. Change
13510 (Symbol_table::do_allocate_commons): Likewise.
13511 (Symbol_table::do_allocate_commons_list): Likewise. Report common
13512 symbol allocation to mapfile.
13513 * common.h (class Allocate_commons_task): Add mapfile_ field.
13514 Update constructor. Change all callers.
13515 * symtab.h (class Symbol_table): Update declarations.
13516 * layout.cc: Include "mapfile.h".
13517 (Layout_task_runner::run): Print information to mapfile.
13518 (Layout::create_gold_note): Change Output_data_fixed_space to
13519 Output_data_zero_fill.
13520 (Layout::create_build_id): Likewise.
13521 (Layout::print_to_mapfile): New function.
13522 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
13523 constructor. Change caller.
13524 (class Layout): Declare print_to_mapfile.
13525 * output.cc (Output_section::Input_section::print_to_mapfile): New
13527 (Output_section::add_input_section): If producing a map, always
13528 add to input_sections_ list.
13529 (Output_section::do_print_to_mapfile): New function.
13530 (Output_segment::print_sections_to_mapfile): New function.
13531 (Output_segment::print_section_list_to_mapfile): New function.
13532 * output.h: Include "mapfile.h".
13533 (Output_data::print_to_mapfile): New function.
13534 (Output_data::do_print_to_mapfile): New virtual function.
13535 (Output_segment_headers::do_print_to_mapfile): New function.
13536 (Output_file_header::do_print_to_mapfile): New function.
13537 (Output_data_const::do_print_to_mapfile): New function.
13538 (class Output_data_const_buffer): Add map_name_ field. Update
13539 constructor. Change all callers. Add do_print_to_mapfile
13541 (class Output_data_fixed_space): Likewise.
13542 (class Output_data_space): Likewise.
13543 (class Output_data_zero_fill): New class.
13544 (Output_data_strtab::do_print_to_mapfile): New function.
13545 (Output_data_reloc_base::do_print_to_mapfile): New function.
13546 (Output_relocatable_relocs::do_print_to_mapfile): New function.
13547 (Output_data_group::do_print_to_mapfile): New function.
13548 (Output_data_got::do_print_to_mapfile): New function.
13549 (Output_data_dynamic::do_print_to_mapfile): New function.
13550 (Output_symtab_xindex::do_print_to_mapfile): New function.
13551 (class Output_section): Declare do_print_to_mapflie. Declare
13552 print_to_mapfile in Input_section.
13553 (class Output_segment): Declare new functions.
13554 * object.h (Sized_relobj::symbol_count): New function.
13555 * script-sections.cc
13556 (Output_section_element_dot_assignment::set_section_addresses):
13557 Change Output_data_fixed_space to Output_data_zero_fill.
13558 (Output_data_expression::do_print_to_mapfile): New function.
13559 * script.cc (read_input_script): Add mapfile parameter. Change
13561 * script.h (read_input_script): Update declaration.
13562 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
13563 (Eh_frame::do_print_to_mapfile): New function.
13564 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
13565 (Output_merge_string::do_print_to_mapfile): New function.
13566 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
13568 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
13570 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
13572 * Makefile.am (CCFILES): Add mapfile.cc.
13573 (HFILES): Add mapfile.h.
13574 * Makefile.in: Rebuild.
13576 2008-05-19 Ian Lance Taylor <iant@google.com>
13578 * options.h (class General_options): Add -z relro.
13579 * layout.cc (Layout::Layout): Initialize relro_segment_.
13580 (Layout::add_output_section_data): Return the output section.
13581 (Layout::make_output_section): Rcognize relro sections and mark
13582 them appropriately.
13583 (Layout::attach_allocated_section_to_segment): Put relro sections
13584 in a PT_GNU_RELRO segment.
13585 (Layout::create_initial_dynamic_sections): Mark the .dynamic
13587 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
13589 (Layout::linkonce_mapping): Map d.rel.ro.local to
13590 .data.rel.ro.local.
13591 (Layout::output_section_name): Us .data.rel.ro.local for any
13592 section which begins with that.
13593 * layout.h (class Layout): Update add_output_section_data
13594 declaration. Add relro_segment_ field.
13595 * output.cc (Output_section::Output_section): Initialize is_relro_
13596 and is_relro_local_ fields.
13597 (Output_segment::add_output_section): Group relro sections.
13598 (Output_segment::is_first_section_relro): New function.
13599 (Output_segment::maximum_alignment): If there is a relro section,
13600 align the segment to the common page size.
13601 (Output_segment::set_section_addresses): Track whether we are
13602 looking at relro sections. If the last section is a relro
13603 section, align to the common page size.
13604 (Output_segment::set_section_list_addresses): Add in_relro
13605 parameter. Change all callers. Align to the page size when
13606 moving from relro to non-relro section.
13607 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
13609 * output.h (class Output_section): Add is_relro_ and
13610 is_relro_local_ fields.
13611 (Output_section::is_relro): New function.
13612 (Output_section::set_is_relro): New function.
13613 (Output_section::is_relro_local): New function.
13614 (Output_section::set_is_relro_local): New function.
13615 (class Output_segment): Update declarations.
13616 * i386.cc (Target_i386::got_section): Mark .got section as relro.
13617 * sparc.cc (Target_sparc::got_section): Likewise.
13618 * x86_64.cc (Target_x86_64::got_section): Likewise.
13619 * testsuite/relro_test_main.cc: New file.
13620 * testsuite/relro_test.cc: New file.
13621 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
13622 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
13623 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
13624 (relro_test.so, relro_test_pic.o): New targets.
13625 * testsuite/Makefile.in: Rebuild.
13627 2008-05-16 Ian Lance Taylor <iant@google.com>
13629 * output.cc (Output_segment::add_output_section): Remove front
13631 * output.h (class Output_segment): Remove
13632 add_initial_output_section and overloaded add_output_section.
13633 Update declaration of remaining add_output_section.
13634 * layout.cc (Layout::create_interp): Call add_output_section
13635 rather than add_initial_output_section.
13636 (Layout::finish_dynamic_section): Likewise.
13638 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
13639 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
13640 know the dynamic type.
13641 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
13642 field. Initialize it in constructor.
13643 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
13644 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
13645 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
13648 * output.cc (Output_reloc::get_address): Change return type to
13650 * output.h (class Output_reloc): Update get_address declaration.
13651 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
13652 for section addresses.
13654 2008-05-09 Ian Lance Taylor <iant@google.com>
13657 * gold.cc (gold_nomem): Use return value of write.
13659 2008-05-08 Ian Lance Taylor <iant@google.com>
13661 * symtab.c (Symbol::init_base_output_data): Add version
13662 parameter. Change all callers.
13663 (Symbol::init_base_output_segment): Likewise.
13664 (Symbol::init_base_constant): Likewise.
13665 (Symbol::init_base_undefined): Likewise.
13666 (Sized_symbol::init_output_data): Likewise.
13667 (Sized_symbol::init_output_segment): Likewise.
13668 (Sized_symbol::init_constant): Likewise.
13669 (Sized_symbol::init_undefined): Likewise.
13670 (Symbol_table::do_define_in_output_data): If the new symbol has a
13671 version, mark it as the default.
13672 (Symbol_table::do_define_in_output_segment): Likewise.
13673 (Symbol_table::do_define_as_constant): Likewise.
13674 * symtab.h (class Symbol): Update declarations.
13675 (class Sized_symbol): Likewise.
13676 * resolve.cc (Symbol::override_version): New function.
13677 (Symbol::override_base): Call override_version.
13678 (Symbol::override_base_with_special): Likewise.
13679 * testsuite/ver_script_8.script: New file.
13680 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
13681 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
13682 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
13683 (ver_test_8_1.so, ver_test_8_2.so): New targets.
13685 2008-05-06 Ian Lance Taylor <iant@google.com>
13688 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
13690 (class General_options): Remove existing --undefined, and add
13691 --no-undefined instead. Add new --undefined as synonym for -u.
13692 * archive.cc (Archive::add_symbols): Check whether symbol was
13694 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
13695 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
13696 all uses. Add IS_UNDEFINED. Update declarations to split
13697 different versions of init_base. Declare init_base_undefined.
13698 (Symbol::is_defined): Handle IS_UNDEFINED.
13699 (Symbol::is_undefined): Likewise.
13700 (Symbol::is_weak_undefined): Call is_undefined.
13701 (Symbol::is_absolute): Handle IS_CONSTANT.
13702 (class Sized_symbol): Update declarations to split different
13703 versions of init. Declare init_undefined.
13704 (class Symbol_table): Declare new functions.
13705 * symtab.cc (Symbol::init_base_object): Rename from init_base.
13706 Change all callers.
13707 (Symbol::init_base_output_data): Likewise.
13708 (Symbol::init_base_output_segment): Likewise.
13709 (Symbol::init_base_constant): Likewise.
13710 (Symbol::init_base_undefined): New function.
13711 (Sized_symbol::init_object): Rename from init. Change all
13713 (Sized_symbol::init_output_data): Likewise.
13714 (Sized_symbol::init_output_segment): Likewise.
13715 (Sized_symbol::init_constant): Likewise.
13716 (Sized_symbol::init_undefined): New function.
13717 (Symbol_table::add_undefined_symbols_from_command_line): New
13719 (Symbol_table::do_add_undefined_symbols_from_command_line): New
13721 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
13722 (Symbol::output_section): Likewise.
13723 (Symbol::set_output_section): Likewise.
13724 (Symbol_table::sized_finalize_symbol): Likewise.
13725 (Symbol_table::sized_write_globals): Likewise.
13726 * resolve.cc (Symbol_table::should_override): Likewise.
13727 (Symbol::override_base_with_special): Likewise.
13729 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
13730 symbol, change it to have default visibility.
13731 * testsuite/protected_1.cc: New file.
13732 * testsuite/protected_2.cc: New file.
13733 * testsuite/protected_3.cc: New file.
13734 * testsuite/protected_main_1.cc: New file.
13735 * testsuite/protected_main_2.cc: New file.
13736 * testsuite/protected_main_3.cc: New file.
13737 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
13738 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
13739 (protected_1_LDFLAGS, protected_1_LDADD): Define.
13740 (protected_1.so): New target.
13741 (protected_1_pic.o, protected_2_pic.o): New targets.
13742 (protected_3_pic.o): New target.
13743 (check_PROGRAMS): Add protected_2.
13744 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
13745 (protected_2_LDFLAGS, protected_2_LDADD): Define.
13746 * testsuite/Makefile.in: Rebuild.
13748 * options.h (DEFINE_var): Add set_user_set_##varname__.
13749 (DEFINE_bool_alias): New macro.
13750 (class General_options): Define -Bstatic using DEFINE_bool_alias
13751 rather than DEFINE_special. Add --undefined as an alias for -z
13753 * options.cc (General_options::parse_Bstatic): Remove.
13755 * options.h (class General_options): Add --fatal-warnings.
13756 * main.cc (main): Implement --fatal-warnings.
13757 * errors.h (Errors::warning_count): New function.
13759 * options.h (class General_options): Add -Bsymbolic-functions.
13760 * symtab.h (Symbol::is_preemptible): Check for
13761 -Bsymbolic-functions.
13763 2008-05-05 Ian Lance Taylor <iant@google.com>
13765 * options.h (DEFINE_bool): For DASH_Z, create the negative option
13766 as noVARNAME rather than no-VARNAME.
13767 (class General_options): Add option -z combreloc.
13768 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
13770 (Output_reloc::sort_before) [SHT_REL]: New function.
13771 (Output_reloc::sort_before) [SHT_RELA]: New function.
13772 (class Output_data_reloc_base): Add sort_relocs_ field. Define
13773 Sort_relocs_comparison.
13774 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
13775 parameter. Change all callers.
13776 (Output_data_reloc::Output_data_reloc) [both versions]: Add
13777 sort_relocs parameter. Change all callers.
13778 * output.cc (Output_reloc::get_address): New function, broken out
13780 (Output_reloc::write_rel): Call it.
13781 (Output_reloc::compare): New function.
13782 (Output_data_reloc_base::do_write): Optionally sort relocs.
13784 * configure.ac: If targ_extra_obj is set, link it in.
13785 * configure.tgt: Initialize all variables.
13786 (x86_64*): Set targ_extra_obj and targ_extra_size.
13787 * configure: Rebuild.
13789 * object.cc (Sized_relobj::include_section_group): Adjust section
13790 indexes read from group data. Build vector to pass to
13792 * layout.cc (Layout::layout_group): Add flags and shndxes
13793 parameters. Remove contents parameter. Change caller. Update
13794 explicit instantiations.
13795 * layout.h (class Layout): Update layout_group declaration.
13796 * output.cc (Output_data_group::Output_data_group): Add flags and
13797 input_shndxes parameters. Remove contents parameter. Change
13799 (Output_data_group::do_write): Change input_sections_ to
13801 * output.h (class Output_data_group): Update constructor
13802 declaration. Rename input_sections_ to input_shndxes_.
13803 * testsuite/many_sections_test.cc: Add template.
13805 2008-04-30 Cary Coutant <ccoutant@google.com>
13807 * target-reloc.h (relocate_section): Fix dead-pointer bug.
13809 * layout.cc (Layout::include_section): Refactored check for debug
13811 (Layout::add_comdat): Add new parameters. Change type
13812 of signature parameter. Add object and shndx to signatures table.
13813 (Layout::find_kept_object): New function.
13814 * layout.h: Include <cstring>.
13815 (Layout::is_debug_info_section): New function.
13816 (Layout::add_comdat): Add new parameters.
13817 (Layout::find_kept_object): New function.
13818 (Layout::Kept_section): New struct.
13819 (Layout::Signatures): Change type of map range.
13820 * object.cc (Relobj::output_section_address): New function.
13821 (Sized_relobj::include_section_group): Add new parameters. Change
13822 calls to Layout::add_comdat. Change to build table of kept comdat
13823 groups and table mapping discarded sections to kept sections.
13824 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
13825 (Sized_relobj::do_layout): Change calls to include_section_group and
13826 include_linkonce_section.
13827 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
13828 value to zero when section is discarded.
13829 (Sized_relobj::map_to_kept_section): New function.
13830 * object.h (Relobj::output_section_address): New function.
13831 (Relobj::Comdat_group): New type.
13832 (Relobj::find_comdat_group): New function.
13833 (Relobj::Comdat_group_table): New type.
13834 (Relobj::Kept_comdat_section): New type.
13835 (Relobj::Kept_comdat_section_table): New type.
13836 (Relobj::add_comdat_group): New function.
13837 (Relobj::set_kept_comdat_section): New function.
13838 (Relobj::get_kept_comdat_section): New function.
13839 (Relobj::comdat_groups_): New field.
13840 (Relobj::kept_comdat_sections_): New field.
13841 (Symbol_value::input_value): Update comment.
13842 (Sized_relobj::map_to_kept_section) New function.
13843 (Sized_relobj::include_linkonce_section): Add new parameter.
13844 * target-reloc.h (Comdat_behavior): New type.
13845 (get_comdat_behavior): New function.
13846 (relocate_section): Add code to map a discarded section to the
13847 corresponding kept section when applying a relocation.
13849 2008-04-30 Craig Silverstein <csilvers@google.com>
13851 * dwarf_reader.cc (next_generation_count): New static var.
13852 (Addr2line_cache_entry): New struct.
13853 (addr2line_cache): New static var.
13854 (Dwarf_line_info::one_addr2line): Added caching.
13855 (Dwarf_line_info::clear_addr2line_cache): New function.
13856 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
13857 cache-size parameter.
13858 (Dwarf_line_info::one_addr2line_cache): New function.
13859 * symtab.cc (Symbol_table::detect_odr_violations): Pass
13860 new cache-size argument to one_addr2line(), and clear cache.
13862 2008-04-28 Cary Coutant <ccoutant@google.com>
13864 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
13865 R_386_PC8 relocations.
13867 2008-04-23 Ian Lance Taylor <iant@google.com>
13869 * object.cc (Sized_relobj::include_section_group): Check for
13870 invalid section group.
13872 * object.cc (make_elf_object): Correct test for 64-bit ELF file
13875 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
13876 than read for file header.
13877 * archive.cc (Archive::include_member): Likewise.
13879 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
13881 * aclocal.m4: Regenerate.
13882 * configure: Regenerate.
13884 2008-04-19 Ian Lance Taylor <iant@google.com>
13886 * version.cc (version_string): Bump to 1.6.
13888 * testsuite/Makefile.am (many_sections_r_test): New target.
13889 (many_sections_r_test_SOURCES): Remove.
13890 (many_sections_r_test_DEPENDENCIES): Remove.
13891 (many_sections_r_test_LDFLAGS): Remove.
13892 (many_sections_r_test_LDADD): Remove.
13894 * object.cc (Sized_relobj::do_add_symbols): Always pass
13895 local_symbol_count_ to add_from_relobj.
13897 * testsuite/Makefile.am (many_sections_check.h): Only check one in
13898 every thousand variables.
13899 * testsuite/Makefile.in: Rebuild.
13901 * object.cc (Xindex::initialize_symtab_xindex): New function.
13902 (Xindex::read_symtab_xindex): New function.
13903 (Xindex::sym_xindex_to_shndx): New function.
13904 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
13906 (Sized_relobj::do_initialize_xindex): New function.
13907 (Sized_relobj::do_read_symbols): Adjust section links.
13908 (Sized_relobj::symbol_section_and_value): Add is_ordinary
13909 parameter. Change all callers.
13910 (Sized_relobj::include_section_group): Adjust section links and
13911 symbol section indexes.
13912 (Sized_relobj::do_layout): Adjust section links.
13913 (Sized_relobj::do_count_local_symbols): Adjust section links and
13914 symbol section indexes.
13915 (Sized_relobj::do_finalize_local_symbols): Distinguish between
13916 ordinary and special symbols.
13917 (Sized_relobj::write_local_symbols): Add symtab_xindex and
13918 dynsym_xindex parameters. Change all callers. Adjust section
13919 links. Use SHN_XINDEX when needed.
13920 (Sized_relobj::get_symbol_location_info): Adjust section links.
13921 Don't get fooled by special symbols.
13922 * object.h (class Xindex): Define.
13923 (class Object): Add xindex_ parameter. Declare virtual functoin
13924 do_initialize_xindex.
13925 (Object::adjust_sym_shndx): New function.
13926 (Object::set_xindex): New protected function.
13927 (class Symbol_value): Add is_ordinary_shndx_ field.
13928 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
13929 (Symbol_value::value): Assert ordinary section.
13930 (Symbol_value::initialize_input_to_output_map): Likewise.
13931 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
13932 Change all callers.
13933 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
13935 (class Sized_relobj): Update declarations.
13936 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
13937 parameter. Change all callers.
13938 (Sized_relobj::adjust_shndx): New function.
13939 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
13941 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
13942 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
13943 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
13944 (Sized_dynobj::read_dynsym_section): Adjust section links.
13945 (Sized_dynobj::read_dynamic): Likewise.
13946 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
13948 (Sized_dynobj::do_initialize_xindex): New function.
13949 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
13950 do_initialize_xindex.
13951 (Sized_dynobj::adjust_shndx): New function.
13952 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
13953 dynsym_xindex_ fields.
13954 (Layout::finalize): Add a call to set_section_indexes before
13955 creating the symtab sections.
13956 (Layout::set_section_indexes): Don't do anything if the section
13957 already has a section index.
13958 (Layout::create_symtab_sections): Add shnum parameter. Change
13959 caller. Create .symtab_shndx section if needed.
13960 (Layout::create_shdrs): Add shstrtab_section parameter. Change
13962 (Layout::allocated_output_section_count): New function.
13963 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
13965 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
13966 fields. Update declarations.
13967 (Layout::symtab_xindex): New function.
13968 (Layout::dynsym_xindex): New function.
13969 (class Write_symbols_task): Add layout_ field.
13970 (Write_symbols_task::Write_symbols_task): Add layout parameter.
13972 * output.cc (Output_section_headers::Output_section_headers): Add
13973 shstrtab_section parameter. Change all callers.
13974 (Output_section_headers::do_sized_write): Store overflow values
13975 for section count and section string table section index in
13976 section header zero.
13977 (Output_file_header::do_sized_write): Check for overflow of
13978 section count and section string table section index.
13979 (Output_symtab_xindex::do_write): New function.
13980 (Output_symtab_xindex::endian_do_write): New function.
13981 * output.h (class Output_section_headers): Add shstrtab_section_.
13982 Update declarations.
13983 (class Output_symtab_xindex): Define.
13984 (Output_section::has_out_shndx): New function.
13985 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
13987 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
13988 Change all callers.
13989 (Sized_symbol::init): Likewise.
13990 (Symbol::output_section): Check for ordinary symbol.
13991 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
13992 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
13994 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
13995 Change all callers. Simplify handling of symbols from sections
13996 not included in the link.
13997 (Symbol_table::add_from_dynobj): Handle ordinary symbol
13999 (Weak_alias_sorter::operator()): Assert that symbols are
14001 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
14003 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
14004 parameters. Change all callers.
14005 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
14006 symbol distinction. Use SHN_XINDEX when needed.
14007 (Symbol_table::write_section_symbol): Add symtab_xindex
14008 parameter. Change all callers.
14009 (Symbol_table::sized_write_section_symbol): Likewise. Use
14010 SHN_XINDEX when needed.
14011 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
14013 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
14014 (Symbol::is_defined): Check is_ordinary.
14015 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
14016 (Symbol::is_absolute, Symbol::is_common): Likewise.
14017 (class Sized_symbol): Update declarations.
14018 (class Symbol_table): Update declarations.
14019 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
14020 parameters. Change all callers.
14021 (Sized_symbol::override): Likewise.
14022 (Symbol_table::override): Likewise.
14023 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
14024 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
14025 is_ordinary, and orig_st_shndx parameters. Change all callers.
14026 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
14027 to be in an ordinary section.
14028 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
14029 object and is_ordinary parameters. Change all callers.
14030 (Sized_dwarf_line_info::read_relocs): Add object parameter.
14031 Change all callers. Don't add undefined or non-ordinary symbols
14033 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
14034 Change all callers.
14035 * dwarf_reader.h (class Sized_dwarf_line_info): Update
14037 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
14038 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
14039 (Sized_relobj::relocate_sections): Likewise.
14040 * target-reloc.h (scan_relocs): Adjust section symbol index.
14041 (scan_relocatable_relocs): Likewise.
14042 * i386.cc (Scan::local): Check for ordinary symbols.
14043 * sparc.cc (Scan::local): Likewise.
14044 * x86_64.cc (Scan::local): Likewise.
14045 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
14046 to symbol_section_and_value.
14047 * testsuite/many_sections_test.cc: New file.
14048 * testsuite/Makefile.am (BUILT_SOURCES): Define.
14049 (check_PROGRAMS): Add many_sections_test.
14050 (many_sections_test_SOURCES): Define.
14051 (many_sections_test_DEPENDENCIES): Define.
14052 (many_sections_test_LDFLAGS): Define.
14053 (BUILT_SOURCES): Add many_sections_define.h.
14054 (many_sections_define.h): New target.
14055 (BUILT_SOURCES): Add many_sections_check.h.
14056 (many_sections_check.h): New target.
14057 (check_PROGRAMS): Add many_sections_r_test.
14058 (many_sections_r_test_SOURCES): Define.
14059 (many_sections_r_test_DEPENDENCIES): Define.
14060 (many_sections_r_test_LDFLAGS): Define.
14061 (many_sections_r_test_LDADD): Define.
14062 (many_sections_r_test.o): New target.
14063 * testsuite/Makefile.in: Rebuild.
14065 2008-04-17 Cary Coutant <ccoutant@google.com>
14067 * errors.cc (Errors::info): New function.
14068 (gold_info): New function.
14069 * errors.h (Errors::info): New function.
14070 * gold.h (gold_info): New function.
14071 * object.cc (Input_objects::add_object): Print trace output.
14072 * options.cc (options::parse_set): New function.
14073 (General_options::parse_wrap): Deleted.
14074 (General_options::General_options): Deleted initializer.
14075 * options.h (options::String_set): New typedef.
14076 (options::parse_set): New function.
14077 (DEFINE_set): New macro.
14078 (General_options::wrap): Changed to use DEFINE_set. Changed
14079 callers of any_wrap_symbols and is_wrap_symbol.
14080 (General_options::trace, General_options::trace_symbol):
14082 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
14083 (General_options::wrap_symbols_): Deleted.
14084 * symtab.cc (Symbol_table::add_from_object): Print trace output.
14086 2008-04-17 David S. Miller <davem@davemloft.net>
14088 * options.cc (General_options::parse_V): New function.
14089 * options.h: Add entries for -V and -Qy.
14091 2008-04-17 Ian Lance Taylor <iant@google.com>
14093 * common.cc (Symbol_table::allocate_commons): Remove options
14094 parameter. Change caller.
14095 (Symbol_table::do_allocate_commons): Remove options parameter.
14096 Change caller. Just call do_allocate_commons_list twice.
14097 (Symbol_table::do_allocate_commons_list): New function, broken out
14098 of do_allocate_commons.
14099 * common.h (class Allocate_commons_task): Remove options_ field.
14100 Update constructor.
14101 * symtab.cc (Symbol_table::Symbol_table): Initialize
14103 (Symbol_table::add_from_object): Put TLS common symbols on
14105 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
14106 which are IN_OUTPUT_DATA.
14107 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
14108 allocate_commons and do_allocate_commons declarations. Declare
14109 do_allocate_commons_list.
14110 * gold.cc (queue_middle_tasks): Update creation of
14111 Allocate_commons_task to not pass options.
14112 * testsuite/Makefile.am (INCLUDES): Add -I.. .
14113 (TLS_TEST_C_FLAGS): New variable.
14114 (tls_test_c_pic.o): New target.
14115 (tls_test_shared.so): Link in tls_test_c_pic.o.
14116 (tls_test_c_pic_ie.o): New target.
14117 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
14118 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
14119 (tls_test_c.o): New target.
14120 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
14121 (tls_pic_test_LDADD): Likewise.
14122 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
14123 (tls_shared_gd_to_ie_test_LDADD): Likewise.
14124 (tls_test_c_gnu2.o): New target.
14125 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
14127 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
14128 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
14129 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
14130 * testsuite/tls_test.cc: Include "config.h".
14131 (t_last): Call t11_last.
14132 * testsuite/tls_test.h (t11, t11_last): Declare.
14133 * testsuite/tls_test_c.c: New file.
14134 * testsuite/tls_test_main.cc (thread_routine): Call t11.
14135 * configure.ac: Check for OpenMP support.
14136 * configure, config.in, Makefile.in: Rebuild.
14137 * testsuite/Makefile.in: Rebuild.
14139 2008-04-16 Cary Coutant <ccoutant@google.com>
14141 * i386.cc (Target_i386::define_tls_base_symbol): New function.
14142 (Target_i386::tls_base_symbol_defined_): New field.
14143 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14144 (Target_i386::Scan::global): Likewise.
14145 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
14146 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
14147 (Target_x86_64::tls_base_symbol_defined_): New field.
14148 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14149 (Target_x86_64::Scan::global): Likewise.
14151 2008-04-16 Cary Coutant <ccoutant@google.com>
14153 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
14154 (Symbol::needs_plt_entry): Allow weak undefined symbols.
14155 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
14156 building shared libraries.
14157 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
14158 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
14159 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
14160 * testsuite/Makefile.in: Rebuild.
14161 * testsuite/weak_undef.h: New file.
14162 * testsuite/weak_undef_file1.cc: Add extra test cases.
14163 * testsuite/weak_undef_file2.cc: Likewise.
14164 * testsuite/weak_undef_test.cc: Likewise.
14166 2008-04-16 David S. Miller <davem@davemloft.net>
14168 * sparc.cc (Target_sparc::Scan): Change from struct to class.
14169 Add issued_non_pic_error_ field. Declare check_non_pic.
14170 (Target_sparc::Scan::check_non_pic): New function.
14171 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
14172 (Target_sparc::Scan::global): Likewise.
14174 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
14175 * configure: Rebuild.
14177 * options.h (DEFINE_enable): New macro.
14178 (new_dtags): New enable option.
14179 (initfirst, interpose, loadfltr, nodefaultlib,
14180 nodelete, nodlopen, nodump): New -z options.
14181 * layout.cc (Layout:finish_dynamic_section): If new
14182 dtags enabled, emit DT_RUNPATH. Also, emit a
14183 DT_FLAGS_1 containing any specified -z flags.
14185 2008-04-16 Ian Lance Taylor <iant@google.com>
14187 * copy-relocs.cc: New file.
14188 * copy-relocs.h: New file.
14189 * reloc.cc: Remove Copy_relocs code.
14190 * reloc.h: Likewise.
14191 * reloc-types.h (struct Reloc_types) [both versions]: Add
14192 get_reloc_addend_noerror.
14193 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
14194 variants of add_global which take an addend which must be zero.
14195 * i386.cc: Include "copy-relocs.h".
14196 (class Target_i386): Change type of copy_relocs_ to variable,
14197 update initializer.
14198 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
14199 Change all callers.
14200 (Target_i386::do_finalize_sections): Change handling of
14202 * sparc.cc: Include "copy-relocs.h".
14203 (class Target_sparc): Change type of copy_relocs_ to variable,
14204 update initializer.
14205 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
14206 Change all callers.
14207 (Target_sparc::do_finalize_sections): Change handling of
14209 * x86_64.cc: Include "copy-relocs.h".
14210 (class Target_x86_64): Change type of copy_relocs_ to variable,
14211 update initializer.
14212 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
14213 class. Change all callers.
14214 (Target_x86_64::do_finalize_sections): Change handling of
14216 * Makefile.am (CCFILES): Add copy-relocs.cc.
14217 (HFILES): Add copy-relocs.h.
14219 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
14221 * testsuite/script_test_4.sh: Permit leading zeroes.
14223 2008-04-15 Ian Lance Taylor <iant@google.com>
14225 * script-sections.cc (Script_sections::create_segments): Use
14226 header_size_adjustment even when there is enough room for the
14228 * testsuite/script_test_4.sh: New file.
14229 * testsuite/script_test_4.t: New file.
14230 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
14231 (check_DATA): Add script_test_4.stdout.
14232 (MOSTLYCLEANFILES): Likewise.
14233 (script_test_4): New target.
14234 (script_test_4.stdout): New target.
14235 * testsuite/Makefile.in: Rebuild.
14237 * sparc.cc: Add definitions for Output_data_plt_sparc class
14240 2008-04-14 David S. Miller <davem@davemloft.net>
14242 * sparc.cc: New file.
14243 * Makefile.am (TARGETSOURCES): Add sparc.cc
14244 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
14245 * configure.tgt: Document targ_extra_size and
14246 targ_extra_big_endian. Add entries for sparc-* and
14248 * configure.ac: Handle targ_extra_size and
14249 targ_extra_big_endian.
14250 * Makefile.in: Rebuild.
14251 * configure: Likewise.
14252 * po/POTFILES.in: Likewise.
14253 * po/gold.pot: Likewise.
14255 2008-04-14 Ian Lance Taylor <iant@google.com>
14257 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
14258 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
14259 in the name/type/flags to section mapping. Don't call
14260 allocate_output_section.
14261 (Layout::choose_output_section): Change parameter from adjust_name
14262 to is_input_section. Don't permit input sections after sections
14263 are attached to segments. Don't call allocate_output_section.
14264 (Layout::layout_eh_frame): Call update_flags_for_input_section,
14265 not write_enable_output_section.
14266 (Layout::make_output_section): Don't push to
14267 unattached_section_list_ nor call attach_to_segment. Call
14268 attach_section_to_segment if sections are attached.
14269 (Layout::attach_sections_to_segments): New function.
14270 (Layout::attach_section_to_segment): New function.
14271 (Layout::attach_allocated_section_to_segment): Rename from
14272 attach_to_segment. Remove flags parameter.
14273 (Layout::allocate_output_section): Remove function.
14274 (Layout::write_enable_output_section): Remove function.
14275 * layout.h (class Layout): Update for above changes. Add new
14276 field sections_are_attached_.
14277 * output.h (Output_section::update_flags_for_input_section): New
14279 * output.cc (Output_section::add_input_section): Call
14280 update_flags_for_input_section.
14281 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
14283 2008-04-11 Cary Coutant <ccoutant@google.com>
14285 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
14286 thought unnecessary.
14287 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
14289 2008-04-11 Ian Lance Taylor <iant@google.com>
14291 * output.h (class Output_section_data): Remove inline definition
14293 * output.cc (Output_section_data::set_addralign): New function.
14295 2008-04-11 Cary Coutant <ccoutant@google.com>
14297 Add support for TLS descriptors for i386 and x86_64.
14298 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
14299 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
14300 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
14302 (Target_i386::got_mod_index_entry): Remove unnecessary code.
14303 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
14304 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
14306 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
14307 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
14308 Fix problem with initial-exec relocations.
14309 (Target_i386::Relocate::relocate_tls): Likewise.
14310 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
14312 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
14313 support for section-plus-offset dynamic table entries.
14314 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
14315 (Output_data_dynamic::Dynamic_entry): Add support for
14316 section-plus-offset dynamic table entries.
14317 (Output_data_dynamic::Classification): Likewise.
14318 (Output_data_dynamic::classification_): Renamed offset_.
14319 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
14320 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
14321 (Target_x86_64::make_plt_section): New function.
14322 (Target_x86_64::reserve_tlsdesc_entries): New function.
14323 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
14324 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
14325 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
14326 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
14327 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
14328 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
14329 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
14330 add extra PLT entry for TLS descriptors.
14331 (Output_data_plt_x86_64::got_): New field.
14332 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
14333 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
14335 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
14337 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
14338 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
14339 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
14340 R_386_TLS_DESC_CALL relocations.
14341 (Target_x86_64::Scan::global): Likewise.
14342 (Target_x86_64::do_finalize_sections): Add dynamic table entries
14343 for TLS descriptors.
14344 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
14345 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
14346 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
14347 GD-to-IE relaxation.
14348 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
14349 and TLS_DESCRIPTORS.
14350 * Makefile.in: Rebuild.
14351 * configure: Rebuild.
14352 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
14353 (tls_test_shared2.so): New target.
14354 (tls_shared_gd_to_ie_test_SOURCES): New variable.
14355 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
14356 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
14357 (tls_shared_gd_to_ie_test_LDADD): New variable.
14358 (tls_shared_gnu2_gd_to_ie_test): New target.
14359 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
14361 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
14362 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
14363 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
14364 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
14365 (tls_shared_gnu2_test): New target.
14366 (tls_test_gnu2_shared.so): New target.
14367 (tls_shared_gnu2_test_SOURCES): New variable.
14368 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
14369 (tls_shared_gnu2_test_LDFLAGS): New variable.
14370 (tls_shared_gnu2_test_LDADD): New variable.
14371 * testsuite/Makefile.in: Rebuild.
14372 * testsuite/Makefile.
14374 2008-04-11 Ian Lance Taylor <iant@google.com>
14376 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
14378 * testsuite/Makefile.in: Rebuild.
14380 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
14382 * testsuite/script_test_2.cc (main): Adjust test.
14384 2008-04-11 David S. Miller <davem@davemloft.net>
14385 Ian Lance Taylor <iant@google.com>
14387 * options.h (General_options): Add entries for '-Y' and
14389 * options.cc (General_options:finalize): If -Y was used, add those
14390 entries to the library path instead of the default "/lib" and
14393 2008-04-11 David S. Miller <davem@davemloft.net>
14395 * testsuite/justsyms.t: Start at 0x100.
14396 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
14397 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
14399 * testsuite/script_test_2.cc: Adjust string and section length
14402 2008-04-09 Ian Lance Taylor <iant@google.com>
14405 * script-sections.cc (Sections_element::allocate_to_segment): Add
14407 (Output_section_definition::allocate_to_segment): Likewise.
14408 (Orphan_output_section::allocate_to_segment): Likewise.
14409 (Script_sections::attach_sections_using_phdrs_clause): Don't
14410 propagate non-PT_LOAD segments to orphan sections.
14411 * testsuite/Makefile.am (script_test_3.stdout): Generate using
14412 readelf rather than objdump.
14413 * testsuite/script_test_3.sh: Adjust accordingly. Test that
14414 .interp section and PT_INTERP segment are the same size.
14415 * testsuite/Makefile.in: Rebuild.
14417 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
14418 aliases for symbols defined in the same object.
14419 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
14420 (weak_alias_test_SOURCES): New variable.
14421 (weak_alias_test_DEPENDENCIES): New variable.
14422 (weak_alias_test_LDFLAGS): New variable.
14423 (weak_alias_test_LDADD): New variable.
14424 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
14425 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
14426 (weak_alias_test_3.o): New target.
14427 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
14428 * testsuite/weak_alias_test_main.cc: New file.
14429 * testsuite/weak_alias_test_1.cc: New file.
14430 * testsuite/weak_alias_test_2.cc: New file.
14431 * testsuite/weak_alias_test_3.cc: New file.
14433 2008-04-08 Ian Lance Taylor <iant@google.com>
14435 * options.h (class General_options): Add --noinhibit-exec option.
14436 * main.cc (main): Check --noinhibit-exec.
14438 * options.h (class General_options): Define --wrap as a special
14439 option. Add wrap_symbols_ field.
14440 (General_options::any_wrap_symbols): New function.
14441 (General_options::is_wrap_symbol): New function.
14442 * options.cc (General_options::parse_wrap): New function.
14443 (General_options::General_options): Initialize wrap_symbols_.
14444 * symtab.cc (Symbol_table::wrap_symbol): New function.
14445 (Symbol_table::add_from_object): Handle --wrap.
14446 * symtab.h (class Symbol_table): Declare wrap_symbol.
14447 * target.h (Target::wrap_char): New function.
14448 (Target::Target_info): Add wrap_char field.
14449 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
14450 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14451 * testsuite/testfile.cc (Target_test::test_target_info):
14454 * errors.cc (Errors::undefined_symbol): Mention symbol version if
14457 * layout.h (class Layout): Add added_eh_frame_data_ field.
14458 * layout.cc (Layout::Layout): Initialize new field.
14459 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
14460 output section until we find a section we merged successfully.
14461 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
14462 that the size be non-zero.
14464 * merge.cc (Object_merge_map::get_output_offset): Remove inline
14467 2008-04-08 Craig Silverstein <csilvers@google.com>
14469 * configure.ac: Export new conditional variable HAVE_ZLIB.
14470 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
14472 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
14473 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14475 2008-04-07 Ian Lance Taylor <iant@google.com>
14477 * version.cc (version_string): Set to "1.5".
14479 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
14480 Add issued_non_pic_error_ field. Declare check_non_pic.
14481 (Target_x86_64::Scan::check_non_pic): New function.
14482 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
14483 (Target_x86_64::Scan::global): Likewise.
14485 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
14486 addend parameter. Change caller. Handle merge sections.
14487 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
14488 Address to Addend. Don't add in the result of
14489 local_section_offset, pass down the addend and use the returned
14491 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
14492 Update declarations of local_section_offset and symbol_value.
14493 * testsuite/two_file_test_1.cc (t18): New function.
14494 * testsuite/two_file_test_2.cc (f18): New function.
14495 * testsuite/two_file_test_main.cc (main): Call t18.
14496 * testsuite/two_file_test.h (t18, f18): Declare.
14498 * configure.ac: Don't test for objdump, c++filt, or readelf.
14499 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
14501 (TEST_READELF): New variable.
14502 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
14503 (check_PROGRAMS): Add two_file_strip_test.
14504 (two_file_strip_test): New target.
14505 (check_PROGRAMS): Add two_file_same_shared_strip_test.
14506 (two_file_same_shared_strip_test_SOURCES): New variable.
14507 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
14508 (two_file_same_shared_strip_test_LDFLAGS): New variable.
14509 (two_file_same_shared_strip_test_LDADD): New variable.
14510 (two_file_shared_strip.so): New target.
14511 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
14512 (ver_test_5.syms, ver_test_7.syms): Likewise.
14513 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
14514 (strip_test_3.stdout): Use TEST_OBJDUMP.
14515 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14517 2008-04-04 Cary Coutant <ccoutant@google.com>
14519 * symtab.h (Symbol::is_weak_undefined): New function.
14520 (Symbol::is_strong_undefined): New function.
14521 (Symbol::is_absolute): New function.
14522 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
14523 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
14525 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
14526 (weak_undef_test): New target.
14527 * testsuite/Makefile.in: Rebuild.
14528 * testsuite/weak_undef_file1.cc: New file.
14529 * testsuite/weak_undef_file2.cc: New file.
14530 * testsuite/weak_undef_test.cc: New file.
14532 2008-04-03 Craig Silverstein <csilvers@google.com>
14534 * compressed_output.h (class Output_compressed_section): Use
14536 * compressed_output.cc (zlib_compress): Use unsigned buffers,
14538 (zlib_compressed_suffix): Removed.
14539 (Output_compressed_section::set_final_data_size): Use unsigned
14541 * testsuite/Makefile.am (flagstest_compress_debug_sections):
14542 Fix linker invocation.
14543 (flagstest_o_specialfile_and_compress_debug_sections):
14545 * testsuite/Makefile.in: Regenerated.
14547 2008-04-02 David S. Miller <davem@davemloft.net>
14549 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
14550 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
14552 2008-04-02 Craig Silverstein <csilvers@google.com>
14556 2008-04-02 Ian Lance Taylor <iant@google.com>
14558 * fileread.cc (File_read::find_view): Add byteshift and vshifted
14559 parameters. Update for new key type to views_. Change all
14561 (File_read::read): Adjust for byteshift in returned view.
14562 (File_read::add_view): New function, broken out of
14563 find_and_make_view.
14564 (File_read::make_view): New function, broken out of
14565 find_and_make_view.
14566 (File_read::find_or_make_view): Add offset and aligned
14567 parameters. Rewrite accordingly. Change all callers.
14568 (File_read::get_view): Add offset and aligned parameters. Adjust
14569 for byteshift in return value.
14570 (File_read::get_lasting_view): Likewise.
14571 * fileread.h (class File_read): Update declarations.
14572 (class File_read::View): Add byteshift_ field. Add byteshift to
14573 constructor. Add byteshift method.
14574 * archive.h (Archive::clear_uncached_views): New function.
14575 (Archive::get_view): Add aligned parameter. Change all callers.
14576 * object.h (Object::get_view): Add aligned parameter. Change all
14578 (Object::get_lasting_view): Likewise.
14580 * fileread.cc (File_read::release): Don't call clear_views if
14581 there are multiple objects.
14582 * fileread.h (File_read::clear_uncached_views): New function.
14583 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
14586 2008-03-31 Cary Coutant <ccoutant@google.com>
14588 Add thin archive support.
14589 * archive.cc (Archive::armagt): New const.
14590 (Archive::setup): Remove task parameter and calls to unlock.
14591 (Archive::unlock_nested_archives): New function.
14592 (Archive::read_header): Add nested_off parameter. Change
14594 (Archive::interpret_header): Likewise.
14595 (Archive::include_all_members): Change to handle thin
14597 (Archive::include_member): Likewise.
14598 * archive.h (Archive::Archive): Add new parameters and
14600 (Archive::armagt): New const.
14601 (Archive::setup): Remove task parameter.
14602 (Archive::unlock_nested_archives): New function.
14603 (Archive::read_header): Add nested_off parameter.
14604 (Archive::interpret_header): Likewise.
14605 (Archive::Nested_archive_table): New typedef.
14606 (Archive::is_thin_archive_): New field.
14607 (Archive::nested_archives_): New field.
14608 (Archive::options_): New field.
14609 (Archive::dirpath_): New field.
14610 (Archive::task_): New field.
14611 * readsyms.cc (Read_symbols::do_read_symbols): Add check
14612 for thin archives. Pass additional parameters to
14613 Archive::Archive. Unlock the archive file after calling
14616 2008-03-29 Ian Lance Taylor <iant@google.com>
14618 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
14619 version symbol to be local.
14620 * testsuite/ver_test_4.sh: New file.
14621 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
14622 (check_DATA): Add ver_test_4.syms.
14623 (ver_test_4.syms): New target.
14624 * testsuite/Makefile.in: Rebuild.
14627 (Output_section::Input_section_sort_entry::has_priority): New
14629 (Output_section::Input_section_sort_entry::match_file_name): New
14631 (Output_section::Input_section_sort_entry::match_section_name):
14633 (Output_section::Input_section_sort_entry::match_section_name_prefix):
14635 (Output_section::Input_section_sort_entry::match_section_file):
14637 (Output_section::Input_section_sort_compare::operator()): Rewrite
14638 using new Input_section_sort_entry functions. Sort crtbegin and
14639 crtend first. Sort sections with no priority before sections with
14641 * testsuite/initpri1.c (d3): Check j != 4.
14642 (cd5): New constructor/destructor function.
14643 (main): Check j != 2.
14645 * symtab.cc (Symbol_table::add_from_object): If we don't use the
14646 new symbol when resolving, don't call set_is_default.
14647 * testsuite/ver_test_7.cc: New file.
14648 * testsuite/ver_test_7.sh: New file.
14649 * testsuite/Makefile.am (ver_test_7.so): New target.
14650 (ver_test_7.o): New target.
14651 (check_SCRIPTS): Add ver_test_7.sh.
14652 (check_DATA): Add ver_test_7.syms.
14653 (ver_test_7.syms): New target.
14655 2008-03-28 Ian Lance Taylor <iant@google.com>
14657 * layout.cc (Layout::layout): If we see an input section with a
14658 name that needs sorting, set the must_sort flag for the output
14660 (Layout::make_output_section): If the name of the output section
14661 indicates that it might require sorting, set the may_sort flag.
14662 * output.h (Output_section::may_sort_attached_input_sections): New
14664 (Output_section::set_may_sort_attached_input_sections): New
14666 (Output_section::must_sort_attached_input_sections): New
14668 (Output_section::set_must_sort_attached_input_sections): New
14670 (class Output_section): Declare Input_section_sort_entry. Define
14671 Input_section_sort_compare. Declare
14672 sort_attached_input_sections. Add new fields:
14673 may_sort_attached_input_sections_,
14674 must_sort_attached_input_sections_,
14675 attached_input_sections_are_sorted_.
14676 * output.cc (Output_section::Output_section): Initialize new
14678 (Output_section::add_input_section): Add an entry to
14679 input_sections_ if may_sort or must_sort are true.
14680 (Output_section::set_final_data_size): Call
14681 sort_attached_input_sections if necessary.
14682 (Output_section::Input_section_sort_entry): Define new class.
14683 (Output_section::Input_section_sort_compare::operator()): New
14685 (Output_section::sort_attached_input_sections): New function.
14686 * configure.ac: Check whether the compiler supports constructor
14687 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
14688 * testsuite/initpri1.c: New file.
14689 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
14690 CONSTRUCTOR_PRIORITY.
14691 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
14692 (initpri1_LDFLAGS): New variable.
14693 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14695 2008-03-27 Ian Lance Taylor <iant@google.com>
14697 * common.cc (Sort_commons::operator): Correct sorting algorithm.
14698 * testsuite/common_test_1.c: New file.
14699 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
14700 (common_test_1_SOURCES): New variable.
14701 (common_test_1_DEPENDENCIES): New variable.
14702 (common_test_1_LDFLAGS): New variable.
14704 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
14705 and commons_ correctly when NAME/VERSION does not override
14707 * testsuite/ver_test_6.c: New file.
14708 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
14709 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
14710 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
14712 2008-03-26 Ian Lance Taylor <iant@google.com>
14714 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
14715 of an undefined symbol from a version script.
14716 * testsuite/Makefile.am (ver_test_5.so): New target.
14717 (ver_test_5.o): New target.
14718 (check_SCRIPTS): Add ver_test_5.sh.
14719 (check_DATA): Add ver_test_5.syms.
14720 (ver_test_5.syms): New target.
14721 * testsuite/ver_test_5.cc: New file.
14722 * testsuite/ver_test_5.script: New file.
14723 * testsuite/ver_test_5.sh: New file.
14724 * Makefile.in, testsuite/Makefile.in: Rebuild.
14727 Fix problems building gold with gcc 4.3.0.
14728 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
14729 (gold_error_at_location, gold_warning_at_location): Use it.
14730 * configure.ac: Check whether we can compile and use a template
14731 function with a printf attribute.
14732 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
14733 when jumping over bytes.
14734 * object.cc: Instantiate Object::read_section_data.
14735 * debug.h: Include <cstring>
14736 * dwarf_reader.cc: Include <algorithm>
14737 * main.cc: Include <cstring>.
14738 * options.cc: Include <cstring>.
14739 * output.cc: Include <cstring>.
14740 * script.cc: Include <cstring>.
14741 * script.h: Include <string>.
14742 * symtab.cc: Include <cstring> and <algorithm>.
14743 * target-select.cc: Include <cstring>.
14744 * version.cc: Include <string>.
14745 * testsuite/testmain.cc: Include <cstdlib>.
14746 * configure, config.in: Rebuild.
14748 2008-03-25 Ian Lance Taylor <iant@google.com>
14750 * options.cc: Include "../bfd/bfdver.h".
14751 (options::help): Print bug reporting address.
14753 * version.cc (print_version): Adjust output for current value of
14754 BFD_VERSION_STRING.
14758 * options.cc (options::help): Print list of supported targets.
14759 * target-select.h: Include <vector>.
14760 (class Target_selector): Make machine_, size_, and is_big_endian_
14761 fields const. Add bfd_name_ and instantiated_target_ fields.
14762 (Target_selector::Target_selector): Add bfd_name parameter.
14763 (Target_selector::recognize): Make non-virtual, call
14765 (Target_selector::recognize_by_name): Make non-virtual, call
14766 do_recognize_by_name.
14767 (Target_selector::supported_names): New function.
14768 (Target_selector::bfd_name): New function.
14769 (Target_selector::do_instantiate_target): New pure virtual
14771 (Target_selector::do_recognize): New virtual function.
14772 (Target_selector::do_recognize_by_name): New virtual function.
14773 (Target_selector::instantiate_target): New private function.
14774 (supported_target_names): Declare.
14775 * target-select.cc (Target_selector::Target_selector): Update for
14776 new parameter and fields.
14777 (select_target_by_name): Check that the name matches before
14778 calling recognize_by_name.
14779 (supported_target_names): New function.
14780 * i386.cc (class Target_selector_i386): Update Target_selector
14781 constructor call. Remove recognize and recognize_by_name. Add
14782 do_instantiate_target.
14783 * x86_64.cc (class Target_selector_x86_64): Likewise.
14784 * testsuite/testfile.cc (class Target_selector_test): Update for
14785 changes to Target_selector.
14787 * README: Rewrite, with some notes on unsupported features.
14789 2008-03-24 Cary Coutant <ccoutant@google.com>
14791 * i386.cc (Target_i386::Got_type): New enum declaration.
14792 (Target_i386::Scan::local): Updated callers of Output_data_got
14794 (Target_i386::Scan::global): Likewise.
14795 (Target_i386::Relocate::relocate): Likewise.
14796 (Target_i386::Relocate::relocate_tls): Likewise.
14797 * object.h (Got_offset_list): New class.
14798 (Sized_relobj::local_has_got_offset): Added got_type parameter.
14799 (Sized_relobj::local_got_offset): Likewise.
14800 (Sized_relobj::set_local_got_offset): Likewise.
14801 (Sized_relobj::local_has_tls_got_offset): Removed.
14802 (Sized_relobj::local_tls_got_offset): Removed.
14803 (Sized_relobj::set_local_tls_got_offset): Removed.
14804 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
14805 * output.cc (Output_data_got::add_global): Added got_type parameter.
14806 (Output_data_got::add_global_with_rel): Likewise.
14807 (Output_data_got::add_global_with_rela): Likewise.
14808 (Output_data_got::add_global_pair_with_rel): New function.
14809 (Output_data_got::add_global_pair_with_rela): New function.
14810 (Output_data_got::add_local): Added got_type parameter.
14811 (Output_data_got::add_local_with_rel): Likewise.
14812 (Output_data_got::add_local_with_rela): Likewise.
14813 (Output_data_got::add_local_pair_with_rel): New function.
14814 (Output_data_got::add_local_pair_with_rela): New function.
14815 (Output_data_got::add_global_tls): Removed.
14816 (Output_data_got::add_global_tls_with_rel): Removed.
14817 (Output_data_got::add_global_tls_with_rela): Removed.
14818 (Output_data_got::add_local_tls): Removed.
14819 (Output_data_got::add_local_tls_with_rel): Removed.
14820 (Output_data_got::add_local_tls_with_rela): Removed.
14821 * output.h (Output_data_got::add_global): Added got_type parameter.
14822 (Output_data_got::add_global_with_rel): Likewise.
14823 (Output_data_got::add_global_with_rela): Likewise.
14824 (Output_data_got::add_global_pair_with_rel): New function.
14825 (Output_data_got::add_global_pair_with_rela): New function.
14826 (Output_data_got::add_local): Added got_type parameter.
14827 (Output_data_got::add_local_with_rel): Likewise.
14828 (Output_data_got::add_local_with_rela): Likewise.
14829 (Output_data_got::add_local_pair_with_rel): New function.
14830 (Output_data_got::add_local_pair_with_rela): New function.
14831 (Output_data_got::add_global_tls): Removed.
14832 (Output_data_got::add_global_tls_with_rel): Removed.
14833 (Output_data_got::add_global_tls_with_rela): Removed.
14834 (Output_data_got::add_local_tls): Removed.
14835 (Output_data_got::add_local_tls_with_rel): Removed.
14836 (Output_data_got::add_local_tls_with_rela): Removed.
14837 * resolve.cc (Symbol::override_base_with_special): Removed
14838 reference to has_got_offset_ field.
14839 * symtab.cc (Symbol::init_fields): Replaced initialization
14840 of got_offset_ with got_offsets_. Removed initialization
14842 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
14843 (Symbol::got_offset): Likewise.
14844 (Symbol::set_got_offset): Likewise.
14845 (Symbol::has_tls_got_offset): Removed.
14846 (Symbol::tls_got_offset): Removed.
14847 (Symbol::set_tls_got_offset): Removed.
14848 (Symbol::got_offset_): Removed.
14849 (Symbol::tls_mod_got_offset_): Removed.
14850 (Symbol::tls_pair_got_offset_): Removed.
14851 (Symbol::got_offsets_): New field.
14852 (Symbol::has_got_offset): Removed.
14853 (Symbol::has_tls_mod_got_offset): Removed.
14854 (Symbol::has_tls_pair_got_offset): Removed.
14855 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
14856 (Target_x86_64::Scan::local): Updated callers of Output_data_got
14858 (Target_x86_64::Scan::global): Likewise.
14859 (Target_x86_64::Relocate::relocate): Likewise.
14860 (Target_x86_64::Relocate::relocate_tls): Likewise.
14862 2008-03-25 Ben Elliston <bje@au.ibm.com>
14864 * yyscript.y: Fix spelling error in comment.
14866 2008-03-24 Ian Lance Taylor <iant@google.com>
14868 * options.h (class General_options): Define build_id option.
14869 * layout.h (class Layout): Declare write_build_id, create_note,
14870 create_build_id. Add build_id_note_ member.
14871 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
14872 "libiberty.h", "md5.h", "sha1.h".
14873 (Layout::Layout): Initialize eh_frame_data_,
14874 eh_frame_hdr_section_, and build_id_note_.
14875 (Layout::finalize): Call create_build_id.
14876 (Layout::create_note): New function, broken out of
14877 Layout::create_gold_note.
14878 (Layout::create_gold_note): Call create_note.
14879 (Layout::create_build_id): New function.
14880 (Layout::write_build_id): New function.
14881 (Close_task_runner::run): Call write_build_id.
14883 * x86_64.cc: Correct license to GPLv3.
14885 2008-03-23 Ian Lance Taylor <iant@google.com>
14887 * options.cc: Include "demangle.h".
14888 (parse_optional_string): New function.
14889 (parse_long_option): Handle takes_optional_argument.
14890 (parse_short_option): Update dash_z initializer. Handle
14891 takes_optional_argument.
14892 (General_options::General_options): Initialize do_demangle_.
14893 (General_options::finalize): Set do_demangle_. Handle demangling
14895 * options.h (parse_optional_string): Declare.
14896 (struct One_option): Add optional_arg field. Update constructor.
14897 Update call constructor calls. Add takes_optional_argument
14899 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
14900 (DEFINE_optional_string): Define.
14901 (General_options::demangle): Change from DEFINE_bool to
14902 DEFINE_optional_string.
14903 (General_options::no_demangle): New function.
14904 (General_options::do_demangle): New function.
14905 (General_options::set_do_demangle): New function.
14906 (General_options::execstack_status_): Move definition to end of
14908 (General_options::static_): Likewise.
14909 (General_options::do_demangle_): New field.
14910 * object.cc (big_endian>::get_symbol_location_info): Call
14911 Options::do_demangle, not Options::demangle.
14912 * symtab.cc (demangle): Likewise.
14914 2008-03-22 Ian Lance Taylor <iant@google.com>
14916 * gold.h: Include <cstddef> and <sys/types.h>
14917 * options.h: Include <cstring>.
14919 2008-03-21 Ian Lance Taylor <iant@google.com>
14921 * Added source code to GNU binutils.
14923 Copyright (C) 2008-2013 Free Software Foundation, Inc.
14925 Copying and distribution of this file, with or without modification,
14926 are permitted in any medium without royalty provided the copyright
14927 notice and this notice are preserved.
14933 version-control: never