1 2013-10-11 Roland McGrath <mcgrathr@google.com>
3 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
4 Remove const from declaration.
5 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
6 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
7 * output.h (Output_file_header): Remove const from member target_
8 and corresponding constructor argument.
9 * output.cc (Output_file_header::Output_file_header): Update prototype.
10 (Output_file_header::do_sized_write): Use this->target_ in place
11 of parameters()->target().
13 * testsuite/undef_symbol.cc (Foo::get_a): New method.
15 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
16 * configure: Regenerate.
17 * Makefile.in: Regenerate.
18 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
19 * testsuite/merge_string_literals_2.c: Likewise.
20 * testsuite/Makefile.am
21 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
22 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
23 literal -fmerge-constants.
24 * testsuite/Makefile.in: Regenerate.
26 * i386.cc (Target_i386): Remove unused member dynbss_.
27 * arm.cc (Target_arm): Likewise.
28 * powerpc.cc (Target_powerpc): Likewise.
29 * sparc.cc (Target_sparc): Likewise.
30 * tilegx.cc (Target_tilegx): Likewise.
31 * x86_64.cc (Target_x86_64): Likewise.
32 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
33 type_signature_, type_offset_.
34 * plugin.h (Plugin_hook): Remove unused member layout_.
35 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
37 (Read_member): Remove unused members input_objects_, symtab_,
39 (Check_library): Remove unused member symtab_.
40 * archive.h (Lib_group): Remove unused member lib_.
41 * archive.cc (Lib_group::Lib_group): Update initializer.
42 * incremental.h (Incremental_binary): Remove unused member target_.
43 (Incremental_script_entry): Removed unused member script_.
44 * layout.h (Write_symbols_task): Remove unused member input_objects_.
45 * icf.h (Icf): Remove unused member num_tracked_relocs.
47 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
48 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
50 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
52 * archive.h: Use struct rather than class for forward declaration
55 2013-10-07 Cary Coutant <ccoutant@google.com>
58 * testsuite/Makefile.am (icf_test): Fix dependencies.
59 (icf_safe_test): Likewise.
60 (icf_safe_so_test): Likewise.
61 (large_symbol_alignment): Add empty _LDADD rule.
62 * testsuite/Makefile.in: Regenerate.
64 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
67 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
68 relocation for R_X86_64_32 on x32.
70 2013-08-27 Roland McGrath <mcgrathr@google.com>
72 * output.cc (Output_segment::set_section_addresses): Take new
73 Target* argument. If target->isolate_execinstr() and the segment
74 is executable and starts at a target->abi_pagesize() boundary,
75 pad its end out to a target->abi_pagesize() boundary with code fill.
76 * output.h (Output_segment::set_section_addresses): Update decl.
77 * layout.h (Layout::check_output_data_for_reset_values): Take new
78 argument RELAX_OUTPUTS.
79 (Layout): New member relax_output_list_.
80 (Layout::add_relax_output): New method.
81 * layout.cc (Layout::Layout): Update constructor.
82 (Layout::reset_relax_output): New method.
83 (Layout::clean_up_after_relaxation): Call it.
84 (Layout::prepare_for_relaxation): Update caller.
85 (Layout::set_segment_offsets): Update callers of set_section_addresses.
86 Call reset_relax_output before re-processing segments for
87 isolate_execinstr case.
88 (Layout::write_data): Handle relax_output_list_.
89 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
90 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
92 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
95 * object.h: Fix typos.
97 2013-08-16 Roland McGrath <mcgrathr@google.com>
99 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
100 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
102 2013-08-07 Cary Coutant <ccoutant@google.com>
104 Revert support for v2 DWP files:
106 2013-03-01 Cary Coutant <ccoutant@google.com>
108 Add dwp support for v2 DWARF package file format.
109 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
110 tu_length parameter. Adjust all callers.
111 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
112 * dwp.cc: Include dwarf.h.
113 (Section_bounds): New struct type.
114 (Unit_set): New struct type.
115 (Dwo_file::Dwo_file): Initialize new data member.
116 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
117 Combine and rename to...
118 (Dwo_file::read_unit_index): ...this.
119 (Dwo_file::sized_read_compunit_index)
120 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
121 (Dwo_file::sized_read_unit_index): ...this.
122 (Dwo_file::copy_section): Remove section_name, is_str_offsets
123 parameters; add section_id parameter.
124 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
125 (Dwo_file::add_unit_set): ...this.
126 (Dwo_file::shndx_map_): Remove.
127 (Dwo_file::sect_offsets_): New data member.
128 (Dwp_output_file::Dwp_output_file): Initialize new data members.
129 (Dwp_output_file::add_section): Rename to...
130 (Dwp_output_file::add_contribution): ...this.
131 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
132 (Dwp_output_file::add_tu_set): Likewise.
133 (Dwp_output_file::Contribution): New type.
134 (Dwp_output_file::Section::contributions): New data member.
135 (Dwp_output_file::Cu_or_tu_set): Remove.
136 (Dwp_output_file::Section::Section): New ctor.
137 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
138 (Dwp_output_file::Dwp_index::Section_table): New type.
139 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
140 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
142 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
143 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
144 (Dwp_output_file::Dwp_index::section_table): New member function.
145 (Dwp_output_file::Dwp_index::section_table_end): New member function.
146 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
147 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
148 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
149 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
150 (Dwp_output_file::Dwp_index::section_table_): New data member.
151 (Dwp_output_file::Dwp_index::section_mask_): New data member.
152 (Dwp_output_file::add_output_section): New member function.
153 (Dwp_output_file::write_new_section): New member function.
154 (Dwp_output_file::write_contributions): New member function.
155 (Dwp_output_file::section_id_map_): New data member.
156 (class Dwo_id_info_reader): Remove.
157 (class Unit_reader): New class.
158 (get_dwarf_section_name): New function.
159 (Dwo_file::read_executable): Adjust initializations of class data.
160 (Dwo_file::read): Add support for v2 package file format.
161 (Dwo_file::read_unit_index): Likewise.
162 (Dwo_file::sized_read_unit_index): Likewise.
163 (Dwo_file::copy_section): Likewise.
164 (Dwo_file::add_unit_set): Likewise.
165 (Dwp_output_file::add_output_section): Likewise.
166 (Dwp_output_file::add_contribution): Likewise.
167 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
169 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
171 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
173 (Dwp_output_file::initialize): Remove unused function.
174 (Dwp_output_file::finalize): Add support for v2 package file format.
175 (Dwp_output_file::write_index): Likewise.
176 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
179 2013-07-31 Cary Coutant <ccoutant@google.com>
181 * object.cc (Sized_relobj::do_output_section_address): New function.
182 (Sized_relobj): Instantiate explicitly.
183 * object.h (Object::output_section_address): New function.
184 (Object::do_output_section_address): New function.
185 (Sized_relobj::do_output_section_address): New function.
186 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
188 2013-07-30 Cary Coutant <ccoutant@google.com>
189 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
191 * parameters.cc (Parameters::entry): Return target-specific entry
193 * target.h (Target::entry_symbol_name): New function.
194 (Target_info::entry_symbol_name): New data member.
196 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
197 * i386.cc (Target_i386::i386_info): Likewise.
198 (Target_i386_nacl::i386_nacl_info): Likewise.
199 * sparc.cc (Target_sparc::sparc_info): Likewise.
200 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
201 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
202 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
203 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
205 2013-07-22 Sterling Augustine <saugustine@google.com>
207 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
208 Convert parameter shndx to local variable. Add parameters symtab
209 and symtab_size. Scan over section names. Find relocation
210 section corresponding to current section. Create and initialize
211 reloc_mapper_ and reloc_type_.
212 (Dwarf_pubnames_table::read_header): Add assertion. Change
213 unit_length to off_t. Initialize member unit_length_. Fill in field
215 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
216 Initialize new fields unit_length_ and cu_offset_.
217 (Dwarf_pubnames_table::read_section): Update prototype.
218 (Dwarf_pubnames_table::cu_offset): New member function.
219 (Dwarf_pubnames_table::subsection_size): Likewise.
220 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
222 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
223 member functions public.
224 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
225 Update comment. Rework logic. Move repeated parts to...
226 (Gdb_index_info_reader::read_pubtable): ...here. New function.
227 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
228 pubtypes_table_, and stmt_list_offset.
229 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
230 Gdb_index::find_pubtype_offset,
231 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
232 (Gdb_index::pubnames_read): Update prototype and rework logic.
233 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
235 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
236 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
237 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
238 Gdb_index::map_pubtable_to_dies):
240 (Gdb_index::pubnames_read): Update declaration.
241 (Gdb_index::Pubname_offset_map): New type.
242 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
243 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
244 Gdb_index::stmt_list_offset): Declare.
245 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
246 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
247 Gdb_index::pubtypes_offset_): Remove.
249 2013-07-19 Roland McGrath <mcgrathr@google.com>
251 * options.h (General_options): Add -Trodata-segment option.
252 * parameters.cc (Parameters::check_rodata_segment): New function.
253 (Parameters::set_target_once): Call it.
254 * parameters.h (Parameters): Declare it (private member function).
255 * layout.cc (load_seg_unusable_for_headers): New function, broken
256 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
257 then validate rodata segment rather than text segment.
258 (relaxation_loop_body): Call that.
259 (is_text_segment): New function. Don't admit a non-executable
260 segment if TARGET->isolate_execinstr().
261 (set_segment_offsets): Call it. Honor -Trodata-segment option.
263 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
266 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
267 * nacl.h (Sniff_file::View::View): Request aligned view.
269 2013-07-11 Cary Coutant <ccoutant@google.com>
271 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
272 correct BRLT entry size.
274 2013-07-03 Alan Modra <amodra@gmail.com>
276 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
279 2013-07-01 Cary Coutant <ccoutant@google.com>
281 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
283 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
284 (Dwarf_ranges_table::lookup_reloc): New function.
285 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
287 (Dwarf_ranges_table::lookup_reloc): New function.
288 (Dwarf_ranges_table::reloc_type_): New data member.
290 2013-06-27 Jing Yu <jingyu@google.com>
293 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
295 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
296 (Target_powerpc::do_relax): Call the above.
298 2013-06-27 Cary Coutant <ccoutant@google.com>
300 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
301 on garbage collected .opd section.
303 2013-06-27 Alan Modra <amodra@gmail.com>
305 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
307 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
308 (Target_powerpc::do_function_location): Likewise for loc->shndx.
310 2013-06-14 Cary Coutant <ccoutant@google.com>
312 * resolve.cc (Symbol::override_base): Don't override st_type
313 from plugin placeholder symbols.
314 (Symbol_table::resolve): Likewise.
315 (Symbol_table::should_override): Don't complain about TLS mismatch
316 if the TO symbol is a plugin placeholder.
317 * testsuite/Makefile.am (plugin_test_tls): New test.
318 * testsuite/Makefile.in: Regenerate.
319 * testsuite/plugin_test_tls.sh: New test script.
320 * testsuite/two_file_test_2_tls.cc: New test source.
321 * testsuite/two_file_test_tls.cc: New test source.
323 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
325 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
326 the maximum segment alignment is larger than the page size.
327 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
328 correctly aligns the symbols with large alignemnt.
329 * testsuite/Makefile.in: Regenerate.
330 * testsuite/large_symbol_alignment.cc: New file.
332 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
333 Sriraman Tallam <tmsriram@google.com>
335 * options.h (sort_section): New option.
336 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
337 Rename from Input_section_sort_section_name_special_ordering_compare.
338 (Input_section_sort_section_name_compare): New struct.
339 * output.cc (Output_section::Input_section_sort_section_name_compare::
340 operator()): New function.
341 (Output_section::sort_attached_input_sections): Use new sort function
342 for .text if --sort-section=name is specified.
343 * layout.cc (Layout::make_output_section):
344 Add sorting by name when --sort-section=name is specified.
345 * testsuite/Makefile.am (text_section_grouping): Test option
347 * testsuite/Makefile.in: Regenerate.
348 * testsuite/section_sorting_name.cc: New file.
349 * testsuite/section_sorting_name.sh: New file.
351 2013-05-21 Cary Coutant <ccoutant@google.com>
353 * symtab.h (Symbol::is_cxx_vtable): New function.
354 * target-reloc.h (relocate_section): Check for vtable symbol.
355 * testsuite/Makefile.am (missing_key_func.sh): New test case.
356 * testsuite/Makefile.in: Regenerate.
357 * testsuite/missing_key_func.cc: New test source.
358 * testsuite/missing_key_func.sh: New test script.
360 2013-05-21 Cary Coutant <ccoutant@google.com>
362 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
363 type of enclosing symbol.
364 (Relocate_info::location): Check symbol type when describing symbol.
365 * object.h (Symbol_location_info): Remove unused line_number;
366 add enclosing_symbol_type.
367 * testsuite/debug_msg.sh: Adjust expected output.
369 2013-05-13 Cary Coutant <ccoutant@google.com>
371 * configure.ac: Export DEFAULT_TARGET.
372 * configure: Regenerate.
373 * Makefile.in: Regenerate.
374 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
375 * testsuite/Makefile.in: Regenerate.
376 * testsuite/debug_msg.sh: Delete duplicate tests.
377 Don't check undef_int error message match for powerpc where the
378 source file and line number aren't available.
380 2013-05-10 Roland McGrath <mcgrathr@google.com>
382 * options.h (General_options): Add --rosegment-gap option.
383 * options.cc (finalize): --rosegment-gap implies --rosegment.
384 * layout.cc (set_segment_offsets): Let user option override
385 target->rosegment_gap().
387 2013-05-10 Roland McGrath <mcgrathr@google.com>
389 * options.h (General_options): Remove leading space from help
390 messages for -nostdlib and --rosegment.
392 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
395 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
397 2013-05-03 Alan Modra <amodra@gmail.com>
399 * merge.cc (Output_merge_string::do_add_input_section): Correct
400 scan for number of strings. Rename vars to avoid shadowing.
401 Include missing terminator in input_size_.
403 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
405 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
406 Restore empty string handling.
408 2013-05-01 Cary Coutant <ccoutant@google.com>
410 * stringpool.cc (Stringpool_template::new_key_offset): Fix
411 uninitialized warning.
413 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
415 * output.cc (Output_section::add_merge_input_section): Allow
416 to merge sections if the alignment is more than character size.
417 * merge.h (Output_merge_string::Output_merge_string): Remove
419 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
420 only not-null strings. Check the alignment of strings.
422 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
423 alignment as the argument.
424 (Stringpool_template<Stringpool_char>::addralign_): New class member.
425 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
426 Align non-zero length strings according to the addralign_.
427 (Stringpool_template<Stringpool_char>::set_string_offsets):
428 Updating offsets according to the given alignment.
429 * testsuite/Makefile.am (text_section_grouping): Test if string
430 literals are getting merged.
431 * testsuite/Makefile.in: Regenerate.
432 * testsuite/merge_string_literals_1.c: New file.
433 * testsuite/merge_string_literals_2.c: Ditto.
434 * testsuite/merge_string_literals.sh: Ditto.
436 2013-04-26 Ian Lance Taylor <iant@google.com>
438 * target-reloc.h (relocate_section): If the reloc offset is out of
439 range, pass VIEW as NULL to relocate.relocate.
440 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
441 * i386.cc (Target_i386::Relocate::relocate): Likewise.
442 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
443 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
444 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
445 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
447 2013-04-26 Geoff Pike <gpike@chromium.org>
449 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
450 * layout.cc (Hash_task): New class.
451 (Layout::queue_build_id_tasks): New function.
452 (Layout::write_build_id): Handle single-thread portion of build ID
453 computation. (In some cases, all of it is single-threaded.) Replace
454 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
455 functionality in fewer lines of code.
456 * layout.h (Layout::queue_build_id_tasks): New function declaration.
457 * options.h (General_options): make "--build-id" default to tree
458 rather than sha1. Add two new options related to --build-id=tree:
459 --build-id-chunk-size-for-treehash and
460 --build-id-min-file-size-for-treehash.
461 * Makefile.am: add testing of --build-id=tree and related new options
462 (these tests will be invoked by "make check").
463 * Makefile.in: Regenerate.
465 2013-04-25 Alan Modra <amodra@gmail.com>
467 * configure.tgt: Add powerpcle and powerpc64le.
469 2013-04-22 Alan Modra <amodra@gmail.com>
472 * layout.cc (Layout::segment_precedes): Allow more than one
473 segment with the same type and flags.
475 2013-04-15 Cary Coutant <ccoutant@google.com>
477 * layout.cc (Layout::set_relocatable_section_offsets): Don't
478 allocate space in file for BSS sections.
480 2013-04-15 Cary Coutant <ccoutant@google.com>
482 * script-sections.cc (Orphan_output_section): Reset address
483 to zero after each orphaned section for relocatable links.
485 2013-04-15 Cary Coutant <ccoutant@google.com>
487 * symtab.cc (Symbol_table::sized_write_globals): Subtract
488 section starting address for relocatable link.
489 * testsuite/Makefile.am (script_test_11): New test.
490 * testsuite/Makefile.in: Regenerate.
491 * testsuite/script_test_11.c: New source file.
492 * testsuite/script_test_11.t: New linker script.
494 2013-04-13 Alan Modra <amodra@gmail.com>
496 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
497 owner when sections are not adjacent and exceed group size.
498 (Target_powerpc::group_sections): Handle corner case.
499 (Target_powerpc::Branch_info::make_stub): Handle case where
500 stub table doesn't exist due to branches in non-exec sections.
501 (Target_powerpc::Relocate::relocate): Likewise.
503 2013-04-11 Alan Modra <amodra@gmail.com>
506 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
507 .branch_lt to match bfd ld. Adjust comments throughout file.
509 2013-04-04 Ian Lance Taylor <iant@google.com>
512 * object.cc (do_layout_deferred_sections): Handle .eh_frame
513 sections before checking whether they are included in the link.
515 2013-03-29 Sriraman Tallam <tmsriram@google.com>
517 * archive.cc (Archive::get_elf_object_for_member): Create the elf
518 object before calling the plugin claim_file handler. Pass the elf
519 object of the archive to the plugin. Delete the elf object if the
520 plugin claims the file.
522 2013-03-21 Alan Modra <amodra@gmail.com>
524 * layout.cc (Layout::set_segment_offsets): Accept writable .text
527 2013-03-21 Alan Modra <amodra@gmail.com>
529 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
531 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
532 uninitialized" warning.
534 2013-03-20 Alan Modra <amodra@gmail.com>
536 * symtab.h (Symbol::clear_version): New function.
537 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
538 is_needed by weak references. Clear version for symbols defined
539 in as-needed objects that are not needed.
541 2013-03-15 Alan Modra <amodra@gmail.com>
543 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
544 static and public. Add report_err param. Return false for data refs.
545 (Target_powerpc::rela_dyn_section): New overloaded function.
546 (Target_powerpc::plt_, iplt_): Elucidate.
547 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
548 (Output_data_plt_powerpc::do_write): Don't write .iplt.
549 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
550 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
551 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
552 push_branch and make_plt_entry for ifunc syms when
553 reloc_needs_plt_for_ifunc.
554 (Target_powerpc::Relocate::relocate): Don't use plt entry value
555 for ifunc unless reloc_needs_plt_for_ifunc.
557 2013-03-15 Alan Modra <amodra@gmail.com>
559 * gc.h (gc_process_relocs): Don't look through function descriptors.
560 * icf.cc (get_section_contents): Do so here instead.
562 2013-03-13 Alan Modra <amodra@gmail.com>
564 * powerpc.cc (is_branch_reloc): Forward declare.
565 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
566 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
567 false for 64-bit, true for 32-bit non-branch relocs.
568 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
569 * testsuite/Makefile.am (icf_test): Use linker map file instead of
571 (icf_safe_test): Generate linker map file as well as nm output.
572 (icf_safe_so_test): Likewise.
573 * testsuite/Makefile.in: Regenerate.
574 * testsuite/icf_test.sh: Parse linker map file to determine
576 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
577 * testsuite/icf_safe_so_test.sh: Likewise.
578 (X86_32_or_ARM_specific_safe_fold): Merge into..
579 (arch_specific_safe_fold): ..this.
580 (X86_64_specific_safe_fold): Delete unused function.
582 2013-03-12 Alan Modra <amodra@gmail.com>
584 * gc.h (gc_process_relocs): Look through function descriptors
585 to determine shndx, symvalue and addend used by ICF. Tidy
586 variable duplication.
588 2013-03-11 Alan Modra <amodra@gmail.com>
590 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
591 * layout.cc (Layout_task_runner::run): ..to here.
592 * symtab.h (struct Symbol_location): Extract from..
593 (class Symbol_table): ..here.
594 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
595 * target.h (class Target): Add function_location and
596 do_function_location functions.
597 (class Sized_target): Add do_function_location.
598 * object.h (class Sized_relobj_file): Move find_shdr..
599 (class Object): ..to here.
600 * object.cc: Likewise. Update to suit. Instantiate.
601 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
602 * powerpc.cc (class Powerpc_dynobj): New.
603 (Target_powerpc::do_function_location): New function.
604 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
605 (Powerpc_dynobj::do_read_symbols): New function.
606 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
608 2013-03-08 Ian Lance Taylor <iant@google.com>
610 * options.cc (General_options::string_to_object_format): Accept
613 2013-03-08 Alan Modra <amodra@gmail.com>
615 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
617 (struct Post_fde): Move definition to here..
618 * ehframe.cc (struct Post_fde): ..from here.
619 (Cie::write): Don't alloc Post_fde.
620 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
622 2013-03-07 Alan Modra <amodra@gmail.com>
624 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
625 relocation referencing .LC0.
626 * testsuite/discard_locals_test.sh: Remove FIXMEs.
628 2013-03-07 Alan Modra <amodra@gmail.com>
630 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
631 always_inline. Add assembly for powerpc to avoid GOT.
633 2013-03-07 Alan Modra <amodra@gmail.com>
635 * testsuite/script_test_10.sh: Don't test .bss section
638 2013-03-06 Alan Modra <amodra@gmail.com>
640 * powerpc.cc (class Powerpc_relobj): Move some member functions.
641 (Target_powerpc::symval_for_branch): Add symtab param. Update
642 all callers. Handle folded sections.
643 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
645 (Global_symbol_visitor_opd::operator()): Likewise.
647 2013-03-04 Alan Modra <amodra@gmail.com>
649 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
650 * testsuite/Makefile.in: Regenerate.
652 2013-03-01 Cary Coutant <ccoutant@google.com>
654 Add dwp support for v2 DWARF package file format.
655 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
656 tu_length parameter. Adjust all callers.
657 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
658 * dwp.cc: Include dwarf.h.
659 (Section_bounds): New struct type.
660 (Unit_set): New struct type.
661 (Dwo_file::Dwo_file): Initialize new data member.
662 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
663 Combine and rename to...
664 (Dwo_file::read_unit_index): ...this.
665 (Dwo_file::sized_read_compunit_index)
666 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
667 (Dwo_file::sized_read_unit_index): ...this.
668 (Dwo_file::copy_section): Remove section_name, is_str_offsets
669 parameters; add section_id parameter.
670 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
671 (Dwo_file::add_unit_set): ...this.
672 (Dwo_file::shndx_map_): Remove.
673 (Dwo_file::sect_offsets_): New data member.
674 (Dwp_output_file::Dwp_output_file): Initialize new data members.
675 (Dwp_output_file::add_section): Rename to...
676 (Dwp_output_file::add_contribution): ...this.
677 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
678 (Dwp_output_file::add_tu_set): Likewise.
679 (Dwp_output_file::Contribution): New type.
680 (Dwp_output_file::Section::contributions): New data member.
681 (Dwp_output_file::Cu_or_tu_set): Remove.
682 (Dwp_output_file::Section::Section): New ctor.
683 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
684 (Dwp_output_file::Dwp_index::Section_table): New type.
685 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
686 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
688 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
689 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
690 (Dwp_output_file::Dwp_index::section_table): New member function.
691 (Dwp_output_file::Dwp_index::section_table_end): New member function.
692 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
693 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
694 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
695 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
696 (Dwp_output_file::Dwp_index::section_table_): New data member.
697 (Dwp_output_file::Dwp_index::section_mask_): New data member.
698 (Dwp_output_file::add_output_section): New member function.
699 (Dwp_output_file::write_new_section): New member function.
700 (Dwp_output_file::write_contributions): New member function.
701 (Dwp_output_file::section_id_map_): New data member.
702 (class Dwo_id_info_reader): Remove.
703 (class Unit_reader): New class.
704 (get_dwarf_section_name): New function.
705 (Dwo_file::read_executable): Adjust initializations of class data.
706 (Dwo_file::read): Add support for v2 package file format.
707 (Dwo_file::read_unit_index): Likewise.
708 (Dwo_file::sized_read_unit_index): Likewise.
709 (Dwo_file::copy_section): Likewise.
710 (Dwo_file::add_unit_set): Likewise.
711 (Dwp_output_file::add_output_section): Likewise.
712 (Dwp_output_file::add_contribution): Likewise.
713 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
715 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
717 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
719 (Dwp_output_file::initialize): Remove unused function.
720 (Dwp_output_file::finalize): Add support for v2 package file format.
721 (Dwp_output_file::write_index): Likewise.
722 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
725 2013-03-01 Cary Coutant <ccoutant@google.com>
727 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
728 function into class definition in header file.
729 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
730 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
732 (Dwarf_info_reader::check_buffer): Move here from .cc file.
734 2013-02-28 Alan Modra <amodra@gmail.com>
736 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
737 * target.cc (Target::do_plt_fde_location): New function.
738 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
739 accessor function, and constructor param.
740 (struct Post_fde, Post_fdes): Declare.
741 (Cie::write): Add post_fdes param.
742 * ehframe.cc (Fde::write): Use plt_fde_location.
743 (struct Post_fde): Define.
744 (Cie::write): Stash FDEs added post merge mapping.
745 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
746 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
747 (Eh_frame::do_sized_write): Arrange to write post map FDES after
749 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
750 (Target_powerpc::has_glink): New function.
751 (Target_powerpc::do_relax): Add eh_frame info for stubs.
752 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
753 glink_eh_frame_fde_32, default_fde): New data.
754 (Stub_table::eh_frame_added_): New var.
755 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
757 (Stub_table::add_eh_frame): New function.
758 (Output_data_glink::add_eh_frame): New function.
759 (Target_powerpc::make_glink_section): Call add_eh_frame.
761 2013-02-15 Ian Lance Taylor <iant@google.com>
763 * options.h (DEFINE_uint64_alias): Define.
764 (class General_options): Add -Ttext-segment as an alias for
767 2013-02-15 Alan Modra <amodra@gmail.com>
769 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
770 (Stub_table::do_write): ..here, two places.
771 (Stub_table::plt_call_size): Use it here too.
773 2013-02-11 Ian Lance Taylor <iant@google.com>
775 * descriptors.cc (Descriptors::close_all): New function.
776 * descriptors.h (class Descriptors): Declare close_all.
777 (close_all_descriptors): New inline function.
778 * plugin.cc: Include "descriptors.h".
779 (Plugin_manager::cleanup): Call close_all_descriptors.
781 2013-02-06 Alan Modra <amodra@gmail.com>
783 * README: Update coding style link.
785 2013-01-28 Cary Coutant <ccoutant@google.com>
787 * dwp.cc (File_list): New typedef.
788 (Dwo_name_info_reader): New class.
789 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
790 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
791 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
792 (Dwo_file::read_executable): New function.
793 (Dwo_file::read): Move common setup code to ...
794 (Dwo_file::make_object): ... here.
795 (dwp_options): Add --exec/-e.
799 2013-01-24 Sriraman Tallam <tmsriram@google.com>
801 * layout.cc (Layout::layout): Check for option text_reorder.
802 (Layout::make_output_section): Ditto.
803 * options.h (text_reorder): New option.
804 * output.cc (Input_section_sort_compare): Remove special ordering
807 Input_section_sort_section_name_special_ordering_compare::
808 operator()): New function.
809 (Output_section::sort_attached_input_sections): Use new sort function
811 * output.h (Input_section_sort_section_name_special_ordering_compare):
813 * testsuite/Makefile.am (text_section_grouping): Test option
815 * testsuite/Makefile.in: Regenerate.
816 * testsuite/text_section_grouping.sh: Check order of functions without
817 default text reordering.
819 2013-01-18 Mike Frysinger <vapier@gentoo.org>
821 * options.h (General_options): Change default to true for new_dtags.
823 2013-01-18 Mike Frysinger <vapier@gentoo.org>
825 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
826 when enable_new_dtags is false. Only add DT_RUNPATH when
827 enable_new_dtags is true.
829 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
831 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
832 used in declaration and definition consistent.
833 (Target_powerpc::symval_for_branch): Ditto.
835 2013-01-16 Sriraman Tallam <tmsriram@google.com>
837 * testsuite/plugin_final_layout.cc: Fix comment.
839 2013-01-16 Sriraman Tallam <tmsriram@google.com>
841 * layout.cc (Layout::layout): Do not do default sorting for
842 text sections when section ordering is specified.
843 (make_output_section): Ditto.
844 * testsuite/plugin_final_layout.cc: Name the function sections
845 to catch reordering issues.
847 2013-01-15 Alan Modra <amodra@gmail.com>
849 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
852 2013-01-15 Alan Modra <amodra@gmail.com>
854 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
855 * testsuite/Makefile.in: Regenerate.
857 2013-01-14 Alan Modra <amodra@gmail.com>
859 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
860 * testsuite/Makefile.in: Regenerate.
862 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
865 Fix mingw gold build with plugins enabled
866 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
867 * configure.ac: Export DLOPEN_LIBS and add headers check.
868 * plugin.cc: Handle non-dlfcn case.
869 * Makefile.in: Regenerate.
870 * config.in: Regenerate.
871 * configure: Regenerate.
872 * testsuite/Makefile.in: Regenerate.
874 2013-01-09 Sriraman Tallam <tmsriram@google.com>
876 * output.h (sort_attached_input_sections): Change to be public.
878 (Output_section_definition::set_section_addresses): Sort
879 attached input sections according to section order before linker
880 script assigns section addresses.
881 (Orphan_output_section::set_section_addresses): Sort
882 attached input sections according to section order before linker
883 script assigns section addresses.
884 * Makefile.am (final_layout.sh): Use a simple linker script to
885 check if section ordering still works.
886 * Makefile.in: Regenerate.
888 2013-01-09 Ben Cheng <bccheng@google.com>
890 * arm.cc (Target_arm::attributes_accept_div): New function.
891 (Target_arm::attributes_forbid_div): New function.
892 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
893 attribute using the same new functions as what bfd/elf32_arm.c
896 2013-01-07 Cary Coutant <ccoutant@google.com>
899 * output.cc (Output_section::add_input_section): For incremental
900 updates, don't track input sections that are allocated from patch
903 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
904 Ian Lance Taylor <iant@google.com>
907 * configure.ac (--enable-ld): Removed.
908 (install_as_default): Set to yes only for --enable-gold=default
910 * configure: Regenerated.
912 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
914 * options.h (General_options): Add -fuse-ld= for GCC linker
915 option compatibility.
917 2013-01-04 Cary Coutant <ccoutant@google.com>
919 * configure.ac: Fix typo restoring CXXFLAGS.
920 * configure: Regenerate.
922 2013-01-04 Cary Coutant <ccoutant@google.com>
924 * testsuite/Makefile.am (CXXLINK_S): New macro.
925 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
926 * testsuite/Makefile.in: Regenerate.
928 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
930 * version.cc (print_version): Update copyright year to 2013.
932 2012-12-20 Ian Lance Taylor <iant@google.com>
934 * layout.cc (Layout::special_ordering_of_input_section): New
936 (Layout::layout): If input section requires special ordering, must
938 (Layout::make_output_section): May sort .text input sections.
939 (Layout::is_section_name_prefix_grouped): Remove.
940 * layout.h (class Layout): Declare
941 special_ordering_of_input_section. Don't declare
942 is_section_name_prefix_grouped.
943 * output.cc (Output_section::add_input_section): Revert last
945 (Output_section::Input_section_sort::match_file_name): Don't crash
946 if called on output section data.
947 (Output_section::Input_section_sort_compare): Sort based on
949 (Output_section::Input_section_sort_section_order_index_compare):
951 (Output_section::sort_attached_input_sections): Likewise.
953 2012-12-18 Sriraman Tallam <tmsriram@google.com>
955 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
956 * layout.h (Layout::is_section_name_prefix_grouped): New function.
957 * output.cc (Output_section::add_input_section): Check if section
958 name contains special prefix. Keep input sections to sort such
960 (Output_section::Input_section_sort_section_order_index_compare
961 ::operator()): Group sections according to prefixes.
962 (Output_section::sort_attached_input_sections): Add condition to
963 Input_section_entry constructor call.
964 * testsuite/Makefile.am (text_section_grouping): New test.
965 * testsuite/Makefile.in: Regenerate.
966 * testsuite/text_section_grouping.cc: New file.
967 * testsuite/text_section_grouping.sh: New file.
969 2012-12-17 Nick Clifton <nickc@redhat.com>
971 * Makefile.am: Add copyright notice.
974 * configure.ac: Likewise.
975 * ftruncate.c: Likewise.
976 * Makefile.in: Regenerate.
978 2012-12-14 Cary Coutant <ccoutant@google.com>
980 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
982 (exception_separate_shared_12_test): Likewise.
983 (incremental_copy_test): Likewise.
984 * testsuite/Makefile.in: Regenerate.
986 2012-12-14 Cary Coutant <ccoutant@google.com>
988 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
989 (Dwp_output_file::Dwp_index::enter_set): Add assert.
991 2012-12-12 Alan Modra <amodra@gmail.com>
993 * powerpc.cc (class Track_tls): New.
994 (class Relocate, class Scan): Inherit Track_tls.
995 (Target_powerpc::Scan::local, global): Track tls optimization
996 and avoid creating plt entry for __tls_get_addr if all uses
998 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
1000 2012-12-12 Alan Modra <amodra@gmail.com>
1002 * options.h (General_options): Add --toc-sort/--no-toc-sort.
1003 Replace no_toc_optimize with toc_optimize.
1004 * output.h (Output_section::input_sections): Provide non-const variant.
1005 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
1006 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
1008 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
1009 (class Sort_toc_sections): New.
1010 (Target_powerpc::do_finalize_sections): Sort toc sections.
1011 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
1013 2012-12-10 Roland McGrath <mcgrathr@google.com>
1015 * testsuite/binary_unittest.cc (read_all): New function.
1016 (Sized_binary_test): Use it instead of ::read.
1017 * fileread.cc (do_read): Don't assume pread always reads the whole
1018 amount in a single call.
1020 2012-12-10 Alan Modra <amodra@gmail.com>
1022 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
1023 Set EM_PPC64 or EM_PPC here.
1024 (Target_selector_powerpc::do_recognize): Delete.
1026 2012-12-10 Alan Modra <amodra@gmail.com>
1028 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
1030 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
1032 2012-12-07 Roland McGrath <mcgrathr@google.com>
1034 * testsuite/binary_unittest.cc (Sized_binary_test):
1035 Use open_descriptor rather than ::open.
1037 2012-12-07 Alan Modra <amodra@gmail.com>
1039 * powerpc.cc (Stub_table::do_write): Delete redundant Address
1040 typedef and invalid_address constant.
1041 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
1042 instantiate constants.
1044 2012-12-06 Roland McGrath <mcgrathr@google.com>
1046 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
1047 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
1048 * aclocal.m4: Regenerate.
1049 * configure: Regenerate.
1050 * Makefile.in: Regenerate.
1051 * testsuite/Makefile.in: Regenerate.
1053 2012-12-07 Alan Modra <amodra@gmail.com>
1055 * options.h (General_options): Add no_toc_optimize.
1056 * powerpc.cc (ok_lo_toc_insn): New function.
1057 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
1059 2012-12-06 Alan Modra <amodra@gmail.com>
1061 * options.h (General_options): Add plt_align, plt_static_chain,
1062 plt_thread_safe. Update stub_group_size help text.
1063 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
1064 for new plt_thread_safe_ var.
1065 (use_plt_offset): Correct comments.
1066 (Target_powerpc::do_relax): Look for thread creation symbols to
1067 determine default plt_thread_safe value. Clear plt call stubs
1068 as well as branch stubs each iteration.
1069 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
1071 (l, hi, ha, write_insn): Move earlier.
1072 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
1073 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
1075 (Stub_table::update_size): Adjust.
1076 (Stub_table::prev_size, set_prev_size): Delete.
1077 (Stub_table::stub_align): Let --plt-align affect result.
1078 (Stub_table::plt_call_size): Calculate sizes for various stubs.
1079 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
1080 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
1081 (Stub_table::do_write): Support more stub variants.
1083 2012-12-04 Alan Modra <amodra@gmail.com>
1085 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
1086 (Target_powerpc::do_define_standard_symbols): New function.
1088 2012-12-03 Alan Modra <amodra@gmail.com>
1090 * output.h: Formatting, whitespace.
1092 2012-12-03 Alan Modra <amodra@gmail.com>
1094 * layout.h (Layout::get_executable_sections): Declare.
1095 * layout.cc (Layout::get_executable_sections): New function.
1096 * arm.cc (Target_arm::group_sections): Use it.
1097 (Arm_output_section::group_sections): Delete now redundant test.
1098 * output.cc (Output_reloc::Output_reloc): Add is_relative.
1099 param to handle relative relocs.
1100 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
1101 (Output_data_reloc::add_absolute): Adjust.
1102 (Output_data_reloc::add_relative): New function.
1103 (Output_data::reset_data_size): New function.
1104 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
1105 (Output_section::set_addralign): New function.
1106 (Output_section::checkpoint_set_addralign): New function.
1107 (Output_section::clear_section_offsets_need_adjustment): New function.
1108 (Output_section::input_sections): Make public.
1109 * powerpc.cc (class Output_data_brlt_powerpc): New.
1110 (class Stub_table, class Stub_control): New.
1111 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
1112 stub_table_, set_stub_table, stub_table): New vectors and accessor
1114 (Target_powerpc::do_may_relax, do_relax, push_branch,
1115 new_stub_table, stub_tables, brlt_section, group_sections,
1116 add_branch_lookup_table, find_branch_lookup_table,
1117 write_branch_lookup_table, make_brlt_section): New functions.
1118 (Target_powerpc::struct Sort_sections, class Branch_info): New.
1119 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
1120 branch_info_): New vars.
1121 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
1122 make call stubs here.
1123 (Output_data_glink): Remove all call stub handling from this class.
1124 (Target_powerpc::Scan::local, global): Save interesting branch
1125 relocs and relocs for ifunc. Adjust calls to plt entry functions.
1126 (Target_powerpc::do_finalize_sections): Only make reg save/restore
1127 functions on final link.
1128 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
1129 Handle long branch destinations too.
1130 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
1131 do_plt_address_for_local): Adjust lookup of plt call stubs.
1133 2012-11-30 Alan Modra <amodra@gmail.com>
1135 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
1136 relocs against protected symbols when building 32-bit shared libs.
1138 2012-11-30 Alan Modra <amodra@gmail.com>
1140 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
1141 param. Call got_section() to make .got. Update all callers
1142 and their callers and so on.
1144 2012-11-30 Alan Modra <amodra@gmail.com>
1146 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
1147 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
1148 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
1149 value if it already exists.
1151 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
1154 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
1156 2012-11-14 Roland McGrath <mcgrathr@google.com>
1158 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
1159 than bfc instruction for data sandboxing.
1161 2012-11-08 Alan Modra <amodra@gmail.com>
1163 * po/POTFILES.in: Regenerate.
1165 2012-11-05 Alan Modra <amodra@gmail.com>
1167 * configure.ac: Apply 2012-09-10 change to config.in here.
1168 * configure: Regenerate.
1170 2012-11-05 Alan Modra <amodra@gmail.com>
1172 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
1173 (struct Opd_ent): Use "Address" rather than "Offset".
1174 (Output_data_got_powerpc::got_base_offset): Return Valtype.
1175 (Target_powerpc::got_section): Make public.
1176 (Target_powerpc::scan_relocs): Move code setting symbols..
1177 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
1178 Create _SDA_BASE_ only when referenced.
1180 2012-11-02 Roland McGrath <mcgrathr@google.com>
1182 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
1185 2012-11-01 Roland McGrath <mcgrathr@google.com>
1187 * target.h (Sized_target::relocate_relocs): Use Elf_Off
1188 for offset_in_output_section parameter.
1189 (Sized_target::relocate_special_relocatable): Likewise.
1190 * arm.cc (Target_arm::relocate_relocs): Likewise.
1191 (Target_arm::relocate_special_relocatable): Likewise.
1192 * i386.cc (Target_i386::relocate_relocs): Likewise.
1193 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
1194 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
1195 * target-reloc.h (relocate_relocs): Likewise.
1196 * testsuite/testfile.cc (Target_test): Likewise.
1197 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
1198 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
1200 * system.h: Move inclusion of <clocale> to after <libintl.h> in
1201 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
1203 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
1204 parameter, which is unused in the [!F_SETFD] case.
1206 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
1207 SYMNDX to off_t before comparing it to this->data_size().
1208 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
1209 * incremental.cc (Output_section_incremental_inputs::do_write):
1210 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
1212 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
1214 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
1216 * gold.cc (Target_arm::do_adjust_elf_header): Add the
1217 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
1220 2012-10-29 Cary Coutant <ccoutant@google.com>
1222 * dwp.cc (usage): Add file and exit status parameters;
1223 add --help and --version options.
1224 (print_version): New function.
1225 (main): Add --help and --version options.
1227 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1229 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
1230 final_layout_sequence.txt.
1231 * testsuite/Makefile.in: Regenerated.
1233 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1235 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
1236 COMPILE generated by automake.
1238 (CXXCOMPILE1): Likewise.
1239 (CXXLINK1): Likewise.
1240 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
1242 (CXXCOMPILE): Likewise.
1243 (CXXLINK): Likewise.
1244 * testsuite/Makefile.in: Regenerated.
1246 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1248 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
1249 on bad fwrite return.
1251 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1253 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
1256 2012-10-23 Cary Coutant <ccoutant@google.com>
1258 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
1259 * testsuite/Makefile.in: Regenerate.
1260 * testsuite/dwp_test.h: New source file.
1261 * testsuite/dwp_test_1.cc: New source file.
1262 * testsuite/dwp_test_1.s: New source file.
1263 * testsuite/dwp_test_1.sh: New source file.
1264 * testsuite/dwp_test_1b.cc: New source file.
1265 * testsuite/dwp_test_1b.s: New source file.
1266 * testsuite/dwp_test_2.cc: New source file.
1267 * testsuite/dwp_test_2.s: New source file.
1268 * testsuite/dwp_test_2.sh: New source file.
1269 * testsuite/dwp_test_main.cc: New source file.
1270 * testsuite/dwp_test_main.s: New source file.
1272 2012-10-23 Cary Coutant <ccoutant@google.com>
1274 * dwp.h: New header file.
1275 * dwp.cc: New source file.
1276 * gold.h: Move shared declarations to system.h.
1277 * system.h: New header file.
1278 * Makefile.am: Add dwp.
1279 * Makefile.in: Regenerate.
1281 2012-10-23 Cary Coutant <ccoutant@google.com>
1283 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
1284 Dwarf_info_reader::read_from_pointer.
1285 (Dwarf_pubnames_table::read_header): Likewise.
1286 (Dwarf_pubnames_table::next_name): Likewise.
1287 (Dwarf_die::read_attributes): Likewise.
1288 (Dwarf_die::skip_attributes): Likewise.
1289 (Dwarf_info_reader::read_from_pointer): New function template.
1290 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
1291 (Dwarf_pubnames_table): Likewise.
1292 (Dwarf_info_reader::read_from_pointer): New function template.
1293 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
1294 Dwarf_pubnames_table ctor.
1296 2012-10-23 Cary Coutant <ccoutant@google.com>
1298 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
1300 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
1302 (Dwarf_info_reader::set_abbrev_shndx): New method.
1303 (Dwarf_info_reader::abbrev_shndx_): New data member.
1305 2012-10-23 Cary Coutant <ccoutant@google.com>
1307 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
1308 from object, not parameters.
1309 (Dwarf_info_reader::parse): Likewise.
1310 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
1311 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
1312 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
1315 2012-10-23 Cary Coutant <ccoutant@google.com>
1317 * fileread.cc (Input_file::Input_file): New constructor.
1318 * fileread.h (class Input_file): Add new constructor.
1320 2012-10-18 Alan Modra <amodra@gmail.com>
1323 * object.cc (Relobj::is_section_name_included): Also match
1324 .sdata personality section.
1326 2012-10-18 Alan Modra <amodra@gmail.com>
1328 * target-reloc.h (class Default_comdat_behavior): New, package up..
1329 (get_comdat_behaviour): ..this.
1330 (relocate_section): Add Relocate_comdat_behavior template arg,
1331 adjust code to suit.
1332 * arm.cc (Target_arm::relocate_section): Adjust to suit.
1333 (Target_arm::scan_reloc_section): Likewise.
1334 * i386.cc (Target_i386::relocate_section): Likewise.
1335 * sparc.cc (Target_sparc::relocate_section): Likewise.
1336 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
1337 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
1338 * powerpc.cc (class Relocate_comdat_behavior): New.
1339 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
1340 gold::relocate_section with new template arg.
1342 2012-10-18 Alan Modra <amodra@gmail.com>
1344 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
1345 dynamic relocs for GOT_TPREL got entries, without symbol if
1347 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
1348 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
1349 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
1351 2012-10-17 Alan Modra <amodra@gmail.com>
1354 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
1356 2012-10-16 Sriraman Tallam <tmsriram@google.com>
1358 * layout.cc (Layout::include_section): Keep sections marked
1359 SHF_EXCLUDE when doing relocatable links.
1361 2012-10-16 Alan Modra <amodra@gmail.com>
1363 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
1364 (Target_powerpc::do_finalize_sections): Call it.
1365 (Output_data_save_res): New class and supporting functions.
1366 (Target_powerpc::symval_for_branch): Only look up .opd entry for
1367 normal symbols defined in object files.
1369 2012-10-12 Alan Modra <amodra@gmail.com>
1371 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
1372 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
1373 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
1374 section if scan_opd_relocs not yet called.
1375 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
1377 2012-10-12 Alan Modra <amodra@gmail.com>
1379 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1380 add_local_ifunc_entry): Revert last change.
1381 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
1383 2012-10-05 Alan Modra <amodra@gmail.com>
1385 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
1386 do_plt_address_for_global): New functions.
1387 (Output_data_got_powerpc::do_write): Don't segfault when linking
1389 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1390 add_local_ifunc_entry): Return true on adding entry..
1391 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
1392 glink->add_entry call. Remove unused symtab param. Adjust calls.
1393 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
1394 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
1395 set up symbols here.
1396 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
1397 syms here. Do so even when no .iplt. Don't segfault when linking
1399 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
1400 new variants without reloc param.
1401 (Glink_sym_ent::Glink_sym_ent): Likewise.
1402 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
1403 reloc when refs will resolve to plt call stub.
1404 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
1405 R_PPC_PLTREL24 to resolve locally.
1406 (Target_powerpc::Scan::global): Correct ifunc handling.
1407 (Target_powerpc::Relocate::relocate): Correct local sym glink
1408 lookup. Don't destroy "value" when we have a plt call stub,
1409 and when checking plt call validity.
1410 (Target_powerpc::do_dynsym_value): Simplify.
1412 2012-10-05 Alan Modra <amodra@gmail.com>
1414 * i386.cc (Output_data_plt_i386::address_for_global,
1415 address_for_local): Add plt offset to returned value. Adjust uses.
1416 * sparc.cc (Output_data_plt_sparc::address_for_global,
1417 address_for_local): Likewise.
1418 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
1419 address_for_local): Likewise.
1420 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
1421 address_for_local): Likewise.
1422 * target.h (Target::plt_address_for_global, plt_address_for_local):
1424 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
1425 (Output_data_got::Got_entry::write): Nor here.
1426 * output.h: Comment fix.
1428 2012-10-02 Jiong Wang <jiwang@tilera.com>
1430 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
1431 global_offset_table_ value for larget got.
1432 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
1434 2012-09-29 Alan Modra <amodra@gmail.com>
1436 * powerpc.cc (Target_powerpc::iplt_): New output section.
1437 (Target_powerpc::iplt_section, make_iplt_section,
1438 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
1439 (Target_powerpc::make_plt_entry): Handle ifunc syms.
1440 Target_powerpc::plt_entry_count): Count iplt entries too.
1441 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
1442 reloc section in constructor. New params.
1443 (Target_powerpc::make_plt_section): Create reloc section here instead.
1444 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
1446 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
1447 (Output_data_glink::add_entry, find_entry): New functions to
1448 deal with local syms.
1449 (Glink_sym_ent): Add support for local syms.
1450 (Output_data_glink::do_write): Handle ifunc plt entries.
1451 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1452 (Target_powerpc::Scan::local, global): Handle ifunc syms.
1453 (Target_powerpc::Relocate::relocate): Likewise.
1454 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
1456 2012-09-25 Alan Modra <amodra@gmail.com>
1458 * object.h (Sized_relobj_file::adjust_local_symbol,
1459 do_adjust_local_symbol): New functions.
1460 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
1461 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
1462 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
1463 and irregular opd entry spacing.
1464 (Powerpc_relobj::do_read_relocs): Add opd size checks.
1465 (Global_symbol_visitor_opd): New functor.
1466 (Target_powerpc::do_finalize_sections): Omit global symbols defined
1467 on deleted opd entries.
1469 2012-09-15 Jiong Wang <jiwang@tilera.com>
1471 * tilegx.cc: New file.
1472 * Makefile.am (TARGETSOURCES): Add tilegx.cc
1473 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
1474 * configure.tgt: Add entries for tilegx*.
1475 * configure.ac: Likewise.
1476 * Makefile.in: Rebuild.
1477 * configure: Likewise.
1478 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
1481 2012-09-13 Alan Modra <amodra@gmail.com>
1483 * target-reloc.h (scan_relocs): Call scan.local for relocs
1484 against symbols in discarded sections. Pass is_discarded
1486 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
1487 Add is_discarded param.
1488 * powerpc (Target_powerpc::Scan::local): Likewise. Use
1489 is_discarded to flag opd entry as discarded. Don't emit dyn
1490 relocs on such entries.
1491 (Target_powerpc::Scan::global): Similarly detect and handle
1493 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
1494 opd_ent_. Update all uses.
1495 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
1496 (Target_powerpc::relocate_section): Zero out discarded opd
1499 2012-09-12 Ian Lance Taylor <iant@google.com>
1502 * output.cc: Rename Output_data_got template parameter from size
1503 to got_size for all functions. Compile all variants of
1505 (Output_data_got::Got_entry::write): Correct use of size for
1506 symbol value. Use local_is_tls rather than casting to
1508 * object.h (class Object): Add local_is_tls and do_local_is_tls.
1509 (class Sized_relobj_file): Add do_local_is_tls.
1510 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
1512 2012-09-11 Alan Modra <amodra@gmail.com>
1515 * layout.cc (Layout::set_segment_offsets): When using
1516 common-page-size alignment, ensure we are on a new max-page-size
1518 * output.cc (Output_segment::set_section_addresses): Use
1519 abi_pagesize, not common_pagesize for relro boundary.
1520 (Output_segment::set_offset): Likewise.
1522 2012-09-11 Alan Modra <amodra@gmail.com>
1524 * output.h (Output_data_got::add_global_tls, add_local_tls,
1525 add_local_tls_pair): New functions.
1526 (Output_data_got::add_local_pair_with_rel): Remove second
1527 reloc param. Expand comment.
1528 (Output_data_got::Got_entry): Rename use_plt_offset_ to
1529 use_plt_or_tls_offset_, similarly for constructor param.
1530 (Output_data_got::Got_entry::write): Add got_index param.
1531 * output.cc (Output_data_got::add_global_tls, add_local_tls,
1532 add_local_tls_pair): New functions.
1533 (Output_data_got::Got_entry::write): Handle tls symbols
1534 with use_plt_or_tls_offset_ set specially.
1535 (Output_data_got::add_local_pair_with_rel): Only one reloc.
1536 (Output_data_got::do_write): Replace iterator with index, pass
1537 index to entry write function.
1538 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
1539 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
1540 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
1542 * i386.cc (Target_i386::Scan::local): Likewise.
1543 * sparc.cc (Target_sparc::Scan::local): Likewise.
1544 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
1545 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
1546 do_tls_offset_for_global): New functions.
1547 (Target_powerpc::Scan::local): Correct TLS relocations and got
1549 (Target_powerpc::Scan::global): Don't emit unnecessary
1550 dynamic relocations on TLS GOT entries.
1552 2012-09-10 Matthias Klose <doko@ubuntu.com>
1554 * config.in: Disable sanity check for kfreebsd.
1556 2012-09-10 Sterling Augustine <saugustine@google.com>
1558 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
1559 (Gdb_index::pubtypes_read): New parameter.
1560 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
1562 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
1565 2012-09-09 Alan Modra <amodra@gmail.com>
1567 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
1568 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
1569 * gc.h (gc_process_relocs): Call target gc_add_reference.
1570 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
1571 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
1572 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
1574 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
1575 to cater for when we don't need code offset. Update use.
1576 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
1577 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
1578 set_opd_valid): New functions.
1579 (Target_powerpc::do_gc_add_reference): New function.
1580 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
1582 (Target_powerpc::do_gc_mark_symbol): New function.
1584 2012-09-06 Cary Coutant <ccoutant@google.com>
1586 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
1587 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
1588 (Dwarf_die::skip_attributes): Likewise.
1589 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
1590 * testsuite/gdb_index_test.cc (inline_func_1): New function.
1592 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
1594 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
1596 * testsuite/script_test_3.t: Add .got.plt output section
1598 * testsuite/script_test_4.t: Likewise.
1600 2012-09-05 Alan Modra <amodra@gmail.com>
1602 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
1603 update all uses and lose "enum" when using type.
1605 2012-09-05 Alan Modra <amodra@gmail.com>
1607 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
1608 * configure: Regenerate.
1609 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
1610 (plugin_final_layout.stdout): Likewise.
1611 (memory_test): Set page sizes to 0x1000.
1612 * testsuite/Makefile.in: Regenerate.
1613 * testsuite/discard_locals_test.sh: Add FIXME comment.
1614 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
1615 * testsuite/pr14265.t: Add .got output section statement.
1616 * testsuite/script_test_2.t: Likewise.
1617 * testsuite/script_test_3.t: Likewise.
1618 * testsuite/script_test_4.t: Likewise.
1619 * testsuite/script_test_5.t: Likewise.
1620 * testsuite/script_test_6.t: Likewise.
1621 * testsuite/script_test_7.t: Likewise.
1622 * testsuite/script_test_9.t: Likewise.
1624 2012-09-05 Alan Modra <amodra@gmail.com>
1626 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
1627 (Powerpc_relocate_functions::Status): New typedef.
1628 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1629 (Target_powerpc::Scan::local): Handle REL64.
1630 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
1631 for REL32 and REL64.
1632 (Target_powerpc::symval_for_branch): New function, extracted from..
1633 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
1634 checks. Report overflow errors.
1636 2012-09-05 Alan Modra <amodra@gmail.com>
1638 * object.h (Sized_relobj_file::emit_relocs): Delete.
1639 (Sized_relobj_file::emit_relocs_reltype): Delete.
1640 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
1641 relocate_relocs for --emit-relocs.
1642 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
1643 * output.h: Update comment.
1644 (Output_segment::first_section): New function.
1645 (Output_segment::first_section_load_address): Use first_section.
1646 * output.cc (Output_segment::first_section): New function extracted..
1647 (Output_segment::first_section_load_address): ..from here. Delete.
1648 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
1649 * target.h (Sized_target::relocate_for_relocatable): Likewise.
1650 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
1651 adjust call to target.h function.
1652 * i386.cc (Target_i386): Likewise.
1653 * sparc.cc (Target_sparc): Likewise.
1654 * x86_64.cc (Target_x86_64): Likewise.
1655 * powerpc.cc (Target_powerpc): Likewise.
1656 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
1657 first tls section has section symbol for optimised local dynamic
1659 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
1660 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
1662 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
1663 Rename to relocate_relocs. Update error message.
1665 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
1667 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
1670 2012-08-31 Alan Modra <amodra@gmail.com>
1672 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
1673 (Powerpc_relobj::toc_base_offset): New stub function.
1674 (Target_powerpc): Add tp_offset, dtp_offset. Rename
1675 got_mod_index_offset to tlsld_got_offset. Update all refs.
1676 (Target_powerpc::Relocate::enum skip_tls): New.
1677 (Target_powerpc::call_tls_get_addr_): New var.
1678 (Target_powerpc::is_branch_reloc): Move to file scope.
1679 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
1680 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
1682 (Target_powerpc::enum Got_type): Delete old values, add new ones.
1683 (powerpc_info): Correct common_pagesize for ppc64.
1684 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
1685 (Powerpc_relocate_functions): Add overflow check enums and functions.
1686 Add non-shift version of rela, rela_ua. Delete all rel public
1687 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
1688 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
1689 addr16_ha3, addr14 functions.
1690 (Output_data_got_powerpc::add_constant_pair): New function.
1691 (Output_data_got_powerpc::got_base_offset): Likewise.
1692 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
1693 (instruction constants): Sort, add some more.
1694 (Output_data_glink::do_write): Add and use Address typedef. Use
1695 object->toc_base_offset() stub for 64-bit.
1696 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
1697 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1698 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
1699 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
1700 Always treat .opd relocs as against locally defined symbol.
1701 Correct condition for RELATIVE relocs.
1702 (Target_powerpc::do_finalize_sections): Test for NULL sections.
1703 (Target_powerpc::Relocate::relocate): Use plt call stub as value
1704 for 32-bit syms with a plt entry. Correct ppc64 toc base
1705 calculations. Handle TLS relocs, and more. Add overflow
1706 checking and adjust for Powerpc_relocate_functions changes.
1707 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
1708 Reinstate --emit-relocs code with FIXME.
1710 2012-08-30 Alan Modra <amodra@gmail.com>
1712 * layout.cc (Layout::set_segment_offsets): Set p_align to
1713 abi_pagesize, not common_pagesize.
1714 (Layout::relaxation_loop_body): Similarly use abi_pagesize
1715 to determine whether file header can go in segment.
1717 2012-08-30 Alan Modra <amodra@gmail.com>
1719 * output.h (Output_reloc::Output_reloc <output section>): Add
1720 is_relative param. Adjust calls.
1721 (Output_reloc::add_output_section_relative): New functions.
1722 * output.cc (Output_reloc::Output_reloc <output section>): Handle
1724 (Output_reloc::symbol_value): Handle SECTION_CODE.
1726 2012-08-24 Sriraman Tallam <tmsriram@google.com>
1728 * gold.cc (queue_middle_tasks): Call layout again when unique
1729 segments for sections is desired.
1730 * layout.cc (Layout::Layout): Initialize new members.
1731 (Layout::get_output_section_flags): New function.
1732 (Layout::choose_output_section): Call get_output_section_flags.
1733 (Layout::layout): Make output section for mapping to a unique segment.
1734 (Layout::insert_section_segment_map): New function.
1735 (Layout::attach_allocated_section_to_segment): Make unique segment for
1736 output sections marked so.
1737 (Layout::segment_precedes): Check for unique segments when sorting.
1738 * layout.h (Layout::Unique_segment_info): New struct.
1739 (Layout::Section_segment_map): New typedef.
1740 (Layout::insert_section_segment_map): New function.
1741 (Layout::get_output_section_flags): New function.
1742 (Layout::is_unique_segment_for_sections_specified): New function.
1743 (Layout::set_unique_segment_for_sections_specified): New function.
1744 (Layout::unique_segment_for_sections_specified_): New member.
1745 (Layout::section_segment_map_): New member.
1746 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
1747 Rename is_gc_pass_one to is_pass_one.
1748 Rename is_gc_pass_two to is_pass_two.
1749 Rename is_gc_or_icf to is_two_pass.
1750 Check for which pass based on whether symbols data is present.
1751 Make it two pass when unique segments for sections is desired.
1752 * output.cc (Output_section::Output_section): Initialize new
1754 * output.h (Output_section::is_unique_segment): New function.
1755 (Output_section::set_is_unique_segment): New function.
1756 (Output_section::is_unique_segment_): New member.
1757 (Output_section::extra_segment_flags): New function.
1758 (Output_section::set_extra_segment_flags): New function.
1759 (Output_section::extra_segment_flags_): New member.
1760 (Output_section::segment_alignment): New function.
1761 (Output_section::set_segment_alignment): New function.
1762 (Output_section::segment_alignment_): New member.
1763 (Output_segment::Output_segment): Initialize is_unique_segment_.
1764 (Output_segment::is_unique_segment): New function.
1765 (Output_segment::set_is_unique_segment): New function.
1766 (Output_segment::is_unique_segment_): New member.
1767 * plugin.cc (allow_unique_segment_for_sections): New function.
1768 (unique_segment_for_sections): New function.
1769 (Plugin::load): Add new functions to transfer vector.
1770 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
1771 * Makefile.in: Regenerate.
1772 * testsuite/plugin_final_layout.sh: Check if unique segment
1773 functionality works.
1774 * testsuite/plugin_section_order.c (onload): Check if new interfaces
1776 (allow_unique_segment_for_sections): New global.
1777 (unique_segment_for_sections): New global.
1778 (claim_file_hook): Call allow_unique_segment_for_sections.
1779 (all_symbols_read_hook): Call unique_segment_for_sections.
1781 2012-08-22 Cary Coutant <ccoutant@google.com>
1783 * layout.cc (Layout::include_section): Don't assert on GROUP
1784 sections with --emit-relocs.
1786 2012-08-21 Cary Coutant <ccoutant@google.com>
1788 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
1789 if --export-dynamic-symbol names an undef symbol.
1791 2012-08-18 Alan Modra <amodra@gmail.com>
1793 * powerpc.cc: Formatting and white space.
1794 (Powerpc_relobj): Rename got2_section_ to special_.
1795 Add opd_ent_shndx_ and opd_ent_off_ vectors.
1796 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
1797 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
1798 (Target_powerpc): Add Address typedef and invalid_address. Use
1800 (Target_powerpc::is_branch_reloc): New function.
1801 (Powerpc_relocate_functions): Add Address typedef, use throughout.
1802 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
1803 for dst_mask, value and addend.
1804 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
1805 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
1806 (Output_data_glink::do_write): Correct toc base. Don't try to use
1807 uint16_t for 24-bit offset. Use get_output_section_offset and
1809 (Target_powerpc::Scan::local): Handle more relocs.
1810 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
1811 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
1812 Plug in toc restoring insn after plt calls. Translate branches
1813 to function descriptor symbols to corresponding entry point.
1814 (Target_powerpc::relocate_for_relocatable): Check return from
1815 get_output_section_offset.
1816 * symtab.h: Comment typo.
1818 2012-08-14 Ian Lance Taylor <iant@google.com>
1820 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
1821 unsupported_relocal_local to call unsupported_reloc_global.
1823 2012-08-14 Nick Clifton <nickc@redhat.com>
1826 * script-sections.cc (Sections_element::output_section_name): Add
1827 keep return parameter.
1828 (Output_section_element::match_name): Add keep return parameter.
1829 Return the value of the keep_ member.
1830 * script-sections.h (class Output_section): Update
1831 output_section_name prototype.
1832 * layout.cc (Layout::keep_input_section): New public member
1834 (Layout::choose_output_section): Pass keep parameter to
1835 output_section_name.
1836 * layout.h (class Layout): Add keep_input_section.
1837 * object.cc (Sized_relobj_file::do_layout): Check for kept input
1839 * testsuite/Makefile.am: Add a test.
1840 * testsuite/Makefile.in: Regenerate.
1841 * testsuite/pr14265.c: Source file for the test.
1842 * testsuite/pr14265.t: Linker script for the test.
1843 * testsuite/pr14265.sh: Shell script for the test.
1845 2012-08-14 Alan Modra <amodra@gmail.com>
1847 * target.h (Target::output_section_name): New function.
1848 (Target::do_output_section_name): New function.
1849 * layout.cc (Layout::choose_output_section): Call the above.
1850 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
1852 2012-08-14 Alan Modra <amodra@gmail.com>
1854 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
1855 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
1856 for replace_constant call.
1857 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
1858 (Output_data_glink::do_print_to_mapfile): New function.
1859 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
1860 (Target_powerpc::Relocate::relocate): Likewise.
1862 2012-08-14 Alan Modra <amodra@gmail.com>
1864 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
1865 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
1866 (Output_data_glink::add_entry,find_entry): Remove shndx param.
1867 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
1868 all references to shndx_. Handle special case for R_PPC_PLTREL24
1870 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
1871 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
1872 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
1874 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
1875 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
1877 2012-08-12 Alan Modra <amodra@gmail.com>
1879 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
1880 (glink insn constants): Use uint32_t.
1881 (Output_data_glink::add_entry): Use insert, not [] operator.
1883 2012-08-11 Alan Modra <amodra@gmail.com>
1885 * object.h (Sized_relobj_file::find_shdr): New function.
1886 (Sized_relobj_file::find_special_sections): New function.
1887 * object.cc (Sized_relobj_file::find_shdr): New function.
1888 (Sized_relobj_file::find_eh_frame): Use find_shdr.
1889 (Sized_relobj_file::find_special_sections): New function, split out..
1890 (Sized_relobj_file::do_read_symbols): ..from here.
1891 * output.h (Output_data_got::replace_constant): New function.
1892 (Output_data_got::num_entries): New function.
1893 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
1894 (Output_data_got::got_offset): Protected rather than private.
1895 (Output_data_got::replace_got_entry): New function.
1896 * output.cc (Output_data_got::replace_got_entry): New function.
1897 * powerpc.cc (class Powerpc_relobj): New.
1898 (class Powerpc_relocate_functions): Delete all psymval variants or
1899 convert to value,addend type. Delete pcrela, pcrela_unaligned.
1900 Implement _ha functions using corresponding _hi function.
1901 (Powerpc_relobj::find_special_sections): New function.
1902 (Target_powerpc::do_make_elf_object): New function.
1903 (class Output_data_got_powerpc): New.
1904 (class Output_data_glink): New.
1905 (class Powerpc_scan_relocatable_reloc): New.
1906 Many more changes througout file.
1908 2012-08-09 Nick Clifton <nickc@redhat.com>
1910 * po/vi.po: Updated Vietnamese translation.
1912 2012-08-07 Ian Lance Taylor <iant@google.com>
1914 * layout.cc (Layout::add_target_dynamic_tags): If
1915 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
1918 2012-07-30 Nick Clifton <nickc@redhat.com>
1920 * po/gold.pot: Updated template.
1921 * po/es.po: Updated Spanish translation.
1923 2012-07-18 Cary Coutant <ccoutant@google.com>
1926 * configure.ac: Add check for -gpubnames support.
1927 * configure: Regenerate.
1928 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
1929 support; force -gno-pubnames.
1930 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
1932 (gdb_index_test_4): New test.
1933 * testsuite/Makefile.in: Regenerate.
1934 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
1935 * testsuite/gdb_index_test_2.sh: Likewise.
1936 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
1937 * testsuite/gdb_index_test_4.sh: New script.
1938 * testsuite/gdb_index_test_comm.sh: New script with common code;
1939 don't look for space after colon.
1941 2012-07-16 Sriraman Tallam <tmsriram@google.com>
1943 * gold.cc (queue_middle_tasks): Update function order only after
1944 deferred objects due to plugins are processed.
1946 2012-07-11 Ian Lance Taylor <iant@google.com>
1948 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
1949 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
1950 (Target_arm::scan_reloc_for_stub): Likewise.
1951 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
1952 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
1953 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
1954 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
1955 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
1957 2012-07-10 Dodji Seketeli <dodji@redhat.com>
1958 Ian Lance Taylor <iant@google.com>
1961 * configure.ac: Test whether std::tr1::hash<off_t> works.
1962 * gold.h: Add a specialization for std::tr1::hash<off_t> if
1964 * output.h (class Output_fill): Add virtual destructor.
1965 * configure, config.in: Rebuild.
1967 2012-06-22 Roland McGrath <mcgrathr@google.com>
1969 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
1971 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
1973 * plugin.cc (Plugin::load): Handle position independent executables.
1975 2012-06-06 Cary Coutant <ccoutant@google.com>
1977 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
1979 (lines_only_debug_sections): Likewise.
1980 (gdb_fast_lookup_sections): New static array.
1981 (is_gdb_debug_section): Rename formal parameter.
1982 (is_lines_only_debug_section): Likewise.
1983 (is_gdb_fast_lookup_section): New function.
1984 (Layout::include_section): Check for ".zdebug_" prefix; pass
1985 section name suffix to is_gdb_debug_section, et al.; check for
1986 fast-lookup sections when building .gdb_index.
1987 * options.h (--strip-debug-gdb): Update GDB version number.
1989 2012-06-06 Cary Coutant <ccoutant@google.com>
1991 * configure.ac: Add check for fallocate.
1992 * configure: Regenerate.
1993 * config.in: Regenerate.
1995 * options.h (class General_options): Add --mmap-output-file and
1996 --posix-fallocate options.
1997 * output.cc: (posix_fallocate): Remove; replace with...
1998 (gold_fallocate): New function.
1999 (Output_file::map_no_anonymous): Call gold_fallocate.
2000 (Output_file::map): Check --mmap-output-file option.
2002 2012-06-05 Jing Yu <jingyu@google.com>
2004 * gold.h (textdomain): Add do {} to empty while(0).
2005 (bindtextdomain): Likewise.
2007 2012-06-04 Cary Coutant <ccoutant@google.com>
2009 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
2012 2012-05-25 Sriraman Tallam <tmsriram@google.com>
2014 * symtab.cc (Symbol_table::define_special_symbol):
2015 Initialize *poldsym to prevent uninitialized variable errors.
2017 2012-05-23 Cary Coutant <ccoutant@google.com>
2019 * layout.cc (Layout::section_name_mapping): Add rules to handle
2020 exact match on .data.rel.ro.local or .data.rel.ro.
2021 (Layout::output_section_name): Check for exact matches.
2023 2012-05-23 Cary Coutant <ccoutant@google.com>
2025 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
2028 2012-05-22 Cary Coutant <ccoutant@google.com>
2030 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
2031 object before exporting symbol.
2033 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
2035 * testsuite/tls_test.cc: Include "config.h" first.
2036 * testsuite/tls_test_c.c: Likewise.
2038 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
2039 Nick Clifton <nickc@redhat.com>
2042 * configure.in: Add check that sysdep.h has been included before
2043 any system header files.
2044 * configure: Regenerate.
2045 * config.in: Regenerate.
2047 2012-05-14 Cary Coutant <ccoutant@google.com>
2049 * layout.cc (Layout::make_output_section): Mark .tdata section
2051 * testsuite/relro_test.cc: Add a TLS variable.
2053 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
2056 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
2057 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
2060 2012-05-08 Cary Coutant <ccoutant@google.com>
2062 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
2063 (lines_only_debug_sections): Likewise.
2065 2012-05-02 Roland McGrath <mcgrathr@google.com>
2067 * nacl.cc: New file.
2069 * Makefile.am (CCFILES, HFILES): Add them.
2070 * Makefile.in: Regenerate.
2071 * i386.cc (Output_data_plt_i386_nacl): New class.
2072 (Output_data_plt_i386_nacl_exec): New class.
2073 (Output_data_plt_i386_nacl_dyn): New class.
2074 (Target_i386_nacl): New class.
2075 (Target_selector_i386_nacl): New class.
2076 (target_selector_i386): Use it instead of Target_selector_i386.
2077 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
2078 (Target_x86_64_nacl): New class.
2079 (Target_selector_x86_64_nacl): New class.
2080 (target_selector_x86_64, target_selector_x32): Use it instead of
2081 Target_selector_x86_64.
2082 * arm.cc (Output_data_plt_arm_nacl): New class.
2083 (Target_arm_nacl): New class.
2084 (Target_selector_arm_nacl): New class.
2085 (target_selector_arm, target_selector_armbe): Use it instead of
2086 Target_selector_arm.
2088 * target-select.cc (select_target): Take new Input_file* and off_t
2089 arguments, pass them on to recognize method of selector.
2090 * object.cc (make_elf_sized_object): Update caller.
2091 * parameters.cc (parameters_force_valid_target): Likewise.
2092 * incremental.cc (make_sized_incremental_binary): Likewise.
2093 * target-select.h: Update decl.
2094 (Target_selector::recognize): Take new Input_file* argument,
2095 pass it on to do_recognize.
2096 (Target_selector::do_recognize): Take new Input_file* argument.
2097 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
2098 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
2099 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
2100 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
2102 * target.h (Target::Target_info): New members isolate_execinstr
2104 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
2105 * arm.cc (Target_arm::arm_info): Update initializer.
2106 * i386.cc (Target_i386::i386_info): Likewise.
2107 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
2108 * sparc.cc (Target_sparc::sparc_info): Likewise.
2109 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
2110 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2111 * layout.cc (Layout::attach_allocated_section_to_segment):
2112 Take new const Target* argument. If target->isolate_execinstr(), act
2114 (Layout::find_first_load_seg): Take new const Target* argument;
2115 if target->isolate_execinstr(), reject PF_X segments.
2116 (Layout::relaxation_loop_body): Update caller.
2117 (Layout::set_segment_offsets): If target->isolate_execinstr(),
2118 reset file offset to zero when we hit LOAD_SEG, and then do a second
2119 loop over the segments before LOAD_SEG to reassign offsets after
2120 addresses have been determined. Handle target->rosegment_gap().
2121 (Layout::attach_section_to_segment): Take new const Target* argument;
2122 pass it to attach_allocated_section_to_segment.
2123 (Layout::make_output_section): Update caller.
2124 (Layout::attach_sections_to_segments): Take new const Target* argument;
2125 pass it to attach_section_to_segment.
2126 * gold.cc (queue_middle_tasks): Update caller.
2127 * layout.h (Layout): Update method decls with new arguments.
2129 * arm.cc (Target_arm::Target_arm): Take optional argument for the
2130 Target_info pointer to use.
2131 (Target_arm::do_make_data_plt): New virtual method.
2132 (Target_arm::make_data_plt): New method that calls it.
2133 (Target_arm::make_plt_entry): Use it.
2134 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
2135 for the section alignment.
2136 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
2138 (Output_data_plt_arm::first_plt_entry_offset): Call it.
2139 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
2141 (Output_data_plt_arm::get_plt_entry_size): Call it.
2142 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
2143 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
2144 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
2146 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
2147 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
2148 method instead of sizeof(plt_entry).
2149 (Output_data_plt_arm::add_entry): Likewise.
2150 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
2151 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
2153 (Target_arm::plt_entry_size): Likewise.
2154 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
2156 (Output_data_plt_arm_standard): ... here, new class.
2157 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
2158 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
2159 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
2161 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2162 Take additional argument for the PLT entry size.
2163 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
2164 Use get_plt_entry_size method rather than plt_entry_size variable.
2165 (Output_data_plt_x86_64::reserve_slot): Likewise.
2166 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
2167 (Output_data_plt_x86_64::add_entry): Likewise.
2168 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
2169 (Output_data_plt_x86_64::address_for_global): Likewise.
2170 (Output_data_plt_x86_64::address_for_local): Likewise.
2171 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2172 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
2173 Make method non-static.
2174 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
2176 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
2177 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
2178 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
2179 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
2181 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
2182 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
2184 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
2185 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
2187 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
2188 (Output_data_plt_x86_64::plt_entry_size)
2189 (Output_data_plt_x86_64::first_plt_entry)
2190 (Output_data_plt_x86_64::plt_entry)
2191 (Output_data_plt_x86_64::tlsdesc_plt_entry)
2192 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
2193 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
2194 (Output_data_plt_x86_64_standard): ... here, new class.
2195 (Target_x86_64::Target_x86_64): Take optional argument for the
2196 Target_info pointer to use.
2197 (Target_x86_64::do_make_data_plt): New virtual method.
2198 (Target_x86_64::make_data_plt): New method to call it.
2199 (Target_x86_64::init_got_plt_for_update): Use that.
2200 Call this->plt_->add_eh_frame method here.
2201 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
2202 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
2203 rather than static method.
2204 (Target_x86_64::plt_entry_size): Likewise.
2205 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
2206 rather than plt_entry_size variable. Move guts of PLT filling to...
2207 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
2208 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
2209 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
2211 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
2212 additional argument for the section alignment.
2213 Don't do add_eh_frame_for_plt here.
2214 (Output_data_plt_i386::first_plt_entry_offset): Make the method
2215 non-static. Use get_plt_entry_size method rather than plt_entry_size
2217 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
2219 (Output_data_plt_i386::get_plt_entry_size): Call it.
2220 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
2221 (Output_data_plt_i386::add_eh_frame): New method to call it.
2222 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
2224 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
2225 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
2227 (Output_data_plt_i386::fill_plt_entry): New method to call it.
2228 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
2229 method instead of plt_entry_size.
2230 (Output_data_plt_i386::plt_entry_size)
2231 (Output_data_plt_i386::plt_eh_frame_fde_size)
2232 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
2233 (Output_data_plt_i386_standard): ... here, new class.
2234 (Output_data_plt_i386_exec): New class.
2235 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
2236 (Output_data_plt_i386_exec::first_plt_entry): ... here.
2237 (Output_data_plt_i386::exec_plt_entry): Move to ...
2238 (Output_data_plt_i386_exec::plt_entry): ... here.
2239 (Output_data_plt_i386_dyn): New class.
2240 (Output_data_plt_i386::first_plt_entry): Move to ...
2241 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
2242 (Output_data_plt_i386::dyn_plt_entry): Move to ...
2243 (Output_data_plt_i386_dyn::plt_entry): ... here.
2244 (Target_i386::Target_i386): Take optional argument for the Target_info
2246 (Target_i386::do_make_data_plt): New virtual method.
2247 (Target_i386::make_data_plt): New method to call it.
2248 (Target_i386::make_plt_section): Use that.
2249 Call this->plt_->add_eh_frame method here.
2250 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
2251 rather than plt_entry_size variable.
2252 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
2253 (Output_data_plt_i386::address_for_local): Likewise.
2254 (Output_data_plt_i386::do_write): Likewise.
2255 Move guts of PLT filling to...
2256 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
2257 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
2258 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
2259 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
2261 2012-05-01 Cary Coutant <ccoutant@google.com>
2263 * dwarf_reader.cc (Dwarf_die::read_attributes)
2264 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
2265 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
2266 * reduced_debug_output.cc
2267 (Output_reduced_debug_info_section::get_die_end): Remove
2268 DW_FORM_GNU_ref_index. Add default case.
2270 2012-04-26 Mark Wielaard <mjw@redhat.com>
2272 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
2273 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
2274 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
2275 DW_AT_high_pc as offset from DW_AT_low_pc.
2277 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
2278 * testsuite/Makefile.in: Regenerate.
2279 * testsuite/gdb_index_test_3.c: New test source file.
2280 * testsuite/gdb_index_test_3.sh: New test source file.
2282 2012-04-25 Ian Lance Taylor <iant@google.com>
2284 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
2286 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
2287 as a class, not a struct.
2288 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
2289 (Target_arm::apply_cortex_a8_workaround): Likewise.
2290 * gc.h: Declare Reloc_types as a struct, not a class.
2291 * object.h: Declare Symbols_data as a struct.
2292 * reloc.h: Declare Read_relocs_data as a struct.
2293 * target.h: Declare Relocate_info as a struct.
2295 2012-04-24 David S. Miller <davem@davemloft.net>
2297 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
2298 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
2301 2012-04-24 Cary Coutant <ccoutant@google.com>
2303 * incremental-dump.cc (find_input_containing_global): Replace
2304 magic number with symbolic constant.
2305 (dump_incremental_inputs): Update version number.
2306 * incremental.cc (Output_section_incremental_inputs): Update version
2307 number; import symbolic constants from Incremental_inputs_reader.
2308 (Incremental_inputs::create_data_sections): Align relocations
2309 section correctly for 64-bit targets.
2310 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
2311 constants; add padding.
2312 (Output_section_incremental_inputs::write_header): Add assert for
2314 (Output_section_incremental_inputs::write_input_files): Add assert
2315 for input_entry_size.
2316 (Output_section_incremental_inputs::write_info_blocks): Add padding;
2317 add assert for object_info_size, input_section_entry_size,
2318 global_sym_entry_size.
2319 * incremental.h (Incremental_inputs_reader): Add symbolic constants
2320 for data structure sizes; use them.
2321 (Incremental_input_entry_reader): Import symbolic constants from
2322 Incremental_inputs_reader; use them.
2324 2012-04-23 David S. Miller <davem@davemloft.net>
2326 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
2328 (Target_sparc::Target_sparc): Initialize new fields.
2329 (Target_sparc::do_make_elf_object): New function.
2330 (Target_sparc::do_adjust_elf_header): New function.
2332 2012-04-23 Cary Coutant <ccoutant@google.com>
2334 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
2335 CU range table of gdb index.
2337 2012-04-20 David S. Miller <davem@davemloft.net>
2339 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
2342 2012-04-16 David S. Miller <davem@davemloft.net>
2344 * sparc.cc (Target_sparc::got_address): New function.
2345 (Sparc_relocate_functions::gdop_hix22): New function.
2346 (Sparc_relocate_functions::gdop_lox10): New function.
2347 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
2349 (Target_sparc::Scan::local): Likewise if the global symbol is not
2350 preemptible and is not IFUNC.
2351 (Target_sparc::Relocate::relocate): Perform GOTDATA code
2352 transformations for local and non-preemptible non-IFUNC global
2355 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
2356 writing out 64-bit part of ranges.
2358 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
2359 -fpic and -fpie respectively.
2360 * Makefile.in: Regenerate.
2362 * sparc.cc (class Target_sparc): Add rela_ifunc_.
2363 (Target_sparc::Target_sparc): Initialize new field.
2364 (Target_sparc::do_plt_section_for_global): New function.
2365 (Target_sparc::do_plt_section_for_local): New function.
2366 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
2367 (Target_sparc::make_plt_section): New function, broken out of
2368 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
2369 (Target_sparc::make_plt_entry): Call make_plt_section.
2370 (Target_sparc::make_local_ifunc_plt_entry): New function.
2371 (Target_sparc::rela_ifunc_section): New function.
2372 (Target_sparc::plt_section): Remove const.
2373 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
2374 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
2375 and ifunc_count_ fields.
2376 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
2377 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
2378 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
2379 (Output_data_plt_sparc::rela_ifunc): New function.
2380 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
2381 (Output_data_plt_sparc::has_ifunc_section): New function.
2382 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
2383 (Output_data_plt_sparc::address_for_global): New function.
2384 (Output_data_plt_sparc::address_for_local): New function.
2385 (Output_data_plt_sparc::plt_index_to_offset): New function.
2386 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
2388 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
2390 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
2391 R_SPARC_JMP_IREL to switch.
2392 (Target_sparc::Scan::check_non_pic): Likewise.
2393 (Target_sparc::Scan::local): Handle IFUNC symbols.
2394 (Target_sparc::Scan::local): Likewise.
2395 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
2396 and plt_address_for_local.
2397 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
2398 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
2400 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
2401 (class Output_data_reloc): Adjust calls to Output_reloc_type.
2402 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
2403 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
2405 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
2406 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
2408 * sparc.cc (Target_sparc::Scan::global): Likewise.
2409 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2411 2012-04-16 Cary Coutant <ccoutant@google.com>
2413 * archive.cc (Library_base::should_include_member): Check for
2414 --export-dynamic-symbol.
2415 * options.h (class General_options): Add --export-dynamic-symbol.
2416 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
2417 --export-dynamic-symbol.
2418 (Symbol_table::gc_mark_undef_symbols): Likewise.
2419 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
2421 2012-04-12 David S. Miller <davem@davemloft.net>
2423 * sparc.cc (Reloc::wdisp10): New relocation method.
2424 (Reloc::h34): Likewise.
2425 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
2426 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
2428 (Target_sparc::Scan::local): Likewise.
2429 (Target_sparc::Scan::global): Likewise.
2430 (Target_sparc::Relocate::relocate): Likewise.
2432 2012-04-09 Cary Coutant <ccoutant@google.com>
2434 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
2437 2012-04-06 Ian Lance Taylor <iant@google.com>
2439 * timer.cc: #include <unistd.h>.
2441 2012-04-06 Roland McGrath <mcgrathr@google.com>
2443 * configure.in (AC_CHECK_HEADERS): Add locale.h.
2444 * config.in: Regenerate.
2445 * configure: Regenerate.
2447 2012-04-05 Nick Clifton <nickc@redhat.com>
2449 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
2450 (AM_LC_MESSAGES): Add.
2451 * aclocal.m4: Regenerate.
2452 * config.in: Regenerate.
2453 * configure: Regenerate.
2455 2012-03-21 Cary Coutant <ccoutant@google.com>
2457 * Makefile.am: Add gdb-index.cc, gdb-index.h.
2458 * Makefile.in: Regenerate.
2459 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
2460 (Sized_elf_reloc_mapper::symbol_section): New function.
2461 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
2462 (make_elf_reloc_mapper): New function.
2463 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
2464 (Dwarf_abbrev_table::do_read_abbrevs): New function.
2465 (Dwarf_abbrev_table::do_get_abbrev): New function.
2466 (Dwarf_ranges_table::read_ranges_table): New function.
2467 (Dwarf_ranges_table::read_range_list): New function.
2468 (Dwarf_pubnames_table::read_section): New function.
2469 (Dwarf_pubnames_table::read_header): New function.
2470 (Dwarf_pubnames_table::next_name): New function.
2471 (Dwarf_die::Dwarf_die): New function.
2472 (Dwarf_die::read_attributes): New function.
2473 (Dwarf_die::skip_attributes): New function.
2474 (Dwarf_die::set_name): New function.
2475 (Dwarf_die::set_linkage_name): New function.
2476 (Dwarf_die::attribute): New function.
2477 (Dwarf_die::string_attribute): New function.
2478 (Dwarf_die::int_attribute): New function.
2479 (Dwarf_die::uint_attribute): New function.
2480 (Dwarf_die::ref_attribute): New function.
2481 (Dwarf_die::child_offset): New function.
2482 (Dwarf_die::sibling_offset): New function.
2483 (Dwarf_info_reader::check_buffer): New function.
2484 (Dwarf_info_reader::parse): New function.
2485 (Dwarf_info_reader::do_parse): New function.
2486 (Dwarf_info_reader::do_read_string_table): New function.
2487 (Dwarf_info_reader::lookup_reloc): New function.
2488 (Dwarf_info_reader::get_string): New function.
2489 (Dwarf_info_reader::visit_compilation_unit): New function.
2490 (Dwarf_info_reader::visit_type_unit): New function.
2491 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
2492 Sized_elf_reloc_mapper.
2493 (Sized_dwarf_line_info::symbol_section): Remove function.
2494 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
2495 (Sized_dwarf_line_info::read_line_mappings): Remove object
2496 parameter, adjust callers.
2497 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
2498 * dwarf_reader.h: Include <sys/types.h>.
2499 (class Track_relocs): Remove forward declaration.
2500 (class Elf_reloc_mapper): New class.
2501 (class Sized_elf_reloc_mapper): New class.
2502 (class Dwarf_abbrev_table): New class.
2503 (class Dwarf_range_list): New class.
2504 (class Dwarf_ranges_table): New class.
2505 (class Dwarf_pubnames_table): New class.
2506 (class Dwarf_die): New class.
2507 (class Dwarf_info_reader): New class.
2508 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
2509 (Sized_dwarf_line_info::symbol_section): Remove member function.
2510 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
2512 * gdb-index.cc: New source file.
2513 * gdb-index.h: New source file.
2514 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
2515 and .debug_types sections, call Layout::add_to_gdb_index.
2516 (Sized_relobj_incr::do_section_name): Implement.
2517 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
2518 return type; Implement.
2519 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
2521 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
2522 parameter list and return type.
2523 (Sized_incr_dynobj::do_section_contents): Likewise.
2524 * layout.cc: Include gdb-index.h.
2525 (Layout::Layout): Initialize gdb_index_data_.
2526 (Layout::init_fixed_output_section): Check for .gdb_index section.
2527 (Layout::add_to_gdb_index): New function. Instantiate.
2528 * layout.h: Add forward declaration for class Gdb_index.
2529 (Layout::add_to_gdb_index): New member function.
2530 (Layout::gdb_index_data_): New data member.
2531 * main.cc: Include gdb-index.h.
2532 (main): Print statistics for gdb index.
2533 * object.cc (Object::section_contents): Move code into
2534 do_section_contents.
2535 (need_decompressed_section): Check for sections needed when building
2537 (build_compressed_section_map): Likewise.
2538 (Sized_relobj_file::do_read_symbols): Need local symbols when building
2540 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
2541 sections; call Layout::add_to_gdb_index.
2542 (Sized_relobj_file::do_decompressed_section_contents): Call
2543 do_section_contents directly.
2544 * object.h (Object::do_section_contents): Adjust parameter list and
2546 (Object::do_decompressed_section_contents): Call do_section_contents
2548 (Sized_relobj_file::do_section_contents): Adjust parameter list and
2550 * options.h (class General_options): Add --gdb-index option.
2551 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
2552 list and return type.
2553 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
2554 * reloc.h (Track_relocs::checkpoint): New function.
2555 (Track_relocs::reset): New function.
2557 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
2559 * testsuite/Makefile.in: Regenerate.
2560 * testsuite/gdb_index_test.cc: New test source file.
2561 * testsuite/gdb_index_test_1.sh: New test source file.
2562 * testsuite/gdb_index_test_2.sh: New test source file.
2564 2012-03-19 Doug Kwan <dougkwan@google.com>
2566 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2567 (Target_arm::do_finalize_sections): Remove code which defines
2568 __exidx_start and __exidx_end. Make symbol table parameter
2569 anonymous as it is not used.
2570 * gold.cc (queue_middle_tasks): Call target hook to define any
2571 target-specific symbols.
2572 * target.h (Target::define_standard_symbols): New method.
2573 (Target::do_define_standard_symbols): Same.
2574 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
2575 * testsuite/Makefile.in: Regenerate.
2576 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
2578 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
2579 relocations are generated for __exidx_start and __exidx_end.
2581 2012-03-16 Doug Kwan <dougkwan@google.com>
2583 * testsuite/Makefile.am: Disable test initpri3b.
2584 * testsuite/Makefile.in: Regenerate.
2586 2012-03-15 Doug Kwan <dougkwan@google.com>
2588 * arm.cc (Target_arm::got_section): Make .got section read-only
2591 2012-03-15 Ian Lance Taylor <iant@google.com>
2594 * layout.cc (Layout::make_output_section): Correctly mark
2595 SHT_INIT_ARRAY, et. al., as relro.
2597 2012-03-14 Doug Kwan <dougkwan@google.com>
2599 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
2600 dynamic relocations for protected symbols in shared objects.
2602 2012-03-13 Ian Lance Taylor <iant@google.com>
2604 * resolve.cc (Symbol_table::resolve): When merging common symbols,
2605 keep the larger alignment.
2607 2012-03-12 Cary Coutant <ccoutant@google.com>
2609 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
2610 handling of DW_LNE_define_file.
2612 2012-03-12 Cary Coutant <ccoutant@google.com>
2614 * reduced_debug_output.cc
2615 (Output_reduced_debug_info_section::get_die_end): Add new FORM
2618 2012-02-29 Cary Coutant <ccoutant@google.com>
2620 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
2622 2012-02-29 Cary Coutant <ccoutant@google.com>
2624 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2625 Call Object::decompressed_section_contents.
2626 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
2628 (Sized_dwarf_line_info::buffer_start_): New data member.
2629 * merge.cc (Output_merge_data::do_add_input_section): Call
2630 Object::decompressed_section_contents.
2631 (Output_merge_string::do_add_input_section): Likewise.
2632 * object.cc (need_decompressed_section): New function.
2633 (build_compressed_section_map): Decompress sections needed later.
2634 (Sized_relobj_file::do_decompressed_section_contents): New function.
2635 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2636 * object.h (Object::decompressed_section_contents): New function.
2637 (Object::discard_decompressed_sections): New function.
2638 (Object::do_decompressed_section_contents): New function.
2639 (Object::do_discard_decompressed_sections): New function.
2640 (Compressed_section_info): New type.
2641 (Compressed_section_map): Include decompressed section contents.
2642 (Sized_relobj_file::do_decompressed_section_contents): New function.
2643 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2645 2012-02-16 Cary Coutant <ccoutant@google.com>
2647 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
2648 * testsuite/Makefile.in: Regenerate.
2650 2012-02-14 Cary Coutant <ccoutant@google.com>
2652 * options.cc (General_options::finalize): Disallow -pie and -static.
2654 2012-02-03 Doug Kwan <dougkwan@google.com>
2656 * arm.cc (Arm_relocate_functions::abs8,
2657 Arm_relocate_functions::abs16): Use
2658 Bits::has_signed_unsigned_overflow32.
2659 (Arm_relocate_functions::thm_abs8): Correct range of
2661 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
2664 2012-02-02 Doug Kwan <dougkwan@google.com>
2666 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
2667 position independent outputs, not just shared objects.
2669 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
2671 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
2672 * configure: Regenerated.
2674 2012-01-27 Ian Lance Taylor <iant@google.com>
2676 * reloc.h (Bits): New class with static functions, copied from
2677 namespace utils in arm.cc.
2678 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
2681 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2683 * incremental.cc (write_info_blocks): Correct relocation offset.
2685 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2687 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
2688 (Relocate::tls_gd_to_le): Likewise.
2690 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2692 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
2694 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2696 * configure.ac: Check if -mcmodel=medium works.
2697 * configure: Regenerated.
2699 2012-01-24 Cary Coutant <ccoutant@google.com>
2701 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
2703 (read_unsigned_LEB_128_x): ... this new function.
2704 (read_signed_LEB_128): Replaced with inline definition and ...
2705 (read_signed_LEB_128_x): ... this new function.
2706 * int_encoding.h (read_unsigned_LEB_128_x): New function.
2707 (read_unsigned_LEB_128): Add inline definition.
2708 (read_signed_LEB_128_x): New function.
2709 (read_signed_LEB_128): Add inline definition.
2710 * testsuite/Makefile.am (leb128_unittest): New unit test.
2711 * testsuite/Makefile.in: Regenerate.
2712 * testsuite/leb128_unittest.cc: New unit test.
2714 2012-01-23 Ian Lance Taylor <iant@google.com>
2717 * i386.cc (Target_i386::do_code_fill): When using a jmp
2718 instruction, pad with nop instructions.
2719 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2721 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
2723 * x86_64.cc (gc_process_relocs): Add typename on types used in
2725 (scan_relocs): Likewise.
2726 (relocate_section): Likewise.
2727 (apply_relocation): Likewise.
2729 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
2731 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
2732 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
2735 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
2737 * x86_64.cc: Initial support for x32.
2739 2012-01-03 Cary Coutant <ccoutant@google.com>
2741 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
2742 Use abstract base class for GOT.
2743 * gold/output.h (class Output_data_got_base): New abstract base class.
2744 (class Output_data_got): Derive from new base class, adjust ctors.
2745 (Output_data_got::reserve_slot): Make virtual; rename to
2746 do_reserve_slot; Adjust callers.
2747 * gold/target.h (Sized_target::init_got_plt_for_update): Return
2748 pointer to abstract base class.
2749 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
2751 2011-12-18 Ian Lance Taylor <iant@google.com>
2753 * object.h (Relobj::local_symbol_value): New function.
2754 (Relobj::local_plt_offset): New function.
2755 (Relobj::local_has_got_offset): New function.
2756 (Relobj::local_got_offset): New function.
2757 (Relobj::set_local_got_offset): New function.
2758 (Relobj::do_local_symbol_value): New pure virtual function.
2759 (Relobj::do_local_plt_offset): Likewise.
2760 (Relobj::do_local_has_got_offset): Likewise.
2761 (Relobj::do_local_got_offset): Likewise.
2762 (Relobj::do_set_local_got_offset): Likewise.
2763 (Sized_relobj::do_local_has_got_offset): Rename from
2764 local_has_got_offset.
2765 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
2766 (Sized_relobj::do_set_local_got_offset): Rename from
2767 set_local_got_offset.
2768 (Sized_relobj_file::do_local_plt_offset): Rename from
2770 (Sized_relobj_file::do_local_symbol_value): New function.
2771 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
2773 * output.cc (Output_data_got::Got_entry::write): Change object to
2774 Relobj. Use local_symbol_value.
2775 (Output_data_got::add_global_with_rel): Change rel_dyn to
2776 Output_data_reloc_generic*. Use add_global_generic.
2777 (Output_data_got::add_global_with_rela): Remove. Change all
2778 callers to use add_global_with_rel.
2779 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
2780 Output_data_reloc_generic*. Use add_global_generic.
2781 (Output_data_got::add_global_pair_with_rela): Remove. Change all
2782 callers to use add_global_pair_with_rel.
2783 (Output_data_got::add_local): Change object to Relobj*.
2784 (Output_data_got::add_local_plt): Likewise.
2785 (Output_data_got::add_local_with_rel): Change object to Relobj*,
2786 change rel_dyn to Output_data_reloc_generic*. Use
2788 (Output_data_got::add_local_with_rela): Remove. Change all
2789 callers to use all_local_with_rel.
2790 (Output_data_got::add_local_pair_with_rel): Change object to
2791 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
2792 add_output_section_generic.
2793 (Output_data_got::add_local_pair_with_rela): Remove. Change all
2794 callers to use add_local_pair_with_rel.
2795 (Output_data_got::reserve_local): Change object to Relobj*.
2796 * output.h: (class Output_data_reloc_generic): Add pure virtual
2797 declarations for add_global_generic, add_local_generic,
2798 add_output_section_generic.
2799 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
2800 functions for Output_data_reloc_generic. Update declarations for
2801 changes listed in output.cc.
2802 (class Output_data_got): Change template parameter to got_size.
2803 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
2804 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
2806 (Sized_relobj_incr::do_local_plt_offset): New function.
2807 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
2810 2011-12-17 Cary Coutant <ccoutant@google.com>
2812 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
2813 * resolve.cc (Symbol_table::resolve): Likewise.
2814 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
2816 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2818 2011-12-16 Ian Lance Taylor <iant@google.com>
2820 * output.h (Output_data_reloc_generic::add): Only call
2821 add_dynamic_reloc if this is a dynamic reloc section.
2823 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
2826 * target-reloc.h (apply_relocation): Replace <64, false> with
2829 2011-11-25 Nick Clifton <nickc@redhat.com>
2831 * po/it.po: New Italian translation.
2833 2011-11-17 Sterling Augustine <saugustine@google.com>
2835 * script.cc (script_include_directive): Implement.
2836 (read_script_file): New local variables name and search_path. Update
2837 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
2838 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
2839 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
2841 2011-11-11 Sterling Augustine <saugustine@google.com>
2843 * yyscript.y (section_cmd): Add support for INCLUDE directive.
2844 (file_or_sections_cmd): Likewise.
2846 2011-11-11 Doug Kwan <dougkwan@google.com>
2848 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
2849 if --just-symbols is given.
2851 2011-11-10 Doug Kwan <dougkwan@google.com>
2854 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
2855 when processing data relocs.
2856 * reloc.h (Relocate_functions::rel_unaligned): New method.
2857 (Relocate_functions::pcrel_unaligned): Ditto.
2858 (Relocate_functions::rel32_unaligned): Ditto.
2859 (Relocate_functions::pcrel32_unaligned): Ditto.
2861 2011-11-09 Doug Kwan <dougkwan@google.com>
2864 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
2865 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
2866 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
2867 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2868 (Relocate_functions::rel_unaligned): New.
2869 (Relocate_functions::rel32_unaligned): New.
2870 * target-reloc.h (relocate_for_relocatable): Add code to handle
2871 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2872 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
2873 arm_unaligned_reloc_r): New targets.
2874 * testsuite/Makefile.in: Regenerate.
2875 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
2878 2011-11-02 Ian Lance Taylor <iant@google.com>
2880 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
2882 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
2883 * options.cc (General_options::finalize): Use library search path
2884 from configure script if specified. If not native and no sysroot,
2885 only search TOOLLIBDIR.
2886 * options.h (Search_directory::Search_directory): Change name to
2888 (General_options::add_to_library_path_with_sysroot): Change arg to
2890 * configure, Makefile.in, config.in: Rebuild.
2892 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2894 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
2895 we are working around the ARM1176 Erratum.
2896 * options.h (General_options::fix_arm1176): Add option.
2897 * testsuite/Makefile.am: Add testcases, and keep current ones
2899 * testsuite/Makefile.in: Regenerate.
2900 * testsuite/arm_fix_1176.s: New file.
2901 * testsuite/arm_fix_1176.sh: Likewise.
2903 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2905 * arm.cc (Target_arm::Target_arm): Remove initialisation of
2907 (Target_arm::may_use_blx): Remove method.
2908 (Target_arm::set_may_use_blx): Likewise.
2909 (Target_arm::may_use_v4t_interworking): New method.
2910 (Target_arm::may_use_v5t_interworking): Likewise.
2911 (Target_arm::may_use_blx_): Remove member variable.
2912 (Arm_relocate_functions::arm_branch_common): Check for v5T
2914 (Arm_relocate_functions::thumb_branch_common): Likewise.
2915 (Reloc_stub::stub_type_for_reloc): Likewise.
2916 (Target_arm::do_finalize_sections): Correct interworking checks.
2917 * testsuite/Makefile.am: Add new tests.
2918 * testsuite/Makefile.in: Regenerate.
2919 * testsuite/arm_farcall_arm_arm.s: New test.
2920 * testsuite/arm_farcall_arm_arm.sh: Likewise.
2921 * testsuite/arm_farcall_arm_thumb.s: Likewise.
2922 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
2923 * testsuite/arm_farcall_thumb_arm.s: Likewise.
2924 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
2925 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
2926 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
2928 2011-10-31 Cary Coutant <ccoutant@google.com>
2931 * expression.cc (Expression::eval_with_dot): Add
2932 is_section_dot_assignment parameter.
2933 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
2934 absolute and assigning to dot within a section.
2935 * script-sections.cc
2936 (Output_section_element_assignment::set_section_addresses): Pass
2937 dot_section to set_if_absolute.
2938 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
2939 as is_section_dot_assignment flag to eval_with_dot.
2940 (Output_section_element_dot_assignment::set_section_addresses):
2942 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
2943 parameter. Also set value if relative to dot_section; set the
2944 symbol's output_section.
2945 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
2946 parameter. Adjust all callers.
2947 (Expression::eval_maybe_dot): Likewise.
2948 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
2950 * testsuite/script_test_2.t: Test assignment of an absolute value
2951 to dot within an output section element.
2953 2011-10-31 Cary Coutant <ccoutant@google.com>
2955 * options.h (class General_options): Add --[no-]gnu-unique options.
2956 * symtab.cc (Symbol_table::sized_write_globals): Convert
2957 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
2959 2011-10-31 Cary Coutant <ccoutant@google.com>
2962 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
2963 unnecessary assertion.
2964 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
2966 2011-10-31 Sriraman Tallam <tmsriram@google.com>
2968 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2970 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2972 Change to just keep the section associated with symbol.
2973 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
2974 they are externally visible and --export-dynamic is turned on.
2975 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
2977 2011-10-19 Ian Lance Taylor <iant@google.com>
2980 * script-sections.cc
2981 (Output_section_element_dot_assignment::needs_output_section): New
2984 2011-10-19 Ian Lance Taylor <iant@google.com>
2987 * layout.cc (Layout::segment_precedes): Don't assert failure if a
2988 --section-start option was seen.
2989 * options.h (General_options::any_section_start): New function.
2991 2011-10-18 David S. Miller <davem@davemloft.net>
2994 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
2995 member to track relocation locations that have moved during TLS
2996 reloc optimizations.
2997 (Target_sparc::Relocate::Relocate): Initialize to NULL.
2998 (Target_sparc::Relocate::relocate): Adjust view down by 4
2999 bytes if it matches reloc_adjust_addr_.
3000 (Target_sparc::Relocate::relocate_tls): Always move the
3001 __tls_get_addr call delay slot instruction forward 4 bytes when
3002 performing relaxation.
3004 2011-10-18 Cary Coutant <ccoutant@google.com>
3006 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
3007 (Output_file::map_no_anonymous): Check for non-zero
3008 return code from posix_fallocate.
3010 2011-10-17 Cary Coutant <ccoutant@google.com>
3013 * plugin.cc (is_visible_from_outside): Check for symbols
3014 referenced from dynamic objects.
3015 * resolve.cc (Symbol_table::resolve): Don't count references
3016 from dynamic objects as references from real ELF files.
3017 * testsuite/plugin_test_2.sh: Adjust expected result.
3019 2011-10-17 Cary Coutant <ccoutant@google.com>
3021 * gold.cc: Include timer.h.
3022 (queue_middle_tasks): Stamp time.
3023 (queue_final_tasks): Likewise.
3024 * main.cc (main): Store timer in parameters. Print timers
3026 * parameters.cc (Parameters::Parameters): Initialize timer_.
3027 (Parameters::set_timer): New function.
3028 (set_parameters_timer): New function.
3029 * parameters.h (Parameters::set_timer): New function.
3030 (Parameters::timer): New function.
3031 (Parameters::timer_): New data member.
3032 (set_parameters_timer): New function.
3033 * timer.cc (Timer::stamp): New function.
3034 (Timer::get_pass_time): New function.
3035 * timer.h (Timer::stamp): New function.
3036 (Timer::get_pass_time): New function.
3037 (Timer::pass_times_): New data member.
3039 2011-10-17 Cary Coutant <ccoutant@google.com>
3041 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
3042 task for members of lib groups.
3044 2011-10-17 Cary Coutant <ccoutant@google.com>
3047 * fileread.cc (File_read::find_view): Add assert.
3048 (File_read::make_view): Move bounds check (replace with assert)...
3049 (File_read::find_or_make_view): ... to here.
3051 2011-10-12 Cary Coutant <ccoutant@google.com>
3053 * output.cc (Output_file::open_base_file): Handle case where
3054 ::read returns less than requested size.
3056 2011-10-10 Cary Coutant <ccoutant@google.com>
3058 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
3059 Initialize defined_count_.
3060 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
3061 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
3062 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
3063 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
3064 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
3065 * incremental.h (Sized_relobj_incr::defined_count_): New data
3067 (Sized_incr_dynobj::defined_count_): New data member.
3068 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
3069 Return zeroes instead of internal error.
3071 2011-10-10 Cary Coutant <ccoutant@google.com>
3074 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
3075 (Output_reloc::symbol_value): Return PLT offset if flag is set.
3076 * output.h (class Output_reloc): Add use_plt_offset flag.
3077 (Output_reloc::type_): Adjust size of bit field.
3078 (Output_reloc::use_plt_offset_): New bit field.
3079 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
3080 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
3081 flag. Adjust all callers.
3082 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
3083 creating RELATIVE relocations.
3085 2011-10-10 Nick Clifton <nickc@redhat.com>
3087 * po/es.po: Updated Spanish translation.
3088 * po/fi.po: Updated Finnish translation.
3090 2011-10-03 Diego Novillo <dnovillo@google.com>
3092 * options.cc (parse_uint): Fix dereference of RETVAL.
3094 2011-09-29 Sriraman Tallam <tmsriram@google.com>
3096 * layout.h (section_order_map_): New member.
3097 (get_section_order_map): New member function.
3098 * output.cc (Output_section::add_input_section): Check for patterns
3099 only when --section-ordering-file is specified.
3100 * gold.cc (queue_middle_tasks): Delay updating order of sections till
3101 output_sections have been formed.
3102 * layout.cc (Layout_Layout): Initialize section_order_map_.
3103 * plugin.cc (update_section_order): Store order in order_map. Do not
3105 * testsuite/Makefile.am: Add test case for plugin_final_layout.
3106 * testsuite/Makefile.in: Regenerate.
3107 * testsuite/plugin_section_order.c: New file.
3108 * testsuite/plugin_final_layout.cc: New file.
3109 * testsuite/plugin_final_layout.sh: New file.
3111 2011-09-29 Cary Coutant <ccoutant@google.com>
3113 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3115 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
3116 symbols during incremental update.
3117 (Symbol_table::add_from_dynobj): Likewise.
3119 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3120 Ian Lance Taylor <iant@google.com>
3122 * symtab.cc (Symbol_table::define_special_symbol): Always
3123 canonicalize version string.
3125 2011-09-26 Cary Coutant <ccoutant@google.com>
3127 * gold.cc (queue_initial_tasks): Move option checks ...
3128 * options.cc (General_options::finalize): ... to here. Disable
3129 some options; make others fatal.
3131 2011-09-26 Cary Coutant <ccoutant@google.com>
3134 * plugin.cc (get_symbols_v2): New function.
3135 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
3136 (is_referenced_from_outside): New function.
3137 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
3138 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
3139 (get_symbols): Pass version parameter.
3140 (get_symbols_v2): New function.
3141 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
3143 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
3144 (onload): Add LDPT_GET_SYMBOLS_V2.
3145 (all_symbols_read_hook): Use get_symbols_v2; check for
3146 LDPR_PREVAILING_DEF_IRONLY_EXP.
3147 * testsuite/plugin_test_3.sh: Update expected results.
3149 2011-09-23 Simon Baldwin <simonb@google.com>
3151 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
3152 configuration options.
3153 * configure: Regenerate.
3154 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
3155 * Makefile.in: Regenerate.
3156 * testsuite/Makefile.in: Regenerate.
3158 2011-09-19 Sriraman Tallam <tmsriram@google.com>
3160 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
3162 2011-09-19 Cary Coutant <ccoutant@google.com>
3164 * incremental.cc (can_incremental_update): Fix typo in comment.
3165 * incremental.h (can_incremental_update): Likewise.
3167 2011-09-18 Cary Coutant <ccoutant@google.com>
3169 * incremental.cc (can_incremental_update): New function.
3170 * incremental.h (can_incremental_update): New function.
3171 * layout.cc (Layout::init_fixed_output_section): Call it.
3172 (Layout::make_output_section): Don't allow patch space in .eh_frame.
3173 * object.cc (Sized_relobj_file::do_layout): Call
3174 can_incremental_update.
3176 2011-09-13 Cary Coutant <ccoutant@google.com>
3178 * configure.ac: Check for glibc support for gnu_indirect_function
3179 support with static linking, setting automake conditional
3181 * Makefile.in: Regenerate.
3182 * configure: Regenerate.
3184 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
3185 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
3187 * testsuite/Makefile.in: Regenerate.
3189 2011-09-13 Cary Coutant <ccoutant@google.com>
3191 * incremental.cc (Sized_relobj_incr::do_layout): Call
3192 report_comdat_group for kept comdat sections.
3193 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
3194 * testsuite/Makefile.in: Regenerate.
3195 * testsuite/incr_comdat_test_1.cc: New source file.
3196 * testsuite/incr_comdat_test_2_v1.cc: New source file.
3197 * testsuite/incr_comdat_test_2_v2.cc: New source file.
3198 * testsuite/incr_comdat_test_2_v3.cc: New source file.
3200 2011-09-13 Ian Lance Taylor <iant@google.com>
3202 * object.cc (Sized_relobj_file::do_layout): Remove unused local
3203 variable external_symbols_offset.
3205 2011-09-12 Ian Lance Taylor <iant@google.com>
3207 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
3208 triggered if object has no symbols.
3210 2011-09-09 David S. Miller <davem@davemloft.net>
3212 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
3213 (Output_fill_debug_line::do_write): Likewise.
3215 2011-08-29 Cary Coutant <ccoutant@google.com>
3217 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
3218 casts to match formatting specs.
3219 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
3221 2011-08-26 Cary Coutant <ccoutant@google.com>
3223 * layout.cc (Free_list::allocate): Provide guarantee of minimum
3224 remaining hole size when allocating.
3225 (Layout::make_output_section): Set fill methods for debug sections.
3226 * layout.h (Free_list::Free_list_node): Move from private to
3228 (Free_list::set_min_hole_size): New function.
3229 (Free_list::begin, Free_list::end): New functions.
3230 (Free_list::min_hole_): New data member.
3231 * output.cc: Include dwarf.h.
3232 (Output_fill_debug_info::do_minimum_hole_size): New function.
3233 (Output_fill_debug_info::do_write): New function.
3234 (Output_fill_debug_line::do_minimum_hole_size): New function.
3235 (Output_fill_debug_line::do_write): New function.
3236 (Output_section::Output_section): Initialize new data member.
3237 (Output_section::set_final_data_size): Ensure patch space is larger
3238 than minimum hole size.
3239 (Output_section::do_write): Fill holes in debug sections.
3240 * output.h (Output_fill): New class.
3241 (Output_fill_debug_info): New class.
3242 (Output_fill_debug_line): New class.
3243 (Output_section::set_free_space_fill): New function.
3244 (Output_section::free_space_fill_): New data member.
3245 * testsuite/Makefile.am (incremental_test_3): Add
3246 --incremental-patch option.
3247 (incremental_test_4): Likewise.
3248 (incremental_test_5): Likewise.
3249 (incremental_test_6): Likewise.
3250 (incremental_copy_test): Likewise.
3251 (incremental_common_test_1): Likewise.
3252 * testsuite/Makefile.in: Regenerate.
3254 2011-08-26 Nick Clifton <nickc@redhat.com>
3256 * po/es.po: Updated Spanish translation.
3258 2011-08-01 Cary Coutant <ccoutant@google.com>
3260 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
3261 * gold/testsuite/Makefile.in: Regenerate.
3262 * gold/testsuite/justsyms_exec.c: New source file.
3263 * gold/testsuite/justsyms_lib.c: New source file.
3265 2011-08-01 Cary Coutant <ccoutant@google.com>
3267 * layout.cc (Layout::set_segment_offsets): Don't realign text
3268 segment if -Ttext was specified.
3269 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
3271 * object.h (Sized_relobj_file::e_type): New function.
3272 (Sized_relobj_file::e_type_): New data member.
3273 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
3274 base address for ET_EXEC files.
3275 * target.cc (Target::do_make_elf_object_implementation): Allow
3276 ET_EXEC files with --just-symbols option.
3278 2011-07-28 Cary Coutant <ccoutant@google.com>
3280 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
3281 Add thread_number parameter.
3282 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
3283 * workqueue-threads.cc
3284 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
3285 current thread if its thread number is greater than desired thread
3287 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
3288 Add thread_number parameter.
3289 (Workqueue::should_cancel_thread): Likewise.
3290 (Workqueue::find_runnable_or_wait): Pass thread_number to
3291 should_cancel_thread.
3292 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
3295 2011-07-22 Sriraman Tallam <tmsriram@google.com>
3297 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
3298 only after checking if it cannot be forced local.
3299 * symtab.h (is_externally_visible): Check if the symbol is not forced
3302 2011-07-15 Ian Lance Taylor <iant@google.com>
3304 * options.h (class General_options): Add --print-output-format.
3305 Move -EL next to -EB, for better --help output.
3306 * target-select.cc: Include <cstdio>, "options.h", and
3308 (Target_selector::do_target_bfd_name): New function.
3309 (print_output_format): New function.
3310 * target-select.h (class Target_selector): Update declarations.
3311 (Target_selector::target_bfd_name): New function.
3312 (print_output_format): Declare.
3313 * main.cc: Include "target-select.h".
3314 (main): Handle --print-output-format.
3315 * gold.cc: Include "target-select.h".
3316 (queue_initial_tasks): Handle --print-output-format when there are
3318 * parameters.cc (parameters_force_valid_target): Give a better
3319 error message if -EB/-EL does not match target.
3320 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
3323 2011-07-15 Ian Lance Taylor <iant@google.com>
3325 * i386.cc (class Output_data_plt_i386): Add layout_ field.
3326 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
3327 (Output_data_plt_i386::do_write): Write address of .dynamic
3328 section to first entry in .got.plt section.
3329 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
3330 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3332 (Output_data_plt_x86_64::do_write): Write address of .dynamic
3333 section to first entry in .got.plt section.
3334 * layout.h (Layout::dynamic_section): New function.
3336 2011-07-13 Sriraman Tallam <tmsriram@google.com>
3338 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
3340 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
3341 input_section_position_, and input_section_glob_.
3342 (read_layout_from_file): Call function section_ordering_specified.
3343 * layout.h (is_section_ordering_specified): New function.
3344 (section_ordering_specified): New function.
3345 (section_ordering_specified_): New boolean member.
3346 * main.cc(main): Call load_plugins after layout object is defined.
3347 * output.cc (Output_section::add_input_section): Use
3348 function section_ordering_specified to check if section ordering is
3350 * output.cc (Output_section::add_relaxed_input_section): Use
3351 function section_ordering_specified to check if section ordering is
3353 (Output_section::update_section_layout): New function.
3354 (Output_section::sort_attached_input_sections): Check if input section
3356 * output.h (Output_section::update_section_layout): New function.
3357 * plugin.cc (get_section_count): New function.
3358 (get_section_type): New function.
3359 (get_section_name): New function.
3360 (get_section_contents): New function.
3361 (update_section_order): New function.
3362 (allow_section_ordering): New function.
3363 (Plugin::load): Add the new interfaces to the transfer vector.
3364 (Plugin_manager::load_plugins): New parameter.
3365 (Plugin_manager::all_symbols_read): New parameter.
3366 (Plugin_manager::claim_file): New parameter. Save the elf object for
3368 (Plugin_manager::get_elf_object): New function.
3369 (Plugin_manager::get_view): Change to directly use the bool to check
3370 if get_view is called from claim_file_hook.
3371 * plugin.h (input_objects): New function
3372 (Plugin__manager::load_plugins): New parameter.
3373 (Plugin_manager::claim_file): New parameter.
3374 (Plugin_manager::get_elf_object): New function.
3375 (Plugin_manager::in_claim_file_handler): New function.
3376 (Plugin_manager::in_claim_file_handler_): New member.
3377 (layout): New function.
3378 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
3379 handler with an extra parameter. Make the elf object before calling
3381 * testsuite/plugin_test.c (get_section_count): New function pointer.
3382 (get_section_type): New function pointer.
3383 (get_section_name): New function pointer.
3384 (get_section_contents): New function pointer.
3385 (update_section_order): New function pointer.
3386 (allow_section_ordering): New function pointer.
3387 (onload): Check if the new interfaces exist.
3389 2011-07-13 Ian Lance Taylor <iant@google.com>
3391 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
3393 * x86_64.cc (Target_x86_64::got_section): Likewise.
3394 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
3395 (relro_now_test_SOURCES): New variable.
3396 (relro_now_test_DEPENDENCIES): New variable.
3397 (relro_now_test_LDFLAGS): New variable.
3398 (relro_now_test_LDADD): New variable.
3399 (relro_now_test.so): New target.
3400 * testsuite/Makefile.in: Rebuild.
3402 2011-07-12 Ian Lance Taylor <iant@google.com>
3405 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
3406 GLOB_DAT relocation rather than a RELATIVE relocation for a
3407 protected symbol when creating a shared library.
3408 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3409 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
3410 * testsuite/protected_main_1.cc (main): Test that protected
3411 function has same address.
3413 2011-07-11 Ian Lance Taylor <iant@google.com>
3416 * options.h (class General_options): Add -Bgroup.
3417 * options.cc (General_options::finalize): If -Bgroup is set,
3418 default to --unresolved-symbols=report-all.
3419 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
3420 * target-reloc.h (issue_undefined_symbol_error): Handle
3421 --unresolved-symbols=report-all.
3423 2011-07-08 Ian Lance Taylor <iant@google.com>
3426 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
3427 if linker script discards key sections.
3428 (Layout::create_dynamic_symtab): Likewise.
3429 (Layout::assign_local_dynsym_offsets): Likewise.
3430 (Layout::sized_create_version_sections): Likewise.
3431 (Layout::create_interp): Likewise.
3432 (Layout::finish_dynamic_section): Likewise.
3433 (Layout::set_dynamic_symbol_size): Likewise.
3435 2011-07-08 Ian Lance Taylor <iant@google.com>
3438 * options.h (class General_options): Add --unresolved-symbols.
3439 * target-reloc.h (issue_undefined_symbol_error): Check
3440 --unresolved-symbols. Add comments.
3442 2011-07-08 Ian Lance Taylor <iant@google.com>
3444 * testsuite/odr_violation2.cc (Ordering::operator()): Make
3445 expression more complex.
3447 2011-07-08 Ian Lance Taylor <iant@google.com>
3450 * target-reloc.h (issue_undefined_symbol_error): New inline
3451 function, broken out of relocate_section.
3452 (relocate_section): Call issue_undefined_symbol_error.
3453 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3454 there is no TLS segment if we are about to issue an undefined
3456 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3458 2011-07-08 Ian Lance Taylor <iant@google.com>
3461 * resolve.cc (Symbol_table::should_override): Add fromtype
3462 parameter. Change all callers. Give error when linking together
3463 TLS and non-TLS symbol.
3464 (Symbol_table::should_override_with_special): Add fromtype
3465 parameter. Change all callers.
3466 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3467 there is no TLS segment if we have reported some errors.
3468 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3470 2011-07-08 Ian Lance Taylor <iant@google.com>
3473 * target.h (Target::plt_address_for_global): New function.
3474 (Target::plt_address_for_local): New function.
3475 (Target::plt_section_for_global): Remove.
3476 (Target::plt_section_for_local): Remove.
3477 (Target::do_plt_address_for_global): New virtual function.
3478 (Target::do_plt_address_for_local): New virtual function.
3479 (Target::do_plt_section_for_global): Remove.
3480 (Target::do_plt_section_for_local): Remove.
3481 (Target::register_global_plt_entry): Add Symbol_table and Layout
3483 * output.cc (Output_data_got::Got_entry::write): Use
3484 plt_address_for_global and plt_address_for_local.
3485 * layout.cc (Layout::add_target_dynamic_tags): Use size and
3486 address of output section.
3487 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
3488 got_irelative_, and irelative_count_ fields. Update
3490 (Output_data_plt_i386::has_irelative_section): New function.
3491 (Output_data_plt_i386::entry_count): Add irelative_count_.
3492 (Output_data_plt_i386::set_final_data_size): Likewise.
3493 (class Target_i386): Add got_irelative_ and rel_irelative_
3494 fields. Update declarations.
3495 (Target_i386::Target_i386): Initialize new fields.
3496 (Target_i386::do_plt_address_for_global): New function replacing
3497 do_plt_section_for_global.
3498 (Target_i386::do_plt_address_for_local): New function replacing
3499 do_plt_section_for_local.
3500 (Target_i386::got_section): Create got_irelative_.
3501 (Target_i386::rel_irelative_section): New function.
3502 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
3503 fields. Don't define __rel_iplt_{start,end}.
3504 (Output_data_plt_i386::add_entry): Add symtab and layout
3505 parameters. Change all callers. Use different PLT and GOT for
3507 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
3508 layout parameters. Change all callers. Use different PLT and
3510 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
3511 (Output_data_plt_i386::rel_irelative): New function.
3512 (Output_data_plt_i386::address_for_global): New function.
3513 (Output_data_plt_i386::address_for_local): New function.
3514 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
3515 IRELATIVE GOT when changing IFUNC GOT entries.
3516 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
3518 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
3519 if we didn't create an IRELATIVE GOT.
3520 (Target_i386::Relocate::relocate): Use plt_address_for_global and
3521 plt_address_for_local.
3522 (Target_i386::do_dynsym_value): Use plt_address_for_global.
3523 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
3524 got_irelative_, and irelative_count_ fields. Update
3526 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3527 Initialize new fields. Remove symtab parameter. Change all
3529 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
3531 (Output_data_plt_x86_64::has_irelative_section): New function.
3532 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
3533 (class Target_x86_64): Add got_irelative_ and rel_irelative_
3534 fields. Update declarations.
3535 (Target_x86_64::Target_x86_64): Initialize new fields.
3536 (Target_x86_64::do_plt_address_for_global): New function replacing
3537 do_plt_section_for_global.
3538 (Target_x86_64::do_plt_address_for_local): New function replacing
3539 do_plt_section_for_local.
3540 (Target_x86_64::got_section): Create got_irelative_.
3541 (Target_x86_64::rela_irelative_section): New function.
3542 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
3543 all callers. Don't create __rel_iplt_{start,end}.
3544 (Output_data_plt_x86_64::add_entry): Add symtab and layout
3545 parameters. Change all callers. Use different PLT and GOT for
3547 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
3548 layout parameters. Change all callers. Use different PLT and
3550 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
3551 parameters. Change all callers. Use different PLT and GOT for
3553 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
3554 (Output_data_plt_x86_64::rela_irelative): New function.
3555 (Output_data_plt_x86_64::address_for_global): New function.
3556 (Output_data_plt_x86_64::address_for_local): New function.
3557 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3558 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
3559 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
3560 (Target_x86_64::register_global_plt_entry): Add symtab and layout
3562 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
3564 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
3565 symbols if we didn't create an IRELATIVE GOT.
3566 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
3567 plt_address_for_local.
3568 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
3569 * testsuite/ifuncvar1.c: New test file.
3570 * testsuite/ifuncvar2.c: New test file.
3571 * testsuite/ifuncvar3.c: New test file.
3572 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
3573 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
3574 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
3575 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
3576 * testsuite/Makefile.in: Rebuild.
3578 2011-07-07 Cary Coutant <ccoutant@google.com>
3580 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
3581 (two_file_test_1_ndebug.o): Likewise.
3582 (two_file_test_1b_ndebug.o): Likewise.
3583 (two_file_test_2_ndebug.o): Likewise.
3584 (two_file_test_main_ndebug.o): Likewise.
3585 (incremental_test_2): Link with no-debug versions.
3587 2011-07-06 Cary Coutant <ccoutant@google.com>
3589 * gold/incremental.cc
3590 (Output_section_incremental_inputs::write_info_blocks): Check for
3591 hidden and internal symbols.
3593 2011-07-06 Cary Coutant <ccoutant@google.com>
3595 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
3596 Check disposition for startup file.
3597 (Incremental_inputs::report_command_line): Ignore
3598 --incremental-startup-unchanged option.
3599 * options.cc (General_options::parse_incremental_startup_unchanged):
3601 (General_options::General_options): Initialize new data member.
3602 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
3603 (General_options): Add --incremental-startup-unchanged option.
3604 (General_options::incremental_startup_disposition): New function.
3605 (General_options::incremental_startup_disposition_): New data member.
3607 2011-07-06 Cary Coutant <ccoutant@google.com>
3609 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
3610 input file index to Script_info ctor.
3611 (Sized_incremental_binary::do_file_has_changed): Find the
3612 command-line argument for files named in scripts.
3613 * incremental.h (Script_info::Script_info): New ctor
3614 with input file index.
3615 (Script_info::input_file_index): New function.
3616 (Script_info::input_file_index_): New data member.
3617 (Incremental_binary::get_library): Add const.
3618 (Incremental_binary::get_script_info): Add const.
3619 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
3620 * testsuite/Makefile.am (incremental_test_5): New test case.
3621 (incremental_test_6): New test case.
3622 * testsuite/Makefile.in: Regenerate.
3624 2011-07-06 Cary Coutant <ccoutant@google.com>
3626 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
3627 debug output when command lines differ.
3629 2011-07-06 Cary Coutant <ccoutant@google.com>
3631 * incremental.cc (Incremental_inputs::report_command_line): Ignore
3632 --incremental-patch option.
3633 * layout.cc (Free_list::allocate): Extend allocation beyond original
3635 (Layout::make_output_section): Mark sections that should get
3637 * options.cc (parse_percent): New function.
3638 * options.h (parse_percent): New function.
3639 (DEFINE_percent): New macro.
3640 (General_options): Add --incremental-patch option.
3641 * output.cc (Output_section::Output_section): Initialize new data
3643 (Output_section::add_input_section): Print section name when out
3645 (Output_section::add_output_section_data): Likewise.
3646 (Output_section::set_final_data_size): Add patch space when
3647 doing --incremental-full.
3648 (Output_section::do_reset_address_and_file_offset): Remove patch
3650 (Output_segment::set_section_list_addresses): Print debug output
3651 only if --incremental-update.
3652 * output.h (Output_section::set_is_patch_space_allowed): New function.
3653 (Output_section::is_patch_space_allowed_): New data member.
3654 (Output_section::patch_space_): New data member.
3655 * parameters.cc (Parameters::incremental_full): New function.
3656 * parameters.h (Parameters::incremental_full): New function
3657 * testsuite/Makefile.am (incremental_test_2): Add test for
3658 --incremental-patch option.
3659 * testsuite/Makefile.in: Regenerate.
3660 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
3661 (t18): Remove function body.
3663 2011-07-05 Doug Kwan <dougkwan@google.com>
3666 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
3667 Arm_Address type for relocation result.
3668 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
3670 (Arm_relocate_functions::abs32): Use unaligned access.
3671 (Arm_relocate_functions::rel32): Ditto.
3672 (Arm_relocate_functions::prel31): Ditto.
3673 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
3674 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
3675 static data relocations.
3676 * testsuite/Makefile.in: Regnerate.
3677 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
3679 2011-07-05 Ian Lance Taylor <iant@google.com>
3682 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
3683 symbols if necessary.
3684 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3686 2011-07-05 Ian Lance Taylor <iant@google.com>
3689 * resolve.cc (Symbol::override_base_with_special): Simply override
3690 version with special symbol version, ignoring previous version.
3692 2011-07-05 Ian Lance Taylor <iant@google.com>
3694 * object.cc (Sized_relobj_file::include_section_group): Add
3695 information to comment about signature location.
3697 2011-07-02 Ian Lance Taylor <iant@google.com>
3700 * options.h (class General_options): Add -f and -F.
3701 * options.cc (General_options::finalize): Fatal error if -f/-F
3702 are used without -shared.
3703 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
3705 2011-07-02 Ian Lance Taylor <iant@google.com>
3707 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
3709 2011-07-01 Ian Lance Taylor <iant@google.com>
3713 * resolve.cc (Symbol::override_base_with_special): Don't override
3714 the version if the overriding symbol has a different name.
3715 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
3716 all callers. If we give an error about an undefined version,
3717 define the base version if necessary.
3718 * dynobj.h (class Versions): Update declaration.
3719 * testsuite/weak_alias_test_5.cc: New file.
3720 * testsuite/weak_alias_test.script: New file.
3721 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
3722 and versioned_alias have the right value, and call t2.
3723 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
3724 weak_alias_test_5.so.
3725 (weak_alias_test_LDADD): Likewise.
3726 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
3727 * testsuite/Makefile.in: Rebuild.
3729 2011-07-01 Ian Lance Taylor <iant@google.com>
3732 * options.h (class General_options): Support -z notext.
3733 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
3735 (two_file_shared_nonpic.so): Likewise.
3736 (two_file_shared_mixed.so): Likewise.
3737 (two_file_shared_mixed_1.so): Likewise.
3738 (weak_undef_lib_nonpic.so): Likewise.
3739 (alt/weak_undef_lib_nonpic.so): Likewise.
3740 (tls_test_shared_nonpic.so): Likewise.
3741 * testsuite/Makefile.in: Rebuild.
3743 2011-07-01 Ian Lance Taylor <iant@google.com>
3746 * configure.ac: Test whether static linking works, setting
3747 the automake conditional HAVE_STATIC.
3748 * testsuite/Makefile.am: Disable tests using -static if
3749 HAVE_STATIC is not true.
3750 * configure, testsuite/Makefile.in: Rebuild.
3752 2011-07-01 Ian Lance Taylor <iant@google.com>
3755 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
3756 Assert if we see DW_EH_PE_indirect.
3757 * target.h (Target::ehframe_datarel_base): New function.
3758 (Target::do_ehframe_datarel_base): New target function.
3759 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
3760 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
3763 2011-07-01 Ian Lance Taylor <iant@google.com>
3766 * options.h (class General_options): Add
3767 --ld-generated-unwind-info.
3768 * ehframe.cc (Fde::write): Add address parameter. Change all
3769 callers. If associated with PLT, fill in address and size.
3770 (Cie::set_output_offset): Only add merge mapping if there is an
3772 (Cie::write): Add address parameter. Change all callers.
3773 (Eh_frame::add_ehframe_for_plt): New function.
3774 * ehframe.h (class Fde): Update declarations. Move shndx_ and
3775 input_offset_ fields into union u_, with new plt field.
3776 (Fde::Fde): Adjust for new union field.
3777 (Fde::Fde) [Output_data version]: New constructor.
3778 (Fde::add_mapping): Only add merge mapping if there is an object.
3779 (class Cie): Update declarations.
3780 (class Eh_frame): Declare add_ehframe_for_plt.
3781 * layout.cc (Layout::layout_eh_frame): Break out code into
3782 make_eh_frame_section, and call it.
3783 (Layout::make_eh_frame_section): New function.
3784 (Layout::add_eh_frame_for_plt): New function.
3785 * layout.h (class Layout): Update declarations.
3786 * merge.cc (Merge_map::add_mapping): Add assertion.
3787 * i386.cc: Include "dwarf.h".
3788 (class Output_data_plt_i386): Make first_plt_entry,
3789 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
3790 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3791 and plt_eh_frame_fde.
3792 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
3793 boundary. Call add_eh_frame_for_plt if appropriate.
3794 * x86_64.cc: Include "dwarf.h".
3795 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
3796 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
3797 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3798 and plt_eh_frame_fde.
3799 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
3802 2011-06-29 Ian Lance Taylor <iant@google.com>
3805 * object.cc (Sized_relobj_file::layout_section): Change shdr
3806 parameter to be const.
3807 (Sized_relobj_file::layout_eh_frame_section): New function, broken
3809 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
3810 appropriate. Call layout_eh_frame_section.
3811 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
3813 * object.h (class Sized_relobj_file): Update declarations.
3815 2011-06-29 Ian Lance Taylor <iant@google.com>
3818 * script.cc (Token::integer_value): Accept trailing M/m/K/k
3820 (Lex::gather_token): Accept trailing M/m/K/k for integers.
3822 2011-06-29 Ian Lance Taylor <iant@google.com>
3825 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
3827 * layout.cc (Layout::layout_eh_frame): Likewise.
3829 2011-06-29 Ian Lance Taylor <iant@google.com>
3832 * layout.cc (Layout::symtab_section_shndx): New function.
3833 * layout.h (class Layout): Declare symtab_section_shndx.
3834 * output.cc (Output_section::write_header): Call it.
3836 2011-06-29 Ian Lance Taylor <iant@google.com>
3839 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
3840 symbols which are not used in a relocation.
3842 2011-06-28 Ian Lance Taylor <iant@google.com>
3845 * layout.cc (Layout::segment_precedes): Don't crash if a linker
3846 script create indistinguishable segments.
3847 (Layout::set_segment_offsets): Use stable_sort when sorting
3848 segments. Pass this to Compare_segments constructor.
3849 * layout.h (class Layout): Make segment_precedes non-static.
3850 (class Compare_segments): Change from struct to class. Add
3851 layout_ field. Add constructor.
3852 * script-sections.cc
3853 (Script_sections::attach_sections_using_phdrs_clause): Rename
3854 local orphan to is_orphan. Don't report failure to put empty
3855 section in segment. On attachment failure, report name of
3856 section, and attach to first PT_LOAD segment.
3858 2011-06-28 Ian Lance Taylor <iant@google.com>
3861 * target-select.cc (Target_selector::Target_selector): Add
3862 emulation parameter. Change all callers.
3863 (select_target_by_bfd_name): Rename from select_target_by_name.
3865 (select_target_by_emulation): New function.
3866 (supported_emulation_names): New function.
3867 * target-select.h (class Target_selector): Add emulation_ field.
3868 Update declarations.
3869 (Target_selector::recognize_by_bfd_name): Rename from
3870 recognize_by_name. Change all callers.
3871 (Target_selector::supported_bfd_names): Rename from
3872 supported_names. Change all callers.
3873 (Target_selector::recognize_by_emulation): New function.
3874 (Target_selector::supported_emulations): New function.
3875 (Target_selector::emulation): New function.
3876 (Target_selector::do_recognize_by_bfd_name): Rename from
3877 do_recognize_by_name. Change all callers.
3878 (Target_selector::do_supported_bfd_names): Rename from
3879 do_supported_names. Change all callers.
3880 (Target_selector::do_recognize_by_emulation): New function.
3881 (Target_selector::do_supported_emulations): New function.
3882 (select_target_by_bfd_name): Change name in declaration.
3883 (select_target_by_emulation): Declare.
3884 (supported_emulation_names): Declare.
3885 * parameters.cc (parameters_force_valid_target): Try to find
3886 target based on emulation from -m option.
3887 * options.h (class General_options): Change doc string for -m.
3888 * options.cc (help): Print emulations.
3889 (General_options::parse_V): Likewise.
3890 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
3891 Add emulation parameter. Change all callers.
3893 2011-06-28 Ian Lance Taylor <iant@google.com>
3895 * target.h (class Target): Add osabi_ field.
3896 (Target::osabi): New function.
3897 (Target::set_osabi): New function.
3898 (Target::Target): Initialize osabi_.
3899 (Target::do_adjust_elf_header): Make pure virtual.
3900 (Sized_target::do_adjust_elf_header): Declare.
3901 * target.cc (Sized_target::do_adjust_elf_header): New function.
3902 (class Sized_target): Instantiate all versions.
3903 * freebsd.h (class Target_freebsd): Remove.
3904 (Target_selector_freebsd::do_recognize): Call set_osabi on
3906 (Target_selector_freebsd::do_recognize_by_name): Likewise.
3907 (Target_selector_freebsd::set_osabi): Remove.
3908 * i386.cc (class Target_i386): Inherit from Sized_target rather
3909 than Target_freebsd.
3910 * x86_64.cc (class Target_x86_64): Likewise.
3912 2011-06-28 Ian Lance Taylor <iant@google.com>
3914 * target.h (Target::can_check_for_function_pointers): Rewrite.
3916 (Target::can_icf_inline_merge_sections): Likewise.
3917 (Target::section_may_have_icf_unsafe_poineters): Likewise.
3918 (Target::Target_info): Add can_icf_inline_merge_sections field.
3919 (Target::do_can_check_for_function_pointers): New virtual
3921 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
3922 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
3923 from can_check_for_function_pointers, move in file.
3924 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
3925 section_may_have_icf_unsafe_poineters, move in file.
3926 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
3927 * i386.cc (Target_i386::do_can_check_for_function_pointers):
3928 Rename from can_check_for_function_pointers, move in file.
3929 (Target_i386::can_icf_inline_merge_sections): Remove.
3930 (Target_i386::i386_info): Initialize
3931 can_icf_inline_merge_sections.
3932 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
3933 Initialize can_icf_inline_merge_sections.
3934 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
3935 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
3936 Rename from can_check_for_function_pointers, move in file.
3937 (Target_x86_64::can_icf_inline_merge_sections): Remove.
3938 (Target_x86_64::x86_64_info): Initialize
3939 can_icf_inline_merge_sections.
3940 * testsuite/testfile.cc (Target_test::test_target_info):
3942 * icf.cc (get_section_contents): Correct formatting.
3944 2011-06-27 Ian Lance Taylor <iant@google.com>
3946 * symtab.cc (Symbol::versioned_name): New function.
3947 (Symbol_table::add_to_final_symtab): Use versioned_name when
3949 (Symbol_table::sized_write_symbol): Likewise.
3950 * symtab.h (class Symbol): Declare versioned_name.
3951 * stringpool.h (class Stringpool_template): Add variant of add
3952 which takes a std::basic_string.
3953 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
3954 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
3955 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
3956 (ver_test_12.o): New target.
3957 * testsuite/Makefile.in: Rebuild.
3959 2011-06-27 Doug Kwan <dougkwan@google.com>
3961 * arm.cc (Arm_relocate_functions::thm_jump8,
3962 Arm_relocate_functions::thm_jump11): Use a wider signed
3963 type to compute offset.
3964 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
3966 * testsuite/Makefile.in: Regenerate.
3967 * testsuite/arm_branch_in_range.sh: Check test results of
3968 arm_thm_jump11 and arm_thm_jump8.
3969 * testsuite/arm_thm_jump11.s: New test source file.
3970 * testsuite/arm_thm_jump11.t: New linker script.
3971 * testsuite/arm_thm_jump8.s: New test source file.
3972 * testsuite/arm_thm_jump8.t: New linker script.
3974 2011-06-24 Ian Lance Taylor <iant@google.com>
3976 * layout.cc: Include "object.h".
3977 (ctors_sections_in_init_array): New static variable.
3978 (Layout::is_ctors_in_init_array): New function.
3979 (Layout::layout): Add entry to ctors_sections_in_init_array if
3981 * layout.h (class Layout): Declare is_ctors_in_init_array.
3982 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
3983 is_ctors_reverse_view is set.
3984 (Sized_relobj_file::write_sections): Add layout parameter. Change
3985 all callers. Set is_ctors_reverse_view field of View_size.
3986 (Sized_relobj_file::reverse_words): New function.
3987 * object.h (Sized_relobj_file::View_size): Add
3988 is_ctors_reverse_view field.
3989 (class Sized_relobj_file): Update declarations.
3990 * testsuite/initpri3.c: New test.
3991 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
3993 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
3994 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
3995 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
3996 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
3997 * testsuite/Makefile.in: Rebuild.
3999 2011-06-24 Cary Coutant <ccoutant@google.com>
4001 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
4002 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
4003 (debug_msg_cdebug.err): New targets.
4004 * testsuite/Makefile.in: Regenerate.
4005 * testsuite/debug_msg.sh: Check output of link with compressed debug.
4006 Fix checks for link with shared library.
4008 2011-06-24 Doug Kwan <dougkwan@google.com>
4010 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
4011 skip empty text sections.
4012 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
4014 2011-06-22 Ian Lance Taylor <iant@google.com>
4017 * options.h (class General_options): Add --ctors-in-init-array.
4018 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
4019 friends as SHT_PROGBITS for merging sections.
4020 (Layout::layout): Remove special handling of .init_array and
4021 friends. Don't sort if doing relocatable link. Sort for .ctors
4022 and .dtors if ctors_in_init_array.
4023 (Layout::make_output_section): Force correct section types for
4024 .init_array and friends. Don't sort if doing relocatable link,
4025 Don't sort .ctors and .dtors if ctors_in_init_array.
4026 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
4027 (Layout::output_section_name): Add relobj parameter. Change all
4028 callers. Handle .ctors. and .dtors. in code rather than table.
4029 Handle .ctors and .dtors if ctors_in_init_array.
4030 (Layout::match_file_name): New function, moved from output.cc.
4031 * layout.h (class Layout): Update declarations.
4032 * output.cc: Include "layout.h".
4033 (Input_section_sort_entry::get_priority): New function.
4034 (Input_section_sort_entry::match_file_name): Just call
4035 Layout::match_file_name.
4036 (Output_section::Input_section_sort_init_fini_compare::operator()):
4037 Handle .ctors and .dtors. Sort by explicit priority rather than
4039 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
4040 * testsuite/initpri2.c: New test.
4041 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
4042 (check_PROGRAMS): Add initpri2.
4043 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
4044 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
4045 * configure, testsuite/Makefile.in: Rebuild.
4047 2011-06-19 Ian Lance Taylor <iant@google.com>
4050 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
4051 .interp section to a PT_INTERP segment even if we have seen a
4052 --dynamic-linker option. Don't do it if we have seen a PHDRS
4053 clause in a linker script.
4054 (Layout::finalize): Don't create a .interp section if we've
4055 already create a PT_INTERP segment.
4056 (Layout::create_interp): Always call choose_output_section (revert
4057 patch of 2011-06-17). Don't create PT_INTERP segment.
4058 * script-sections.cc
4059 (Script_sections::create_note_and_tls_segments): Add a .interp
4060 section to a PT_INTERP segment even if we have seen a
4061 --dynamic-linker option.
4063 2011-06-18 Ian Lance Taylor <iant@google.com>
4065 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
4066 merely because a non-PT_LOAD segment has a dynamic reloc.
4068 2011-06-18 Ian Lance Taylor <iant@google.com>
4070 * layout.cc (Layout::finish_dynamic_section): Don't create
4071 DT_FLAGS entry if not needed.
4073 2011-06-18 Ian Lance Taylor <iant@google.com>
4076 * layout.cc (Layout::layout_eh_frame): Correct handling of
4077 writable .eh_frame section.
4079 2011-06-17 Ian Lance Taylor <iant@google.com>
4082 * resolve.cc (Symbol_table::resolve): Don't give an error if a
4083 symbol is redefined with the exact same object and value.
4085 2011-06-17 Ian Lance Taylor <iant@google.com>
4088 * layout.h (class Layout): Add interp_segment_ field.
4089 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
4090 (Layout::attach_allocated_section_to_segment): If making shared
4091 library, put .interp section in PT_INTERP segment.
4092 (Layout::finalize): Also call create_interp if -dynamic-linker
4094 (Layout::create_interp): Assert that there is no PT_INTERP
4095 segment. If not using a SECTIONS clause, use make_output_section.
4096 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
4097 * script-sections.cc
4098 (Script_sections::create_note_and_tls_segments): If making shared
4099 library, put .interp section in PT_INTERP segment.
4101 2011-06-17 Ian Lance Taylor <iant@google.com>
4103 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
4104 when making a shared library.
4106 2011-06-17 Ian Lance Taylor <iant@google.com>
4108 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
4109 parameter. Change all callers. Don't issue warning about PC32
4110 against locally defined symbol.
4112 2011-06-16 Ian Lance Taylor <iant@google.com>
4114 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
4115 occurs in same object.
4117 2011-06-14 Alan Modra <amodra@gmail.com>
4119 * po/POTFILES.in: Regenerate.
4121 2011-06-09 Ian Lance Taylor <iant@google.com>
4123 * script-sections.cc
4124 (Orphan_output_section::set_section_addresses): For a relocatable
4125 link set address to 0.
4127 2011-06-09 Cary Coutant <ccoutant@google.com>
4130 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
4131 used with --compress-debug-sections.
4132 * gold/object.cc (Sized_relobj_file::do_layout): Report
4133 uncompressed size of compressed input sections.
4135 2011-06-08 Cary Coutant <ccoutant@google.com>
4138 * testsuite/two_file_test_2_v1.cc: Change initialization of
4139 v2 to keep it in .data.
4141 2011-06-07 Cary Coutant <ccoutant@google.com>
4143 * common.cc (Symbol_table::do_allocate_commons_list): Call
4145 * errors.cc (Errors::fatal): Adjust call to gold_exit.
4146 (Errors::fallback): New function.
4147 (gold_fallback): New function.
4148 * errors.h (Errors::fallback): New function.
4149 * gold.cc (gold_exit): Change status parameter to enum; adjust
4151 (queue_initial_tasks): Call gold_fallback.
4152 * gold.h: Include cstdlib.
4153 (Exit_status): New enum type.
4154 (gold_exit): Change status parameter to enum.
4155 (gold_fallback): New function.
4156 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
4157 (Layout::create_symtab_sections): Likewise.
4158 (Layout::create_shdrs): Likewise.
4159 * main.cc (main): Adjust call to gold_exit.
4160 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
4161 (Output_data_got::add_got_entry_pair): Likewise.
4162 (Output_section::add_input_section): Likewise.
4163 (Output_section::add_output_section_data): Likewise.
4164 (Output_segment::set_section_list_addresses): Likewise.
4165 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
4167 2011-06-07 Cary Coutant <ccoutant@google.com>
4169 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
4170 for incremental links.
4171 * output.cc (Output_segment::set_section_list_addresses): Remove
4172 FIXME and test for TLS or BSS.
4174 2011-06-07 Cary Coutant <ccoutant@google.com>
4176 * testsuite/Makefile.am: Add incremental_copy_test,
4177 incremental_common_test_1.
4178 * testsuite/Makefile.in: Regenerate.
4179 * testsuite/common_test_1_v1.c: New source file.
4180 * testsuite/common_test_1_v2.c: New source file.
4181 * testsuite/copy_test_v1.cc: New source file.
4183 2011-06-07 Cary Coutant <ccoutant@google.com>
4185 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
4186 update, allocate common from bss section's free list.
4187 * incremental-dump.cc (dump_incremental_inputs): Print flag for
4188 linker-defined symbols.
4189 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4190 Skip GOT and PLT entries that are no longer referenced.
4191 (Output_section_incremental_inputs::write_info_blocks): Mark
4192 linker-defined symbols.
4193 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
4194 * output.cc (Output_section::allocate): New function.
4195 * output.h (Output_section::allocate): New function.
4196 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
4197 linker-defined symbols.
4198 (Symbol::override_base_with_special): Copy is_predefined_ flag.
4199 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
4200 (Symbol::init_base_output_data): Likewise.
4201 (Symbol::init_base_output_segment): Likewise.
4202 (Symbol::init_base_constant): Likewise.
4203 (Sized_symbol::init_output_data): Likewise.
4204 (Sized_symbol::init_output_segment): Likewise.
4205 (Sized_symbol::init_constant): Likewise.
4206 (Symbol_table::do_define_in_output_data): Likewise.
4207 (Symbol_table::do_define_in_output_segment): Likewise.
4208 (Symbol_table::do_define_as_constant): Likewise.
4209 * symtab.h (Symbol::is_predefined): New function.
4210 (Symbol::init_base_output_data): Add is_predefined parameter.
4211 (Symbol::init_base_output_segment): Likewise.
4212 (Symbol::init_base_constant): Likewise.
4213 (Symbol::is_predefined_): New data member.
4214 (Sized_symbol::init_output_data): Add is_predefined parameter.
4215 (Sized_symbol::init_output_segment): Likewise.
4216 (Sized_symbol::init_constant): Likewise.
4217 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
4219 2011-06-07 Cary Coutant <ccoutant@google.com>
4221 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
4222 instead of emit_copy_reloc.
4223 (Copy_relocs::emit_copy_reloc): Refactor.
4224 (Copy_relocs::make_copy_reloc): New function.
4225 (Copy_relocs::add_copy_reloc): Remove.
4226 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
4228 (Copy_relocs::make_copy_reloc): New function.
4229 (Copy_relocs::add_copy_reloc): Remove.
4230 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
4231 unchanged input files.
4232 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
4233 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
4234 Reserve BSS space for COPY relocations.
4235 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4236 (Output_section_incremental_inputs::write_info_blocks): Record
4237 whether a symbol is copied from a shared object.
4238 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
4239 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
4240 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
4241 (Incremental_input_entry_reader::get_output_symbol_index): Add
4243 (Incremental_binary::emit_copy_relocs): New function.
4244 (Incremental_binary::do_emit_copy_relocs): New function.
4245 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4247 (Sized_incremental_binary::add_copy_reloc): New function.
4248 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4249 (Sized_incremental_binary::Copy_reloc): New struct.
4250 (Sized_incremental_binary::Copy_relocs): New typedef.
4251 (Sized_incremental_binary::copy_relocs_): New data member.
4252 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
4253 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
4254 * target.h (Sized_target::emit_copy_reloc): New function.
4255 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
4257 2011-06-02 Cary Coutant <ccoutant@google.com>
4260 * gold/archive.cc (Archive::Archive): Initialize new data member.
4261 (Archive::include_all_members): Return if archive has already been
4263 * gold/archive.h (Archive::include_all_members_): New data member.
4265 2011-06-02 Nick Clifton <nickc@redhat.com>
4267 * dynobj.h: Fix spelling mistake in comment.
4268 * output.cc: Likewise.
4270 2011-05-31 Doug Kwan <dougkwan@google.com>
4274 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
4275 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
4276 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
4277 redundant arm_exidx_test.so.
4278 * testsuite/Makefile.in: Regenerate.
4279 (check_SCRIPTS): Add pr12826.sh
4280 (check_DATA): Add pr12826.stdout
4281 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
4282 * testsuite/pr12826.sh: New file.
4283 * testsuite/pr12826_1.s: Ditto.
4284 * testsuite/pr12826_1.s: Ditto.
4286 2011-05-30 Ian Lance Taylor <iant@google.com>
4288 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
4291 2011-05-29 Ian Lance Taylor <iant@google.com>
4294 * testsuite/Makefile.am: Use different file name for two_file_test
4295 temporary file for each incremental test.
4296 * testsuite/Makefile.in: Rebuild.
4298 2011-05-29 Ian Lance Taylor <iant@google.com>
4300 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
4301 binary input file is empty.
4303 2011-05-27 Ian Lance Taylor <iant@google.com>
4305 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
4306 (ver_test_9.so): Likewise.
4307 * testsuite/Makefile.in: Rebuild.
4309 2011-05-26 Cary Coutant <ccoutant@google.com>
4311 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
4312 * incremental.cc (Incremental_inputs::report_input_section): Fix
4313 comment, indentation.
4314 (Incremental_inputs::report_comdat_group): New function.
4315 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4316 of data for incremental input file entry.
4317 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
4318 group count, COMDAT group signatures.
4319 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
4320 an unchanged input file.
4321 * incremental.h (Incremental_object_entry::Incremental_object_entry):
4322 Initialize new data member.
4323 (Incremental_object_entry::add_comdat_group): New function.
4324 (Incremental_object_entry::get_comdat_group_count): New function.
4325 (Incremental_object_entry::get_comdat_signature_key): New function.
4326 (Incremental_object_entry::groups_): New data member.
4327 (Incremental_inputs::report_comdat_group): New function.
4328 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
4329 data for incremental input file entry.
4330 (Incremental_input_entry_reader::get_comdat_group_count): New function.
4331 (Incremental_input_entry_reader::get_input_section): Adjust size of
4332 data for incremental input file entry.
4333 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
4334 (Incremental_input_entry_reader::get_comdat_group_signature): New
4336 * object.cc (Sized_relobj::include_section_group): Report kept
4337 COMDAT groups for incremental links.
4339 2011-05-24 David Meyer <pdox@google.com>
4341 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
4342 with name parameter. Add found_name parameter.
4343 * fileread.cc (Input_file::find_file): Adjust code accordingly.
4344 * dirsearch.h (class Dirsearch): Update declaration.
4346 2011-05-24 Ian Lance Taylor <iant@google.com>
4348 * archive.cc (Library_base::should_include_member): Pull in object
4349 from archive if it defines the entry symbol.
4350 * parameters.cc (Parameters::entry): New function.
4351 * parameters.h (class Parameters): Declare entry.
4352 * output.h (class Output_file_header): Remove entry_ field.
4353 * output.cc (Output_file_header::Output_file_header): Remove entry
4354 parameter. Change all callers.
4355 (Output_file_header::entry): Use parameters->entry.
4356 * gold.cc (queue_middle_tasks): Likewise.
4357 * plugin.cc (Plugin_hook::run): Likewise.
4359 2011-05-24 Cary Coutant <ccoutant@google.com>
4361 * gold.cc (queue_initial_tasks): Pass incremental base filename
4362 to Output_file::open_base_file; don't print error message.
4363 * incremental-dump.cc (main): Adjust call to
4364 Output_file::open_for_modification.
4365 * incremental-dump.cc (main): Likewise.
4366 * incremental.cc (Incremental_inputs::report_command_line):
4367 Ignore --incremental-base option when comparing command lines.
4368 Ignore parameter when given as separate argument.
4369 * options.h (class General_options): Add --incremental-base.
4370 * output.cc (Output_file::Output_file):
4371 (Output_file::open_base_file): Add base_name and writable parameters;
4372 read base file into new file; print error message here.
4373 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4375 * output.h (Output_file::open_for_modification): Rename to...
4376 (Output_file::open_base_file): ...this; add base_name and
4377 writable parameters; adjust all callers.
4378 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4380 * testsuite/Makefile.am (incremental_test_4): Test
4382 * testsuite/Makefile.in: Regenerate.
4384 2011-05-24 Cary Coutant <ccoutant@google.com>
4386 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
4388 * testsuite/Makefile.in: Regenerate.
4389 * testsuite/two_file_test_1_v1.cc: New test source file.
4390 * testsuite/two_file_test_1b_v1.cc: New test source file.
4391 * testsuite/two_file_test_2_v1.cc: New test source file.
4393 2011-05-24 Cary Coutant <ccoutant@google.com>
4395 * dynobj.h (Dynobj::do_dynobj): New function.
4396 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
4397 flag and soname for shared objects.
4398 * incremental.cc (Incremental_inputs::report_object): Make
4399 either Incremental_object_entry or Incremental_dynobj_entry; add
4400 soname to string table.
4401 (Incremental_inputs::report_input_section): Add assertion.
4402 (Output_section_incremental_inputs::set_final_data_size): Adjust
4403 type of input file entry for shared libraries; adjust size of
4404 shared library info entry.
4405 (Output_section_incremental_inputs::write_input_files): Write
4406 as_needed flag for shared libraries.
4407 (Output_section_incremental_inputs::write_info_blocks): Adjust type
4408 of input file entry for shared libraries; write soname.
4409 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
4410 soname from incremental info.
4411 * incremental.h (enum Incremental_input_flags): Add
4412 INCREMENTAL_INPUT_AS_NEEDED.
4413 (Incremental_input_entry::Incremental_input_entry): Initialize new
4415 (Incremental_input_entry::set_as_needed): New function.
4416 (Incremental_input_entry::as_needed): New function.
4417 (Incremental_input_entry::do_dynobj_entry): New function.
4418 (Incremental_input_entry::as_needed_): New data member.
4419 (Incremental_object_entry::Incremental_object_entry): Don't check
4421 (Incremental_object_entry::do_type): Likewise.
4422 (class Incremental_dynobj_entry): New class.
4423 (Incremental_input_entry_reader::as_needed): New function.
4424 (Incremental_input_entry_reader::get_soname): New function.
4425 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
4426 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
4427 size of shared library info entry.
4428 * layout.cc (Layout::finish_dynamic_section): Don't test for
4429 incremental link when adding DT_NEEDED entries.
4430 * object.h (Object::Object): Initialize new data member.
4431 (Object::dynobj): New function.
4432 (Object::set_as_needed): New function.
4433 (Object::as_needed): New function.
4434 (Object::do_dynobj): New function.
4435 (Object::as_needed_): New data member.
4437 2011-05-24 Cary Coutant <ccoutant@google.com>
4439 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
4440 info; adjust display of GOT entries.
4441 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4442 vector of input objects; remove file_status_.
4443 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
4444 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
4445 got_plt reader; call target hooks to reserve GOT entries.
4446 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4447 of input file info header and GOT info entry.
4448 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
4450 (Got_plt_view_info::got_descriptor): Remove.
4451 (Got_plt_view_info::sym_index): New data member.
4452 (Got_plt_view_info::input_index): New data member.
4453 (Local_got_offset_visitor::visit): Write input file index.
4454 (Global_got_offset_visitor::visit): Write 0 for input file index.
4455 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
4456 with sym_index and input_index.
4457 (Output_section_incremental_inputs::write_got_plt): Adjust size of
4458 incremental info GOT entry; replace got_descriptor with input_index.
4459 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
4460 map from input file index to object.
4461 (Sized_relobj_incr::do_layout): Replace direct data member reference
4462 with accessor function.
4463 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
4464 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
4465 Adjust size of input file info header.
4466 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
4467 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
4468 (Incremental_input_entry_reader::get_input_section): Adjust size of
4469 input file info header.
4470 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
4471 of incremental info GOT entry.
4472 (Incremental_got_plt_reader::get_got_desc): Remove.
4473 (Incremental_got_plt_reader::get_got_symndx): New function.
4474 (Incremental_got_plt_reader::get_got_input_index): New function.
4475 (Sized_incremental_binary::Sized_incremental_binary): Remove
4476 file_status_; add input_objects_.
4477 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
4478 (Sized_incremental_binary::set_file_is_unchanged): Remove.
4479 (Sized_incremental_binary::file_is_unchanged): Remove.
4480 (Sized_incremental_binary::set_input_object): New function.
4481 (Sized_incremental_binary::input_object): New function.
4482 (Sized_incremental_binary::file_status_): Remove.
4483 (Sized_incremental_binary::input_objects_): New data member.
4484 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
4486 (Sized_relobj_incr::invalid_address): Move to base class.
4487 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
4489 (Sized_relobj_incr::do_output_section_offset): Likewise.
4490 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
4491 (Sized_relobj_incr::section_offsets_): Likewise.
4492 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
4494 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
4495 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
4496 with accessor function.
4497 (Sized_relobj_file::do_layout): Likewise.
4498 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
4499 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
4500 (Sized_relobj_file::compute_final_local_value): Replace refs to
4501 section_offsets_ with accessor function.
4502 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
4503 * object.h (Relobj::Relobj): Initialize new data members.
4504 (Relobj::add_dyn_reloc): New function.
4505 (Relobj::first_dyn_reloc): New function.
4506 (Relobj::dyn_reloc_count): New function.
4507 (Relobj::first_dyn_reloc_): New data member.
4508 (Relobj::dyn_reloc_count_): New data member.
4509 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
4511 (Sized_relobj::Address): New typedef.
4512 (Sized_relobj::invalid_address): Move here from child class.
4513 (Sized_relobj::Sized_relobj): Initialize new data members.
4514 (Sized_relobj::sized_relobj): New function.
4515 (Sized_relobj::is_output_section_offset_invalid): Move here from
4517 (Sized_relobj::get_output_section_offset): Likewise.
4518 (Sized_relobj::local_has_got_offset): Likewise.
4519 (Sized_relobj::local_got_offset): Likewise.
4520 (Sized_relobj::set_local_got_offset): Likewise.
4521 (Sized_relobj::do_for_all_local_got_entries): Likewise.
4522 (Sized_relobj::clear_got_offsets): New function.
4523 (Sized_relobj::section_offsets): Move here from child class.
4524 (Sized_relobj::do_output_section_offset): Likewise.
4525 (Sized_relobj::do_set_section_offset): Likewise.
4526 (Sized_relobj::Local_got_offsets): Likewise.
4527 (Sized_relobj::local_got_offsets_): Likewise.
4528 (Sized_relobj::section_offsets_): Likewise.
4529 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
4531 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
4533 (Sized_relobj_file::sized_relobj): New function
4534 (Sized_relobj_file::local_has_got_offset): Move to base class.
4535 (Sized_relobj_file::local_got_offset): Likewise.
4536 (Sized_relobj_file::set_local_got_offset): Likewise.
4537 (Sized_relobj_file::get_output_section_offset): Likewise.
4538 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
4539 (Sized_relobj_file::do_output_section_offset): Likewise.
4540 (Sized_relobj_file::do_set_section_offset): Likewise.
4541 (Sized_relobj_file::Local_got_offsets): Likewise.
4542 (Sized_relobj_file::local_got_offsets_): Likewise.
4543 (Sized_relobj_file::section_offsets_): Likewise.
4544 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
4546 (set_needs_dynsym_index): Convert relobj to derived class pointer.
4547 (Output_reloc::get_symbol_index): Likewise.
4548 (Output_reloc::local_section_offset): Likewise.
4549 (Output_reloc::get_address): Likewise.
4550 (Output_reloc::symbol_value): Likewise.
4551 (Output_data_got::reserve_slot): Move to class definition.
4552 (Output_data_got::reserve_local): New function.
4553 (Output_data_got::reserve_slot_for_global): Remove.
4554 (Output_data_got::reserve_global): New function.
4555 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
4556 (all constructors, two instantiations).
4557 (Output_reloc::get_relobj): New function (two instantiations).
4558 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
4559 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
4560 (Output_data_reloc::add_global): Adjust type of relobj.
4561 (Output_data_reloc::add_global_relative): Likewise.
4562 (Output_data_reloc::add_symbolless_global_addend): Likewise.
4563 (Output_data_reloc::add_local): Likewise.
4564 (Output_data_reloc::add_local_relative): Likewise.
4565 (Output_data_reloc::add_symbolless_local_addend): Likewise.
4566 (Output_data_reloc::add_local_section): Likewise.
4567 (Output_data_reloc::add_output_section): Likewise.
4568 (Output_data_reloc::add_absolute): Likewise.
4569 (Output_data_reloc::add_target_specific): Likewise.
4570 (Output_data_got::reserve_slot): Move definition here.
4571 (Output_data_got::reserve_local): New function.
4572 (Output_data_got::reserve_global): New function.
4573 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
4574 section_offsets_ with accessor function.
4575 (Sized_relobj_file::write_sections): Likewise.
4576 (Sized_relobj_file::do_relocate_sections): Likewise.
4577 * target.h (Sized_target::reserve_local_got_entry): New function.
4578 (Sized_target::reserve_global_got_entry): New function.
4579 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
4580 (Target_x86_64::reserve_global_got_entry): New function.
4581 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
4583 2011-05-23 Cary Coutant <ccoutant@google.com>
4585 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
4586 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
4587 bit when checking got_type.
4588 * incremental.cc (Sized_incremental_binary::setup_readers):
4589 Store symbol table and string table locations; initialize bit vector
4590 of file status flags.
4591 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
4593 (Sized_incremental_binary::do_process_got_plt): New function.
4594 (Sized_incremental_binary::get_symtab_view): Use stored locations.
4595 (Output_section_incremental_inputs::set_final_data_size): Record
4596 file index for each input file.
4597 (Output_section_incremental_inputs::write_got_plt): Store file index
4598 instead of input entry offset for each GOT entry.
4600 (Incremental_input_entry::Incremental_input_entry): Initialize new
4602 (Incremental_input_entry::set_offset): Store file index.
4603 (Incremental_input_entry::get_file_index): New function.
4604 (Incremental_input_entry::file_index_): New data member.
4605 (Incremental_binary::process_got_plt): New function.
4606 (Incremental_binary::do_process_got_plt): New function.
4607 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4609 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
4610 (Sized_incremental_binary::set_file_is_unchanged): New function.
4611 (Sized_incremental_binary::file_is_unchanged): New function.
4612 (Sized_incremental_binary::do_process_got_plt): New function.
4613 (Sized_incremental_binary::file_status_): New data member.
4614 (Sized_incremental_binary::main_symtab_loc_): New data member.
4615 (Sized_incremental_binary::main_strtab_loc_): New data member.
4616 * output.cc (Output_data_got::Got_entry::write): Add case
4618 (Output_data_got::add_global): Call add_got_entry.
4619 (Output_data_got::add_global_plt): Likewise.
4620 (Output_data_got::add_global_with_rel): Likewise.
4621 (Output_data_got::add_global_with_rela): Likewise.
4622 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
4623 (Output_data_got::add_global_pair_with_rela): Likewise.
4624 (Output_data_got::add_local): Call add_got_entry.
4625 (Output_data_got::add_local_plt): Likewise.
4626 (Output_data_got::add_local_with_rel): Likewise.
4627 (Output_data_got::add_local_with_rela): Likewise.
4628 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
4629 (Output_data_got::add_local_pair_with_rela): Likewise.
4630 (Output_data_got::reserve_slot): New function.
4631 (Output_data_got::reserve_slot_for_global): New function.
4632 (Output_data_got::add_got_entry): New function.
4633 (Output_data_got::add_got_entry_pair): New function.
4634 (Output_section::add_output_section_data): Edit FIXME.
4636 (Output_section_data_build::Output_section_data_build): New
4637 constructor with size parameter.
4638 (Output_data_space::Output_data_space): Likewise.
4639 (Output_data_got::Output_data_got): Initialize new data member; new
4640 constructor with size parameter.
4641 (Output_data_got::add_constant): Call add_got_entry.
4642 (Output_data_got::reserve_slot): New function.
4643 (Output_data_got::reserve_slot_for_global): New function.
4644 (class Output_data_got::Got_entry): Add RESERVED_CODE.
4645 (Output_data_got::add_got_entry): New function.
4646 (Output_data_got::add_got_entry_pair): New function.
4647 (Output_data_got::free_list_): New data member.
4648 * target.h (Sized_target::init_got_plt_for_update): New function.
4649 (Sized_target::register_global_plt_entry): New function.
4650 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4651 Initialize new data member; call init; add constructor with PLT count.
4652 (Output_data_plt_x86_64::init): New function.
4653 (Output_data_plt_x86_64::add_relocation): New function.
4654 (Output_data_plt_x86_64::reserve_slot): New function.
4655 (Output_data_plt_x86_64::free_list_): New data member.
4656 (Target_x86_64::init_got_plt_for_update): New function.
4657 (Target_x86_64::register_global_plt_entry): New function.
4658 (Output_data_plt_x86_64::add_entry): Allocate from free list for
4659 incremental updates.
4660 (Output_data_plt_x86_64::add_relocation): New function.
4661 * testsuite/object_unittest.cc (Object_test): Set default options.
4663 2011-05-16 Ian Lance Taylor <iant@google.com>
4665 * options.h (class General_options): Make -i a synonym for -r.
4667 2011-05-16 Ian Lance Taylor <iant@google.com>
4669 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
4671 2011-05-10 Cary Coutant <ccoutant@google.com>
4673 * object.cc (Sized_relobj::do_count_local_symbols): Check for
4676 2011-05-06 Ian Lance Taylor <iant@google.com>
4678 * layout.cc (Layout::layout): If the output section flags change,
4679 update the ordering.
4681 2011-04-25 Cary Coutant <ccoutant@google.com>
4683 * incremental-dump.cc (dump_incremental_inputs): Print local
4684 symbol info for each input file.
4686 (Output_section_incremental_inputs::set_final_data_size): Add local
4687 symbol info to input file entries in incremental info.
4688 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4689 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
4690 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
4691 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
4693 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
4694 (Sized_incr_relobj::do_relocate): Write the local symbols.
4695 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
4696 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
4697 Adjust size of input file header.
4698 (Incremental_inputs_reader::get_local_symbol_offset): New function.
4699 (Incremental_inputs_reader::get_local_symbol_count): New function.
4700 (Incremental_inputs_reader::get_input_section): Adjust size of input
4702 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
4703 (Sized_incr_relobj::This): New typedef.
4704 (Sized_incr_relobj::sym_size): New const data member.
4705 (Sized_incr_relobj::Local_symbol): New struct.
4706 (Sized_incr_relobj::do_output_local_symbol_count): New function.
4707 (Sized_incr_relobj::do_local_symbol_offset): New function.
4708 (Sized_incr_relobj::local_symbol_count_): New data member.
4709 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
4710 (Sized_incr_relobj::local_symbol_index_): New data member.
4711 (Sized_incr_relobj::local_symbol_offset_): New data member.
4712 (Sized_incr_relobj::local_dynsym_offset_): New data member.
4713 (Sized_incr_relobj::local_symbols_): New data member.
4714 * object.h (Relobj::output_local_symbol_count): New function.
4715 (Relobj::local_symbol_offset): New function.
4716 (Relobj::do_output_local_symbol_count): New function.
4717 (Relobj::do_local_symbol_offset): New function.
4718 (Sized_relobj::do_output_local_symbol_count): New function.
4719 (Sized_relobj::do_local_symbol_offset): New function.
4721 2011-04-22 Vladimir Simonov <sv@sw.ru>
4723 * descriptors.cc (set_close_on_exec): New function.
4724 (Descriptors::open): Use set_close_on_exec.
4725 * output.cc (S_ISLNK): Define if not defined.
4727 2011-04-22 Cary Coutant <ccoutant@google.com>
4729 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4731 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4732 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
4733 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
4735 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
4736 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
4737 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
4739 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
4741 (Incremental_binary::apply_incremental_relocs): New function.
4742 (Incremental_binary::do_apply_incremental_relocs): New function.
4743 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4745 (Sized_incremental_binary::add_global_symbol): New function.
4746 (Sized_incremental_binary::global_symbol): New function.
4747 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4748 (Sized_incremental_binary::symbol_map_): New data member.
4749 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
4750 * target.h (Sized_target::apply_relocation): New function.
4751 * target-reloc.h (apply_relocation): New function.
4752 * x86_64.cc (Target_x86_64::apply_relocation): New function.
4754 2011-04-22 Doug Kwan <dougkwan@google.com>
4756 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
4757 flag of a SHT_ARM_EXIDX section.
4758 * testsuite/Makefile.am (arm_exidx_test): New test rules.
4759 * testsuite/Makefile.in: Regenerate.
4760 * testsuite/arm_exidx_test.s: New file.
4761 * testsuite/arm_exidx_test.sh: Same.
4763 2011-04-20 Cary Coutant <ccoutant@google.com>
4766 * archive.h (Incremental_archive_entry::Archive_member):
4767 Initialize arg_serial_ (second constructor).
4769 2011-04-17 Ian Lance Taylor <iant@google.com>
4771 * object.cc (Relocate_info::location): Simplify location string.
4772 * errors.cc (Errors::error_at_location): Don't print program
4774 (Errors::warning_at_location): Likewise.
4775 (Errors::undefined_symbol): Likewise.
4776 * testsuite/debug_msg.sh: Update accordingly.
4778 2011-04-14 Cary Coutant <ccoutant@google.com>
4780 * gold/layout.cc (Layout::symtab_section_offset): New function.
4781 * gold/layout.h (Layout::symtab_section_offset): New function.
4782 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
4784 2011-04-12 Ian Lance Taylor <iant@google.com>
4786 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
4787 with MREMAP_MAYMOVE.
4788 * output.h (class Output_file): Add map_is_allocated_ field.
4789 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
4790 not available, provide stubs. If mremap is not available, #define
4792 (MREMAP_MAYMOVE): Define if not defined.
4793 (Output_file::Output_file): Initialize map_is_allocated_.
4794 (Output_file::resize): Check map_is_allocated_.
4795 (Output_file::map_anonymous): If mmap fails, use malloc.
4796 (Output_file::unmap): Don't do anything for an anonymous map.
4797 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
4798 is not available, provide stubs.
4799 (File_read::View::~View): Use free rather than delete[].
4800 (File_read::make_view): Use malloc rather than new[]. If mmap
4802 (File_read::find_or_make_view): Use malloc rather than new[].
4803 * gold.h: Remove HAVE_REMAP code.
4804 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
4805 exists. Rename mremap to gold_mremap. If mmap is not available
4807 * configure, config.in: Rebuild.
4809 2011-04-11 Ian Lance Taylor <iant@google.com>
4811 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
4812 initialize local variable v.
4814 2011-04-11 Cary Coutant <ccoutant@google.com>
4816 * archive.cc (Archive::include_member): Adjust call to
4818 (Add_archive_symbols::run): Track argument serial numbers.
4819 (Lib_group::include_member): Likewise.
4820 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
4821 * archive.h (Incremental_archive_entry::Archive_member):
4822 Initialize arg_serial_.
4823 (Archive_member::arg_serial_): New data member.
4824 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
4825 (Sized_dynobj::do_add_symbols): Track symbols when doing an
4827 (Sized_dynobj::do_for_all_local_got_entries): New function.
4828 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
4830 * fileread.cc (get_mtime): New function.
4831 * fileread.h (get_mtime): New function.
4832 * gold.cc (queue_initial_tasks): Check for incremental update.
4833 (process_incremental_input): New function.
4834 (queue_middle_tasks): Don't force valid target for incremental
4836 * incremental-dump.cc (find_input_containing_global): Adjust
4837 size of symbol info entry.
4838 (dump_incremental_inputs): Dump argument serial number and
4839 in_system_directory flag; bias shndx by 1; print symbol names
4840 when dumping per-file symbol lists; use new symbol info readers.
4842 (Output_section_incremental_inputs:update_data_size): New function.
4843 (Sized_incremental_binary::setup_readers): Setup input readers
4844 for each input file; build maps for files added from libraries
4846 (Sized_incremental_binary::check_input_args): New function.
4847 (Sized_incremental_binary::do_check_inputs): Build map of argument
4848 serial numbers to input arguments.
4849 (Sized_incremental_binary::do_file_has_changed): Rename
4850 do_file_is_unchanged to this; compare file modification times.
4851 (Sized_incremental_binary::do_init_layout): New function.
4852 (Sized_incremental_binary::do_reserve_layout): New function.
4853 (Sized_incremental_binary::do_get_input_reader): Remove.
4854 (Sized_incremental_binary::get_symtab_view): New function.
4855 (Incremental_checker::can_incrementally_link_output_file): Remove.
4856 (Incremental_inputs::report_command_line): Exclude --debug options.
4857 (Incremental_inputs::report_archive_begin): Add parameter; track
4858 argument serial numbers; don't put input file entry for archive
4859 before archive members.
4860 (Incremental_inputs::report_archive_end): Put input file entry
4861 for archive after archive members.
4862 (Incremental_inputs::report_object): Add parameter; track argument
4863 serial numbers and in_system_directory flag.
4864 (Incremental_inputs::report_script): Add parameter; track argument
4866 (Output_section_incremental_inputs::set_final_data_size): Adjust
4867 size of symbol info entry; check for forwarding symbols.
4868 (Output_section_incremental_inputs::write_input_files): Write
4869 in_system_directory flag and argument serial number.
4870 (Output_section_incremental_inputs::write_info_blocks): Map section
4871 indices between incremental info and original input file; store
4872 input section index for each symbol.
4873 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
4874 change operator() to visit().
4875 (class Global_got_offset_visitor): Likewise.
4876 (class Global_symbol_visitor_got_plt):
4877 (Output_section_incremental_inputs::write_got_plt): Use new visitor
4879 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
4880 (Sized_incr_relobj::do_read_symbols): New function.
4881 (Sized_incr_relobj::do_layout): New function.
4882 (Sized_incr_relobj::do_layout_deferred_sections): New function.
4883 (Sized_incr_relobj::do_add_symbols): New function.
4884 (Sized_incr_relobj::do_should_include_member): New function.
4885 (Sized_incr_relobj::do_for_all_global_symbols): New function.
4886 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
4887 (Sized_incr_relobj::do_section_size): New function.
4888 (Sized_incr_relobj::do_section_name): New function.
4889 (Sized_incr_relobj::do_section_contents): New function.
4890 (Sized_incr_relobj::do_section_flags): New function.
4891 (Sized_incr_relobj::do_section_entsize): New function.
4892 (Sized_incr_relobj::do_section_address): New function.
4893 (Sized_incr_relobj::do_section_type): New function.
4894 (Sized_incr_relobj::do_section_link): New function.
4895 (Sized_incr_relobj::do_section_info): New function.
4896 (Sized_incr_relobj::do_section_addralign): New function.
4897 (Sized_incr_relobj::do_initialize_xindex): New function.
4898 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
4899 (Sized_incr_relobj::do_read_relocs): New function.
4900 (Sized_incr_relobj::do_gc_process_relocs): New function.
4901 (Sized_incr_relobj::do_scan_relocs): New function.
4902 (Sized_incr_relobj::do_count_local_symbols): New function.
4903 (Sized_incr_relobj::do_finalize_local_symbols): New function.
4904 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
4905 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
4906 (Sized_incr_relobj::do_relocate): New function.
4907 (Sized_incr_relobj::do_set_section_offset): New function.
4908 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
4909 (Sized_incr_dynobj::do_read_symbols): New function.
4910 (Sized_incr_dynobj::do_layout): New function.
4911 (Sized_incr_dynobj::do_add_symbols): New function.
4912 (Sized_incr_dynobj::do_should_include_member): New function.
4913 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
4914 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
4915 (Sized_incr_dynobj::do_section_size): New function.
4916 (Sized_incr_dynobj::do_section_name): New function.
4917 (Sized_incr_dynobj::do_section_contents): New function.
4918 (Sized_incr_dynobj::do_section_flags): New function.
4919 (Sized_incr_dynobj::do_section_entsize): New function.
4920 (Sized_incr_dynobj::do_section_address): New function.
4921 (Sized_incr_dynobj::do_section_type): New function.
4922 (Sized_incr_dynobj::do_section_link): New function.
4923 (Sized_incr_dynobj::do_section_info): New function.
4924 (Sized_incr_dynobj::do_section_addralign): New function.
4925 (Sized_incr_dynobj::do_initialize_xindex): New function.
4926 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
4927 (make_sized_incremental_object): New function.
4928 (Incremental_library::copy_unused_symbols): New function.
4929 (Incremental_library::do_for_all_unused_symbols): New function.
4930 * incremental.h (enum Incremental_input_flags): New type.
4931 (class Incremental_checker): Remove.
4932 (Incremental_input_entry::Incremental_input_entry): Add argument
4934 (Incremental_input_entry::arg_serial): New function.
4935 (Incremental_input_entry::set_is_in_system_directory): New function.
4936 (Incremental_input_entry::is_in_system_directory): New function.
4937 (Incremental_input_entry::arg_serial_): New data member.
4938 (Incremental_input_entry::is_in_system_directory_): New data member.
4939 (class Script_info): Move here from script.h.
4940 (Script_info::Script_info): Add filename parameter.
4941 (Script_info::filename): New function.
4942 (Script_info::filename_): New data member.
4943 (Incremental_script_entry::Incremental_script_entry): Add argument
4945 (Incremental_object_entry::Incremental_object_entry): Likewise.
4946 (Incremental_object_entry::add_input_section): Build list of input
4947 sections with map to original shndx.
4948 (Incremental_object_entry::get_input_section_index): New function.
4949 (Incremental_object_entry::shndx_): New data member.
4950 (Incremental_object_entry::name_key_): Rename; adjust all refs.
4951 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
4952 (Incremental_archive_entry::Incremental_archive_entry): Add argument
4954 (Incremental_inputs::report_archive_begin): Likewise.
4955 (Incremental_inputs::report_object): Likewise.
4956 (Incremental_inputs::report_script): Likewise.
4957 (class Incremental_global_symbol_reader): New class.
4958 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
4959 and store flags and input file type.
4960 (Incremental_input_entry_reader::arg_serial): New function.
4961 (Incremental_input_entry_reader::type): Extract type from flags.
4962 (Incremental_input_entry_reader::is_in_system_directory): New function.
4963 (Incremental_input_entry_reader::get_input_section_count): Call
4964 accessor function for type.
4965 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
4966 function for type; adjust size of global symbol entry.
4967 (Incremental_input_entry_reader::get_global_symbol_count): Call
4968 accessor function for type.
4969 (Incremental_input_entry_reader::get_object_count): Likewise.
4970 (Incremental_input_entry_reader::get_object_offset): Likewise.
4971 (Incremental_input_entry_reader::get_member_count): Likewise.
4972 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
4973 (Incremental_input_entry_reader::get_member_offset): Likewise.
4974 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
4975 (Incremental_input_entry_reader::Global_symbol_info): Remove.
4976 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
4977 (Incremental_input_entry_reader::get_global_symbol_reader): New
4979 (Incremental_input_entry_reader::get_output_symbol_index): New
4981 (Incremental_input_entry_reader::type_): Remove.
4982 (Incremental_input_entry_reader::flags_): New data member.
4983 (Incremental_inputs_reader::input_file_offset): New function.
4984 (Incremental_inputs_reader::input_file_index): New function.
4985 (Incremental_inputs_reader::input_file): Call input_file_offset.
4986 (Incremental_inputs_reader::input_file_at_offset): New function.
4987 (Incremental_relocs_reader::get_r_type): Reformat.
4988 (Incremental_relocs_reader::get_r_shndx): Reformat.
4989 (Incremental_relocs_reader::get_r_offset): Reformat.
4990 (Incremental_relocs_reader::data): New function.
4991 (Incremental_binary::Incremental_binary): Initialize new data members.
4992 (Incremental_binary::check_inputs): Add cmdline parameter.
4993 (Incremental_binary::file_is_unchanged): Remove.
4994 (Input_reader::arg_serial): New function.
4995 (Input_reader::get_unused_symbol_count): New function.
4996 (Input_reader::get_unused_symbol): New function.
4997 (Input_reader::do_arg_serial): New function.
4998 (Input_reader::do_get_unused_symbol_count): New function.
4999 (Input_reader::do_get_unused_symbol): New function.
5000 (Incremental_binary::input_file_count): New function.
5001 (Incremental_binary::get_input_reader): Change signature to use
5002 index instead of filename.
5003 (Incremental_binary::file_has_changed): New function.
5004 (Incremental_binary::get_input_argument): New function.
5005 (Incremental_binary::get_library): New function.
5006 (Incremental_binary::get_script_info): New function.
5007 (Incremental_binary::init_layout): New function.
5008 (Incremental_binary::reserve_layout): New function.
5009 (Incremental_binary::output_file): New function.
5010 (Incremental_binary::do_check_inputs): New function.
5011 (Incremental_binary::do_file_is_unchanged): Remove.
5012 (Incremental_binary::do_file_has_changed): New function.
5013 (Incremental_binary::do_init_layout): New function.
5014 (Incremental_binary::do_reserve_layout): New function.
5015 (Incremental_binary::do_input_file_count): New function.
5016 (Incremental_binary::do_get_input_reader): Change signature.
5017 (Incremental_binary::input_args_map_): New data member.
5018 (Incremental_binary::library_map_): New data member.
5019 (Incremental_binary::script_map_): New data member.
5020 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5022 (Sized_incremental_binary::output_section): New function.
5023 (Sized_incremental_binary::inputs_reader): Add const.
5024 (Sized_incremental_binary::symtab_reader): Add const.
5025 (Sized_incremental_binary::relocs_reader): Add const.
5026 (Sized_incremental_binary::got_plt_reader): Add const.
5027 (Sized_incremental_binary::get_symtab_view): New function.
5028 (Sized_incremental_binary::Inputs_reader): New typedef.
5029 (Sized_incremental_binary::Input_entry_reader): New typedef.
5030 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
5031 (Sized_incremental_binary::do_file_is_unchanged): Remove.
5032 (Sized_incremental_binary::do_file_has_changed): New function.
5033 (Sized_incremental_binary::do_init_layout): New function.
5034 (Sized_incremental_binary::do_reserve_layout): New function.
5035 (Sized_input_reader::Inputs_reader): Remove.
5036 (Sized_input_reader::Input_entry_reader): Remove.
5037 (Sized_input_reader::do_arg_serial): New function.
5038 (Sized_input_reader::do_get_unused_symbol_count): New function.
5039 (Sized_input_reader::do_get_unused_symbol): New function.
5040 (Sized_incremental_binary::do_input_file_count): New function.
5041 (Sized_incremental_binary::do_get_input_reader): Change signature;
5042 use index instead of filename.
5043 (Sized_incremental_binary::section_map_): New data member.
5044 (Sized_incremental_binary::input_entry_readers_): New data member.
5045 (class Sized_incr_relobj): New class.
5046 (class Sized_incr_dynobj): New class.
5047 (make_sized_incremental_object): New function.
5048 (class Incremental_library): New class.
5049 * layout.cc (Free_list::num_lists): New static data member.
5050 (Free_list::num_nodes): New static data member.
5051 (Free_list::num_removes): New static data member.
5052 (Free_list::num_remove_visits): New static data member.
5053 (Free_list::num_allocates): New static data member.
5054 (Free_list::num_allocate_visits): New static data member.
5055 (Free_list::init): New function.
5056 (Free_list::remove): New function.
5057 (Free_list::allocate): New function.
5058 (Free_list::dump): New function.
5059 (Free_list::print_stats): New function.
5060 (Layout_task_runner::run): Resize output file for incremental updates.
5061 (Layout::Layout): Initialize new data members.
5062 (Layout::set_incremental_base): New function.
5063 (Layout::init_fixed_output_section): New function.
5064 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
5065 incremental updates.
5066 (Layout::create_gold_note): Do not create gold note section for
5067 incremental updates.
5068 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
5069 for incremental updates.
5070 (Layout::set_section_offsets): For incremental updates, allocate space
5072 (Layout::create_symtab_sections): Layout with offsets relative to
5073 start of section; for incremental updates, allocate space from free
5075 (Layout::create_shdrs): For incremental updates, allocate space from
5077 (Layout::finish_dynamic_section): For incremental updates, do not
5078 check --as-needed (fixed in subsequent patch).
5079 * layout.h (class Free_list): New class.
5080 (Layout::set_incremental_base): New function.
5081 (Layout::incremental_base): New function.
5082 (Layout::init_fixed_output_section): New function.
5083 (Layout::allocate): New function.
5084 (Layout::incremental_base_): New data member.
5085 (Layout::free_list_): New data member.
5086 * main.cc (main): Print Free_list statistics.
5087 * object.cc (Relobj::finalize_incremental_relocs): Add
5088 clear_counts parameter; clear counts only when clear_counts is set.
5089 (Sized_relobj::Sized_relobj): Initialize new base class.
5090 (Sized_relobj::do_layout): Don't report special sections.
5091 (Sized_relobj::do_for_all_local_got_entries): New function.
5092 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
5093 symtab_off to all symbol table offsets.
5094 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
5095 * object.h (class Got_offset_list): Move to top of file.
5096 (Object::Object): Allow case where input_file == NULL.
5097 (Object::~Object): Likewise.
5098 (Object::input_file): Assert that input_file != NULL.
5099 (Object::lock): Allow case where input_file == NULL.
5100 (Object::unlock): Likewise.
5101 (Object::is_locked): Likewise.
5102 (Object::token): Likewise.
5103 (Object::release): Likewise.
5104 (Object::is_incremental): New function.
5105 (Object::get_mtime): New function.
5106 (Object::for_all_local_got_entries): New function.
5107 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
5108 (Object::set_is_in_system_directory): New function.
5109 (Object::is_in_system_directory): New function.
5110 (Object::do_is_incremental): New function.
5111 (Object::do_get_mtime): New function.
5112 (Object::do_for_all_local_got_entries): New function.
5113 (Object::is_in_system_directory_): New data member.
5114 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
5115 (class Sized_relobj_base): New class.
5116 (class Sized_relobj): Derive from Sized_relobj_base.
5117 (class Sized_relobj::Symbols): Redeclare from base class.
5118 (class Sized_relobj::local_got_offset_list): Remove.
5119 (class Sized_relobj::Output_sections): Redeclare from base class.
5120 (class Sized_relobj::do_for_all_local_got_entries): New function.
5121 (class Sized_relobj::write_local_symbols): Add offset parameter.
5122 (class Sized_relobj::local_symbol_offset_): Update comment.
5123 (class Sized_relobj::local_dynsym_offset_): Update comment.
5124 * options.cc (Input_arguments::add_file): Remove const.
5125 * options.h (Input_file_argument::Input_file_argument):
5126 Initialize arg_serial_ (all constructors).
5127 (Input_file_argument::set_arg_serial): New function.
5128 (Input_file_argument::arg_serial): New function.
5129 (Input_file_argument::arg_serial_): New data member.
5130 (Input_arguments::Input_arguments): Initialize file_count_.
5131 (Input_arguments::add_file): Remove const.
5132 (Input_arguments::number_of_input_files): New function.
5133 (Input_arguments::file_count_): New data member.
5134 (Command_line::number_of_input_files): Call
5135 Input_arguments::number_of_input_files.
5136 * output.cc (Output_segment_headers::Output_segment_headers):
5138 (Output_section::Input_section::current_data_size): New function.
5139 (Output_section::Output_section): Initialize new data members.
5140 (Output_section::add_input_section): Don't do merge sections for
5141 an incremental link; allocate space from free list for an
5143 (Output_section::add_output_section_data): Allocate space from
5144 free list for an incremental update.
5145 (Output_section::update_data_size): New function.
5146 (Output_section::set_fixed_layout): New function.
5147 (Output_section::reserve): New function.
5148 (Output_segment::set_section_addresses): Remove const.
5149 (Output_segment::set_section_list_addresses): Remove const; allocate
5150 space from free list for an incremental update.
5151 (Output_segment::set_offset): Adjust size of RELRO segment for an
5153 * output.h (Output_data::current_data_size): Move here from
5155 (Output_data::pre_finalize_data_size): New function.
5156 (Output_data::update_data_size): New function.
5157 (Output_section_headers::update_data_size): new function.
5158 (Output_section_data_build::current_data_size): Move to Output_data.
5159 (Output_data_strtab::update_data_size): New function.
5160 (Output_section::current_data_size): Move to Output_data.
5161 (Output_section::set_fixed_layout): New function.
5162 (Output_section::has_fixed_layout): New function.
5163 (Output_section::reserve): New function.
5164 (Output_section::update_data_size): New function.
5165 (Output_section::has_fixed_layout_): New data member.
5166 (Output_section::free_list_): New data member.
5167 (Output_segment::set_section_addresses): Remove const.
5168 (Output_segment::set_section_list_addresses): Remove const.
5169 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
5171 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
5173 * readsyms.cc (Read_symbols::do_read_symbols): Add library
5174 parameter when calling Add_symbols constructor; store argument
5175 serial number for members of a lib group.
5176 (Add_symbols::locks): Allow case where token == NULL.
5177 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
5178 (Read_member::~Read_member): New function.
5179 (Read_member::is_runnable): New function.
5180 (Read_member::locks): New function.
5181 (Read_member::run): New function.
5182 (Check_script::~Check_script): New function.
5183 (Check_script::is_runnable): New function.
5184 (Check_script::locks): New function.
5185 (Check_script::run): New function.
5186 (Check_library::~Check_library): New function.
5187 (Check_library::is_runnable): New function.
5188 (Check_library::locks): New function.
5189 (Check_library::run): New function.
5190 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
5191 (Add_symbols::library_): New data member.
5192 (class Read_member): New class.
5193 (class Check_script): New class.
5194 (class Check_library): New class.
5195 * reloc.cc (Read_relocs::is_runnable): Allow case where
5197 (Read_relocs::locks): Likewise.
5198 (Scan_relocs::locks): Likewise.
5199 (Relocate_task::locks): Likewise.
5200 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
5202 (Sized_relobj::incremental_relocs_scan): Fix comment.
5203 (Sized_relobj::do_relocate): Pass output file offset to
5204 write_local_symbols.
5205 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
5206 from class declaration.
5207 * script.cc (read_input_script): Allocate Script_info; pass
5208 argument serial number to report_script.
5209 * script.h (class Script_info): Move to incremental.h.
5210 * symtab.cc (Symbol_table::add_from_incrobj): New function.
5211 * symtab.h (Symbol_table::add_from_incrobj): New function.
5212 (Symbol_table::set_file_offset): New function.
5214 2011-04-05 Cary Coutant <ccoutant@google.com>
5216 * incremental-dump.cc (dump_incremental_inputs): Change signature
5217 to take a Sized_incremental_binary; change caller. Use readers
5218 in Sized_incremental_binary.
5220 (Sized_incremental_binary::find_incremental_inputs_sections):
5221 Rename do_find_incremental_inputs_sections to this.
5222 (Sized_incremental_binary::setup_readers): New function.
5223 (Sized_incremental_binary::do_check_inputs): Check
5224 has_incremental_info_ flag; move setup code to setup_readers;
5226 (Sized_incremental_binary::do_file_is_unchanged): New function.
5227 (Sized_incremental_binary::do_get_input_reader): New function.
5228 * incremental.h (class Incremental_binary): Move to end of file.
5229 (Incremental_binary::file_is_unchanged): New function.
5230 (Incremental_binary::do_file_is_unchanged): New function.
5231 (Incremental_binary::Input_reader): New class.
5232 (Incremental_binary::get_input_reader): New function.
5233 (class Sized_incremental_binary): Move to end of file.
5234 (Sized_incremental_binary::Sized_incremental_binary): Setup the
5235 input section reader classes.
5236 (Sized_incremental_binary::has_incremental_info): New function.
5237 (Sized_incremental_binary::inputs_reader): New function.
5238 (Sized_incremental_binary::symtab_reader): New function.
5239 (Sized_incremental_binary::relocs_reader): New function.
5240 (Sized_incremental_binary::got_plt_reader): New function.
5241 (Sized_incremental_binary::do_file_is_unchanged): New function.
5242 (Sized_incremental_binary::Sized_input_reader): New class.
5243 (Sized_incremental_binary::get_input_reader): New function.
5244 (Sized_incremental_binary::find_incremental_inputs_sections):
5245 Rename do_find_incremental_inputs_sections to this.
5246 (Sized_incremental_binary::setup_readers): New function.
5247 (Sized_incremental_binary::has_incremental_info_): New data member.
5248 (Sized_incremental_binary::inputs_reader_): New data member.
5249 (Sized_incremental_binary::symtab_reader_): New data member.
5250 (Sized_incremental_binary::relocs_reader_): New data member.
5251 (Sized_incremental_binary::got_plt_reader_): New data member.
5252 (Sized_incremental_binary::current_input_file_): New data member.
5254 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
5257 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
5260 2011-03-30 Cary Coutant <ccoutant@google.com>
5262 * archive.cc (Archive::include_member): Adjust call to report_object.
5263 (Add_archive_symbols::run): Add script_info to call to
5264 report_archive_begin.
5265 (Lib_group::include_member): Adjust call to report_object.
5266 (Add_lib_group_symbols::run): Adjust call to report_object.
5267 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
5268 blocks. Add object count for script input files.
5269 * incremental.cc (Incremental_inputs::report_archive_begin): Add
5270 script_info parameter; change all callers.
5271 (Incremental_inputs::report_object): Add script_info parameter;
5273 (Incremental_inputs::report_script): Store backpointer to
5274 incremental info entry.
5275 (Output_section_incremental_inputs::set_final_data_size): Record
5276 additional information for scripts.
5277 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5278 * incremental.h (Incremental_script_entry::add_object): New function.
5279 (Incremental_script_entry::get_object_count): New function.
5280 (Incremental_script_entry::get_object): New function.
5281 (Incremental_script_entry::objects_): New data member; adjust
5283 (Incremental_inputs::report_archive_begin): Add script_info parameter.
5284 (Incremental_inputs::report_object): Add script_info parameter.
5285 (Incremental_inputs_reader::get_object_count): New function.
5286 (Incremental_inputs_reader::get_object_offset): New function.
5287 * options.cc (Input_arguments::add_file): Return reference to
5289 * options.h (Input_argument::set_script_info): New function.
5290 (Input_argument::script_info): New function.
5291 (Input_argument::script_info_): New data member; adjust all
5293 (Input_file_group::add_file): Return reference to new input argument.
5294 (Input_file_lib::add_file): Likewise.
5295 (Input_arguments::add_file): Likewise.
5296 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
5297 * script.cc (Parser_closure::Parser_closure): Add script_info
5298 parameter; adjust all callers.
5299 (Parser_closure::script_info): New function.
5300 (Parser_closure::script_info_): New data member.
5301 (read_input_script): Report scripts earlier to incremental info.
5302 (script_add_file): Set script_info in Input_argument.
5303 (script_add_library): Likewise.
5304 * script.h (Script_options::Script_info): Rewrite class.
5306 2011-03-29 Cary Coutant <ccoutant@google.com>
5308 * archive.cc (Library_base::should_include_member): Move
5309 method here from class Archive.
5310 (Archive::Archive): Initialize base class.
5311 (Archive::should_include_member): Move to base class.
5312 (Archive::do_for_all_unused_symbols): New function.
5313 (Add_archive_symbols::run): Remove redundant access to
5315 (Lib_group::Lib_group): Initialize base class.
5316 (Lib_group::do_filename): New function.
5317 (Lib_group::include_member): Pass pointer to Lib_group to
5319 (Lib_group::do_for_all_unused_symbols): New function.
5320 (Add_lib_group_symbols::run): Report archive information for
5322 * archive.h (class Library_base): New base class.
5323 (class Archive): Derive from Library_base.
5324 (Archive::filename): Move to base class.
5325 (Archive::set_incremental_info): Likewise.
5326 (Archive::incremental_info): Likewise.
5327 (Archive::Should_include): Likewise.
5328 (Archive::should_include_member): Likewise.
5329 (Archive::Armap_entry): Remove.
5330 (Archive::Unused_symbol_iterator): Remove.
5331 (Archive::unused_symbols_begin): Remove.
5332 (Archive::unused_symbols_end): Remove.
5333 (Archive::do_filename): New function.
5334 (Archive::do_get_mtime): New function.
5335 (Archive::do_for_all_unused_symbols): New function.
5336 (Archive::task_): Move to base class.
5337 (Archive::incremental_info_): Likewise.
5338 (class Lib_group): Derive from Library_base.
5339 (Lib_group::do_filename): New function.
5340 (Lib_group::do_get_mtime): New function.
5341 (Lib_group::do_for_all_unused_symbols): New function.
5342 (Lib_group::task_): Move to base class.
5343 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
5345 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
5347 * incremental.cc (Incremental_inputs::report_archive_begin):
5348 Use Library_base; call library's get_mtime; add incremental inputs
5349 entry before members.
5350 (class Unused_symbol_visitor): New class.
5351 (Incremental_inputs::report_archive_end): Use Library_base; use
5352 visitor class to record unused symbols; don't add incremental inputs
5353 entry after members.
5354 (Incremental_inputs::report_object): Use Library_base.
5356 (Incremental_archive_entry::Incremental_archive_entry): Remove
5357 unused Archive parameter.
5358 (Incremental_inputs::report_archive_begin): Use Library_base.
5359 (Incremental_inputs::report_archive_end): Likewise.
5360 (Incremental_inputs::report_object): Likewise.
5361 * object.cc (Sized_relobj::do_for_all_global_symbols): New
5363 * object.h (Object::for_all_global_symbols): New function.
5364 (Object::do_for_all_global_symbols): New function.
5365 (Sized_relobj::do_for_all_global_symbols): New function.
5366 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
5368 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
5371 2011-03-27 Ian Lance Taylor <iant@google.com>
5373 * archive.cc (Archive::interpret_header): Return -1 if something
5374 goes wrong. Change callers accordingly.
5376 2011-03-25 Cary Coutant <ccoutant@google.com>
5378 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
5379 * testsuite/Makefile.in: Regenerate.
5381 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
5383 * plugin.cc (get_view): New.
5384 (Plugin::load): Pass get_view to the plugin.
5385 (Plugin_manager::get_view): New.
5387 2011-03-21 Ian Lance Taylor <iant@google.com>
5389 * testsuite/final_layout.sh: Rewrite to not use dc.
5390 * testsuite/relro_test.sh: Fail if dc is not present.
5392 2011-03-21 Sriraman Tallam <tmsriram@google.com>
5394 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
5396 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
5397 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
5399 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
5400 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
5402 2011-03-14 Ian Lance Taylor <iant@google.com>
5404 * script-sections.cc (Sort_output_sections::script_compare):
5405 Rename from is_before, change return type.
5406 (Sort_output_sections::operator()): Adjust accordingly.
5408 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
5411 * testsuite/odr_violation2.cc: Add comment to make all error line
5412 numbers double digits.
5413 * testsuite/debug_msg.sh: Adjust expected errors.
5415 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
5417 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
5418 but mark earlier ones as non-canonical
5419 (offset_to_iterator): Update search target and example
5420 (do_addr2line): Return extra lines in a vector*
5421 (format_file_lineno): Extract from do_addr2line
5422 (one_addr2line): Add vector* out-param
5423 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
5424 when a lineno entry appeared last for its instruction
5425 (Dwarf_line_info): Add vector* out-param
5426 * object.cc (Relocate_info): Pass NULL for the vector* out-param
5427 * symtab.cc (Odr_violation_compare): Include the lineno in the
5429 (linenos_from_loc): New. Combine the canonical line for an
5430 address with its other lines.
5431 (True_if_intersect): New. Helper functor to make
5432 std::set_intersection a query.
5433 (detect_odr_violations): Compare sets of lines instead of just
5434 one line for each function. This became less deterministic, but
5435 has fewer false positives.
5436 * symtab.h: Declarations.
5437 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
5438 mix an optimized and non-optimized object in the same binary
5439 (odr_violation2.so): Same.
5440 * testsuite/Makefile.in: Regenerate from Makefile.am.
5441 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
5442 * testsuite/debug_msg.sh: Update line numbers and add
5444 * testsuite/odr_violation1.cc: Use OdrDerived, in a
5445 non-optimized context.
5446 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
5447 isn't inlined, and use OdrDerived in an optimized context.
5448 * testsuite/odr_header1.h: Defines OdrDerived, where
5449 optimization will change the
5450 first-instruction-in-the-destructor's file and line number.
5451 * testsuite/odr_header2.h: Defines OdrBase.
5453 2011-03-09 Ian Lance Taylor <iant@google.com>
5455 * fileread.cc (File_read::clear_views): Don't delete the whole
5458 2011-03-08 Ian Lance Taylor <iant@google.com>
5461 * fileread.cc: #include <climits>.
5462 (GOLD_IOV_MAX): Define.
5463 (File_read::read_multiple): Limit number of entries by iov_max.
5464 * fileread.h (class File_read): Always set max_readv_entries to
5467 2011-03-07 Ian Lance Taylor <iant@google.com>
5470 * options.h (class General_options): Add -dy and -dn.
5472 2011-03-02 Cary Coutant <ccoutant@google.com>
5474 * testsuite/script_test_9.t: Add TLS segment.
5476 2011-03-02 Simon Baldwin <simonb@google.com>
5478 * configure.ac: Add check for gnu_indirect_function support in
5479 the toolchain building binutils.
5480 * configure: Rebuild.
5482 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
5484 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
5485 plugin only symbols.
5486 (Symbol_table::sized_finalize_symbol) Mark symbol only present
5487 in plugin files as not needed in the symbol table.
5489 2011-02-11 Sriraman Tallam <tmsriram@google.com>
5491 * output.cc (Output_section::add_input_section): Delay fill
5492 generation for section ordering.
5494 2011-02-09 Ian Lance Taylor <iant@google.com>
5497 * object.h (class Sized_relobj): Remove clear_local_symbols.
5498 * reloc.cc (Sized_relobj::do_relocate): Don't call
5499 clear_local_symbols.
5501 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
5503 * plugin.cc (is_visible_from_outside): Return true for symbols
5506 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
5508 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
5511 2011-02-02 Sriraman Tallam <tmsriram@google.com>
5513 * icf.h (is_section_foldable_candidate): Change type of parameter
5515 * icf.cc (Icf::find_identical_sections): Change type of local variable
5516 section_name to be std::string.
5517 (is_function_ctor_or_dtor): Change type of parameter to std::string.
5519 2011-01-25 Ian Lance Taylor <iant@google.com>
5521 * script.cc (script_add_extern): Rewrite to use
5522 add_symbol_reference.
5524 2011-01-25 Doug Kwan <dougkwan@google.com>
5526 * icf.cc (get_section_contents): Always lock section's object.
5528 2011-01-24 Ian Lance Taylor <iant@google.com>
5530 * options.h (class General_options): Accept
5531 --no-detect-odr-violations.
5533 2011-01-24 Ian Lance Taylor <iant@google.com>
5535 * version.cc (version_string): Bump to 1.11.
5537 2011-01-24 Ian Lance Taylor <iant@google.com>
5539 * plugin.cc (class Plugin_rescan): Define new class.
5540 (Plugin_manager::claim_file): Set any_claimed_.
5541 (Plugin_manager::save_archive): New function.
5542 (Plugin_manager::save_input_group): New function.
5543 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
5545 (Plugin_manager::new_undefined_symbol): New function.
5546 (Plugin_manager::rescan): New function.
5547 (Plugin_manager::rescannable_defines): New function.
5548 (Plugin_manager::add_input_file): Set any_added_.
5549 * plugin.h (class Plugin_manager): define new fields rescannable_,
5550 undefined_symbols_, any_claimed_, and any_added_. Declare
5551 Plugin_rescan as friend. Declare new functions.
5552 (Plugin_manager::Rescannable): Define type.
5553 (Plugin_manager::Rescannable_list): Define type.
5554 (Plugin_manager::Undefined_symbol_list): Define type.
5555 (Plugin_manager::Plugin_manager): Initialize new fields.
5556 * archive.cc (Archive::defines_symbol): New function.
5557 (Add_archive_symbols::run): Pass archive to plugins if any.
5558 * archive.h (class Archive): Declare defines_symbol.
5559 * readsyms.cc (Input_group::~Input_group): New function.
5560 (Finish_group::run): Pass input_group to plugins if any.
5561 * readsyms.h (class Input_group): Declare destructor.
5562 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
5565 2011-01-10 Ian Lance Taylor <iant@google.com>
5567 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
5569 (Layout::set_segment_offsets): Reset increase_relro before calling
5570 set_section_addresses a second time.
5572 2011-01-04 Cary Coutant <ccoutant@google.com>
5574 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
5575 sections before NOBITS sections.
5577 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
5579 * version.cc (print_version): Update copyright to 2011.
5581 2010-12-23 Cary Coutant <ccoutant@google.com>
5583 * output.h (Output_data_reloc::add_output_section): Pass OD instead
5584 of OS to this->add. Add OD parameter to second form of the function.
5586 2010-12-20 Ian Lance Taylor <iant@google.com>
5588 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
5589 second of two consecutive entries with same offset.
5591 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5593 * testsuite/Makefile.am (ifuncmain2static_LDADD)
5594 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
5595 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
5596 to avoid unneeded links against $(LDADD).
5597 * testsuite/Makefile.in: Regenerate.
5599 2010-12-15 Ian Lance Taylor <iant@google.com>
5602 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
5603 for R_X86_64_32 and R_X86_64_PC32.
5604 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
5605 ver_matching_def_pic.o.
5606 (ver_matching_def_pic.o): New target.
5608 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5610 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
5611 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
5612 Move definition before File_read::View member definitions.
5613 (File_read::View::~View): Initialize and hold lock before
5614 updating current_mapped_bytes.
5616 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5618 * dwarf_reader.cc: Remove outdated comment.
5619 * gold-threads.cc: Fix typo in error message.
5620 * archive.cc: Fix typos in comments.
5621 * archive.h: Likewise.
5622 * arm-reloc-property.cc: Likewise.
5623 * arm-reloc-property.h: Likewise.
5624 * arm-reloc.def: Likewise.
5626 * attributes.h: Likewise.
5627 * cref.cc: Likewise.
5628 * ehframe.cc: Likewise.
5629 * fileread.h: Likewise.
5631 * i386.cc: Likewise.
5633 * incremental.h: Likewise.
5634 * int_encoding.cc: Likewise.
5635 * layout.h: Likewise.
5636 * main.cc: Likewise.
5637 * merge.h: Likewise.
5638 * object.cc: Likewise.
5639 * object.h: Likewise.
5640 * options.cc: Likewise.
5641 * readsyms.cc: Likewise.
5642 * reduced_debug_output.cc: Likewise.
5643 * reloc.cc: Likewise.
5644 * script-sections.cc: Likewise.
5645 * sparc.cc: Likewise.
5646 * symtab.h: Likewise.
5647 * target-reloc.h: Likewise.
5648 * target.cc: Likewise.
5649 * target.h: Likewise.
5650 * timer.cc: Likewise.
5651 * timer.h: Likewise.
5652 * x86_64.cc: Likewise.
5654 2010-12-09 Cary Coutant <ccoutant@google.com>
5656 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
5658 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
5659 parameter; change all callers.
5660 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
5661 * options.h (warn_execstack): New option.
5663 2010-12-07 Doug Kwan <dougkwan@google.com>
5665 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
5666 like function call relocations.
5668 2010-12-07 Ian Lance Taylor <iant@google.com>
5670 * archive.cc (Archive::get_elf_object_for_member): Permit
5671 punconfigured to be NULL.
5672 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
5673 (Archive::include_member): Pass NULL to get_elf_object_for_member
5674 if we searched for the archive and this is the first included
5677 2010-12-01 Ian Lance Taylor <iant@google.com>
5679 * dwarf_reader.h (class Sized_dwarf_line_info): Add
5680 track_relocs_type_ field.
5681 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5682 Set track_relocs_type_.
5683 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
5684 contents when using RELA relocs.
5685 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
5687 * reloc.cc (Track_relocs::next_addend): New function.
5688 * reloc.h (class Track_relocs): Declare next_addend.
5690 2010-12-01 Ian Lance Taylor <iant@google.com>
5692 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
5695 2010-12-01 Ian Lance Taylor <iant@google.com>
5697 * README: Update compilers known to work and fail.
5699 2010-11-23 Matthias Klose <doko@ubuntu.com>
5701 * configure.in: For --enable-gold, handle value `default' instead of
5702 `both*'. Always install ld as ld.bfd, install as ld if gold is
5704 * configure: Regenerate.
5706 2010-11-18 Doug Kwan <dougkwan@google.com>
5708 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
5709 and right_alignment to be zero. Store result alignment only if it is
5710 greater than existing alignment.
5712 2010-11-16 Cary Coutant <ccoutant@google.com>
5715 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5716 Check for ".zdebug_line".
5718 2010-11-16 Doug Kwan <dougkwan@google.com>
5719 Cary Coutant <ccoutant@google.com>
5721 * output.h (Output_segment::set_section_addresses): Pass increase_relro
5722 by reference; adjust all callers.
5723 * output.cc (Output_segment::set_section_addresses): Adjust references
5724 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
5726 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
5727 end at page boundary.
5729 2010-11-16 Cary Coutant <ccoutant@google.com>
5732 * layout.cc (Layout::choose_output_section): Transform names of
5733 compressed sections even when using a script with a SECTIONS clause.
5734 (Layout::output_section_name): Remove code to transform
5735 compressed debug section names.
5736 * output.cc (Output_section::add_input_section): Use uncompressed
5737 section size when tracking input sections.
5739 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
5741 * symtab.h (Symbol::NON_PIC_REF): Remove.
5742 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
5743 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
5744 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
5745 (Symbol::use_plt_offset): Take a flags argument and pass it
5746 directly to needs_dynamic_reloc. Restrict check for undefined
5747 weak symbols to function calls.
5748 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
5749 (Target_arm::Scan::global): Use it.
5750 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
5751 (Target_arm::Relocate::relocate): Likewise.
5752 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
5753 parameter with an r_type parameter. Use get_reference_flags
5755 (Target_arm::Relocate::relocate): Update accordingly.
5756 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
5757 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
5758 (Target_i386::Scan::global): Likewise.
5759 (Target_i386::Relocate::relocate): Likewise.
5760 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
5761 parameter with an r_type parameter. Use get_reference_flags
5763 (Target_i386::Relocate::relocate): Update accordingly.
5764 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
5765 (Target_powerpc::Scan::global): Use it.
5766 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
5767 (Target_powerpc::Relocate::relocate): Likewise.
5768 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
5769 (Target_sparc::Scan::global): Use it.
5770 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
5771 (Target_sparc::Relocate::relocate): Likewise.
5772 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
5773 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
5774 (Target_x86_64::Scan::global): Likewise.
5775 (Target_x86_64::Relocate::relocate): Likewise.
5777 2010-11-08 Doug Kwan <dougkwan@google.com>
5778 Cary Coutant <ccoutant@google.com>
5780 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
5781 (Arm_exidx_merge_section::section_contents_): New data member.
5782 (Arm_input_section::Arm_input_section): Initialize original_contents_.
5783 (Arm_input_section::~Arm_input_section): De-allocate memory.
5784 (Arm_input_section::original_contents_): New data member.
5785 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
5786 in parameters instead of calling Object::section_contents without
5788 (Arm_output_section::group_section): New parameter TASK. Pass it
5789 to callees that need locking objects.
5790 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
5791 to lock EXIDX input sections. Fix a formatting issue. Call
5792 Arm_exidx_merged_section::build_contents to create merged section
5794 (Arm_output_section::create_stub_group): New parameter TASK. Use it
5795 to lock object of stub table owner.
5796 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
5797 TEXT_SIZE to initialize data member TEXT_SIZE_.
5798 (Arm_exidx_input_section::addralign): Fix typo in comment.
5799 (Arm_exidx_input_section::text_size): New method.
5800 (Target_arm::do_relax): New parameter TASK. Pass it to callees
5801 that require locking objects. Lock objects before scanning for stubs
5802 and updating local symbols.
5803 (Arm_input_section<big_endian>::init): Copy contents of original
5805 (Arm_input_section<big_endian>::do_write): Use saved contents of
5806 original input section instead of calling Object::section_contents
5808 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
5809 size without calling Object::section_size().
5810 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
5811 for size. Allocate a buffer for merged EXIDX entries.
5812 (Arm_exidx_merged_section::build_contents): New method.
5813 (Arm_exidx_merged_section::do_write): Move merge section contents
5814 building code to Arm_exidx_merged_section::build_contetns. Write
5815 out contetns in buffer instead of building it on the fly.
5816 (Arm_relobj::make_exidx_input_section): Also pass text section size
5817 to Arm_exidx_input_section constructor.
5818 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
5819 (Arm_dynobj::do_read_symbols): Fix memory leak.
5820 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
5821 * target.h: (class Task): Add forward declaration.
5822 (Target::relax): Add new parameter TASK and pass it to
5824 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
5826 2010-11-05 Cary Coutant <ccoutant@google.com>
5829 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
5830 object when reading from the file.
5831 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
5833 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
5834 when reading section contents.
5835 (get_section_contents): Likewise.
5836 (icf::find_identical_sections): Likewise.
5837 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
5838 object when reading from the file.
5839 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
5840 the object when doing deferred section layout.
5842 2010-11-03 Nick Clifton <nickc@redhat.com>
5845 * script.h (class Symbol_assignment: name): New member. Returns
5846 the name of the symbol.
5847 * scrfipt.cc (Script_options::is_pending_assignment): New member.
5848 Returns true if the given symbol name is on the list of
5849 assignments wating to be processed.
5850 * archive.cc (should_incldue_member): If the symbol is undefined,
5851 check to see if it is on the list of symbols pending assignment.
5853 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
5855 * script-sections.cc (Script_sections::find_memory_region): Check
5856 for a NULL output section pointer.
5858 2010-10-29 Doug Kwan <dougkwan@google.com>
5860 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
5861 Output_section::add_relaxed_input_section.
5862 * output.cc (Output_section::add_relaxed_input_section): Add new
5863 arguments LAYOUT and NAME. Set section order index.
5864 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5865 Copy section order index.
5866 * output.h (Output_section::add_relaxed_input_section): Add new
5867 arguments LAYOUT and NAME.
5869 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5871 * testsuite/Makefile.am: Move gcctestdir/ld rule to
5872 NATIVE_OR_CROSS_LINKER.
5873 * testsuite/Makefile.in: Regenerate.
5875 2010-10-20 Doug Kwan <dougkwan@google.com>
5877 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
5878 without SHF_LINK_ORDER flags.
5879 * layout.cc (Layout::choose_output_section): Do not filter
5880 SHF_LINK_ORDER flag in a relocatable link.
5882 2010-10-17 Cary Coutant <ccoutant@google.com>
5884 * output.h (Output_segment::set_section_addresses): Change function
5885 signature. Update all callers.
5886 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
5888 (Output_segment::set_section_addresses): Align after last TLS
5889 section. Add padding before last relro section instead of after.
5891 2010-10-17 Doug Kwan <dougkwan@google.com>
5893 * gold/arm.cc (Target_arm::got_section): Use correct order and set
5894 GOT output section to be writable.
5896 2010-10-14 Cary Coutant <ccoutant@google.com>
5898 * debug.h (DEBUG_INCREMENTAL): New flag.
5899 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
5900 * gold.cc (queue_initial_tasks): Check parameters for incremental link
5902 * incremental.cc (report_command_line): Ignore all forms of
5904 * layout.cc (Layout::Layout): Check parameters for incremental link
5906 * options.cc (General_options::parse_incremental): New function.
5907 (General_options::parse_no_incremental): New function.
5908 (General_options::parse_incremental_full): New function.
5909 (General_options::parse_incremental_update): New function.
5910 (General_options::incremental_mode_): New data member.
5911 (General_options::finalize): Check incremental_mode_.
5912 * options.h (General_options): Update help text for --incremental.
5913 Add --no-incremental, --incremental-full, --incremental-update.
5914 (General_options::Incremental_mode): New enum type.
5915 (General_options::incremental_mode): New function.
5916 (General_options::incremental_mode_): New data member.
5917 * parameters.cc (Parameters::incremental_mode_): New data member.
5918 (Parameters::set_options): Set incremental_mode_.
5919 (Parameters::set_incremental_full): New function.
5920 (Parameters::incremental): New function.
5921 (Parameters::incremental_update): New function.
5922 (set_parameters_incremental_full): New function.
5923 * parameters.h (Parameters::set_incremental_full): New function.
5924 (Parameters::incremental): New function.
5925 (Parameters::incremental_update): New function.
5926 (Parameters::incremental_mode_): New data member.
5927 (set_parameters_incremental_full): New function.
5928 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
5929 incremental link mode.
5930 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
5931 (Sized_relobj::do_relocate_sections): Likewise.
5932 * testsuite/Makefile.am (incremental_test): Use --incremental-full
5934 * testsuite/Makefile.in: Regenerate.
5935 * testsuite/incremental_test.sh: Filter all forms of --incremental.
5937 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5939 * script-sections.h (class Script_sections): Make
5940 Sections_elements typedef public.
5941 * script-sections.cc (class Sort_output_sections): Add elements_
5942 field. Add constructor which sets it; change all callers.
5943 (Sort_output_sections::is_before): New function.
5944 (Sort_output_sections::operator()): Call is_before.
5945 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
5947 * testsuite/script_test_10.sh: New test. Test script section
5949 * testsuite/script_test_10.t: Likewise.
5950 * testsuite/script_test_10.s: Likewise.
5951 * testsuite/Makefile.am: Wrap the cross linker tests and the
5952 common tests into NATIVE_OR_CROSS_LINKER.
5953 (check_SCRIPTS): Add script_test_10.sh.
5954 (check_DATA): Add script_test_10.stdout.
5955 (script_test_10.o, script_test_10): New targets.
5956 (script_test_10.stdout): New target.
5957 * configure, testsuite/Makefile.in: Regenerate.
5959 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5961 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
5962 error for the deprecated relocations.
5963 (Target_arm::Scan::global): Likewise.
5964 (Target_arm::Relocate::relocate): Likewise.
5966 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
5968 * fileread.cc (Input_file::find_file): Initialize *found_name
5969 and *namep when using the fallback search for case 4.
5971 2010-10-11 Cary Coutant <ccoutant@google.com>
5973 * options.h (class General_options): Redefine -z lazy as an alias for
5974 the negation of -z now.
5976 2010-10-11 Ian Lance Taylor <iant@google.com>
5978 * resolve.cc (symbol_to_bits): Report the value of the unsupported
5981 2010-10-06 Nick Clifton <nickc@redhat.com>
5983 * script-sections.cc(class Memory_region): Remove
5984 current_lma_offset_ field. Rename current_vma_offset_ to
5985 current_offset_. Add last_section_ field.
5986 (Memory_region::get_current_vma_address): Rename to
5987 get_current_address.
5988 (Memory_region::get_current_lma_address): Delete.
5989 (Memory_region::increment_vma_offset): Rename to
5991 (Memory_region::increment_lma_offset): Delete.
5992 (Memory_region::attributes_compatible): New method. Returns
5993 true if the provided section is compatible with the region.
5994 (Memory_region::get_last_section): New method. Returns the last
5995 section to use the region.
5996 (Memory_region::set_last_section): New method. Stores the last
5997 section to use the region.
5998 (Script_sections::block_in_region): New method. Returns true if
5999 a block of memory is contained within a region.
6000 (Script_sections::find_memory_region): New method. Locates a
6001 memory region to be used to set a VMA or LMA address.
6002 (Output_section_definition::set_section_addresses): Add code to
6003 check for addresses set by memory regions.
6004 (Output_segment::set_section_addresses): Remove memory region
6006 (Script_sections::create_segment): Add a warning if a header
6007 segment is created outside of any region.
6008 * script-sections.h (class Script_sections): Add prototypes for
6009 find_memory_region and block_in_region methods.
6010 * testsuite/memory_test.s: Use .long instead of .word.
6011 * testsuite/memory_test.t: Add some more output sections.
6012 * testsuite/memory_test.sh: Update expected output.
6014 2010-10-02 Doug Kwan <dougkwan@google.com>
6016 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
6017 defintion to symtab.h
6018 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
6019 declaration to defintion.
6021 2010-10-01 Nick Clifton <nickc@redhat.com>
6023 * expression.cc (eval): Replace dummy argument with NULL.
6024 (eval_maybe_dot): Check for a NULL result section pointer.
6025 (Symbol_expression::value): Likewise.
6026 (Dot_expression::value): Likewise.
6027 (BINARY_EXPRESSION): Likewise.
6028 (Max_expression::value): Likewise.
6029 (Min_expression::value): Likewise.
6030 (Absolute_expression::value): Likewise.
6031 (Addr_expression::value_from_output_section): Likewise.
6032 (Loaddddr_expression::value_from_output_section): Likewise.
6033 (Segment_start_expression::value): Likewise.
6034 * script-sections.cc
6035 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
6037 (Sections_elememt_dot_assignment::set_section_addresses):
6039 (Output_data_expression::do_write_to_buffer): Likewise.
6040 (Output_section_definition::finalize_symbols): Likewise.
6041 (Output_section_definition::set_section_addresses): Likewise.
6043 2010-09-30 Doug Kwan <dougkwan@google.com>
6045 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
6047 2010-09-28 Sriraman Tallam <tmsriram@google.com>
6049 * target.h (Target::can_icf_inline_merge_sections): New virtual
6051 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
6053 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
6055 * icf.cc (get_section_contents): Inline merge sections only when
6058 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6060 * configure: Regenerate.
6062 2010-09-17 Ian Lance Taylor <iant@google.com>
6064 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
6065 * testsuite/Makefile.am (memory_test.o): New target.
6066 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
6068 * testsuite/Makefile.in: Rebuild.
6070 2010-09-17 Doug Kwan <dougkwan@google.com>
6072 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
6073 defintion if relocation uses GOT entries of the symbol.
6074 * testsuite/icf_safe_test.sh: Fix test.
6075 * testsuite/icf_safe_so_test.sh: Fix test.
6077 2010-09-16 Cary Coutant <ccoutant@google.com>
6079 * script_sections.cc (class Memory_region): Remove "NULL" from
6080 vector initializations.
6082 2010-09-15 Cary Coutant <ccoutant@google.com>
6084 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
6085 Resolve forwarding symbols.
6087 2010-09-15 Doug Kwan <dougkwan@google.com>
6089 * gold/testsuite/script_test_3.t: Add ARM special sections.
6090 * gold/testsuite/script_test_4.t: Same.
6091 * gold/testsuite/script_test_5.t: Same.
6092 * gold/testsuite/script_test_6.t: Same.
6093 * gold/testsuite/script_test_7.t: Same.
6094 * gold/testsuite/script_test_7.t: Same.
6095 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
6097 2010-09-14 Cary Coutant <ccoutant@google.com>
6099 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
6100 (Target_x86_64::Relocate::relocate_tls): Replace check for
6101 saw_tls_block_reloc_ with test for executable section.
6103 2010-09-12 Cary Coutant <ccoutant@google.com>
6105 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
6106 position-independent executables to shared libraries need dynamic
6108 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
6109 position-independent executables.
6110 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
6111 * testsuite/Makefile.in: Regenerate.
6113 2010-09-10 Nick Clifton <nickc@redhat.com>
6116 * testsuite/memory_test.t: Discard any sections that are not
6119 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
6122 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
6123 "This::" to work around a bug in gcc 4.2.
6125 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
6127 2010-09-09 Rafael Espindola <espindola@google.com>
6129 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
6130 sections with different PF_X flags in the same segment.
6131 (Layout::find_first_load_seg): Search all segments to find the first
6133 * options.h (rosegment): New.
6135 2010-09-08 Rafael Espindola <espindola@google.com>
6137 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
6139 2010-09-08 Doug Kwan <dougkwan@google.com>
6141 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
6142 (Arm_relobj::do_relocate_sections): Add new parameter for output
6143 file to match the parent.
6144 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
6145 of local symbols instead of input values. Update code to track
6146 changes in gold::relocate_section.
6147 * object.cc (Sized_relobj::compute_final_local_value): New methods.
6148 (Sized_relobj::compute_final_local_value_internal): New methods.
6149 (Sized_relobj::do_finalize_local_symbols): Move code from loop
6150 body into private version of Sized_relobj::compute_final_local_value.
6151 Call the inline method.
6152 * object.h (Symbol_value::Symbol_value): Define destructor. Free
6153 merged symbol value if there is one.
6154 (Symbol_value::has_output_value): New method defintiion.
6155 (Sized_relobj::Compute_final_local_value_status): New enum type.
6156 (Sized_relobj::compute_final_local_value): New methods.
6157 (Sized_relobj::compute_final_local_value_internal): New methods.
6158 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
6159 and arm_cortex_a8.sh.
6160 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
6161 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
6163 * Makefile.in: Regenerate.
6164 * testsuite/arm_bl_out_of_range.s: Update test.
6165 * testsuite/thumb_bl_out_of_range.s: Ditto.
6166 * testsuite/thumb_blx_out_of_range.s: Ditto.
6167 * testsuite/arm_branch_out_of_range.sh: New file.
6168 * testsuite/arm_cortex_a8.sh: Ditto.
6169 * testsuite/arm_cortex_a8_b.s: Ditto.
6170 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
6171 * testsuite/arm_cortex_a8_b_local.s: Ditto.
6172 * testsuite/arm_cortex_a8_bl.s: Ditto.
6173 * testsuite/arm_cortex_a8_blx.s: Ditto.
6174 * testsuite/arm_cortex_a8_local.s: Ditto.
6175 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
6176 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
6178 2010-09-08 Rafael Espindola <espindola@google.com>
6180 * Makefile.am (memory_test.stdout): Run readelf with -W.
6181 * Makefile.in: Regenerate.
6182 * testsuite/memory_test.sh: Make the regexps accept both 32 and
6185 2010-09-08 Rafael Espindola <espindola@google.com>
6187 * script-sections.cc (Script_sections::add_memory_region): Convert
6188 field precision to int.
6189 * script.cc (script_set_section_region, script_set_section_region):
6190 Convert field precision to int.
6192 2010-09-08 Rafael Espindola <espindola@google.com>
6194 * arm.cc (do_finalize_sections): Create the __exidx_start and
6195 __exdix_end symbols even when the section is missing.
6197 2010-09-08 Nick Clifton <nickc@redhat.com>
6199 * README: Remove claim that MEMORY is not supported.
6200 * expression.cc (script_exp_function_origin)
6201 (script_exp_function_length): Move from here to ...
6202 * script.cc: ... here.
6203 (script_set_section_region, script_add_memory)
6204 (script_parse_memory_attr, script_include_directive): New
6206 * script-sections.cc
6207 (class Memory_region): New class.
6208 (class Output_section_definition): Add set_memory_region,
6209 set_section_vma, set_section_lma and get_section_name methods.
6210 (class Script_Sections): Add add_memory_region,
6211 find_memory_region, find_memory_region_origin,
6212 find_memory_region_length and set_memory_region methods.
6213 Have set_section_addresses method walk the list of set memory
6215 Extend the print methos to display memory regions.
6216 * script-sections.h: Add prototypes for new methods.
6217 Add enum for MEMORY region attributes.
6218 * yyscript.y: Add support for parsing MEMORY regions.
6219 * script-c.h: Add prototypes for new functions.
6220 * testsuite/Makefile.am: Add test of MEMORY region functionality.
6221 * testsuite/Makefile.in: Regenerate.
6222 * testsuite/memory_test.sh: New script.
6223 * testsuite/memory_test.s: New assembler source file.
6224 * testsuite/memory_test.t: New linker script.
6226 2010-08-27 Doug Kwan <dougkwan@google.com>
6228 * gold/resolve.cc (Symbol_table::should_override): Let a weak
6229 reference override an existing dynamic weak reference.
6230 * testsuite/Makefile.am: Add new test dyn_weak_ref.
6231 * testsuite/Makefile.in: Regenerate.
6232 * testsuite/dyn_weak_ref.sh: New file.
6233 * testsuite/dyn_weak_ref_1.c: Ditto.
6234 * testsuite/dyn_weak_ref_2.c: Ditto.
6236 2010-08-27 Ian Lance Taylor <iant@google.com>
6238 * incremental.h (class Incremental_input_entry): Add virtual
6241 2010-08-27 Ian Lance Taylor <iant@google.com>
6243 * testsuite/start_lib_test_3.c: Mark t3 as used.
6245 2010-08-27 Nick Clifton <nickc@redhat.com>
6247 * options.cc (version_script): Fix small typo in previous
6250 2010-08-25 Nick Clifton <nickc@redhat.com>
6252 * archive.cc: Formatting fixes: Remove whitespace between
6253 typename and following asterisk. Remove whitespace between
6254 function name and opening parenthesis.
6255 * archive.h: Likewise.
6257 * attributes.cc: Likewise.
6258 * attributes.h: Likewise.
6259 * common.cc: Likewise.
6260 * copy-relocs.cc: Likewise.
6261 * dirsearch.h: Likewise.
6262 * dynobj.cc: Likewise.
6263 * ehframe.cc: Likewise.
6264 * ehframe.h: Likewise.
6265 * expression.cc: Likewise.
6266 * fileread.cc: Likewise.
6267 * fileread.h: Likewise.
6269 * gold-threads.cc: Likewise.
6270 * gold.cc: Likewise.
6271 * i386.cc: Likewise.
6273 * incremental-dump.cc: Likewise.
6274 * incremental.cc: Likewise.
6275 * layout.cc: Likewise.
6276 * layout.h: Likewise.
6277 * main.cc: Likewise.
6278 * merge.cc: Likewise.
6279 * merge.h: Likewise.
6280 * object.cc: Likewise.
6281 * object.h: Likewise.
6282 * options.cc: Likewise.
6283 * options.h: Likewise.
6284 * output.cc: Likewise.
6285 * output.h: Likewise.
6286 * plugin.cc: Likewise.
6287 * plugin.h: Likewise.
6288 * powerpc.cc: Likewise.
6289 * reloc.cc: Likewise.
6290 * script-c.h: Likewise.
6291 * script-sections.cc: Likewise.
6292 * script.cc: Likewise.
6293 * stringpool.cc: Likewise.
6294 * symtab.cc: Likewise.
6295 * symtab.h: Likewise.
6296 * target.cc: Likewise.
6297 * timer.cc: Likewise.
6298 * timer.h: Likewise.
6299 * version.cc: Likewise.
6300 * x86_64.cc: Likewise.
6302 2010-08-24 Nick Clifton <nickc@redhat.com>
6305 * layout.cc (segment_precedes): Sort segments by their physical
6306 addresses, if they have been set.
6308 2010-08-23 Cary Coutant <ccoutant@google.com>
6310 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
6312 (Lib_group::include_member): Unlock object after deleting its
6314 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
6317 2010-08-19 Neil Vachharajani <nvachhar@google.com>
6318 Cary Coutant <ccoutant@google.com>
6320 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
6321 constructor, and set_blocker.
6322 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
6324 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
6325 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
6326 * testsuite/Makefile.am (start_lib_test): New test case.
6327 * testsuite/Makefile.in: Regenerate.
6328 * testsuite/start_lib_test_main.c: New file.
6329 * testsuite/start_lib_test_1.c: New file.
6330 * testsuite/start_lib_test_2.c: New file.
6331 * testsuite/start_lib_test_3.c: New file.
6333 2010-08-19 Ian Lance Taylor <iant@google.com>
6335 * Makefile.in: Rebuild with automake 1.11.1.
6336 * aclocal.m4: Likewise.
6337 * testsuite/Makefile.in: Likewise.
6339 2010-08-19 Ian Lance Taylor <iant@google.com>
6342 * i386.cc (class Output_data_plt_i386): Update declarations.
6343 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
6344 local_ifuncs_ fields.
6345 (Target_i386::do_plt_section_for_global): New function.
6346 (Target_i386::do_plt_section_for_local): New function.
6347 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
6348 parameter; change all callers. Initialize global_ifuncs_ and
6349 local_ifuncs_. If doing a static link define __rel_iplt_start and
6351 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
6352 (Output_data_plt_i386::add_local_ifunc_entry): New function.
6353 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
6355 (Target_i386::make_plt_section): New function, broken out of
6356 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
6357 (Target_i386::make_plt_entry): Call make_plt_section.
6358 (Target_i386::make_local_ifunc_plt_entry): New function.
6359 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
6360 (Target_i386::Scan::local): Handle IFUNC symbols. Add
6361 R_386_IRELATIVE to switch.
6362 (Target_i386::Scan::global): Likewise.
6363 (Target_i386::Relocate::relocate): Likewise.
6364 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
6366 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
6367 (Target_x86_64::do_plt_section_for_global): New function.
6368 (Target_x86_64::do_plt_section_for_local): New function.
6369 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
6370 parameter; change all callers. If doing a static link define
6371 __rela_iplt_start and __rela_iplt_end.
6372 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
6373 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
6374 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
6376 (Target_x86_64::make_local_ifunc_plt_entry): New function.
6377 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
6379 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
6380 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
6381 R_X86_64_IRELATIVE to switch.
6382 (Target_x86_64::Scan::global): Likewise.
6383 (Target_x86_64::Relocate::relocate): Likewise.
6384 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
6386 * target.h (class Target): Add plt_section_for_global and
6387 plt_section_for_local functions. Add do_plt_section_for_global
6388 and do_plt_section_for_local virtual functions.
6389 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
6390 clarifying comments.
6391 (Symbol::use_plt_offset): Handle IFUNC symbol.
6392 * object.cc (Sized_relobj::Sized_relobj): Initialize
6394 (Sized_relobj::local_has_plt_offset): New function.
6395 (Sized_relobj::local_plt_offset): New function.
6396 (Sized_relobj::set_local_plt_offset): New function.
6397 (Sized_relobj::do_count): Handle IFUNC symbol.
6398 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
6399 a bit away from input_shndx_ field. Add set_is_func_symbol and
6400 is_ifunc_symbol functions.
6401 (class Sized_relobj): Update declarations. Remove Tls_got_entry
6402 and Local_tls_got_offsets. Define Local_plt_offsets. Add
6403 local_plt_offsets_ field.
6404 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
6405 * output.h (class Output_section_data): Add non-const
6406 output_section function.
6407 (class Output_data_got): Update declarations.
6408 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
6409 Add use_plt_offset parameter to global and local constructors.
6410 Change all callers. Change local_sym_index_ field to 31 bits.
6411 Change GSYM_CODE and CONSTANT_CODE accordingly.
6412 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
6413 doing a static link don't set sh_link field.
6414 (Output_data_got::Got_entry::write): Use PLT offset if
6416 (Output_data_got::add_global_plt): New function.
6417 (Output_data_got::add_local_plt): New function.
6418 * target-reloc.h (relocate_section): Handle IFUNC symbol.
6419 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
6420 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
6421 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
6422 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
6424 * testsuite/ifunc-sel.h: New file.
6425 * testsuite/ifuncmain1.c: New file.
6426 * testsuite/ifuncmain1vis.c: New file.
6427 * testsuite/ifuncmod1.c: New file.
6428 * testsuite/ifuncdep2.c: New file.
6429 * testsuite/ifuncmain2.c: New file.
6430 * testsuite/ifuncmain3.c: New file.
6431 * testsuite/ifuncmod3.c: New file.
6432 * testsuite/ifuncmain4.c: New file.
6433 * testsuite/ifuncmain5.c: New file.
6434 * testsuite/ifuncmod5.c: New file.
6435 * testsuite/ifuncmain6pie.c: New file.
6436 * testsuite/ifuncmod6.c: New file.
6437 * testsuite/ifuncmain7.c: New file.
6438 * configure, testsuite/Makefile.in: Rebuild.
6440 2010-08-18 Ian Lance Taylor <iant@google.com>
6443 (Output_section_incremental_inputs::write_input_files): Add cast
6444 to avoid signed/unsigned comparison warning.
6445 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6447 2010-08-12 Cary Coutant <ccoutant@google.com>
6449 * common.cc (Sort_commons::operator()): Remove unnecessary code.
6451 2010-08-13 Ian Lance Taylor <iant@google.com>
6453 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
6455 2010-08-12 Cary Coutant <ccoutant@google.com>
6456 Doug Kwan <dougkwan@google.com>
6458 * resolve.cc (Symbol_table::should_override): When a weak dynamic
6459 defintion overrides non-weak undef, remember that the original undef
6461 * symtab.cc (Symbol_table::sized_write_global): For undef without
6462 an original weak binding, set binding to global in output.
6463 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
6464 * testsuite/Makefile.in: Regenerate.
6465 * testsuite/strong_ref_weak_def.sh: New file.
6466 * testsuite/strong_ref_weak_def_1.c: Ditto.
6467 * testsuite/strong_ref_weak_def_2.c: Ditto.
6469 2010-08-12 Cary Coutant <ccoutant@google.com>
6471 * testsuite/incremental_test.sh: Rewrite.
6472 * testsuite/incremental_test_1.c: Rewrite.
6473 * testsuite/incremental_test_2.c: Rewrite.
6475 2010-08-12 Cary Coutant <ccoutant@google.com>
6477 * arm.cc (Target_arm::got_size): Add const.
6478 (Target_arm::got_entry_count): New function.
6479 (Target_arm::plt_entry_count): New function.
6480 (Target_arm::first_plt_entry_offset): New function.
6481 (Target_arm::plt_entry_size): New function.
6482 (Output_data_plt_arm::entry_count): New function.
6483 (Output_data_plt_arm::first_plt_entry_offset): New function.
6484 (Output_data_plt_arm::get_plt_entry_size): New function.
6485 * i386.cc (Target_i386::got_size): Add const.
6486 (Target_i386::got_entry_count): New function.
6487 (Target_i386::plt_entry_count): New function.
6488 (Target_i386::first_plt_entry_offset): New function.
6489 (Target_i386::plt_entry_size): New function.
6490 (Output_data_plt_i386::entry_count): New function.
6491 (Output_data_plt_i386::first_plt_entry_offset): New function.
6492 (Output_data_plt_i386::get_plt_entry_size): New function.
6493 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
6494 find_incremental_inputs_sections. Dump incremental_got_plt section.
6495 * incremental.cc: Include target.h.
6496 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
6497 parameter. Adjust all callers. Find incremental_got_plt section.
6498 (Incremental_inputs::create_data_sections): Create incremental_got_plt
6500 (Output_section_incremental_inputs::set_final_data_size): Calculate
6501 size of incremental_got_plt section.
6502 (Output_section_incremental_inputs::do_write): Write the
6503 incremental_got_plt section.
6504 (Got_plt_view_info): New struct.
6505 (Local_got_offset_visitor): New class.
6506 (Global_got_offset_visitor): New class.
6507 (Global_symbol_visitor_got_plt): New class.
6508 (Output_section_incremental_inputs::write_got_plt): New function.
6509 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
6510 Add parameter. Adjust all callers.
6511 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6512 (Incremental_inputs::got_plt_section): New function.
6513 (Incremental_inputs::got_plt_section_): New data member.
6514 (Incremental_got_plt_reader): New class.
6515 * layout.cc (Layout::create_incremental_info_sections): Add the
6516 incremental_got_plt section.
6517 * object.h (Got_offset_list::get_list): New function.
6518 (Got offset_list::for_all_got_offsets): New function.
6519 (Sized_relobj::local_got_offset_list): New function.
6520 * powerpc.cc (Target_powerpc::got_size): Add const.
6521 (Target_powerpc::got_entry_count): New function.
6522 (Target_powerpc::plt_entry_count): New function.
6523 (Target_powerpc::first_plt_entry_offset): New function.
6524 (Target_powerpc::plt_entry_size): New function.
6525 (Output_data_plt_powerpc::entry_count): New function.
6526 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
6527 (Output_data_plt_powerpc::get_plt_entry_size): New function.
6528 * sparc.cc (Target_sparc::got_size): Add const.
6529 (Target_sparc::got_entry_count): New function.
6530 (Target_sparc::plt_entry_count): New function.
6531 (Target_sparc::first_plt_entry_offset): New function.
6532 (Target_sparc::plt_entry_size): New function.
6533 (Output_data_plt_sparc::entry_count): New function.
6534 (Output_data_plt_sparc::first_plt_entry_offset): New function.
6535 (Output_data_plt_sparc::get_plt_entry_size): New function.
6536 * symtab.h (Symbol::got_offset_list): New function.
6537 (Symbol_table::for_all_symbols): New function.
6538 * target.h (Sized_target::got_entry_count): New function.
6539 (Sized_target::plt_entry_count): New function.
6540 (Sized_target::plt_entry_size): New function.
6541 * x86_64.cc (Target_x86_64::got_size): Add const.
6542 (Target_x86_64::got_entry_count): New function.
6543 (Target_x86_64::plt_entry_count): New function.
6544 (Target_x86_64::first_plt_entry_offset): New function.
6545 (Target_x86_64::plt_entry_size): New function.
6546 (Output_data_plt_x86_64::entry_count): New function.
6547 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
6548 (Output_data_plt_x86_64::get_plt_entry_size): New function.
6550 2010-08-12 Cary Coutant <ccoutant@google.com>
6552 * archive.cc: Include incremental.h.
6553 (Archive::Archive): Initialize incremental_info_.
6554 (Archive::include_member): Record archive members in incremental info.
6555 (Add_archive_symbols::run): Record begin and end of an archive in
6557 (Lib_group::include_member): Record objects in incremental info.
6558 * archive.h (Incremental_archive_entry): Forward declaration.
6559 (Archive::set_incremental_info): New member function.
6560 (Archive::incremental_info): New member function.
6561 (Archive::Unused_symbol_iterator): New class.
6562 (Archive::unused_symbols_begin): New member function.
6563 (Archive::unused_symbols_end): New member function.
6564 (Archive::incremental_info_): New data member.
6565 * incremental-dump.cc (find_input_containing_global): New function.
6566 (dump_incremental_inputs): Dump new incremental info sections.
6567 * incremental.cc: Include symtab.h.
6568 (Output_section_incremental_inputs): New class.
6569 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
6570 new incremental info sections.
6571 (Sized_incremental_binary::do_check_inputs): Likewise.
6572 (Incremental_inputs::report_archive): Remove.
6573 (Incremental_inputs::report_archive_begin): New function.
6574 (Incremental_inputs::report_archive_end): New function.
6575 (Incremental_inputs::report_object): New function.
6576 (Incremental_inputs::finalize_inputs): Remove.
6577 (Incremental_inputs::report_input_section): New function.
6578 (Incremental_inputs::report_script): Rewrite.
6579 (Incremental_inputs::finalize): Do nothing but finalize string table.
6580 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6581 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6582 (Incremental_inputs::create_data_sections): New function.
6583 (Incremental_inputs::relocs_entsize): New function.
6584 (Output_section_incremental_inputs::set_final_data_size): New function.
6585 (Output_section_incremental_inputs::do_write): New function.
6586 (Output_section_incremental_inputs::write_header): New function.
6587 (Output_section_incremental_inputs::write_input_files): New function.
6588 (Output_section_incremental_inputs::write_info_blocks): New function.
6589 (Output_section_incremental_inputs::write_symtab): New function.
6590 * incremental.h (Incremental_script_entry): Forward declaration.
6591 (Incremental_object_entry): Forward declaration.
6592 (Incremental_archive_entry): Forward declaration.
6593 (Incremental_inputs): Forward declaration.
6594 (Incremental_inputs_header_data): Remove.
6595 (Incremental_inputs_header): Remove.
6596 (Incremental_inputs_header_write): Remove.
6597 (Incremental_inputs_entry_data): Remove.
6598 (Incremental_inputs_entry): Remove.
6599 (Incremental_inputs_entry_write): Remove.
6600 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
6601 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
6602 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6603 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
6605 (Incremental_input_entry): New class.
6606 (Incremental_script_entry): New class.
6607 (Incremental_object_entry): New class.
6608 (Incremental_archive_entry): New class.
6609 (Incremental_inputs::Incremental_inputs): Initialize new data members.
6610 (Incremental_inputs::report_inputs): Remove.
6611 (Incremental_inputs::report_archive): Remove.
6612 (Incremental_inputs::report_archive_begin): New function.
6613 (Incremental_inputs::report_archive_end): New function.
6614 (Incremental_inputs::report_object): Change prototype.
6615 (Incremental_inputs::report_input_section): New function.
6616 (Incremental_inputs::report_script): Change prototype.
6617 (Incremental_inputs::get_reloc_count): New function.
6618 (Incremental_inputs::set_reloc_count): New function.
6619 (Incremental_inputs::create_data_sections): New function.
6620 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6621 (Incremental_inputs::inputs_section): New function.
6622 (Incremental_inputs::symtab_section): New function.
6623 (Incremental_inputs::relocs_section): New function.
6624 (Incremental_inputs::get_stringpool): Add const.
6625 (Incremental_inputs::command_line): Add const.
6626 (Incremental_inputs::inputs): Remove.
6627 (Incremental_inputs::command_line_key): New function.
6628 (Incremental_inputs::input_file_count): New function.
6629 (Incremental_inputs::input_files): New function.
6630 (Incremental_inputs::relocs_entsize): New function.
6631 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6632 (Incremental_inputs::finalize_inputs): Remove.
6633 (Incremental_inputs::Input_info): Remove.
6634 (Incremental_inputs::lock_): Remove.
6635 (Incremental_inputs::inputs_): Change type.
6636 (Incremental_inputs::inputs_map_): Remove.
6637 (Incremental_inputs::current_object_entry_): New data member.
6638 (Incremental_inputs::inputs_section_): New data member.
6639 (Incremental_inputs::symtab_section_): New data member.
6640 (Incremental_inputs::relocs_section_): New data member.
6641 (Incremental_inputs::reloc_count_): New data member.
6642 (Incremental_inputs_reader): New class.
6643 (Incremental_symtab_reader): New class.
6644 (Incremental_relocs_reader): New class.
6645 * layout.cc (Layout::finalize): Move finalization of incremental info
6646 and creation of incremental info sections to follow finalization of
6647 symbol table. Set offsets for postprocessing sections.
6648 (Layout::create_incremental_info_sections): Call
6649 Incremental_inputs::create_data_sections. Add incremental symtab
6650 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
6651 sections to layout after input sections.
6652 * layout.h (struct Timespec): Forward declaration.
6653 (Layout::incremental_inputs): Add const.
6654 (Layout::create_incremental_info_sections): Add parameter.
6655 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
6656 * object.cc: Include incremental.h.
6657 (Relobj::finalize_incremental_relocs): New function.
6658 (Sized_relobj::do_layout): Record input sections in incremental info.
6659 * object.h (Object::output_section): New function.
6660 (Object::output_section_offset): Moved from Relobj.
6661 (Object::get_incremental_reloc_base): New function.
6662 (Object::get_incremental_reloc_count): New function.
6663 (Object::do_output_section): New function.
6664 (Object::do_output_section_offset): Moved from Relobj.
6665 (Object::do_get_incremental_reloc_base): New function.
6666 (Object::do_get_incremental_reloc_count): New function.
6667 (Object::Object): Initialize new data members.
6668 (Relobj::output_section): Renamed do_output_section and moved to
6670 (Relobj::output_section_offset): Moved to Object.
6671 (Relobj::do_get_incremental_reloc_base): New function.
6672 (Relobj::do_get_incremental_reloc_count): New function.
6673 (Relobj::allocate_incremental_reloc_counts): New function.
6674 (Relobj::count_incremental_reloc): New function.
6675 (Relobj::finalize_incremental_relocs): New function.
6676 (Relobj::next_incremental_reloc_index): New function.
6677 (Relobj::reloc_counts_): New data member.
6678 (Relobj::reloc_bases_): New data member.
6679 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
6680 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
6681 (Sized_relobj::incremental_relocs_scan): New function.
6682 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6683 (Sized_relobj::incremental_relocs_write): New function.
6684 (Sized_relobj::incremental_relocs_write_reltype): New function.
6685 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
6687 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
6688 archives and object files elsewhere.
6689 (Add_symbols::run): Report object files here.
6690 (Finish_group::run): Report end of archive at end of group.
6691 * reloc.cc: Include layout.h, incremental.h.
6692 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
6693 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
6694 (Sized_relobj::incremental_relocs_scan): New function.
6695 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6696 (Sized_relobj::do_relocate_sections): Write incremental relocations.
6697 (Sized_relobj::incremental_relocs_write): New function.
6698 (Sized_relobj::incremental_relocs_write_reltype): New function.
6699 * script.cc (read_input_script): Rewrite test for incremental link.
6700 Change call to Incremental_inputs::report_script.
6701 * symtab.h (Symbol_table::first_global_index): New function.
6702 (Symbol_table::output_count): New function.
6704 2010-08-12 Doug Kwan <dougkwan@google.com>
6706 * arm.cc (Target_arm::merge_object_attributes): Check command line
6707 options --no-wchar-size-warning and --no-enum-size-warning.
6708 * options.h (General_options): Add ld-compatible options
6709 --no-enum-size-warning and --no-wchar-size-warning.
6711 2010-08-04 Ian Lance Taylor <iant@google.com>
6713 * x86_64.cc (Target_x86_64::Scan::local): Use
6714 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
6715 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
6716 (Target_x86_64::Scan::global): Likewise.
6717 (Target_x86_64::Relocate::relocate): Likewise.
6718 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
6721 2010-08-03 Cary Coutant <ccoutant@google.com>
6723 * merge.cc (Output_merge_string::do_add_input_section): Count strings
6724 to reserve space in merged_strings vector. Keep total input size
6726 (Output_merge_string::do_print_merge_stats): Print total input size.
6727 * merge.h (Output_merge_string): Add input_size_ field.
6728 * stringpool.cc (Stringpool_template::string_length): Move
6729 implementations out of Stringpool_template class and place in
6731 * stringpool.h (string_length): Move out of Stringpool_template.
6733 2010-08-03 Ian Lance Taylor <iant@google.com>
6736 * layout.cc (relaxation_loop_body): If address of load segment is
6737 set, adjust address to include headers if possible.
6739 2010-08-03 Ian Lance Taylor <iant@google.com>
6741 * version.cc (version_string): Bump to 1.10.
6743 2010-08-03 Ian Lance Taylor <iant@google.com>
6746 * layout.h (enum Output_section_order): Define.
6747 (class Layout): Update declarations.
6748 * layout.cc (Layout::get_output_section): Add order parameter.
6749 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
6750 is_first_non_relro parameters. Change all callers.
6751 (Layout::choose_output_section): Likewise.
6752 (Layout::add_output_section_data): Likewise.
6753 (Layout::make_output_section): Likewise. Set order.
6754 (Layout::default_section_order): New function.
6755 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
6756 * output.cc (Output_section::Output_section): Initialize order_.
6757 Don't initialize deleted fields.
6758 (Output_segment::Output_segment): Don't initialize deleted
6760 (Output_segment::add_output_section_to_load): New function
6761 replacing add_output_section. Change all callers to call this or
6762 add_output_section_to_nonload.
6763 (Output_segment::add_output_section_to_nonload): New function.
6764 (Output_segment::remove_output_section): Rewrite.
6765 (Output_segment::add_initial_output_data): Likewise.
6766 (Output_segment::has_any_data_sections): Likewise.
6767 (Output_segment::is_first_section_relro): Likewise.
6768 (Output_segment::maximum_alignment): Likewise.
6769 (Output_segment::has_dynamic_reloc): New function replacing
6770 dynamic_reloc_count. Change all callers.
6771 (Output_segment::has_dynamic_reloc_list): New function replacing
6772 dynamic_reloc_count_list. Change all callers.
6773 (Output_segment::set_section_addresses): Rewrite.
6774 (Output_segment::set_offset): Rewrite.
6775 (Output_segment::find_first_and_last_list): Remove.
6776 (Output_segment::set_tls_offsets): Rewrite.
6777 (Output_segment::first_section_load_address): Likewise.
6778 (Output_segment::output_section_count): Likewise.
6779 (Output_segment::section_with_lowest_load_address): Likewise.
6780 (Output_segment::write_section_headers): Likewise.
6781 (Output_segment::print_sections_to_map): Likewise.
6782 * output.h (class Output_data): Remove dynamic_reloc_count_
6783 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
6784 (Output_data::add_dynamic_reloc): Rewrite.
6785 (Output_data::has_dynamic_reloc): New function.
6786 (Output_data::dynamic_reloc_count): Remove.
6787 (class Output_section): Add order_ field. Remvoe is_relro_local_,
6788 is_last_relro_, is_first_non_relro_, is_interp_,
6789 is_dynamic_linker_section_ fields. Add order and set_order
6790 functions. Remove is_relro_local, set_is_relro_local,
6791 is_last_relro, set_is_last_relro, is_first_non_relro,
6792 set_is_first_non_relro functions, is_interp, set_is_interp,
6793 is_dynamic_linker_section, and set_is_dynamic_linker_section
6795 (class Output_segment): Change Output_data_list from std::list to
6796 std:;vector. Add output_lists_ field. Remove output_data_ and
6797 output_bss_ fields. Update declarations.
6799 2010-08-02 Ian Lance Taylor <iant@google.com>
6801 * arm.cc (Target_arm::gc_process_relocs): Use typename.
6802 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
6803 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
6805 2010-08-02 Ian Lance Taylor <iant@google.com>
6808 * script.cc (Script_options::Script_options): Initialize
6809 symbol_definitions_ and symbol_references_.
6810 (Script_options::add_symbol_assignment): Update
6811 symbol_definitions_ and symbol_references_.
6812 (Script_options::add_symbol_reference): New function.
6813 (script_symbol): New function.
6814 * script.h (class Script_options): Add symbol_definitions_ and
6815 symbol_references_ fields.
6816 (Script_options::referenced_const_iterator): New type.
6817 (Script_options::referenced_begin): New function.
6818 (Script_options::referenced_end): New function.
6819 (Script_options::is_referenced): New function.
6820 (Script_options::any_unreferenced): New function.
6821 * script-c.h (script_symbol): Declare.
6822 * yyscript.y (exp): Call script_symbol.
6823 * symtab.cc: Include "script.h".
6824 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
6825 Change all callers. Check symbols referenced by scripts.
6826 (Symbol_table::add_undefined_symbols_from_command_line): Add
6827 layout parameter. Change all callers.
6828 (Symbol_table::do_add_undefined_symbols_from_command_line):
6829 Likewise. Break out loop body. Check symbols referenced by
6831 (Symbol_table::add_undefined_symbol_from_command_line): New
6832 function broken out of
6833 do_add_undefined_symbols_from_command_line.
6834 * symtab.h (class Symbol_table): Update declarations.
6835 * archive.cc: Include "layout.h".
6836 (Archive::should_include_member): Add layout parameter. Change
6837 all callers. Check for symbol mentioned in expression.
6838 * archive.h (class Archive): Update declaration.
6839 * object.cc (Sized_relobj::do_should_include_member): Add layout
6841 * object.h (Object::should_include_member): Add layout parameter.
6843 (Object::do_should_include_member): Add layout parameter.
6844 (class Sized_relobj): Update declaration.
6845 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
6847 * dynobj.h (class Sized_dynobj): Update declaration.
6848 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
6850 * plugin.h (class Sized_pluginobj): Update declaration.
6852 2010-08-02 Ian Lance Taylor <iant@google.com>
6855 * output.cc (Output_segment::set_offset): Search for the first and
6856 last sections rather than assuming that the list is in order.
6857 (Output_segment::find_first_and_last_list): New function.
6858 * output.h (class Output_segment): Update declarations.
6859 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
6860 (relro_strip_test_SOURCES): New variable.
6861 (relro_strip_test_DEPENDENCIES): New variable.
6862 (relro_strip_test_LDFLAGS): New variable.
6863 (relro_strip_test_LDADD): New variable.
6864 (relro_strip_test.so): New target.
6866 2010-08-02 Ian Lance Taylor <iant@google.com>
6868 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
6869 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
6870 (Target_i386::got_tlsdesc_section): New function.
6871 (Target_i386::got_section): Create space for GOT entries for
6872 TLSDESC relocations.
6873 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
6875 (Target_i386::Scan::global): Likewise.
6876 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
6878 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
6879 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
6880 (Target_x86_64::got_tlsdesc_section): New function.
6881 (Target_x86_64::got_section): Create space for GOT entries for
6882 TLSDESC relocations.
6883 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
6885 (Target_x86_64::Scan::global): Likewise.
6886 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
6889 2010-08-02 Ian Lance Taylor <iant@google.com>
6891 * testsuite/final_layout.sh: Use dc to convert from hex to
6894 2010-07-29 Sriraman Tallam <tmsriram@google.com>
6896 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
6897 paramter to the call to gold::gc_process_relocs.
6898 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
6899 paramter to the call to gold::gc_process_relocs.
6900 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
6901 parameter to the call to gold::gc_process_relocs.
6902 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
6903 template parameter to the call to gold::gc_process_relocs.
6904 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
6905 paramter to the call to gold::gc_process_relocs.
6906 * gc.h (get_embedded_addend_size): New function.
6907 (gc_process_relocs): Save the size of the reloc for use by ICF.
6908 * icf.cc (get_section_contents): Get the addend from the text section
6909 for SHT_REL relocation sections.
6910 * icf.h (Icf::Reloc_addend_size_info): New typedef.
6911 (Icf::Reloc_info): Add new member reloc_addend_size_info.
6912 * int_encoding.h (read_from_pointer): New overloaded function.
6913 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
6914 * testsuite/icf_sht_rel_addend_test.sh: New file.
6915 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
6916 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
6918 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6920 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
6921 * Makefile.in: Regenerate.
6922 * testsuite/Makefile.in: Regenerate.
6924 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
6926 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
6927 * gold/testsuite/debug_msg.cc: Likewise.
6928 * gold/testsuite/odr_violation1.cc
6929 * gold/testsuite/odr_violation2.cc
6931 2010-07-21 Cary Coutant <ccoutant@google.com>
6933 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
6934 string, and length fields.
6935 (Output_merge_string::Merged_strings_list): New type.
6936 (Output_merge_string::Merged_strings_lists): New typedef.
6937 (Output_merge_string): Replace merged_strings_ with
6938 merged_strings_lists_.
6939 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
6940 Merged_strings_list per input object and section. Don't store pointer
6941 to the string. Don't store length with each merged string entry.
6942 (Output_merge_string::finalize_merged_data): Loop over list of merged
6943 strings lists. Recompute length of each merged string.
6945 2010-07-15 Cary Coutant <ccoutant@google.com>
6947 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
6950 2010-07-14 Ian Lance Taylor <iant@google.com>
6952 * descriptors.cc (Descriptors::open): Report correct name in error
6955 2010-07-13 Doug Kwan <dougkwan@google.com>
6957 * arm.cc (Arm_input_section::Arm_input_section): For a
6958 SHT_ARM_EXIDX section, always keeps the input sections.
6959 (Arm_input_section::set_exidx_section_link): New method.
6960 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
6961 has_errors_ to false.
6962 (Arm_exidx_input_section::has_errors,
6963 Arm_exidx_input_section::set_has_errors): New methods.
6964 (Arm_exidx_input_section::has_errors_): New data member.
6965 (Arm_relobj::get_exidx_shndx_list): New method.
6966 (Arm_output_section::append_text_sections_to_list): Do not skip
6967 section without SHF_EXECINSTR.
6968 (Arm_output_section::fix_exidx_coverage): Skip input sections with
6970 (Arm_relobj::make_exidx_input_section): Add new parameter for text
6971 section header. Make error messages more verbose. Check for
6972 a non-executable section linked to an EXIDX section.
6973 (Arm_relobj::do_read_symbols): Remove error checking, which has been
6974 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
6975 check that there is no deferred EXIDX section if we exit early.
6976 Instead of not making an EXIDX section in case of an error, make one
6977 and set the has_errors flag of it.
6978 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
6979 in a relocatable link.
6980 (Target_arm::do_relax): Look for the EXIDX output section instead of
6981 assuming that it is called .ARM.exidx.
6982 (Target_arm::fix_exidx_coverage): Add a new parameter for input
6983 section list. Do not check for SHF_EXECINSTR section flags but
6984 skip any input section with errors.
6985 * output.cc (Output_section::Output_section): Initialize
6986 always_keeps_input_sections_ to false.
6987 (Output_section::add_input_section): Check for
6988 always_keeps_input_sections_.
6989 * output.h (Output_section::always_keeps_input_sections,
6990 Output_section::set_always_keeps_input_sections): New methods.
6991 (Output_section::always_keeps_input_sections): New data member.
6993 2010-07-13 Rafael Espindola <espindola@google.com>
6995 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
6996 * fileread.h (Input_file): Add try_extra_search_path and find_file.
6998 2010-07-13 Philip Herron <herron.philip@googlemail.com>
6999 Ian Lance Taylor <iant@google.com>
7001 * output.h (Output_section_lookup_maps::add_merge_section):
7002 Correct check of whether value was inserted.
7003 (Output_section_lookup_maps::add_merge_input_section): Likewise.
7004 (Output_section_lookup_maps::add_relaxed_input_section):
7006 * arm.cc (Target_arm::got_section): Remove used local os.
7007 * i386.cc (Target_i386::got_section): Likewise.
7008 * x86_64.cc (Target_x86_64::got_section): Likewise.
7009 * sparc.cc (Target_sparc::got_section): Likewise.
7010 (Target_sparc::relocate): Remove unused local have_got_offset.
7011 * powerpc.cc (Target_powerpc::relocate): Likewise.
7013 2010-07-13 Ian Lance Taylor <iant@google.com>
7015 * compressed_output.cc (zlib_decompress): Fix signature in
7018 * archive.cc (Archive::include_member): Unlock an external member
7019 of a thin archive. Don't bother to delete an object we know is
7022 2010-07-12 Cary Coutant <ccoutant@google.com>
7024 * compressed_output.cc (zlib_decompress): New function.
7025 (get_uncompressed_size): New function.
7026 (decompress_input_section): New function.
7027 * compressed_output.h (get_uncompressed_size): New function.
7028 (decompress_input_section): New function.
7029 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
7030 Handle compressed debug sections.
7031 * layout.cc (is_compressed_debug_section): New function.
7032 (Layout::output_section_name): Map compressed section names to
7034 * layout.h (is_compressed_debug_section): New function.
7035 (is_debug_info_section): Recognize compressed debug sections.
7036 * merge.cc: Include compressed_output.h.
7037 (Output_merge_data::do_add_input_section): Handle compressed
7039 (Output_merge_string::do_add_input_section): Handle compressed
7041 * object.cc: Include compressed_output.h.
7042 (Sized_relobj::Sized_relobj): Initialize new data members.
7043 (build_compressed_section_map): New function.
7044 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
7045 * object.h (Object::section_is_compressed): New method.
7046 (Object::do_section_is_compressed): New method.
7047 (Sized_relobj::Compressed_section_map): New type.
7048 (Sized_relobj::do_section_is_compressed): New method.
7049 (Sized_relobj::compressed_sections_): New data member.
7050 * output.cc (Output_section::add_input_section): Handle compressed
7052 * reloc.cc: Include compressed_output.h.
7053 (Sized_relobj::write_sections): Handle compressed debug sections.
7055 2010-07-08 Cary Coutant <ccoutant@google.com>
7057 * resolve.cc (Symbol_table::resolve): Remember whether undef was
7058 weak when resolving to a dynamic def.
7059 (Symbol_table::should_override): Add adjust_dyndef flag; set it
7060 for weak undef/dynamic def cases. Adjust callers.
7061 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
7062 undef_binding_weak_.
7063 (Symbol_table::sized_write_globals): Adjust symbol binding.
7064 (Symbol_table::sized_write_symbol): Add binding parameter.
7065 * symtab.h (Symbol::set_undef_binding): New method.
7066 (Symbol::is_undef_binding_weak): New method.
7067 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
7068 (Symbol_table::should_override): Add new parameter.
7069 (Symbol_table::sized_write_symbol): Add new parameter.
7071 * testsuite/weak_undef_file1.cc: Add new test case.
7072 * testsuite/weak_undef_file2.cc: Fix header comment.
7073 * testsuite/weak_undef_test.cc: Add new test case.
7075 2010-06-29 Doug Kwan <dougkwan@google.com>
7077 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
7078 Initialize USE_SYMBOL_.
7079 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
7081 (Arm_reloc_property::uses_symbol_): New data member declaration.
7082 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
7083 uses symbol value and symbol is undefined but not weakly undefined.
7085 2010-06-28 Rafael Espindola <espindola@google.com>
7087 * plugin.cc (Plugin::load): Use dlerror.
7089 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
7091 * symtab.cc (detect_odr_violations): When reporting an ODR
7092 violation, report an object where the symbol is defined.
7094 2010-06-25 Doug Kwan <dougkwan@google.com>
7096 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
7097 (Target_arm::section_may_have_icf_unsafe_pointers): New method
7099 (Target_arm::Scan::local_reloc_may_be_function_pointer,
7100 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
7101 target hook to detect function points.
7102 (Target_arm::Scan::possible_function_pointer_reloc): New method.
7103 * icf.h (Icf::check_section_for_function_pointers): Change type of
7104 parameter SECTION_NAME to const reference to std::string. Use
7105 target hook to determine if section may have unsafe pointers.
7106 * target.h (Target::section_may_have_icf_unsafe_pointers): New
7109 2010-06-21 Rafael Espindola <espindola@google.com>
7111 * fileread.cc (Input_file::find_fie): New
7112 (Input_file::open): Use Input_file::find_fie.
7113 * fileread.h (Input_file::find_fie): New
7114 * plugin.cc (set_extra_library_path): New.
7115 (Plugin::load): Add set_extra_library_path to the transfer vector.
7116 (Plugin_manager::set_extra_library_path): New.
7117 (Plugin_manager::add_input_file): Use the extra search path if set.
7118 (set_extra_library_path(): New.
7119 * plugin.h (Plugin_manager): Add set_extra_library_path and
7122 2010-06-19 Cary Coutant <ccoutant@google.com>
7124 * layout.cc (gdb_sections): Add .debug_types.
7125 (lines_only_debug_sections): Likewise.
7127 2010-06-18 Rafael Espindola <espindola@google.com>
7129 * plugin.cc (add_input_file,add_input_library)
7130 (Plugin_manager::add_input_file): Make filename arguments const.
7131 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
7134 2010-06-16 Doug Kwan <dougkwan@google.com>
7136 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
7137 .ARM.attributes section if we have not merged any input
7138 attributes sections.
7140 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7142 * arm.cc: Allow combining objects with no EABI version
7145 2010-06-15 Rafael Espindola <espindola@google.com>
7147 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
7149 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7151 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
7152 (struct iovec): Correct !HAVE_READV definition.
7154 2010-06-10 Cary Coutant <ccoutant@google.com>
7156 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
7157 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
7159 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
7162 * symtab.h (Symbol::is_placeholder): New member function.
7163 * target-reloc.h (relocate_section): Check for placeholder symbols.
7165 * testsuite/Makefile.am (plugin_test_8): New test.
7166 (plugin_test_9): New test.
7167 * testsuite/Makefile.in: Regenerate.
7169 2010-06-09 Nick Clifton <nickc@redhat.com>
7171 * yyscript.y (input_list_element): Allow strings prefixed with
7172 the '-' character. Treat these as libraries.
7173 * script.cc (script_add_library): New function. Adds a library
7174 specified by "-l<name>" found in an input script.
7175 * script-c.h: Add prototype for script_add_library.
7177 2010-06-07 Doug Kwan <dougkwan@google.com>
7179 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
7180 Restrict stub-group size to be within long conditional branch
7181 range when working around cortex-A8 erratum.
7183 2010-06-07 Damien Diederen <dd@crosstwine.com>
7185 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
7188 2010-06-03 Sriraman Tallam <tmsriram@google.com>
7192 (Output_section::Input_section_sort_entry::compare_section_ordering):
7193 Change to return non-zero correctly.
7194 (Output_section::Input_section_sort_section_order_index_compare
7195 ::operator()): Change to fix ambiguity in comparisons.
7197 2010-06-01 Sriraman Tallam <tmsriram@google.com>
7199 * gold.h (is_wildcard_string): New function.
7200 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
7201 (Layout::layout_eh_frame): Ditto.
7202 (Layout::find_section_order_index): New method.
7203 (Layout::read_layout_from_file): New method.
7204 * layout.h (Layout::find_section_order_index): New method.
7205 (Layout::read_layout_from_file): New method.
7206 (Layout::input_section_position_): New private member.
7207 (Layout::input_section_glob_): New private member.
7208 * main.cc (main): Call read_layout_from_file here.
7209 * options.h (--section-ordering-file): New option.
7210 * output.cc (Output_section::input_section_order_specified_): New
7212 (Output_section::Output_section): Initialize new member.
7213 (Output_section::add_input_section): Add new parameter.
7214 Keep input sections when --section-ordering-file is used.
7215 (Output_section::set_final_data_size): Sort input sections when
7216 section ordering file is specified.
7217 (Output_section::Input_section_sort_entry): Add new parameter.
7219 (Output_section::Input_section_sort_entry::compare_section_ordering):
7221 (Output_section::Input_section_sort_compare::operator()): Change to
7222 consider section_order_index.
7223 (Output_section::Input_section_sort_init_fini_compare::operator()):
7224 Change to consider section_order_index.
7225 (Output_section::Input_section_sort_section_order_index_compare
7226 ::operator()): New method.
7227 (Output_section::sort_attached_input_sections): Change to sort
7228 according to section order when specified.
7229 (Output_section::add_input_section<32, true>): Add new parameter.
7230 (Output_section::add_input_section<64, true>): Add new parameter.
7231 (Output_section::add_input_section<32, false>): Add new parameter.
7232 (Output_section::add_input_section<64, false>): Add new parameter.
7233 * output.h (Output_section::add_input_section): Add new parameter.
7234 (Output_section::input_section_order_specified): New
7236 (Output_section::set_input_section_order_specified): New method.
7237 (Input_section::Input_section): Initialize section_order_index_.
7238 (Input_section::section_order_index): New method.
7239 (Input_section::set_section_order_index): New method.
7240 (Input_section::section_order_index_): New member.
7241 (Input_section::Input_section_sort_section_order_index_compare): New
7243 (Output_section::input_section_order_specified_): New member.
7244 * script-sections.cc (is_wildcard_string): Delete and move modified
7246 (Output_section_element_input::Output_section_element_input): Modify
7247 call to is_wildcard_string.
7248 (Output_section_element_input::Input_section_pattern
7249 ::Input_section_pattern): Ditto.
7250 (Output_section_element_input::Output_section_element_input): Ditto.
7251 * testsuite/Makefile.am (final_layout): New test case.
7252 * testsuite/Makefile.in: Regenerate.
7253 * testsuite/final_layout.cc: New file.
7254 * testsuite/final_layout.sh: New file.
7256 2010-06-01 Rafael Espindola <espindola@google.com>
7258 * plugin.cc (Plugin::load): Pass the output name to the plugin.
7260 2010-06-01 Rafael Espindola <espindola@google.com>
7262 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
7263 visibility of symbols.
7265 2010-05-27 Doug Kwan <dougkwan@google.com>
7267 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
7268 from start of output section instead of address for a local symbol
7269 in a merged or relaxed section when doing a relocatable link.
7271 2010-05-26 Rafael Espindola <espindola@google.com>
7274 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
7275 adding sections the garbage collector removed.
7276 * gold/testsuite/Makefile.am: Add test.
7277 * gold/testsuite/Makefile.in: Regenerate.
7278 * gold/testsuite/plugin_test_7.sh: New.
7279 * gold/testsuite/plugin_test_7_1.c: New.
7280 * gold/testsuite/plugin_test_7_2.c: New.
7282 2010-05-26 Rafael Espindola <espindola@google.com>
7284 * script-sections.cc (Output_section_definition::set_section_addresses):
7285 Check for --section-start.
7287 2010-05-26 Doug Kwan <dougkwan@google.com>
7289 * arm.cc (Arm_scan_relocatable_relocs): New class.
7290 (Target_arm::relocate_special_relocatable): New method.
7291 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
7292 (Arm_relocate_functions::thumb_branch_common): Same.
7293 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
7294 instead of Default_scan_relocatable_relocs.
7295 * target-reloc.h (relocate_for_relocatable): Let target handle
7296 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
7297 * target.h (Sized_target::relocate_special_relocatable): New method.
7299 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7301 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
7303 2010-05-23 Doug Kwan <dougkwan@google.com>
7305 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
7307 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
7308 with a direct branch, not a conditional branch, to a stub.
7309 * merge.cc (Output_merge_base::record_input_section): New method
7311 (Output_merge_data::do_add_input_section): Record input section if
7312 keeps-input-sections flag is set.
7313 (Output_merge_string::do_add_input_section): Ditto.
7314 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
7315 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
7317 (Output_merge_base::keeps_input_sections,
7318 Output_merge_base::set_keeps_input_sections,
7319 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
7321 (Output_merge_base::Input_sections): New type declaration.
7322 (Output_merge_base::input_sections_begin,
7323 Output_merge_base::input_sections_end,
7324 Output_merge_base::do_set_keeps_input_sections): New method definitions.
7325 (Output_merge_base::bool keeps_input_sections_,
7326 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
7327 Output_merge_base::input_sections_): New data members.
7328 (Output_merge_data::do_set_keeps_input_sections): New method
7330 (Output_merge_string::do_set_keeps_input_sections): Ditto.
7331 * output.cc (Output_section::Input_section::relobj): Move method
7332 defintion from class declaration to here and handle merge sections.
7333 (Output_section::Input_section::shndx): Ditto.
7334 (Output_section::Output_section): Remove initializations of removed
7335 data members and initialize new data member LOOKUP_MAPS_.
7336 (Output_section::add_input_section): Set keeps-input-sections flag
7337 for a newly created merge output section as appropriate. Adjust code
7338 to use Output_section_lookup_maps class.
7339 (Output_section::add_relaxed_input_section): Adjst code for lookup
7340 maps code refactoring.
7341 (Output_section::add_merge_input_section): Add a new parameter
7342 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
7343 class. If adding input section to a newly created merge output
7344 section fails, remove the new merge section.
7345 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
7346 Adjust code for use of the Output_section_lookup_maps class.
7347 (Output_section::find_merge_section): Ditto.
7348 (Output_section::build_lookup_maps): New method defintion.
7349 (Output_section::find_relaxed_input_section): Adjust code to use
7350 Output_section_lookup_maps class.
7351 (Output_section::get_input_sections): Export merge sections. Adjust
7352 code to use Output_section_lookup_maps class.
7353 (Output_section:::add_script_input_section): Adjust code to use
7354 Output_section_lookup_maps class. Update lookup maps for merge
7356 (Output_section::discard_states): Use Output_section_lookup_maps.
7357 (Output_section::restore_states): Same.
7358 * output.h (Merge_section_properties): Move class defintion out of
7360 (Output_section_lookup_maps): New class.
7361 (Output_section::Input_section::is_merge_section): New method
7363 (Output_section::Input_section::relobj): Move defintion out of class
7364 defintion. Declare method only.
7365 (Output_section::Input_section::shndx): Ditto.
7366 (Output_section::Input_section::output_merge_base): New method defintion.
7367 (Output_section::Input_section::u2_.pomb): New union field.
7368 (Output_section::Merge_section_by_properties_map,
7369 Output_section::Output_section_data_by_input_section_map,
7370 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
7372 (Output_section::add_merge_input_section): Add new parameter
7373 KEEPS_INPUT_SECTIONS.
7374 (Output_section::build_lookup_maps): New method declaration.
7375 (Output_section::merge_section_map_,
7376 Output_section::merge_section_by_properties_map_,
7377 Output_section::relaxed_input_section_map_,
7378 Output_section::is_relaxed_input_section_map_valid_): Remove data
7380 (Output_section::lookup_maps_): New data member.
7382 2010-05-21 Doug Kwan <dougkwan@google.com>
7385 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
7386 avoid a compilation error.
7388 2010-05-19 Rafael Espindola <espindola@google.com>
7390 * script-sections.cc (Output_section_definition::allocate_to_segment):
7391 Update the phdrs_list even when the output section is NULL.
7392 * testsuite/Makefile.am: Add test.
7393 * testsuite/Makefile.in: Regenerate.
7394 * testsuite/script_test_9.cc: New.
7395 * testsuite/script_test_9.sh: New.
7396 * testsuite/script_test_9.t: New.
7398 2010-05-19 Doug Kwan <dougkwan@google.com>
7400 * arm.cc (Arm_input_section::original_size): New method.
7401 (Arm_input_section::do_addralign): Add a cast.
7402 (Arm_input_section::do_output_offset): Remove static cast.
7403 (Arm_input_section::original_addralign,
7404 Arm_input_section::original_size_): Change type to uint32_t.
7405 (Arm_input_section::init): Add safe casts for section alignment
7407 (Arm_input_section::set_final_data_size): Do not set address and
7408 offset of stub table.
7409 (Arm_output_section::fix_exidx_coverage): Change use of of
7410 Output_section::Simple_input_section to that of
7411 Output_section::Input_section.
7412 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
7413 except for the first pass.
7414 * output.cc (Output_section::get_input_sections): Change type of
7415 input_sections to std::list<Input_section>.
7416 (Output_section::add_script_input_section): Rename from
7417 Output_section::add_simple_input_section. Change type of SIS
7418 parameter from Simple_input_section to Input_section.
7419 * output.h (Output_section::Simple_input_section): Remove class.
7420 (Output_section::Input_section): Change class visibility to public.
7421 (Output_section::Input_section::addralign): Use stored alignments
7422 for special input sections if set.
7423 (Output_section::Input_section::set_addralign): New method.
7424 (Output_section::get_input_sections): Change parameter type from
7425 list of Simple_input_section to list of Input_section.
7426 (Output_section::add_script_input_section): Rename from
7427 Output_section::add_simple_input_section. Change first parameter's
7428 type from Simple_input_section to Input_section and remove the
7429 second and third parameters.
7430 * script-sections.cc (Input_section::Input_section_list): Change
7431 type to list of Output_section::Input_section/
7432 (Input_section_info::Input_section_info): Change parameter type of
7433 INPUT_SECTION to Output_section::Input_section.
7434 (Input_section_info::input_section): Change return type.
7435 (Input_section_info::input_section_): Change type to
7436 Output_section::Input_section.
7437 (Output_section_element_input::set_section_addresses): Adjust code
7438 to use Output_section::Input_section instead of
7439 Output_section::Simple_input_section. Adjust code for renaming
7440 of Output_section::add_simple_input_section.
7441 (Orphan_output_section::set_section_addresses): Ditto.
7443 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7445 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
7446 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
7448 2010-05-18 Rafael Espindola <espindola@google.com>
7450 * options.cc (General_options::finalize): Handle -nostdlib.
7451 * options.h (nostdlib): New option.
7452 * script.cc (script_add_search_dir): Handle -nostdlib.
7454 2010-05-12 Doug Kwan <dougkwan@google.com>
7456 * arm.cc (Target_arm::do_finalize_sections): Create an empty
7457 attributes section only if there no attributes section after merging.
7458 (Target_arm::merge_object_attributes): Move value of
7459 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
7460 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
7461 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
7462 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
7463 and arm_attr_merge_7.stdout.
7464 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
7465 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
7466 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
7467 arm_attr_merge_7b.o): New rules.
7468 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
7470 * testsuite/Makefile.in: Regenerate.
7471 * testsuite/arm_attr_merge.sh: New file.
7472 * testsuite/arm_attr_merge_[67][ab].s: Same.
7474 2010-05-05 Nick Clifton <nickc@redhat.com>
7476 * po/es.po: Updated Spanish translation.
7478 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7480 * Makefile.am (install-exec-local): Properly install gold as
7481 default cross linker.
7482 * Makefile.in: Regenerated.
7484 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7485 Nick Clifton <nickc@redhat.com>
7487 * configure.ac (install_as_default): Define and set to false
7488 unless --enable-gold or --enable-gold=both/gold has been
7490 * configure: Regenerate.
7492 * Makefile.am (install-exec-local): Install the executable as
7493 'ld.gold'. If install_as_default is true then also install it as
7495 * Makefile.in: Regenerated.
7497 2010-04-24 Ian Lance Taylor <iant@google.com>
7499 * layout.cc (Layout::layout_reloc): In relocatable link don't
7500 combine reloc sections for grouped sections.
7502 2010-04-23 Sriraman Tallam <tmsriram@google.com>
7504 * gc.h (gc_process_relocs): Pass information on relocs pointing to
7505 sections that are not ordinary to icf.
7506 * icf.cc (get_section_contents): Handle relocation pointing to section
7507 with no object or shndx information.
7508 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
7509 * testsuite/Makefile.in: Regenerate.
7510 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
7511 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
7513 2010-04-22 Ian Lance Taylor <iant@google.com>
7515 * expression.cc (Expression::Expression_eval_info): Add
7516 result_alignment_pointer field.
7517 (Expression::eval_with_dot): Add result_alignment_pointer
7518 parameter. Change all callers.
7519 (Expression::eval_maybe_dot): Likewise.
7520 (class Binary_expression): Add alignment_pointer parameter to
7521 left_value and right_value. Change all callers.
7522 (BINARY_EXPRESSION): Set result alignment.
7523 (class Trinary_expression): Add alignment_pointer parameter to
7524 arg2_value and arg3_value. Change all callers.
7525 (Trinary_cond::value): Set result alignment.
7526 (Max_expression::value, Min_expression::value): Likewise.
7527 (Align_expression::value): Likewise.
7528 * script-sections.cc (class Sections_element): Add dot_alignment
7529 parameter to set_section_addresses virtual function. Update
7531 (class Output_section_element): Likewise.
7532 (Script_sections::create_segments): Add dot_alignment parameter.
7534 (Script_sections::create_segments_from_phdrs_clause): Likewise.
7535 (Script_sections::set_phdrs_clause_addresses): Likewise.
7536 * script-sections.h: Update declarations.
7537 * script.h: Update declarations.
7538 * output.h (Output_segment::set_minimum_p_align): Don't decrease
7540 * testsuite/script_test_3.t: Set large alignment.
7541 * testsuite/script_test_3.sh: Make sure that at least one LOAD
7542 segment has expected alignment.
7544 2010-04-22 Nick Clifton <nickc@redhat.com>
7546 * po/gold.pot: Updated by the Translation project.
7547 * po/vi.po: Updated Vietnamese translation.
7549 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
7551 * testsuite/Makefile.am (check_PROGRAMS): Add
7552 icf_virtual_function_folding_test.
7553 * testsuite/Makefile.in: Regenerated.
7555 2010-04-15 Andrew Haley <aph@redhat.com>
7557 * options.h (merge_exidx_entries): New option.
7558 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
7559 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
7560 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
7561 (Target_arm::merge_exidx_entries): New function.
7562 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
7563 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
7564 to Arm_exidx_fixup constructor.
7565 Add new arg, merge_exidx_entries.
7566 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
7567 Arm_output_section::fix_exidx_coverage.
7569 2010-04-18 Sriraman Tallam <tmsriram@google.com>
7571 * icf.cc (get_section_contents): Check for preemptible functions.
7572 Ignore addend when appropriate.
7573 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
7575 (add_from_relobj): Check for section folded.
7576 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
7577 * symtab.h (should_add_dynsym_entry): Add new parameter.
7578 * target-reloc.h (scan_relocs): Check for section folded.
7579 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
7580 Check reloc types for function pointers in shared objects.
7581 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
7583 (icf_preemptible_functions_test): New test case.
7584 (icf_string_merge_test): New test case.
7585 * testsuite.Makefile.in: Regenerate.
7586 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
7587 bar_glob. Refactor code.
7588 * testsuite/icf_preemptible_functions_test.cc: New file.
7589 * testsuite/icf_preemptible_functions_test.sh: New file.
7590 * testsuite/icf_string_merge_test.cc: New file.
7591 * testsuite/icf_string_merge_test.sh: New file.
7592 * testsuite/icf_virtual_function_folding_test.cc: New file.
7593 * testsuite/icf_virtual_function_folding_test.sh: New file.
7595 2010-04-14 Doug Kwan <dougkwan@google.com>
7597 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
7598 for local symbol recounting if we remove a section due to ICF.
7599 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
7600 there are no regular objects in input.
7602 2010-04-13 Doug Kwan <dougkwan@google.com>
7604 * arm.cc (Arm_input_section::set_final_data_size): Compute
7605 accurate final data size instead of using current data size.
7607 2010-04-09 Doug Kwan <dougkwan@google.com>
7609 * layout.cc (Layout::choose_output_section): Handle script section
7611 (Layout::make_output_section_for_script): Add section type parameter.
7612 Handle script section types.
7613 * layout.h (Layout::make_output_section_for_script): Add section
7615 * output.cc (Output_section::Output_section): Initialize data member
7617 (Output_section::do_reset_address_and_file_offset): Do not set address
7618 to 0 if section is a NOLOAD section.
7619 * output.h (Output_section::is_noload): New method.
7620 (Output_section::set_is_noload): Ditto.
7621 (Output_section::is_noload_): New data member.
7622 * script-c.h (Script_section_type): New enum type.
7623 (struct Parser_output_section_header): Add new file section_type.
7624 * script-sections.cc (Sections_element::output_section_name): Add
7625 parameter for returning script section type.
7626 (Output_section_definition::output_section_name): Ditto.
7627 (Output_section_definition::section_type)P; New method.
7628 (Output_section_definiton::script_section_type_name): Ditto.
7629 (Output_section_definition::script_section_type_): New data member.
7630 (Output_section_definition::Output_section_definition): Initialize
7631 data member Output_section_definition::script_section_type_.
7632 (Output_section_definition::create_sections): Pass script section type
7633 to Layout::make_output_section_for_script.
7634 (Output_section_definition::output_section_name): Return script
7635 section type to caller.
7636 (Output_section_definition::set_section_address): Do not advance
7637 dot value and load address if section type is NOLOAD. Set address
7638 of NOLOAD sections regardless of section flags.
7639 (Output_section_definition::print): Print section type if it is
7640 not SCRIPT_SECTION_TYPE_NONE.
7641 (Output_section_definition::section_type): New method.
7642 (Output_section_definition::script_section_type_name): Ditto.
7643 (Script_sections::output_section_name): Add new parameter
7644 PSECTION_TYPE for returning script section type. Pass it to
7645 section elements. Handle discard sections.
7646 (Sort_output_sections::operator()): Handle NOLOAD sections.
7647 * script-sections.h (Script_sections::Section_type): New enum type.
7648 (Script_sections::output_section_name): Add a new parameter for
7649 returning script section type.
7650 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
7652 * yyscript.y (union): Add new field SECTION_TYPE.
7653 (COPY, DSECT, INFO, NOLOAD): New tokens.
7654 (opt_address_and_section_type): Change type to output_section_header.
7655 (section_type): New non-terminal
7656 (section_header): Handle section type.
7657 (opt_address_and_section_type): Return section type value.
7659 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
7661 * testsuite/plugin_common_test_1.c (foo): Add prototype.
7662 * testsuite/plugin_common_test_2.c (foo): Likewise.
7664 2010-04-08 Doug Kwan <dougkwan@google.com>
7666 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
7668 * output.cc (Output_section::add_merge_input_section): Simplify
7669 code and return status of Output_merge_base::add_input_section.
7670 Update merge section map only if Output_merge_base::add_input_section
7673 2010-04-07 Doug Kwan <dougkwan@google.com>
7675 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
7676 if section is marked as containing instructions but has no mapping
7678 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
7679 correct section index.
7680 (Arm_relobj::find_linked_text_section): Ditto.
7682 2010-04-07 Cary Coutant <ccoutant@google.com>
7684 * archive.cc (include_member): Destroy Read_symbols_data object before
7686 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
7687 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
7688 (Read_symbols_data::~Read_symbols_data) New destructor.
7689 (Section_relocs::Section_relocs) New constructor.
7690 (Section_relocs::~Section_relocs) New destructor.
7691 (Read_relocs_data::Read_relocs_data) New constructor.
7692 (Read_relocs_data::~Read_relocs_data) New destructor.
7693 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
7694 pointers to NULL after deleting.
7696 2010-04-07 Doug Kwan <dougkwan@google.com>
7698 * arm.cc: Replace "endianity" with "endianness" in comments.
7699 (Arm_exidx_cantunwind): Ditto.
7700 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
7701 (Arm_relobj::merge_flags_and_attributes): New method.
7702 (Arm_relobj::merge_flags_and_attributes_): New data member.
7703 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
7704 (Arm_relobj::scan_sections_for_stubs): Ditto.
7705 (Arm_relobj::do_read_symbols): Check to see if we really want to
7706 merge processor-specific flags and attributes. Exit early if
7707 an object is empty except for section names and the undefined symbol.
7708 (Target_arm::do_finalize_sections): Move check for ELF format to
7709 Arm_relobj::do_read_symbols. Merge processor specific flags and
7710 attributes from a regular object only when we have determined that
7711 it is aapropriate. Do not create an .ARM.attributes section in
7712 output if there is no regular input object.
7713 (Target_arm::merge_processor_specific_flags): Check
7714 --warn-mismatch before printing any error.
7715 (Target_arm::merge_object_attributes): Ditto.
7716 * gold.cc (queue_middle_tasks): Handle the case in which there is
7717 no regular object in input.
7718 * options.cc (General_options::parse_EB): New method.
7719 (General_options::parse_EL): Same.
7720 (General_options::General_options): Initialize endianness_.
7721 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
7723 (General_options::Endianness): New enum.
7724 (General_options::endianness): New method.
7725 (General_options::endianness_): New data member.
7726 * parameters.cc (Parameters::set_options): Check target endianness.
7727 (Parameters::set_target_once): Ditto.
7728 (Parameters::check_target_endianness): New method.
7729 (parameters_force_valid_target): If either -EL or -EB is specified,
7730 use it to define endianness of default target.
7731 * parameters.h (Parameters::check_target_endianness): New method
7733 * target.h (class Target): Change "endianity" to "endianness"
7736 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7738 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
7739 * configure: Regenerate.
7740 * Makefile.in: Regenerate.
7741 * testsuite/Makefile.in: Regenerate.
7743 2010-04-06 Cary Coutant <ccoutant@google.com>
7746 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
7747 prevailing definitions of common symbols.
7748 * testsuite/plugin_test_6.sh: New test case.
7749 * testsuite/plugin_common_test_1.c: New test case.
7750 * testsuite/plugin_common_test_2.c: New test case.
7751 * testsuite/Makefile.am (plugin_test_6): New test case.
7752 * testsuite/Makefile.in: Regenerate.
7754 2010-04-06 Nick Clifton <nickc@redhat.com>
7756 * po/vi.po: New Vietnamese translation.
7758 2010-03-30 Doug Kwan <dougkwan@google.com>
7760 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
7762 2010-03-25 Doug Kwan <dougkwan@google.com>
7764 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
7765 to avoid a conversion warning on a 32-bit host.
7767 2010-03-24 Ian Lance Taylor <iant@google.com>
7769 * testsuite/script_test_3.t: Add a TLS segment.
7770 * testsuite/Makefile.am (check_PROGRAMS): Add
7771 tls_phdrs_script_test.
7772 (tls_phdrs_script_test_SOURCES): Define.
7773 (tls_phdrs_script_test_DEPENDENCIES): Define.
7774 (tls_phdrs_script_test_LDFLAGS): Define.
7775 (tls_phdrs_script_test_LDADD): Define.
7776 * testsuite/Makefile.in: Rebuild.
7778 2010-03-23 Cary Coutant <ccoutant@google.com>
7780 * fileread.cc (find_or_make_view): Fix comment.
7782 2010-03-23 Ian Lance Taylor <iant@google.com>
7784 * script-sections.cc (class Orphan_section_placement): Define
7785 PLACE_TLS and PLACE_TLS_BSS.
7786 (Orphan_section_placement::Orphan_section_placement): Initialize
7788 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
7789 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
7790 (tls_script_test_SOURCES): Define.
7791 (tls_script_test_DEPENDENCIES): Define.
7792 (tls_script_test_LDFLAGS): Define.
7793 (tls_script_test_LDADD): Define.
7794 * testsuite/Makefile.in: Rebuild.
7796 2010-03-22 Doug Kwan <dougkwan@google.com>
7798 * arm.cc (Arm_relocate_functions::abs8,
7799 Arm_relocate_functions::abs16): Use correct check for overflow
7800 specified in the ARM ELF specs.
7801 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
7802 target of a BLX instruction specially.
7803 (Reloc_stub::stub_type_for_reloc): Ditto.
7804 (Relocate::relocate): Use symbolic names instead of numeric relocation
7805 codes to report error.
7806 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
7808 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
7809 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
7810 thumb2_blx_out_of_range.stdout
7811 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
7812 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
7813 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
7814 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
7815 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
7816 thumb2_blx_in_range, thumb2_blx_in_range.o,
7817 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
7818 thumb2_blx_out_of_range.o): New rules.
7819 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
7820 thumb2_blx_in_range and thumb2_blx_out_of_range.
7821 * testsuite/Makefile.in: Regenerate.
7822 * arm_branch_in_range.sh: Add tests for THUMB BLX.
7823 * testsuite/thumb_blx_in_range.s: New file.
7824 * testsuite/thumb_blx_out_of_range.s: New file.
7826 2010-03-22 Rafael Espindola <espindola@google.com>
7828 * archive.cc (Should_include): Move to archive.h.
7829 (should_include_member): Make it a member of Archive.
7831 (Add_lib_group_symbols): New.
7832 * archive.h: Include options.h.
7833 (Archive_member): Moved from Archive.
7834 (Should_include): Moved from archive.cc.
7836 (Add_lib_group_symbols): New.
7837 * dynobj.cc (do_should_include_member): New.
7838 * dynobj.h (do_should_include_member): New.
7839 * gold.cc (queue_initial_tasks): Update call to queue.
7840 * main.cc (main): Print lib group stats.
7841 * object.cc (do_should_include_member): New.
7842 * object.h: Include archive.h.
7843 (Object::should_include_member): New.
7844 (Object::do_should_include_member): New.
7845 (Sized_relobj::do_should_include_member): New.
7846 * options.cc (General_options::parse_start_lib): New.
7847 (General_options::parse_end_lib): New.
7848 (Input_arguments::add_file): Handle lib groups.
7849 (Input_arguments::start_group): Check we are not in a lib.
7850 (Input_arguments::start_lib): New.
7851 (Input_arguments::end_lib): New.
7852 * options.h (General_options): Add start_lib and end_lib.
7853 (Input_argument::lib_): New.
7854 (Input_argument::lib): New.
7855 (Input_argument::is_lib): New.
7856 (Input_file_lib): New.
7857 (Input_arguments::in_lib_): New.
7858 (Input_arguments::in_lib): New.
7859 (Input_arguments::start_lib): New.
7860 (Input_arguments::end_lib_): New.
7861 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
7862 in unused members as preempted.
7863 (Sized_pluginobj::do_should_include_member): New.
7864 * plugin.h (Sized_pluginobj::do_should_include_member): New.
7865 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
7867 (Read_symbols::do_whole_lib_group): New.
7868 (Read_symbols::do_lib_group): New.
7869 (Read_symbols::do_read_symbols): Handle lib groups.
7870 (Read_symbols::get_name): Handle lib groups.
7871 * readsyms.h (Read_symbols): Add an archive member pointer.
7872 (Read_symbols::do_whole_lib_group): New.
7873 (Read_symbols::do_lib_group): New.
7874 (Read_symbols::member_): New.
7875 * script.cc (read_input_script): Update call to queue_soon.
7877 2010-03-19 Doug Kwan <dougkwan@google.com>
7879 * arm.cc (Stub_table::Stub_table): Initialize new data members
7880 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7881 (Stub_table::add_reloc_stub): Assign stub offset and update
7882 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7883 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
7885 (Stub_table::update_data_size_and_addralign): Use
7886 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
7887 instead of going over all reloc stubs.
7888 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
7889 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7890 Stringpool_template::offset_ to size of Stringpool_char.
7891 (Stringpool_template::new_key_offset): Remove code to initialize
7892 Stringpool_template::offset_.
7893 * stringpool.h (Stringpool_template::set_no_zero_null): Set
7894 Stringpool_template::offset_ to zero.
7896 2010-03-15 Doug Kwan <dougkwan@google.com>
7898 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7900 (Stringpool_template::new_key_offset): New method.
7901 (Stringpool_template::add_string): Assign offsets when adding new
7903 (Stringpool_template::set_string_offsets): Do not set string offsets
7904 when not optimizing.
7905 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
7907 (Chunked_vector::clear): Clear size_.
7908 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
7909 (Chunked_vector::size): Return size_.
7910 (Chunked_vector::push_back): Use size_ to find insert position.
7911 (Chunked_vector::size_): New data member.
7912 (Stringpool_template::set_no_zero_null): Assert string set is empty.
7913 (Stringpool_template::new_key_offset): New method declaration.
7914 (Stringpool_template::offset_): New data member.
7916 2010-03-15 Rafael Espindola <espindola@google.com>
7918 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
7919 Add_symbols' constructor.
7920 * readsyms.h (Add_symbols): Remove the input_group member.
7922 2010-03-10 Ian Lance Taylor <iant@google.com>
7924 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
7925 target to ask whether a reference to a symbol requires a stack
7927 * target.h (Target::is_call_to_non_split): New function.
7928 (Target::do_is_call_to_non_split): Declare virtual function.
7929 * target.cc: Include "symtab.h".
7930 (Target::do_is_call_to_non_split): New function.
7931 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
7933 2010-03-10 Cary Coutant <ccoutant@google.com>
7935 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
7936 (File_read::open[1]): Remove initial mapping of whole_file_view_.
7937 (File_read::open[2]): Add whole_file_view_ to list of views.
7938 (File_read::make_view): Remove test of whole_file_view_.
7939 (File_read::find_or_make_view): Create whole_file_view_ if
7941 (File_read::clear_views): Replace bool parameter with enum;
7942 adjust all callers. Don't delete views with permanent data;
7943 do delete cached views and views from archives if
7944 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
7945 if clearing the corresponding view.
7946 * fileread.h (File_read::Clear_views_mode): New enum.
7947 (File_read::View::is_permanent_view): New method.
7948 (File_read::clear_views): Replace bool parameter
7949 with enum; adjust all callers.
7950 * options.h (General_options): Change keep_files_mapped option;
7951 add map_whole_files.
7952 * readsyms.cc (Add_symbols::run): Delete sd_ object before
7954 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
7957 2010-03-10 David S. Miller <davem@davemloft.net>
7959 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
7961 2010-03-09 Sriraman Tallam <tmsriram@google.com>
7963 * icf.cc (get_section_contents): Add '@' marker after processing the
7966 2010-03-08 Doug Kwan <dougkwan@google.com>
7968 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
7969 due to a conversion warning.
7970 (Arm_relobj::update_output_local_symbol_count): Check for local
7971 symbol with unset output index.
7973 2010-03-05 Ian Lance Taylor <iant@google.com>
7975 * options.h (class General_options): Add --spare-dynamic-tags.
7976 * output.cc (Output_data_dynamic::set_final_data_size): Implement
7977 --spare-dynamic-tags.
7979 2010-03-05 Ian Lance Taylor <iant@google.com>
7981 * incremental.cc: Include "libiberty.h".
7983 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
7985 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
7986 function, is_info_ member.
7987 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
7988 (Versions::Versions): Update caller.
7989 (Versions::define_base_version): Likewise.
7990 (Versions::add_def): Likewise.
7992 2010-03-03 Sriraman Tallam <tmsriram@google.com>
7994 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
7995 (Scan::possible_function_pointer_reloc): New function.
7996 (Scan::local_reloc_may_be_function_pointer): Change to call
7997 possible_function_pointer_reloc.
7998 (Scan::global_reloc_may_be_function_pointer): Ditto.
7999 * icf.h (Icf::check_section_for_function_pointers): Change to reject
8000 relocations in ".data.rel.ro._ZTV" section.
8001 * testsuite/icf_safe_so_test.sh: Change to pass i386.
8002 * testsuite/icf_safe_so_test.cc: Ditto.
8003 * testsuite/icf_safe_test.cc: Ditto.
8004 * testsuite/icf_safe_test.sh: Ditto.
8006 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8007 Ian Lance Taylor <iant@google.com>
8009 * target-reloc.h (relocate_section): Check the symbol table index
8010 for -1U before setting the local symbol index.
8011 (scan_relocatable_relocs): If copying the relocation, record that
8012 the local symbol is required.
8013 * object.h (Symbol_value::is_output_symtab_index_set): New
8015 (Symbol_value::may_be_discarded_from_output_symtab): New
8017 (Symbol_value::has_output_symtab_entry): New function.
8018 (Symbol_value::needs_output_symtab_entry): Remove.
8019 (Symbol_value::output_symtab_index): Make sure the symbol index is
8021 (Symbol_value::set_output_symtab_index): Make sure the symbol
8022 index is not set. Make sure the new index is valid.
8023 (Symbol_value::set_must_have_output_symtab_entry): New function.
8024 (Symbol_value::has_output_dynsym_entry): New function.
8025 (Symbol_value::set_output_dynsym_index): Make sure the new index
8027 (Sized_relobj::set_must_have_output_symtab_entry): New function.
8028 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
8029 local symbol if permitted.
8030 (Sized_relobj::do_finalize_local_symbols): Call
8031 is_output_symtab_index_set rather than needs_output_symtab_entry.
8032 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
8033 rather than needs_output_symtab_entry. Call
8034 has_output_dynsym_entry rather than needs_output_dynsym_entry.
8035 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
8036 is_output_symtab_index_set rather than needs_output_symtab_entry.
8037 * testsuite/discard_locals_relocatable_test.c: New file.
8038 * testsuite/discard_locals_test.sh: Test -r.
8039 * testsuite/Makefile.am (check_DATA): Add
8040 discard_locals_relocatable_test1.syms,
8041 discard_local_relocatable_test2.syms.
8042 (MOSTLYCLEANFILES): Likewise. Also add
8043 discard_locals_relocatable_test1.lout and
8044 discard_locals_relocatable_test2.out.
8045 (discard_locals_relocatable_test1.syms): New target.
8046 (discard_locals_relocatable_test.o): New target.
8047 (discard_locals_relocatable_test1.out): New target.
8048 (discard_locals_relocatable_test2.syms): New target.
8049 (discard_locals_relocatable_test2.out): New target.
8050 (various): Add missing ../ld-new dependencies.
8051 * testsuite/Makefile.in: Rebuild.
8053 2010-03-03 Nick Clifton <nickc@redhat.com>
8055 * po/fi.po: New Finnish translation.
8057 2010-03-01 Doug Kwan <dougkwan@google.com>
8059 * layout.cc (Layout::Layout): Force section types of .init_array*,
8060 .preinit_array* and .fini_array* sections.
8061 * output.cc (Output_section::Input_section_sort_entry::has_priority):
8062 Fix check of return value of std::string::find.().
8063 (Output_section::Input_section_sort_compare::operator()): Remove
8064 comment about .init_array.
8065 (Output_section::Input_section_sort_init_fini_compare::operator()):
8067 (Output_section::sort_attached_input_sections): Handle .init_array
8068 and .fini_array specially.
8069 * output.h (Output_section::Inut_section_sort_compare): Update
8071 (Output_section::Input_section_sort_init_fini_compare): New struct.
8073 2010-02-26 Doug Kwan <dougkwan@google.com>
8075 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
8076 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
8077 * testsuite/debug_msg.sh: Avoid matching source line number for
8078 use of global variable undef_int.
8080 2010-02-26 Doug Kwan <dougkwan@google.com>
8082 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
8083 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
8084 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
8085 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
8086 * options.cc (General_options::General_options): Initialize member
8088 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
8089 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
8090 and rm_no_fix_v4bx.stdout
8091 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
8092 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
8093 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
8094 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
8095 and arm_no_fix_v4bx.
8096 * Makefile.in: Regenerate.
8097 * testsuite/arm_fix_v4bx.s: New file.
8098 * testsuite/arm_fix_v4bx.sh: Ditto.
8100 2010-02-24 Doug Kwan <dougkwan@google.com>
8102 * arm.cc (Target_arm::got_section): Make the .got section the first
8103 non RELRO section in the data segment.
8104 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
8105 suffixes of section names.
8107 2010-02-24 Doug Kwan <dougkwan@google.com>
8109 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
8110 flags and attributes merging if an input file is a binary file.
8111 * fileread.cc (Input_file::open): Record format of original file.
8112 * fileread.h (Input_file::Format): New enum type.
8113 (Input_file::Input_file): Initialize data member format_.
8114 (Input_file::format): New method definition.
8115 (Input_file::format_):: New data member.
8117 2010-02-24 Doug Kwan <dougkwan@google.com>
8119 * arm.cc (Arm_output_data_got): New class.
8120 (ARM_TCB_SIZE): New constant
8121 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
8122 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
8123 If user uses a script with a SECTIONS clause, issue only a warning
8124 for a misplaced EXIDX input section. Otherwise, issue an error.
8125 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
8127 (Target_arm::got_mode_index_entry): Handle static linking.
8128 (Target_arm::Scan::local): Ditto.
8129 (Target_arm::Scan::global): Ditto.
8130 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
8131 all incorrectly implemented relocations.
8132 (Target_arm::fix_exidx_coverage): Pass layout to
8133 Arm_output_section::fix_exidx_coverage.
8134 * layout.cc (Layout::section_name_mapping): Remove trailing dots
8135 from ".ARM.exidx." and ".ARM.extab.".
8137 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8139 * arm.cc (Target_arm::do_finalize_sections): Create attribute
8140 section if it does not already exist.
8141 * attributes.cc (Attributes_section_data::Attributes_section_data):
8142 Don't crash if size is zero.
8144 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8145 Ian Lance Taylor <iant@google.com>
8147 * gold.cc (queue_middle_tasks): If no input files were opened,
8149 * workqueue.h (Task_function::Task_function): Assert that there is
8152 2010-02-22 Doug Kwan <dougkwan@google.com>
8154 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
8155 * icf.cc (get_section_contents): Cast snprintf arguments to long long
8156 types to avoid warnings due to different uint64_t implementations
8159 2010-02-21 Doug Kwan <dougkwan@google.com>
8161 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
8162 handling of the maximum backward branch offset.
8163 (Arm_relocate_functions::thumb_branch_common): Ditto.
8164 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
8165 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
8166 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
8167 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
8168 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
8169 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
8170 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
8171 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
8172 thumb_bl_out_of_range thumb_bl_out_of_range.o,
8173 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
8174 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
8175 thumb2_bl_out_of_range.o): New rules.
8176 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
8177 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
8178 thumb2_bl_out_of_range
8179 * testsuite/Makefile.in: Regenerate.
8180 * testsuite/arm_bl_in_range.s: New file.
8181 * testsuite/arm_bl_out_of_range.s: Ditto.
8182 * testsuite/arm_branch_in_range.sh: Ditto.
8183 * testsuite/arm_branch_range.t: Ditto.
8184 * testsuite/thumb2_branch_range.t: Ditto.
8185 * testsuite/thumb_bl_in_range.s: Ditto.
8186 * testsuite/thumb_bl_out_of_range.s: Ditto.
8187 * testsuite/thumb_branch_range.t: Ditto.
8189 2010-02-20 Sriraman Tallam <tmsriram@google.com>
8191 * gc.h (gc_process_relocs): Change vectors to point to the new list.
8192 Add reloc offset information.
8193 * icf.cc (get_section_contents): Change iterators to point to the new
8194 vectors. Add reloc offset information to the contents.
8195 * icf.h (Icf::Sections_reachable_info): New typedef.
8196 (Icf::Sections_reachable_list): New typedef.
8197 (Icf::Offset_info): New typedef.
8198 (Icf::Reloc_info): New struct typedef.
8199 (Icf::Reloc_info_list): New typedef.
8200 (Icf::symbol_reloc_list): Delete method.
8201 (Icf::addend_reloc_list): Delete method.
8202 (Icf::section_reloc_list): Delete method.
8203 (Icf::reloc_info_list): New method.
8204 (Icf::reloc_info_list_): New member.
8206 2010-02-19 Doug Kwan <dougkwan@google.com>
8208 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
8209 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
8210 * arm.cc (Arm_relocation_functions): New forward declaration.
8211 (Target_arm::Target_arm): Initialize new data members
8212 got_mod_index_offset_ and tls_base_symbol_defined_.
8213 (Target_arm::Relocate::relocate_tls): New method.
8214 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
8215 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
8217 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
8218 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
8219 (Target_arm::got_mod_index_offset_,
8220 Target_arm::tls_base_symbol_defined_): New data members.
8221 (Target_arm::Scan::local, Target::Scan::global,
8222 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
8225 2010-02-18 Doug Kwan <dougkwan@google.com>
8227 * arm.cc (Arm_relobj::find_linked_text_section): New method.
8228 (Arm_relobj::make_exidx_input_section): Pass section index of linked
8229 text section as a parameter becuase some broken tools may not set
8230 the link in section header.
8231 (Target_arm::has_got_section): New method.
8232 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
8233 without any mapping symbol as data only. Remove warning.
8234 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
8235 link in its section header, try to discover the link by inspecting the
8236 REL31 relocation at the beginning of the section.
8237 (Target_arm::Scan::check_non_pic): Report name of offending relocation
8239 (Target_arm::Scan::global): Treat any reference to the symbol
8240 _GLOBAL_OFFSET_TABLE_ as a GOT access.
8242 2010-02-12 Sriraman Tallam <tmsriram@google.com>
8244 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
8245 (Scan::global_reloc_may_be_function_pointer): New function.
8246 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8247 (Scan::global_reloc_may_be_function_pointer): New function.
8248 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8249 (Scan::global_reloc_may_be_function_pointer): New function.
8250 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
8251 (Scan::global_reloc_may_be_function_pointer): New function.
8252 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
8253 (Scan::global_reloc_may_be_function_pointer): New function.
8254 (Scan::possible_function_pointer_reloc): New function.
8255 (Target_x86_64::can_check_for_function_pointers): New function.
8256 * gc.h (gc_process_relocs): Scan relocation types to determine if
8257 function pointers were taken for targets that support it.
8258 * icf.cc (Icf::find_identical_sections): Include functions for
8259 folding in safe ICF whose pointer is not taken.
8260 * icf.h (Secn_fptr_taken_set): New typedef.
8261 (fptr_section_id_): New member.
8262 (section_has_function_pointers): New function.
8263 (set_section_has_function_pointers): New function.
8264 (check_section_for_function_pointers): New function.
8265 * options.h: Fix comment for safe ICF option.
8266 * target.h (can_check_for_function_pointers): New function.
8267 * testsuite/Makefile.am: Add icf_safe_so_test test case.
8268 Modify icf_safe_test for X86-64.
8269 * testsuite/Makefile.in: Regenerate.
8270 * testsuite/icf_safe_so_test.cc: New file.
8271 * testsuite/icf_safe_so_test.sh: New file.
8272 * testsuite/icf_safe_test.cc (kept_func_3): New function.
8273 (main): Change to take pointer to function kept_func_3.
8274 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
8275 folding is done correctly for X86-64.
8277 2010-02-12 David S. Miller <davem@davemloft.net>
8279 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
8280 is_symbolless parameter.
8281 (Output_reloc<SHT_REL>::is_symbolless): New.
8282 (Output_reloc<SHT_REL>::is_symbolless_): New.
8283 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
8284 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
8285 (Output_reloc<SHT_RELA>::is_symbolless): New.
8286 (Output_data_reloc::add_global): Handle is_symbolless.
8287 (Output_data_reloc::add_global_relative): Likewise.
8288 (Output_data_reloc::add_local): Likewise.
8289 (Output_data_reloc::add_local_relative): Likewise.
8290 (Output_data_reloc::add_symbolless_global_addend): New.
8291 (Output_data_reloc::add_symbolless_local_addend): New.
8292 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
8294 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
8295 instead of ->is_relative_
8296 (Output_reloc::write): Likewise.
8297 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
8298 (Output_reloc::write_rel): Simplify.
8300 * sparc.cc (Target_sparc::Scan::local): Use
8301 ->add_symbolless_local_addend as needed.
8302 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
8303 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
8304 based upon relocation offset.
8306 2010-02-11 Doug Kwan <dougkwan@google.com>
8308 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
8309 (Target_arm::Scan::global): Ditto. Also remove a comment before the
8310 beginning of function.
8311 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
8312 and MOVT_ABS relocations. Those are non issued in scanning. Fix
8313 parameter is_32bit in calls to should_apply_static_reloc.
8314 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
8315 (check_DATA): Add arm_abs_global.stdout.
8316 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
8317 arm_abs_global.stdout): New rules.
8318 (MOSTLLYCLEANFILES): Add arm_abs_global
8319 * Makefile.in: Regenerate.
8320 * testsuite/arm_abs_global.s: New file.
8321 * testsuite/arm_abs_global.sh: Ditto.
8322 * testsuite/arm_abs_lib.s: Ditto.
8324 2010-02-11 Ian Lance Taylor <iant@google.com>
8326 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
8328 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
8329 Allocate_commons_task first.
8330 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
8331 task, rather than symtab_lock_.
8332 (Gc_process_relocs::~Gc_process_relocs): New function.
8333 (Gc_process_relocs::is_runnable): Check this_blocker_.
8334 (Gc_process_relocs::locks): Use next_blocker_ rather than
8336 (Scan_relocs::~Scan_relocs): New function.
8337 (Scan_relocs::is_runnable): Check this_blocker_ rather than
8339 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
8341 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
8342 fields. Add this_blocker_ and next_blocker_ fields. Adjust
8343 constructor accordingly.
8344 (class Gc_process_relocs): Likewise.
8345 (class Scan_relocs): Likewise.
8346 * common.h (class Allocate_commons_task): Remove symtab_lock_
8347 field, and corresponding constructor parameter.
8348 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
8350 (Allocate_commons_task::locks): Likewise.
8352 2010-02-11 Ian Lance Taylor <iant@google.com>
8354 * gold-threads.h (class Once): Define.
8355 (class Initialize_lock): Rewrite as child of Once.
8356 * gold-threads.cc (class Once_initialize): Define.
8357 (once_pointer_control): New static variable.
8358 (once_pointer, once_arg): New static variables.
8359 (c_run_once): New static function.
8360 (Once::Once, Once::run_once, Once::internal_run): New functions.
8361 (class Initialize_lock_once): Remove.
8362 (initialize_lock_control): Remove.
8363 (initialize_lock_pointer): Remove.
8364 (initialize_lock_once): Remove.
8365 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
8366 (Initialize_lock::initialize): Rewrite.
8367 (Initialize_lock::do_run_once): New function.
8368 * archive.cc (Archive::interpret_header): Only clear name if it is
8370 * fileread.cc: Include "gold-threads.h"
8371 (file_counts_lock): New static variable.
8372 (file_counts_initialize_lock): Likewise.
8373 (File_read::release): Only increment counts when using --stats.
8374 Use a lock around the increment.
8375 * parameters.cc (class Set_parameters_target_once): Define.
8376 (set_parameters_target_once): New static variable.
8377 (Parameters::Parameters): Move here from parameters.h.
8378 (Parameters::set_target): Rewrite.
8379 (Parameters::set_target_once): New function.
8380 (Parameters::clear_target): Move here and rewrite.
8381 * parameters.h (class Parameters): Update declarations. Add
8382 set_parameters_target_once_ field.
8383 (Parameters::Parameters): Move to parameters.cc.
8384 (Parameters::clear_target): Likewise.
8385 * readsyms.cc (Read_symbols::do_group): Create a Start_group
8387 (Start_group::~Start_group): New function.
8388 (Start_group::is_runnable): New function.
8389 (Start_group::locks, Start_group::run): New functions.
8390 (Finish_group::run): Change saw_undefined to size_t.
8391 * readsyms.h (class Start_group): Define.
8392 (class Finish_group): Change saw_undefined_ field to size_t.
8393 (Finish_group::Finish_group): Remove saw_undefined and
8394 this_blocker parameters. Change all callers.
8395 (Finish_group::set_saw_undefined): New function.
8396 (Finish_group::set_blocker): New function.
8397 * symtab.h (class Symbol_table): Change saw_undefined to return
8398 size_t. Change saw_undefined_ field to size_t.
8399 * target-select.cc (Set_target_once::do_run_once): New function.
8400 (Target_selector::Target_selector): Initialize set_target_once_
8401 field. Don't initialize lock_ and initialize_lock_ fields.
8402 (Target_selector::instantiate_target): Rewrite.
8403 (Target_selector::set_target): New function.
8404 * target-select.h (class Set_target_once): Define.
8405 (class Target_selector): Update declarations. Make
8406 Set_target_once a friend. Remove lock_ and initialize_lock_
8407 fields. Add set_target_once_ field.
8409 2010-02-10 Ian Lance Taylor <iant@google.com>
8411 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
8413 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
8414 (queue_middle_tasks): Add all blockers before queueing any tasks.
8415 (queue_final_tasks): Likewise.
8416 * token.h (Task_token::add_blockers): New function.
8417 * object.h (Input_objects::number_of_relobjs): New function.
8419 2010-02-10 Ian Lance Taylor <iant@google.com>
8421 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
8422 shared, not if not position independent.
8423 * x86_64.cc (Relocate::relocate_tls): Likewise.
8424 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
8425 (tls_pie_pic_test): New target.
8426 * testsuite/Makefile.in: Rebuild.
8428 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
8429 (tls_test_main_pie.o, tls_test_pie.o): New targets.
8430 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
8431 * testsuite/Makefile.in: Rebuild.
8433 2010-02-09 David S. Miller <davem@davemloft.net>
8435 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
8436 R_SPARC_RELATIVE using ->add_local_relative().
8437 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
8439 * output.h (Output_data_dynamic::add_section_size): New method
8440 that takes two Output_data objects.
8441 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
8442 entry param. Handle it in initializers.
8443 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
8444 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
8445 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
8447 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
8448 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
8449 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
8450 for dynrel_includes_plt.
8451 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8452 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8453 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
8455 (Target_sparc::do_finalize_sections): Update to pass true for
8456 dynrel_includes_plt.
8457 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
8458 output before .rela.plt
8459 (Target_powerpc::do_finalize_sections): Update to pass true for
8460 dynrel_includes_plt when 32-bit.
8462 2010-02-08 Doug Kwan <dougkwan@google.com>
8464 * arm.cc (Arm_relobj::simple_input_section_output_address): New
8466 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
8467 Arm_relobj::scan_section_for_cortex_a8_stubs,
8468 Arm_relobj::do_relocation_section): Instead of calling
8469 Output_section::output_address, use faster
8470 Arm_relobj::simple_input_section_output_address.
8472 2010-02-08 David S. Miller <davem@davemloft.net>
8474 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
8475 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
8476 relocation helper function.
8478 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
8479 just like R_SPARC_GOT{10,13,22}.
8480 (Target_sparc::Scan::local): Likewise.
8481 (Target_sparc::Relocate:relocate): Likewise.
8483 2010-02-06 Ian Lance Taylor <iant@google.com>
8485 * configure.ac: Rewrite targetobjs duplicate removal code to use
8486 only shell constructs.
8487 * configure: Rebuild.
8489 2010-02-05 Doug Kwan <dougkwan@google.com>
8492 * arm.cc (Arm_relobj::section_is_scannable): New method.
8493 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
8494 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
8496 2010-02-04 Doug Kwan <dougkwan@google.com>
8499 * arm-reloc-property.cc (cstdio): Include.
8500 * configure.ac (targetobjs): Remove duplicates.
8501 * configure: Regenerate.
8502 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
8503 big and little endian version for a given address size.
8505 2010-02-03 Doug Kwan <dougkwan@google.com>
8507 * arm-reloc-property.cc
8508 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8510 * arm-reloc-property.h
8511 (Arm_reloc_property_table::get_implemented_static_reloc_property):
8512 New method definition.
8513 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8515 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
8517 (GOT_PREL): Change implemented to Y.
8518 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
8519 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
8520 (Arm_relocate_functions::movw_abs_nc): Remove method.
8521 (Arm_relocate_functions::movt_abs): Ditto.
8522 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
8523 (Arm_relocate_functions::thm_movt_abs): Ditto.
8524 (Arm_relocate_functions::movw_rel_nc): Ditto.
8525 (Arm_relocate_functions::movw_rel): Ditto.
8526 (Arm_relocate_functions::movt_rel): Ditto.
8527 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
8528 (Arm_relocate_functions:thm_movw_rel): Ditto.
8529 (Arm_relocate_functions:thm_movt_rel): Ditto.
8530 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
8531 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
8532 New method definitions.
8533 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
8534 (Arm_relocation_functions::arm_grp_ldr): Ditto.
8535 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
8536 (Arm_relocation_functions::arm_grp_ldc): Ditto.
8537 (Target_arm::Relocate::relocate): Check for non-static or
8538 unimplemented relocation code and exit early. Change calls to
8539 Target_arm::reloc_uses_thumb_bit and
8540 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
8541 instead. Refactor code to handle similar relocations to increase
8542 code sharing. Remove check for unsupported relocation code in switch
8544 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
8545 relocation property table to find out size. Change error message to
8546 print out the name of a relocation code instead of the numeric value.
8547 (Target_arm::scan_reloc_for_stub): Use relocation property table
8548 instead of calling Target_arm::reloc_uses_thumb_bit().
8550 2010-02-02 Doug Kwan <dougkwan@google.com>
8552 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
8553 types of relaxed input section.
8555 2010-02-02 Doug Kwan <dougkwan@google.com>
8557 * Makefile.am (HFILES): Add arm-reloc-property.h.
8559 (TARGETSOURCES): Add arm-reloc-property.cc
8560 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
8561 (libgold_a_SOURCES): $(DEFFILES)
8562 * Makefile.in: Regenerate.
8563 * arm-reloc-property.cc: New file.
8564 * arm-reloc-property.h: New file.
8565 * arm-reloc.def: New file.
8566 * arm.cc: Update comments.
8567 (arm-reloc-property.h): New included header.
8568 (arm_reloc_property_table): New global variable.
8569 (Target_arm::do_select_as_default_target): New method definition.
8570 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
8571 arm-reloc-property to targ_extra_obj.
8572 * parameters.cc (set_parameters_target): Call
8573 Target::select_as_default_target().
8574 * target.h (Target::select_as_default_target): New method definition.
8575 (Target::do_select_as_default_target): Same.
8577 2010-02-01 Doug Kwan <dougkwan@google.com>
8579 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
8580 first_output_text_section_.
8581 (Arm_exidx_fixup::first_output_text_section): New method definition.
8582 (Arm_exidx_fixup::first_output_text_section_): New data member.
8583 (Arm_exidx_fixup::process_exidx_section): Record the first text
8584 output section seen.
8585 (Arm_output_section::fix_exidx_coverage): Set correct linked section
8586 and entsize in output section header.
8588 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8590 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
8591 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
8592 (Arm_relocate_functions::thm_alu11): New Method.
8593 (Arm_relocate_functions::thm_pc8): New Method.
8594 (Arm_relocate_functions::thm_pc12): New Method.
8595 (Target_arm::Scan::local): Handle the relocations.
8596 (Target_arm::Scan::global): Likewise.
8597 (Target_arm::Relocate::relocate): Likewise.
8598 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8600 2010-01-29 Doug Kwan <dougkwan@google.com>
8602 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
8603 of relocation types as ld.
8605 2010-01-29 Doug Kwan <dougkwan@google.com>
8607 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
8609 (Arm_relocate_functions::thumb_branch_common): Ditto.
8610 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
8611 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
8612 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
8613 Arm_relocate_functions::jump24): Remove.
8614 (Target_arm::Relocate::relocate): Adjust code to call
8615 Arm_relocation_functions::arm_branch_common and
8616 Arm_relocation_functions::thumb_branch_common instead of their removed
8617 wrappers. Merge switch-cases together to reduce source code size.
8619 2010-01-29 Doug Kwan <dougkwan@google.com>
8621 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
8622 output_local_symbol_count_needs_update_.
8623 (Arm_relobj::output_local_symbol_count_needs_update,
8624 Arm_relobj::set_output_local_symbol_count_needs_update,
8625 Arm_relobj::update_output_local_symbol_count): New methods.
8626 (Arm_relobj::output_local_symbol_count_needs_update_): New data
8628 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
8629 of pointed function as in a R_ARM_PREL31 relocation.
8630 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
8631 for output local symbol count updating.
8632 (Target_arm::do_relax): Update output local symbol counts in objects
8634 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
8636 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8638 * arm.cc: Added support for the ARM relocations:
8639 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
8640 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
8641 (Arm_relocate_functions::movw_rel_nc): Renamed (was
8643 (Arm_relocate_functions::movw_rel): New method.
8644 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
8645 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
8647 (Arm_relocate_functions::thm_movw_rel): New method.
8648 (Arm_relocate_functions::thm_movt_rel): Renamed (was
8650 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
8652 (Target_arm::Scan::global): Likewise.
8653 (Target_arm::Relocate::relocate): Likewise.
8654 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8657 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8659 * arm.cc: Added support for ARM group relocations.
8660 (Target_arm::reloc_needs_sym_origin): New method.
8661 (Arm_relocate_functions::calc_grp_kn): New method.
8662 (Arm_relocate_functions::calc_grp_residual): New method.
8663 (Arm_relocate_functions::calc_grp_gn): New method.
8664 (Arm_relocate_functions::arm_grp_alu): New Method.
8665 (Arm_relocate_functions::arm_grp_ldr): New Method.
8666 (Arm_relocate_functions::arm_grp_ldrs): New Method.
8667 (Arm_relocate_functions::arm_grp_ldc): New Method.
8668 (Target_arm::Scan::local): Handle the ARM group relocations.
8669 (Target_arm::Scan::global): Likewise.
8670 (Target_arm::Relocate::relocate): Likewise.
8671 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8674 2010-01-26 Doug Kwan <dougkwan@google.com>
8676 * arm.cc (set): Include.
8677 (class Arm_exidx_fixup): Change type of last_input_section_ to const
8679 (Arm_output_section::Text_section_list): New type.
8680 (Arm_output_section::append_text_sections_to_list): New method.
8681 (Arm_output_section::fix_exidx_coverage): Ditto.
8682 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
8683 (Arm_relobj::convert_input_section_to_relaxed_section): Use
8684 Relobj::set_section_offset() instead of
8685 Sized_relobj::invalidate_section_offset().
8686 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
8687 parameter for section headers. Ignore relocation sections for
8688 unallocated sections and EXIDX sections.
8689 (Target_arm::fix_exidx_coverage): New method.
8690 (Target_arm::output_section_address_less_than): New type.
8691 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
8692 linked text section instead of the EXIDX section.
8693 (Arm_output_section::create_stub_group): Add an assertion to check
8694 that this is not an EXIDX output section.
8695 (Arm_output_section::append_text_sections_to_list): New method.
8696 (Arm_output_section::fix_exidx_coverage): Ditto.
8697 (Arm_relobj::scan_sections_for_stubs): Adjust call to
8698 Arm_relobj::section_needs_reloc_stub_scanning.
8699 (Target_arm::do_relax): Fix EXIDX output section coverage in the
8701 (Target_arm::fix_exidx_coverage): New method.
8702 * object.h (Relobj::set_output_section): New method.
8703 (Sized_relobj::invalidate_section_offset): Remove method.
8704 (Sized_relobj::do_invalidate_section_offset): Remove method.
8705 (Sized_relobj::do_set_section_offset): Handle offset value -1.
8707 2010-01-25 Doug Kwan <dougkwan@google.com>
8709 * arm.cc (Arm_exidx_merged_section::do_output_offset):
8710 Fix warning due to signed and unsigned comparison on a 32-bit host.
8712 2010-01-22 Doug Kwan <dougkwan@google.com>
8714 * arm.cc (Target_arm::do_relax): Record an output section for section
8715 offset adjustment it contains any stub table that has changed.
8716 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
8717 offsets in an output section if necessary.
8718 * output.cc (Output_section::Output_section): Initialize
8719 section_offsets_need_adjustments_.
8720 (Output_section::add_input_section_for_script): Renamed to
8721 Output_section::add_simple_input_section.
8722 (Output_section::save_states): Add a comment.
8723 (Output_section::discard_states): New method defintion.
8724 (Output_section::adjust_section_offsets): Same.
8725 * output.h (Output_section::add_input_section_for_script): Renamed to
8726 Output_section::add_simple_input_section.
8727 (Output_section::discard_states): New method declaration.
8728 (Output_section::adjust_section_offsets): Same.
8729 (Output_section::section_offsets_need_adjustment,
8730 Output_section::set_section_offsets_need_adjustment): New method
8732 (Output_section::section_offsets_need_adjustment_): New data member.
8733 * script-sections.cc
8734 (Output_section_element_input::set_section_address): Adjust code for
8735 renaming of Output_section::add_input_section_for_script.
8736 (Orphan_output_section::set_section_address): Same.
8738 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8740 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
8741 Fix_v4bx enum values .
8742 * gold/options.h (General_options): New option definitions.
8743 (General_options::fix_v4bx): New method.
8744 (General_options::Fix_v4bx): New enum.
8745 * gold/options.cc (General_options::parse_fix_v4bx): New method.
8746 (General_options::parse_fix_v4bx_interworking): New method.
8748 2010-01-22 Doug Kwan <dougkwan@google.com>
8750 * arm.cc (Arm_exidx_fixup): New class.
8752 2010-01-21 Doug Kwan <dougkwan@google.com>
8754 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
8756 (Arm_exidx_section_offset_map): New type.
8758 2010-01-21 Doug Kwan <dougkwan@google.com>
8760 * arm.cc (Arm_exidx_input_section): New class.
8761 (Arm_relobj::exidx_input_section_by_link,
8762 Arm_relobj::exidx_input_section_by_shndx,
8763 Arm_relobj::make_exidx_input_section): New methods.
8764 (read_arm_attributes_section): Remove.
8765 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
8766 information about them.
8767 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
8770 2010-01-20 Doug Kwan <dougkwan@google.com>
8772 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
8773 Input_section_specifier to Section_id.
8774 (Target_arm::new_arm_input_section: Adjust code for change of key
8776 (Target_arm::find_arm_input_section): Ditto.
8777 * gc.h (object.h): Include for Section_id nand Section_id_hash.
8778 (Section_id): Remove.
8779 (Garbage_collection::Section_id_hash): Remove.
8780 * icf.h (object.h): Include for Section_id nand Section_id_hash.
8781 (Section_id): Remove.
8782 (Icf::Section_id_hash): Remove.
8783 * object.h (Section_id, Const_section_id, Section_id_hash,
8784 Const_section_id_hash): New type definitions.
8785 * output.cc (Output_section::add_relaxed_input_section): Change to
8786 use Const_section_id instead of Input_section_specifier as key type.
8787 (Output_section::add_merge_input_section): Ditto.
8788 (Output_section::build_relaxation_map): Change to use Section_id
8789 instead of Input_section_specifier as key type.
8790 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8792 (Output_section::convert_input_sections_to_relaxed_sections): Change
8793 to use Const_section_id instead of Input_section_specifier as key type.
8794 (Output_section::find_merge_section): Ditto.
8795 (Output_section::find_relaxed_input_section): Ditto.
8796 * output.h (Input_section_specifier): Remove class.
8797 (Output_section::Output_section_data_by_input_section_map): Change
8798 key type to Const_section_id.
8799 (Output_section::Output_relaxed_input_section_by_input_section_map):
8801 (Output_section::Relaxation_map): Change key type to Section_id.
8803 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8805 * gold/arm.cc: Added support for R_ARM_V4BX relocation
8806 (class Arm_v4bx_stub): New class.
8807 (DEF_STUBS): Updated definition to support v4_veneer_bx.
8808 (Stub_factory::make_arm_v4bx_stub): New method.
8809 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
8810 (Stub_table::empty): Handle v4bx stubs.
8811 (Stub_table::add_arm_v4bx_stub): New method.
8812 (Stub_table::find_arm_v4bx_stub): New method.
8813 (Arm_relocate_functions::v4bx): New method.
8814 (Target_arm::fix_v4bx): New method.
8815 (Target_arm::Target_arm): Handle R_ARM_V4BX.
8816 (Stub_table::relocate_stubs): Likewise.
8817 (Stub_table::do_write): Likewise.
8818 (Stub_table::update_data_size_and_addralign): Likewise.
8819 (Stub_table::finalize_stubs): Likewise.
8820 (Target_arm::Scan::local): Likewise.
8821 (Target_arm::Scan::global): Likewise.
8822 (Target_arm::do_finalize_sections): Likewise.
8823 (Target_arm::Relocate::relocate): Likewise.
8824 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8826 (Target_arm::scan_reloc_for_stub): Likewise.
8827 (Target_arm::scan_reloc_section_for_stubs): Likewise.
8829 2010-01-19 Ian Lance Taylor <iant@google.com>
8831 * output.cc (Output_section_headers::do_sized_write): Write large
8832 segment count to sh_info field.
8833 (Output_file_header::do_sized_write): For large segment count,
8834 write PN_XNUM to e_phnum field.
8836 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8838 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
8839 (Arm_relocate_functions::thm_jump8): New function.
8840 (Arm_relocate_functions::thm_jump11): New function.
8841 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
8843 (Target_arm::Scan::global): Likewise.
8844 (Target_arm::Relocate::relocate): Likewise.
8845 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8848 2010-01-14 Doug Kwan <dougkwan@google.com>
8850 * arm.cc (map, utility): Include headers.
8851 (Target_arm::apply_cortex_a8_workaround): New method.
8852 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
8853 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
8854 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
8855 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
8856 the --[no-]fix-cortex-a8 command line options.
8857 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
8858 (Target_arm::relocate_stub): Use addend in instruction template.
8859 * options.h (DEFINE_bool): Set the user-set flag.
8860 (General_options): Add --[no-]-fix-cortex options.
8861 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
8862 : Update fast look-up map after conversion.
8864 2010-01-14 Sriraman Tallam <tmsriram@google.com>
8866 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
8867 in the first pass of do_layout.
8869 2010-01-13 Doug Kwan <dougkwan@google.com>
8871 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8872 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
8873 apparent compiler problem of not folding static constant integral
8874 data members of elfcpp::Elf_sizes<32>.
8876 2010-01-13 Doug Kwan <dougkwan@google.com>
8878 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8879 Arm_relobj::section_needs_cortex_a8_stub_scanning,
8880 Arm_relobj::scan_section_for_cortex_a8_erratum,
8881 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
8882 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
8883 sections to scan for relocation stubs into a new method
8884 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
8885 relocation and Cortex-A8 stub scanning.
8886 (Target_arm::do_relax): Force stubs to be after stubbed sections
8887 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
8888 the beginning of a new relaxation pass. Update a comment.
8889 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
8891 2010-01-12 Ian Lance Taylor <iant@google.com>
8893 * target-reloc.h (visibility_error): New inline function.
8894 (relocate_section): Call visibility_error.
8895 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
8896 (MOSTLYCLEANFILES): Likewise.
8897 (protected_4_pic.o, protected_3.err): New targets.
8898 * testsuite/protected_4.cc: New file.
8900 2010-01-12 Doug Kwan <dougkwan@google.com>
8902 * arm.cc (Cortex_a8_reloc): New class.
8903 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
8904 and cortex_a8_relocs_info_.
8905 (Target_arm::fix_cortex_a8): New method definition.
8906 (Target_arm::Cortex_a8_relocs_info): New type.
8907 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
8908 New data member declarations.
8909 (Target_arm::scan_reloc_for_stub): Record information about
8910 relocations for THUMB branches that might be exempted from the
8911 Cortex-A8 workaround.
8912 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
8913 at the beginning of a relaxation pass.
8915 2010-01-12 Doug Kwan <dougkwan@google.com>
8917 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
8918 (Arm_relobj::Mapping_symbol_position,
8919 Arm_reloj::Mapping_symbol_position_less,
8920 Arm_relobj::Mapping_symbols_info): New types.
8921 (Target_arm::is_mapping_symbol_name): New method definition.
8922 (Arm_relobj::do_count_local_symbols): Save information about mapping
8925 2010-01-11 Doug Kwan <dougkwan@google.com>
8927 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
8928 Arm_relocate_functions::thumb32_branch_upper,
8929 Arm_relocate_functions::thumb32_branch_lower,
8930 Arm_relocate_functions::thumb32_cond_branch_offset,
8931 Arm_relocate_functions::thumb32_cond_branch_upper,
8932 Arm_relocate_functions::thumb32_cond_branch_lower,
8933 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
8934 branch offset encoding.
8935 (Arm_relocate_functions::thumb_branch_common): Use new branch
8936 offset encoding methods to avoid code duplication.
8937 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
8938 (Stub_addend_reader::operator()): Use new branch encoding method
8939 to avoid code duplication.
8941 2010-01-11 Doug Kwan <dougkwan@google.com>
8943 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
8944 (Target_arm::do_finalize_sections): Define special EXIDX section
8945 symbols only if referenced.
8946 * gc.h (Garbage_collection::add_reference): New method.
8947 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
8950 2010-01-11 Ian Lance Taylor <iant@google.com>
8952 * script.cc (Version_script_info::build_expression_list_lookup):
8953 Change complaing about duplicate wildcard match from error to
8956 * script.cc (class Lazy_demangler): Recreate--revert part of patch
8958 (Version_script_info::Version_script_info): Initialize globs_,
8959 default_version_, default_is_global_, and exact_. Don't
8960 initialize globals_ or locals_.
8961 (Version_script_info::build_lookup_tables): Build local symbols
8963 (Version_script_info::unquote): New function.
8964 (Version_script_info::add_exact_match): New function.
8965 (Version_script_info::build_expression_list_lookup): Remove lookup
8966 parameter. Add is_global parameter. Change all callers. Handle
8967 wildcard pattern specially. Unquote pattern. Call
8969 (Version_script_info::get_name_to_match): New function.
8970 (Version_script_info::get_symbol_version): New function.
8971 (Version_script_info::get_symbol_version_helper): Remove.
8972 (Version_script_info::check_unmatched_names): Call unquote.
8973 * script.h (class Version_script_info): Change get_symbol_version
8974 to be non-inline and add is_global parameter; change all callers.
8975 Rewrite symbol_is_local. Update declarations. Define struct
8976 Version_tree_match, Exact, Globs. Don't define struct Lookup.
8977 Remove globals_ and locals_ members. Add exact_, globs_,
8978 default_version_, is_global_.
8979 (Version_script_info::Glob): Remove pattern, add expression and
8980 is_global. Update constructor. Change all callers.
8981 * dynobj.cc (Versions::finalize): Mark the version symbol as the
8983 (Versions::symbol_section_contents): If a symbol is undefined, or
8984 defined in a dynamic object, set the version index to
8986 * symtab.cc (Symbol_table::add_from_relobj): Don't call
8988 (Symbol_table::add_from_pluginobj): Likewise.
8989 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
8991 2010-01-11 Doug Kwan <dougkwan@google.com>
8993 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
8994 (incremental_dump_LDADD): Add linking option for libintl.
8995 * Makefile.in: Regenerate.
8997 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
9000 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
9002 * testsuite/Makefile.in: Regenerated.
9004 2010-01-10 Doug Kwan <dougkwan@google.com>
9006 * options.h (DEFINE_var): Use parentheses around argument varname__
9007 in macro body to avoid any unintended subsequent substitutions.
9009 2010-01-10 Ian Lance Taylor <iant@google.com>
9011 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
9012 candidates before doing symbol resolution.
9014 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
9015 ODR candidates if only one is weak.
9017 2010-01-08 Ian Lance Taylor <iant@google.com>
9019 * script.cc (Version_script_info::build_expression_list_lookup):
9020 Don't warn about ambiguous version, just record the ambiguity.
9021 (Version_script_info::get_symbol_version_helper): Give error if
9022 version is ambiguous.
9024 2010-01-08 Doug Kwan <dougkwan@google.com>
9026 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
9027 prev_data_size_ and prev_addralign_. Remove initializer for
9028 deleted data member has_been_changed_.
9029 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
9030 to determine if the table is empty.
9031 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
9033 (Stub_table::add_reloc_stub): Define method in class definition
9034 instead of just declaring it there.
9035 (Stub_table::add_cortex_a8_stub): New method definition.
9036 (Stub_table::update_data_size_and_addralign): Ditto.
9037 (Stub_table::finalize_stubs): Ditto.
9038 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
9039 (Stub_table::do_addralign_): Return address alignment in the
9040 (Stub_table::do_reset_address_and_file_offset): Define method in
9041 class definition instead of declaring it there. Set current data
9042 size to be the data size of the previous pass.
9043 (Stub_table::set_final_data_size): Use current data size as the
9045 (Stub_table::relocate_stub): Change parameter type of stub from
9046 Reloc_stub pointer to Stub pointer.
9047 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
9048 (Stub_table::Cortex_a8_stub_list): New typedef.
9049 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
9050 Stub_table::prev_addralign_): New data member.
9051 (Arm_relobj::Arm_relobj): Initialize data member
9052 section_has_cortex_a8_workaround_.
9053 (Arm_relobj::section_has_cortex_a8_workaround,
9054 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
9056 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
9058 (Target_arm::relocate_stub): Change parameter type of stub from
9059 Reloc_stub pointer to Stub pointer.
9060 (Insn_template::size, Insn_template::alignment): Handle
9061 THUMB16_SPECIAL_TYPE.
9062 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
9063 Stub_table::update_data_size_and_addralign,
9064 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
9066 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
9067 (Stub_table::do_write): Ditto.
9068 (Target_arm::do_relax): Adjust code for changes in Stub_table.
9070 2010-01-08 Ian Lance Taylor <iant@google.com>
9073 * symtab.h (class Symbol): Remove fields is_target_special_ and
9074 has_plt_offset_. Add field is_defined_in_discarded_section_.
9075 (Symbol::is_defined_in_discarded_section): New function.
9076 (Symbol::set_is_defined_in_discarded_section): New function.
9077 (Symbol::has_plt_offset): Rewrite.
9078 (Symbol::set_plt_offset): Verify that new offset is not -1U.
9079 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
9080 Don't initialize is_target_special_ or has_plt_offset_.
9081 Initialize is_defined_in_discarded_section_.
9082 (Symbol_table::add_from_relobj): If appropriate, set
9083 is_defined_in_discarded_section.
9084 * resolve.cc (Symbol::override_base_with_special): Don't test
9085 is_target_special_. Change has_plt_offset_ to has_plt_offset().
9086 * target-reloc.h (relocate_section): Do special handling for
9087 symbols defined in discarded sections for global symbols as well
9090 2010-01-08 Ian Lance Taylor <iant@google.com>
9092 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
9093 the SHT_SYMTAB case.
9095 2010-01-08 Ian Lance Taylor <iant@google.com>
9097 * object.cc (Sized_relobj::do_layout): Don't get confused if
9098 layout_eh_frame returns NULL.
9100 2010-01-08 Ian Lance Taylor <iant@google.com>
9103 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
9104 dynamic symbol table, use the normal symbol table.
9105 (Sized_dynobj::do_read_symbols): Remove assertion about type of
9108 2010-01-08 Ian Lance Taylor <iant@google.com>
9111 * layout.cc (Layout::include_section): Remove .gnu_debuglink
9114 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
9116 * version.cc (print_version): Change to "Copyright 2010".
9118 2010-01-08 Ian Lance Taylor <iant@google.com>
9122 * i386.cc (class Target_i386): Change return type of plt_section
9124 (class Output_data_plt_i386): Add tls_desc_rel_ field.
9125 (Output_data_plt_i386::Output_data_plt_i386): Initialize
9126 tls_desc_rel_ field.
9127 (Output_data_plt_i386::rel_tls_desc): New function.
9128 (Target_i386::rel_tls_desc_section): New function.
9129 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
9130 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
9131 R_386_TLS_DESC reloc in rel_tls_desc_section.
9132 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
9133 Define struct Tlsdesc_info.
9134 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
9135 (Target_x86_64::do_reloc_symbol_index): New function.
9136 (Target_x86_64::add_tlsdesc_info): New function.
9137 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
9138 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
9140 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
9142 (Output_data_plt_x86_64::rela_tlsdesc): New function.
9143 (Target_x86_64::rela_tlsdesc_section): New function.
9144 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
9146 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
9147 (Target_x86_64::do_reloc_addend): New function.
9148 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
9149 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
9150 declarations. Define TARGET_CODE. Add arg field to u1_ union.
9151 (Output_reloc::type): New function.
9152 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
9153 (Output_reloc::is_target_specific): New function.
9154 (Output_reloc::target_arg): New function.
9155 (class Output_reloc) [SHT_RELA]: Add four new constructors for
9156 absolute relocs and target specific relocs.
9157 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
9158 add_target_specific.
9159 (class Output_data_reloc) [SHT_RELA]: Likewise.
9160 * output.cc (Output_reloc::Output_reloc): Add four new versions
9161 for absolute relocs and target specific relocs.
9162 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
9163 (Output_reloc::get_symbol_index): Likewise.
9164 (Output_reloc::local_section_offset): Check that local_sym_index_
9165 is not TARGET_CODE or 0.
9166 (Output_reloc::symbol_value): Likewise.
9167 (Output_reloc::write) [SHT_RELA]: Call target for target specific
9169 * target.h (class Target): Add reloc_symbol_index and reloc_addend
9170 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
9172 * layout.cc (add_target_dynamic_tags): Use output section for
9173 DT_PLTRELSZ and DT_JMPREL.
9175 2010-01-07 Ian Lance Taylor <iant@google.com>
9178 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
9180 (class Output_data_reloc_generic): Define.
9181 (class Output_data_reloc_base): Change base class to
9182 Output_data_reloc_generic. Change add() method to call
9183 bump_relative_reloc_count for a relative reloc. Remove
9185 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
9187 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
9188 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
9190 * layout.h (class Layout): Update declaration.
9192 2010-01-07 Ian Lance Taylor <iant@google.com>
9194 * output.h (class Output_data): Add const version of
9195 output_section and do_output_section.
9196 (class Output_section_data): Add const version of
9198 (class Output_section): Likewise.
9199 * layout.cc (Layout::add_target_dynamic_tags): New function.
9200 * layout.h (class Layout): Update declarations.
9201 * arm.cc (Target_arm::do_finalize_sections): Use
9202 add_target_dynamic_tags.
9203 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9204 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9205 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9206 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9208 2010-01-07 Ian Lance Taylor <iant@google.com>
9211 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
9214 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
9215 Ian Lance Taylor <iant@google.com>
9218 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
9219 Xindex::read_symtab_xindex.
9221 2010-01-07 Doug Kwan <dougkwan@google.com>
9223 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
9224 (Insn_template::thumb16_bcond_insn): New method declaration.
9225 (Insn_template): Fix spelling.
9226 (Stub::thumb16_special): New method declaration.
9227 (Stub::do_write): Define virtual method which was previously pure
9229 (Stub::do_thumb16_special): New method declaration.
9230 (Stub::do_fixed_endian_write): New template member.
9231 (Reloc_stub::do_write): Remove.
9232 (Reloc_stub::do_fixed_endian_write): Remove.
9233 (Cortex_a8_stub): New class definition.
9234 (Stub_factory::make_cortex_a8_stub): New method definition.
9235 (Stub_factory::Stub_factory): Add missing static storage class
9236 qualifier for elf32_arm_stub_a8_veneer_blx.
9238 2010-01-07 Ian Lance Taylor <iant@google.com>
9241 * options.h (class General_options): Add --warn-unresolved-symbols
9242 and --error-unresolved-symbols.
9243 * errors.cc (Errors::undefined_symbol): Implement
9244 --warn-unresolved-symbols.
9246 * options.h (class General_options): Add -z text and -z textoff.
9247 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
9249 2010-01-06 Sriraman Tallam <tmsriram@google.com>
9251 * gc.h (Garbage_collection::Cident_section_map): New typedef.
9252 (Garbage_collection::cident_sections): New function.
9253 (Garbage_collection::add_cident_section): New function.
9254 (Garbage_collection::cident_sections_): New member.
9255 (gc_process_relocs): Add references to sections whose names are C
9257 * gold.h (cident_section_start_prefix): New constant.
9258 (cident_section_stop_prefix): New constant.
9259 (is_cident): New function.
9260 * layout.cc (Layout::define_section_symbols): Replace string constants
9261 with the newly defined constants.
9262 * object.cc (Sized_relobj::do_layout): Track sections whose names are
9264 * testsuite/Makefile.am: Add gc_orphan_section_test.
9265 * testsuite/Makefile.in: Regenerate.
9266 * testsuite/gc_orphan_section_test.cc: New file.
9267 * testsuite/gc_orphan_section_test.sh: New file.
9269 2010-01-06 Ian Lance Taylor <iant@google.com>
9272 * options.h (class General_options): Add --warn-shared-textrel.
9273 * layout.cc (Layout::finish_dynamic_section): Implement
9274 --warn-shared-textrel.
9277 * options.h (class General_options): Add --warn-multiple-gp.
9279 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9281 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
9282 $(THREADSLIB) and $(LIBDL).
9283 * Makefile.in: Rebuild.
9285 2010-01-06 Ian Lance Taylor <iant@google.com>
9288 * options.cc (General_options::parse_section_start): New function.
9289 (General_options::section_start): New function.
9290 (General_options::General_options): Initialize all members.
9291 * options.h: Include <map>
9292 (class General_options): Add --section-start. Add section_starts_
9294 * layout.cc (Layout::attach_allocated_section_to_segment): If
9295 --section-start was used, set the address of the segment. Remove
9296 local sort_sections.
9297 (Layout::relaxation_loop_body): If the address of the load segment
9298 has been set by --section-start, don't use it.
9299 * output.h (Output_segment::update_flags_for_output_section): New
9301 * output.cc (Output_segment::add_output_section): Call
9302 update_flags_for_output_section.
9304 2010-01-05 Ian Lance Taylor <iant@google.com>
9307 * options.h (class General_options): Add --undefined-version.
9308 * script.cc (struct Version_expression): Add was_matched_by_symbol
9310 (Version_script_info::matched_symbol): New function.
9311 (Version_script_info::get_symbol_version_helper): Call
9313 (Version_script_info::check_unmatched_names): New function.
9314 * script.h (class Version_script_info): Update declarations.
9315 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
9317 * options.h (class General_options): Use DEFINE_bool_alias for
9318 allow_multiple_definition.
9319 * resolve.cc (Symbol_table::should_override): Don't test
9320 allow_multiple_definition.
9323 * options.h (class General_options): Add --cref.
9324 * main.cc (main): Print cref table if --cref. Don't close mapfile
9325 until after printing cref table.
9326 * cref.cc: Include "symtab.h".
9327 (class Cref_inputs): Define Cref_table_compare and Cref_table.
9328 (Cref_table_compare::operator()): New function.
9329 (Cref_inputs::gather_cref): New function.
9330 (filecol): New static const.
9331 (Cref_inputs::print_cref): New function.
9332 (Cref::print_cref): New function.
9333 * cref.h: Include <cstdio>.
9334 (class Cref): Update declarations.
9335 * mapfile.h (Mapfile::file): New function.
9336 * object.h (class Object): Define Symbols. Declare virtual
9337 do_get_global_symbols.
9338 (Object::get_global_symbols): New function.
9339 * object.cc (Input_objects::add_object): Pass object to cref_ if
9341 (Input_objects::archive_start): Likewise.
9342 (Input_objects::archive_stop): Likewise.
9343 (Input_objects::print_cref): New function.
9344 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
9345 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
9347 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
9349 * plugin.h (class Sized_pluginobj): Update declarations.
9351 2010-01-05 Ian Lance Taylor <iant@google.com>
9353 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
9354 to is_default_version. Rename insdef to insdefault.
9355 (Symbol_table::add_from_relobj): Rename def to is_default_version
9356 and local to is_forced_local.
9357 (Symbol_table::add_from_pluginobj): Likewise.
9358 (Symbol_table::add_from_dynobj): Likewise.
9359 (Symbol_table::define_special_symbol): Rename insdef to
9362 2010-01-04 Ian Lance Taylor <iant@google.com>
9365 * options.h (class General_options): Add
9366 --allow-multiple-definition and -z muldefs.
9367 * resolve.cc (Symbol_table::should_override): Don't warn about a
9368 multiple symbol definition if --allow-multiple-definition or -z
9372 * options.h (class General_options): Add --add-needed and
9373 --copy-dt-needed-entries. Tweak --as-needed help entry.
9374 * object.cc (Input_objects::check_dynamic_dependencies): Give an
9375 error if --copy-dt-needed-entries aka --add-needed is used and
9376 would cause a change in behaviour.
9379 * options.h (class General_options): Add -G as a short version of
9380 --shared. Add no-op options -assert, -g, and -i.
9382 2010-01-04 Sriraman Tallam <tmsriram@google.com>
9384 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
9385 check for .text or .gnu.linkonce.t sections.
9386 * icf.cc (Icf::find_identical_sections): Ditto.
9387 Change the detection for mangled function name within the section
9389 * icf.h (is_section_foldable_candidate): New function.
9391 2009-12-30 Ian Lance Taylor <iant@google.com>
9394 * options.h (class General_options): Permit two dashes with
9395 --retain-symbols-file.
9397 2009-12-30 Ian Lance Taylor <iant@google.com>
9400 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
9401 don't put the file header and segment headers in the text
9405 * common.cc (Sort_commons::operator()): Stabilize sort when both
9407 (Symbol_table::do_allocate_commons_list): When allocating common
9408 symbols, skip a symbol which is no longer common.
9409 * symtab.h (Symbol::is_common): Test whether the symbol comes from
9410 an object before checking its type.
9411 * testsuite/common_test_2.c: New file.
9412 * testsuite/common_test_3.c: New file.
9413 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
9414 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
9415 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
9416 (common_test_2_pic.o, common_test_2.so): New targets.
9417 (common_test_3_pic.o, common_test_3.so): New targets.
9418 * testsuite/Makefile.in: Rebuild.
9421 * script.cc (read_input_script): If we see a new SECTIONS clause,
9422 and we have added an input section, give an error.
9423 * layout.h (class Layout): Add have_added_input_section function.
9424 Add have_added_input_section_ field.
9425 * layout.cc (Layout::Layout): Initialize
9426 have_added_input_section_.
9427 (Layout::layout): Set have_added_input_section_.
9428 (Layout::layout_eh_frame): Likewise.
9430 2009-12-30 Ian Lance Taylor <iant@google.com>
9433 * options.h (class General_options): Add --sort-common option.
9434 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
9435 * common.cc (Sort_common): Add sort_order parameter to
9436 constructor. Add sort_order_ field.
9437 (Sort_commons::operator): Check sort_order_.
9438 (Symbol_table::allocate_commons): Determine the sort order.
9439 (Symbol_table::do_allocate_commons): Add sort_order parameter.
9441 (Symbol_table::do_allocate_commons_list): Likewise.
9443 2009-12-30 Ian Lance Taylor <iant@google.com>
9446 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
9447 symbols from this object, don't change the visibility of an
9449 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
9451 2009-12-30 Ian Lance Taylor <iant@google.com>
9454 * script.h (class Version_script_info): Define Language enum.
9455 Update declarations. Define Glob, Exact, and Lookup types. Add
9456 new fields globals_, locals_, and is_finalized_.
9457 * script.cc: Various formatting fixes.
9458 (class Parser_closure): Change language_stack_ from a vector of
9459 std::string to one of Version_script_info::Language. Adjust all
9461 (class Lazy_demangler): Remove.
9462 (struct Version_expression): Change language from std::string to
9463 Version_script_info::Language.
9464 (Version_script_info::Version_script_info): New function.
9465 (Version_script_info::~Version_script_info): Don't call clear.
9466 (Version_script_info::finalize): New function.
9467 (Version_script_info::build_lookup_tables): New function.
9468 (Version_script_info::build_expression_list_lookup): New
9470 (Version_script_info::get_symbol_version_helper): Rewrite to use
9472 (Version_script_info::print_expression_list): Adjust to use
9473 Version_script_info::Language.
9474 (script_push_lex_into_version_mode): Check that the version script
9475 has not been finalized.
9476 (version_script_push_lang): Change language string to
9477 Version_script_info::Language.
9478 * options.cc (Command_line::version_script): New function.
9479 * options.h (class General_options): Add finalize_dynamic_list
9480 function. Change version_script from declaration to definition.
9481 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
9482 * testsuite/version_script.map: Remove duplicate def of foo.
9483 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
9485 * testsuite/Makefile.in: Rebuild.
9487 2009-12-30 Ian Lance Taylor <iant@google.com>
9490 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
9491 if the input symbol index is 0, make the output symbol index 0.
9493 2009-12-30 Ian Lance Taylor <iant@google.com>
9496 * options.h (class General_options): Add -x/--discard-all.
9497 * object.cc (Sized_relobj::do_count_local_symbols): Handle
9498 --discard-all. If the local symbol needs a dynamic entry, check
9499 that before handling --discard-locals.
9501 2009-12-30 Ian Lance Taylor <iant@google.com>
9504 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
9506 (Output_segment::add_output_section): Don't change the flags if
9510 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
9511 GNU hash table if they need a dynamic value. Otherwise, don't add
9512 them if they are defined in a dynamic object or are forced local.
9514 2009-12-29 Ian Lance Taylor <iant@google.com>
9517 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
9518 .gnu.hash table for a 32-bit target.
9521 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
9522 regular and a dynamic object only needs a dynamic symbol table
9523 entry if it is externally visible.
9526 * i386.cc (class Target_i386): Initialize global_offset_table_ in
9527 constructor. Add global_offset_table_ field.
9528 (Target_i386::got_section): Set global_offset_table_.
9529 (Target_i386::do_finalize_sections): Set global_offset_table_
9531 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
9532 in constructor. Add global_offset_table_ field.
9533 (Target_x86_64::got_section): Set global_offset_table_.
9534 (Target_x86_64::do_finalize_sections): Set global_offset_table_
9537 * layout.cc (Layout::Layout): Initialize increase_relro_.
9538 (Layout::get_output_section): Add is_relro, is_last_relro, and
9539 is_first_non_relro parameters. Change all callers.
9540 (Layout::choose_output_section): Likewise.
9541 (Layout::add_output_section_data): Likewise.
9542 (Layout::make_output_section): Likewise.
9543 (Layout::set_segment_offsets): Clear increase_relro when using a
9545 * layout.h (class Layout): Add increase_relro method. Add
9546 increase_relro_ field. Update declarations.
9547 * output.cc (Output_section::Output_section): Initialize
9548 is_last_relro_ and is_first_non_relro_.
9549 (Output_segment::add_output_section): Group relro sections is
9550 do_sort is true. Handle is_last_relro and is_first_non_relro.
9551 (Output_segment::maximum_alignment): Remove relro handling.
9552 (Output_segment::set_section_addresses): Add increase_relro
9553 parameter. Change all callers. Add initial alignment to align
9554 relro sections on separate page. Remove old relro handling.
9555 (Output_segment::set_section_list_addresses): Remove in_relro
9556 parameter. Change all callers.
9557 (Output_segment::set_offset): Add increase parameter. Change all
9558 callers. Remove old relro handling.
9559 * output.h (class Output_section): Add new methods: is_last_relro,
9560 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
9561 Add is_last_relro_ and is_first_non_relro_ fields.
9562 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
9563 Create separate .got.plt section. Call increase_relro.
9564 * x86_64.cc (Target_x86_64::got_section): Likewise.
9565 * testsuite/relro_script_test.t: Add .got.plt.
9568 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
9569 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
9570 (Layout::finalize): Call set_dynamic_symbol_size.
9571 (Layout::set_dynamic_symbol_size): New function.
9572 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
9573 set_dynamic_symbol_size.
9576 * output.h (class Output_section): Add is_entsize_zero_ field.
9577 * output.cc (Output_section::Output_section): Initialize
9579 (Output_section::set_entsize): If two different entsizes are
9580 requested, force it to zero.
9581 (Output_section::add_input_section): Set flags for .debug_str
9582 before updating section flags. Set entsize.
9583 (Output_section::update_flags_for_input_section): Set SHF_MERGE
9584 and SHF_STRING if all input sections have those flags.
9586 2009-12-29 Rafael Espindola <espindola@google.com>
9588 * main.cc (main): Fix the sys time reporting.
9589 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
9592 2009-12-29 Sriraman Tallam <tmsriram@google.com>
9594 * options.cc (General_options::parse_version): Allow -v to exit
9595 without an error if there is nothing to link.
9597 2009-12-29 Ian Lance Taylor <iant@google.com>
9599 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
9600 using a version of gcc before 4.1.
9601 * configure: Rebuild.
9603 2009-12-28 Chris Demetriou <cgd@google.com>
9605 * attributes.cc (Output_attributes_section_data::do_write): Use
9606 std::vector::front rather than std::vector::data.
9608 2009-12-28 Ian Lance Taylor <iant@google.com>
9610 * symtab.h (class Symbol_table): Add enum Defined.
9611 * resolve.cc (Symbol_table::should_override): Add defined
9612 parameter. Change all callers. Test whether object is NULL
9613 before calling a method on it.
9614 (Symbol_table::report_resolve_problem): Add defined parameter.
9616 (Symbol_table::should_override_with_special): Likewise.
9617 * symtab.cc (Symbol_table::define_in_output_data): Add defined
9618 parameter. Change all callers.
9619 (Symbol_table::do_define_in_output_data): Likewise.
9620 (Symbol_table::define_in_output_segment): Likewise.
9621 (Symbol_table::do_define_in_output_segment): Likewise.
9622 (Symbol_table::define_as_constant): Likewise.
9623 (Symbol_table::do_define_as_constant): Likewise.
9624 * script.h (class Symbol_assignment): Add is_defsym parameter to
9625 constructor; change all callers.
9626 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
9627 parameter. Change all callers. Add is_defsym_ field.
9628 (class Parser_closure): Add parsing_defsym parameter to
9629 constructor; change all callers. Add parsing_defsym accessor
9630 function. Add parsing_defsym_ field.
9632 2009-12-28 Ian Lance Taylor <iant@google.com>
9634 * gold.cc (queue_middle_tasks): Fix formatting.
9635 * object.cc (Relobj::is_section_name_included): Likewise.
9637 2009-12-23 Ian Lance Taylor <iant@google.com>
9639 * i386.cc (Target_i386::do_calls_non_split): Recognize
9640 -fsplit-stack prologue for a function with a static chain.
9641 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
9642 -fsplit-stack prologue when using %r11.
9644 2009-12-21 Sriraman Tallam <tmsriram@google.com>
9646 * options.cc (General_options::parse_version): Make -v continue and do
9647 the link like GNU ld does.
9649 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
9651 * Makefile.am (CCFILES): Add timer.cc.
9652 (HFILES): Add timer.h.
9653 * configure.ac: Check for sysconf and times.
9654 * main.cc: include timer.h.
9655 (main): Use Timer instead of get_run_time.
9658 * workqueue.cc: include timer.h.
9659 (Workqueue::find_and_run_task):
9660 Report user, sys and wall time.
9661 * Makefile.in: Regenerate.
9662 * config.in: Regenerate.
9663 * configure: Regenerate.
9665 2009-12-16 Doug Kwan <dougkwan@google.com>
9667 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
9669 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
9670 relaxed input sections.
9671 * output.cc (Output_section::find_relaxed_input_section): Change
9672 return type to Output_relaxed_input_section pointer. Adjust code
9673 for new type of relaxed_input_section_map_.
9674 * output.h (Output_section::find_relaxed_input_section): Change
9675 return type to Output_relaxed_input_section pointer.
9676 (Output_section::Output_relaxed_input_section_by_input_section_map):
9678 (Output_section::relaxed_input_section_map_): Change type to
9679 Output_section::Output_relaxed_input_section_by_input_section_map.
9680 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
9683 2009-12-15 Ian Lance Taylor <iant@google.com>
9685 * layout.cc (Layout::create_shstrtab): Only write out after input
9686 sections if we are compressing debug sections.
9688 2009-12-15 Ian Lance Taylor <iant@google.com>
9690 * archive.cc (Archive::add_symbols): Only look up a symbol without
9691 a version if there is, in fact, a version.
9693 2009-12-14 Ian Lance Taylor <iant@google.com>
9695 Revert -Wshadow changes, all changes from:
9696 2009-12-11 Doug Kwan <dougkwan@google.com>
9697 2009-12-11 Nick Clifton <nickc@redhat.com>
9698 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
9700 2009-12-11 Doug Kwan <dougkwan@google.com>
9702 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
9704 * attributes.cc (Object_attribute::size): Ditto.
9705 (Attributes_section_data::size): Ditto.
9706 (Attributes_section_data::Attributes_section_data): Ditto.
9707 (Output_attributes_section_data::do_write): Ditto.
9708 * attributes.h (Object_attribute::set_type): Ditto.
9709 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
9711 2009-12-11 Nick Clifton <nickc@redhat.com>
9713 * archive.cc: Fix shadowed variable warnings.
9715 * compressed_output.cc: Likewise.
9716 * compressed_output.h: Likewise.
9717 * configure: Likewise.
9718 * dwarf_reader.cc: Likewise.
9719 * dynobj.cc: Likewise.
9720 * dynobj.h: Likewise.
9721 * ehframe.cc: Likewise.
9722 * ehframe.h: Likewise.
9723 * errors.cc: Likewise.
9724 * expression.cc: Likewise.
9725 * fileread.cc: Likewise.
9726 * fileread.h: Likewise.
9727 * freebsd.h: Likewise.
9728 * i386.cc: Likewise.
9730 * incremental.h: Likewise.
9731 * layout.cc: Likewise.
9732 * layout.h: Likewise.
9733 * mapfile.cc: Likewise.
9734 * merge.cc: Likewise.
9735 * merge.h: Likewise.
9736 * object.cc: Likewise.
9737 * object.h: Likewise.
9738 * options.h: Likewise.
9739 * output.cc: Likewise.
9740 * output.h: Likewise.
9741 * parameters.cc: Likewise.
9742 * plugin.cc: Likewise.
9743 * powerpc.cc: Likewise.
9744 * reduced_debug_output.cc: Likewise.
9745 * reduced_debug_output.h: Likewise.
9746 * reloc.cc: Likewise.
9747 * reloc.h: Likewise.
9748 * resolve.cc: Likewise.
9749 * script-sections.cc: Likewise.
9750 * script.cc: Likewise.
9751 * script.h: Likewise.
9752 * sparc.cc: Likewise.
9753 * symtab.cc: Likewise.
9754 * symtab.h: Likewise.
9755 * target-select.cc: Likewise.
9756 * target-select.h: Likewise.
9757 * token.h: Likewise.
9758 * workqueue.cc: Likewise.
9759 * workqueue.h: Likewise.
9760 * x86_64.cc: Likewise.
9762 2009-12-10 Doug Kwan <dougkwan@google.com>
9764 * arm.cc (attributes.h): New include.
9765 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
9766 (Arm_relobj::~Arm_relobj): Delete object pointed by
9767 attributes_section_data_.
9768 (Arm_relobj::attributes_section_data): New method definition.
9769 (Arm_relobj::attributes_section_data_): New data member declaration.
9770 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
9771 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
9772 attributes_section_data_.
9773 (Arm_dynobj::attributes_section_data): New method definition.
9774 (Arm_dynobj::attributes_section_data_): New data member declaration.
9775 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
9776 initialization value of may_use_blx_ to false.
9777 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
9778 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
9779 object attributes to compute results instead of hard-coding.
9780 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
9781 Target_arm::get_secondary_compatible_arch,
9782 Target_arm::set_secondary_compatible_arch
9783 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9784 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
9785 New method declarations.
9786 (Target_arm::get_aeabi_object_attribute): New method definition.
9787 (Target_arm::attributes_section_data_): New data member declaration.
9788 (read_arm_attributes_section): New template definition.
9789 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
9790 (Arm_dynobj::do_read_symbols): Ditto.
9791 (Target_arm::do_finalize_sections): Merge attributes sections from
9792 input. Check for BLX use after attributes section merging.
9793 Fix __exidx_start and __exidx_end visibility. Create an
9794 .ARM.attributes section if necessary.
9795 (Target_arm::get_secondary_compatible_arch,
9796 Target_arm::set_secondary_compatible_arch,
9797 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9798 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
9799 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
9800 New method definitions.
9802 2009-12-09 Ian Lance Taylor <iant@google.com>
9804 * plugin.cc (Plugin::load): Don't cast from void* to a function
9807 2009-12-09 Ian Lance Taylor <iant@google.com>
9809 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
9812 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
9814 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
9815 Replace two_file_shared_1.so with two_file_shared_2.so.
9816 * testsuite/Makefile.in: Regenerated.
9818 2009-12-08 Doug Kwan <dougkwan@google.com>
9820 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
9821 (HFILES): Add attributes.h and int_encoding.h.
9822 * Makefile.in: Regenerate.
9823 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
9824 function definitions to int_encoding.cc
9825 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
9826 prototypes to int_encoding.h
9827 * reduced_debug_output.cc (int_encoding.h): New include.
9828 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
9829 function definitions to int_encoding.cc
9830 (insert_into_vector, read_from_pointer): Move template definitions to
9832 * attributes.cc: New file.
9833 * attributes.h: New file.
9834 * int_encoding.cc: New file.
9835 * int_encoding.h: New file.
9837 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
9840 * incremental-dump.cc (dump_incremental_inputs): New.
9841 (main): Use dump_incremental_inputs.
9843 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
9846 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
9847 checking elfcpp::STT_FUNC.
9848 (Target_i386::Relocate::relocate): Likewise.
9849 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
9851 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
9852 symbols from shared libraries into normal FUNC symbols.
9854 * symtab.h (Symbol): Add is_func and use it.
9856 2009-12-05 Doug Kwan <dougkwan@google.com>
9858 * arm.cc (Target_arm::arm_info): Initialize new fields
9859 attributes_section and attributes_vendor.
9860 * i386.cc (Target_i386::i386_info): Same.
9861 * object.cc (Sized_relobj::do_layout): Skip attribute section.
9862 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
9863 fields attributes_section and attributes_vendor.
9864 * sparc.cc (Target_sparc::sparc_info): Same.
9865 * target.h (Target::attributes_section, Target::attributes_vendor,
9866 Target::is_attributes_section, Target::attribute_arg_type,
9867 Target::attributes_order): New method definitions.
9868 (Target::Target_info::attributes_section,
9869 Target::Target_info::attributes_vendor): New fields.
9870 (Target::do_attribute_arg_type, Target::do_attributes_order): New
9871 virtual method definitions.
9872 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
9873 attributes_section and attributes_vendor.
9874 * testsuite/testfile.cc (Target_test::test_target_info): Same.
9876 2009-12-05 Doug Kwan <dougkwan@google.com>
9878 * arm.cc: Update comments about interworking and stub generation.
9879 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
9880 considered as non-PIC.
9881 (Arm_relocate_functions::base_abs): Fix formatting.
9882 (Arm_relocate_functions::got_prel): Fix comment. Change interface
9883 of function to use GOT entry address instead of offset.
9884 (Target_arm::Scan::global): Issue an error if a symbol would need a
9885 PLT does not get one because it is untyped. Remove code to create
9886 dynamic symbols for relative branches.
9887 (Target_arm::Relocate::relocate: Use 0 instead of false since function
9888 takes unsigned integer instead of boolean.
9890 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
9892 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
9893 (two_file_test_LDADD): Likewise.
9894 (common_test_1_LDADD): Likewise.
9895 (exception_test_LDADD) Likewise.
9896 (weak_test_LDADD): Likewise.
9897 (many_sections_test_LDADD): Likewise.
9898 (initpri1_LDADD): Likewise.
9899 (script_test_1_LDADD): Likewise.
9900 (script_test_2_LDADD): Likewise.
9901 (justsyms_LDADD): Likewise.
9902 (binary_test_LDADD): Likewise.
9903 (large_LDADD): Likewise.
9904 * testsuite/Makefile.in: Regenerated.
9906 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
9908 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
9909 (Symbol_table::override_with_special): Likewise.
9910 (Symbol_table::add_from_object): Likewise.
9912 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
9914 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9915 Don't set the data_offset twice.
9917 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
9919 * testsuite/Makefile.in: Regenerate.
9921 2009-12-03 Doug Kwan <dougkwan@google.com>
9923 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
9924 (Target_arm::do_finalize_sections): Add parameter for symbol table
9925 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
9926 * i386.cc (Target_i386::do_finalize_sections): Add an additional
9927 parameter for symbol table pointer.
9928 * layout.cc (Layout::finalize): Call Target::finalize_sections with
9929 an additional parameter for a pointer to symbol table.
9930 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
9931 parameter for a symbol table pointer.
9932 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
9933 * target.h (Target::finalize_sections, Target::do_finalize_sections):
9935 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
9936 parameter for a symbol table pointer.
9938 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
9940 * incremental.cc (Incremental_inputs_header)
9941 (Incremental_inputs_header_write, Incremental_inputs_entry)
9942 (Incremental_inputs_entry_write): Move ...
9943 * incremental.h (Incremental_inputs_header)
9944 (Incremental_inputs_header_write, Incremental_inputs_entry)
9945 (Incremental_inputs_entry_write): here.
9947 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9949 * incremental.cc (make_sized_incremental_binary): Set the target.
9950 Error if it is incompatible.
9951 * output.h (Output_file): Add filename method.
9953 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9955 * incremental.cc (Incremental_inputs_entry): Remove unused argument
9956 from the get_* methods.
9958 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9960 * incremental-dump.cc (main): Check that the offeset of a script is 0.
9961 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9962 Write 0 for the data_offset of scripts.
9964 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
9966 * testsuite/Makefile.am: Add the incremental_test.sh test.
9967 * testsuite/incremental_test.sh: New.
9968 * testsuite/incremental_test_1.c: New.
9969 * testsuite/incremental_test_2.c: New.
9971 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
9973 * incremental-dump.cc (main): Fix typos.
9975 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
9978 * incremental-dump.cc (main): Use llu to print 64 bit values.
9980 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
9981 H.J. Lu <hongjiu.lu@intel.com>
9983 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
9985 (incremental_dump_LDADD): Likewise.
9986 * Makefile.in: Regenerated.
9988 2009-11-25 Doug Kwan <dougkwan@google.com>
9992 2009-11-25 Doug Kwan <dougkwan@google.com>
9994 * arm.cc (Target_arm::Target_arm): Move method definition
9995 outside of class definition. Add code to handle
9996 --target1-rel, --target1-abs and --target2= options.
9997 (Target_arm::get_reloc_reloc_type): Change method to be
9998 non-static and const.
9999 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
10000 New data member declaration.
10001 (Target_arm::Scan::local, Target_arm::Scan::global,
10002 Target_arm::Relocate::relocate,
10003 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10004 Adjust call to Target_arm::get_real_reloc_type.
10005 (Target_arm::get_real_reloc_type): Use command line options
10006 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10007 * options.h (--target1-rel, --target1-abs, --target2): New
10010 2009-11-25 Doug Kwan <dougkwan@google.com>
10012 * arm.cc (Target_arm::Target_arm): Move method definition outside of
10013 class definition. Add code to handle --target1-rel, --target1-abs
10014 and --target2= options.
10015 (Target_arm::get_reloc_reloc_type): Change method to be non-static
10017 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
10018 member declaration.
10019 (Target_arm::Scan::local, Target_arm::Scan::global,
10020 Target_arm::Relocate::relocate,
10021 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
10022 call to Target_arm::get_real_reloc_type.
10023 (Target_arm::get_real_reloc_type): Use command line options to
10024 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10025 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
10028 2009-11-25 Doug Kwan <dougkwan@google.com>
10030 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
10031 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
10032 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
10034 (Arm_relocate_functions::thm_call): Replace body with a call to
10035 Arm_relocate_functions::thumb_branch_common.
10036 (Arm_relocate_functions::thm_jump24,
10037 Arm_relocate_functions::thm_xpc22): New method definitions.
10038 (Arm_relocate_functions::thumb_branch_common): New method definition.
10039 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
10041 (Target_arm::Relocate::relocate): Adjust call to thm_call.
10042 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
10044 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10046 * Makefile.am: Build incremental-dump
10047 * Makefile.in: Regenerate.
10048 * incremental-dump.cc: New.
10049 * incremental.cc (Incremental_inputs_header_data,
10050 Incremental_inputs_entry_data): Move to incremental.h
10051 * incremental.h: (Incremental_inputs_header_data,
10052 Incremental_inputs_entry_data): Move from incremental.cc
10054 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10056 * incremental.cc (Incremental_inputs_header,
10057 Incremental_inputs_header_write, Incremental_inputs_entry,
10058 Incremental_inputs_entry_write): Add a typedef with the data type.
10060 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10062 * incremental.cc (Incremental_inputs_header,
10063 Incremental_inputs_header_write, Incremental_inputs_entry,
10064 Incremental_inputs_entry_write): Update comment about which
10065 type has the filed descriptions.
10067 2009-11-15 Doug Kwan <dougkwan@google.com>
10069 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
10070 (Arm_relocate_functions::arm_branch_common): Change method defintion
10071 in class definition to a method declaration and update list of formal
10073 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
10074 Arm_relocation_functions::jump24): Adjust call to
10075 Arm_relocate_functions::arm_branch_common. Update list of formal
10077 (Arm_relocate_functions::xpc25): New method definition.
10078 (Arm_relocate_functions::arm_branch_common): Move method defintion
10079 out from class definition. Use stubs for mode-switching and extending
10081 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
10082 specially. Change code to enable use of stubs in ARM branches.
10084 2009-11-10 Doug Kwan <dougkwan@google.com>
10086 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
10087 in method declaration.
10088 (Target_arm::relocate_stub): New method declaration.
10089 (Target_arm::default_target): Change to return a pointer instead of
10091 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
10092 Target_arm::default_target.
10093 (Arm_Relobj::do_relocate_sections): Remove options paramater in
10095 (Target_arm::relocate_section): Adjust view.
10096 (Target_arm::relocate_stub): New method definition.
10098 2009-11-10 Doug Kwan <dougkwan@google.com>
10100 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
10102 * incremental.cc (open_incremental_binary): Initialized local
10103 variables to avoid warnings.
10104 * object.cc (make_elf_object): Ditto.
10105 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
10108 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
10111 * testsuite/plugin_test.c: Include "config.h".
10113 2009-11-09 Doug Kwan <dougkwan@google.com>
10115 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
10116 (arm_symbol_value): Remove.
10117 (Arm_relocate_functions::arm_branch_common,
10118 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
10119 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
10120 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
10121 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
10122 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
10123 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
10124 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
10125 Arm_relocate_functions::thm_mobw_abs_nc,
10126 Arm_relocate_functions::thm_mov_abs,
10127 Arm_relocate_functions::movw_prel_nc,
10128 Arm_relocate_functions::thm_movt_abs,
10129 Arm_relocate_functions::movt_prel,
10130 Arm_relocate_functions::thm_movw_prel_nc,
10131 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
10132 (Target_arm::Relocate::relocate): Only decompose address into two
10133 parts if relocation type uses the thumb-bit and pass the actual
10134 bit instead of a flag indicating that the thumb-bit is used. Adjust
10135 calls to methods in Arm_relocate_functions for this change.
10137 2009-11-08 Ian Lance Taylor <iant@google.com>
10140 * reloc.cc: Instantiate
10141 Sized_relobj::initialize_input_to_output_maps and
10142 Sized_relobj:free_input_to_output_maps.
10144 2009-11-06 Ian Lance Taylor <iant@google.com>
10147 * defstd.cc (in_segment): Set only_if_ref true for "end".
10149 2009-11-06 Doug Kwan <dougkwan@google.com>
10151 * arm.cc (class Reloc_stub): Correct a comment.
10152 (Target_arm::Target_arm): Initialize arm_input_section_map_.
10153 (Target_arm::scan_section_for_stubs): New method declaration.
10154 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
10155 Change methods from private to protected.
10156 (Target_arm::do_may_relax): New method definition.
10157 (Target_arm::do_relax, Target_arm::group_sections,
10158 Target_arm::scan_reloc_for_stub,
10159 Target_arm::scan_reloc_section_for_stubs): New method declarations.
10160 (Target_arm::arm_input_section_map_): New data member declaration.
10161 (Target_arm::scan_reloc_for_stub,
10162 Target_arm::scan_reloc_section_for_stubs,
10163 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
10164 Target_arm::do_relax): New method definitions.
10166 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
10168 * configure.ac: Check for (struct stat)::st_mtim
10169 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
10170 * config.in: Regenerate.
10171 * configure: Regenerate.
10173 2009-11-05 Ian Lance Taylor <iant@google.com>
10176 * output.cc (Output_segment::add_output_section): Add missing
10179 2009-11-04 Ian Lance Taylor <iant@google.com>
10182 * object.h (class Object): Add is_needed and set_is_needed
10183 methods. Add is_needed_ field. Make bool fields into bitfields.
10184 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
10185 defined in a dynamic object and referenced by a regular object,
10186 set is_needed for the dynamic object.
10187 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
10188 if the file is marked with as_needed and it is not needed.
10190 2009-11-04 Ian Lance Taylor <iant@google.com>
10193 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
10194 tags if data is discarded by linker script.
10195 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10196 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10197 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10198 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10200 2009-11-04 Ian Lance Taylor <iant@google.com>
10202 * layout.cc (Layout::get_output_section): Add is_interp and
10203 is_dynamic_linker_section parameters. Change all callers.
10204 (Layout::choose_output_section): Likewise.
10205 (Layout::make_output_section): Likewise.
10206 (Layout::add_output_section_data): Add is_dynamic_linker_section
10207 parameter. Change all callers.
10208 * layout.h (class Layout): Update declarations.
10209 * output.h (class Output_section): Add is_interp, set_is_interp,
10210 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
10211 Add is_interp_, is_dynamic_linker_section_ fields. Change
10212 generate_code_fills_at_write_ to a bitfield.
10213 * output.cc (Output_section::Output_sections): Initialize new
10215 (Output_segment::add_output_section): Add do_sort parameter.
10216 Change all callers.
10218 2009-11-03 Ian Lance Taylor <iant@google.com>
10221 * options.h (class General_options): Add --warn-common.
10222 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
10223 merging two common symbols.
10224 (Symbol_table::should_override): Handle --warn-common when merging
10225 a common symbol with a defined symbol. Use report_resolve_problem
10226 for multiple definitions.
10227 (Symbol_table::report_resolve_problem): New function.
10228 * symtab.h (class Symbol_table): Declare report_resolve_problem.
10230 2009-11-03 Doug Kwan <dougkwan@google.com>
10232 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
10234 (Target_arm::stub_factory): New method definition.
10235 (Target_arm::new_arm_input_section,
10236 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
10237 Target_arm::reloc_uses_thumb_bit): New method declarations.
10238 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
10239 New type definitions.
10240 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
10241 member declarations.
10242 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
10243 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
10244 New method definitions.
10246 2009-11-03 Ian Lance Taylor <iant@google.com>
10248 * options.h (class General_options): Add --warn_constructors.
10250 2009-11-03 Ian Lance Taylor <iant@google.com>
10253 * defstd.cc (in_section): Add entries for __rel_iplt_start,
10254 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
10256 2009-11-03 Ian Lance Taylor <iant@google.com>
10259 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
10260 --msgid-bugs-address.
10261 (install-pdf): New target.
10262 (install-data_yes): Look up one directory to find mkinstalldirs.
10264 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
10266 * po/Make-in (.po.gmo): Don't generate .gmo files in source
10269 2009-10-30 Doug Kwan <dougkwan@google.com>
10271 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
10273 2009-10-30 Doug Kwan <dougkwan@google.com>
10275 * arm.cc (Stub_addend_reader): New struct template definition
10276 and partial specializations.
10277 (Stub_addend_reader::operator()): New method definition for a
10278 partially specialized template.
10280 2009-10-30 Doug Kwan <dougkwan@google.com>
10282 * arm.cc (Arm_relobj::processor_specific_flags): New method
10284 (Arm_relobj::do_read_symbols): New method declaration.
10285 (Arm_relobj::processor_specific_flags_): New data member declaration.
10286 (Arm_dynobj): New class definition.
10287 (Target_arm::do_finalize_sections): Add input_objects parameter.
10288 (Target_arm::do_adjust_elf_header): New method declaration.
10289 (Target_arm::are_eabi_versions_compatible,
10290 (Target_arm::merge_processor_specific_flags): New method declaration.
10291 (Target_arm::do_make_elf_object): New overloaded method definitions
10293 (Arm_relobj::do_read_symbols): New method definition.
10294 (Arm_dynobj::do_read_symbols): Ditto.
10295 (Target_arm::do_finalize_sections): Add input_objects parameters.
10296 Merge processor-specific flags from all input objects.
10297 (Target_arm::are_eabi_versions_compatible,
10298 Target_arm::merge_processor_specific_flags,
10299 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
10300 New method definitions.
10301 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
10302 Input_objects pointer type parameter.
10303 * layout.cc (Layout::finalize): Pass input objects to target's.
10304 finalize_sections function.
10305 * output.cc (Output_file_header::do_sized_write): Set ELF file
10306 header's processor-specific flags.
10307 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
10308 Input_objects pointer type parameter.
10309 * sparc.cc (Target_sparc::do_finalize_sections): Same.
10310 * target.h (Input_objects): New forward class declaration.
10311 (Target::processor_specific_flags,
10312 Target::are_processor_specific_flags_sect): New method definitions.
10313 (Target::finalize_sections): Add input_objects parameter.
10314 (Target::Target): Initialize processor_specific_flags_ and
10315 are_processor_specific_flags_set_.
10316 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
10318 (Target::set_processor_specific_flags): New method definition.
10319 (Target::processor_specific_flags_,
10320 Target::are_processor_specific_flags_set_): New data member
10322 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
10323 Input_objects pointer type parameter.
10325 2009-10-30 Doug Kwan <dougkwan@google.com>
10327 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
10329 2009-10-28 Ian Lance Taylor <iant@google.com>
10331 * object.h (class Relobj): Drop options parameter from
10332 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
10333 do_scan_relocs, do_relocate. Change all callers.
10334 (class Sized_relobj): Drop options parameters from
10335 do_gc_process_relocs, do_scan_relocs, do_relocate,
10336 do_relocate_sections, relocate_sections, emit_relocs_scan,
10337 emit_relocs_scan_reltype. Change all callers.
10338 (struct Relocate_info): Remove options field and all references to
10340 * reloc.h (class Read_relocs): Remove options constructor
10341 parameter and options_ field. Change all callers.
10342 (class Gc_process_relocs, class Scan_relocs): Likewise.
10343 (class Relocate_task): Likewise.
10344 * target-reloc.h (scan_relocs): Remove options parameter. Change
10346 (scan_relocatable_relocs): Likewise.
10347 * target.h (class Sized_target): Remove options parameter from
10348 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
10350 * gc.h (gc_process_relocs): Remove options parameter. Change all
10352 * arm.cc: Update functions to remove options parameters.
10353 * i386.cc: Likewise.
10354 * powerpc.cc: Likewise.
10355 * sparc.cc: Likewise.
10356 * x86_64.cc: Likewise.
10357 * testsuite/testfile.cc: Likewise.
10359 2009-10-28 Doug Kwan <dougkwan@google.com>
10361 * arm.cc (Arm_relobj): New class definition.
10362 (Arm_relobj::scan_sections_for_stubs,
10363 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
10364 New method definitions.
10366 2009-10-28 Cary Coutant <ccoutant@google.com>
10368 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
10369 (Plugin::cleanup_done_): New member.
10370 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
10371 (Plugin_manager::cleanup_done_): Remove.
10372 (Plugin_manager::add_input_file): Edit error message.
10373 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
10374 (Plugin_manager::cleanup): Remove use of cleanup_done_.
10376 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
10378 * fileread.cc: (File_read::View::~View): Use the new
10379 data_ownership_ filed.
10380 (File_read::~File_read): Dispose the new whole_file_view_.
10381 (File_read::open): Mmap the whole file if needed.
10382 (File_read::open): Use whole_file_view_ instead of contents_.
10383 (File_read::find_view): Use whole_file_view_ if applicable.
10384 (File_read::do_read): Use whole_file_view_ instead of contents_.
10385 (File_read::make_view): Use whole_file_view_ instead of contents_,
10386 update File_read::View::View call.
10387 (File_read::find_or_make_view): Update File_read::View::View
10389 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
10391 (File_read::View::Data_ownership): New enum.
10392 (File_read::View::View): Replace bool mapped_ with Data_ownership
10394 (File_read::View::mapped_): Remove (replaced by data_ownership_).
10395 (File_read::View::data_ownership_): New field.
10396 (File_read::contents_): Remove (replaced by whole_file_view_).
10397 (File_read::whole_file_view_): New field.
10398 * options.h (class General_options): Add --keep-files-mapped.
10400 2009-10-27 Cary Coutant <ccoutant@google.com>
10402 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
10403 * testsuite/Makefile.am (plugin_test_5): New test case.
10404 * testsuite/Makefile.in: Regenerate.
10406 2009-10-25 Doug Kwan <dougkwan@google.com>
10408 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
10409 from private to protected to allow access by child class.
10410 (Sized_relobj::do_relocate_sections): New method declaration.
10411 (Sized_relobj::relocate_sections): Virtualize.
10412 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
10413 Sized_relobj::relocate_sections. Instantiate template explicitly
10414 for different target sizes and endianity.
10416 2009-10-24 Doug Kwan <dougkwan@google.com>
10418 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
10419 (Arm_input_section::as_arm_input_section): New method.
10420 (Arm_output_section): New class definition.
10421 (Arm_output_section::create_stub_group,
10422 Arm_output_section::group_sections): New method definitions.
10424 2009-10-22 Doug Kwan <dougkwan@google.com>
10426 * arm.cc (Arm_input_section): New class definition.
10427 (Arm_input_section::init, Arm_input_section:do_write,
10428 Arm_input_section::set_final_data_size,
10429 Arm_input_section::do_reset_address_and_file_offset): New method
10432 2009-10-21 Doug Kwan <dougkwan@google.com>
10434 * arm.cc (Stub_table, Arm_input_section): New forward class
10436 (Stub_table): New class defintion.
10437 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
10438 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
10439 New method definition.
10441 2009-10-21 Doug Kwan <dougkwan@google.com>
10443 * arm.cc: Update copyright comments.
10444 (Target_arm): New forward class template declaration.
10445 (Arm_address): New type.
10446 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
10447 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
10448 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
10450 (Insn_template): Same.
10451 (DEF_STUBS): New macro.
10452 (Stub_type): New enum type.
10453 (Stub_template): New class definition.
10455 (Reloc_stub): Same.
10456 (Stub_factory): Same.
10457 (Target_arm::Target_arm): Initialize may_use_blx_ and
10458 should_force_pic_veneer_.
10459 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
10460 Target_arm::should_force_pic_veneer,
10461 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
10462 Target_arm::using_thumb_only, Target_arm:;default_target): New
10464 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
10465 New data member declarations.
10466 (Insn_template::size, Insn_template::alignment): New method defintions.
10467 (Stub_template::Stub_template): New method definition.
10468 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
10469 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
10470 (Stub_factory::Stub_factory): New method definition.
10471 * gold.h (string_hash): New template.
10472 * output.h (Input_section_specifier::hash_value): Use
10474 (Input_section_specifier::string_hash): Remove.
10475 * stringpool.cc (Stringpool_template::string_hash): Use
10478 2009-10-20 Doug Kwan <dougkwan@google.com>
10480 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
10481 symbols of relaxed input sections.
10482 * output.h (Output_section::find_relaxed_input_section): Make
10485 2009-10-16 Doug Kwan <dougkwan@google.com>
10487 * dynobj.cc (Versions::Versions): Initialize version_script_.
10488 Only insert base version symbol definition for a shared object
10489 if version script defines any version versions.
10490 (Versions::define_base_version): New method definition.
10491 (Versions::add_def): Check that base version is not needed.
10492 (Versions::add_need): Define base version lazily.
10493 * dynobj.h (Versions::define_base_version): New method declaration.
10494 (Versions::needs_base_version_): New data member declaration.
10495 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
10496 (check_DATA): Add no_version_test.stdout.
10497 (libno_version_test.so, no_version_test.o no_version_test.stdout):
10499 * testsuite/Makefile.in: Regenerate.
10500 * testsuite/no_version_test.c: New file.
10501 * testsuite/no_version_test.sh: Ditto.
10503 2009-10-16 Doug Kwan <dougkwan@google.com>
10505 * expression.cc (class Segment_start_expression): New class definition.
10506 (Segment_start_expression::value): New method definition.
10507 (script_exp_function_segment_start): Return a new
10508 Segment_start_expression.
10509 * gold/script-c.h (script_saw_segment_start_expression): New function
10511 * script-sections.cc (Script_sections::Script_sections): Initialize
10512 SAW_SEGMENT_START_EXPRESSION_ to false.
10513 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
10514 and -Tbbs options to specify section addresses if given in
10515 command line and no SEGMENT_START expression is seen in a script.
10516 * script-sections.h (Script_sections::saw_segment_start_expression,
10517 Script_sections::set_saw_segment_start_expression): New method
10519 (Script_sections::saw_segment_start_expression_): New data member
10521 * script.cc (script_saw_segment_start_expression): New function.
10522 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
10523 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
10524 script_test_7.sh and script_test_8.sh.
10525 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
10526 script_test_8.stdout.
10527 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
10528 (script_test_6, script_test_6.stdout, script_test_7,
10529 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
10530 * Makefile.in: Regenerate.
10531 * testsuite/script_test_6.sh: New file.
10532 * testsuite/script_test_6.t: Same.
10533 * testsuite/script_test_7.sh: Same.
10534 * testsuite/script_test_7.t: Same.
10535 * testsuite/script_test_8.sh: Same.
10537 2009-10-16 Doug Kwan <dougkwan@google.com>
10539 * output.cc (Output_segment::set_section_list_address): Cast
10540 expressions to unsigned long long type to avoid format warnings.
10542 2009-10-15 Ian Lance Taylor <iant@google.com>
10544 * script.cc (Script_options::add_symbol_assignment): Always add a
10545 dot assignment to script_sections_.
10546 * script-sections.cc (Script_sections::add_dot_assignment):
10547 Initialize if necessary.
10549 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
10550 program headers with no load segment if there is a linker script.
10552 * layout.cc (Layout::set_segment_offsets): Align the file offset
10553 to the segment aligment for -N or -n with no load segment.
10554 * output.cc (Output_segment::add_output_section): Don't crash if
10555 the first section is a TLS section.
10556 (Output_segment::set_section_list_addresses): Print an error
10557 message if the address moves backward in a linker script.
10558 * script-sections.cc
10559 (Output_section_element_input::set_section_addresses): Don't
10560 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
10561 (Orphan_output_section::set_section_addresses): Likewise.
10563 2009-10-15 Doug Kwan <dougkwan@google.com>
10565 * layout.cc (Layout::finish_dynamic_section): Generate tags
10566 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
10567 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
10568 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
10570 2009-10-14 Ian Lance Taylor <iant@google.com>
10572 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
10574 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
10575 data_shdr fields of relinfo.
10576 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
10577 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
10578 R_386_TLS_LDO_32, adjust based on section flags.
10579 (Target_i386::Relocate::fix_up_ldo): Remove.
10581 2009-10-13 Ian Lance Taylor <iant@google.com>
10583 Add support for -pie.
10584 * options.h (class General_options): Add -pie and
10586 (General_options::output_is_position_independent): Test -pie.
10587 (General_options::output_is_executable): Return true if not shared
10588 and not relocatable.
10589 (General_options::output_is_pie): Remove.
10590 * options.cc (General_options::finalize): Reject incompatible uses
10592 * gold.cc (queue_middle_tasks): A -pie link is not static.
10593 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
10594 * symtab.cc (Symbol::final_value_is_known): Return false if
10595 output_is_position_independent.
10596 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
10597 output_is_position_independent.
10598 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
10599 output_is_position_independent.
10600 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
10601 output_is_position_independent.
10602 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
10604 (basic_pie_test.o, basic_pie_test): New targets.
10605 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
10606 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
10607 (two_file_pie_test): New target.
10608 * testsuite/Makefile.in: Rebuild.
10609 * README: Remove note saying that -pie is not supported.
10611 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
10613 * options.h (class General_options): Add -init and -fini.
10614 * layout.cc (Layout::finish_dynamic_section): Emit
10615 given init and fini functions.
10617 2009-10-13 Sriraman Tallam <tmsriram@google.com>
10619 * gc.h (gc_process_relocs): Check if icf is enabled using new
10621 * gold.cc (queue_initial_tasks): Likewise.
10622 (queue_middle_tasks): Likewise.
10623 * object.cc (do_layout): Likewise.
10624 * symtab.cc (is_section_folded): Likewise.
10625 * main.cc (main): Likewise.
10626 * reloc.cc (Read_relocs::run): Likewise.
10627 (Sized_relobj::do_scan_relocs): Likewise.
10628 * icf.cc (is_function_ctor_or_dtor): New function.
10629 (Icf::find_identical_sections): Check if function is ctor or dtor when
10630 safe icf is chosen.
10631 * options.h (General_options::icf): Change option to be an enum.
10632 (Icf_status): New enum.
10633 (icf_enabled): New method.
10634 (icf_safe_folding): New method.
10635 (set_icf_status): New method.
10636 (icf_status_): New variable.
10637 * (options.cc) (General_options::finalize): Set icf_status_.
10638 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
10639 icf_test and icf_keep_unique_test to use the --icf enum flag.
10640 * testsuite/icf_safe_test.sh: New file.
10641 * testsuite/icf_safe_test.cc: New file.
10643 2009-10-12 Sriraman Tallam <tmsriram@google.com>
10645 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
10646 includes to gc.h and icf.h.
10647 * arm.cc: Include gc.h.
10648 * gold.cc: Likewise.
10649 * i386.cc: Likewise.
10650 * powerpc.cc: Likewise.
10651 * sparc.cc: Likewise.
10652 * x86_64.cc: Likewise.
10653 * gc.h: Include icf.h.
10655 2009-10-11 Ian Lance Taylor <iant@google.com>
10657 * plugin.cc: Include "gold.h" before other header files.
10659 2009-10-10 Chris Demetriou <cgd@google.com>
10661 * options.h (Input_file_argument::Input_file_type): New enum.
10662 (Input_file_argument::is_lib_): Replace with...
10663 (Input_file_argument::type_): New member.
10664 (Input_file_argument::Input_file_argument): Take Input_file_type
10665 'type' rather than boolean 'is_lib' as second argument.
10666 (Input_file_argument::is_lib): Use type_.
10667 (Input_file_argument::is_searched_file): New function.
10668 (Input_file_argument::may_need_search): Handle is_searched_file.
10669 * options.cc (General_options::parse_library): Support -l:filename.
10670 (General_options::parse_just_symbols): Update for Input_file_argument
10672 (Command_line::process): Likewise.
10673 * archive.cc (Archive::get_file_and_offset): Likewise.
10674 * plugin.cc (Plugin_manager::release_input_file): Likewise.
10675 * script.cc (read_script_file, script_add_file): Likewise.
10676 * fileread.cc (Input_file::Input_file): Likewise.
10677 (Input_file::will_search_for): Handle is_searched_file.
10678 (Input_file::open): Likewise.
10679 * readsyms.cc (Read_symbols::get_name): Likewise.
10680 * testsuite/Makefile.am (searched_file_test): New test.
10681 * testsuite/Makefile.in: Regenerate.
10682 * testsuite/searched_file_test.cc: New file.
10683 * testsuite/searched_file_test_lib.cc: New file.
10685 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10686 Ian Lance Taylor <iant@google.com>
10688 * descriptor.cc: Include <cstdio> and "binary-io.h".
10689 (Descriptors::open): Open the files in binary mode always.
10690 * script.cc (Lex::get_token): Treat \r as whitespace.
10692 2009-10-09 Ian Lance Taylor <iant@google.com>
10694 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
10696 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10697 Ian Lance Taylor <iant@google.com>
10699 * configure.ac: Check for readv function also.
10700 * fileread.cc (readv): Define if not HAVE_READV.
10701 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
10703 * config.in: Regenerate.
10704 * configure: Regenerate.
10706 2009-10-09 Doug Kwan <dougkwan@google.com>
10708 * layout.cc (Layout::make_output_section): Call target hook to make
10709 ordinary output section.
10710 (Layout::finalize): Adjust parameter list of call the
10711 Target::may_relax().
10712 * layout.h (class Layout::section_list): New method.
10713 * merge.h (Output_merge_base::entsize): Change visibility to public.
10714 (Output_merge_base::is_string, Output_merge_base::do_is_string):
10716 (Output_merge_string::do_is_string): New method.
10717 * object.cc (Sized_relobj::do_setup): renamed from
10718 Sized_relobj::set_up.
10719 * object.h (Sized_relobj::adjust_shndx,
10720 Sized_relobj::initializ_input_to_output_maps,
10721 Sized_relobj::free_input_to_output_maps): Change visibilities to
10723 (Sized_relobj::setup): Virtualize.
10724 (Sized_relobj::do_setup): New method declaration.
10725 (Sized_relobj::invalidate_section_offset,
10726 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
10727 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
10728 * options.cc (parse_int): New function.
10729 * options.h (parse_int): New declaration.
10730 (DEFINE_int): New macro.
10731 (stub_group_size): New option.
10732 * output.cc (Output_section::Output_section): Initialize memebers
10733 merge_section_map_, merge_section_by_properties_map_,
10734 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
10735 (Output_section::add_input_section): Handled deferred code-fill
10736 generation and remove an old comment.
10737 (Output_section::add_relaxed_input_section): New method definition.
10738 (Output_section::add_merge_input_section): Use merge section by
10739 properties map to speed to search. Update merge section maps
10741 (Output_section::build_relaxation_map): New method definition.
10742 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
10744 (Output_section::relax_input_section): Renamed to
10745 Output_section::convert_input_sections_to_relaxed_sections and change
10746 interface to take a vector of pointers to relaxed sections.
10747 (Output_section::find_merge_section,
10748 Output_section::find_relaxed_input_section): New method definitions.
10749 (Output_section::is_input_address_mapped,
10750 Output_section::output_offset, Output_section::output_address):
10751 Use output section data maps to speed up searching.
10752 (Output_section::find_starting_output_address): Add comments.
10753 (Output_section::do_write,
10754 Output_section::write_to_postprocessing_buffer): Do code-fill
10755 generation as appropriate.
10756 (Output_section::get_input_sections): Invalidate relaxed input section
10758 (Output_section::restore_states): Adjust type of checkpoint .
10759 Invalidate relaxed input section map.
10760 * output.h (Output_merge_base): New class declaration.
10761 (Input_section_specifier): New class defintion.
10762 (class Output_relaxed_input_section) Change base class to
10763 Output_section_data_build.
10764 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
10765 base class initializer.
10766 (Output_section::add_relaxed_input_section): New method declaration.
10767 (Output_section::Input_section): Change visibility to protected.
10768 (Output_section::Input_section::relobj,
10769 Output_section::Input_section::shndx): Handle relaxed input sections.
10770 Output_section::input_sections) Change visibility to protected. Also
10771 define overload to return a non-const pointer.
10772 (Output_section::Merge_section_properties): New class defintion.
10773 (Output_section::Merge_section_by_properties_map,
10774 Output_section::Output_section_data_by_input_section_map,
10775 Output_section::Relaxation_map): New types.
10776 (Output_section::relax_input_section): Rename method to
10777 Output_section::convert_input_sections_to_relaxed_sections and change
10778 interface to take a vector of relaxed section pointers.
10779 (Output_section::find_merge_section,
10780 Output_section::find_relaxed_input_section,
10781 Output_section::build_relaxation_map,
10782 Output_section::convert_input_sections_in_list_to_relaxed_sections):
10783 New method declarations.
10784 (Output_section::merge_section_map_
10785 Output_section::merge_section_by_properties_map_,
10786 Output_section::relaxed_input_section_map_,
10787 Output_section::is_relaxed_input_section_map_valid_,
10788 Output_section::generate_code_fills_at_write_): New data members.
10789 * script-sections.cc
10790 (Output_section_element_input::set_section_addresses): Call
10791 current_data_size and addralign methods of relaxed input sections.
10792 (Orphan_output_section::set_section_addresses): Call current_data_size
10793 and addralign methods of relaxed input sections.
10794 * symtab.cc (Symbol_table::compute_final_value): Extract template
10795 from the body of Symbol_table::sized_finalize_symbol.
10796 (Symbol_table::sized_finalized_symbol): Call
10797 Symbol_table::compute_final_value.
10798 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
10799 (Symbol_table::compute_final_value): New templated method declaration.
10800 * target.cc (Target::do_make_output_section): New method defintion.
10801 * target.h (Target::make_output_section): New method declaration.
10802 (Target::relax): Add more parameters for input objects, symbol table
10803 and layout. Adjust call to do_relax.
10804 (Target::do_make_output_section): New method declaration.
10805 (Target::do_relax): Add parameters for input objects, symbol table
10808 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10810 * pread.c: Include stdio.h.
10812 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10814 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
10817 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10819 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
10820 Change read_shndx type to unsigned int.
10821 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10823 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10824 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
10825 Change read_shndx type to unsigned int.
10826 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10828 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10829 * layout.cc (Layout::create_symtab_sections): Cast the result of
10830 local_symcount * symsize to off_t in the gold_assert.
10832 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10834 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
10835 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
10837 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
10838 (Arm_relocate_functions::thm_abs5): New function.
10839 (Arm_relocate_functions::abs12): New function.
10840 (Arm_relocate_functions::abs16): New function.
10841 (Arm_relocate_functions::base_abs): New function.
10842 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
10843 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
10844 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
10846 (Scan::global): Likewise.
10847 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
10848 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
10849 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
10850 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
10853 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10855 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
10856 (Arm_relocate_functions::movt_prel): New function.
10857 (Arm_relocate_functions::thm_movw_prel_nc): New function.
10858 (Arm_relocate_functions::thm_movt_prel): New function.
10859 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
10860 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
10861 (Scan::global, Relocate::relocate): Likewise.
10862 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10864 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10866 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
10867 Incremental_checker.
10868 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
10870 (class Incremental_inputs_header): New class.
10871 (Incremental_inputs_header_writer): Edit comment.
10872 (Incremental_inputs_entry): New class.
10873 (Incremental_inputs_entry_writer): Edit comment.
10874 (Sized_incremental_binary::do_find_incremental_inputs_section):
10875 Add *strtab_shndx parameter, fill it.
10876 (Sized_incremental_binary::do_check_inputs): New method.
10877 (Incremental_checker::can_incrementally_link_output_file): Use
10878 Sized_incremental_binary::check_inputs.
10879 (Incremental_inputs::report_command_line): Save command line in
10882 (Incremental_binary::find_incremental_inputs_section): New
10884 (Incremental_binary::do_find_incremental_inputs_section): Add
10885 strtab_shndx parameter.
10886 (Incremental_binary::do_check_inputs): New pure virtual method.
10887 (Sized_incremental_binary::do_check_inputs): Declare.
10888 (Incremental_checker::Incremental_checker): Add incremental_inputs
10889 parameter, use it to initialize incremental_inputs_.
10890 (Incremental_checker::incremental_inputs_): New field.
10891 (Incremental_checker::command_line): New method.
10892 (Incremental_checker::inputs): New method.
10893 (Incremental_checker::command_line_): New field.
10895 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10897 * incremental.cc: Include <cstdarg> and "target-select.h".
10898 (vexplain_no_incremental): New function.
10899 (explain_no_incremental): New function.
10900 (Incremental_binary::error): New method.
10901 (Sized_incremental_binary::do_find_incremental_inputs_section): New
10903 (make_sized_incremental_binary): New function.
10904 (open_incremental_binary): New function.
10905 (can_incrementally_link_file): Add checks if output is ELF and has
10907 * incremental.h: Include "elfcpp_file.h" and "output.h".
10908 (Incremental_binary): New class.
10909 (Sized_incremental_binary): New class.
10910 (open_incremental_binary): Declare.
10911 * object.cc (is_elf_object): Use
10912 elfcpp::Elf_recognizer::is_elf_file.
10913 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
10914 * output.h (Output_file::filesize): New method.
10916 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10918 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
10920 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
10921 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
10923 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
10925 (Arm_relocate_functions::movw_abs_nc): New function.
10926 (Arm_relocate_functions::movt_abs): New function.
10927 (Arm_relocate_functions::thm_movw_abs_nc): New function.
10928 (Arm_relocate_functions::thm_movt_abs): New function.
10929 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
10930 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
10931 (Scan::global): Likewise.
10932 (Relocate::relocate): Likewise.
10933 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10935 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10937 * arm.cc (Arm_relocate_functions::got_prel) New function.
10938 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
10939 (Relocate::relocate): Likewise.
10940 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10942 2009-10-06 Ian Lance Taylor <iant@google.com>
10944 * options.h (class General_options): Define
10945 split_stack_adjust_size parameter.
10946 * object.h (class Object): Add uses_split_stack_ and
10947 has_no_split_stack_ fields. Add uses_split_stack and
10948 has_no_split_stack accessor functions. Declare
10949 handle_split_stack_section.
10950 (class Reloc_symbol_changes): Define.
10951 (class Sized_relobj): Define Function_offsets. Declare
10952 split_stack_adjust, split_stack_adjust_reltype, and
10954 * object.cc (Object::handle_split_stack_section): New function.
10955 (Sized_relobj::do_layout): Call handle_split_stack_section.
10956 * dynobj.cc (Sized_dynobj::do_layout): Call
10957 handle_split_stack_section.
10958 * reloc.cc (Sized_relobj::relocate_sections): Call
10959 split_stack_adjust for executable sections in split_stack
10960 objects. Pass reloc_map to relocate_section.
10961 (Sized_relobj::split_stack_adjust): New function.
10962 (Sized_relobj::split_stack_adjust_reltype): New function.
10963 (Sized_relobj::find_functions): New function.
10964 * target-reloc.h: Include "object.h".
10965 (relocate_section): Add reloc_symbol_changes parameter. Change
10967 * target.h (class Target): Add calls_non_split method. Declare
10968 do_calls_non_split virtual method. Declare match_view and
10970 * target.cc: Include "elfcpp.h".
10971 (Target::do_calls_non_split): New function.
10972 (Target::match_view): New function.
10973 (Target::set_view_to_nop): New function.
10974 * gold.cc (queue_middle_tasks): Give an error if mixing
10975 split-stack and non-split-stack objects with -r.
10976 * i386.cc (Target_i386::relocate_section): Add
10977 reloc_symbol_changes parameter.
10978 (Target_i386::do_calls_non_split): New function.
10979 * x86_64.cc (Target_x86_64::relocate_section): Add
10980 reloc_symbol_changes parameter.
10981 (Target_x86_64::do_calls_non_split): New function.
10982 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
10984 * powerpc.cc (Target_powerpc::relocate_section): Add
10985 reloc_symbol_changes parameter.
10986 * sparc.cc (Target_sparc::relocate_section): Add
10987 reloc_symbol_changes parameter.
10988 * configure.ac: Call AM_CONDITIONAL for the default target.
10989 * configure: Rebuild.
10990 * testsuite/Makefile.am (TEST_AS): New variable.
10991 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
10992 (check_DATA): Add split_i386 and split_x86_64 files.
10993 (SPLIT_DEFSYMS): Define.
10994 (split_i386_[1234n].o): New targets.
10995 (split_i386_[124]): New targets.
10996 (split_i386_[1234r].stdout): New targets.
10997 (split_x86_64_[1234n].o): New targets.
10998 (split_x86_64_[124]): New targets.
10999 (split_x86_64_[1234r].stdout): New targets.
11000 (MOSTLYCLEANFILES): Add new executables.
11001 * testsuite/split_i386.sh: New file.
11002 * testsuite/split_x86_64.sh: New file.
11003 * testsuite/split_i386_1.s: New file.
11004 * testsuite/split_i386_2.s: New file.
11005 * testsuite/split_i386_3.s: New file.
11006 * testsuite/split_i386_4.s: New file.
11007 * testsuite/split_i386_n.s: New file.
11008 * testsuite/split_x86_64_1.s: New file.
11009 * testsuite/split_x86_64_2.s: New file.
11010 * testsuite/split_x86_64_3.s: New file.
11011 * testsuite/split_x86_64_4.s: New file.
11012 * testsuite/split_x86_64_n.s: New file.
11013 * testsuite/testfile.cc (Target_test): Update relocation_section
11015 * testsuite/Makefile.in: Rebuild.
11017 2009-10-06 Ian Lance Taylor <iant@google.com>
11019 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
11020 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
11021 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
11022 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
11023 the address on ldo_addrs_.
11024 (Target_i386::Relocate::fix_up_ldo): New function.
11026 2009-10-06 Rafael Espindola <espindola@google.com>
11028 * plugin.cc (add_input_library): New.
11029 (Plugin::load): Add add_input_library to tv.
11030 (Plugin_manager::add_input_file): Add the is_lib argument.
11031 (add_input_file): Update call to Plugin_manager::add_input_file.
11032 (add_input_library): New.
11033 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
11035 2009-09-30 Doug Kwan <dougkwan@google.com>
11037 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
11038 symbol and call Symbol::may_need_copy_reloc to determine if
11039 a copy reloc is needed.
11040 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
11041 nocopyreloc is given in command line.
11042 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
11043 given in command line.
11044 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
11045 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
11046 of the removed Target_i386::may_need_copy_reloc.
11047 * options.h (copyreloc): New option with default value false.
11048 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11049 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
11050 instead of the removed Target_powerpc::may_need_copy_reloc.
11051 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11052 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
11053 instead of the removed Target_sparc::may_need_copy_reloc.
11054 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
11055 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
11056 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
11057 instead of the removed Target_x86_64::may_need_copy_reloc.
11059 2009-09-30 Ian Lance Taylor <iant@google.com>
11061 * object.h (class Object): Remove target_ field, and target,
11062 sized_target, and set_target methods.
11063 (Object::sized_target): Remove.
11064 (class Sized_relobj): Update declarations. Remove sized_target.
11065 * object.cc (Sized_relobj::setup): Remove target parameter.
11066 Change all callers.
11067 (Input_objects::add_object): Don't do anything with the target.
11068 (make_elf_sized_object): Add punconfigured parameter. Change all
11069 callers. Set or test parameter target.
11070 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
11071 Change all callers.
11072 * parameters.cc (Parameters::set_target): Change parameter type to
11074 (Parameters::default_target): Remove.
11075 (set_parameters_target): Change parameter type to be non-const.
11076 (parameters_force_valid_target): New function.
11077 (parameters_clear_target): New function.
11078 * parameters.h (class Parameters): Update declarations. Remove
11079 default_target method. Add sized_target and clear_target
11080 methods. Change target_ to be non-const.
11081 (set_parameters_target): Update declaration.
11082 (parameters_force_valid_target): Declare.
11083 (parameters_clear_target): Declare.
11084 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
11085 as NULL if we aren't searching.
11086 (Add_symbols::run): Don't check for compatible target.
11087 * fileread.cc (Input_file::open_binary): Call
11088 parameters_force_valid_target.
11089 * gold.cc (queue_middle_tasks): Likewise.
11090 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
11091 set_target on object.
11092 * dynobj.h (class Sized_dynobj): Update declarations.
11093 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
11094 make_elf_object returns NULL.
11095 (Archive::include_member): Don't check whether object target is
11097 * output.cc (Output_section::add_input_section): Get target from
11099 (Output_section::relax_input_section): Likewise.
11100 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
11102 (Sized_relobj::do_scan_relocs): Likewise.
11103 (Sized_relobj::relocate_sections): Likewise.
11104 * resolve.cc (Symbol_table::resolve): Likewise.
11105 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
11106 parameter. Change all callers.
11107 (Symbol_table::add_from_object): Get target from parameters.
11108 (Symbol_table::add_from_relobj): Don't check object target.
11109 (Symbol_table::add_from_dynobj): Likewise.
11110 (Symbol_table::define_special_symbol): Get target from
11112 * symtab.h (class Symbol_table): Update declaration.
11113 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
11114 parameter. Change all callers. Clear parameter target.
11115 (Binary_test): Test target here.
11116 * testsuite/object_unittest.cc (gold_testsuite): Remove
11117 target_test_pointer parameter. Change all callers.
11118 (Object_test): Test target here.
11120 2009-09-26 Ian Lance Taylor <iant@google.com>
11122 * testsuite/initpri1.c: Don't try to use constructor priorities if
11123 compiling with gcc before 4.3.
11125 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
11127 * testsuite/retain_symbols_file_test.sh (check_present): Change
11128 output file name to retain_symbols_file_test.stdout.
11129 (check_absent): Likewise.
11131 2009-09-18 Craig Silverstein <csilvers@google.com>
11133 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
11134 * options.cc: Include <cerrno> and <fstream>.
11135 (General_options::finalize): Parse -retain-symbols-file tag.
11136 * options.h: New flag.
11137 (General_options): New method should_retain_symbol, new
11138 variable symbols_to_retain.
11139 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
11140 should_retain_symbol map.
11141 * testsuite/Makefile.am (retain_symbols_file_test): New test.
11142 * testsuite/Makefile.in: Regenerate.
11143 * testsuite/retain_symbols_file_test.sh: New file.
11145 2009-09-18 Nick Clifton <nickc@redhat.com>
11147 * po/es.po: Updated Spanish translation.
11149 2009-09-17 Doug Kwan <dougkwan@google.com>
11151 * debug.h (DEBUG_RELAXATION): New constant.
11152 (DEBUG_ALL): Add DEBUG_RELAXATION.
11153 (debug_string_to_enum): Add relaxation debug option.
11155 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
11156 Layout::Relaxation_debug_check::read_sections,
11157 Layout::Relaxation_debug_check::read_sections): New method definitions.
11158 (Layout::Layout): Initialize data members
11159 record_output_section_data_from_scrips_,
11160 script_output_section_data_list_ and relaxation_debug_check_.
11161 (Layout::save_segments, Layout::restore_segments,
11162 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11163 Layout::relaxation_loop_body): New method definitions.
11164 (Layout::finalize): Support relaxation. Move section layout code to
11165 Layout::relaxation_loop_body.
11166 (Layout::set_asection_address_from_script): Move code for orphan
11167 section placement out.
11168 (Layout::place_orphan_sections_in_script): New method definition.
11169 * layout.h (Output_segment_headers, Output_file_header):
11170 New forward class declarations.
11171 (Layout::~Layout): Define.
11172 (Layout::new_output_section_data_from_script): New method definition.
11173 (Layout::place_orphan_sections_in_script): New method declaration.
11174 (Layout::Segment_states): New type declaration.
11175 (Layout::save_segments, Layout::restore_segments,
11176 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11177 Layout::relaxation_loop_body): New method declarations.
11178 (Layout::Output_section_data_list): New type declaration.
11179 (Layout::Relaxation_debug_check): New class definition.
11180 (Layout::record_output_section_data_from_script_,
11181 Layout::script_output_section_data_list_, Layout::segment_states_,
11182 Layout::relaxation_debug_check_): New data members.
11183 * output.cc: (Output_section_headers::do_size): New method definition.
11184 (Output_section_headers::Output_section_headers): Move size
11185 computation to Output_section_headers::do_size.
11186 (Output_segment_headers::do_size): New method definition.
11187 (Output_file_header::Output_file_header): Move size computation to
11188 Output_file_header::do_size and call it.
11189 (Output_file_header::do_size): New method definition.
11190 (Output_data_group::Output_data_group): Adjust call to
11191 Output_section_data.
11192 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
11193 (Output_symtab_xindex::do_write): Add array bound check.
11194 (Output_section::Input_section::print_to_mapfile): Handle
11195 RELAXED_INPUT_SECTION_CODE.
11196 (Output_section::Output_section): Initialize data member checkpoint_.
11197 (Output_section::~Output_section): Delete checkpoint object pointed
11199 (Output_section::add_input_section): Always add an Input_section if
11201 (Output_section::add_merge_input_section): Add assert.
11202 (Output_section::relax_input_section): New method definition.
11203 (Output_section::set_final_data_size): Set load address to zero for
11204 an unallocated section.
11205 (Output_section::do_address_and_file_offset_have_reset_values):
11206 New method definition.
11207 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
11208 Handle relaxed input section.
11209 (Output_section::sort_attached_input_sections): Checkpoint input
11210 section list lazily.
11211 (Output_section::get_input_sections): Change type of input_sections to
11212 list of Simple_input_section pointers. Checkpoint input section list
11213 lazily. Also handle relaxed input sections.
11214 (Output_section::add_input_section_for_script): Take a reference to
11215 a Simple_input_section object instead of Relobj pointer and section
11216 index as parameter. Handle relaxed input sections.
11217 (Output_section::save_states, Output_section::restore_states): New
11218 method definitions.
11219 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
11220 (Output_data::is_data_size_fixed): New method definition.
11221 (Output_data::reset_addresss_and_file_offset): Do not reset data size
11223 (Output_data::address_and_file_offset_have_reset_values): New method
11225 (Output_data::do_address_and_file_offset_have_reset_values): New method
11227 (Output_data::set_data_size): Check that data size is not fixed.
11228 (Output_data::fix_data_size): New method definition.
11229 (Output_data::is_data_size_fixed_): New data member.
11230 (Output_section_headers::set_final_data_size): New method definition.
11231 (Output_section_headers::do_size): New method declaration.
11232 (Output_segment_headers::set_final_data_size): New method definition.
11233 (Output_segment_headers::do_size): New method declaration.
11234 (Output_file_header::set_final_data_size)::New method definition.
11235 (Output_file_header::do_size)::New method declaration.
11236 (Output_section_data::Output_section_data): Add new parameter
11237 is_data_size_fixed and use it to fix data size.
11238 (Output_data_const::Output_data_const): Adjust call to base class
11239 constructor and fix data size.
11240 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
11241 base class constructor and fix data size.
11242 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
11243 base class constructor and fix data size.
11244 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
11245 class constructor and fix data size.
11246 (Output_data_group::set_final_data_size): New method definition.
11247 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
11248 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
11249 class constructor and fix data size.
11250 (Output_relaxed_input_section): New class definition.
11251 (Output_section::Simple_input_section): New class definition.
11252 (Output_section::get_input_sections): Adjust parameter list.
11253 (Output_section::add_input_section_for_script): Same.
11254 (Output_section::save_states, Output_section::restore_states,
11255 Output_section::do_address_and_file_offset_have_reset_values,
11256 (Output_section::Input_section::Input_section): Handle
11257 RELAXED_INPUT_SECTION_CODE. Add new overload for
11258 Output_relaxed_input_section.
11259 (Output_section::Input_section::is_input_section,
11260 Output_section::Input_section::set_output_section): Handle relaxed
11262 (Output_section::Input_section::is_relaxed_input_section,
11263 Output_section::Input_section::output_section_data,
11264 Output_section::Input_section::relaxed_input_section): New method
11266 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
11268 (Output_section::Input_section::u1_): Update comments.
11269 (Output_section::Input_section::u2_): Add new union member poris.
11270 (Output_section::Checkpoint_output_section): New classs definition.
11271 (Output_section::relax_input_section): New method declaration.
11272 (Output_section::checkpoint_): New data member.
11273 (Output_segment): Update comments.
11274 (Output_segment::Output_segment): Un-privatize copy constructor.
11275 (Output_segment::operator=): Un-privatize.
11276 * script-sections.cc (Output_section_element::Input_section_list):
11277 Change element type to Output_section::Simple_input_section.
11278 (Output_section_element_dot_assignment::set_section_addresses):
11279 Register output section data for relaxation clean up.
11280 (Output_data_exression::Output_data_expression): Adjust call to base
11281 constructor to fix data size.
11282 (Output_section_element_data::set_section_addresses): Register
11283 Output_data_expression object for relaxation clean up.
11284 (struct Input_section_info): Replace Relobj pointer and section index
11285 pair with Output_section::Simple_input_section and Convert struct to a
11287 (Input_section_sorter::operator()): Adjust access to
11288 Input_section_info data member to use accessors.
11289 (Output_section_element_input::set_section_addresses): Use layout
11290 parameter. Adjust code to use Output_section::Simple_input_section
11291 and Input_secction_info classes. Register filler for relaxation
11293 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
11294 and section index pair with Output_section::Simple_input_section
11295 class. Adjust code accordingly.
11296 (Phdrs_element::release_segment): New method definition.
11297 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
11299 (Script_sections::release_segments): New method definition.
11300 * gold/script-sections.h (Script_sections::release_segments): New
11301 method declaration.
11302 * gold/target.h (Target::may_relax, Target::relax,
11303 Target::do_may_relax, Target::do_relax): New method definitions.
11305 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11307 * arm.cc (has_signed_unsigned_overflow): New function.
11308 (Arm_relocate_functions::abs8): New function.
11309 (Target_arm::Scan::local): Handle R_ARM_ABS8.
11310 (Target_arm::Scan::global): Likewise.
11311 (Target_arm::relocate::relocate): Likewise.
11312 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11315 2009-09-16 Cary Coutant <ccoutant@google.com>
11317 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
11318 * testsuite/Makefile.in: Regenerate.
11320 2009-09-11 Nick Clifton <nickc@redhat.com>
11322 * po/gold.pot: Updated by the Translation project.
11324 2009-09-08 Cary Coutant <ccoutant@google.com>
11326 * output.cc (Output_file::open): Add execute permission to empty file.
11327 * testsuite/Makefile.am (permission_test): New test.
11328 * testsuite/Makefile.in: Regenerate.
11330 2009-09-02 Ian Lance Taylor <iant@google.com>
11332 * output.cc (Output_file::resize): Call map_no_anonymous rather
11335 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
11337 * gold.cc: Include "incremental.h".
11338 (queue_initial_tasks): Call Incremental_checker methods.
11339 * incremental.cc: Include "output.h".
11340 (Incremental_checker::can_incrementally_link_output_file): New
11342 * incremental.h (Incremental_checker): New class.
11344 * output.cc (Output_file::open_for_modification): New method.
11345 (Output_file::map_anonymous): Changed return type to bool. Record
11346 map in base_ field.
11347 (Output_file::map_no_anonymous): New method, broken out of map.
11348 (Output_file::map): Use map_no_anonymous and map_anonymous.
11349 * output.h (class Output_file): Update declarations.
11351 2009-08-24 Cary Coutant <ccoutant@google.com>
11353 * options.h (Command_line::Pre_options): New class.
11354 (Command_line::pre_options): New member.
11355 * options.cc (gold::options::ready_to_register): New variable.
11356 (One_option::register_option): Do nothing if not registering options.
11357 Assert if same short option registered twice.
11358 (General_options::General_options): Turn off option registration when
11360 (Command_line::Pre_options::Pre_options): New constructor.
11362 2009-08-24 Cary Coutant <ccoutant@google.com>
11364 * options.h (General_options::no_keep_memory): Remove incorrect
11367 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11369 * Makefile.am (am__skiplex, am__skipyacc): New.
11370 * Makefile.in: Regenerate.
11372 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11374 * Makefile.am (AM_CPPFLAGS): Renamed from ...
11375 (INCLUDES): ... this.
11376 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
11377 (AM_CPPFLAGS): Renamed from ...
11378 (INCLUDE): ... this.
11379 * Makefile.in, testsuite/Makefile.in: Regenerate.
11381 * Makefile.in: Regenerate.
11382 * aclocal.m4: Likewise.
11383 * config.in: Likewise.
11384 * configure: Likewise.
11385 * testsuite/Makefile.in: Likewise.
11387 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11388 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11389 * Makefile.in: Regenerate.
11390 * testsuite/Makefile.in: Regenerate.
11392 2009-08-19 Cary Coutant <ccoutant@google.com>
11394 * resolve.cc (Symbol_table::resolve): Don't complain about defined
11395 symbols in shared libraries overridden by hidden or internal symbols
11396 in the main program.
11398 2009-08-19 Chris Demetriou <cgd@google.com>
11400 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
11401 checking source file names in error messages.
11403 2009-08-18 Doug Kwan <dougkwan@google.com>
11405 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
11406 an elcpp::Ehdr as parameter. Adjust call to set_target.
11407 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
11408 an elfcpp::Ehdr as parameter.
11409 * object.cc (Object::set_target): Remove the version that looks up
11410 a target and sets it.
11411 (Sized_relobj::setup): Take a Target object instead of
11412 an elfcpp::Ehdr as parameter. Adjust call to set_target.
11413 (make_elf_sized_object): Find target and ask target to
11414 make an ELF object.
11415 * object.h: (Object::set_target): Remove the version that looks up
11416 a target and sets it.
11417 (Sized_relobj::setup): Take a Target object instead of
11418 an elfcpp:Ehdr as parameter.
11419 * target.cc: Include dynobj.h.
11420 (Target::do_make_elf_object_implementation): New.
11421 (Target::do_make_elf_object): New.
11422 * target.h (Target::make_elf_object): New template declaration.
11423 (Target::do_make_elf_object): New method declarations.
11424 (Target::do_make_elf_object_implementation): New template declaration.
11426 2009-08-14 Ian Lance Taylor <iant@google.com>
11428 * gold.h (FUNCTION_NAME): Define.
11429 (gold_unreachable): Use FUNCTION_NAME.
11431 2009-08-12 Sriraman Tallam <tmsriram@google.com>
11433 * icf.cc (Icf::find_identical_sections): Issue a warning when a
11434 symbol in the --keep-unique list is not found.
11436 2009-08-12 Sriraman Tallam <tmsriram@google.com>
11438 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
11439 been maked as --keep-unique.
11440 (Icf::unfold_section): New function.
11441 * icf.h (Icf::unfold_section): New function.
11442 * options.h (General_options::keep_unique): New option.
11443 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
11444 * testsuite/Makefile.in: Regenerate.
11445 * testsuite/icf_keep_unique_test.sh: New file.
11446 * testsuite/icf_keep_unique_test.cc: New file.
11448 2009-08-12 Cary Coutant <ccoutant@google.com>
11451 * resolve.cc (Symbol_table::resolve): Check for references from
11452 dynamic objects to hidden and internal symbols.
11453 * testsuite/Makefile.am (hidden_test.sh): New test.
11454 * testsuite/Makefile.in: Regenerate.
11455 * testsuite/hidden_test.sh: New script.
11456 * testsuite/hidden_test_1.c: New test source.
11457 * testsuite/hidden_test_main.c: New test source.
11459 2009-08-11 Doug Kwan <dougkwan@google.com>
11461 * arm.cc: Update comments.
11462 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
11463 segment to locate the .ARM.exidx section if present.
11465 2009-08-09 Doug Kwan <dougkwan@google.com>
11467 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
11470 2009-08-07 Sriraman Tallam <tmsriram@google.com>
11471 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
11474 2009-08-06 Sriraman Tallam <tmsriram@google.com>
11476 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
11477 valid tls_segment only for non-debug-section relocations.
11478 * testsuite/Makefile.am: Add gc_tls_test.
11479 * testsuite/Makefile.in: Regenerate.
11480 * testsuite/gc_tls_test.cc: New file.
11481 * testsuite/gc_tls_test.sh: New file.
11483 2009-08-05 Sriraman Tallam <tmsriram@google.com>
11485 * icf.cc: New file.
11487 * Makefile.am (CCFILES): Add icf.cc.
11488 (HFILES): Add icf.h
11489 * Makefile.in: Regenerate.
11490 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
11491 * gc.h (gc_process_relocs): Populate lists used by icf to contain
11492 section, symbol and addend information for the relocs.
11493 * gold.cc (queue_middle_tasks): Call identical code folding.
11494 * gold.h: Add defines for multimap.
11495 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
11496 to the call of finalize_local_symbols.
11497 * main.cc (main): Create object of class Icf.
11498 * object.cc (Sized_relobj::do_layout): Allow this function to be
11499 called twice during icf.
11500 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
11501 to sections marked as identical by icf.
11502 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
11504 (Sized_relobj::do_section_entsize): New function.
11505 * object.h (Object::section_entsize): New function.
11506 (Object::do_section_entsize): New pure virtual function.
11507 (Relobj::finalize_local_symbols): Add new parameter.
11508 (Relobj::do_section_entsize): New function.
11509 * options.h (General_options::icf): New option.
11510 (General_options::icf_iterations): New option.
11511 (General_options::print_icf_sections): New option.
11512 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
11513 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
11514 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
11516 * symtab.cc (Symbol_table::is_section_folded): New function.
11517 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
11518 to sections marked as identical by icf.
11519 * symtab.h (Symbol_table::set_icf): New function.
11520 (Symbol_table::icf): New function.
11521 (Symbol_table::is_section_folded): New function.
11522 (Symbol_table::icf_): New data member.
11523 * target-reloc.h (relocate_section): Ignore sections folded by icf.
11524 * testsuite/Makefile.am: Add commands to build icf_test.
11525 * testsuite/Makefile.in: Regenerate.
11526 * testsuite/icf_test.sh: New file.
11527 * testsuite/icf_test.cc: New file.
11529 2009-07-24 Chris Demetriou <cgd@google.com>
11531 * layout.cc (is_compressible_debug_section): Fix incorrect
11532 comment about compressed section names.
11534 2009-07-20 Ian Lance Taylor <ian@airs.com>
11537 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
11539 2009-07-16 Ian Lance Taylor <iant@google.com>
11542 * layout.h: #include <map>.
11543 (class Kept_section): Change from struct to class. Add accessors
11544 and setters. Add section size to Comdat_group mapping. Change
11545 Comdat_group to std::map. Add is_comdat_ field. Add
11546 linkonce_size field in union.
11547 (class Layout): Update declaration of find_or_add_kept_section.
11548 Don't declare find_kept_object.
11549 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
11550 parameter. Add object, shndx, is_comdat, and is_group_name
11551 parameters. Change all callers. Adjust for new Kept_section.
11552 (Layout::find_kept_object): Remove.
11553 * object.cc (Sized_relobj::include_section_group): Update use of
11554 Kept_section. Rename secnum to shndx. Only record
11555 Kept_comdat_section if sections are the same size.
11556 (Sized_relobj::include_linkonce_section): Update use of
11557 Kept_section. Only record Kept_comdat_section if sections are the
11558 same size. Set size of linkonce section.
11559 (Sized_relobj::map_to_kept_section): Update call to
11560 get_kept_comdat_section.
11561 * object.h (class Sized_relobj): Rename fields in
11562 Kept_comdat_section to drop trailing underscores; change object
11563 field to Relobj*. Change Kept_comdat_section_table to store
11564 struct rather than pointer.
11565 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
11566 Add kept_object and kept_shndx parameters. Change all callers.
11567 (Sized_relobj::get_kept_comdat_section): Change return type to
11568 bool. Add kept_object and kept_shndx parameters. Change all
11570 * plugin.cc (Pluginobj::include_comdat_group): Update call to
11571 Layout::find_or_add_kept_section.
11573 2009-07-09 Ian Lance Taylor <iant@google.com>
11575 * merge.cc (Object_merge_map::initialize_input_to_output_map):
11576 Reserve space in the hash table.
11578 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
11580 * fileread.cc (File_read::get_mtime): New method.
11581 * fileread.h (Timespec): New structure.
11582 (File_read::get_mtime): New method.
11583 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
11584 Renamed from timestamp_nsec.
11585 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
11587 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
11589 (Incremental_inputs::report_archive): Save mtime; style fix.
11590 (Incremental_inputs::report_obejct): Save mtime; style fix.
11591 (Incremental_inputs::report_script): Save mtime; style fix.
11592 (Incremental_inputs::finalize_inputs): Style fix.
11593 (Incremental_inputs::finalize): Style fix.
11594 (Incremental_inputs::create_input_section_data): Store inputs
11596 * incremental.h (Incremental_inputs::report_script): Add mtime
11598 (Incremental_inputs::Input_info::Input_info): Intialize only one
11600 (Incremental_inputs::Input_info::archive): Move to nameless
11602 (Incremental_inputs::Input_info::obejct): Move to nameless union.
11603 (Incremental_inputs::Input_info::script): Move to nameless union.
11604 (Incremental_inputs::mtime): New field.
11605 * script.cc (read_input_script): Pass file mtime to
11607 * script.h (Script_info::inputs): Style fix.
11609 2009-07-01 Ian Lance Taylor <ian@airs.com>
11611 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
11614 2009-06-24 Ian Lance Taylor <iant@google.com>
11617 * layout.cc (Layout::choose_output_section): If we find an
11618 existing section, update the flags.
11619 (Layout::create_notes): New function, broken out of
11621 (Layout::finalize): Don't create note sections.
11622 (Layout::create_note): Don't crash if linker script discards
11624 (Layout::create_gold_note): Likewise.
11625 (Layout::create_build_id): Likewise. Don't set
11626 after_input_sections on the section.
11627 (Layout::create_executable_stack_info): Remove target parameter.
11629 * layout.h (class Layout): Declare create_notes. Update
11630 declaration of create_executable_stack_info.
11631 * gold.cc (queue_middle_tasks): Call create_notes.
11632 * output.cc (Output_section::update_flags_for_input_section): Move
11633 here from output.h. If SHF_ALLOC flag is newly set, mark address
11635 * output.h (Output_data::mark_address_invalid): New function.
11636 (class Output_section): Only declare, not define,
11637 update_flags_for_input_section. Remove set_flags.
11639 2009-06-24 Ian Lance Taylor <iant@google.com>
11641 * script-sections.cc (Output_section_definition::
11642 set_section_addresses): Rename shadowing local load_address to
11645 2009-06-24 Ian Lance Taylor <iant@google.com>
11648 * reloc.cc (relocate_sections): Skip empty relocation sections.
11650 2009-06-23 Ian Lance Taylor <iant@google.com>
11653 * layout.cc (Layout::create_note): Use choose_output_section
11654 rather than make_output_section.
11656 2009-06-23 Ian Lance Taylor <iant@google.com>
11659 * options.cc (General_options::parse_V): Set printed_version_.
11660 (General_options::General_options): Initialize printed_version_.
11661 * options.h (class General_options): Add printed_version_ field.
11662 * gold.cc (queue_initial_tasks): If there are no input files,
11663 don't give a fatal error if we printed the version information.
11664 (queue_middle_tasks): If using -r with a shared object, give a
11665 fatal error rather than an ordinary error.
11667 2009-06-23 Ian Lance Taylor <iant@google.com>
11670 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
11671 (Layout::make_output_section): Set have_stabstr_section_ if we see
11672 a .stab*str section.
11673 (Layout::finalize): Call link_stabs_sections.
11674 (Layout::link_stabs_sections): New file.
11675 * layout.h (class Layout): Add have_stabstr_section_ field.
11676 Declare link_stabs_sections.
11678 2009-06-23 Doug Kwan <dougkwan@google.com>
11680 * Makefile.am (libgold_a_LIBADD): New.
11681 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
11682 * Makefile.in: Regenerate.
11683 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
11684 * configure: Regenerate.
11685 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
11686 * fileread.cc: Include sys/state.h
11687 * gold.h: Declare memmem and strndup if found missing.
11688 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
11690 2009-06-23 Ian Lance Taylor <iant@google.com>
11692 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
11693 * configure: Rebuild.
11695 2009-06-23 Ian Lance Taylor <iant@google.com>
11698 * object.cc (Object::section_contents): Don't try to get a view if
11699 the section has length zero.
11700 (Object::handle_gnu_warning_section): If the section is empty, use
11701 the name of the section as the warning.
11703 2009-06-23 Ian Lance Taylor <iant@google.com>
11706 * stringpool.h (class Stringpool_template): Add optimize_ field.
11707 (Stringpool_template::set_optimize): New function.
11708 * stringpool.cc (Stringpool_template::Stringpool_template):
11709 Initialize optimize_ field.
11710 (Stringpool_template::set_string_offsets): Test local optimize
11711 fild rather than parameter.
11712 * layout.cc (Layout::Layout): Call set_optimize on the section
11715 2009-06-22 Ian Lance Taylor <iant@google.com>
11718 * yyscript.y: Parse TARGET.
11719 * script.cc (script_set_target): New function.
11720 * script-c.h (script_set_target): Declare.
11721 * options.cc (General_options::string_to_object_format): Rename
11722 from string_to_object_format in anonymous namespace. Change
11724 * options.h (class General_options): Declare
11725 string_to_object_format.
11727 2009-06-22 Ian Lance Taylor <iant@google.com>
11729 * script-sections.cc (Script_sections::create_segments): Don't put
11730 program headers in a PT_LOAD segment if -n or -N.
11732 2009-06-22 Ian Lance Taylor <iant@google.com>
11735 * options.h (class General_options): Add -z lazy and -z now. Sort
11736 -z options into alphabetical order.
11737 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
11739 2009-06-21 Ian Lance Taylor <iant@google.com>
11741 * layout.cc (Layout::make_output_section): Call
11742 Target::new_output_section.
11743 (Layout::attach_allocated_section_to_segment): Put large section
11744 sections in a separate load segment with the large segment flag
11746 (Layout::segment_precedes): Sort large data segments after other
11748 (align_file_offset): New static function.
11749 (Layout::set_segment_offsets): Use align_file_offset.
11750 * output.h (class Output_section): Add is_small_section_ and
11751 is_large_section_ fields.
11752 (Output_section::is_small_section): New function.
11753 (Output_section::set_is_small_section): New function.
11754 (Output_section::is_large_section): New function.
11755 (Output_section::set_is_large_section): New function.
11756 (Output_section::is_large_data_section): New function.
11757 (class Output_segment): Add is_large_data_segment_ field.
11758 (Output_segment::is_large_data_segment): New function.
11759 (Output_segment::set_is_large_data_segment): New function.
11760 * output.cc (Output_section::Output_section): Initialize new
11762 (Output_segment::Output_segment): Likewise.
11763 (Output_segment::add_output_section): Add assertion that large
11764 data sections always go in large data segments. Force small data
11765 sections to the end of the list of data sections. Force small BSS
11766 sections to the start of the list of BSS sections. For large BSS
11767 sections to the end of the list of BSS sections.
11768 * symtab.h (class Symbol): Declare is_common_shndx.
11769 (Symbol::is_defined): Check Symbol::is_common_shndx.
11770 (Symbol::is_common): Likewise.
11771 (class Symbol_table): Define enum Commons_section_type. Update
11772 declarations. Add small_commons_ and large_commons_ fields.
11773 * symtab.cc (Symbol::is_common_shndx): New function.
11774 (Symbol_table::Symbol_table): Initialize new fields.
11775 (Symbol_table::add_from_object): Put small and large common
11776 symbols in the right list.
11777 (Symbol_table::sized_finalized_symbol): Check
11778 Symbol::is_common_shndx.
11779 (Symbol_table::sized_write_globals): Likewise.
11780 * common.cc (Symbol_table::do_allocate_commons): Allocate new
11781 common symbol lists. Don't call do_allocate_commons_list if the
11783 (Symbol_table::do_allocate_commons_list): Remove is_tls
11784 parameter. Add comons_section_type parameter. Change all
11785 callers. Handle small and large common symbols.
11786 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
11787 Symbol::is_common_shndx.
11788 * resolve.cc (symbol_to_bits): Likewise.
11789 * target.h (Target::small_common_shndx): New function.
11790 (Target::small_common_section_flags): New function.
11791 (Target::large_common_shndx): New function.
11792 (Target::large_common_section_flags): New function.
11793 (Target::new_output_section): New function.
11794 (Target::Target_info): Add small_common_shndx, large_common_shndx,
11795 small_common_section_flags, and large_common_section_flags
11797 (Target::do_new_output_section): New virtual function.
11798 * arm.cc (Target_arm::arm_info): Initialize new fields.
11799 * i386.cc (Target_i386::i386_info): Likewise.
11800 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
11802 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
11803 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11804 (Target_x86_64::do_new_output_section): New function.
11805 * configure.ac: Define conditional MCMODEL_MEDIUM.
11806 * testsuite/Makefile.am (check_PROGRAMS): Add large.
11807 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
11808 (large_LDFLAGS): Define.
11809 * testsuite/large.c: New file.
11810 * testsuite/testfile.cc (Target_test::test_target_info):
11811 Initialize new fields.
11812 * configure, testsuite/Makefile.in: Rebuild.
11814 2009-06-05 Doug Kwan <dougkwan@google.com>
11816 * Makefile.am (CCFILES): Add target.cc.
11817 * Makefile.in: Regenerate.
11818 * i386.cc (class Target_i386): Define new virtual method to
11819 override do_is_local_label_name in parent.
11820 * object.cc (Sized_relobj::do_count_local_symbols): Discard
11821 local symbols if --discard-locals or -X is given.
11822 * options.h (class General_options): Declare new options
11823 '--discard-locals' and '-X' for discarding locals.
11824 * target.h (class Target): Define new methods is_local_label_name.
11825 Declare new virtual method do_is_local_label_name.
11826 * target.cc: New file.
11827 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
11828 (check_SCRIPTS): Add discard_locals_test.sh.
11829 (check_DATA): Add discard_local_tests.syms.
11830 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
11831 (discard_local_tests.syms, discard_locals_test.o): New make rules.
11832 * testsuite/Makefile.in: Regenerate.
11833 * testsuite/discard_locals_test.c: New file.
11834 * testsuite/discard_locals_test.sh: Same.
11836 2009-06-05 Doug Kwan <dougkwan@google.com>
11838 * object.cc (Sized_relobj::Sized_relobj): Initialize
11839 discarded_eh_frame_shndx_ to -1U.
11840 (Sized_relobj::do_layout): Record index of a discard .eh_frame
11842 (Sized_relobj::do_count_local_symbols): Skip local symbols in
11843 a discarded .eh_frame section.
11844 (Sized_relobj::do_finalize_local_symbols): Ditto.
11845 * object.h (class Sized_relobj): Declare new member
11846 discarded_eh_frame_shndx_.
11847 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
11848 (local_labels_test.o, local_labels_test): New rules.
11849 * testsuite/Makefile.in: Regenerate.
11851 2009-06-04 Doug Kwan <dougkwan@google.com>
11853 * layout.cc (Layout::section_name_mapping): Add mapping for
11854 special ARM sections.
11856 2009-06-03 Doug Kwan <dougkwan@google.com>
11858 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
11859 (utils::has_overflow): Same.
11861 2009-06-03 Ian Lance Taylor <iant@google.com>
11863 * layout.cc (Layout::section_name_mapping): New array, replacing
11864 Layout::linkonce_mapping.
11865 (Layout::section_name_mapping_count): New variable, replacing
11866 Layout::linkonce_mapping_count.
11867 (Layout::linkonce_output_name): Remove.
11868 (Layout::output_section_name): Rewrite.
11869 * layout.h (class Layout): Rename Linkonce_mapping to
11870 Section_name_mapping, linkonce_mapping to section_name_mapping,
11871 linkonce_mapping_count to section_name_mapping_count. Don't
11872 declare linkonce_output_name.
11874 2009-06-03 Doug Kwan <dougkwan@google.com>
11876 * gold/arm.cc (namespace utils): New.
11877 (Target_arm::reloc_is_non_pic): Define new method.
11878 (class Arm_relocate_functions): New.
11879 (Target_arm::Relocate::relocate): Handle relocation types used by
11882 2009-06-03 Ian Lance Taylor <iant@google.com>
11884 * arm.cc (Target_arm::scan::global): Use || instead of |.
11886 2009-06-02 Doug Kwan <dougkwan@google.com>
11888 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
11889 issued_non_pic_error_.
11890 (class Target_arm::Scan): Declare new method check_non_pic.
11891 Define new method symbol_needs_plt_entry.
11892 Declare new data member issued_non_pic_error_.
11893 (class Target_arm::Relocate): Declare new method
11894 should_apply_static_reloc.
11895 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
11896 (Target_arm::Scan::check_non_pic): Define new method.
11897 (Target_arm::Scan::local): Handle a small subset of reloc types used
11899 (Target_arm::Scan::local): Same.
11900 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
11902 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
11904 * incremental.cc (Incremental_inputs::report_command_line): Filter
11905 out --incremental-* options.
11907 2009-05-29 Doug Kwan <dougkwan@google.com>
11909 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
11911 (class Target_arm): Update comment.
11912 (Target_arm::Target_arm): Initialize new data members GOT_,
11913 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
11914 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
11915 and Target_arm::rel_dyn_section.
11916 Declare new_enum Target_arm::Got_type.
11917 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
11919 Update commments for member do_dynsym_value.
11920 (Target_arm::got_size, Target_arm::plt_section,
11921 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
11922 new methods inside class defintion.
11923 (Target_arm::got_section): Define new method.
11924 (Target_arm::rel_dyn_section): Same.
11925 (Output_data_plt_arm): New template class.
11926 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
11927 (Output_data_plt_arm:do_adjust_output_section): Define new method.
11928 (Output_data_plt_arm::add_entry): Same.
11929 (Output_data_plt_arm::first_plt_entry): Define new
11930 static data member for PLT instruction template.
11931 (Output_data_plt_arm::plt_entry): Same.
11932 (Output_data_plt_arm::do_write): Define new method.
11933 (Target_arm::make_plt_entry): Same.
11934 (Target_arm::do_finalize_sections): Same.
11935 (Target_arm::do_dynsym_value): Same.
11937 2009-05-28 Doug Kwan <dougkwan@google.com>
11939 * Makefile.am (TARGETSOURCES): Add arm.cc.
11940 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
11941 * Makefile.in: Regenerate.
11942 * arm.cc: New file.
11943 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
11945 2009-05-26 Doug Kwan <dougkwan@google.com>
11947 * options.cc (General_options::parse_exclude_libs). Fix a comment.
11948 (General_options::check_excluded_libs): Strip off directories in
11949 archive name before matching like GNU ld does.
11950 * testsuite/Makefile.am (MOSTLYCLEANFILES,
11951 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
11952 (exclude_libs_test_LDFLAGS): Add linker option
11953 -Wl,--exclude-libs,libexclude_libs_test_3
11954 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
11955 an explicit archive without using -l.
11956 (alt/libexclude_libs_test_3.a): New make rule.
11957 * testsuite/Makefile.in: Regenerate.
11958 * testsuite/exclude_libs_test.c : Declare lib3_default().
11960 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
11961 * exclude_libs_test_3.c: New file.
11963 2009-05-26 Nick Clifton <nickc@redhat.com>
11965 * po/id.po: New Indonesian translation.
11966 * po/gold.pot: Updated template file.
11968 2009-05-22 Sriraman Tallam <tmsriram@google.com>
11970 * testsuite/Makefile.am: Add -ffunction-sections to compile
11971 gc_comdat_test files. Add -Wl,--gc-sections to build
11973 * testsuite/Makefile.in: Regenerate.
11974 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
11976 2009-05-21 Sriraman Tallam <tmsriram@google.com>
11978 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
11979 kept comdat section was garbage collected.
11980 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
11981 * testsuite/Makefile.in: Regenerate.
11982 * testsuite/gc_comdat_test.sh: New file.
11983 * testsuite/gc_comdat_test_1.cc: New file.
11984 * testsuite/gc_comdat_test_2.cc: New file.
11986 2009-05-19 Doug Kwan <dougkwan@google.com>
11988 * archive.cc (Archive::Archive): Move constructor from archive.h
11989 to here. Initialize no_export_.
11990 (Archive::get_elf_object_for_member): Set no_export flag of object.
11991 * archive.h (Archive::Archive): Move constructor body to
11993 (Archive::no_export): New method.
11994 (Archive::no_export_): New field.
11995 * object.h (Object::Object): Initialize no_export_ to false.
11996 (Object::no_export, Object::set_no_export): New methods.
11997 (Object::no_export_): New field.
11998 * options.cc (General_options::parse_exclude_libs): New method.
11999 (General_options::check_excluded_libs) Same.
12000 * options.h (exclude_libs): New option.
12001 (General_options::check_excluded_libs): New method declaration.
12002 (General_options::excluded_libs_): New field.
12003 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
12004 default or protected visibility if an object has no-export flag set.
12005 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
12006 (check_SCRIPTS): Add exclude_libs_test.sh.
12007 (check_DATA): Add exclude_libs_test.syms.
12008 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
12009 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
12010 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
12011 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
12012 (exclude_libs_test.syms, libexclude_libs_test_1.a,
12013 libexclude_libs_test_2.a): New rules.
12014 * testsuite/Makefile.in: Regenerate.
12015 * testsuite/exclude_libs_test.c: New file.
12016 * testsuite/exclude_libs_test.sh: Ditto.
12017 * testsuite/exclude_libs_test_1.c: Ditto.
12018 * testsuite/exclude_libs_test_2.c: Ditto.
12020 2009-05-15 Ian Lance Taylor <iant@google.com>
12022 * configure.ac: Check for declarations for cases where libiberty.h
12023 checks HAVE_DECL_xxx.
12024 * configure, config.in: Rebuild.
12026 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
12028 * gold.h (Incremental_argument_list): Remove (invalid) forward
12030 * incremental.cc (Incremental_inputs::report_achive): New method.
12031 (Incremental_inputs::report_object): New method.
12032 (Incremental_inputs::report_script): New method.
12033 (Incremental_inputs::finalize_inputs): New method.
12034 (Incremental_inputs::finalize): Call finalize_inputs().
12035 (Incremental_inputs::sized_create_incremental_inputs_section_data):
12036 Create inputs entries.
12037 * incremental.h (Incremental_input_type): New enum.
12038 (Incremental_inputs::Incremental_input): Initialize new fields.
12039 (Incremental_inputs::report_inputs): New method.
12040 (Incremental_inputs::report_achive): New method.
12041 (Incremental_inputs::report_object): New method.
12042 (Incremental_inputs::report_script): New method.
12043 (Incremental_inputs::finalize_inputs): New method.
12044 (Incremental_inputs::Input_info): New struct.
12045 (Incremental_inputs::Input_info_map): New typedef.
12046 (Incremental_inputs::lock_): New field.
12047 (Incremental_inputs::Inputs_): New field.
12048 (Incremental_inputs::Inputs_map): New field.
12049 * main.cc (main): Call Incremental_input::report_inputs.
12050 * options.h (Input_argument_list): Typedef moved from
12052 (Input_file_group::Files): Remove, use ::Input_argument_list.
12053 (Input_file_group::Input_argument_list): Remove, use
12054 ::Input_argument_list.
12055 * plugin.cc (Plugin_manager::add_input_file): Add error in
12057 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
12059 * script.cc (read_input_script): Call
12060 Incremental_input::report_script.
12061 * script.h (Script_info): New class.
12063 2009-04-27 Ian Lance Taylor <iant@google.com>
12065 * x86_64.cc (do_adjust_output_section): Set entsize to
12068 2009-04-23 Elliott Hughes <enh@google.com>
12070 * output.cc (Output_file::close): After short writes, continue
12071 writing from the correct offset in the buffer being written.
12073 2009-04-23 Chris Demetriou <cgd@google.com>
12075 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
12076 * configure: Regenerate.
12077 * config.in: Regenerate.
12078 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
12079 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
12081 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
12083 * incremental.cc (Incremental_inputs_header_data): Renamed from
12084 Incremental_input_header_data.
12085 (Incremental_inputs_header_data::data_size): New field.
12086 (Incremental_inputs_header_data::put_input_file_count): Renamed
12087 from input_file_count.
12088 (Incremental_inputs_header_data::put_command_line_offset): Renamed
12089 from command_line_offset.
12090 (Incremental_inputs_header_data::put_reserved): Renamed from
12092 (Incremental_inputs_entry_data): Renamed from
12093 Incremental_input_entry_data.
12094 (Incremental_inputs_entry_data::data_size): New field.
12095 (Incremental_inputs::report_command_line): New method.
12096 (Incremental_inputs::finalize): New method.
12097 (Incremental_inputs::create_incremental_inputs_data): New method.
12098 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
12099 * incremental.h: New file.
12100 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
12101 (Layout::finalize): Create incremental inputs section in
12102 incremental builds.
12103 (Layout::create_incremental_info_sections): New method.
12104 * layout.h (Layout::incremental_inputs): New method.
12105 (Layout::create_incremental_info_sections): New method.
12106 (Layout::incremental_inputs_): New field.
12107 * main.cc (main): Notify Incremental_input of the command line.
12109 2009-04-01 Ian Lance Taylor <iant@google.com>
12110 Mikolaj Zalewski <mikolajz@google.com>
12112 * gold.h (reserve_unordered_map): Define, three versions, one for
12113 each version of Unordered_map.
12114 * layout.cc (Layout::Layout): Remove options parameter. Add
12115 number_of_input_files parameter. Don't initialize options_.
12116 Initialize number_of_input_files_ and resized_signatures_. Move
12117 sections_are_attached_.
12118 (Layout::layout_group): Reserve space for group_signatures_.
12119 (Layout::find_or_add_kept_section): Change name parameter to be a
12120 reference. Resize signatures_ map when it gets large enough.
12121 (Layout::layout_eh_frame): Use parameters->options() instead of
12123 (Layout::make_output_section): Likewise.
12124 (Layout::attach_allocated_section_to_segment): Likewise.
12125 (Layout::finalize, Layout::create_executable_stack): Likewise.
12126 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
12127 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
12128 * layout.h (class Layout): Update declarations. Remove options_
12129 field. Add number_of_input_files_ and resized_signatures_
12130 fields. Move sections_are_attached_ field.
12131 * main.cc (main): Pass number of input files to Layout
12132 constructor. Don't pass options.
12134 2009-03-30 Ian Lance Taylor <iant@google.com>
12136 * ffsll.c (ffsll): Correct implementation.
12138 2009-03-27 Ian Lance Taylor <iant@google.com>
12140 * ffsll.c: New file.
12141 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
12142 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
12143 * ftruncate.c (ftruncate): Declare before definition.
12144 * mremap.c (mremap): Likewise.
12145 * pread.c (pread): Likewise.
12146 * configure, Makefile.in, config.in: Rebuild.
12148 * mremap.c: New file.
12149 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
12150 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
12151 (mremap): Declare if HAVE_MREMAP is not defined.
12152 * configure, Makefile.in, config.in: Rebuild.
12154 2009-03-27 Cary Coutant <ccoutant@google.com>
12156 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
12157 position independent.
12158 * sparc.cc (Target_sparc::check_non_pic): Likewise.
12159 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
12161 2009-03-24 Cary Coutant <ccoutant@google.com>
12163 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
12165 (needs_dynamic_reloc): Likewise.
12167 2009-03-24 Ian Lance Taylor <iant@google.com>
12169 * yyscript.y (file_cmd): Recognize EXTERN.
12170 (extern_name_list, extern_name_list_body): New nonterminals.
12171 * script.cc (script_add_extern): Define.
12172 * script-c.h (script_add_extern): Declare.
12174 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
12176 * object.cc (is_elf_object): Define.
12177 * object.h (is_elf_object): Declare.
12178 * archive.cc (Archive::get_elf_object_for_member): Call
12180 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
12182 2009-03-24 Elliott Hughes <enh@google.com>
12184 * output.cc (Output_file::map_anonymous): Define.
12185 (Output_file::map): Use map_anonymous. If the regular mmap fails,
12186 try an anonymous one. Report the size if the mmap fails.
12187 * output.h (class Output_file): Declare map_anonymous.
12189 2009-03-24 Ian Lance Taylor <iant@google.com>
12191 * target-select.cc (instantiate_target): Don't acquire the lock if
12192 the instantiated_target_ field has already been set.
12194 2009-03-23 Ian Lance Taylor <iant@google.com>
12196 * gold-threads.h (class Initialize_lock): Define.
12197 * gold-threads.cc (class Initialize_lock_once): Define.
12198 (initialize_lock_control): New static variable.
12199 (initialize_lock_pointer): New static variable.
12200 (initialize_lock_once): New static function.
12201 (Initialize_lock::Initialize_lock): Define.
12202 (Initialize_lock::initialize): Define.
12203 * target-select.h: Include "gold-threads.h".
12204 (class Target_selector): Add lock_ and initialize_lock_ fields.
12205 Don't define instantiate_target, just declare it.
12206 * target-select.cc (Target_selector::Target_selector): Initialize
12208 (Target_selector::instantiate_target): Define.
12209 * descriptors.h: Include "gold-threads.h".
12210 (class Descriptors): Add initialize_lock_ field.
12211 * descriptors.cc (Descriptors::Descriptors): Initialize new
12213 (Descriptors::open): Use initialize_lock_ field
12214 * errors.h (class Errors): Add initialize_lock_ field.
12215 * errors.cc (Errors::Errors): Initialize new field.
12216 (Errors::initialize_lock): Use initialize_lock_ field.
12217 * powerpc.cc (class Target_selector_powerpc): Remove
12218 instantiated_target_ field. In do_recognize call
12219 instantiate_target rather than do_instantiate_target. In
12220 do_instantiate_target just allocate a new target.
12221 * sparc.cc (class Target_selector_sparc): Likewise.
12223 * freebsd.h: New file.
12224 * i386.cc: Include "freebsd.h".
12225 (Target_i386): Derive from Target_freebsd rather than
12227 (Target_selector_i386): Derive from Target_selector_freebsd rather
12228 than Target_selector.
12229 * x86_64.cc: Include "freebsd.h".
12230 (Target_x86_64): Derive from Target_freebsd rather than
12232 (Target_selector_x86_64): Derive from Target_selector_freebsd
12233 rather than Target_selector.
12234 * target.h (class Target): Add adjust_elf_header and
12235 do_adjust_elf_header.
12236 * output.cc (Output_file_header:: do_sized_write): Call target
12237 adjust_elf_header routine.
12238 * configure.tgt: Set targ_osabi.
12239 * configure.ac: Define GOLD_DEFAULT_OSABI.
12240 * parameters.cc (Parameters::default_target): Pass
12241 GOLD_DEFAULT_OSABI to select_target.
12242 * target-select.h (class Target_selector): Make instantiate_target
12243 protected rather than private.
12244 * Makefile.am (HFILES): Add freebsd.h.
12245 * configure, Makefile.in, config.in: Rebuild.
12247 * merge.cc (do_add_input_section): Correct pend value. Change
12248 message about last entry not being null terminated from error to
12251 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
12253 * incremental.cc: New file.
12254 * Makefile.am (CCFILES): Add incremental.cc.
12255 * Makefile.in: Rebuild.
12257 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
12259 * layout.cc (Layout::output_section_name): Preserve names
12260 of '.note.' sections.
12262 2009-03-19 Ian Lance Taylor <iant@google.com>
12264 * descriptors.cc (Descriptors::open): Check that the options are
12265 valid before using them.
12267 2009-03-18 Ian Lance Taylor <iant@google.com>
12269 * script-sections.h: Include <list>.
12270 (class Script_sections): Change Sections_elements from std::vector
12271 to std::list. Typedef public Elements_iterator. Add
12272 orphan_section_placement_, data_segment_align_start_, and
12273 saw_data_segment_align_ fields. Remove data_segment_align_index_
12275 * script-sections.cc (class Orphan_section_placement): New class.
12276 (class Sections_element): Add virtual functions is_relro and
12277 orphan_section_init. Remove virtual function place_orphan_here.
12278 (class Output_section_definition): Add is_relro and
12279 orphan_section_init. Remove place_orphan_here.
12280 (class Orphan_output_section): Likewise.
12281 (Script_sections::Script_sections): Update for field changes.
12282 (Script_sections::data_segment_align): Set saw_data_segment_align_
12283 and data_segment_align_start_, not data_segment_align_index.
12284 (Script_sections::data_segment_relro_end): Check
12285 saw_data_segment_align_. Use data_segment_align_start_ rather
12286 than data_segment_align_index_.
12287 (Script_sections::place_orphan): Rewrite to use
12288 Orphan_section_placement.
12290 2009-03-17 Ian Lance Taylor <iant@google.com>
12292 * archive.cc (Archive::add_symbols): Check for a version attached
12293 to the symbol name in the archive map.
12294 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
12295 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
12296 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
12297 (ver_test_11.a): New target.
12298 * testsuite/Makefile.in: Rebuild.
12300 * configure.ac: Check for chsize and posix_fallocate. Replace
12302 * ftruncate.c: New file, from gnulib.
12303 * output.cc (posix_fallocate): Define dummy version if not
12304 HAVE_POSIX_FALLOCATE.
12305 (Output_file::map): Call posix_fallocate rather than lseek and
12307 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
12308 * configure, Makefile.in, config.in: Rebuild.
12310 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
12312 * layout.h (Layout::create_note): Add section_name parameter.
12313 * layout.cc (Layout::create_note): Likewise.
12314 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
12316 2009-03-17 Ian Lance Taylor <iant@google.com>
12318 * descriptors.cc: Include "options.h".
12319 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
12320 (Descriptors::open): Always use O_CLOEXEC when opening a new
12321 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
12322 then set FD_CLOEXEC.
12324 * sparc.cc (class Target_sparc): Add has_got_section.
12325 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
12326 make sure we have a GOT section.
12328 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
12329 (Target_sparc::Scan::local): Likewise.
12330 (Target_sparc::Scan::global): Likewise.
12331 (Target_sparc::Relocate::relocate): Likewise.
12332 (Target_sparc::Relocate::relocate_tls): Likewise.
12334 * symtab.cc (Symbol_table::define_default_version): New function,
12335 broken out of add_from_object.
12336 (Symbol_table::add_from_object): Call define_default_version.
12337 (Symbol_table::define_special_symbol): Add resolve_oldsym
12338 parameter. Change all callers. If the version for a symbol comes
12339 from a version script, resolve it with the symbol with the same
12340 name with no version. Also add the symbol without a version if
12342 (do_define_in_output_data): If resolving with oldsym, don't delete
12344 (do_define_in_output_segment): Likewise.
12345 (do_define_as_constant): Likewise.
12346 * symtab.h (class Symbol_table): Update declarations.
12348 2009-03-13 Ian Lance Taylor <iant@google.com>
12350 * readsyms.cc (Read_symbols::incompatible_warning): New function.
12351 (Read_symbols::requeue): New function.
12352 (Read_symbols::do_read_symbols): If make_elf_object fails because
12353 the target type is not configured, and the file was searched for,
12354 issue a warning and retry with the next directory.
12355 (Add_symbols::run): If the file has an incompatible format, and
12356 it was searched for, requeue the Read_symbols task. On error,
12357 release the object.
12358 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
12359 dirindex parameter to constructor. Change all callers. Declare
12360 incompatible_warning and requeue.
12361 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
12362 input_argument_ and input_group_ fields. Add them to
12363 constructor. Change all callers.
12364 (class Read_script): Add dirindex_ field. Add it to constructor.
12365 Change all callers.
12366 * archive.cc (Archive::setup): Remove input_objects parameter.
12367 Change all callers.
12368 (Archive::get_file_and_offset): Likewise.
12369 (Archive::read_all_symbols): Likewise.
12370 (Archive::read_symbols): Likewise.
12371 (Archive::get_elf_object_for_member): Remove input_objects
12372 parameter. Add punconfigured parameter. Change all callers.
12373 (Archive::add_symbols): Change return type to bool. Check return
12374 value of include_member.
12375 (Archive::include_all_members): Likewise.
12376 (Archive::include_member): Change return type to bool. Return
12377 false if first included object has incompatible target. Set
12378 included_member_ field.
12379 (Add_archive_symbols::run): If add_symbols returns false, requeue
12381 * archive.h (class Archive): Add included_member_ field.
12382 Initialize it in constructor. Add input_file and searched_for
12383 methods. Update declarations.
12384 (class Add_archive_symbols): Add dirpath_, dirindex_, and
12385 input_argument_ fields. Add them to constructor. Change all
12387 * script.cc: Include "target-select.h".
12388 (class Parser_closure): Add skip_on_incompatible_target_ and
12389 found_incompatible_target_ fields. Add
12390 skip_on_incompatible_target parameter to constructor. Change all
12391 callers. Add methods skip_on_incompatible_target,
12392 clear_skip_on_incompatible_target, found_incompatible_target, and
12393 set_found_incompatible_target.
12394 (read_input_script): Add dirindex parameter. Change all callers.
12395 If parser finds an incompatible target, requeue Read_symbols
12397 (script_set_symbol): Clear skip_on_incompatible_target in
12399 (script_add_assertion, script_parse_option): Likewise.
12400 (script_start_sections, script_add_phdr): Likewise.
12401 (script_check_output_format): New function.
12402 * script.h (read_input_script): Update declaration.
12403 * script-c.h (script_check_output_format): Declare.
12404 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
12405 (ignore_cmd): Remove OUTPUT_FORMAT.
12406 * fileread.cc (Input_file::Input_file): Add explicit this.
12407 (Input_file::will_search_for): New function.
12408 (Input_file::open): Add pindex parameter. Change all callers.
12409 * fileread.h (class Input_file): Add input_file_argument method.
12410 Declare will_search_for. Update declarations.
12411 * object.cc (make_elf_object): Add punconfigured parameter.
12412 Change all callers.
12413 * object.h (class Object): Make input_file public. Add
12414 searched_for method.
12415 (make_elf_object): Update declaration.
12416 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
12418 * dirsearch.h (class Dirsearch): Update declaration.
12419 * options.h (class General_options): Add --warn-search-mismatch.
12420 * parameters.cc (Parameters::is_compatible_target): New function.
12421 * parameters.h (class Parameters): Declare is_compatible_target.
12422 * workqueue.cc (Workqueue::add_blocker): New function.
12423 * workqueue.h (class Workqueue): Declare add_blocker.
12425 * fileread.cc (Input_file::open): Remove options parameter.
12426 Change all callers.
12427 (Input_file::open_binary): Likewise.
12428 * script.cc (read_input_script): Likewise.
12429 * readsyms.h (class Read_symbols): Remove options_ field. Remove
12430 options parameter from constructor. Change all callers.
12431 (class Read_script): Likewise.
12432 * fileread.h (class Input_file): Update declarations.
12433 * script.h (read_input_script): Update declaration.
12435 2009-03-10 Nick Clifton <nickc@redhat.com>
12437 * po/es.po: New Spanish translation.
12439 2009-03-06 Cary Coutant <ccoutant@google.com>
12441 * options.cc (parse_short_option): Keep dash_z from registering itself.
12443 2009-03-03 Ian Lance Taylor <iant@google.com>
12446 * target-reloc.h (relocate_section): Pass output_section to
12448 * i386.cc (Target_i386::should_apply_static_reloc): Add
12449 output_section parameter. Change all callers.
12450 (Target_i386::Relocate::relocate): Add output_section parameter.
12451 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12452 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
12453 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
12454 * testsuite/two_file_shared.sh: New script.
12455 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
12456 (check_DATA): Add two_file_shared.dbg.
12457 (two_file_shared.dbg): New target.
12458 * testsuite/Makefile.in: Rebuild.
12460 2009-03-01 Ian Lance Taylor <iant@google.com>
12462 * configure.ac: Check for byteswap.h.
12463 * configure: Rebuild.
12464 * config.in: Rebuild.
12466 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
12468 * layout.cc (Layout::find_or_add_kept_section): New function.
12469 (Layout::add_comdat): Removed.
12470 * layout.h (struct Kept_section): Move out of class Layout.
12471 Remove trailing underscores from field names. Add group_sections
12472 field. Rename group_ field to is_group. Change all uses.
12473 (class Layout): Declare find_or_add_kept_section, not add_comdat.
12474 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
12475 comdat_groups_ field.
12476 (Sized_relobj::include_section_group): Use
12477 find_or_add_kept_section and Kept_section::group_sections.
12478 (Sized_relobj::include_linkonce_section): Likewise.
12479 * object.cc (class Sized_relobj): Don't define Comdat_group or
12480 Comdat_group_table. Remove find_comdat_group and
12481 add_comdat_group. Remove comdat_groups_ field.
12482 * plugin.cc (include_comdat_group): Use
12483 Layout::find_or_add_kept_section.
12485 2009-02-28 Ian Lance Taylor <iant@google.com>
12487 * README: --gc-sections and map files are now supported. Document
12488 some build requirements.
12491 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
12492 relocatable link set the value of the section symbol to zero.
12493 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
12494 relocatable link don't include the section address in the local
12497 2009-02-27 Ian Lance Taylor <iant@google.com>
12500 * options.h (class Search_directory): Add is_system_directory.
12501 (class General_options): Declare is_in_system_directory.
12502 * options.cc (get_relative_sysroot): Make static.
12503 (get_default_sysroot): Make static.
12504 (General_optoins::is_in_system_directory): New function.
12505 * fileread.cc (Input_file::is_in_system_directory): New function.
12506 * fileread.h (class Input_file): Declare is_in_system_directory.
12507 * object.h (class Object): Add is_in_system_directory.
12508 (class Input_objects): Remove system_library_directory_ field.
12509 * object.cc (Input_objects::add_object): Don't set
12510 system_library_directory_.
12511 (input_objects::found_in_system_library_directory): Remove.
12512 * symtab.cc (Symbol_table::write_globals): Remove input_objects
12513 parameter. Change all callers.
12514 (Symbol_table::sized_write_globals): Likewise.
12515 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
12516 Call Object::is_in_system_directory.
12517 * symtab.h (class Symbol_table): Update declarations.
12520 * descriptors.h (Open_descriptor): Add is_on_stack field.
12521 * descriptors.cc (Descriptors::open): If the descriptor is on the
12522 top of the stack, remove it. Initialize is_on_stack field.
12523 (Descriptors::release): Only add pod to stack if it is not on the
12525 (Descriptors::close_some_descriptor): Clear stack_next and
12526 is_on_stack fields.
12529 * output.cc (Output_section::find_starting_output_address): Rename
12530 from starting_output_address; add PADDR parameter; change return
12532 * output.h (class Output_section): Declare
12533 find_starting_output_address instead of starting_output_address.
12534 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
12535 section symbol for which we can't find a merge section.
12538 * symtab.cc (Symbol_table::add_from_object): If the visibility is
12539 hidden or internal, force the symbol to be local.
12540 * resolve.cc (Symbol::override_visibility): Define.
12541 (Symbol::override_base): Use override_visibility.
12542 (Symbol_table::resolve): Likewise.
12543 (Symbol::override_base_with_special): Likewise.
12544 (Symbol_table::override_with_special): If the visibility is hidden
12545 or internal, force the symbol to be local.
12546 * symtab.h (class Symbol): Add set_visibility and
12547 override_visibility.
12548 * testsuite/ver_test_1.sh: New file.
12549 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
12550 (check_DATA): Add ver_test_1.syms.
12551 (ver_test_1.syms): New target.
12552 * testsuite/Makefile.in: Rebuild.
12554 2009-02-25 Cary Coutant <ccoutant@google.com>
12556 * layout.cc (Layout::choose_output_section): Don't rename sections
12557 when using a linker script that has a SECTIONS clause.
12558 * Makefile.in: Regenerate.
12560 * testsuite/Makefile.am (script_test_5.sh): New test case.
12561 * testsuite/Makefile.in: Regenerate.
12562 * testsuite/script_test_5.cc: New file.
12563 * testsuite/script_test_5.sh: New file.
12564 * testsuite/script_test_5.t: New file.
12566 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
12568 * archive.cc (Archive::include_member): Update calls to add_symbols.
12569 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
12570 the Layout argument.
12571 * dynobj.h (do_add_symbols): Add the Layout argument.
12572 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
12574 * object.h (Object::add_symbols): Add the Layout argument.
12575 (Object::do_add_symbols): Add the Layout argument.
12576 (Sized_relobj::do_add_symbols): Add the Layout argument.
12577 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
12578 Unify the two versions.
12579 (Add_plugin_symbols): Remove.
12580 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
12581 (Sized_pluginobj::do_add_symbols): Unify the two versions.
12582 (Add_plugin_symbols): Remove.
12583 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
12584 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
12585 (Add_symbols::run): Make it work with Pulginobj.
12587 2009-02-06 Ian Lance Taylor <iant@google.com>
12589 * object.cc (Sized_relobj::do_layout): Make info message start
12590 with lower case letter.
12592 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
12594 * binary.cc: Fix file comment.
12596 * options.h (enum Incremental_disposition): Define.
12597 (class General_options): Add new options: --incremental,
12598 --incremental_changed, --incremental_unchanged,
12599 --incremental_unknown. Add incremental_disposition_ and
12600 implicit_incremental_ fields.
12601 (General_options::incremental_disposition): New function.
12602 (class Position_dependent_options): Add incremental_disposition
12604 (Position_dependent_options::copy_from_options): Set incremental
12606 * options.cc (General_options::parse_incremental_changed): New
12608 (General_options::parse_incremental_unchanged): New function.
12609 (General_options::parse_incremental_unknown): New function.
12610 (General_options::General_options): Initialize new fields
12611 incremental_disposition_ and implicit_incremental_.
12612 (General_options::finalize): Check for uasge of --incremental-*
12613 without --incremental.
12615 2009-02-06 Chris Demetriou <cgd@google.com>
12617 * gold.h (gold_undefined_symbol): Change to take only a Symbol
12618 pointer and to report location as the file name associated with
12620 (gold_undefined_symbol_at_location): New function to replace the
12621 old gold_undefined_symbol functionality.
12622 * target-reloc.h (relocate_section): Update to use
12623 gold_undefined_symbol_at_location.
12624 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12625 Call gold_undefined_symbol function rather than gold_error.
12626 * errors.h (Errors::undefined_symbol): Take location as a
12627 string, rather than calculating it from a relocation.
12628 * errors.cc (Errors::fatal): Print "fatal error:" before the
12630 (Errors::error, Errors::error_at_location): Print "error: "
12631 before the formatted message.
12632 (Errors::undefined_symbol): Take location as a string, rather
12633 than calculating it from a relocation.
12634 (gold_undefined_symbol_at_location): New function akin to
12635 old gold_undefined_symbol, calculates location from relocation.
12636 (gold_undefined_symbol): Change to take only a Symbol pointer
12637 and to report location as the file name associated with the symbol.
12638 * testsuite/debug_msg.sh: Update for changed error messages.
12639 * testsuite/undef_symbol.sh: Likewise.
12641 2009-02-04 Duncan Sands <baldrick@free.fr>
12644 * reduced_debug_output.h
12645 (Output_reduced_debug_abbrev_section::failed): Use format for
12647 (Output_reduced_debug_info_section::faild): Likewise.
12649 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
12651 * script.cc (Lazy_demangler): New class.
12652 (Version_script_info::get_symbol_version_helper): Demangle a
12655 2009-01-29 Cary Coutant <ccoutant@google.com>
12657 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
12659 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12661 2009-01-28 Ian Lance Taylor <iant@google.com>
12663 * version.cc (version_string): Bump to 1.9.
12665 * gold.h: Include <cstring> and <stdint.h>.
12666 * version.cc: Include <cstdio>.
12667 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
12669 * reduced_debug_output.cc (insert_into_vector): Rename from
12670 Insert_into_vector; change all callers. Use Swap_unaligned to
12671 avoid aliasing issue; remove union since it is unnecessary.
12673 2009-01-27 Sriraman Tallam <tmsriram@google.com>
12675 * Makefile.am (CCFILES): Add gc.cc.
12676 (HFILES): Add gc.h.
12677 * Makefile.in: Regenerate.
12678 * gold.cc (Gc_runner): New class.
12679 (queue_initial_tasks): Call garbage collection related tasks
12680 when corresponding options are invoked.
12681 (queue_middle_gc_tasks): New function.
12682 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
12683 processed early before laying out sections during garbage collection.
12684 * gold.h (queue_middle_gc_tasks): New function.
12685 (is_prefix_of): Move from "layout.cc".
12686 * i386.cc (Target_i386::gc_process_relocs): New function.
12687 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
12688 * main.cc (main): Create object of class "Garbage_collection".
12689 * object.cc (Relobj::copy_symbols_data): New function.
12690 (Relobj::is_section_name_included): New function.
12691 (Sized_relobj::do_layout): Allow this function to be called twice
12692 during garbage collection and defer layout of section during the
12694 * object.h (Relobj::get_symbols_data): New function.
12695 (Relobj::is_section_name_included): New function.
12696 (Relobj::copy_symbols_data): New function.
12697 (Relobj::set_symbols_data): New function.
12698 (Relobj::get_relocs_data): New function.
12699 (Relobj::set_relocs_data): New function.
12700 (Relobj::is_output_section_offset_invalid): New pure virtual function.
12701 (Relobj::gc_process_relocs): New function.
12702 (Relobj::do_gc_process_relocs): New pure virtual function.
12703 (Relobj::sd_): New data member.
12704 (Sized_relobj::is_output_section_offset_invalid): New function.
12705 (Sized_relobj::do_gc_process_relocs): New function.
12706 * options.h (General_options::gc_sections): Modify to not be a no-op.
12707 (General_options::print_gc_sections): New option.
12708 * plugin.cc (Plugin_finish::run): Remove function call to
12709 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
12710 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
12711 * reloc.cc (Read_relocs::run): Add task to process relocs and
12712 determine unreferenced sections when doing garbage collection.
12713 (Gc_process_relocs): New class.
12714 (Sized_relobj::do_gc_process_relocs): New function.
12715 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
12716 sections that are garbage collected.
12717 * reloc.h (Gc_process_relocs): New class.
12718 * sparc.cc (Target_sparc::gc_process_relocs): New function.
12719 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
12720 symbols whose corresponding sections are garbage collected.
12721 (Symbol_table::Symbol_table): Add new parameter for the garbage
12723 (Symbol_table::gc_mark_undef_symbols): New function.
12724 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12725 (Symbol_table::gc_mark_dyn_syms): New function.
12726 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
12728 (Symbol_table::add_from_object): Likewise.
12729 (Symbol_table::add_from_relobj): When building shared objects, do not
12730 treat externally visible symbols as garbage.
12731 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
12732 table information for static and relocatable links.
12733 * symtab.h (Symbol_table::set_gc): New function.
12734 (Symbol_table::gc): New function.
12735 (Symbol_table::gc_mark_undef_symbols): New function.
12736 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12737 (Symbol_table::gc_mark_dyn_syms): New function.
12738 (Symbol_table::gc_): New data member.
12739 * target.h (Sized_target::gc_process_relocs): New pure virtual
12741 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
12742 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
12744 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
12746 * options.h (General_options::gc_sections): Define as a no-op for now.
12747 (General_options::no_keep_memory): Ditto.
12748 (General_options::Bshareable): Define.
12749 * options.cc (General_options::finalize): Honor -Bshareable.
12751 2009-01-20 Andreas Schwab <schwab@suse.de>
12753 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
12754 read the value in the contents, since we don't use it. Use the
12755 template endianness when writing.
12756 (Relocate::relocate): Use it for R_PPC_REL16_HA.
12758 2009-01-19 Andreas Schwab <schwab@suse.de>
12760 * configure.tgt (powerpc64-*): Fix targ_obj.
12762 2009-01-15 Ian Lance Taylor <iant@google.com>
12764 * object.cc (Sized_relobj::write_local_symbols): Don't write out
12765 local symbols when stripping all symbols.
12767 2009-01-14 Cary Coutant <ccoutant@google.com>
12769 * output.cc (Output_reloc): Add explicit instantiations.
12771 2009-01-14 Cary Coutant <ccoutant@google.com>
12773 * archive.cc (Archive::get_elf_object_for_member): Remove call
12774 to File_read::claim_for_plugin.
12775 * descriptors.cc (Descriptors::open): Remove reference to
12777 (Descriptors::claim_for_plugin): Remove.
12778 * descriptors.h (Descriptors::claim_for_plugin): Remove.
12779 (Descriptors::is_claimed): Remove.
12780 (claim_descriptor_for_plugin): Remove.
12781 * fileread.cc (File_read::claim_for_plugin): Remove.
12782 * fileread.h (File_read::claim_for_plugin): Remove.
12783 (File_read::descriptor): Reopen descriptor if necessary.
12784 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
12785 (Plugin_manager::all_symbols_read): Add task parameter. Change
12787 (Plugin_manager::get_input_file): New function.
12788 (Plugin_manager::release_input_file): New function.
12789 (Pluginobj::Pluginobj): Add filesize parameter and initialize
12790 corresponding data member.
12791 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
12792 and pass to base constructor. Change all callers.
12793 (get_input_file, release_input_file): New functions.
12794 (make_sized_plugin_object): Add filesize parameter. Change all callers.
12795 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
12796 (Plugin_manager::all_symbols_read): Add task parameter.
12797 (Plugin_manager::get_input_file): New function.
12798 (Plugin_manager::release_input_file): New function.
12799 (Plugin_manager::task_): New data member.
12800 (Pluginobj::Pluginobj): Add filesize parameter.
12801 (Pluginobj::filename): New function.
12802 (Pluginobj::descriptor): New function.
12803 (Pluginobj::filesize): New function.
12804 (Pluginobj::filesize_): New data member.
12805 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
12806 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
12807 File_read::claim_for_plugin; use Object::unlock to unlock the file.
12809 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
12810 with archive libraries.
12811 * testsuite/Makefile.in: Regenerate.
12812 * testsuite/plugin_test.c (struct sym_info): New type.
12813 (get_input_file, release_input_file): New static variables.
12814 (onload): Capture new transfer vector entries.
12815 (claim_file_hook): Stop reading at end of file according to filesize.
12816 Factor out parsing of readelf output into separate function.
12817 (all_symbols_read_hook): Exercise get_input_file and release_input_file
12818 APIs and get the source file name from the symbol table. Convert
12819 source file name to corresponding object file name. Print info
12820 message when adding new input files.
12821 (parse_readelf_line): New function.
12822 * testsuite/plugin_test_1.sh: Add checks for new info messages.
12823 * testsuite/plugin_test_2.sh: Likewise.
12824 * testsuite/plugin_test_3.sh: Likewise.
12825 * testsuite/plugin_test_4.sh: New test case.
12827 2009-01-07 Ian Lance Taylor <iant@google.com>
12829 * version.cc (version_string): Bump to 1.8.
12831 2008-12-23 Cary Coutant <ccoutant@google.com>
12833 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
12834 * plugin.cc (Plugin_manager::finish): Rename as
12835 layout_deferred_objects. Move cleanup to separate function.
12836 (Plugin_manager::cleanup): New function.
12837 (Plugin_finish::run): Call layout_deferred_objects and cleanup
12839 * plugin.h (Plugin_manager::finish): Rename as
12840 layout_deferred_objects.
12841 (Plugin_manager::cleanup): New function.
12842 (Plugin_manager::cleanup_done): New field.
12844 2008-12-23 Cary Coutant <ccoutant@google.com>
12846 * plugin.cc (is_visible_from_outside): New function.
12847 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
12848 so we don't return "IR only" status for exported symbols or -r links.
12850 * testsuite/Makefile.am (plugin_test_3): New test case.
12851 * testsuite/Makefile.in: Regenerate.
12852 * testsuite/plugin_test_3.sh: New file.
12854 2008-12-22 Cary Coutant <ccoutant@google.com>
12856 * object.cc (Sized_relobj::layout_section): New function.
12857 (Sized_relobj::do_layout): Defer layout of input sections until after
12858 plugin has provided replacement files.
12859 (Sized_relobj::do_layout_deferred_sections): New function.
12860 * object.h (Relobj::set_section_offset): Remove virtual keyword.
12861 (Relobj::layout_deferred_sections): New function.
12862 (Relobj::do_layout_deferred_sections): New function.
12863 (Sized_relobj::do_layout_deferred_sections): New function.
12864 (Sized_relobj::layout_section): New function.
12865 (Sized_relobj::Deferred_layout): New structure.
12866 (Sized_relobj::deferred_layout_): New field.
12867 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
12868 Change all callers. Layout deferred sections.
12869 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
12871 (Plugin_hook::run): Move code from do_plugin_hook inline.
12872 (Plugin_hook::do_plugin_hook): Remove.
12873 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
12874 (Plugin_manager::finish): Renamed, was cleanup.
12875 (Plugin_manager::should_defer_layout): New function.
12876 (Plugin_manager::add_deferred_layout_object): New function.
12877 (Plugin_manager::Deferred_layout_list): New type.
12878 (Plugin_manager::deferred_layout_objects_): New field.
12879 (Plugin_hook::do_plugin_hook): Remove.
12881 2008-12-17 Ian Lance Taylor <iant@google.com>
12883 * options.h (class General_options): Add --no case for
12886 2008-12-16 Cary Coutant <ccoutant@google.com>
12888 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
12890 (Plugin_manager::claim_file): Create plugin object even if
12891 plugin did not call the add_symbols callback.
12892 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
12893 asking for more symbols than were added.
12894 * testsuite/Makefile.am (plugin_test_1): Add test case with
12896 (empty.syms): New target.
12897 * testsuite/Makefile.in: Regenerate.
12898 * testsuite/plugin_test.c (claim_file_hook): Add new debug
12899 message. Don't call add_symbols if no globals.
12900 (all_symbols_read_hook): Don't provide replacement for empty
12903 2008-12-12 Ian Lance Taylor <iant@google.com>
12905 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
12906 r_type == 0 for a local symbol with r_sym == 0.
12907 (scan_relocatable_relocs): Pass r_sym to
12908 local_non_section_strategy.
12909 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
12912 * configure.ac: Update test for TLS descriptors: they are
12913 supported as of glibc 2.9.
12914 * configure: Rebuild.
12916 2008-12-11 Ian Lance Taylor <iant@google.com>
12919 * target-reloc.h (Default_scan_relocatable_relocs): For each
12920 function, map r_type == 0 to RELOC_DISCARD.
12922 2008-12-10 Cary Coutant <ccoutant@google.com>
12924 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
12925 object to override a kept COMDAT group from a plugin object.
12927 2008-12-09 Ian Lance Taylor <iant@google.com>
12930 * yyscript.y (file_cmd): Handle INPUT.
12932 * testsuite/initpri1.c: Change all declarations to be full
12933 prototypes by adding void, to avoid compiler warnings.
12935 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
12937 * options.cc (General_options::parse_plugin_opt): New.
12938 (General_options::add_plugin): The argument now is just the filename.
12939 (General_options::add_plugin_option): New.
12940 * options.h (plugin_opt): New.
12941 (add_plugin): Change argument name.
12942 (add_plugin_option): New.
12943 * plugin.cc (Plugin::load): Don't parse the plugin option.
12944 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
12945 (Plugin::add_option): New.
12946 (Plugin::args_): Change type.
12947 (Plugin::filename_): New.
12948 (Plugin_manager::add_plugin_option): New.
12949 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
12950 * testsuite/Makefile.in: Regenerate.
12952 2008-12-05 Cary Coutant <ccoutant@google.com>
12954 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
12955 Handle --strip-lto-sections option.
12956 * options.h (strip_lto_sections): New option.
12958 2008-12-01 Cary Coutant <ccoutant@google.com>
12960 * plugin.cc (ld_plugin_message): Change format parameter to const.
12961 Fix mismatch between new[] and delete.
12963 2008-11-14 Cary Coutant <ccoutant@google.com>
12965 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
12968 2008-11-05 Craig Silverstein <csilvers@google.com>
12970 * options.cc (General_options::parse_dynamic_list): New function.
12971 * options.h (General_options): New flags dynamic_list,
12972 dynamic_list_data, dynamic_list_cpp_new, and
12973 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
12974 (General_options::in_dynamic_list): New function.
12975 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
12976 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
12977 (Lex::can_continue_name): Likewise.
12979 (read_script_file): New parameter script_options.
12980 (read_dynamic_list): New function.
12981 (Script_options::define_dynamic_list): New function.
12982 (dynamic_list_keyword_parsecodes): New variable.
12983 (dynamic_list_keywords): New variable.
12984 * script.h (Script_options::define_dynamic_list): New function
12986 (read_dynamic_list): New function prototype.
12987 * symtab.cc (strprefix): New macro.
12988 (Symbol::should_add_dynsym_entry): Support dynamic_list,
12989 dynamic_list_data, dynamic_list_cpp_new, and
12990 dynamic_list_cpp_typeinfo.
12991 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
12992 (dynamic_list_expr): New rule.
12993 (dynamic_list_nodes): Likewise.
12994 (dynamic_list_node): Likewise.
12995 * testsuite/Makefile.am (dynamic_list): New test.
12996 * testsuite/Makefile.in: Regenerated.
12997 * testsuite/dynamic_list.t: New file.
12998 * testsuite/dynamic_list.sh: New file.
13000 2008-11-05 Craig Silverstein <csilvers@google.com>
13002 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
13003 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
13004 (t11_last): Likewise.
13005 * testsuite/ver_test_6.c (main): Likewise.
13007 2008-10-07 Cary Coutant <ccoutant@google.com>
13009 * options.c (General_options::finalize): Add check for -static and
13011 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
13014 2008-10-02 Cary Coutant <ccoutant@google.com>
13016 * plugin.cc (make_sized_plugin_object): Fix conditional
13017 compilation to work when not all targets are enabled.
13019 2008-09-29 Cary Coutant <ccoutant@google.com>
13021 * archive.cc (Archive::get_file_and_offset): Use filename instead
13022 of name to get library path.
13023 (Archive::include_member): Unlock external member of a thin archive.
13025 * testsuite/Makefile.am (TEST_AR): New variable.
13026 (thin_archive_test_1): New test.
13027 (thin_archive_test_2): New test.
13028 * testsuite/Makefile.in: Regenerate.
13029 * testsuite/thin_archive_main.cc: New file.
13030 * testsuite/thin_archive_test_1.cc: New file.
13031 * testsuite/thin_archive_test_2.cc: New file.
13032 * testsuite/thin_archive_test_3.cc: New file.
13033 * testsuite/thin_archive_test_4.cc: New file.
13035 2008-09-29 Cary Coutant <ccoutant@google.com>
13037 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
13038 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
13040 (Sized_relobj::do_finalize_local_symbols): Likewise.
13041 (Sized_relobj::map_to_kept_section): Likewise.
13042 * object.h (Sized_relobj::invalid_address): New constant.
13043 (Sized_relobj::do_output_section_offset): Check for invalid_address
13045 * output.cc (Output_reloc::local_section_offset): Use constant
13046 invalid_address instead of -1U.
13047 (Output_reloc::get_address): Likewise.
13048 (Output_section::output_address): Change -1U to -1ULL.
13049 * output.h (Output_reloc::invalid_address): New constant.
13050 * reloc.cc (Sized_relobj::write_sections): Use constant
13051 invalid_address instead of -1U.
13052 (Sized_relobj::relocate_sections): Likewise.
13053 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
13054 values for merge sections.
13055 * target-reloc.h (relocate_for_relocatable): Use constant
13056 invalid_address instead of -1U.
13058 2008-09-19 Cary Coutant <ccoutant@google.com>
13060 Add plugin functionality for link-time optimization (LTO).
13061 * configure.ac (plugins): Add --enable-plugins option.
13062 * configure: Regenerate.
13063 * config.in: Regenerate.
13064 * Makefile.am (LIBDL): New variable.
13065 (CCFILES): Add plugin.cc.
13066 (HFILES): Add plugin.h.
13067 (ldadd_var): Add LIBDL.
13068 * Makefile.in: Regenerate.
13070 * archive.cc: Include "plugin.h".
13071 (Archive::setup): Don't preread archive symbols when using a plugin.
13072 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
13073 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
13075 (Archive::include_member): Add symbols from plugin objects.
13076 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
13077 * descriptors.cc (Descriptors::open): Check for file descriptors
13078 abandoned by plugins.
13079 (Descriptors::claim_for_plugin): New function.
13080 * descriptors.h (Descriptors::claim_for_plugin): New function.
13081 (Open_descriptor::is_claimed): New field.
13082 (claim_descriptor_for_plugin): New function.
13083 * fileread.cc (File_read::claim_for_plugin): New function.
13084 * fileread.h (File_read::claim_for_plugin): New function.
13085 (File_read::descriptor): New function.
13086 * gold.cc: Include "plugin.h".
13087 (queue_initial_tasks): Add task to call plugin hooks for generating
13089 * main.cc: Include "plugin.h".
13090 (main): Load plugin libraries.
13091 * object.h (Pluginobj): Declare.
13092 (Object::pluginobj): New function.
13093 (Object::do_pluginobj): New function.
13094 (Object::set_target): New function.
13095 * options.cc: Include "plugin.h".
13096 (General_options::parse_plugin): New function.
13097 (General_options::General_options): Initialize plugins_ field.
13098 (General_options::add_plugin): New function.
13099 * options.h (Plugin_manager): Declare.
13100 (General_options): Add --plugin option.
13101 (General_options::has_plugins): New function.
13102 (General_options::plugins): New function.
13103 (General_options::add_plugin): New function.
13104 (General_options::plugins_): New field.
13105 * plugin.cc: New file.
13106 * plugin.h: New file.
13107 * readsyms.cc: Include "plugin.h".
13108 (Read_symbols::do_read_symbols): Check for archive before checking
13109 for ELF file. Call plugin hooks to claim files.
13110 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
13111 from a real object file; force override when processing replacement
13113 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
13114 (Symbol::init_base_object): Likewise.
13115 (Symbol::init_base_output_data): Likewise.
13116 (Symbol::init_base_output_segment): Likewise.
13117 (Symbol::init_base_constant): Likewise.
13118 (Symbol::init_base_undefined): Likewise.
13119 (Symbol::output_section): Assert that object is not a plugin.
13120 (Symbol_table::add_from_pluginobj): New function.
13121 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
13123 (Symbol_table::sized_write_globals): Likewise.
13124 (Symbol_table::add_from_pluginobj): Instantiate template.
13125 * symtab.h (Sized_pluginobj): Declare.
13126 (Symbol::in_real_elf): New function.
13127 (Symbol::set_in_real_elf): New function.
13128 (Symbol::in_real_elf_): New field.
13129 (Symbol_table::add_from_pluginobj): New function.
13131 * testsuite/Makefile.am (AM_CFLAGS): New variable.
13132 (LIBDL): New variable.
13133 (LDADD): Add LIBDL.
13134 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
13135 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
13136 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
13137 (MOSTLYCLEANFILES): Likewise.
13138 * testsuite/Makefile.in: Regenerate.
13139 * testsuite/plugin_test.c: New file.
13140 * testsuite/plugin_test_1.sh: New file.
13141 * testsuite/plugin_test_2.sh: New file.
13143 2008-09-16 Ian Lance Taylor <iant@google.com>
13145 * target-reloc.h (relocate_section): Check whether a symbol is
13146 defined by the ABI before reporting an undefined symbol error.
13147 * target.h (Target::is_defined_by_abi): Make parameter const.
13148 (Target::do_is_defined_by_abi): Likewise.
13149 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
13150 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
13151 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
13152 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
13153 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
13154 * testsuite/Makefile.in: Rebuild.
13156 * fileread.cc (make_view): Add casts to avoid warning.
13158 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
13160 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
13161 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13163 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
13165 * options.h (General_options::output_is_executable): New.
13166 (General_options::output_is_pie): New.
13167 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
13168 for shared libraries.
13169 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13171 2008-09-11 Chris Demetriou <cgd@google.com>
13173 * options.h (origin): New -z option.
13174 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
13175 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
13178 2008-09-05 Cary Coutant <ccoutant@google.com>
13180 * fileread.cc (File_read::make_view): Add check for attempt to map
13181 beyond end of file.
13183 2008-09-05 Cary Coutant <ccoutant@google.com>
13185 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
13186 explicit instantiations.
13188 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
13191 * options.cc (General_options::finalize): Allow undefined symbols
13192 in shlibs if linking -shared.
13195 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
13196 symbols as not needing a dynsym entry.
13198 2008-08-20 Craig Silverstein <csilvers@google.com>
13200 * fileread.cc (File_read::open): Do not lock the file unless it
13201 was successfully opened.
13203 2008-08-14 Cary Coutant <ccoutant@google.com>
13205 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
13206 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
13207 * testsuite/tls_test.cc (struct int128): 128-bit struct
13208 for testing TLS relocs with non-zero addend.
13209 (v12): New TLS variable.
13211 (t_last): Add check for v12.
13212 * testsuite/tls_test.h (t12): New function.
13213 * testsuite/tls_test_main.cc (thread_routine): Call new test.
13215 2008-08-13 Ian Lance Taylor <iant@google.com>
13217 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
13218 set tls_segment_ or relro_segment_.
13219 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
13221 * output.h (Output_section::clear_is_relro): New function.
13222 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
13223 sections specially even when output_data_ is empty.
13224 (Output_segment::maximum_alignment): When first section is relro,
13225 only force alignment for PT_LOAD segments.
13226 * script.cc (script_data_segment_align): New function.
13227 (script_data_segment_relro_end): New function.
13228 * script-c.h (script_data_segment_align): Declare.
13229 (script_data_segment_relro_end): Declare.
13230 * script-sections.h (class Script_sections): Declare
13231 data_segment_align and data_segment_relro_end. Add fields
13232 segment_align_index_ and saw_relro_end_.
13233 * script-sections.cc (class Sections_element): Add set_is_relro
13234 virtual function. Add new bool* parameter to place_orphan_here.
13235 Add get_output_section virtual function.
13236 (class Output_section_definition): Add set_is_relro. Add new
13237 bool* parameter to place_orphan_here. Add get_output_section.
13238 Add is_relro_ field.
13239 (Output_section_definition::Output_section_definition): Initialize
13240 evaluated_address_, evaluated_load_address, evaluated_addralign_,
13241 and is_relro_ fields.
13242 (Output_section_definition::place_orphan_here): Add is_relro
13244 (Output_section_definition::set_section_addresses): Set relro for
13246 (Output_section_definition::alternate_constraint): Likewise.
13247 (class Orphan_output_section): Add new bool* parameter to
13248 place_orphan_here. Add get_output_section.
13249 (Orphan_output_section::place_orphan_here): Add is_relro
13251 (Script_sections::Script_sections): Initialize
13252 data_segment_align_index_ and saw_relro_end_.
13253 (Script_sections::data_segment_align): New function.
13254 (Script_sections::data_segment_relro_end): New function.
13255 (Script_sections::place_orphan): Set or clear is_relro.
13256 (Script_sections::set_section_addresses): Force alignment of first
13258 * yyscript.y (exp): Call script_data_segment_align and
13259 script_data_segment_relro_end.
13260 * testsuite/relro_script_test.t: New file.
13261 * testsuite/relro_test.cc (using_script): Declare.
13262 (t1, t2): Test using_script.
13263 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
13264 (relro_script_test_SOURCES): Define.
13265 (relro_script_test_DEPENDENCIES): Define.
13266 (relro_script_test_LDFLAGS): Define.
13267 (relro_script_test_LDADD): Define.
13268 (relro_script_test.so): New target.
13269 * testsuite/Makefile.in: Rebuild.
13271 2008-08-06 Cary Coutant <ccoutant@google.com>
13273 * archive.cc (Archive::total_archives, Archive::total_members)
13274 (Archive::total_members_loaded): New variables.
13275 (Archive::setup): Add parameter. Add option to preread
13277 (Archive::read_armap): Add counter.
13278 (Archive::get_file_and_offset): New function.
13279 (Archive::get_elf_object_for_member): New function.
13280 (Archive::read_all_symbols): New function.
13281 (Archive::read_symbols): New function.
13282 (Archive::add_symbols): Add counters.
13283 (Archive::include_all_members): Use armap to find members if it's
13285 (Archive::include_member): Skip reading symbols if already read.
13286 Factored code into Archive::get_file_and_offset and
13287 Archive::get_elf_object_for_member. Changed call to
13288 Mapfile::report_include_archive_member.
13289 (Archive::print_stats): New function.
13290 * archive.h: Declare Object and Read_symbols_data classes.
13291 (Archive::Archive): Add initializers for new members.
13292 (Archive::setup): Add parameter.
13293 (Archive::print_stats): New function.
13294 (Archive::total_archives, Archive::total_members)
13295 (Archive::total_members_loaded): New variables.
13296 (Archive::get_file_and_offset): New function.
13297 (Archive::get_elf_object_for_member): New function.
13298 (Archive::read_all_symbols): New function.
13299 (Archive::read_symbols): New function.
13300 (Archive::Archive_member): New class.
13301 (Archive::members_): New member.
13302 (Archive::num_members_): New member.
13303 * main.cc: Include archive.h.
13304 (main): Call Archive::print_stats.
13305 * mapfile.cc (Mapfile::report_include_archive_member): Delete
13306 archive parameter; member_name is now the fully-decorated name.
13307 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
13308 * options.h: (General_options): Add --preread-archive-symbols option.
13309 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
13312 2008-08-04 Ian Lance Taylor <iant@google.com>
13314 * symtab.h (Symbol::use_plt_offset): New function.
13315 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
13316 * powerpc.cc (Relocate::relocate): Likewise.
13317 * sparc.cc (Relocate::relocate): Likewise.
13318 * x86_64.cc (Relocate::relocate): Likewise.
13319 * testsuite/weak_plt.sh: New test.
13320 * testsuite/weak_plt_main.cc: New test.
13321 * testsuite/weak_plt_shared.cc: New test.
13322 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
13323 (check_PROGRAMS): Add weak_plt.
13324 (check_DATA): Add weak_plt_shared.so.
13325 (weak_plt_main_pic.o, weak_plt): New targets.
13326 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
13327 * testsuite/Makefile.in: Rebuild.
13329 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
13331 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
13332 * testsuite/Makefile.in: Rebuild.
13334 2008-08-04 Alan Modra <amodra@bigpond.net.au>
13336 * Makefile.am (POTFILES.in): Set LC_ALL=C.
13337 * Makefile.in: Regenerate.
13338 * po/POTFILES.in: Regenerate.
13340 2008-07-29 Ian Lance Taylor <iant@google.com>
13342 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
13343 symbols before other symbols.
13344 * testsuite/script_test_2.cc (test_addr): Declare.
13345 (test_addr_alias): Declare.
13346 (main): Check that test_addr and test_addr_alias have the right
13348 * testsuite/script_test_2.t: Define test_addr_alias and
13351 2008-07-24 Ian Lance Taylor <iant@google.com>
13354 * descriptors.cc: New file.
13355 * descriptors.h: New file.
13356 * gold-threads.h (class Hold_optional_lock): New class.
13357 * fileread.cc: Include "descriptors.h".
13358 (File_read::~File_read): Release descriptor rather than closing
13360 (File_read::open) [file]: Call open_descriptor rather than open.
13361 Set is_descriptor_opened_.
13362 (File_read::open) [memory]: Assert that descriptor is not open.
13363 (File_read::reopen_descriptor): New function.
13364 (File_read::release): Release descriptor.
13365 (File_read::do_read): Make non-const. Reopen descriptor.
13366 (File_read::read): Make non-const.
13367 (File_read::make_view): Reopen descriptor.
13368 (File_read::do_readv): Likewise.
13369 * fileread.h (class File_read): Add is_descriptor_opened_ field.
13370 Update declarations.
13371 * layout.cc: Include "descriptors.h".
13372 (Layout::create_build_id): Use open_descriptor rather than open.
13373 * output.cc: Include "descriptors.h".
13374 (Output_file::open): Use open_descriptor rather than open.
13375 * archive.cc (Archive::const_iterator): Change Archive to be
13377 (Archive::begin, Archive::end): Make non-const.
13378 (Archive::count_members): Likewise.
13379 * archive.h (class Archive): Update declarations.
13380 * object.h (Object::read): Make non-const.
13381 * Makefile.am (CCFILES): Add descriptors.cc.
13382 (HFILES): Add descriptors.h.
13383 * Makefile.in: Rebuild.
13386 * gold.h: Always include <clocale>. Add Solaris workarounds
13387 following code in binutils/sysdep.h.
13390 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
13391 this->eh_frame_hdr_ is NULL before using it.
13393 * dynobj.cc (Versions::Versions): Update comment.
13395 * dynobj.cc (Versions::Versions): If there is an soname, use it as
13396 the base version name.
13398 * stringpool.cc (Stringpool_template::add_with_length): Set key to
13399 array size plus one.
13400 (Stringpool_template::set_string_offsets): Subtract one from key
13401 before using it as an array index.
13402 (Stringpool_template::get_offset_with_length): Likewise.
13403 (Stringpool_template::write_to_buffer): Likewise.
13404 * stringpool.h (Stringpool_template::get_offset_from_key):
13407 2008-07-23 Ian Lance Taylor <iant@google.com>
13410 * object.h (Merged_symbol_value::value): Do our best to handle a
13414 * script.cc (Version_script_info::get_versions): Don't add empty
13415 version tag to return value.
13416 (Version_script_info::get_symbol_version_helper): Change return
13417 type to bool. Add pversion parameter. Change all callers.
13418 (script_register_vers_node): Don't require a non-NULL tag.
13419 * script.h (class Version_script_info): Update declarations.
13420 (Version_script_info::get_symbol_version): Change return type to
13421 bool. Add version parameter. Change all callers.
13422 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
13423 handling. Handle an empty version from a version script.
13424 (Symbol_table::define_special_symbol): Likewise.
13425 * testsuite/ver_test_10.script: New file.
13426 * testsuite/ver_test_10.sh: New file.
13427 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
13428 (check_DATA): Add ver_test_10.syms.
13429 (ver_test_10.syms, ver_test_10.so): New target.
13430 * testsuite/Makefile.in: Rebuild.
13432 2008-07-23 Simon Baldwin <simonb@google.com>
13434 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
13435 to zero for undefined symbols from dynamic libraries.
13437 2008-07-23 Ian Lance Taylor <iant@google.com>
13439 * symtab.cc (Symbol_table::resolve): Remove version parameter.
13440 Change all callers.
13441 * symtab.h (class Symbol_table): Update declaration.
13442 * testsuite/ver_test_9.cc: New file.
13443 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
13444 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
13445 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
13446 (ver_test_9.so, ver_test_9.o): New targets.
13447 * testsuite/Makefile.in: Rebuild.
13449 2008-07-22 Ian Lance Taylor <iant@google.com>
13451 * options.h (class General_options): Define --check-sections.
13452 * layout.cc (Layout::set_segment_offsets): Handle
13455 * options.h (class General_options): Define -n/--nmagic and
13457 * options.cc (General_options::finalize): For -n/--nmagic or
13458 -N/--omagic, set -static.
13459 * layout.cc (Layout::attach_allocated_section_to_segment): If
13460 -N/--omagic, don't put read-only and read-write sections in
13461 different segments.
13462 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
13463 finding a read-only segment.
13464 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
13465 don't set the minimum segment alignment to the common page size,
13466 and don't set the file offset to the address modulo the page size.
13467 * script-sections.cc (Script_sections::create_segments): If
13468 -n/--omagic, don't put read-only and read-write sections in
13469 different segments.
13471 * cref.cc: New file.
13472 * cref.h: New file.
13473 * options.h (class General_options): Add --print-symbol-counts.
13474 * main.cc (main): Issue defined symbol report if requested.
13475 * archive.cc (Archive::interpret_header): Make into a const member
13477 (Archive::add_symbols): Call Input_objects::archive_start and
13479 (Archive::const_iterator): Define new class.
13480 (Archive::begin, Archive::end): New functions.
13481 (Archive::include_all_members): Rewrite to use iterator.
13482 (Archive::count_members): New function.
13483 * archive.h (class Archive): Update declarations.
13484 (Archive::filename): New function.
13485 * object.cc: Include "cref.h".
13486 (Sized_relobj::Sized_relobj): Initialize defined_count_.
13487 (Sized_relobj::do_get_global_symbol_counts): New function.
13488 (Input_objects::add_object): Add object to cross-referencer.
13489 (Input_objects::archive_start): New function.
13490 (Input_objects::archive_stop): New function.
13491 (Input_objects::print_symbol_counts): New function.
13492 * object.h: Declare Cref and Archive.
13493 (Object::get_global_symbol_counts): New function.
13494 (Object::do_get_global_symbol_counts): New pure virtual function.
13495 (class Sized_relobj): Add defined_count_ field. Update
13497 (class Input_objects): Add cref_ field. Update constructor.
13498 Update declarations.
13499 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
13501 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
13503 (Sized_dynobj::do_get_global_symbol_counts): New function.
13504 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
13505 defined_count_. Update declarations. Define Symbols typedef.
13506 * symtab.cc (Symbol_table::add_from_relobj): Add defined
13507 parameter. Change all callers.
13508 (Symbol_table::add_from_dynobj): Add sympointers and defined
13509 parameters. Change all callers.
13510 * symtab.h (class Symbol_table): Update declarations.
13511 * Makefile.am (CCFILES): Add cref.cc.
13512 (HFILES): Add cref.h.
13513 * Makefile.in: Rebuild.
13515 2008-07-22 Simon Baldwin <simonb@google.com>
13517 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
13518 to zero when writing undefined symbols.
13520 2008-07-22 Ian Lance Taylor <iant@google.com>
13522 * output.cc (Output_section::add_input_section): Don't try to
13523 merge empty merge sections.
13525 2008-07-21 Craig Silverstein <csilvers@google.com>
13527 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13528 Include symbol version in error message.
13530 2008-07-20 Chris Demetriou <cgd@google.com>
13532 * configure.ac (gold_cv_c_random_seed): New configured variable.
13533 (RANDOM_SEED_CFLAGS): New substituted variable.
13534 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
13535 * configure: Rebuild.
13536 * Makefile.in: Likewise.
13537 * testsuite/Makefile.in: Likewise.
13539 2008-07-18 Ian Lance Taylor <iant@google.com>
13541 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
13542 where we see NAME/NULL and NAME/VERSION as separate symbols.
13543 * testsuite/ver_test_main.cc (main): Call t4.
13544 (t4, t4_2a): Define.
13545 * testsuite/ver_test_2.cc (t4_2): Define.
13546 * testsuite/ver_test_2.script: Put t4_2a in VER2.
13547 * testsuite/ver_test_4.cc (t4_2a): Define.
13548 * testsuite/ver_test_4.script: Put t4_2a in VER2.
13549 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
13551 2008-07-17 Ian Lance Taylor <iant@google.com>
13553 * dynobj.cc (Versions::add_def): If we give an error about a
13554 missing version, go ahead and create the version anyhow.
13556 2008-07-10 Ian Lance Taylor <iant@google.com>
13558 Handle output sections with more than 0x7fffffff bytes.
13559 * object.h (class Relobj): Change map_to_output_ to
13560 output_sections_, and just keep a section pointer. Change all
13561 uses. Move comdat group support to Sized_relobj.
13562 (Relobj::is_section_specially_mapped): Remove.
13563 (Relobj::output_section): Remove poff parameter. Change all
13565 (Relobj::output_section_offset): New function.
13566 (Relobj::set_section_offset): Rewrite.
13567 (Relobj::map_to_output): Remove.
13568 (Relobj::output_sections): New function.
13569 (Relobj::do_output_section_offset): New pure virtual function.
13570 (Relobj::do_set_section_offset): Likewise.
13571 (class Sized_relobj): Add section_offsets_ field. Add comdat
13572 group support from Relobj. Update declarations.
13573 (Sized_relobj::get_output_section_offset): New function.
13574 (Sized_relobj::do_output_section_offset): New function.
13575 (Sized_relobj::do_set_section_offset): New function.
13576 * object.cc (Relobj::output_section_address): Remove.
13577 (Sized_relobj::Sized_relobj): Initialize new fields.
13578 (Sized_relobj::include_section_group): Cast find_kept_object to
13580 (Sized_relobj::include_linkonce_section): Likewise.
13581 (Sized_relobj::do_layout): Use separate arrays for output section
13583 (Sized_relobj::do_count_local_symbols): Change map_to_output to
13585 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
13586 output_sections and section_offsets.
13587 (Sized_relobj::write_local_symbols): Likewise.
13588 (map_to_kept_section): Compute output address directly.
13589 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
13590 output_sections and section_offsets.
13591 (Sized_relobj::write_sections): Likewise.
13592 (Sized_relobj::relocate_sections): Likewise.
13593 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
13594 * output.h (class Output_reloc): Update declarations. Change
13595 u2_.relobj to Sized_relobj*.
13596 (class Output_data_reloc): Change add functions to use
13598 * output.cc (Output_reloc::Output_reloc): Change relobj to
13600 (Output_reloc::local_section_offset): Change return type to
13601 Elf_Addr. Use get_output_section_offset.
13602 (Output_reloc::get_address): Likewise.
13603 (Output_section::is_input_address_mapped): Don't call
13604 is_section_specially_mapped.
13605 (Output_section::output_offset): Likewise.
13606 (Output_section::output_address): Likewise.
13607 (Output_section::starting_output_address): Likewise.
13608 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
13609 parameter to Sized_relobj*.
13610 (Copy_relocs::need_copy_reloc): Likewise.
13611 (Copy_relocs::save): Likewise.
13612 * copy-relocs.h (class Copy_relocs): Update declarations.
13613 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
13614 Sized_relobj*. Change relobj_ field to Sized_relobj*.
13615 * target-reloc.h (relocate_for_relocatable): Change
13616 offset_in_output_section type to Elf_Addr. Change code that uses
13618 * layout.cc (Layout::layout): Always set *off.
13619 * mapfile.cc (Mapfile::print_input_section): Use
13620 output_section_offset.
13621 * i386.cc (Target_i386::copy_reloc): Change object parameter to
13623 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
13624 * sparc.cc (Target_sparc::copy_reloc): Likewise.
13625 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
13627 2008-07-03 Ian Lance Taylor <iant@google.com>
13629 * layout.cc (Layout::include_section): Do not discard unrecognized
13630 SHT_STRTAB sections.
13632 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
13634 * script.cc (Lex::can_continue_name): Make '?' allowable in
13635 version-script names.
13636 * testsuite/version_script.map: Change glob pattern to use '?'
13638 2008-06-30 Manish Singh <yosh@gimp.org>
13641 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
13644 2008-06-30 Ian Lance Taylor <iant@google.com>
13648 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
13649 versions]: Don't try to read the value in the contents, since we
13650 don't use it. Use the template endianness when writing.
13652 2008-06-25 Cary Coutant <ccoutant@google.com>
13654 * fileread.cc (File_read::make_view): Assert on zero-length view.
13655 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
13656 symbol table when there are no symbols to read.
13658 2008-06-23 Craig Silverstein <csilvers@google.com>
13660 * version.cc (version_string): Bump to 1.7
13662 2008-06-18 Craig Silverstein <csilvers@google.com>
13664 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
13665 constant 0xFFFF to type Valtype.
13666 (Powerpc_relocate_functions::rel16_ha): Likewise.
13668 2008-06-17 Ian Lance Taylor <iant@google.com>
13670 * output.h (Output_section::Input_section): Initialize p2align_ to
13671 zero for Output_section_data constructors.
13672 (Output_section::Input_section::addralign): If not an input
13673 section, return the alignment of the Output_section_data.
13674 * testsuite/copy_test.cc: New file.
13675 * testsuite/copy_test_1.cc: New file.
13676 * testsuite/copy_test_2.cc: New file.
13677 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
13678 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
13679 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
13680 (copy_test_1_pic.o, copy_test_1.so): New targets.
13681 (copy_test_2_pic.o, copy_test_2.so): New targets.
13682 * testsuite/Makefile.in: Rebuild.
13684 * script-sections.cc (Script_sections::place_orphan): Initialize
13685 local variable exact.
13687 2008-06-13 David Edelsohn <edelsohn@gnu.org>
13689 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
13691 2008-06-12 David Edelsohn <edelsohn@gnu.org>
13692 David S. Miller <davem@davemloft.net>
13694 * powerpc.cc: New file.
13695 * Makefile.am (TARGETSOURCES): Add powerpc.cc
13696 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
13697 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
13698 * Makefile.in: Rebuild.
13700 2008-06-09 Ian Lance Taylor <iant@google.com>
13702 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
13704 (throwing, orig_terminate): New static variables.
13705 (terminate_handler): New static function.
13706 (t2): Set terminate handler.
13708 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
13711 * binary.cc (Binary_to_elf::sized_convert): Fix .data
13714 2008-05-30 Cary Coutant <ccoutant@google.com>
13716 * archive.cc (Archive::include_all_members) Correct to step
13717 over symbol table and extended name table in thin archives.
13719 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
13722 * target-reloc.h (relocate_for_relocatable): Fix new_offset
13725 2008-05-28 Caleb Howe <cshowe@google.com>
13727 * reduced_debug_output.cc: New file.
13728 * reduced_debug_output.h: New file.
13729 * options.h (class General_options): Add --strip-debug-non-line.
13730 * options.cc (General_options::finalize): Add strip_debug_non_line
13731 to the strip heirarchy.
13732 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
13734 * layout.cc: Include "reduced_debug_output.h".
13735 (Layout::Layout): Initialize new fields.
13736 (line_only_debug_sections): New static array.
13737 (is_lines_only_debug_sections): New static inline function.
13738 (Layout::include_section): Handle --strip-debug-non-line.
13739 (Layout::make_output_section): If --strip-debug-non-line, build
13740 new output sections for .debug_abbrev and .debug_info.
13741 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
13742 gold. Warn about possible overflow.
13743 (read_signed_LEB_128): Likewise.
13744 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
13745 (read_signed_LEB_128): Declare.
13746 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
13747 (HFILES): Add reduced_debug_output.h.
13748 * Makefile.in: Rebuild.
13750 2008-05-21 Ian Lance Taylor <iant@google.com>
13752 * mapfile.cc: New file.
13753 * mapfile.h: New file.
13754 * options.h (class General_options): Add -M/--print-map and -Map.
13755 * options.cc (General_options::finalize): Make -M equivalent to
13757 * main.cc: Include <cstdio> and "mapfile.h".
13758 (main): Open mapfile if requested.
13759 * gold.cc (class Middle_runner): Add mapfile_ field. Update
13760 constructor. Change caller.
13761 (queue_initial_tasks): Add mapfile parameter. Change caller.
13762 (queue_middle_tasks): Likewise.
13763 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
13765 * archive.cc: Include "mapfile.h".
13766 (Archive::add_symbols): Add mapfile parameter. Change all
13767 callers. Pass mapfile, symbol, and reason to include_member.
13768 (Archive::include_all_members): Add mapfile parameter. Change all
13770 (Archive::include_member): Add mapfile, sym, and why parameters.
13771 Change all callers. Report inclusion to map file.
13772 * archive.h: Include "fileread.h".
13773 (class Archive): Update declarations.
13774 (Archive::file): New const method.
13775 (class Add_archive_symbols): Add mapfile_ field. Update
13776 constructor. Change all callers.
13777 * readsyms.h (class Read_symbols): Likewise.
13778 (class Finish_group): Likewise.
13779 (class Read_script): Likewise.
13780 * common.cc: Include "mapfile.h".
13781 (Symbol_table::allocate_commons): Add mapfile parameter. Change
13783 (Symbol_table::do_allocate_commons): Likewise.
13784 (Symbol_table::do_allocate_commons_list): Likewise. Report common
13785 symbol allocation to mapfile.
13786 * common.h (class Allocate_commons_task): Add mapfile_ field.
13787 Update constructor. Change all callers.
13788 * symtab.h (class Symbol_table): Update declarations.
13789 * layout.cc: Include "mapfile.h".
13790 (Layout_task_runner::run): Print information to mapfile.
13791 (Layout::create_gold_note): Change Output_data_fixed_space to
13792 Output_data_zero_fill.
13793 (Layout::create_build_id): Likewise.
13794 (Layout::print_to_mapfile): New function.
13795 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
13796 constructor. Change caller.
13797 (class Layout): Declare print_to_mapfile.
13798 * output.cc (Output_section::Input_section::print_to_mapfile): New
13800 (Output_section::add_input_section): If producing a map, always
13801 add to input_sections_ list.
13802 (Output_section::do_print_to_mapfile): New function.
13803 (Output_segment::print_sections_to_mapfile): New function.
13804 (Output_segment::print_section_list_to_mapfile): New function.
13805 * output.h: Include "mapfile.h".
13806 (Output_data::print_to_mapfile): New function.
13807 (Output_data::do_print_to_mapfile): New virtual function.
13808 (Output_segment_headers::do_print_to_mapfile): New function.
13809 (Output_file_header::do_print_to_mapfile): New function.
13810 (Output_data_const::do_print_to_mapfile): New function.
13811 (class Output_data_const_buffer): Add map_name_ field. Update
13812 constructor. Change all callers. Add do_print_to_mapfile
13814 (class Output_data_fixed_space): Likewise.
13815 (class Output_data_space): Likewise.
13816 (class Output_data_zero_fill): New class.
13817 (Output_data_strtab::do_print_to_mapfile): New function.
13818 (Output_data_reloc_base::do_print_to_mapfile): New function.
13819 (Output_relocatable_relocs::do_print_to_mapfile): New function.
13820 (Output_data_group::do_print_to_mapfile): New function.
13821 (Output_data_got::do_print_to_mapfile): New function.
13822 (Output_data_dynamic::do_print_to_mapfile): New function.
13823 (Output_symtab_xindex::do_print_to_mapfile): New function.
13824 (class Output_section): Declare do_print_to_mapflie. Declare
13825 print_to_mapfile in Input_section.
13826 (class Output_segment): Declare new functions.
13827 * object.h (Sized_relobj::symbol_count): New function.
13828 * script-sections.cc
13829 (Output_section_element_dot_assignment::set_section_addresses):
13830 Change Output_data_fixed_space to Output_data_zero_fill.
13831 (Output_data_expression::do_print_to_mapfile): New function.
13832 * script.cc (read_input_script): Add mapfile parameter. Change
13834 * script.h (read_input_script): Update declaration.
13835 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
13836 (Eh_frame::do_print_to_mapfile): New function.
13837 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
13838 (Output_merge_string::do_print_to_mapfile): New function.
13839 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
13841 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
13843 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
13845 * Makefile.am (CCFILES): Add mapfile.cc.
13846 (HFILES): Add mapfile.h.
13847 * Makefile.in: Rebuild.
13849 2008-05-19 Ian Lance Taylor <iant@google.com>
13851 * options.h (class General_options): Add -z relro.
13852 * layout.cc (Layout::Layout): Initialize relro_segment_.
13853 (Layout::add_output_section_data): Return the output section.
13854 (Layout::make_output_section): Rcognize relro sections and mark
13855 them appropriately.
13856 (Layout::attach_allocated_section_to_segment): Put relro sections
13857 in a PT_GNU_RELRO segment.
13858 (Layout::create_initial_dynamic_sections): Mark the .dynamic
13860 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
13862 (Layout::linkonce_mapping): Map d.rel.ro.local to
13863 .data.rel.ro.local.
13864 (Layout::output_section_name): Us .data.rel.ro.local for any
13865 section which begins with that.
13866 * layout.h (class Layout): Update add_output_section_data
13867 declaration. Add relro_segment_ field.
13868 * output.cc (Output_section::Output_section): Initialize is_relro_
13869 and is_relro_local_ fields.
13870 (Output_segment::add_output_section): Group relro sections.
13871 (Output_segment::is_first_section_relro): New function.
13872 (Output_segment::maximum_alignment): If there is a relro section,
13873 align the segment to the common page size.
13874 (Output_segment::set_section_addresses): Track whether we are
13875 looking at relro sections. If the last section is a relro
13876 section, align to the common page size.
13877 (Output_segment::set_section_list_addresses): Add in_relro
13878 parameter. Change all callers. Align to the page size when
13879 moving from relro to non-relro section.
13880 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
13882 * output.h (class Output_section): Add is_relro_ and
13883 is_relro_local_ fields.
13884 (Output_section::is_relro): New function.
13885 (Output_section::set_is_relro): New function.
13886 (Output_section::is_relro_local): New function.
13887 (Output_section::set_is_relro_local): New function.
13888 (class Output_segment): Update declarations.
13889 * i386.cc (Target_i386::got_section): Mark .got section as relro.
13890 * sparc.cc (Target_sparc::got_section): Likewise.
13891 * x86_64.cc (Target_x86_64::got_section): Likewise.
13892 * testsuite/relro_test_main.cc: New file.
13893 * testsuite/relro_test.cc: New file.
13894 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
13895 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
13896 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
13897 (relro_test.so, relro_test_pic.o): New targets.
13898 * testsuite/Makefile.in: Rebuild.
13900 2008-05-16 Ian Lance Taylor <iant@google.com>
13902 * output.cc (Output_segment::add_output_section): Remove front
13904 * output.h (class Output_segment): Remove
13905 add_initial_output_section and overloaded add_output_section.
13906 Update declaration of remaining add_output_section.
13907 * layout.cc (Layout::create_interp): Call add_output_section
13908 rather than add_initial_output_section.
13909 (Layout::finish_dynamic_section): Likewise.
13911 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
13912 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
13913 know the dynamic type.
13914 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
13915 field. Initialize it in constructor.
13916 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
13917 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
13918 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
13921 * output.cc (Output_reloc::get_address): Change return type to
13923 * output.h (class Output_reloc): Update get_address declaration.
13924 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
13925 for section addresses.
13927 2008-05-09 Ian Lance Taylor <iant@google.com>
13930 * gold.cc (gold_nomem): Use return value of write.
13932 2008-05-08 Ian Lance Taylor <iant@google.com>
13934 * symtab.c (Symbol::init_base_output_data): Add version
13935 parameter. Change all callers.
13936 (Symbol::init_base_output_segment): Likewise.
13937 (Symbol::init_base_constant): Likewise.
13938 (Symbol::init_base_undefined): Likewise.
13939 (Sized_symbol::init_output_data): Likewise.
13940 (Sized_symbol::init_output_segment): Likewise.
13941 (Sized_symbol::init_constant): Likewise.
13942 (Sized_symbol::init_undefined): Likewise.
13943 (Symbol_table::do_define_in_output_data): If the new symbol has a
13944 version, mark it as the default.
13945 (Symbol_table::do_define_in_output_segment): Likewise.
13946 (Symbol_table::do_define_as_constant): Likewise.
13947 * symtab.h (class Symbol): Update declarations.
13948 (class Sized_symbol): Likewise.
13949 * resolve.cc (Symbol::override_version): New function.
13950 (Symbol::override_base): Call override_version.
13951 (Symbol::override_base_with_special): Likewise.
13952 * testsuite/ver_script_8.script: New file.
13953 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
13954 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
13955 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
13956 (ver_test_8_1.so, ver_test_8_2.so): New targets.
13958 2008-05-06 Ian Lance Taylor <iant@google.com>
13961 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
13963 (class General_options): Remove existing --undefined, and add
13964 --no-undefined instead. Add new --undefined as synonym for -u.
13965 * archive.cc (Archive::add_symbols): Check whether symbol was
13967 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
13968 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
13969 all uses. Add IS_UNDEFINED. Update declarations to split
13970 different versions of init_base. Declare init_base_undefined.
13971 (Symbol::is_defined): Handle IS_UNDEFINED.
13972 (Symbol::is_undefined): Likewise.
13973 (Symbol::is_weak_undefined): Call is_undefined.
13974 (Symbol::is_absolute): Handle IS_CONSTANT.
13975 (class Sized_symbol): Update declarations to split different
13976 versions of init. Declare init_undefined.
13977 (class Symbol_table): Declare new functions.
13978 * symtab.cc (Symbol::init_base_object): Rename from init_base.
13979 Change all callers.
13980 (Symbol::init_base_output_data): Likewise.
13981 (Symbol::init_base_output_segment): Likewise.
13982 (Symbol::init_base_constant): Likewise.
13983 (Symbol::init_base_undefined): New function.
13984 (Sized_symbol::init_object): Rename from init. Change all
13986 (Sized_symbol::init_output_data): Likewise.
13987 (Sized_symbol::init_output_segment): Likewise.
13988 (Sized_symbol::init_constant): Likewise.
13989 (Sized_symbol::init_undefined): New function.
13990 (Symbol_table::add_undefined_symbols_from_command_line): New
13992 (Symbol_table::do_add_undefined_symbols_from_command_line): New
13994 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
13995 (Symbol::output_section): Likewise.
13996 (Symbol::set_output_section): Likewise.
13997 (Symbol_table::sized_finalize_symbol): Likewise.
13998 (Symbol_table::sized_write_globals): Likewise.
13999 * resolve.cc (Symbol_table::should_override): Likewise.
14000 (Symbol::override_base_with_special): Likewise.
14002 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
14003 symbol, change it to have default visibility.
14004 * testsuite/protected_1.cc: New file.
14005 * testsuite/protected_2.cc: New file.
14006 * testsuite/protected_3.cc: New file.
14007 * testsuite/protected_main_1.cc: New file.
14008 * testsuite/protected_main_2.cc: New file.
14009 * testsuite/protected_main_3.cc: New file.
14010 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
14011 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
14012 (protected_1_LDFLAGS, protected_1_LDADD): Define.
14013 (protected_1.so): New target.
14014 (protected_1_pic.o, protected_2_pic.o): New targets.
14015 (protected_3_pic.o): New target.
14016 (check_PROGRAMS): Add protected_2.
14017 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
14018 (protected_2_LDFLAGS, protected_2_LDADD): Define.
14019 * testsuite/Makefile.in: Rebuild.
14021 * options.h (DEFINE_var): Add set_user_set_##varname__.
14022 (DEFINE_bool_alias): New macro.
14023 (class General_options): Define -Bstatic using DEFINE_bool_alias
14024 rather than DEFINE_special. Add --undefined as an alias for -z
14026 * options.cc (General_options::parse_Bstatic): Remove.
14028 * options.h (class General_options): Add --fatal-warnings.
14029 * main.cc (main): Implement --fatal-warnings.
14030 * errors.h (Errors::warning_count): New function.
14032 * options.h (class General_options): Add -Bsymbolic-functions.
14033 * symtab.h (Symbol::is_preemptible): Check for
14034 -Bsymbolic-functions.
14036 2008-05-05 Ian Lance Taylor <iant@google.com>
14038 * options.h (DEFINE_bool): For DASH_Z, create the negative option
14039 as noVARNAME rather than no-VARNAME.
14040 (class General_options): Add option -z combreloc.
14041 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
14043 (Output_reloc::sort_before) [SHT_REL]: New function.
14044 (Output_reloc::sort_before) [SHT_RELA]: New function.
14045 (class Output_data_reloc_base): Add sort_relocs_ field. Define
14046 Sort_relocs_comparison.
14047 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
14048 parameter. Change all callers.
14049 (Output_data_reloc::Output_data_reloc) [both versions]: Add
14050 sort_relocs parameter. Change all callers.
14051 * output.cc (Output_reloc::get_address): New function, broken out
14053 (Output_reloc::write_rel): Call it.
14054 (Output_reloc::compare): New function.
14055 (Output_data_reloc_base::do_write): Optionally sort relocs.
14057 * configure.ac: If targ_extra_obj is set, link it in.
14058 * configure.tgt: Initialize all variables.
14059 (x86_64*): Set targ_extra_obj and targ_extra_size.
14060 * configure: Rebuild.
14062 * object.cc (Sized_relobj::include_section_group): Adjust section
14063 indexes read from group data. Build vector to pass to
14065 * layout.cc (Layout::layout_group): Add flags and shndxes
14066 parameters. Remove contents parameter. Change caller. Update
14067 explicit instantiations.
14068 * layout.h (class Layout): Update layout_group declaration.
14069 * output.cc (Output_data_group::Output_data_group): Add flags and
14070 input_shndxes parameters. Remove contents parameter. Change
14072 (Output_data_group::do_write): Change input_sections_ to
14074 * output.h (class Output_data_group): Update constructor
14075 declaration. Rename input_sections_ to input_shndxes_.
14076 * testsuite/many_sections_test.cc: Add template.
14078 2008-04-30 Cary Coutant <ccoutant@google.com>
14080 * target-reloc.h (relocate_section): Fix dead-pointer bug.
14082 * layout.cc (Layout::include_section): Refactored check for debug
14084 (Layout::add_comdat): Add new parameters. Change type
14085 of signature parameter. Add object and shndx to signatures table.
14086 (Layout::find_kept_object): New function.
14087 * layout.h: Include <cstring>.
14088 (Layout::is_debug_info_section): New function.
14089 (Layout::add_comdat): Add new parameters.
14090 (Layout::find_kept_object): New function.
14091 (Layout::Kept_section): New struct.
14092 (Layout::Signatures): Change type of map range.
14093 * object.cc (Relobj::output_section_address): New function.
14094 (Sized_relobj::include_section_group): Add new parameters. Change
14095 calls to Layout::add_comdat. Change to build table of kept comdat
14096 groups and table mapping discarded sections to kept sections.
14097 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
14098 (Sized_relobj::do_layout): Change calls to include_section_group and
14099 include_linkonce_section.
14100 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
14101 value to zero when section is discarded.
14102 (Sized_relobj::map_to_kept_section): New function.
14103 * object.h (Relobj::output_section_address): New function.
14104 (Relobj::Comdat_group): New type.
14105 (Relobj::find_comdat_group): New function.
14106 (Relobj::Comdat_group_table): New type.
14107 (Relobj::Kept_comdat_section): New type.
14108 (Relobj::Kept_comdat_section_table): New type.
14109 (Relobj::add_comdat_group): New function.
14110 (Relobj::set_kept_comdat_section): New function.
14111 (Relobj::get_kept_comdat_section): New function.
14112 (Relobj::comdat_groups_): New field.
14113 (Relobj::kept_comdat_sections_): New field.
14114 (Symbol_value::input_value): Update comment.
14115 (Sized_relobj::map_to_kept_section) New function.
14116 (Sized_relobj::include_linkonce_section): Add new parameter.
14117 * target-reloc.h (Comdat_behavior): New type.
14118 (get_comdat_behavior): New function.
14119 (relocate_section): Add code to map a discarded section to the
14120 corresponding kept section when applying a relocation.
14122 2008-04-30 Craig Silverstein <csilvers@google.com>
14124 * dwarf_reader.cc (next_generation_count): New static var.
14125 (Addr2line_cache_entry): New struct.
14126 (addr2line_cache): New static var.
14127 (Dwarf_line_info::one_addr2line): Added caching.
14128 (Dwarf_line_info::clear_addr2line_cache): New function.
14129 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
14130 cache-size parameter.
14131 (Dwarf_line_info::one_addr2line_cache): New function.
14132 * symtab.cc (Symbol_table::detect_odr_violations): Pass
14133 new cache-size argument to one_addr2line(), and clear cache.
14135 2008-04-28 Cary Coutant <ccoutant@google.com>
14137 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
14138 R_386_PC8 relocations.
14140 2008-04-23 Ian Lance Taylor <iant@google.com>
14142 * object.cc (Sized_relobj::include_section_group): Check for
14143 invalid section group.
14145 * object.cc (make_elf_object): Correct test for 64-bit ELF file
14148 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
14149 than read for file header.
14150 * archive.cc (Archive::include_member): Likewise.
14152 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
14154 * aclocal.m4: Regenerate.
14155 * configure: Regenerate.
14157 2008-04-19 Ian Lance Taylor <iant@google.com>
14159 * version.cc (version_string): Bump to 1.6.
14161 * testsuite/Makefile.am (many_sections_r_test): New target.
14162 (many_sections_r_test_SOURCES): Remove.
14163 (many_sections_r_test_DEPENDENCIES): Remove.
14164 (many_sections_r_test_LDFLAGS): Remove.
14165 (many_sections_r_test_LDADD): Remove.
14167 * object.cc (Sized_relobj::do_add_symbols): Always pass
14168 local_symbol_count_ to add_from_relobj.
14170 * testsuite/Makefile.am (many_sections_check.h): Only check one in
14171 every thousand variables.
14172 * testsuite/Makefile.in: Rebuild.
14174 * object.cc (Xindex::initialize_symtab_xindex): New function.
14175 (Xindex::read_symtab_xindex): New function.
14176 (Xindex::sym_xindex_to_shndx): New function.
14177 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
14179 (Sized_relobj::do_initialize_xindex): New function.
14180 (Sized_relobj::do_read_symbols): Adjust section links.
14181 (Sized_relobj::symbol_section_and_value): Add is_ordinary
14182 parameter. Change all callers.
14183 (Sized_relobj::include_section_group): Adjust section links and
14184 symbol section indexes.
14185 (Sized_relobj::do_layout): Adjust section links.
14186 (Sized_relobj::do_count_local_symbols): Adjust section links and
14187 symbol section indexes.
14188 (Sized_relobj::do_finalize_local_symbols): Distinguish between
14189 ordinary and special symbols.
14190 (Sized_relobj::write_local_symbols): Add symtab_xindex and
14191 dynsym_xindex parameters. Change all callers. Adjust section
14192 links. Use SHN_XINDEX when needed.
14193 (Sized_relobj::get_symbol_location_info): Adjust section links.
14194 Don't get fooled by special symbols.
14195 * object.h (class Xindex): Define.
14196 (class Object): Add xindex_ parameter. Declare virtual functoin
14197 do_initialize_xindex.
14198 (Object::adjust_sym_shndx): New function.
14199 (Object::set_xindex): New protected function.
14200 (class Symbol_value): Add is_ordinary_shndx_ field.
14201 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
14202 (Symbol_value::value): Assert ordinary section.
14203 (Symbol_value::initialize_input_to_output_map): Likewise.
14204 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
14205 Change all callers.
14206 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
14208 (class Sized_relobj): Update declarations.
14209 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
14210 parameter. Change all callers.
14211 (Sized_relobj::adjust_shndx): New function.
14212 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
14214 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
14215 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
14216 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
14217 (Sized_dynobj::read_dynsym_section): Adjust section links.
14218 (Sized_dynobj::read_dynamic): Likewise.
14219 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
14221 (Sized_dynobj::do_initialize_xindex): New function.
14222 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
14223 do_initialize_xindex.
14224 (Sized_dynobj::adjust_shndx): New function.
14225 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
14226 dynsym_xindex_ fields.
14227 (Layout::finalize): Add a call to set_section_indexes before
14228 creating the symtab sections.
14229 (Layout::set_section_indexes): Don't do anything if the section
14230 already has a section index.
14231 (Layout::create_symtab_sections): Add shnum parameter. Change
14232 caller. Create .symtab_shndx section if needed.
14233 (Layout::create_shdrs): Add shstrtab_section parameter. Change
14235 (Layout::allocated_output_section_count): New function.
14236 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
14238 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
14239 fields. Update declarations.
14240 (Layout::symtab_xindex): New function.
14241 (Layout::dynsym_xindex): New function.
14242 (class Write_symbols_task): Add layout_ field.
14243 (Write_symbols_task::Write_symbols_task): Add layout parameter.
14245 * output.cc (Output_section_headers::Output_section_headers): Add
14246 shstrtab_section parameter. Change all callers.
14247 (Output_section_headers::do_sized_write): Store overflow values
14248 for section count and section string table section index in
14249 section header zero.
14250 (Output_file_header::do_sized_write): Check for overflow of
14251 section count and section string table section index.
14252 (Output_symtab_xindex::do_write): New function.
14253 (Output_symtab_xindex::endian_do_write): New function.
14254 * output.h (class Output_section_headers): Add shstrtab_section_.
14255 Update declarations.
14256 (class Output_symtab_xindex): Define.
14257 (Output_section::has_out_shndx): New function.
14258 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
14260 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
14261 Change all callers.
14262 (Sized_symbol::init): Likewise.
14263 (Symbol::output_section): Check for ordinary symbol.
14264 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
14265 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
14267 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
14268 Change all callers. Simplify handling of symbols from sections
14269 not included in the link.
14270 (Symbol_table::add_from_dynobj): Handle ordinary symbol
14272 (Weak_alias_sorter::operator()): Assert that symbols are
14274 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
14276 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
14277 parameters. Change all callers.
14278 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
14279 symbol distinction. Use SHN_XINDEX when needed.
14280 (Symbol_table::write_section_symbol): Add symtab_xindex
14281 parameter. Change all callers.
14282 (Symbol_table::sized_write_section_symbol): Likewise. Use
14283 SHN_XINDEX when needed.
14284 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
14286 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
14287 (Symbol::is_defined): Check is_ordinary.
14288 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
14289 (Symbol::is_absolute, Symbol::is_common): Likewise.
14290 (class Sized_symbol): Update declarations.
14291 (class Symbol_table): Update declarations.
14292 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
14293 parameters. Change all callers.
14294 (Sized_symbol::override): Likewise.
14295 (Symbol_table::override): Likewise.
14296 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
14297 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
14298 is_ordinary, and orig_st_shndx parameters. Change all callers.
14299 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
14300 to be in an ordinary section.
14301 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
14302 object and is_ordinary parameters. Change all callers.
14303 (Sized_dwarf_line_info::read_relocs): Add object parameter.
14304 Change all callers. Don't add undefined or non-ordinary symbols
14306 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
14307 Change all callers.
14308 * dwarf_reader.h (class Sized_dwarf_line_info): Update
14310 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
14311 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
14312 (Sized_relobj::relocate_sections): Likewise.
14313 * target-reloc.h (scan_relocs): Adjust section symbol index.
14314 (scan_relocatable_relocs): Likewise.
14315 * i386.cc (Scan::local): Check for ordinary symbols.
14316 * sparc.cc (Scan::local): Likewise.
14317 * x86_64.cc (Scan::local): Likewise.
14318 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
14319 to symbol_section_and_value.
14320 * testsuite/many_sections_test.cc: New file.
14321 * testsuite/Makefile.am (BUILT_SOURCES): Define.
14322 (check_PROGRAMS): Add many_sections_test.
14323 (many_sections_test_SOURCES): Define.
14324 (many_sections_test_DEPENDENCIES): Define.
14325 (many_sections_test_LDFLAGS): Define.
14326 (BUILT_SOURCES): Add many_sections_define.h.
14327 (many_sections_define.h): New target.
14328 (BUILT_SOURCES): Add many_sections_check.h.
14329 (many_sections_check.h): New target.
14330 (check_PROGRAMS): Add many_sections_r_test.
14331 (many_sections_r_test_SOURCES): Define.
14332 (many_sections_r_test_DEPENDENCIES): Define.
14333 (many_sections_r_test_LDFLAGS): Define.
14334 (many_sections_r_test_LDADD): Define.
14335 (many_sections_r_test.o): New target.
14336 * testsuite/Makefile.in: Rebuild.
14338 2008-04-17 Cary Coutant <ccoutant@google.com>
14340 * errors.cc (Errors::info): New function.
14341 (gold_info): New function.
14342 * errors.h (Errors::info): New function.
14343 * gold.h (gold_info): New function.
14344 * object.cc (Input_objects::add_object): Print trace output.
14345 * options.cc (options::parse_set): New function.
14346 (General_options::parse_wrap): Deleted.
14347 (General_options::General_options): Deleted initializer.
14348 * options.h (options::String_set): New typedef.
14349 (options::parse_set): New function.
14350 (DEFINE_set): New macro.
14351 (General_options::wrap): Changed to use DEFINE_set. Changed
14352 callers of any_wrap_symbols and is_wrap_symbol.
14353 (General_options::trace, General_options::trace_symbol):
14355 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
14356 (General_options::wrap_symbols_): Deleted.
14357 * symtab.cc (Symbol_table::add_from_object): Print trace output.
14359 2008-04-17 David S. Miller <davem@davemloft.net>
14361 * options.cc (General_options::parse_V): New function.
14362 * options.h: Add entries for -V and -Qy.
14364 2008-04-17 Ian Lance Taylor <iant@google.com>
14366 * common.cc (Symbol_table::allocate_commons): Remove options
14367 parameter. Change caller.
14368 (Symbol_table::do_allocate_commons): Remove options parameter.
14369 Change caller. Just call do_allocate_commons_list twice.
14370 (Symbol_table::do_allocate_commons_list): New function, broken out
14371 of do_allocate_commons.
14372 * common.h (class Allocate_commons_task): Remove options_ field.
14373 Update constructor.
14374 * symtab.cc (Symbol_table::Symbol_table): Initialize
14376 (Symbol_table::add_from_object): Put TLS common symbols on
14378 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
14379 which are IN_OUTPUT_DATA.
14380 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
14381 allocate_commons and do_allocate_commons declarations. Declare
14382 do_allocate_commons_list.
14383 * gold.cc (queue_middle_tasks): Update creation of
14384 Allocate_commons_task to not pass options.
14385 * testsuite/Makefile.am (INCLUDES): Add -I.. .
14386 (TLS_TEST_C_FLAGS): New variable.
14387 (tls_test_c_pic.o): New target.
14388 (tls_test_shared.so): Link in tls_test_c_pic.o.
14389 (tls_test_c_pic_ie.o): New target.
14390 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
14391 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
14392 (tls_test_c.o): New target.
14393 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
14394 (tls_pic_test_LDADD): Likewise.
14395 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
14396 (tls_shared_gd_to_ie_test_LDADD): Likewise.
14397 (tls_test_c_gnu2.o): New target.
14398 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
14400 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
14401 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
14402 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
14403 * testsuite/tls_test.cc: Include "config.h".
14404 (t_last): Call t11_last.
14405 * testsuite/tls_test.h (t11, t11_last): Declare.
14406 * testsuite/tls_test_c.c: New file.
14407 * testsuite/tls_test_main.cc (thread_routine): Call t11.
14408 * configure.ac: Check for OpenMP support.
14409 * configure, config.in, Makefile.in: Rebuild.
14410 * testsuite/Makefile.in: Rebuild.
14412 2008-04-16 Cary Coutant <ccoutant@google.com>
14414 * i386.cc (Target_i386::define_tls_base_symbol): New function.
14415 (Target_i386::tls_base_symbol_defined_): New field.
14416 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14417 (Target_i386::Scan::global): Likewise.
14418 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
14419 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
14420 (Target_x86_64::tls_base_symbol_defined_): New field.
14421 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14422 (Target_x86_64::Scan::global): Likewise.
14424 2008-04-16 Cary Coutant <ccoutant@google.com>
14426 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
14427 (Symbol::needs_plt_entry): Allow weak undefined symbols.
14428 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
14429 building shared libraries.
14430 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
14431 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
14432 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
14433 * testsuite/Makefile.in: Rebuild.
14434 * testsuite/weak_undef.h: New file.
14435 * testsuite/weak_undef_file1.cc: Add extra test cases.
14436 * testsuite/weak_undef_file2.cc: Likewise.
14437 * testsuite/weak_undef_test.cc: Likewise.
14439 2008-04-16 David S. Miller <davem@davemloft.net>
14441 * sparc.cc (Target_sparc::Scan): Change from struct to class.
14442 Add issued_non_pic_error_ field. Declare check_non_pic.
14443 (Target_sparc::Scan::check_non_pic): New function.
14444 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
14445 (Target_sparc::Scan::global): Likewise.
14447 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
14448 * configure: Rebuild.
14450 * options.h (DEFINE_enable): New macro.
14451 (new_dtags): New enable option.
14452 (initfirst, interpose, loadfltr, nodefaultlib,
14453 nodelete, nodlopen, nodump): New -z options.
14454 * layout.cc (Layout:finish_dynamic_section): If new
14455 dtags enabled, emit DT_RUNPATH. Also, emit a
14456 DT_FLAGS_1 containing any specified -z flags.
14458 2008-04-16 Ian Lance Taylor <iant@google.com>
14460 * copy-relocs.cc: New file.
14461 * copy-relocs.h: New file.
14462 * reloc.cc: Remove Copy_relocs code.
14463 * reloc.h: Likewise.
14464 * reloc-types.h (struct Reloc_types) [both versions]: Add
14465 get_reloc_addend_noerror.
14466 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
14467 variants of add_global which take an addend which must be zero.
14468 * i386.cc: Include "copy-relocs.h".
14469 (class Target_i386): Change type of copy_relocs_ to variable,
14470 update initializer.
14471 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
14472 Change all callers.
14473 (Target_i386::do_finalize_sections): Change handling of
14475 * sparc.cc: Include "copy-relocs.h".
14476 (class Target_sparc): Change type of copy_relocs_ to variable,
14477 update initializer.
14478 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
14479 Change all callers.
14480 (Target_sparc::do_finalize_sections): Change handling of
14482 * x86_64.cc: Include "copy-relocs.h".
14483 (class Target_x86_64): Change type of copy_relocs_ to variable,
14484 update initializer.
14485 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
14486 class. Change all callers.
14487 (Target_x86_64::do_finalize_sections): Change handling of
14489 * Makefile.am (CCFILES): Add copy-relocs.cc.
14490 (HFILES): Add copy-relocs.h.
14492 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
14494 * testsuite/script_test_4.sh: Permit leading zeroes.
14496 2008-04-15 Ian Lance Taylor <iant@google.com>
14498 * script-sections.cc (Script_sections::create_segments): Use
14499 header_size_adjustment even when there is enough room for the
14501 * testsuite/script_test_4.sh: New file.
14502 * testsuite/script_test_4.t: New file.
14503 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
14504 (check_DATA): Add script_test_4.stdout.
14505 (MOSTLYCLEANFILES): Likewise.
14506 (script_test_4): New target.
14507 (script_test_4.stdout): New target.
14508 * testsuite/Makefile.in: Rebuild.
14510 * sparc.cc: Add definitions for Output_data_plt_sparc class
14513 2008-04-14 David S. Miller <davem@davemloft.net>
14515 * sparc.cc: New file.
14516 * Makefile.am (TARGETSOURCES): Add sparc.cc
14517 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
14518 * configure.tgt: Document targ_extra_size and
14519 targ_extra_big_endian. Add entries for sparc-* and
14521 * configure.ac: Handle targ_extra_size and
14522 targ_extra_big_endian.
14523 * Makefile.in: Rebuild.
14524 * configure: Likewise.
14525 * po/POTFILES.in: Likewise.
14526 * po/gold.pot: Likewise.
14528 2008-04-14 Ian Lance Taylor <iant@google.com>
14530 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
14531 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
14532 in the name/type/flags to section mapping. Don't call
14533 allocate_output_section.
14534 (Layout::choose_output_section): Change parameter from adjust_name
14535 to is_input_section. Don't permit input sections after sections
14536 are attached to segments. Don't call allocate_output_section.
14537 (Layout::layout_eh_frame): Call update_flags_for_input_section,
14538 not write_enable_output_section.
14539 (Layout::make_output_section): Don't push to
14540 unattached_section_list_ nor call attach_to_segment. Call
14541 attach_section_to_segment if sections are attached.
14542 (Layout::attach_sections_to_segments): New function.
14543 (Layout::attach_section_to_segment): New function.
14544 (Layout::attach_allocated_section_to_segment): Rename from
14545 attach_to_segment. Remove flags parameter.
14546 (Layout::allocate_output_section): Remove function.
14547 (Layout::write_enable_output_section): Remove function.
14548 * layout.h (class Layout): Update for above changes. Add new
14549 field sections_are_attached_.
14550 * output.h (Output_section::update_flags_for_input_section): New
14552 * output.cc (Output_section::add_input_section): Call
14553 update_flags_for_input_section.
14554 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
14556 2008-04-11 Cary Coutant <ccoutant@google.com>
14558 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
14559 thought unnecessary.
14560 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
14562 2008-04-11 Ian Lance Taylor <iant@google.com>
14564 * output.h (class Output_section_data): Remove inline definition
14566 * output.cc (Output_section_data::set_addralign): New function.
14568 2008-04-11 Cary Coutant <ccoutant@google.com>
14570 Add support for TLS descriptors for i386 and x86_64.
14571 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
14572 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
14573 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
14575 (Target_i386::got_mod_index_entry): Remove unnecessary code.
14576 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
14577 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
14579 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
14580 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
14581 Fix problem with initial-exec relocations.
14582 (Target_i386::Relocate::relocate_tls): Likewise.
14583 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
14585 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
14586 support for section-plus-offset dynamic table entries.
14587 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
14588 (Output_data_dynamic::Dynamic_entry): Add support for
14589 section-plus-offset dynamic table entries.
14590 (Output_data_dynamic::Classification): Likewise.
14591 (Output_data_dynamic::classification_): Renamed offset_.
14592 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
14593 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
14594 (Target_x86_64::make_plt_section): New function.
14595 (Target_x86_64::reserve_tlsdesc_entries): New function.
14596 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
14597 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
14598 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
14599 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
14600 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
14601 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
14602 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
14603 add extra PLT entry for TLS descriptors.
14604 (Output_data_plt_x86_64::got_): New field.
14605 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
14606 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
14608 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
14610 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
14611 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
14612 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
14613 R_386_TLS_DESC_CALL relocations.
14614 (Target_x86_64::Scan::global): Likewise.
14615 (Target_x86_64::do_finalize_sections): Add dynamic table entries
14616 for TLS descriptors.
14617 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
14618 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
14619 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
14620 GD-to-IE relaxation.
14621 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
14622 and TLS_DESCRIPTORS.
14623 * Makefile.in: Rebuild.
14624 * configure: Rebuild.
14625 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
14626 (tls_test_shared2.so): New target.
14627 (tls_shared_gd_to_ie_test_SOURCES): New variable.
14628 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
14629 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
14630 (tls_shared_gd_to_ie_test_LDADD): New variable.
14631 (tls_shared_gnu2_gd_to_ie_test): New target.
14632 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
14634 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
14635 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
14636 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
14637 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
14638 (tls_shared_gnu2_test): New target.
14639 (tls_test_gnu2_shared.so): New target.
14640 (tls_shared_gnu2_test_SOURCES): New variable.
14641 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
14642 (tls_shared_gnu2_test_LDFLAGS): New variable.
14643 (tls_shared_gnu2_test_LDADD): New variable.
14644 * testsuite/Makefile.in: Rebuild.
14645 * testsuite/Makefile.
14647 2008-04-11 Ian Lance Taylor <iant@google.com>
14649 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
14651 * testsuite/Makefile.in: Rebuild.
14653 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
14655 * testsuite/script_test_2.cc (main): Adjust test.
14657 2008-04-11 David S. Miller <davem@davemloft.net>
14658 Ian Lance Taylor <iant@google.com>
14660 * options.h (General_options): Add entries for '-Y' and
14662 * options.cc (General_options:finalize): If -Y was used, add those
14663 entries to the library path instead of the default "/lib" and
14666 2008-04-11 David S. Miller <davem@davemloft.net>
14668 * testsuite/justsyms.t: Start at 0x100.
14669 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
14670 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
14672 * testsuite/script_test_2.cc: Adjust string and section length
14675 2008-04-09 Ian Lance Taylor <iant@google.com>
14678 * script-sections.cc (Sections_element::allocate_to_segment): Add
14680 (Output_section_definition::allocate_to_segment): Likewise.
14681 (Orphan_output_section::allocate_to_segment): Likewise.
14682 (Script_sections::attach_sections_using_phdrs_clause): Don't
14683 propagate non-PT_LOAD segments to orphan sections.
14684 * testsuite/Makefile.am (script_test_3.stdout): Generate using
14685 readelf rather than objdump.
14686 * testsuite/script_test_3.sh: Adjust accordingly. Test that
14687 .interp section and PT_INTERP segment are the same size.
14688 * testsuite/Makefile.in: Rebuild.
14690 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
14691 aliases for symbols defined in the same object.
14692 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
14693 (weak_alias_test_SOURCES): New variable.
14694 (weak_alias_test_DEPENDENCIES): New variable.
14695 (weak_alias_test_LDFLAGS): New variable.
14696 (weak_alias_test_LDADD): New variable.
14697 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
14698 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
14699 (weak_alias_test_3.o): New target.
14700 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
14701 * testsuite/weak_alias_test_main.cc: New file.
14702 * testsuite/weak_alias_test_1.cc: New file.
14703 * testsuite/weak_alias_test_2.cc: New file.
14704 * testsuite/weak_alias_test_3.cc: New file.
14706 2008-04-08 Ian Lance Taylor <iant@google.com>
14708 * options.h (class General_options): Add --noinhibit-exec option.
14709 * main.cc (main): Check --noinhibit-exec.
14711 * options.h (class General_options): Define --wrap as a special
14712 option. Add wrap_symbols_ field.
14713 (General_options::any_wrap_symbols): New function.
14714 (General_options::is_wrap_symbol): New function.
14715 * options.cc (General_options::parse_wrap): New function.
14716 (General_options::General_options): Initialize wrap_symbols_.
14717 * symtab.cc (Symbol_table::wrap_symbol): New function.
14718 (Symbol_table::add_from_object): Handle --wrap.
14719 * symtab.h (class Symbol_table): Declare wrap_symbol.
14720 * target.h (Target::wrap_char): New function.
14721 (Target::Target_info): Add wrap_char field.
14722 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
14723 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14724 * testsuite/testfile.cc (Target_test::test_target_info):
14727 * errors.cc (Errors::undefined_symbol): Mention symbol version if
14730 * layout.h (class Layout): Add added_eh_frame_data_ field.
14731 * layout.cc (Layout::Layout): Initialize new field.
14732 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
14733 output section until we find a section we merged successfully.
14734 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
14735 that the size be non-zero.
14737 * merge.cc (Object_merge_map::get_output_offset): Remove inline
14740 2008-04-08 Craig Silverstein <csilvers@google.com>
14742 * configure.ac: Export new conditional variable HAVE_ZLIB.
14743 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
14745 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
14746 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14748 2008-04-07 Ian Lance Taylor <iant@google.com>
14750 * version.cc (version_string): Set to "1.5".
14752 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
14753 Add issued_non_pic_error_ field. Declare check_non_pic.
14754 (Target_x86_64::Scan::check_non_pic): New function.
14755 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
14756 (Target_x86_64::Scan::global): Likewise.
14758 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
14759 addend parameter. Change caller. Handle merge sections.
14760 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
14761 Address to Addend. Don't add in the result of
14762 local_section_offset, pass down the addend and use the returned
14764 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
14765 Update declarations of local_section_offset and symbol_value.
14766 * testsuite/two_file_test_1.cc (t18): New function.
14767 * testsuite/two_file_test_2.cc (f18): New function.
14768 * testsuite/two_file_test_main.cc (main): Call t18.
14769 * testsuite/two_file_test.h (t18, f18): Declare.
14771 * configure.ac: Don't test for objdump, c++filt, or readelf.
14772 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
14774 (TEST_READELF): New variable.
14775 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
14776 (check_PROGRAMS): Add two_file_strip_test.
14777 (two_file_strip_test): New target.
14778 (check_PROGRAMS): Add two_file_same_shared_strip_test.
14779 (two_file_same_shared_strip_test_SOURCES): New variable.
14780 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
14781 (two_file_same_shared_strip_test_LDFLAGS): New variable.
14782 (two_file_same_shared_strip_test_LDADD): New variable.
14783 (two_file_shared_strip.so): New target.
14784 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
14785 (ver_test_5.syms, ver_test_7.syms): Likewise.
14786 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
14787 (strip_test_3.stdout): Use TEST_OBJDUMP.
14788 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14790 2008-04-04 Cary Coutant <ccoutant@google.com>
14792 * symtab.h (Symbol::is_weak_undefined): New function.
14793 (Symbol::is_strong_undefined): New function.
14794 (Symbol::is_absolute): New function.
14795 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
14796 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
14798 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
14799 (weak_undef_test): New target.
14800 * testsuite/Makefile.in: Rebuild.
14801 * testsuite/weak_undef_file1.cc: New file.
14802 * testsuite/weak_undef_file2.cc: New file.
14803 * testsuite/weak_undef_test.cc: New file.
14805 2008-04-03 Craig Silverstein <csilvers@google.com>
14807 * compressed_output.h (class Output_compressed_section): Use
14809 * compressed_output.cc (zlib_compress): Use unsigned buffers,
14811 (zlib_compressed_suffix): Removed.
14812 (Output_compressed_section::set_final_data_size): Use unsigned
14814 * testsuite/Makefile.am (flagstest_compress_debug_sections):
14815 Fix linker invocation.
14816 (flagstest_o_specialfile_and_compress_debug_sections):
14818 * testsuite/Makefile.in: Regenerated.
14820 2008-04-02 David S. Miller <davem@davemloft.net>
14822 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
14823 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
14825 2008-04-02 Craig Silverstein <csilvers@google.com>
14829 2008-04-02 Ian Lance Taylor <iant@google.com>
14831 * fileread.cc (File_read::find_view): Add byteshift and vshifted
14832 parameters. Update for new key type to views_. Change all
14834 (File_read::read): Adjust for byteshift in returned view.
14835 (File_read::add_view): New function, broken out of
14836 find_and_make_view.
14837 (File_read::make_view): New function, broken out of
14838 find_and_make_view.
14839 (File_read::find_or_make_view): Add offset and aligned
14840 parameters. Rewrite accordingly. Change all callers.
14841 (File_read::get_view): Add offset and aligned parameters. Adjust
14842 for byteshift in return value.
14843 (File_read::get_lasting_view): Likewise.
14844 * fileread.h (class File_read): Update declarations.
14845 (class File_read::View): Add byteshift_ field. Add byteshift to
14846 constructor. Add byteshift method.
14847 * archive.h (Archive::clear_uncached_views): New function.
14848 (Archive::get_view): Add aligned parameter. Change all callers.
14849 * object.h (Object::get_view): Add aligned parameter. Change all
14851 (Object::get_lasting_view): Likewise.
14853 * fileread.cc (File_read::release): Don't call clear_views if
14854 there are multiple objects.
14855 * fileread.h (File_read::clear_uncached_views): New function.
14856 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
14859 2008-03-31 Cary Coutant <ccoutant@google.com>
14861 Add thin archive support.
14862 * archive.cc (Archive::armagt): New const.
14863 (Archive::setup): Remove task parameter and calls to unlock.
14864 (Archive::unlock_nested_archives): New function.
14865 (Archive::read_header): Add nested_off parameter. Change
14867 (Archive::interpret_header): Likewise.
14868 (Archive::include_all_members): Change to handle thin
14870 (Archive::include_member): Likewise.
14871 * archive.h (Archive::Archive): Add new parameters and
14873 (Archive::armagt): New const.
14874 (Archive::setup): Remove task parameter.
14875 (Archive::unlock_nested_archives): New function.
14876 (Archive::read_header): Add nested_off parameter.
14877 (Archive::interpret_header): Likewise.
14878 (Archive::Nested_archive_table): New typedef.
14879 (Archive::is_thin_archive_): New field.
14880 (Archive::nested_archives_): New field.
14881 (Archive::options_): New field.
14882 (Archive::dirpath_): New field.
14883 (Archive::task_): New field.
14884 * readsyms.cc (Read_symbols::do_read_symbols): Add check
14885 for thin archives. Pass additional parameters to
14886 Archive::Archive. Unlock the archive file after calling
14889 2008-03-29 Ian Lance Taylor <iant@google.com>
14891 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
14892 version symbol to be local.
14893 * testsuite/ver_test_4.sh: New file.
14894 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
14895 (check_DATA): Add ver_test_4.syms.
14896 (ver_test_4.syms): New target.
14897 * testsuite/Makefile.in: Rebuild.
14900 (Output_section::Input_section_sort_entry::has_priority): New
14902 (Output_section::Input_section_sort_entry::match_file_name): New
14904 (Output_section::Input_section_sort_entry::match_section_name):
14906 (Output_section::Input_section_sort_entry::match_section_name_prefix):
14908 (Output_section::Input_section_sort_entry::match_section_file):
14910 (Output_section::Input_section_sort_compare::operator()): Rewrite
14911 using new Input_section_sort_entry functions. Sort crtbegin and
14912 crtend first. Sort sections with no priority before sections with
14914 * testsuite/initpri1.c (d3): Check j != 4.
14915 (cd5): New constructor/destructor function.
14916 (main): Check j != 2.
14918 * symtab.cc (Symbol_table::add_from_object): If we don't use the
14919 new symbol when resolving, don't call set_is_default.
14920 * testsuite/ver_test_7.cc: New file.
14921 * testsuite/ver_test_7.sh: New file.
14922 * testsuite/Makefile.am (ver_test_7.so): New target.
14923 (ver_test_7.o): New target.
14924 (check_SCRIPTS): Add ver_test_7.sh.
14925 (check_DATA): Add ver_test_7.syms.
14926 (ver_test_7.syms): New target.
14928 2008-03-28 Ian Lance Taylor <iant@google.com>
14930 * layout.cc (Layout::layout): If we see an input section with a
14931 name that needs sorting, set the must_sort flag for the output
14933 (Layout::make_output_section): If the name of the output section
14934 indicates that it might require sorting, set the may_sort flag.
14935 * output.h (Output_section::may_sort_attached_input_sections): New
14937 (Output_section::set_may_sort_attached_input_sections): New
14939 (Output_section::must_sort_attached_input_sections): New
14941 (Output_section::set_must_sort_attached_input_sections): New
14943 (class Output_section): Declare Input_section_sort_entry. Define
14944 Input_section_sort_compare. Declare
14945 sort_attached_input_sections. Add new fields:
14946 may_sort_attached_input_sections_,
14947 must_sort_attached_input_sections_,
14948 attached_input_sections_are_sorted_.
14949 * output.cc (Output_section::Output_section): Initialize new
14951 (Output_section::add_input_section): Add an entry to
14952 input_sections_ if may_sort or must_sort are true.
14953 (Output_section::set_final_data_size): Call
14954 sort_attached_input_sections if necessary.
14955 (Output_section::Input_section_sort_entry): Define new class.
14956 (Output_section::Input_section_sort_compare::operator()): New
14958 (Output_section::sort_attached_input_sections): New function.
14959 * configure.ac: Check whether the compiler supports constructor
14960 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
14961 * testsuite/initpri1.c: New file.
14962 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
14963 CONSTRUCTOR_PRIORITY.
14964 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
14965 (initpri1_LDFLAGS): New variable.
14966 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14968 2008-03-27 Ian Lance Taylor <iant@google.com>
14970 * common.cc (Sort_commons::operator): Correct sorting algorithm.
14971 * testsuite/common_test_1.c: New file.
14972 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
14973 (common_test_1_SOURCES): New variable.
14974 (common_test_1_DEPENDENCIES): New variable.
14975 (common_test_1_LDFLAGS): New variable.
14977 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
14978 and commons_ correctly when NAME/VERSION does not override
14980 * testsuite/ver_test_6.c: New file.
14981 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
14982 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
14983 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
14985 2008-03-26 Ian Lance Taylor <iant@google.com>
14987 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
14988 of an undefined symbol from a version script.
14989 * testsuite/Makefile.am (ver_test_5.so): New target.
14990 (ver_test_5.o): New target.
14991 (check_SCRIPTS): Add ver_test_5.sh.
14992 (check_DATA): Add ver_test_5.syms.
14993 (ver_test_5.syms): New target.
14994 * testsuite/ver_test_5.cc: New file.
14995 * testsuite/ver_test_5.script: New file.
14996 * testsuite/ver_test_5.sh: New file.
14997 * Makefile.in, testsuite/Makefile.in: Rebuild.
15000 Fix problems building gold with gcc 4.3.0.
15001 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
15002 (gold_error_at_location, gold_warning_at_location): Use it.
15003 * configure.ac: Check whether we can compile and use a template
15004 function with a printf attribute.
15005 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
15006 when jumping over bytes.
15007 * object.cc: Instantiate Object::read_section_data.
15008 * debug.h: Include <cstring>
15009 * dwarf_reader.cc: Include <algorithm>
15010 * main.cc: Include <cstring>.
15011 * options.cc: Include <cstring>.
15012 * output.cc: Include <cstring>.
15013 * script.cc: Include <cstring>.
15014 * script.h: Include <string>.
15015 * symtab.cc: Include <cstring> and <algorithm>.
15016 * target-select.cc: Include <cstring>.
15017 * version.cc: Include <string>.
15018 * testsuite/testmain.cc: Include <cstdlib>.
15019 * configure, config.in: Rebuild.
15021 2008-03-25 Ian Lance Taylor <iant@google.com>
15023 * options.cc: Include "../bfd/bfdver.h".
15024 (options::help): Print bug reporting address.
15026 * version.cc (print_version): Adjust output for current value of
15027 BFD_VERSION_STRING.
15031 * options.cc (options::help): Print list of supported targets.
15032 * target-select.h: Include <vector>.
15033 (class Target_selector): Make machine_, size_, and is_big_endian_
15034 fields const. Add bfd_name_ and instantiated_target_ fields.
15035 (Target_selector::Target_selector): Add bfd_name parameter.
15036 (Target_selector::recognize): Make non-virtual, call
15038 (Target_selector::recognize_by_name): Make non-virtual, call
15039 do_recognize_by_name.
15040 (Target_selector::supported_names): New function.
15041 (Target_selector::bfd_name): New function.
15042 (Target_selector::do_instantiate_target): New pure virtual
15044 (Target_selector::do_recognize): New virtual function.
15045 (Target_selector::do_recognize_by_name): New virtual function.
15046 (Target_selector::instantiate_target): New private function.
15047 (supported_target_names): Declare.
15048 * target-select.cc (Target_selector::Target_selector): Update for
15049 new parameter and fields.
15050 (select_target_by_name): Check that the name matches before
15051 calling recognize_by_name.
15052 (supported_target_names): New function.
15053 * i386.cc (class Target_selector_i386): Update Target_selector
15054 constructor call. Remove recognize and recognize_by_name. Add
15055 do_instantiate_target.
15056 * x86_64.cc (class Target_selector_x86_64): Likewise.
15057 * testsuite/testfile.cc (class Target_selector_test): Update for
15058 changes to Target_selector.
15060 * README: Rewrite, with some notes on unsupported features.
15062 2008-03-24 Cary Coutant <ccoutant@google.com>
15064 * i386.cc (Target_i386::Got_type): New enum declaration.
15065 (Target_i386::Scan::local): Updated callers of Output_data_got
15067 (Target_i386::Scan::global): Likewise.
15068 (Target_i386::Relocate::relocate): Likewise.
15069 (Target_i386::Relocate::relocate_tls): Likewise.
15070 * object.h (Got_offset_list): New class.
15071 (Sized_relobj::local_has_got_offset): Added got_type parameter.
15072 (Sized_relobj::local_got_offset): Likewise.
15073 (Sized_relobj::set_local_got_offset): Likewise.
15074 (Sized_relobj::local_has_tls_got_offset): Removed.
15075 (Sized_relobj::local_tls_got_offset): Removed.
15076 (Sized_relobj::set_local_tls_got_offset): Removed.
15077 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
15078 * output.cc (Output_data_got::add_global): Added got_type parameter.
15079 (Output_data_got::add_global_with_rel): Likewise.
15080 (Output_data_got::add_global_with_rela): Likewise.
15081 (Output_data_got::add_global_pair_with_rel): New function.
15082 (Output_data_got::add_global_pair_with_rela): New function.
15083 (Output_data_got::add_local): Added got_type parameter.
15084 (Output_data_got::add_local_with_rel): Likewise.
15085 (Output_data_got::add_local_with_rela): Likewise.
15086 (Output_data_got::add_local_pair_with_rel): New function.
15087 (Output_data_got::add_local_pair_with_rela): New function.
15088 (Output_data_got::add_global_tls): Removed.
15089 (Output_data_got::add_global_tls_with_rel): Removed.
15090 (Output_data_got::add_global_tls_with_rela): Removed.
15091 (Output_data_got::add_local_tls): Removed.
15092 (Output_data_got::add_local_tls_with_rel): Removed.
15093 (Output_data_got::add_local_tls_with_rela): Removed.
15094 * output.h (Output_data_got::add_global): Added got_type parameter.
15095 (Output_data_got::add_global_with_rel): Likewise.
15096 (Output_data_got::add_global_with_rela): Likewise.
15097 (Output_data_got::add_global_pair_with_rel): New function.
15098 (Output_data_got::add_global_pair_with_rela): New function.
15099 (Output_data_got::add_local): Added got_type parameter.
15100 (Output_data_got::add_local_with_rel): Likewise.
15101 (Output_data_got::add_local_with_rela): Likewise.
15102 (Output_data_got::add_local_pair_with_rel): New function.
15103 (Output_data_got::add_local_pair_with_rela): New function.
15104 (Output_data_got::add_global_tls): Removed.
15105 (Output_data_got::add_global_tls_with_rel): Removed.
15106 (Output_data_got::add_global_tls_with_rela): Removed.
15107 (Output_data_got::add_local_tls): Removed.
15108 (Output_data_got::add_local_tls_with_rel): Removed.
15109 (Output_data_got::add_local_tls_with_rela): Removed.
15110 * resolve.cc (Symbol::override_base_with_special): Removed
15111 reference to has_got_offset_ field.
15112 * symtab.cc (Symbol::init_fields): Replaced initialization
15113 of got_offset_ with got_offsets_. Removed initialization
15115 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
15116 (Symbol::got_offset): Likewise.
15117 (Symbol::set_got_offset): Likewise.
15118 (Symbol::has_tls_got_offset): Removed.
15119 (Symbol::tls_got_offset): Removed.
15120 (Symbol::set_tls_got_offset): Removed.
15121 (Symbol::got_offset_): Removed.
15122 (Symbol::tls_mod_got_offset_): Removed.
15123 (Symbol::tls_pair_got_offset_): Removed.
15124 (Symbol::got_offsets_): New field.
15125 (Symbol::has_got_offset): Removed.
15126 (Symbol::has_tls_mod_got_offset): Removed.
15127 (Symbol::has_tls_pair_got_offset): Removed.
15128 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
15129 (Target_x86_64::Scan::local): Updated callers of Output_data_got
15131 (Target_x86_64::Scan::global): Likewise.
15132 (Target_x86_64::Relocate::relocate): Likewise.
15133 (Target_x86_64::Relocate::relocate_tls): Likewise.
15135 2008-03-25 Ben Elliston <bje@au.ibm.com>
15137 * yyscript.y: Fix spelling error in comment.
15139 2008-03-24 Ian Lance Taylor <iant@google.com>
15141 * options.h (class General_options): Define build_id option.
15142 * layout.h (class Layout): Declare write_build_id, create_note,
15143 create_build_id. Add build_id_note_ member.
15144 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
15145 "libiberty.h", "md5.h", "sha1.h".
15146 (Layout::Layout): Initialize eh_frame_data_,
15147 eh_frame_hdr_section_, and build_id_note_.
15148 (Layout::finalize): Call create_build_id.
15149 (Layout::create_note): New function, broken out of
15150 Layout::create_gold_note.
15151 (Layout::create_gold_note): Call create_note.
15152 (Layout::create_build_id): New function.
15153 (Layout::write_build_id): New function.
15154 (Close_task_runner::run): Call write_build_id.
15156 * x86_64.cc: Correct license to GPLv3.
15158 2008-03-23 Ian Lance Taylor <iant@google.com>
15160 * options.cc: Include "demangle.h".
15161 (parse_optional_string): New function.
15162 (parse_long_option): Handle takes_optional_argument.
15163 (parse_short_option): Update dash_z initializer. Handle
15164 takes_optional_argument.
15165 (General_options::General_options): Initialize do_demangle_.
15166 (General_options::finalize): Set do_demangle_. Handle demangling
15168 * options.h (parse_optional_string): Declare.
15169 (struct One_option): Add optional_arg field. Update constructor.
15170 Update call constructor calls. Add takes_optional_argument
15172 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
15173 (DEFINE_optional_string): Define.
15174 (General_options::demangle): Change from DEFINE_bool to
15175 DEFINE_optional_string.
15176 (General_options::no_demangle): New function.
15177 (General_options::do_demangle): New function.
15178 (General_options::set_do_demangle): New function.
15179 (General_options::execstack_status_): Move definition to end of
15181 (General_options::static_): Likewise.
15182 (General_options::do_demangle_): New field.
15183 * object.cc (big_endian>::get_symbol_location_info): Call
15184 Options::do_demangle, not Options::demangle.
15185 * symtab.cc (demangle): Likewise.
15187 2008-03-22 Ian Lance Taylor <iant@google.com>
15189 * gold.h: Include <cstddef> and <sys/types.h>
15190 * options.h: Include <cstring>.
15192 2008-03-21 Ian Lance Taylor <iant@google.com>
15194 * Added source code to GNU binutils.
15196 Copyright (C) 2008-2013 Free Software Foundation, Inc.
15198 Copying and distribution of this file, with or without modification,
15199 are permitted in any medium without royalty provided the copyright
15200 notice and this notice are preserved.
15206 version-control: never