1 2013-10-31 Cary Coutant <ccoutant@google.com>
3 Restore support for dwp v2 DWARF package file format.
5 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
6 tu_length parameter. Adjust all callers.
7 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
8 * dwp.cc: Include dwarf.h.
9 (Section_bounds): New struct type.
10 (Unit_set): New struct type.
11 (Dwo_file::Dwo_file): Initialize new data member.
12 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
13 Combine and rename to...
14 (Dwo_file::read_unit_index): ...this.
15 (Dwo_file::sized_read_compunit_index)
16 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
17 (Dwo_file::sized_read_unit_index): ...this.
18 (Dwo_file::copy_section): Remove section_name, is_str_offsets
19 parameters; add section_id parameter.
20 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
21 (Dwo_file::add_unit_set): ...this.
22 (Dwo_file::shndx_map_): Remove.
23 (Dwo_file::sect_offsets_): New data member.
24 (Dwp_output_file::Dwp_output_file): Initialize new data members.
25 (Dwp_output_file::add_section): Rename to...
26 (Dwp_output_file::add_contribution): ...this.
27 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
28 (Dwp_output_file::add_tu_set): Likewise.
29 (Dwp_output_file::Contribution): New type.
30 (Dwp_output_file::Section::contributions): New data member.
31 (Dwp_output_file::Cu_or_tu_set): Remove.
32 (Dwp_output_file::Section::Section): New ctor.
33 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
34 (Dwp_output_file::Dwp_index::Section_table): New type.
35 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
36 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
38 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
39 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
40 (Dwp_output_file::Dwp_index::section_table): New member function.
41 (Dwp_output_file::Dwp_index::section_table_end): New member function.
42 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
43 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
44 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
45 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
46 (Dwp_output_file::Dwp_index::section_table_): New data member.
47 (Dwp_output_file::Dwp_index::section_mask_): New data member.
48 (Dwp_output_file::add_output_section): New member function.
49 (Dwp_output_file::write_new_section): New member function.
50 (Dwp_output_file::write_contributions): New member function.
51 (Dwp_output_file::section_id_map_): New data member.
52 (class Dwo_id_info_reader): Remove.
53 (class Unit_reader): New class.
54 (get_dwarf_section_name): New function.
55 (Dwo_file::read_executable): Adjust initializations of class data.
56 (Dwo_file::read): Add support for v2 package file format.
57 (Dwo_file::read_unit_index): Likewise.
58 (Dwo_file::sized_read_unit_index): Likewise.
59 (Dwo_file::copy_section): Likewise.
60 (Dwo_file::add_unit_set): Likewise.
61 (Dwp_output_file::add_output_section): Likewise.
62 (Dwp_output_file::add_contribution): Likewise.
63 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
65 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
67 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
69 (Dwp_output_file::initialize): Remove unused function.
70 (Dwp_output_file::finalize): Add support for v2 package file format.
71 (Dwp_output_file::write_index): Likewise.
72 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
75 2013-10-31 Cary Coutant <ccoutant@google.com>
77 * configure.ac: Fix check for -fmerge-constants.
78 * configure.ac: Regenerate.
80 2013-10-30 Roland McGrath <mcgrathr@google.com>
82 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
83 Correct 9-byte nop sequence to match what the assembler generates.
85 2013-10-30 Alan Modra <amodra@gmail.com>
87 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
88 ppc64_local_entry_offset, ppc64_local_entry_offset,
89 do_read_symbols): New functions.
90 (Powerpc_relobj::e_flags_, st_other_): New vars.
91 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
92 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
93 (Powerpc_relobj::e_flags_): New var.
94 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
96 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
97 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
98 (Powerpc_dynobj::do_find_special_sections): Likewise.
99 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
100 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
101 to ELFv2 local entry.
102 (Target_powerpc::do_relax): No thread safe barriers needed for
104 (Output_data_plt_powerpc::initial_plt_entry_size_,
105 plt_entry_size): Delete. Replace all uses with
106 first_plt_entry_offset() and plt_entry_size().
107 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
108 reserved_size parm. Update callers.
109 (Output_data_plt_powerpc::entry_count): Update.
110 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
111 and use Target_powerpc::first_plt_entry_offset().
112 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
113 rename to plt_entry_size.
114 (Output_data_plt_powerpc::add_ifunc_entry,
115 add_local_ifunc_entry): Adjust reloc for ELFv2.
116 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
117 (glink_eh_frame_fde_64v2): New.
118 (Stub_table::plt_call_size): Support ELFv2 sizing.
119 (Output_data_glink::add_eh_frame): Use the new FDE.
120 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
121 (Stub_table::do_write): Write ELFv2 stubs and glink.
122 (Target_powerpc::Relocate::relocate): Replaces nop after call
123 with ld 2,24(1) and adjust local offset destination for ELFv2.
125 2013-10-30 Alan Modra <amodra@gmail.com>
127 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
128 (Target_powerpc::Scan::global, local): Likewise.
129 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
130 on all ppc64 @h and @ha relocs.
132 2013-10-14 Alan Modra <amodra@gmail.com>
134 * output.h (Output_data_got::add_constant): Tidy.
135 (Output_data_got::add_constant_pair): New function.
136 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
137 methods used so as to first call reserve_ent().
139 2013-10-11 Roland McGrath <mcgrathr@google.com>
141 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
142 add_got_entry and add_got_entry_pair.
144 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
145 (HAVE_PUBNAMES): Likewise.
146 * configure: Regenerate.
148 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
149 * testsuite/Makefile.in: Regenerate.
151 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
152 Remove const from declaration.
153 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
154 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
155 * output.h (Output_file_header): Remove const from member target_
156 and corresponding constructor argument.
157 * output.cc (Output_file_header::Output_file_header): Update prototype.
158 (Output_file_header::do_sized_write): Use this->target_ in place
159 of parameters()->target().
161 * testsuite/undef_symbol.cc (Foo::get_a): New method.
163 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
164 * configure: Regenerate.
165 * Makefile.in: Regenerate.
166 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
167 * testsuite/merge_string_literals_2.c: Likewise.
168 * testsuite/Makefile.am
169 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
170 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
171 literal -fmerge-constants.
172 * testsuite/Makefile.in: Regenerate.
174 * i386.cc (Target_i386): Remove unused member dynbss_.
175 * arm.cc (Target_arm): Likewise.
176 * powerpc.cc (Target_powerpc): Likewise.
177 * sparc.cc (Target_sparc): Likewise.
178 * tilegx.cc (Target_tilegx): Likewise.
179 * x86_64.cc (Target_x86_64): Likewise.
180 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
181 type_signature_, type_offset_.
182 * plugin.h (Plugin_hook): Remove unused member layout_.
183 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
185 (Read_member): Remove unused members input_objects_, symtab_,
187 (Check_library): Remove unused member symtab_.
188 * archive.h (Lib_group): Remove unused member lib_.
189 * archive.cc (Lib_group::Lib_group): Update initializer.
190 * incremental.h (Incremental_binary): Remove unused member target_.
191 (Incremental_script_entry): Removed unused member script_.
192 * layout.h (Write_symbols_task): Remove unused member input_objects_.
193 * icf.h (Icf): Remove unused member num_tracked_relocs.
195 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
196 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
198 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
200 * archive.h: Use struct rather than class for forward declaration
201 of Read_symbols_data.
203 2013-10-07 Cary Coutant <ccoutant@google.com>
206 * testsuite/Makefile.am (icf_test): Fix dependencies.
207 (icf_safe_test): Likewise.
208 (icf_safe_so_test): Likewise.
209 (large_symbol_alignment): Add empty _LDADD rule.
210 * testsuite/Makefile.in: Regenerate.
212 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
215 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
216 relocation for R_X86_64_32 on x32.
218 2013-08-27 Roland McGrath <mcgrathr@google.com>
220 * output.cc (Output_segment::set_section_addresses): Take new
221 Target* argument. If target->isolate_execinstr() and the segment
222 is executable and starts at a target->abi_pagesize() boundary,
223 pad its end out to a target->abi_pagesize() boundary with code fill.
224 * output.h (Output_segment::set_section_addresses): Update decl.
225 * layout.h (Layout::check_output_data_for_reset_values): Take new
226 argument RELAX_OUTPUTS.
227 (Layout): New member relax_output_list_.
228 (Layout::add_relax_output): New method.
229 * layout.cc (Layout::Layout): Update constructor.
230 (Layout::reset_relax_output): New method.
231 (Layout::clean_up_after_relaxation): Call it.
232 (Layout::prepare_for_relaxation): Update caller.
233 (Layout::set_segment_offsets): Update callers of set_section_addresses.
234 Call reset_relax_output before re-processing segments for
235 isolate_execinstr case.
236 (Layout::write_data): Handle relax_output_list_.
237 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
238 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
240 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
243 * object.h: Fix typos.
245 2013-08-16 Roland McGrath <mcgrathr@google.com>
247 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
248 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
250 2013-08-07 Cary Coutant <ccoutant@google.com>
252 Revert support for v2 DWP files:
254 2013-03-01 Cary Coutant <ccoutant@google.com>
256 Add dwp support for v2 DWARF package file format.
257 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
258 tu_length parameter. Adjust all callers.
259 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
260 * dwp.cc: Include dwarf.h.
261 (Section_bounds): New struct type.
262 (Unit_set): New struct type.
263 (Dwo_file::Dwo_file): Initialize new data member.
264 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
265 Combine and rename to...
266 (Dwo_file::read_unit_index): ...this.
267 (Dwo_file::sized_read_compunit_index)
268 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
269 (Dwo_file::sized_read_unit_index): ...this.
270 (Dwo_file::copy_section): Remove section_name, is_str_offsets
271 parameters; add section_id parameter.
272 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
273 (Dwo_file::add_unit_set): ...this.
274 (Dwo_file::shndx_map_): Remove.
275 (Dwo_file::sect_offsets_): New data member.
276 (Dwp_output_file::Dwp_output_file): Initialize new data members.
277 (Dwp_output_file::add_section): Rename to...
278 (Dwp_output_file::add_contribution): ...this.
279 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
280 (Dwp_output_file::add_tu_set): Likewise.
281 (Dwp_output_file::Contribution): New type.
282 (Dwp_output_file::Section::contributions): New data member.
283 (Dwp_output_file::Cu_or_tu_set): Remove.
284 (Dwp_output_file::Section::Section): New ctor.
285 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
286 (Dwp_output_file::Dwp_index::Section_table): New type.
287 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
288 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
290 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
291 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
292 (Dwp_output_file::Dwp_index::section_table): New member function.
293 (Dwp_output_file::Dwp_index::section_table_end): New member function.
294 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
295 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
296 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
297 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
298 (Dwp_output_file::Dwp_index::section_table_): New data member.
299 (Dwp_output_file::Dwp_index::section_mask_): New data member.
300 (Dwp_output_file::add_output_section): New member function.
301 (Dwp_output_file::write_new_section): New member function.
302 (Dwp_output_file::write_contributions): New member function.
303 (Dwp_output_file::section_id_map_): New data member.
304 (class Dwo_id_info_reader): Remove.
305 (class Unit_reader): New class.
306 (get_dwarf_section_name): New function.
307 (Dwo_file::read_executable): Adjust initializations of class data.
308 (Dwo_file::read): Add support for v2 package file format.
309 (Dwo_file::read_unit_index): Likewise.
310 (Dwo_file::sized_read_unit_index): Likewise.
311 (Dwo_file::copy_section): Likewise.
312 (Dwo_file::add_unit_set): Likewise.
313 (Dwp_output_file::add_output_section): Likewise.
314 (Dwp_output_file::add_contribution): Likewise.
315 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
317 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
319 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
321 (Dwp_output_file::initialize): Remove unused function.
322 (Dwp_output_file::finalize): Add support for v2 package file format.
323 (Dwp_output_file::write_index): Likewise.
324 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
327 2013-07-31 Cary Coutant <ccoutant@google.com>
329 * object.cc (Sized_relobj::do_output_section_address): New function.
330 (Sized_relobj): Instantiate explicitly.
331 * object.h (Object::output_section_address): New function.
332 (Object::do_output_section_address): New function.
333 (Sized_relobj::do_output_section_address): New function.
334 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
336 2013-07-30 Cary Coutant <ccoutant@google.com>
337 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
339 * parameters.cc (Parameters::entry): Return target-specific entry
341 * target.h (Target::entry_symbol_name): New function.
342 (Target_info::entry_symbol_name): New data member.
344 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
345 * i386.cc (Target_i386::i386_info): Likewise.
346 (Target_i386_nacl::i386_nacl_info): Likewise.
347 * sparc.cc (Target_sparc::sparc_info): Likewise.
348 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
349 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
350 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
351 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
353 2013-07-22 Sterling Augustine <saugustine@google.com>
355 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
356 Convert parameter shndx to local variable. Add parameters symtab
357 and symtab_size. Scan over section names. Find relocation
358 section corresponding to current section. Create and initialize
359 reloc_mapper_ and reloc_type_.
360 (Dwarf_pubnames_table::read_header): Add assertion. Change
361 unit_length to off_t. Initialize member unit_length_. Fill in field
363 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
364 Initialize new fields unit_length_ and cu_offset_.
365 (Dwarf_pubnames_table::read_section): Update prototype.
366 (Dwarf_pubnames_table::cu_offset): New member function.
367 (Dwarf_pubnames_table::subsection_size): Likewise.
368 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
370 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
371 member functions public.
372 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
373 Update comment. Rework logic. Move repeated parts to...
374 (Gdb_index_info_reader::read_pubtable): ...here. New function.
375 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
376 pubtypes_table_, and stmt_list_offset.
377 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
378 Gdb_index::find_pubtype_offset,
379 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
380 (Gdb_index::pubnames_read): Update prototype and rework logic.
381 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
383 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
384 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
385 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
386 Gdb_index::map_pubtable_to_dies):
388 (Gdb_index::pubnames_read): Update declaration.
389 (Gdb_index::Pubname_offset_map): New type.
390 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
391 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
392 Gdb_index::stmt_list_offset): Declare.
393 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
394 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
395 Gdb_index::pubtypes_offset_): Remove.
397 2013-07-19 Roland McGrath <mcgrathr@google.com>
399 * options.h (General_options): Add -Trodata-segment option.
400 * parameters.cc (Parameters::check_rodata_segment): New function.
401 (Parameters::set_target_once): Call it.
402 * parameters.h (Parameters): Declare it (private member function).
403 * layout.cc (load_seg_unusable_for_headers): New function, broken
404 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
405 then validate rodata segment rather than text segment.
406 (relaxation_loop_body): Call that.
407 (is_text_segment): New function. Don't admit a non-executable
408 segment if TARGET->isolate_execinstr().
409 (set_segment_offsets): Call it. Honor -Trodata-segment option.
411 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
414 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
415 * nacl.h (Sniff_file::View::View): Request aligned view.
417 2013-07-11 Cary Coutant <ccoutant@google.com>
419 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
420 correct BRLT entry size.
422 2013-07-03 Alan Modra <amodra@gmail.com>
424 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
427 2013-07-01 Cary Coutant <ccoutant@google.com>
429 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
431 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
432 (Dwarf_ranges_table::lookup_reloc): New function.
433 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
435 (Dwarf_ranges_table::lookup_reloc): New function.
436 (Dwarf_ranges_table::reloc_type_): New data member.
438 2013-06-27 Jing Yu <jingyu@google.com>
441 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
443 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
444 (Target_powerpc::do_relax): Call the above.
446 2013-06-27 Cary Coutant <ccoutant@google.com>
448 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
449 on garbage collected .opd section.
451 2013-06-27 Alan Modra <amodra@gmail.com>
453 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
455 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
456 (Target_powerpc::do_function_location): Likewise for loc->shndx.
458 2013-06-14 Cary Coutant <ccoutant@google.com>
460 * resolve.cc (Symbol::override_base): Don't override st_type
461 from plugin placeholder symbols.
462 (Symbol_table::resolve): Likewise.
463 (Symbol_table::should_override): Don't complain about TLS mismatch
464 if the TO symbol is a plugin placeholder.
465 * testsuite/Makefile.am (plugin_test_tls): New test.
466 * testsuite/Makefile.in: Regenerate.
467 * testsuite/plugin_test_tls.sh: New test script.
468 * testsuite/two_file_test_2_tls.cc: New test source.
469 * testsuite/two_file_test_tls.cc: New test source.
471 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
473 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
474 the maximum segment alignment is larger than the page size.
475 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
476 correctly aligns the symbols with large alignemnt.
477 * testsuite/Makefile.in: Regenerate.
478 * testsuite/large_symbol_alignment.cc: New file.
480 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
481 Sriraman Tallam <tmsriram@google.com>
483 * options.h (sort_section): New option.
484 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
485 Rename from Input_section_sort_section_name_special_ordering_compare.
486 (Input_section_sort_section_name_compare): New struct.
487 * output.cc (Output_section::Input_section_sort_section_name_compare::
488 operator()): New function.
489 (Output_section::sort_attached_input_sections): Use new sort function
490 for .text if --sort-section=name is specified.
491 * layout.cc (Layout::make_output_section):
492 Add sorting by name when --sort-section=name is specified.
493 * testsuite/Makefile.am (text_section_grouping): Test option
495 * testsuite/Makefile.in: Regenerate.
496 * testsuite/section_sorting_name.cc: New file.
497 * testsuite/section_sorting_name.sh: New file.
499 2013-05-21 Cary Coutant <ccoutant@google.com>
501 * symtab.h (Symbol::is_cxx_vtable): New function.
502 * target-reloc.h (relocate_section): Check for vtable symbol.
503 * testsuite/Makefile.am (missing_key_func.sh): New test case.
504 * testsuite/Makefile.in: Regenerate.
505 * testsuite/missing_key_func.cc: New test source.
506 * testsuite/missing_key_func.sh: New test script.
508 2013-05-21 Cary Coutant <ccoutant@google.com>
510 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
511 type of enclosing symbol.
512 (Relocate_info::location): Check symbol type when describing symbol.
513 * object.h (Symbol_location_info): Remove unused line_number;
514 add enclosing_symbol_type.
515 * testsuite/debug_msg.sh: Adjust expected output.
517 2013-05-13 Cary Coutant <ccoutant@google.com>
519 * configure.ac: Export DEFAULT_TARGET.
520 * configure: Regenerate.
521 * Makefile.in: Regenerate.
522 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
523 * testsuite/Makefile.in: Regenerate.
524 * testsuite/debug_msg.sh: Delete duplicate tests.
525 Don't check undef_int error message match for powerpc where the
526 source file and line number aren't available.
528 2013-05-10 Roland McGrath <mcgrathr@google.com>
530 * options.h (General_options): Add --rosegment-gap option.
531 * options.cc (finalize): --rosegment-gap implies --rosegment.
532 * layout.cc (set_segment_offsets): Let user option override
533 target->rosegment_gap().
535 2013-05-10 Roland McGrath <mcgrathr@google.com>
537 * options.h (General_options): Remove leading space from help
538 messages for -nostdlib and --rosegment.
540 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
543 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
545 2013-05-03 Alan Modra <amodra@gmail.com>
547 * merge.cc (Output_merge_string::do_add_input_section): Correct
548 scan for number of strings. Rename vars to avoid shadowing.
549 Include missing terminator in input_size_.
551 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
553 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
554 Restore empty string handling.
556 2013-05-01 Cary Coutant <ccoutant@google.com>
558 * stringpool.cc (Stringpool_template::new_key_offset): Fix
559 uninitialized warning.
561 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
563 * output.cc (Output_section::add_merge_input_section): Allow
564 to merge sections if the alignment is more than character size.
565 * merge.h (Output_merge_string::Output_merge_string): Remove
567 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
568 only not-null strings. Check the alignment of strings.
570 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
571 alignment as the argument.
572 (Stringpool_template<Stringpool_char>::addralign_): New class member.
573 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
574 Align non-zero length strings according to the addralign_.
575 (Stringpool_template<Stringpool_char>::set_string_offsets):
576 Updating offsets according to the given alignment.
577 * testsuite/Makefile.am (text_section_grouping): Test if string
578 literals are getting merged.
579 * testsuite/Makefile.in: Regenerate.
580 * testsuite/merge_string_literals_1.c: New file.
581 * testsuite/merge_string_literals_2.c: Ditto.
582 * testsuite/merge_string_literals.sh: Ditto.
584 2013-04-26 Ian Lance Taylor <iant@google.com>
586 * target-reloc.h (relocate_section): If the reloc offset is out of
587 range, pass VIEW as NULL to relocate.relocate.
588 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
589 * i386.cc (Target_i386::Relocate::relocate): Likewise.
590 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
591 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
592 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
593 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
595 2013-04-26 Geoff Pike <gpike@chromium.org>
597 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
598 * layout.cc (Hash_task): New class.
599 (Layout::queue_build_id_tasks): New function.
600 (Layout::write_build_id): Handle single-thread portion of build ID
601 computation. (In some cases, all of it is single-threaded.) Replace
602 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
603 functionality in fewer lines of code.
604 * layout.h (Layout::queue_build_id_tasks): New function declaration.
605 * options.h (General_options): make "--build-id" default to tree
606 rather than sha1. Add two new options related to --build-id=tree:
607 --build-id-chunk-size-for-treehash and
608 --build-id-min-file-size-for-treehash.
609 * Makefile.am: add testing of --build-id=tree and related new options
610 (these tests will be invoked by "make check").
611 * Makefile.in: Regenerate.
613 2013-04-25 Alan Modra <amodra@gmail.com>
615 * configure.tgt: Add powerpcle and powerpc64le.
617 2013-04-22 Alan Modra <amodra@gmail.com>
620 * layout.cc (Layout::segment_precedes): Allow more than one
621 segment with the same type and flags.
623 2013-04-15 Cary Coutant <ccoutant@google.com>
625 * layout.cc (Layout::set_relocatable_section_offsets): Don't
626 allocate space in file for BSS sections.
628 2013-04-15 Cary Coutant <ccoutant@google.com>
630 * script-sections.cc (Orphan_output_section): Reset address
631 to zero after each orphaned section for relocatable links.
633 2013-04-15 Cary Coutant <ccoutant@google.com>
635 * symtab.cc (Symbol_table::sized_write_globals): Subtract
636 section starting address for relocatable link.
637 * testsuite/Makefile.am (script_test_11): New test.
638 * testsuite/Makefile.in: Regenerate.
639 * testsuite/script_test_11.c: New source file.
640 * testsuite/script_test_11.t: New linker script.
642 2013-04-13 Alan Modra <amodra@gmail.com>
644 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
645 owner when sections are not adjacent and exceed group size.
646 (Target_powerpc::group_sections): Handle corner case.
647 (Target_powerpc::Branch_info::make_stub): Handle case where
648 stub table doesn't exist due to branches in non-exec sections.
649 (Target_powerpc::Relocate::relocate): Likewise.
651 2013-04-11 Alan Modra <amodra@gmail.com>
654 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
655 .branch_lt to match bfd ld. Adjust comments throughout file.
657 2013-04-04 Ian Lance Taylor <iant@google.com>
660 * object.cc (do_layout_deferred_sections): Handle .eh_frame
661 sections before checking whether they are included in the link.
663 2013-03-29 Sriraman Tallam <tmsriram@google.com>
665 * archive.cc (Archive::get_elf_object_for_member): Create the elf
666 object before calling the plugin claim_file handler. Pass the elf
667 object of the archive to the plugin. Delete the elf object if the
668 plugin claims the file.
670 2013-03-21 Alan Modra <amodra@gmail.com>
672 * layout.cc (Layout::set_segment_offsets): Accept writable .text
675 2013-03-21 Alan Modra <amodra@gmail.com>
677 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
679 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
680 uninitialized" warning.
682 2013-03-20 Alan Modra <amodra@gmail.com>
684 * symtab.h (Symbol::clear_version): New function.
685 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
686 is_needed by weak references. Clear version for symbols defined
687 in as-needed objects that are not needed.
689 2013-03-15 Alan Modra <amodra@gmail.com>
691 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
692 static and public. Add report_err param. Return false for data refs.
693 (Target_powerpc::rela_dyn_section): New overloaded function.
694 (Target_powerpc::plt_, iplt_): Elucidate.
695 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
696 (Output_data_plt_powerpc::do_write): Don't write .iplt.
697 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
698 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
699 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
700 push_branch and make_plt_entry for ifunc syms when
701 reloc_needs_plt_for_ifunc.
702 (Target_powerpc::Relocate::relocate): Don't use plt entry value
703 for ifunc unless reloc_needs_plt_for_ifunc.
705 2013-03-15 Alan Modra <amodra@gmail.com>
707 * gc.h (gc_process_relocs): Don't look through function descriptors.
708 * icf.cc (get_section_contents): Do so here instead.
710 2013-03-13 Alan Modra <amodra@gmail.com>
712 * powerpc.cc (is_branch_reloc): Forward declare.
713 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
714 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
715 false for 64-bit, true for 32-bit non-branch relocs.
716 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
717 * testsuite/Makefile.am (icf_test): Use linker map file instead of
719 (icf_safe_test): Generate linker map file as well as nm output.
720 (icf_safe_so_test): Likewise.
721 * testsuite/Makefile.in: Regenerate.
722 * testsuite/icf_test.sh: Parse linker map file to determine
724 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
725 * testsuite/icf_safe_so_test.sh: Likewise.
726 (X86_32_or_ARM_specific_safe_fold): Merge into..
727 (arch_specific_safe_fold): ..this.
728 (X86_64_specific_safe_fold): Delete unused function.
730 2013-03-12 Alan Modra <amodra@gmail.com>
732 * gc.h (gc_process_relocs): Look through function descriptors
733 to determine shndx, symvalue and addend used by ICF. Tidy
734 variable duplication.
736 2013-03-11 Alan Modra <amodra@gmail.com>
738 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
739 * layout.cc (Layout_task_runner::run): ..to here.
740 * symtab.h (struct Symbol_location): Extract from..
741 (class Symbol_table): ..here.
742 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
743 * target.h (class Target): Add function_location and
744 do_function_location functions.
745 (class Sized_target): Add do_function_location.
746 * object.h (class Sized_relobj_file): Move find_shdr..
747 (class Object): ..to here.
748 * object.cc: Likewise. Update to suit. Instantiate.
749 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
750 * powerpc.cc (class Powerpc_dynobj): New.
751 (Target_powerpc::do_function_location): New function.
752 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
753 (Powerpc_dynobj::do_read_symbols): New function.
754 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
756 2013-03-08 Ian Lance Taylor <iant@google.com>
758 * options.cc (General_options::string_to_object_format): Accept
761 2013-03-08 Alan Modra <amodra@gmail.com>
763 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
765 (struct Post_fde): Move definition to here..
766 * ehframe.cc (struct Post_fde): ..from here.
767 (Cie::write): Don't alloc Post_fde.
768 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
770 2013-03-07 Alan Modra <amodra@gmail.com>
772 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
773 relocation referencing .LC0.
774 * testsuite/discard_locals_test.sh: Remove FIXMEs.
776 2013-03-07 Alan Modra <amodra@gmail.com>
778 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
779 always_inline. Add assembly for powerpc to avoid GOT.
781 2013-03-07 Alan Modra <amodra@gmail.com>
783 * testsuite/script_test_10.sh: Don't test .bss section
786 2013-03-06 Alan Modra <amodra@gmail.com>
788 * powerpc.cc (class Powerpc_relobj): Move some member functions.
789 (Target_powerpc::symval_for_branch): Add symtab param. Update
790 all callers. Handle folded sections.
791 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
793 (Global_symbol_visitor_opd::operator()): Likewise.
795 2013-03-04 Alan Modra <amodra@gmail.com>
797 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
798 * testsuite/Makefile.in: Regenerate.
800 2013-03-01 Cary Coutant <ccoutant@google.com>
802 Add dwp support for v2 DWARF package file format.
803 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
804 tu_length parameter. Adjust all callers.
805 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
806 * dwp.cc: Include dwarf.h.
807 (Section_bounds): New struct type.
808 (Unit_set): New struct type.
809 (Dwo_file::Dwo_file): Initialize new data member.
810 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
811 Combine and rename to...
812 (Dwo_file::read_unit_index): ...this.
813 (Dwo_file::sized_read_compunit_index)
814 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
815 (Dwo_file::sized_read_unit_index): ...this.
816 (Dwo_file::copy_section): Remove section_name, is_str_offsets
817 parameters; add section_id parameter.
818 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
819 (Dwo_file::add_unit_set): ...this.
820 (Dwo_file::shndx_map_): Remove.
821 (Dwo_file::sect_offsets_): New data member.
822 (Dwp_output_file::Dwp_output_file): Initialize new data members.
823 (Dwp_output_file::add_section): Rename to...
824 (Dwp_output_file::add_contribution): ...this.
825 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
826 (Dwp_output_file::add_tu_set): Likewise.
827 (Dwp_output_file::Contribution): New type.
828 (Dwp_output_file::Section::contributions): New data member.
829 (Dwp_output_file::Cu_or_tu_set): Remove.
830 (Dwp_output_file::Section::Section): New ctor.
831 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
832 (Dwp_output_file::Dwp_index::Section_table): New type.
833 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
834 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
836 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
837 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
838 (Dwp_output_file::Dwp_index::section_table): New member function.
839 (Dwp_output_file::Dwp_index::section_table_end): New member function.
840 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
841 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
842 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
843 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
844 (Dwp_output_file::Dwp_index::section_table_): New data member.
845 (Dwp_output_file::Dwp_index::section_mask_): New data member.
846 (Dwp_output_file::add_output_section): New member function.
847 (Dwp_output_file::write_new_section): New member function.
848 (Dwp_output_file::write_contributions): New member function.
849 (Dwp_output_file::section_id_map_): New data member.
850 (class Dwo_id_info_reader): Remove.
851 (class Unit_reader): New class.
852 (get_dwarf_section_name): New function.
853 (Dwo_file::read_executable): Adjust initializations of class data.
854 (Dwo_file::read): Add support for v2 package file format.
855 (Dwo_file::read_unit_index): Likewise.
856 (Dwo_file::sized_read_unit_index): Likewise.
857 (Dwo_file::copy_section): Likewise.
858 (Dwo_file::add_unit_set): Likewise.
859 (Dwp_output_file::add_output_section): Likewise.
860 (Dwp_output_file::add_contribution): Likewise.
861 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
863 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
865 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
867 (Dwp_output_file::initialize): Remove unused function.
868 (Dwp_output_file::finalize): Add support for v2 package file format.
869 (Dwp_output_file::write_index): Likewise.
870 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
873 2013-03-01 Cary Coutant <ccoutant@google.com>
875 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
876 function into class definition in header file.
877 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
878 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
880 (Dwarf_info_reader::check_buffer): Move here from .cc file.
882 2013-02-28 Alan Modra <amodra@gmail.com>
884 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
885 * target.cc (Target::do_plt_fde_location): New function.
886 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
887 accessor function, and constructor param.
888 (struct Post_fde, Post_fdes): Declare.
889 (Cie::write): Add post_fdes param.
890 * ehframe.cc (Fde::write): Use plt_fde_location.
891 (struct Post_fde): Define.
892 (Cie::write): Stash FDEs added post merge mapping.
893 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
894 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
895 (Eh_frame::do_sized_write): Arrange to write post map FDES after
897 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
898 (Target_powerpc::has_glink): New function.
899 (Target_powerpc::do_relax): Add eh_frame info for stubs.
900 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
901 glink_eh_frame_fde_32, default_fde): New data.
902 (Stub_table::eh_frame_added_): New var.
903 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
905 (Stub_table::add_eh_frame): New function.
906 (Output_data_glink::add_eh_frame): New function.
907 (Target_powerpc::make_glink_section): Call add_eh_frame.
909 2013-02-15 Ian Lance Taylor <iant@google.com>
911 * options.h (DEFINE_uint64_alias): Define.
912 (class General_options): Add -Ttext-segment as an alias for
915 2013-02-15 Alan Modra <amodra@gmail.com>
917 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
918 (Stub_table::do_write): ..here, two places.
919 (Stub_table::plt_call_size): Use it here too.
921 2013-02-11 Ian Lance Taylor <iant@google.com>
923 * descriptors.cc (Descriptors::close_all): New function.
924 * descriptors.h (class Descriptors): Declare close_all.
925 (close_all_descriptors): New inline function.
926 * plugin.cc: Include "descriptors.h".
927 (Plugin_manager::cleanup): Call close_all_descriptors.
929 2013-02-06 Alan Modra <amodra@gmail.com>
931 * README: Update coding style link.
933 2013-01-28 Cary Coutant <ccoutant@google.com>
935 * dwp.cc (File_list): New typedef.
936 (Dwo_name_info_reader): New class.
937 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
938 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
939 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
940 (Dwo_file::read_executable): New function.
941 (Dwo_file::read): Move common setup code to ...
942 (Dwo_file::make_object): ... here.
943 (dwp_options): Add --exec/-e.
947 2013-01-24 Sriraman Tallam <tmsriram@google.com>
949 * layout.cc (Layout::layout): Check for option text_reorder.
950 (Layout::make_output_section): Ditto.
951 * options.h (text_reorder): New option.
952 * output.cc (Input_section_sort_compare): Remove special ordering
955 Input_section_sort_section_name_special_ordering_compare::
956 operator()): New function.
957 (Output_section::sort_attached_input_sections): Use new sort function
959 * output.h (Input_section_sort_section_name_special_ordering_compare):
961 * testsuite/Makefile.am (text_section_grouping): Test option
963 * testsuite/Makefile.in: Regenerate.
964 * testsuite/text_section_grouping.sh: Check order of functions without
965 default text reordering.
967 2013-01-18 Mike Frysinger <vapier@gentoo.org>
969 * options.h (General_options): Change default to true for new_dtags.
971 2013-01-18 Mike Frysinger <vapier@gentoo.org>
973 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
974 when enable_new_dtags is false. Only add DT_RUNPATH when
975 enable_new_dtags is true.
977 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
979 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
980 used in declaration and definition consistent.
981 (Target_powerpc::symval_for_branch): Ditto.
983 2013-01-16 Sriraman Tallam <tmsriram@google.com>
985 * testsuite/plugin_final_layout.cc: Fix comment.
987 2013-01-16 Sriraman Tallam <tmsriram@google.com>
989 * layout.cc (Layout::layout): Do not do default sorting for
990 text sections when section ordering is specified.
991 (make_output_section): Ditto.
992 * testsuite/plugin_final_layout.cc: Name the function sections
993 to catch reordering issues.
995 2013-01-15 Alan Modra <amodra@gmail.com>
997 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1000 2013-01-15 Alan Modra <amodra@gmail.com>
1002 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1003 * testsuite/Makefile.in: Regenerate.
1005 2013-01-14 Alan Modra <amodra@gmail.com>
1007 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1008 * testsuite/Makefile.in: Regenerate.
1010 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1013 Fix mingw gold build with plugins enabled
1014 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1015 * configure.ac: Export DLOPEN_LIBS and add headers check.
1016 * plugin.cc: Handle non-dlfcn case.
1017 * Makefile.in: Regenerate.
1018 * config.in: Regenerate.
1019 * configure: Regenerate.
1020 * testsuite/Makefile.in: Regenerate.
1022 2013-01-09 Sriraman Tallam <tmsriram@google.com>
1024 * output.h (sort_attached_input_sections): Change to be public.
1025 * script-sections.cc
1026 (Output_section_definition::set_section_addresses): Sort
1027 attached input sections according to section order before linker
1028 script assigns section addresses.
1029 (Orphan_output_section::set_section_addresses): Sort
1030 attached input sections according to section order before linker
1031 script assigns section addresses.
1032 * Makefile.am (final_layout.sh): Use a simple linker script to
1033 check if section ordering still works.
1034 * Makefile.in: Regenerate.
1036 2013-01-09 Ben Cheng <bccheng@google.com>
1038 * arm.cc (Target_arm::attributes_accept_div): New function.
1039 (Target_arm::attributes_forbid_div): New function.
1040 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
1041 attribute using the same new functions as what bfd/elf32_arm.c
1044 2013-01-07 Cary Coutant <ccoutant@google.com>
1047 * output.cc (Output_section::add_input_section): For incremental
1048 updates, don't track input sections that are allocated from patch
1051 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1052 Ian Lance Taylor <iant@google.com>
1055 * configure.ac (--enable-ld): Removed.
1056 (install_as_default): Set to yes only for --enable-gold=default
1058 * configure: Regenerated.
1060 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1062 * options.h (General_options): Add -fuse-ld= for GCC linker
1063 option compatibility.
1065 2013-01-04 Cary Coutant <ccoutant@google.com>
1067 * configure.ac: Fix typo restoring CXXFLAGS.
1068 * configure: Regenerate.
1070 2013-01-04 Cary Coutant <ccoutant@google.com>
1072 * testsuite/Makefile.am (CXXLINK_S): New macro.
1073 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
1074 * testsuite/Makefile.in: Regenerate.
1076 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
1078 * version.cc (print_version): Update copyright year to 2013.
1080 2012-12-20 Ian Lance Taylor <iant@google.com>
1082 * layout.cc (Layout::special_ordering_of_input_section): New
1084 (Layout::layout): If input section requires special ordering, must
1085 sort input sections.
1086 (Layout::make_output_section): May sort .text input sections.
1087 (Layout::is_section_name_prefix_grouped): Remove.
1088 * layout.h (class Layout): Declare
1089 special_ordering_of_input_section. Don't declare
1090 is_section_name_prefix_grouped.
1091 * output.cc (Output_section::add_input_section): Revert last
1093 (Output_section::Input_section_sort::match_file_name): Don't crash
1094 if called on output section data.
1095 (Output_section::Input_section_sort_compare): Sort based on
1097 (Output_section::Input_section_sort_section_order_index_compare):
1099 (Output_section::sort_attached_input_sections): Likewise.
1101 2012-12-18 Sriraman Tallam <tmsriram@google.com>
1103 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
1104 * layout.h (Layout::is_section_name_prefix_grouped): New function.
1105 * output.cc (Output_section::add_input_section): Check if section
1106 name contains special prefix. Keep input sections to sort such
1108 (Output_section::Input_section_sort_section_order_index_compare
1109 ::operator()): Group sections according to prefixes.
1110 (Output_section::sort_attached_input_sections): Add condition to
1111 Input_section_entry constructor call.
1112 * testsuite/Makefile.am (text_section_grouping): New test.
1113 * testsuite/Makefile.in: Regenerate.
1114 * testsuite/text_section_grouping.cc: New file.
1115 * testsuite/text_section_grouping.sh: New file.
1117 2012-12-17 Nick Clifton <nickc@redhat.com>
1119 * Makefile.am: Add copyright notice.
1122 * configure.ac: Likewise.
1123 * ftruncate.c: Likewise.
1124 * Makefile.in: Regenerate.
1126 2012-12-14 Cary Coutant <ccoutant@google.com>
1128 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
1129 --no-as-needed flag.
1130 (exception_separate_shared_12_test): Likewise.
1131 (incremental_copy_test): Likewise.
1132 * testsuite/Makefile.in: Regenerate.
1134 2012-12-14 Cary Coutant <ccoutant@google.com>
1136 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
1137 (Dwp_output_file::Dwp_index::enter_set): Add assert.
1139 2012-12-12 Alan Modra <amodra@gmail.com>
1141 * powerpc.cc (class Track_tls): New.
1142 (class Relocate, class Scan): Inherit Track_tls.
1143 (Target_powerpc::Scan::local, global): Track tls optimization
1144 and avoid creating plt entry for __tls_get_addr if all uses
1146 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
1148 2012-12-12 Alan Modra <amodra@gmail.com>
1150 * options.h (General_options): Add --toc-sort/--no-toc-sort.
1151 Replace no_toc_optimize with toc_optimize.
1152 * output.h (Output_section::input_sections): Provide non-const variant.
1153 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
1154 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
1156 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
1157 (class Sort_toc_sections): New.
1158 (Target_powerpc::do_finalize_sections): Sort toc sections.
1159 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
1161 2012-12-10 Roland McGrath <mcgrathr@google.com>
1163 * testsuite/binary_unittest.cc (read_all): New function.
1164 (Sized_binary_test): Use it instead of ::read.
1165 * fileread.cc (do_read): Don't assume pread always reads the whole
1166 amount in a single call.
1168 2012-12-10 Alan Modra <amodra@gmail.com>
1170 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
1171 Set EM_PPC64 or EM_PPC here.
1172 (Target_selector_powerpc::do_recognize): Delete.
1174 2012-12-10 Alan Modra <amodra@gmail.com>
1176 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
1178 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
1180 2012-12-07 Roland McGrath <mcgrathr@google.com>
1182 * testsuite/binary_unittest.cc (Sized_binary_test):
1183 Use open_descriptor rather than ::open.
1185 2012-12-07 Alan Modra <amodra@gmail.com>
1187 * powerpc.cc (Stub_table::do_write): Delete redundant Address
1188 typedef and invalid_address constant.
1189 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
1190 instantiate constants.
1192 2012-12-06 Roland McGrath <mcgrathr@google.com>
1194 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
1195 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
1196 * aclocal.m4: Regenerate.
1197 * configure: Regenerate.
1198 * Makefile.in: Regenerate.
1199 * testsuite/Makefile.in: Regenerate.
1201 2012-12-07 Alan Modra <amodra@gmail.com>
1203 * options.h (General_options): Add no_toc_optimize.
1204 * powerpc.cc (ok_lo_toc_insn): New function.
1205 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
1207 2012-12-06 Alan Modra <amodra@gmail.com>
1209 * options.h (General_options): Add plt_align, plt_static_chain,
1210 plt_thread_safe. Update stub_group_size help text.
1211 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
1212 for new plt_thread_safe_ var.
1213 (use_plt_offset): Correct comments.
1214 (Target_powerpc::do_relax): Look for thread creation symbols to
1215 determine default plt_thread_safe value. Clear plt call stubs
1216 as well as branch stubs each iteration.
1217 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
1219 (l, hi, ha, write_insn): Move earlier.
1220 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
1221 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
1223 (Stub_table::update_size): Adjust.
1224 (Stub_table::prev_size, set_prev_size): Delete.
1225 (Stub_table::stub_align): Let --plt-align affect result.
1226 (Stub_table::plt_call_size): Calculate sizes for various stubs.
1227 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
1228 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
1229 (Stub_table::do_write): Support more stub variants.
1231 2012-12-04 Alan Modra <amodra@gmail.com>
1233 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
1234 (Target_powerpc::do_define_standard_symbols): New function.
1236 2012-12-03 Alan Modra <amodra@gmail.com>
1238 * output.h: Formatting, whitespace.
1240 2012-12-03 Alan Modra <amodra@gmail.com>
1242 * layout.h (Layout::get_executable_sections): Declare.
1243 * layout.cc (Layout::get_executable_sections): New function.
1244 * arm.cc (Target_arm::group_sections): Use it.
1245 (Arm_output_section::group_sections): Delete now redundant test.
1246 * output.cc (Output_reloc::Output_reloc): Add is_relative.
1247 param to handle relative relocs.
1248 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
1249 (Output_data_reloc::add_absolute): Adjust.
1250 (Output_data_reloc::add_relative): New function.
1251 (Output_data::reset_data_size): New function.
1252 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
1253 (Output_section::set_addralign): New function.
1254 (Output_section::checkpoint_set_addralign): New function.
1255 (Output_section::clear_section_offsets_need_adjustment): New function.
1256 (Output_section::input_sections): Make public.
1257 * powerpc.cc (class Output_data_brlt_powerpc): New.
1258 (class Stub_table, class Stub_control): New.
1259 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
1260 stub_table_, set_stub_table, stub_table): New vectors and accessor
1262 (Target_powerpc::do_may_relax, do_relax, push_branch,
1263 new_stub_table, stub_tables, brlt_section, group_sections,
1264 add_branch_lookup_table, find_branch_lookup_table,
1265 write_branch_lookup_table, make_brlt_section): New functions.
1266 (Target_powerpc::struct Sort_sections, class Branch_info): New.
1267 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
1268 branch_info_): New vars.
1269 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
1270 make call stubs here.
1271 (Output_data_glink): Remove all call stub handling from this class.
1272 (Target_powerpc::Scan::local, global): Save interesting branch
1273 relocs and relocs for ifunc. Adjust calls to plt entry functions.
1274 (Target_powerpc::do_finalize_sections): Only make reg save/restore
1275 functions on final link.
1276 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
1277 Handle long branch destinations too.
1278 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
1279 do_plt_address_for_local): Adjust lookup of plt call stubs.
1281 2012-11-30 Alan Modra <amodra@gmail.com>
1283 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
1284 relocs against protected symbols when building 32-bit shared libs.
1286 2012-11-30 Alan Modra <amodra@gmail.com>
1288 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
1289 param. Call got_section() to make .got. Update all callers
1290 and their callers and so on.
1292 2012-11-30 Alan Modra <amodra@gmail.com>
1294 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
1295 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
1296 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
1297 value if it already exists.
1299 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
1302 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
1304 2012-11-14 Roland McGrath <mcgrathr@google.com>
1306 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
1307 than bfc instruction for data sandboxing.
1309 2012-11-08 Alan Modra <amodra@gmail.com>
1311 * po/POTFILES.in: Regenerate.
1313 2012-11-05 Alan Modra <amodra@gmail.com>
1315 * configure.ac: Apply 2012-09-10 change to config.in here.
1316 * configure: Regenerate.
1318 2012-11-05 Alan Modra <amodra@gmail.com>
1320 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
1321 (struct Opd_ent): Use "Address" rather than "Offset".
1322 (Output_data_got_powerpc::got_base_offset): Return Valtype.
1323 (Target_powerpc::got_section): Make public.
1324 (Target_powerpc::scan_relocs): Move code setting symbols..
1325 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
1326 Create _SDA_BASE_ only when referenced.
1328 2012-11-02 Roland McGrath <mcgrathr@google.com>
1330 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
1333 2012-11-01 Roland McGrath <mcgrathr@google.com>
1335 * target.h (Sized_target::relocate_relocs): Use Elf_Off
1336 for offset_in_output_section parameter.
1337 (Sized_target::relocate_special_relocatable): Likewise.
1338 * arm.cc (Target_arm::relocate_relocs): Likewise.
1339 (Target_arm::relocate_special_relocatable): Likewise.
1340 * i386.cc (Target_i386::relocate_relocs): Likewise.
1341 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
1342 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
1343 * target-reloc.h (relocate_relocs): Likewise.
1344 * testsuite/testfile.cc (Target_test): Likewise.
1345 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
1346 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
1348 * system.h: Move inclusion of <clocale> to after <libintl.h> in
1349 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
1351 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
1352 parameter, which is unused in the [!F_SETFD] case.
1354 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
1355 SYMNDX to off_t before comparing it to this->data_size().
1356 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
1357 * incremental.cc (Output_section_incremental_inputs::do_write):
1358 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
1360 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
1362 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
1364 * gold.cc (Target_arm::do_adjust_elf_header): Add the
1365 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
1368 2012-10-29 Cary Coutant <ccoutant@google.com>
1370 * dwp.cc (usage): Add file and exit status parameters;
1371 add --help and --version options.
1372 (print_version): New function.
1373 (main): Add --help and --version options.
1375 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1377 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
1378 final_layout_sequence.txt.
1379 * testsuite/Makefile.in: Regenerated.
1381 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1383 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
1384 COMPILE generated by automake.
1386 (CXXCOMPILE1): Likewise.
1387 (CXXLINK1): Likewise.
1388 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
1390 (CXXCOMPILE): Likewise.
1391 (CXXLINK): Likewise.
1392 * testsuite/Makefile.in: Regenerated.
1394 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1396 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
1397 on bad fwrite return.
1399 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1401 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
1404 2012-10-23 Cary Coutant <ccoutant@google.com>
1406 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
1407 * testsuite/Makefile.in: Regenerate.
1408 * testsuite/dwp_test.h: New source file.
1409 * testsuite/dwp_test_1.cc: New source file.
1410 * testsuite/dwp_test_1.s: New source file.
1411 * testsuite/dwp_test_1.sh: New source file.
1412 * testsuite/dwp_test_1b.cc: New source file.
1413 * testsuite/dwp_test_1b.s: New source file.
1414 * testsuite/dwp_test_2.cc: New source file.
1415 * testsuite/dwp_test_2.s: New source file.
1416 * testsuite/dwp_test_2.sh: New source file.
1417 * testsuite/dwp_test_main.cc: New source file.
1418 * testsuite/dwp_test_main.s: New source file.
1420 2012-10-23 Cary Coutant <ccoutant@google.com>
1422 * dwp.h: New header file.
1423 * dwp.cc: New source file.
1424 * gold.h: Move shared declarations to system.h.
1425 * system.h: New header file.
1426 * Makefile.am: Add dwp.
1427 * Makefile.in: Regenerate.
1429 2012-10-23 Cary Coutant <ccoutant@google.com>
1431 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
1432 Dwarf_info_reader::read_from_pointer.
1433 (Dwarf_pubnames_table::read_header): Likewise.
1434 (Dwarf_pubnames_table::next_name): Likewise.
1435 (Dwarf_die::read_attributes): Likewise.
1436 (Dwarf_die::skip_attributes): Likewise.
1437 (Dwarf_info_reader::read_from_pointer): New function template.
1438 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
1439 (Dwarf_pubnames_table): Likewise.
1440 (Dwarf_info_reader::read_from_pointer): New function template.
1441 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
1442 Dwarf_pubnames_table ctor.
1444 2012-10-23 Cary Coutant <ccoutant@google.com>
1446 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
1448 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
1450 (Dwarf_info_reader::set_abbrev_shndx): New method.
1451 (Dwarf_info_reader::abbrev_shndx_): New data member.
1453 2012-10-23 Cary Coutant <ccoutant@google.com>
1455 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
1456 from object, not parameters.
1457 (Dwarf_info_reader::parse): Likewise.
1458 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
1459 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
1460 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
1463 2012-10-23 Cary Coutant <ccoutant@google.com>
1465 * fileread.cc (Input_file::Input_file): New constructor.
1466 * fileread.h (class Input_file): Add new constructor.
1468 2012-10-18 Alan Modra <amodra@gmail.com>
1471 * object.cc (Relobj::is_section_name_included): Also match
1472 .sdata personality section.
1474 2012-10-18 Alan Modra <amodra@gmail.com>
1476 * target-reloc.h (class Default_comdat_behavior): New, package up..
1477 (get_comdat_behaviour): ..this.
1478 (relocate_section): Add Relocate_comdat_behavior template arg,
1479 adjust code to suit.
1480 * arm.cc (Target_arm::relocate_section): Adjust to suit.
1481 (Target_arm::scan_reloc_section): Likewise.
1482 * i386.cc (Target_i386::relocate_section): Likewise.
1483 * sparc.cc (Target_sparc::relocate_section): Likewise.
1484 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
1485 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
1486 * powerpc.cc (class Relocate_comdat_behavior): New.
1487 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
1488 gold::relocate_section with new template arg.
1490 2012-10-18 Alan Modra <amodra@gmail.com>
1492 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
1493 dynamic relocs for GOT_TPREL got entries, without symbol if
1495 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
1496 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
1497 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
1499 2012-10-17 Alan Modra <amodra@gmail.com>
1502 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
1504 2012-10-16 Sriraman Tallam <tmsriram@google.com>
1506 * layout.cc (Layout::include_section): Keep sections marked
1507 SHF_EXCLUDE when doing relocatable links.
1509 2012-10-16 Alan Modra <amodra@gmail.com>
1511 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
1512 (Target_powerpc::do_finalize_sections): Call it.
1513 (Output_data_save_res): New class and supporting functions.
1514 (Target_powerpc::symval_for_branch): Only look up .opd entry for
1515 normal symbols defined in object files.
1517 2012-10-12 Alan Modra <amodra@gmail.com>
1519 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
1520 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
1521 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
1522 section if scan_opd_relocs not yet called.
1523 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
1525 2012-10-12 Alan Modra <amodra@gmail.com>
1527 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1528 add_local_ifunc_entry): Revert last change.
1529 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
1531 2012-10-05 Alan Modra <amodra@gmail.com>
1533 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
1534 do_plt_address_for_global): New functions.
1535 (Output_data_got_powerpc::do_write): Don't segfault when linking
1537 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1538 add_local_ifunc_entry): Return true on adding entry..
1539 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
1540 glink->add_entry call. Remove unused symtab param. Adjust calls.
1541 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
1542 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
1543 set up symbols here.
1544 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
1545 syms here. Do so even when no .iplt. Don't segfault when linking
1547 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
1548 new variants without reloc param.
1549 (Glink_sym_ent::Glink_sym_ent): Likewise.
1550 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
1551 reloc when refs will resolve to plt call stub.
1552 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
1553 R_PPC_PLTREL24 to resolve locally.
1554 (Target_powerpc::Scan::global): Correct ifunc handling.
1555 (Target_powerpc::Relocate::relocate): Correct local sym glink
1556 lookup. Don't destroy "value" when we have a plt call stub,
1557 and when checking plt call validity.
1558 (Target_powerpc::do_dynsym_value): Simplify.
1560 2012-10-05 Alan Modra <amodra@gmail.com>
1562 * i386.cc (Output_data_plt_i386::address_for_global,
1563 address_for_local): Add plt offset to returned value. Adjust uses.
1564 * sparc.cc (Output_data_plt_sparc::address_for_global,
1565 address_for_local): Likewise.
1566 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
1567 address_for_local): Likewise.
1568 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
1569 address_for_local): Likewise.
1570 * target.h (Target::plt_address_for_global, plt_address_for_local):
1572 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
1573 (Output_data_got::Got_entry::write): Nor here.
1574 * output.h: Comment fix.
1576 2012-10-02 Jiong Wang <jiwang@tilera.com>
1578 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
1579 global_offset_table_ value for larget got.
1580 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
1582 2012-09-29 Alan Modra <amodra@gmail.com>
1584 * powerpc.cc (Target_powerpc::iplt_): New output section.
1585 (Target_powerpc::iplt_section, make_iplt_section,
1586 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
1587 (Target_powerpc::make_plt_entry): Handle ifunc syms.
1588 Target_powerpc::plt_entry_count): Count iplt entries too.
1589 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
1590 reloc section in constructor. New params.
1591 (Target_powerpc::make_plt_section): Create reloc section here instead.
1592 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
1594 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
1595 (Output_data_glink::add_entry, find_entry): New functions to
1596 deal with local syms.
1597 (Glink_sym_ent): Add support for local syms.
1598 (Output_data_glink::do_write): Handle ifunc plt entries.
1599 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1600 (Target_powerpc::Scan::local, global): Handle ifunc syms.
1601 (Target_powerpc::Relocate::relocate): Likewise.
1602 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
1604 2012-09-25 Alan Modra <amodra@gmail.com>
1606 * object.h (Sized_relobj_file::adjust_local_symbol,
1607 do_adjust_local_symbol): New functions.
1608 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
1609 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
1610 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
1611 and irregular opd entry spacing.
1612 (Powerpc_relobj::do_read_relocs): Add opd size checks.
1613 (Global_symbol_visitor_opd): New functor.
1614 (Target_powerpc::do_finalize_sections): Omit global symbols defined
1615 on deleted opd entries.
1617 2012-09-15 Jiong Wang <jiwang@tilera.com>
1619 * tilegx.cc: New file.
1620 * Makefile.am (TARGETSOURCES): Add tilegx.cc
1621 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
1622 * configure.tgt: Add entries for tilegx*.
1623 * configure.ac: Likewise.
1624 * Makefile.in: Rebuild.
1625 * configure: Likewise.
1626 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
1629 2012-09-13 Alan Modra <amodra@gmail.com>
1631 * target-reloc.h (scan_relocs): Call scan.local for relocs
1632 against symbols in discarded sections. Pass is_discarded
1634 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
1635 Add is_discarded param.
1636 * powerpc (Target_powerpc::Scan::local): Likewise. Use
1637 is_discarded to flag opd entry as discarded. Don't emit dyn
1638 relocs on such entries.
1639 (Target_powerpc::Scan::global): Similarly detect and handle
1641 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
1642 opd_ent_. Update all uses.
1643 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
1644 (Target_powerpc::relocate_section): Zero out discarded opd
1647 2012-09-12 Ian Lance Taylor <iant@google.com>
1650 * output.cc: Rename Output_data_got template parameter from size
1651 to got_size for all functions. Compile all variants of
1653 (Output_data_got::Got_entry::write): Correct use of size for
1654 symbol value. Use local_is_tls rather than casting to
1656 * object.h (class Object): Add local_is_tls and do_local_is_tls.
1657 (class Sized_relobj_file): Add do_local_is_tls.
1658 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
1660 2012-09-11 Alan Modra <amodra@gmail.com>
1663 * layout.cc (Layout::set_segment_offsets): When using
1664 common-page-size alignment, ensure we are on a new max-page-size
1666 * output.cc (Output_segment::set_section_addresses): Use
1667 abi_pagesize, not common_pagesize for relro boundary.
1668 (Output_segment::set_offset): Likewise.
1670 2012-09-11 Alan Modra <amodra@gmail.com>
1672 * output.h (Output_data_got::add_global_tls, add_local_tls,
1673 add_local_tls_pair): New functions.
1674 (Output_data_got::add_local_pair_with_rel): Remove second
1675 reloc param. Expand comment.
1676 (Output_data_got::Got_entry): Rename use_plt_offset_ to
1677 use_plt_or_tls_offset_, similarly for constructor param.
1678 (Output_data_got::Got_entry::write): Add got_index param.
1679 * output.cc (Output_data_got::add_global_tls, add_local_tls,
1680 add_local_tls_pair): New functions.
1681 (Output_data_got::Got_entry::write): Handle tls symbols
1682 with use_plt_or_tls_offset_ set specially.
1683 (Output_data_got::add_local_pair_with_rel): Only one reloc.
1684 (Output_data_got::do_write): Replace iterator with index, pass
1685 index to entry write function.
1686 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
1687 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
1688 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
1690 * i386.cc (Target_i386::Scan::local): Likewise.
1691 * sparc.cc (Target_sparc::Scan::local): Likewise.
1692 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
1693 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
1694 do_tls_offset_for_global): New functions.
1695 (Target_powerpc::Scan::local): Correct TLS relocations and got
1697 (Target_powerpc::Scan::global): Don't emit unnecessary
1698 dynamic relocations on TLS GOT entries.
1700 2012-09-10 Matthias Klose <doko@ubuntu.com>
1702 * config.in: Disable sanity check for kfreebsd.
1704 2012-09-10 Sterling Augustine <saugustine@google.com>
1706 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
1707 (Gdb_index::pubtypes_read): New parameter.
1708 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
1710 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
1713 2012-09-09 Alan Modra <amodra@gmail.com>
1715 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
1716 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
1717 * gc.h (gc_process_relocs): Call target gc_add_reference.
1718 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
1719 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
1720 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
1722 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
1723 to cater for when we don't need code offset. Update use.
1724 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
1725 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
1726 set_opd_valid): New functions.
1727 (Target_powerpc::do_gc_add_reference): New function.
1728 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
1730 (Target_powerpc::do_gc_mark_symbol): New function.
1732 2012-09-06 Cary Coutant <ccoutant@google.com>
1734 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
1735 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
1736 (Dwarf_die::skip_attributes): Likewise.
1737 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
1738 * testsuite/gdb_index_test.cc (inline_func_1): New function.
1740 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
1742 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
1744 * testsuite/script_test_3.t: Add .got.plt output section
1746 * testsuite/script_test_4.t: Likewise.
1748 2012-09-05 Alan Modra <amodra@gmail.com>
1750 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
1751 update all uses and lose "enum" when using type.
1753 2012-09-05 Alan Modra <amodra@gmail.com>
1755 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
1756 * configure: Regenerate.
1757 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
1758 (plugin_final_layout.stdout): Likewise.
1759 (memory_test): Set page sizes to 0x1000.
1760 * testsuite/Makefile.in: Regenerate.
1761 * testsuite/discard_locals_test.sh: Add FIXME comment.
1762 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
1763 * testsuite/pr14265.t: Add .got output section statement.
1764 * testsuite/script_test_2.t: Likewise.
1765 * testsuite/script_test_3.t: Likewise.
1766 * testsuite/script_test_4.t: Likewise.
1767 * testsuite/script_test_5.t: Likewise.
1768 * testsuite/script_test_6.t: Likewise.
1769 * testsuite/script_test_7.t: Likewise.
1770 * testsuite/script_test_9.t: Likewise.
1772 2012-09-05 Alan Modra <amodra@gmail.com>
1774 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
1775 (Powerpc_relocate_functions::Status): New typedef.
1776 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1777 (Target_powerpc::Scan::local): Handle REL64.
1778 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
1779 for REL32 and REL64.
1780 (Target_powerpc::symval_for_branch): New function, extracted from..
1781 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
1782 checks. Report overflow errors.
1784 2012-09-05 Alan Modra <amodra@gmail.com>
1786 * object.h (Sized_relobj_file::emit_relocs): Delete.
1787 (Sized_relobj_file::emit_relocs_reltype): Delete.
1788 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
1789 relocate_relocs for --emit-relocs.
1790 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
1791 * output.h: Update comment.
1792 (Output_segment::first_section): New function.
1793 (Output_segment::first_section_load_address): Use first_section.
1794 * output.cc (Output_segment::first_section): New function extracted..
1795 (Output_segment::first_section_load_address): ..from here. Delete.
1796 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
1797 * target.h (Sized_target::relocate_for_relocatable): Likewise.
1798 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
1799 adjust call to target.h function.
1800 * i386.cc (Target_i386): Likewise.
1801 * sparc.cc (Target_sparc): Likewise.
1802 * x86_64.cc (Target_x86_64): Likewise.
1803 * powerpc.cc (Target_powerpc): Likewise.
1804 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
1805 first tls section has section symbol for optimised local dynamic
1807 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
1808 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
1810 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
1811 Rename to relocate_relocs. Update error message.
1813 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
1815 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
1818 2012-08-31 Alan Modra <amodra@gmail.com>
1820 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
1821 (Powerpc_relobj::toc_base_offset): New stub function.
1822 (Target_powerpc): Add tp_offset, dtp_offset. Rename
1823 got_mod_index_offset to tlsld_got_offset. Update all refs.
1824 (Target_powerpc::Relocate::enum skip_tls): New.
1825 (Target_powerpc::call_tls_get_addr_): New var.
1826 (Target_powerpc::is_branch_reloc): Move to file scope.
1827 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
1828 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
1830 (Target_powerpc::enum Got_type): Delete old values, add new ones.
1831 (powerpc_info): Correct common_pagesize for ppc64.
1832 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
1833 (Powerpc_relocate_functions): Add overflow check enums and functions.
1834 Add non-shift version of rela, rela_ua. Delete all rel public
1835 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
1836 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
1837 addr16_ha3, addr14 functions.
1838 (Output_data_got_powerpc::add_constant_pair): New function.
1839 (Output_data_got_powerpc::got_base_offset): Likewise.
1840 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
1841 (instruction constants): Sort, add some more.
1842 (Output_data_glink::do_write): Add and use Address typedef. Use
1843 object->toc_base_offset() stub for 64-bit.
1844 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
1845 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1846 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
1847 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
1848 Always treat .opd relocs as against locally defined symbol.
1849 Correct condition for RELATIVE relocs.
1850 (Target_powerpc::do_finalize_sections): Test for NULL sections.
1851 (Target_powerpc::Relocate::relocate): Use plt call stub as value
1852 for 32-bit syms with a plt entry. Correct ppc64 toc base
1853 calculations. Handle TLS relocs, and more. Add overflow
1854 checking and adjust for Powerpc_relocate_functions changes.
1855 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
1856 Reinstate --emit-relocs code with FIXME.
1858 2012-08-30 Alan Modra <amodra@gmail.com>
1860 * layout.cc (Layout::set_segment_offsets): Set p_align to
1861 abi_pagesize, not common_pagesize.
1862 (Layout::relaxation_loop_body): Similarly use abi_pagesize
1863 to determine whether file header can go in segment.
1865 2012-08-30 Alan Modra <amodra@gmail.com>
1867 * output.h (Output_reloc::Output_reloc <output section>): Add
1868 is_relative param. Adjust calls.
1869 (Output_reloc::add_output_section_relative): New functions.
1870 * output.cc (Output_reloc::Output_reloc <output section>): Handle
1872 (Output_reloc::symbol_value): Handle SECTION_CODE.
1874 2012-08-24 Sriraman Tallam <tmsriram@google.com>
1876 * gold.cc (queue_middle_tasks): Call layout again when unique
1877 segments for sections is desired.
1878 * layout.cc (Layout::Layout): Initialize new members.
1879 (Layout::get_output_section_flags): New function.
1880 (Layout::choose_output_section): Call get_output_section_flags.
1881 (Layout::layout): Make output section for mapping to a unique segment.
1882 (Layout::insert_section_segment_map): New function.
1883 (Layout::attach_allocated_section_to_segment): Make unique segment for
1884 output sections marked so.
1885 (Layout::segment_precedes): Check for unique segments when sorting.
1886 * layout.h (Layout::Unique_segment_info): New struct.
1887 (Layout::Section_segment_map): New typedef.
1888 (Layout::insert_section_segment_map): New function.
1889 (Layout::get_output_section_flags): New function.
1890 (Layout::is_unique_segment_for_sections_specified): New function.
1891 (Layout::set_unique_segment_for_sections_specified): New function.
1892 (Layout::unique_segment_for_sections_specified_): New member.
1893 (Layout::section_segment_map_): New member.
1894 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
1895 Rename is_gc_pass_one to is_pass_one.
1896 Rename is_gc_pass_two to is_pass_two.
1897 Rename is_gc_or_icf to is_two_pass.
1898 Check for which pass based on whether symbols data is present.
1899 Make it two pass when unique segments for sections is desired.
1900 * output.cc (Output_section::Output_section): Initialize new
1902 * output.h (Output_section::is_unique_segment): New function.
1903 (Output_section::set_is_unique_segment): New function.
1904 (Output_section::is_unique_segment_): New member.
1905 (Output_section::extra_segment_flags): New function.
1906 (Output_section::set_extra_segment_flags): New function.
1907 (Output_section::extra_segment_flags_): New member.
1908 (Output_section::segment_alignment): New function.
1909 (Output_section::set_segment_alignment): New function.
1910 (Output_section::segment_alignment_): New member.
1911 (Output_segment::Output_segment): Initialize is_unique_segment_.
1912 (Output_segment::is_unique_segment): New function.
1913 (Output_segment::set_is_unique_segment): New function.
1914 (Output_segment::is_unique_segment_): New member.
1915 * plugin.cc (allow_unique_segment_for_sections): New function.
1916 (unique_segment_for_sections): New function.
1917 (Plugin::load): Add new functions to transfer vector.
1918 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
1919 * Makefile.in: Regenerate.
1920 * testsuite/plugin_final_layout.sh: Check if unique segment
1921 functionality works.
1922 * testsuite/plugin_section_order.c (onload): Check if new interfaces
1924 (allow_unique_segment_for_sections): New global.
1925 (unique_segment_for_sections): New global.
1926 (claim_file_hook): Call allow_unique_segment_for_sections.
1927 (all_symbols_read_hook): Call unique_segment_for_sections.
1929 2012-08-22 Cary Coutant <ccoutant@google.com>
1931 * layout.cc (Layout::include_section): Don't assert on GROUP
1932 sections with --emit-relocs.
1934 2012-08-21 Cary Coutant <ccoutant@google.com>
1936 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
1937 if --export-dynamic-symbol names an undef symbol.
1939 2012-08-18 Alan Modra <amodra@gmail.com>
1941 * powerpc.cc: Formatting and white space.
1942 (Powerpc_relobj): Rename got2_section_ to special_.
1943 Add opd_ent_shndx_ and opd_ent_off_ vectors.
1944 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
1945 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
1946 (Target_powerpc): Add Address typedef and invalid_address. Use
1948 (Target_powerpc::is_branch_reloc): New function.
1949 (Powerpc_relocate_functions): Add Address typedef, use throughout.
1950 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
1951 for dst_mask, value and addend.
1952 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
1953 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
1954 (Output_data_glink::do_write): Correct toc base. Don't try to use
1955 uint16_t for 24-bit offset. Use get_output_section_offset and
1957 (Target_powerpc::Scan::local): Handle more relocs.
1958 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
1959 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
1960 Plug in toc restoring insn after plt calls. Translate branches
1961 to function descriptor symbols to corresponding entry point.
1962 (Target_powerpc::relocate_for_relocatable): Check return from
1963 get_output_section_offset.
1964 * symtab.h: Comment typo.
1966 2012-08-14 Ian Lance Taylor <iant@google.com>
1968 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
1969 unsupported_relocal_local to call unsupported_reloc_global.
1971 2012-08-14 Nick Clifton <nickc@redhat.com>
1974 * script-sections.cc (Sections_element::output_section_name): Add
1975 keep return parameter.
1976 (Output_section_element::match_name): Add keep return parameter.
1977 Return the value of the keep_ member.
1978 * script-sections.h (class Output_section): Update
1979 output_section_name prototype.
1980 * layout.cc (Layout::keep_input_section): New public member
1982 (Layout::choose_output_section): Pass keep parameter to
1983 output_section_name.
1984 * layout.h (class Layout): Add keep_input_section.
1985 * object.cc (Sized_relobj_file::do_layout): Check for kept input
1987 * testsuite/Makefile.am: Add a test.
1988 * testsuite/Makefile.in: Regenerate.
1989 * testsuite/pr14265.c: Source file for the test.
1990 * testsuite/pr14265.t: Linker script for the test.
1991 * testsuite/pr14265.sh: Shell script for the test.
1993 2012-08-14 Alan Modra <amodra@gmail.com>
1995 * target.h (Target::output_section_name): New function.
1996 (Target::do_output_section_name): New function.
1997 * layout.cc (Layout::choose_output_section): Call the above.
1998 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2000 2012-08-14 Alan Modra <amodra@gmail.com>
2002 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2003 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2004 for replace_constant call.
2005 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2006 (Output_data_glink::do_print_to_mapfile): New function.
2007 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2008 (Target_powerpc::Relocate::relocate): Likewise.
2010 2012-08-14 Alan Modra <amodra@gmail.com>
2012 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2013 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2014 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2015 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2016 all references to shndx_. Handle special case for R_PPC_PLTREL24
2018 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2019 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2020 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2022 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2023 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2025 2012-08-12 Alan Modra <amodra@gmail.com>
2027 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
2028 (glink insn constants): Use uint32_t.
2029 (Output_data_glink::add_entry): Use insert, not [] operator.
2031 2012-08-11 Alan Modra <amodra@gmail.com>
2033 * object.h (Sized_relobj_file::find_shdr): New function.
2034 (Sized_relobj_file::find_special_sections): New function.
2035 * object.cc (Sized_relobj_file::find_shdr): New function.
2036 (Sized_relobj_file::find_eh_frame): Use find_shdr.
2037 (Sized_relobj_file::find_special_sections): New function, split out..
2038 (Sized_relobj_file::do_read_symbols): ..from here.
2039 * output.h (Output_data_got::replace_constant): New function.
2040 (Output_data_got::num_entries): New function.
2041 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
2042 (Output_data_got::got_offset): Protected rather than private.
2043 (Output_data_got::replace_got_entry): New function.
2044 * output.cc (Output_data_got::replace_got_entry): New function.
2045 * powerpc.cc (class Powerpc_relobj): New.
2046 (class Powerpc_relocate_functions): Delete all psymval variants or
2047 convert to value,addend type. Delete pcrela, pcrela_unaligned.
2048 Implement _ha functions using corresponding _hi function.
2049 (Powerpc_relobj::find_special_sections): New function.
2050 (Target_powerpc::do_make_elf_object): New function.
2051 (class Output_data_got_powerpc): New.
2052 (class Output_data_glink): New.
2053 (class Powerpc_scan_relocatable_reloc): New.
2054 Many more changes througout file.
2056 2012-08-09 Nick Clifton <nickc@redhat.com>
2058 * po/vi.po: Updated Vietnamese translation.
2060 2012-08-07 Ian Lance Taylor <iant@google.com>
2062 * layout.cc (Layout::add_target_dynamic_tags): If
2063 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
2066 2012-07-30 Nick Clifton <nickc@redhat.com>
2068 * po/gold.pot: Updated template.
2069 * po/es.po: Updated Spanish translation.
2071 2012-07-18 Cary Coutant <ccoutant@google.com>
2074 * configure.ac: Add check for -gpubnames support.
2075 * configure: Regenerate.
2076 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
2077 support; force -gno-pubnames.
2078 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
2080 (gdb_index_test_4): New test.
2081 * testsuite/Makefile.in: Regenerate.
2082 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
2083 * testsuite/gdb_index_test_2.sh: Likewise.
2084 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
2085 * testsuite/gdb_index_test_4.sh: New script.
2086 * testsuite/gdb_index_test_comm.sh: New script with common code;
2087 don't look for space after colon.
2089 2012-07-16 Sriraman Tallam <tmsriram@google.com>
2091 * gold.cc (queue_middle_tasks): Update function order only after
2092 deferred objects due to plugins are processed.
2094 2012-07-11 Ian Lance Taylor <iant@google.com>
2096 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
2097 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
2098 (Target_arm::scan_reloc_for_stub): Likewise.
2099 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
2100 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
2101 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
2102 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
2103 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
2105 2012-07-10 Dodji Seketeli <dodji@redhat.com>
2106 Ian Lance Taylor <iant@google.com>
2109 * configure.ac: Test whether std::tr1::hash<off_t> works.
2110 * gold.h: Add a specialization for std::tr1::hash<off_t> if
2112 * output.h (class Output_fill): Add virtual destructor.
2113 * configure, config.in: Rebuild.
2115 2012-06-22 Roland McGrath <mcgrathr@google.com>
2117 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
2119 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
2121 * plugin.cc (Plugin::load): Handle position independent executables.
2123 2012-06-06 Cary Coutant <ccoutant@google.com>
2125 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
2127 (lines_only_debug_sections): Likewise.
2128 (gdb_fast_lookup_sections): New static array.
2129 (is_gdb_debug_section): Rename formal parameter.
2130 (is_lines_only_debug_section): Likewise.
2131 (is_gdb_fast_lookup_section): New function.
2132 (Layout::include_section): Check for ".zdebug_" prefix; pass
2133 section name suffix to is_gdb_debug_section, et al.; check for
2134 fast-lookup sections when building .gdb_index.
2135 * options.h (--strip-debug-gdb): Update GDB version number.
2137 2012-06-06 Cary Coutant <ccoutant@google.com>
2139 * configure.ac: Add check for fallocate.
2140 * configure: Regenerate.
2141 * config.in: Regenerate.
2143 * options.h (class General_options): Add --mmap-output-file and
2144 --posix-fallocate options.
2145 * output.cc: (posix_fallocate): Remove; replace with...
2146 (gold_fallocate): New function.
2147 (Output_file::map_no_anonymous): Call gold_fallocate.
2148 (Output_file::map): Check --mmap-output-file option.
2150 2012-06-05 Jing Yu <jingyu@google.com>
2152 * gold.h (textdomain): Add do {} to empty while(0).
2153 (bindtextdomain): Likewise.
2155 2012-06-04 Cary Coutant <ccoutant@google.com>
2157 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
2160 2012-05-25 Sriraman Tallam <tmsriram@google.com>
2162 * symtab.cc (Symbol_table::define_special_symbol):
2163 Initialize *poldsym to prevent uninitialized variable errors.
2165 2012-05-23 Cary Coutant <ccoutant@google.com>
2167 * layout.cc (Layout::section_name_mapping): Add rules to handle
2168 exact match on .data.rel.ro.local or .data.rel.ro.
2169 (Layout::output_section_name): Check for exact matches.
2171 2012-05-23 Cary Coutant <ccoutant@google.com>
2173 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
2176 2012-05-22 Cary Coutant <ccoutant@google.com>
2178 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
2179 object before exporting symbol.
2181 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
2183 * testsuite/tls_test.cc: Include "config.h" first.
2184 * testsuite/tls_test_c.c: Likewise.
2186 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
2187 Nick Clifton <nickc@redhat.com>
2190 * configure.in: Add check that sysdep.h has been included before
2191 any system header files.
2192 * configure: Regenerate.
2193 * config.in: Regenerate.
2195 2012-05-14 Cary Coutant <ccoutant@google.com>
2197 * layout.cc (Layout::make_output_section): Mark .tdata section
2199 * testsuite/relro_test.cc: Add a TLS variable.
2201 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
2204 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
2205 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
2208 2012-05-08 Cary Coutant <ccoutant@google.com>
2210 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
2211 (lines_only_debug_sections): Likewise.
2213 2012-05-02 Roland McGrath <mcgrathr@google.com>
2215 * nacl.cc: New file.
2217 * Makefile.am (CCFILES, HFILES): Add them.
2218 * Makefile.in: Regenerate.
2219 * i386.cc (Output_data_plt_i386_nacl): New class.
2220 (Output_data_plt_i386_nacl_exec): New class.
2221 (Output_data_plt_i386_nacl_dyn): New class.
2222 (Target_i386_nacl): New class.
2223 (Target_selector_i386_nacl): New class.
2224 (target_selector_i386): Use it instead of Target_selector_i386.
2225 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
2226 (Target_x86_64_nacl): New class.
2227 (Target_selector_x86_64_nacl): New class.
2228 (target_selector_x86_64, target_selector_x32): Use it instead of
2229 Target_selector_x86_64.
2230 * arm.cc (Output_data_plt_arm_nacl): New class.
2231 (Target_arm_nacl): New class.
2232 (Target_selector_arm_nacl): New class.
2233 (target_selector_arm, target_selector_armbe): Use it instead of
2234 Target_selector_arm.
2236 * target-select.cc (select_target): Take new Input_file* and off_t
2237 arguments, pass them on to recognize method of selector.
2238 * object.cc (make_elf_sized_object): Update caller.
2239 * parameters.cc (parameters_force_valid_target): Likewise.
2240 * incremental.cc (make_sized_incremental_binary): Likewise.
2241 * target-select.h: Update decl.
2242 (Target_selector::recognize): Take new Input_file* argument,
2243 pass it on to do_recognize.
2244 (Target_selector::do_recognize): Take new Input_file* argument.
2245 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
2246 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
2247 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
2248 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
2250 * target.h (Target::Target_info): New members isolate_execinstr
2252 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
2253 * arm.cc (Target_arm::arm_info): Update initializer.
2254 * i386.cc (Target_i386::i386_info): Likewise.
2255 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
2256 * sparc.cc (Target_sparc::sparc_info): Likewise.
2257 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
2258 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2259 * layout.cc (Layout::attach_allocated_section_to_segment):
2260 Take new const Target* argument. If target->isolate_execinstr(), act
2262 (Layout::find_first_load_seg): Take new const Target* argument;
2263 if target->isolate_execinstr(), reject PF_X segments.
2264 (Layout::relaxation_loop_body): Update caller.
2265 (Layout::set_segment_offsets): If target->isolate_execinstr(),
2266 reset file offset to zero when we hit LOAD_SEG, and then do a second
2267 loop over the segments before LOAD_SEG to reassign offsets after
2268 addresses have been determined. Handle target->rosegment_gap().
2269 (Layout::attach_section_to_segment): Take new const Target* argument;
2270 pass it to attach_allocated_section_to_segment.
2271 (Layout::make_output_section): Update caller.
2272 (Layout::attach_sections_to_segments): Take new const Target* argument;
2273 pass it to attach_section_to_segment.
2274 * gold.cc (queue_middle_tasks): Update caller.
2275 * layout.h (Layout): Update method decls with new arguments.
2277 * arm.cc (Target_arm::Target_arm): Take optional argument for the
2278 Target_info pointer to use.
2279 (Target_arm::do_make_data_plt): New virtual method.
2280 (Target_arm::make_data_plt): New method that calls it.
2281 (Target_arm::make_plt_entry): Use it.
2282 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
2283 for the section alignment.
2284 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
2286 (Output_data_plt_arm::first_plt_entry_offset): Call it.
2287 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
2289 (Output_data_plt_arm::get_plt_entry_size): Call it.
2290 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
2291 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
2292 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
2294 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
2295 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
2296 method instead of sizeof(plt_entry).
2297 (Output_data_plt_arm::add_entry): Likewise.
2298 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
2299 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
2301 (Target_arm::plt_entry_size): Likewise.
2302 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
2304 (Output_data_plt_arm_standard): ... here, new class.
2305 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
2306 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
2307 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
2309 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2310 Take additional argument for the PLT entry size.
2311 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
2312 Use get_plt_entry_size method rather than plt_entry_size variable.
2313 (Output_data_plt_x86_64::reserve_slot): Likewise.
2314 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
2315 (Output_data_plt_x86_64::add_entry): Likewise.
2316 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
2317 (Output_data_plt_x86_64::address_for_global): Likewise.
2318 (Output_data_plt_x86_64::address_for_local): Likewise.
2319 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2320 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
2321 Make method non-static.
2322 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
2324 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
2325 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
2326 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
2327 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
2329 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
2330 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
2332 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
2333 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
2335 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
2336 (Output_data_plt_x86_64::plt_entry_size)
2337 (Output_data_plt_x86_64::first_plt_entry)
2338 (Output_data_plt_x86_64::plt_entry)
2339 (Output_data_plt_x86_64::tlsdesc_plt_entry)
2340 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
2341 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
2342 (Output_data_plt_x86_64_standard): ... here, new class.
2343 (Target_x86_64::Target_x86_64): Take optional argument for the
2344 Target_info pointer to use.
2345 (Target_x86_64::do_make_data_plt): New virtual method.
2346 (Target_x86_64::make_data_plt): New method to call it.
2347 (Target_x86_64::init_got_plt_for_update): Use that.
2348 Call this->plt_->add_eh_frame method here.
2349 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
2350 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
2351 rather than static method.
2352 (Target_x86_64::plt_entry_size): Likewise.
2353 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
2354 rather than plt_entry_size variable. Move guts of PLT filling to...
2355 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
2356 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
2357 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
2359 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
2360 additional argument for the section alignment.
2361 Don't do add_eh_frame_for_plt here.
2362 (Output_data_plt_i386::first_plt_entry_offset): Make the method
2363 non-static. Use get_plt_entry_size method rather than plt_entry_size
2365 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
2367 (Output_data_plt_i386::get_plt_entry_size): Call it.
2368 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
2369 (Output_data_plt_i386::add_eh_frame): New method to call it.
2370 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
2372 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
2373 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
2375 (Output_data_plt_i386::fill_plt_entry): New method to call it.
2376 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
2377 method instead of plt_entry_size.
2378 (Output_data_plt_i386::plt_entry_size)
2379 (Output_data_plt_i386::plt_eh_frame_fde_size)
2380 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
2381 (Output_data_plt_i386_standard): ... here, new class.
2382 (Output_data_plt_i386_exec): New class.
2383 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
2384 (Output_data_plt_i386_exec::first_plt_entry): ... here.
2385 (Output_data_plt_i386::exec_plt_entry): Move to ...
2386 (Output_data_plt_i386_exec::plt_entry): ... here.
2387 (Output_data_plt_i386_dyn): New class.
2388 (Output_data_plt_i386::first_plt_entry): Move to ...
2389 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
2390 (Output_data_plt_i386::dyn_plt_entry): Move to ...
2391 (Output_data_plt_i386_dyn::plt_entry): ... here.
2392 (Target_i386::Target_i386): Take optional argument for the Target_info
2394 (Target_i386::do_make_data_plt): New virtual method.
2395 (Target_i386::make_data_plt): New method to call it.
2396 (Target_i386::make_plt_section): Use that.
2397 Call this->plt_->add_eh_frame method here.
2398 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
2399 rather than plt_entry_size variable.
2400 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
2401 (Output_data_plt_i386::address_for_local): Likewise.
2402 (Output_data_plt_i386::do_write): Likewise.
2403 Move guts of PLT filling to...
2404 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
2405 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
2406 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
2407 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
2409 2012-05-01 Cary Coutant <ccoutant@google.com>
2411 * dwarf_reader.cc (Dwarf_die::read_attributes)
2412 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
2413 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
2414 * reduced_debug_output.cc
2415 (Output_reduced_debug_info_section::get_die_end): Remove
2416 DW_FORM_GNU_ref_index. Add default case.
2418 2012-04-26 Mark Wielaard <mjw@redhat.com>
2420 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
2421 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
2422 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
2423 DW_AT_high_pc as offset from DW_AT_low_pc.
2425 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
2426 * testsuite/Makefile.in: Regenerate.
2427 * testsuite/gdb_index_test_3.c: New test source file.
2428 * testsuite/gdb_index_test_3.sh: New test source file.
2430 2012-04-25 Ian Lance Taylor <iant@google.com>
2432 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
2434 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
2435 as a class, not a struct.
2436 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
2437 (Target_arm::apply_cortex_a8_workaround): Likewise.
2438 * gc.h: Declare Reloc_types as a struct, not a class.
2439 * object.h: Declare Symbols_data as a struct.
2440 * reloc.h: Declare Read_relocs_data as a struct.
2441 * target.h: Declare Relocate_info as a struct.
2443 2012-04-24 David S. Miller <davem@davemloft.net>
2445 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
2446 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
2449 2012-04-24 Cary Coutant <ccoutant@google.com>
2451 * incremental-dump.cc (find_input_containing_global): Replace
2452 magic number with symbolic constant.
2453 (dump_incremental_inputs): Update version number.
2454 * incremental.cc (Output_section_incremental_inputs): Update version
2455 number; import symbolic constants from Incremental_inputs_reader.
2456 (Incremental_inputs::create_data_sections): Align relocations
2457 section correctly for 64-bit targets.
2458 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
2459 constants; add padding.
2460 (Output_section_incremental_inputs::write_header): Add assert for
2462 (Output_section_incremental_inputs::write_input_files): Add assert
2463 for input_entry_size.
2464 (Output_section_incremental_inputs::write_info_blocks): Add padding;
2465 add assert for object_info_size, input_section_entry_size,
2466 global_sym_entry_size.
2467 * incremental.h (Incremental_inputs_reader): Add symbolic constants
2468 for data structure sizes; use them.
2469 (Incremental_input_entry_reader): Import symbolic constants from
2470 Incremental_inputs_reader; use them.
2472 2012-04-23 David S. Miller <davem@davemloft.net>
2474 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
2476 (Target_sparc::Target_sparc): Initialize new fields.
2477 (Target_sparc::do_make_elf_object): New function.
2478 (Target_sparc::do_adjust_elf_header): New function.
2480 2012-04-23 Cary Coutant <ccoutant@google.com>
2482 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
2483 CU range table of gdb index.
2485 2012-04-20 David S. Miller <davem@davemloft.net>
2487 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
2490 2012-04-16 David S. Miller <davem@davemloft.net>
2492 * sparc.cc (Target_sparc::got_address): New function.
2493 (Sparc_relocate_functions::gdop_hix22): New function.
2494 (Sparc_relocate_functions::gdop_lox10): New function.
2495 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
2497 (Target_sparc::Scan::local): Likewise if the global symbol is not
2498 preemptible and is not IFUNC.
2499 (Target_sparc::Relocate::relocate): Perform GOTDATA code
2500 transformations for local and non-preemptible non-IFUNC global
2503 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
2504 writing out 64-bit part of ranges.
2506 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
2507 -fpic and -fpie respectively.
2508 * Makefile.in: Regenerate.
2510 * sparc.cc (class Target_sparc): Add rela_ifunc_.
2511 (Target_sparc::Target_sparc): Initialize new field.
2512 (Target_sparc::do_plt_section_for_global): New function.
2513 (Target_sparc::do_plt_section_for_local): New function.
2514 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
2515 (Target_sparc::make_plt_section): New function, broken out of
2516 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
2517 (Target_sparc::make_plt_entry): Call make_plt_section.
2518 (Target_sparc::make_local_ifunc_plt_entry): New function.
2519 (Target_sparc::rela_ifunc_section): New function.
2520 (Target_sparc::plt_section): Remove const.
2521 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
2522 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
2523 and ifunc_count_ fields.
2524 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
2525 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
2526 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
2527 (Output_data_plt_sparc::rela_ifunc): New function.
2528 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
2529 (Output_data_plt_sparc::has_ifunc_section): New function.
2530 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
2531 (Output_data_plt_sparc::address_for_global): New function.
2532 (Output_data_plt_sparc::address_for_local): New function.
2533 (Output_data_plt_sparc::plt_index_to_offset): New function.
2534 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
2536 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
2538 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
2539 R_SPARC_JMP_IREL to switch.
2540 (Target_sparc::Scan::check_non_pic): Likewise.
2541 (Target_sparc::Scan::local): Handle IFUNC symbols.
2542 (Target_sparc::Scan::local): Likewise.
2543 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
2544 and plt_address_for_local.
2545 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
2546 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
2548 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
2549 (class Output_data_reloc): Adjust calls to Output_reloc_type.
2550 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
2551 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
2553 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
2554 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
2556 * sparc.cc (Target_sparc::Scan::global): Likewise.
2557 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2559 2012-04-16 Cary Coutant <ccoutant@google.com>
2561 * archive.cc (Library_base::should_include_member): Check for
2562 --export-dynamic-symbol.
2563 * options.h (class General_options): Add --export-dynamic-symbol.
2564 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
2565 --export-dynamic-symbol.
2566 (Symbol_table::gc_mark_undef_symbols): Likewise.
2567 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
2569 2012-04-12 David S. Miller <davem@davemloft.net>
2571 * sparc.cc (Reloc::wdisp10): New relocation method.
2572 (Reloc::h34): Likewise.
2573 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
2574 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
2576 (Target_sparc::Scan::local): Likewise.
2577 (Target_sparc::Scan::global): Likewise.
2578 (Target_sparc::Relocate::relocate): Likewise.
2580 2012-04-09 Cary Coutant <ccoutant@google.com>
2582 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
2585 2012-04-06 Ian Lance Taylor <iant@google.com>
2587 * timer.cc: #include <unistd.h>.
2589 2012-04-06 Roland McGrath <mcgrathr@google.com>
2591 * configure.in (AC_CHECK_HEADERS): Add locale.h.
2592 * config.in: Regenerate.
2593 * configure: Regenerate.
2595 2012-04-05 Nick Clifton <nickc@redhat.com>
2597 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
2598 (AM_LC_MESSAGES): Add.
2599 * aclocal.m4: Regenerate.
2600 * config.in: Regenerate.
2601 * configure: Regenerate.
2603 2012-03-21 Cary Coutant <ccoutant@google.com>
2605 * Makefile.am: Add gdb-index.cc, gdb-index.h.
2606 * Makefile.in: Regenerate.
2607 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
2608 (Sized_elf_reloc_mapper::symbol_section): New function.
2609 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
2610 (make_elf_reloc_mapper): New function.
2611 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
2612 (Dwarf_abbrev_table::do_read_abbrevs): New function.
2613 (Dwarf_abbrev_table::do_get_abbrev): New function.
2614 (Dwarf_ranges_table::read_ranges_table): New function.
2615 (Dwarf_ranges_table::read_range_list): New function.
2616 (Dwarf_pubnames_table::read_section): New function.
2617 (Dwarf_pubnames_table::read_header): New function.
2618 (Dwarf_pubnames_table::next_name): New function.
2619 (Dwarf_die::Dwarf_die): New function.
2620 (Dwarf_die::read_attributes): New function.
2621 (Dwarf_die::skip_attributes): New function.
2622 (Dwarf_die::set_name): New function.
2623 (Dwarf_die::set_linkage_name): New function.
2624 (Dwarf_die::attribute): New function.
2625 (Dwarf_die::string_attribute): New function.
2626 (Dwarf_die::int_attribute): New function.
2627 (Dwarf_die::uint_attribute): New function.
2628 (Dwarf_die::ref_attribute): New function.
2629 (Dwarf_die::child_offset): New function.
2630 (Dwarf_die::sibling_offset): New function.
2631 (Dwarf_info_reader::check_buffer): New function.
2632 (Dwarf_info_reader::parse): New function.
2633 (Dwarf_info_reader::do_parse): New function.
2634 (Dwarf_info_reader::do_read_string_table): New function.
2635 (Dwarf_info_reader::lookup_reloc): New function.
2636 (Dwarf_info_reader::get_string): New function.
2637 (Dwarf_info_reader::visit_compilation_unit): New function.
2638 (Dwarf_info_reader::visit_type_unit): New function.
2639 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
2640 Sized_elf_reloc_mapper.
2641 (Sized_dwarf_line_info::symbol_section): Remove function.
2642 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
2643 (Sized_dwarf_line_info::read_line_mappings): Remove object
2644 parameter, adjust callers.
2645 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
2646 * dwarf_reader.h: Include <sys/types.h>.
2647 (class Track_relocs): Remove forward declaration.
2648 (class Elf_reloc_mapper): New class.
2649 (class Sized_elf_reloc_mapper): New class.
2650 (class Dwarf_abbrev_table): New class.
2651 (class Dwarf_range_list): New class.
2652 (class Dwarf_ranges_table): New class.
2653 (class Dwarf_pubnames_table): New class.
2654 (class Dwarf_die): New class.
2655 (class Dwarf_info_reader): New class.
2656 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
2657 (Sized_dwarf_line_info::symbol_section): Remove member function.
2658 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
2660 * gdb-index.cc: New source file.
2661 * gdb-index.h: New source file.
2662 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
2663 and .debug_types sections, call Layout::add_to_gdb_index.
2664 (Sized_relobj_incr::do_section_name): Implement.
2665 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
2666 return type; Implement.
2667 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
2669 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
2670 parameter list and return type.
2671 (Sized_incr_dynobj::do_section_contents): Likewise.
2672 * layout.cc: Include gdb-index.h.
2673 (Layout::Layout): Initialize gdb_index_data_.
2674 (Layout::init_fixed_output_section): Check for .gdb_index section.
2675 (Layout::add_to_gdb_index): New function. Instantiate.
2676 * layout.h: Add forward declaration for class Gdb_index.
2677 (Layout::add_to_gdb_index): New member function.
2678 (Layout::gdb_index_data_): New data member.
2679 * main.cc: Include gdb-index.h.
2680 (main): Print statistics for gdb index.
2681 * object.cc (Object::section_contents): Move code into
2682 do_section_contents.
2683 (need_decompressed_section): Check for sections needed when building
2685 (build_compressed_section_map): Likewise.
2686 (Sized_relobj_file::do_read_symbols): Need local symbols when building
2688 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
2689 sections; call Layout::add_to_gdb_index.
2690 (Sized_relobj_file::do_decompressed_section_contents): Call
2691 do_section_contents directly.
2692 * object.h (Object::do_section_contents): Adjust parameter list and
2694 (Object::do_decompressed_section_contents): Call do_section_contents
2696 (Sized_relobj_file::do_section_contents): Adjust parameter list and
2698 * options.h (class General_options): Add --gdb-index option.
2699 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
2700 list and return type.
2701 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
2702 * reloc.h (Track_relocs::checkpoint): New function.
2703 (Track_relocs::reset): New function.
2705 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
2707 * testsuite/Makefile.in: Regenerate.
2708 * testsuite/gdb_index_test.cc: New test source file.
2709 * testsuite/gdb_index_test_1.sh: New test source file.
2710 * testsuite/gdb_index_test_2.sh: New test source file.
2712 2012-03-19 Doug Kwan <dougkwan@google.com>
2714 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2715 (Target_arm::do_finalize_sections): Remove code which defines
2716 __exidx_start and __exidx_end. Make symbol table parameter
2717 anonymous as it is not used.
2718 * gold.cc (queue_middle_tasks): Call target hook to define any
2719 target-specific symbols.
2720 * target.h (Target::define_standard_symbols): New method.
2721 (Target::do_define_standard_symbols): Same.
2722 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
2723 * testsuite/Makefile.in: Regenerate.
2724 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
2726 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
2727 relocations are generated for __exidx_start and __exidx_end.
2729 2012-03-16 Doug Kwan <dougkwan@google.com>
2731 * testsuite/Makefile.am: Disable test initpri3b.
2732 * testsuite/Makefile.in: Regenerate.
2734 2012-03-15 Doug Kwan <dougkwan@google.com>
2736 * arm.cc (Target_arm::got_section): Make .got section read-only
2739 2012-03-15 Ian Lance Taylor <iant@google.com>
2742 * layout.cc (Layout::make_output_section): Correctly mark
2743 SHT_INIT_ARRAY, et. al., as relro.
2745 2012-03-14 Doug Kwan <dougkwan@google.com>
2747 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
2748 dynamic relocations for protected symbols in shared objects.
2750 2012-03-13 Ian Lance Taylor <iant@google.com>
2752 * resolve.cc (Symbol_table::resolve): When merging common symbols,
2753 keep the larger alignment.
2755 2012-03-12 Cary Coutant <ccoutant@google.com>
2757 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
2758 handling of DW_LNE_define_file.
2760 2012-03-12 Cary Coutant <ccoutant@google.com>
2762 * reduced_debug_output.cc
2763 (Output_reduced_debug_info_section::get_die_end): Add new FORM
2766 2012-02-29 Cary Coutant <ccoutant@google.com>
2768 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
2770 2012-02-29 Cary Coutant <ccoutant@google.com>
2772 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2773 Call Object::decompressed_section_contents.
2774 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
2776 (Sized_dwarf_line_info::buffer_start_): New data member.
2777 * merge.cc (Output_merge_data::do_add_input_section): Call
2778 Object::decompressed_section_contents.
2779 (Output_merge_string::do_add_input_section): Likewise.
2780 * object.cc (need_decompressed_section): New function.
2781 (build_compressed_section_map): Decompress sections needed later.
2782 (Sized_relobj_file::do_decompressed_section_contents): New function.
2783 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2784 * object.h (Object::decompressed_section_contents): New function.
2785 (Object::discard_decompressed_sections): New function.
2786 (Object::do_decompressed_section_contents): New function.
2787 (Object::do_discard_decompressed_sections): New function.
2788 (Compressed_section_info): New type.
2789 (Compressed_section_map): Include decompressed section contents.
2790 (Sized_relobj_file::do_decompressed_section_contents): New function.
2791 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2793 2012-02-16 Cary Coutant <ccoutant@google.com>
2795 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
2796 * testsuite/Makefile.in: Regenerate.
2798 2012-02-14 Cary Coutant <ccoutant@google.com>
2800 * options.cc (General_options::finalize): Disallow -pie and -static.
2802 2012-02-03 Doug Kwan <dougkwan@google.com>
2804 * arm.cc (Arm_relocate_functions::abs8,
2805 Arm_relocate_functions::abs16): Use
2806 Bits::has_signed_unsigned_overflow32.
2807 (Arm_relocate_functions::thm_abs8): Correct range of
2809 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
2812 2012-02-02 Doug Kwan <dougkwan@google.com>
2814 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
2815 position independent outputs, not just shared objects.
2817 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
2819 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
2820 * configure: Regenerated.
2822 2012-01-27 Ian Lance Taylor <iant@google.com>
2824 * reloc.h (Bits): New class with static functions, copied from
2825 namespace utils in arm.cc.
2826 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
2829 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2831 * incremental.cc (write_info_blocks): Correct relocation offset.
2833 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2835 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
2836 (Relocate::tls_gd_to_le): Likewise.
2838 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2840 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
2842 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2844 * configure.ac: Check if -mcmodel=medium works.
2845 * configure: Regenerated.
2847 2012-01-24 Cary Coutant <ccoutant@google.com>
2849 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
2851 (read_unsigned_LEB_128_x): ... this new function.
2852 (read_signed_LEB_128): Replaced with inline definition and ...
2853 (read_signed_LEB_128_x): ... this new function.
2854 * int_encoding.h (read_unsigned_LEB_128_x): New function.
2855 (read_unsigned_LEB_128): Add inline definition.
2856 (read_signed_LEB_128_x): New function.
2857 (read_signed_LEB_128): Add inline definition.
2858 * testsuite/Makefile.am (leb128_unittest): New unit test.
2859 * testsuite/Makefile.in: Regenerate.
2860 * testsuite/leb128_unittest.cc: New unit test.
2862 2012-01-23 Ian Lance Taylor <iant@google.com>
2865 * i386.cc (Target_i386::do_code_fill): When using a jmp
2866 instruction, pad with nop instructions.
2867 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2869 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
2871 * x86_64.cc (gc_process_relocs): Add typename on types used in
2873 (scan_relocs): Likewise.
2874 (relocate_section): Likewise.
2875 (apply_relocation): Likewise.
2877 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
2879 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
2880 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
2883 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
2885 * x86_64.cc: Initial support for x32.
2887 2012-01-03 Cary Coutant <ccoutant@google.com>
2889 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
2890 Use abstract base class for GOT.
2891 * gold/output.h (class Output_data_got_base): New abstract base class.
2892 (class Output_data_got): Derive from new base class, adjust ctors.
2893 (Output_data_got::reserve_slot): Make virtual; rename to
2894 do_reserve_slot; Adjust callers.
2895 * gold/target.h (Sized_target::init_got_plt_for_update): Return
2896 pointer to abstract base class.
2897 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
2899 2011-12-18 Ian Lance Taylor <iant@google.com>
2901 * object.h (Relobj::local_symbol_value): New function.
2902 (Relobj::local_plt_offset): New function.
2903 (Relobj::local_has_got_offset): New function.
2904 (Relobj::local_got_offset): New function.
2905 (Relobj::set_local_got_offset): New function.
2906 (Relobj::do_local_symbol_value): New pure virtual function.
2907 (Relobj::do_local_plt_offset): Likewise.
2908 (Relobj::do_local_has_got_offset): Likewise.
2909 (Relobj::do_local_got_offset): Likewise.
2910 (Relobj::do_set_local_got_offset): Likewise.
2911 (Sized_relobj::do_local_has_got_offset): Rename from
2912 local_has_got_offset.
2913 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
2914 (Sized_relobj::do_set_local_got_offset): Rename from
2915 set_local_got_offset.
2916 (Sized_relobj_file::do_local_plt_offset): Rename from
2918 (Sized_relobj_file::do_local_symbol_value): New function.
2919 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
2921 * output.cc (Output_data_got::Got_entry::write): Change object to
2922 Relobj. Use local_symbol_value.
2923 (Output_data_got::add_global_with_rel): Change rel_dyn to
2924 Output_data_reloc_generic*. Use add_global_generic.
2925 (Output_data_got::add_global_with_rela): Remove. Change all
2926 callers to use add_global_with_rel.
2927 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
2928 Output_data_reloc_generic*. Use add_global_generic.
2929 (Output_data_got::add_global_pair_with_rela): Remove. Change all
2930 callers to use add_global_pair_with_rel.
2931 (Output_data_got::add_local): Change object to Relobj*.
2932 (Output_data_got::add_local_plt): Likewise.
2933 (Output_data_got::add_local_with_rel): Change object to Relobj*,
2934 change rel_dyn to Output_data_reloc_generic*. Use
2936 (Output_data_got::add_local_with_rela): Remove. Change all
2937 callers to use all_local_with_rel.
2938 (Output_data_got::add_local_pair_with_rel): Change object to
2939 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
2940 add_output_section_generic.
2941 (Output_data_got::add_local_pair_with_rela): Remove. Change all
2942 callers to use add_local_pair_with_rel.
2943 (Output_data_got::reserve_local): Change object to Relobj*.
2944 * output.h: (class Output_data_reloc_generic): Add pure virtual
2945 declarations for add_global_generic, add_local_generic,
2946 add_output_section_generic.
2947 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
2948 functions for Output_data_reloc_generic. Update declarations for
2949 changes listed in output.cc.
2950 (class Output_data_got): Change template parameter to got_size.
2951 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
2952 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
2954 (Sized_relobj_incr::do_local_plt_offset): New function.
2955 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
2958 2011-12-17 Cary Coutant <ccoutant@google.com>
2960 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
2961 * resolve.cc (Symbol_table::resolve): Likewise.
2962 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
2964 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2966 2011-12-16 Ian Lance Taylor <iant@google.com>
2968 * output.h (Output_data_reloc_generic::add): Only call
2969 add_dynamic_reloc if this is a dynamic reloc section.
2971 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
2974 * target-reloc.h (apply_relocation): Replace <64, false> with
2977 2011-11-25 Nick Clifton <nickc@redhat.com>
2979 * po/it.po: New Italian translation.
2981 2011-11-17 Sterling Augustine <saugustine@google.com>
2983 * script.cc (script_include_directive): Implement.
2984 (read_script_file): New local variables name and search_path. Update
2985 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
2986 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
2987 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
2989 2011-11-11 Sterling Augustine <saugustine@google.com>
2991 * yyscript.y (section_cmd): Add support for INCLUDE directive.
2992 (file_or_sections_cmd): Likewise.
2994 2011-11-11 Doug Kwan <dougkwan@google.com>
2996 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
2997 if --just-symbols is given.
2999 2011-11-10 Doug Kwan <dougkwan@google.com>
3002 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3003 when processing data relocs.
3004 * reloc.h (Relocate_functions::rel_unaligned): New method.
3005 (Relocate_functions::pcrel_unaligned): Ditto.
3006 (Relocate_functions::rel32_unaligned): Ditto.
3007 (Relocate_functions::pcrel32_unaligned): Ditto.
3009 2011-11-09 Doug Kwan <dougkwan@google.com>
3012 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3013 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3014 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3015 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3016 (Relocate_functions::rel_unaligned): New.
3017 (Relocate_functions::rel32_unaligned): New.
3018 * target-reloc.h (relocate_for_relocatable): Add code to handle
3019 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3020 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3021 arm_unaligned_reloc_r): New targets.
3022 * testsuite/Makefile.in: Regenerate.
3023 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3026 2011-11-02 Ian Lance Taylor <iant@google.com>
3028 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
3030 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
3031 * options.cc (General_options::finalize): Use library search path
3032 from configure script if specified. If not native and no sysroot,
3033 only search TOOLLIBDIR.
3034 * options.h (Search_directory::Search_directory): Change name to
3036 (General_options::add_to_library_path_with_sysroot): Change arg to
3038 * configure, Makefile.in, config.in: Rebuild.
3040 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3042 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
3043 we are working around the ARM1176 Erratum.
3044 * options.h (General_options::fix_arm1176): Add option.
3045 * testsuite/Makefile.am: Add testcases, and keep current ones
3047 * testsuite/Makefile.in: Regenerate.
3048 * testsuite/arm_fix_1176.s: New file.
3049 * testsuite/arm_fix_1176.sh: Likewise.
3051 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3053 * arm.cc (Target_arm::Target_arm): Remove initialisation of
3055 (Target_arm::may_use_blx): Remove method.
3056 (Target_arm::set_may_use_blx): Likewise.
3057 (Target_arm::may_use_v4t_interworking): New method.
3058 (Target_arm::may_use_v5t_interworking): Likewise.
3059 (Target_arm::may_use_blx_): Remove member variable.
3060 (Arm_relocate_functions::arm_branch_common): Check for v5T
3062 (Arm_relocate_functions::thumb_branch_common): Likewise.
3063 (Reloc_stub::stub_type_for_reloc): Likewise.
3064 (Target_arm::do_finalize_sections): Correct interworking checks.
3065 * testsuite/Makefile.am: Add new tests.
3066 * testsuite/Makefile.in: Regenerate.
3067 * testsuite/arm_farcall_arm_arm.s: New test.
3068 * testsuite/arm_farcall_arm_arm.sh: Likewise.
3069 * testsuite/arm_farcall_arm_thumb.s: Likewise.
3070 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
3071 * testsuite/arm_farcall_thumb_arm.s: Likewise.
3072 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
3073 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
3074 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
3076 2011-10-31 Cary Coutant <ccoutant@google.com>
3079 * expression.cc (Expression::eval_with_dot): Add
3080 is_section_dot_assignment parameter.
3081 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
3082 absolute and assigning to dot within a section.
3083 * script-sections.cc
3084 (Output_section_element_assignment::set_section_addresses): Pass
3085 dot_section to set_if_absolute.
3086 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
3087 as is_section_dot_assignment flag to eval_with_dot.
3088 (Output_section_element_dot_assignment::set_section_addresses):
3090 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
3091 parameter. Also set value if relative to dot_section; set the
3092 symbol's output_section.
3093 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
3094 parameter. Adjust all callers.
3095 (Expression::eval_maybe_dot): Likewise.
3096 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
3098 * testsuite/script_test_2.t: Test assignment of an absolute value
3099 to dot within an output section element.
3101 2011-10-31 Cary Coutant <ccoutant@google.com>
3103 * options.h (class General_options): Add --[no-]gnu-unique options.
3104 * symtab.cc (Symbol_table::sized_write_globals): Convert
3105 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
3107 2011-10-31 Cary Coutant <ccoutant@google.com>
3110 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
3111 unnecessary assertion.
3112 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
3114 2011-10-31 Sriraman Tallam <tmsriram@google.com>
3116 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3118 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3120 Change to just keep the section associated with symbol.
3121 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
3122 they are externally visible and --export-dynamic is turned on.
3123 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
3125 2011-10-19 Ian Lance Taylor <iant@google.com>
3128 * script-sections.cc
3129 (Output_section_element_dot_assignment::needs_output_section): New
3132 2011-10-19 Ian Lance Taylor <iant@google.com>
3135 * layout.cc (Layout::segment_precedes): Don't assert failure if a
3136 --section-start option was seen.
3137 * options.h (General_options::any_section_start): New function.
3139 2011-10-18 David S. Miller <davem@davemloft.net>
3142 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
3143 member to track relocation locations that have moved during TLS
3144 reloc optimizations.
3145 (Target_sparc::Relocate::Relocate): Initialize to NULL.
3146 (Target_sparc::Relocate::relocate): Adjust view down by 4
3147 bytes if it matches reloc_adjust_addr_.
3148 (Target_sparc::Relocate::relocate_tls): Always move the
3149 __tls_get_addr call delay slot instruction forward 4 bytes when
3150 performing relaxation.
3152 2011-10-18 Cary Coutant <ccoutant@google.com>
3154 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
3155 (Output_file::map_no_anonymous): Check for non-zero
3156 return code from posix_fallocate.
3158 2011-10-17 Cary Coutant <ccoutant@google.com>
3161 * plugin.cc (is_visible_from_outside): Check for symbols
3162 referenced from dynamic objects.
3163 * resolve.cc (Symbol_table::resolve): Don't count references
3164 from dynamic objects as references from real ELF files.
3165 * testsuite/plugin_test_2.sh: Adjust expected result.
3167 2011-10-17 Cary Coutant <ccoutant@google.com>
3169 * gold.cc: Include timer.h.
3170 (queue_middle_tasks): Stamp time.
3171 (queue_final_tasks): Likewise.
3172 * main.cc (main): Store timer in parameters. Print timers
3174 * parameters.cc (Parameters::Parameters): Initialize timer_.
3175 (Parameters::set_timer): New function.
3176 (set_parameters_timer): New function.
3177 * parameters.h (Parameters::set_timer): New function.
3178 (Parameters::timer): New function.
3179 (Parameters::timer_): New data member.
3180 (set_parameters_timer): New function.
3181 * timer.cc (Timer::stamp): New function.
3182 (Timer::get_pass_time): New function.
3183 * timer.h (Timer::stamp): New function.
3184 (Timer::get_pass_time): New function.
3185 (Timer::pass_times_): New data member.
3187 2011-10-17 Cary Coutant <ccoutant@google.com>
3189 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
3190 task for members of lib groups.
3192 2011-10-17 Cary Coutant <ccoutant@google.com>
3195 * fileread.cc (File_read::find_view): Add assert.
3196 (File_read::make_view): Move bounds check (replace with assert)...
3197 (File_read::find_or_make_view): ... to here.
3199 2011-10-12 Cary Coutant <ccoutant@google.com>
3201 * output.cc (Output_file::open_base_file): Handle case where
3202 ::read returns less than requested size.
3204 2011-10-10 Cary Coutant <ccoutant@google.com>
3206 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
3207 Initialize defined_count_.
3208 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
3209 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
3210 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
3211 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
3212 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
3213 * incremental.h (Sized_relobj_incr::defined_count_): New data
3215 (Sized_incr_dynobj::defined_count_): New data member.
3216 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
3217 Return zeroes instead of internal error.
3219 2011-10-10 Cary Coutant <ccoutant@google.com>
3222 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
3223 (Output_reloc::symbol_value): Return PLT offset if flag is set.
3224 * output.h (class Output_reloc): Add use_plt_offset flag.
3225 (Output_reloc::type_): Adjust size of bit field.
3226 (Output_reloc::use_plt_offset_): New bit field.
3227 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
3228 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
3229 flag. Adjust all callers.
3230 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
3231 creating RELATIVE relocations.
3233 2011-10-10 Nick Clifton <nickc@redhat.com>
3235 * po/es.po: Updated Spanish translation.
3236 * po/fi.po: Updated Finnish translation.
3238 2011-10-03 Diego Novillo <dnovillo@google.com>
3240 * options.cc (parse_uint): Fix dereference of RETVAL.
3242 2011-09-29 Sriraman Tallam <tmsriram@google.com>
3244 * layout.h (section_order_map_): New member.
3245 (get_section_order_map): New member function.
3246 * output.cc (Output_section::add_input_section): Check for patterns
3247 only when --section-ordering-file is specified.
3248 * gold.cc (queue_middle_tasks): Delay updating order of sections till
3249 output_sections have been formed.
3250 * layout.cc (Layout_Layout): Initialize section_order_map_.
3251 * plugin.cc (update_section_order): Store order in order_map. Do not
3253 * testsuite/Makefile.am: Add test case for plugin_final_layout.
3254 * testsuite/Makefile.in: Regenerate.
3255 * testsuite/plugin_section_order.c: New file.
3256 * testsuite/plugin_final_layout.cc: New file.
3257 * testsuite/plugin_final_layout.sh: New file.
3259 2011-09-29 Cary Coutant <ccoutant@google.com>
3261 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3263 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
3264 symbols during incremental update.
3265 (Symbol_table::add_from_dynobj): Likewise.
3267 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3268 Ian Lance Taylor <iant@google.com>
3270 * symtab.cc (Symbol_table::define_special_symbol): Always
3271 canonicalize version string.
3273 2011-09-26 Cary Coutant <ccoutant@google.com>
3275 * gold.cc (queue_initial_tasks): Move option checks ...
3276 * options.cc (General_options::finalize): ... to here. Disable
3277 some options; make others fatal.
3279 2011-09-26 Cary Coutant <ccoutant@google.com>
3282 * plugin.cc (get_symbols_v2): New function.
3283 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
3284 (is_referenced_from_outside): New function.
3285 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
3286 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
3287 (get_symbols): Pass version parameter.
3288 (get_symbols_v2): New function.
3289 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
3291 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
3292 (onload): Add LDPT_GET_SYMBOLS_V2.
3293 (all_symbols_read_hook): Use get_symbols_v2; check for
3294 LDPR_PREVAILING_DEF_IRONLY_EXP.
3295 * testsuite/plugin_test_3.sh: Update expected results.
3297 2011-09-23 Simon Baldwin <simonb@google.com>
3299 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
3300 configuration options.
3301 * configure: Regenerate.
3302 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
3303 * Makefile.in: Regenerate.
3304 * testsuite/Makefile.in: Regenerate.
3306 2011-09-19 Sriraman Tallam <tmsriram@google.com>
3308 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
3310 2011-09-19 Cary Coutant <ccoutant@google.com>
3312 * incremental.cc (can_incremental_update): Fix typo in comment.
3313 * incremental.h (can_incremental_update): Likewise.
3315 2011-09-18 Cary Coutant <ccoutant@google.com>
3317 * incremental.cc (can_incremental_update): New function.
3318 * incremental.h (can_incremental_update): New function.
3319 * layout.cc (Layout::init_fixed_output_section): Call it.
3320 (Layout::make_output_section): Don't allow patch space in .eh_frame.
3321 * object.cc (Sized_relobj_file::do_layout): Call
3322 can_incremental_update.
3324 2011-09-13 Cary Coutant <ccoutant@google.com>
3326 * configure.ac: Check for glibc support for gnu_indirect_function
3327 support with static linking, setting automake conditional
3329 * Makefile.in: Regenerate.
3330 * configure: Regenerate.
3332 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
3333 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
3335 * testsuite/Makefile.in: Regenerate.
3337 2011-09-13 Cary Coutant <ccoutant@google.com>
3339 * incremental.cc (Sized_relobj_incr::do_layout): Call
3340 report_comdat_group for kept comdat sections.
3341 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
3342 * testsuite/Makefile.in: Regenerate.
3343 * testsuite/incr_comdat_test_1.cc: New source file.
3344 * testsuite/incr_comdat_test_2_v1.cc: New source file.
3345 * testsuite/incr_comdat_test_2_v2.cc: New source file.
3346 * testsuite/incr_comdat_test_2_v3.cc: New source file.
3348 2011-09-13 Ian Lance Taylor <iant@google.com>
3350 * object.cc (Sized_relobj_file::do_layout): Remove unused local
3351 variable external_symbols_offset.
3353 2011-09-12 Ian Lance Taylor <iant@google.com>
3355 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
3356 triggered if object has no symbols.
3358 2011-09-09 David S. Miller <davem@davemloft.net>
3360 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
3361 (Output_fill_debug_line::do_write): Likewise.
3363 2011-08-29 Cary Coutant <ccoutant@google.com>
3365 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
3366 casts to match formatting specs.
3367 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
3369 2011-08-26 Cary Coutant <ccoutant@google.com>
3371 * layout.cc (Free_list::allocate): Provide guarantee of minimum
3372 remaining hole size when allocating.
3373 (Layout::make_output_section): Set fill methods for debug sections.
3374 * layout.h (Free_list::Free_list_node): Move from private to
3376 (Free_list::set_min_hole_size): New function.
3377 (Free_list::begin, Free_list::end): New functions.
3378 (Free_list::min_hole_): New data member.
3379 * output.cc: Include dwarf.h.
3380 (Output_fill_debug_info::do_minimum_hole_size): New function.
3381 (Output_fill_debug_info::do_write): New function.
3382 (Output_fill_debug_line::do_minimum_hole_size): New function.
3383 (Output_fill_debug_line::do_write): New function.
3384 (Output_section::Output_section): Initialize new data member.
3385 (Output_section::set_final_data_size): Ensure patch space is larger
3386 than minimum hole size.
3387 (Output_section::do_write): Fill holes in debug sections.
3388 * output.h (Output_fill): New class.
3389 (Output_fill_debug_info): New class.
3390 (Output_fill_debug_line): New class.
3391 (Output_section::set_free_space_fill): New function.
3392 (Output_section::free_space_fill_): New data member.
3393 * testsuite/Makefile.am (incremental_test_3): Add
3394 --incremental-patch option.
3395 (incremental_test_4): Likewise.
3396 (incremental_test_5): Likewise.
3397 (incremental_test_6): Likewise.
3398 (incremental_copy_test): Likewise.
3399 (incremental_common_test_1): Likewise.
3400 * testsuite/Makefile.in: Regenerate.
3402 2011-08-26 Nick Clifton <nickc@redhat.com>
3404 * po/es.po: Updated Spanish translation.
3406 2011-08-01 Cary Coutant <ccoutant@google.com>
3408 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
3409 * gold/testsuite/Makefile.in: Regenerate.
3410 * gold/testsuite/justsyms_exec.c: New source file.
3411 * gold/testsuite/justsyms_lib.c: New source file.
3413 2011-08-01 Cary Coutant <ccoutant@google.com>
3415 * layout.cc (Layout::set_segment_offsets): Don't realign text
3416 segment if -Ttext was specified.
3417 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
3419 * object.h (Sized_relobj_file::e_type): New function.
3420 (Sized_relobj_file::e_type_): New data member.
3421 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
3422 base address for ET_EXEC files.
3423 * target.cc (Target::do_make_elf_object_implementation): Allow
3424 ET_EXEC files with --just-symbols option.
3426 2011-07-28 Cary Coutant <ccoutant@google.com>
3428 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
3429 Add thread_number parameter.
3430 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
3431 * workqueue-threads.cc
3432 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
3433 current thread if its thread number is greater than desired thread
3435 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
3436 Add thread_number parameter.
3437 (Workqueue::should_cancel_thread): Likewise.
3438 (Workqueue::find_runnable_or_wait): Pass thread_number to
3439 should_cancel_thread.
3440 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
3443 2011-07-22 Sriraman Tallam <tmsriram@google.com>
3445 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
3446 only after checking if it cannot be forced local.
3447 * symtab.h (is_externally_visible): Check if the symbol is not forced
3450 2011-07-15 Ian Lance Taylor <iant@google.com>
3452 * options.h (class General_options): Add --print-output-format.
3453 Move -EL next to -EB, for better --help output.
3454 * target-select.cc: Include <cstdio>, "options.h", and
3456 (Target_selector::do_target_bfd_name): New function.
3457 (print_output_format): New function.
3458 * target-select.h (class Target_selector): Update declarations.
3459 (Target_selector::target_bfd_name): New function.
3460 (print_output_format): Declare.
3461 * main.cc: Include "target-select.h".
3462 (main): Handle --print-output-format.
3463 * gold.cc: Include "target-select.h".
3464 (queue_initial_tasks): Handle --print-output-format when there are
3466 * parameters.cc (parameters_force_valid_target): Give a better
3467 error message if -EB/-EL does not match target.
3468 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
3471 2011-07-15 Ian Lance Taylor <iant@google.com>
3473 * i386.cc (class Output_data_plt_i386): Add layout_ field.
3474 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
3475 (Output_data_plt_i386::do_write): Write address of .dynamic
3476 section to first entry in .got.plt section.
3477 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
3478 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3480 (Output_data_plt_x86_64::do_write): Write address of .dynamic
3481 section to first entry in .got.plt section.
3482 * layout.h (Layout::dynamic_section): New function.
3484 2011-07-13 Sriraman Tallam <tmsriram@google.com>
3486 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
3488 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
3489 input_section_position_, and input_section_glob_.
3490 (read_layout_from_file): Call function section_ordering_specified.
3491 * layout.h (is_section_ordering_specified): New function.
3492 (section_ordering_specified): New function.
3493 (section_ordering_specified_): New boolean member.
3494 * main.cc(main): Call load_plugins after layout object is defined.
3495 * output.cc (Output_section::add_input_section): Use
3496 function section_ordering_specified to check if section ordering is
3498 * output.cc (Output_section::add_relaxed_input_section): Use
3499 function section_ordering_specified to check if section ordering is
3501 (Output_section::update_section_layout): New function.
3502 (Output_section::sort_attached_input_sections): Check if input section
3504 * output.h (Output_section::update_section_layout): New function.
3505 * plugin.cc (get_section_count): New function.
3506 (get_section_type): New function.
3507 (get_section_name): New function.
3508 (get_section_contents): New function.
3509 (update_section_order): New function.
3510 (allow_section_ordering): New function.
3511 (Plugin::load): Add the new interfaces to the transfer vector.
3512 (Plugin_manager::load_plugins): New parameter.
3513 (Plugin_manager::all_symbols_read): New parameter.
3514 (Plugin_manager::claim_file): New parameter. Save the elf object for
3516 (Plugin_manager::get_elf_object): New function.
3517 (Plugin_manager::get_view): Change to directly use the bool to check
3518 if get_view is called from claim_file_hook.
3519 * plugin.h (input_objects): New function
3520 (Plugin__manager::load_plugins): New parameter.
3521 (Plugin_manager::claim_file): New parameter.
3522 (Plugin_manager::get_elf_object): New function.
3523 (Plugin_manager::in_claim_file_handler): New function.
3524 (Plugin_manager::in_claim_file_handler_): New member.
3525 (layout): New function.
3526 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
3527 handler with an extra parameter. Make the elf object before calling
3529 * testsuite/plugin_test.c (get_section_count): New function pointer.
3530 (get_section_type): New function pointer.
3531 (get_section_name): New function pointer.
3532 (get_section_contents): New function pointer.
3533 (update_section_order): New function pointer.
3534 (allow_section_ordering): New function pointer.
3535 (onload): Check if the new interfaces exist.
3537 2011-07-13 Ian Lance Taylor <iant@google.com>
3539 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
3541 * x86_64.cc (Target_x86_64::got_section): Likewise.
3542 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
3543 (relro_now_test_SOURCES): New variable.
3544 (relro_now_test_DEPENDENCIES): New variable.
3545 (relro_now_test_LDFLAGS): New variable.
3546 (relro_now_test_LDADD): New variable.
3547 (relro_now_test.so): New target.
3548 * testsuite/Makefile.in: Rebuild.
3550 2011-07-12 Ian Lance Taylor <iant@google.com>
3553 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
3554 GLOB_DAT relocation rather than a RELATIVE relocation for a
3555 protected symbol when creating a shared library.
3556 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3557 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
3558 * testsuite/protected_main_1.cc (main): Test that protected
3559 function has same address.
3561 2011-07-11 Ian Lance Taylor <iant@google.com>
3564 * options.h (class General_options): Add -Bgroup.
3565 * options.cc (General_options::finalize): If -Bgroup is set,
3566 default to --unresolved-symbols=report-all.
3567 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
3568 * target-reloc.h (issue_undefined_symbol_error): Handle
3569 --unresolved-symbols=report-all.
3571 2011-07-08 Ian Lance Taylor <iant@google.com>
3574 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
3575 if linker script discards key sections.
3576 (Layout::create_dynamic_symtab): Likewise.
3577 (Layout::assign_local_dynsym_offsets): Likewise.
3578 (Layout::sized_create_version_sections): Likewise.
3579 (Layout::create_interp): Likewise.
3580 (Layout::finish_dynamic_section): Likewise.
3581 (Layout::set_dynamic_symbol_size): Likewise.
3583 2011-07-08 Ian Lance Taylor <iant@google.com>
3586 * options.h (class General_options): Add --unresolved-symbols.
3587 * target-reloc.h (issue_undefined_symbol_error): Check
3588 --unresolved-symbols. Add comments.
3590 2011-07-08 Ian Lance Taylor <iant@google.com>
3592 * testsuite/odr_violation2.cc (Ordering::operator()): Make
3593 expression more complex.
3595 2011-07-08 Ian Lance Taylor <iant@google.com>
3598 * target-reloc.h (issue_undefined_symbol_error): New inline
3599 function, broken out of relocate_section.
3600 (relocate_section): Call issue_undefined_symbol_error.
3601 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3602 there is no TLS segment if we are about to issue an undefined
3604 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3606 2011-07-08 Ian Lance Taylor <iant@google.com>
3609 * resolve.cc (Symbol_table::should_override): Add fromtype
3610 parameter. Change all callers. Give error when linking together
3611 TLS and non-TLS symbol.
3612 (Symbol_table::should_override_with_special): Add fromtype
3613 parameter. Change all callers.
3614 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3615 there is no TLS segment if we have reported some errors.
3616 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3618 2011-07-08 Ian Lance Taylor <iant@google.com>
3621 * target.h (Target::plt_address_for_global): New function.
3622 (Target::plt_address_for_local): New function.
3623 (Target::plt_section_for_global): Remove.
3624 (Target::plt_section_for_local): Remove.
3625 (Target::do_plt_address_for_global): New virtual function.
3626 (Target::do_plt_address_for_local): New virtual function.
3627 (Target::do_plt_section_for_global): Remove.
3628 (Target::do_plt_section_for_local): Remove.
3629 (Target::register_global_plt_entry): Add Symbol_table and Layout
3631 * output.cc (Output_data_got::Got_entry::write): Use
3632 plt_address_for_global and plt_address_for_local.
3633 * layout.cc (Layout::add_target_dynamic_tags): Use size and
3634 address of output section.
3635 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
3636 got_irelative_, and irelative_count_ fields. Update
3638 (Output_data_plt_i386::has_irelative_section): New function.
3639 (Output_data_plt_i386::entry_count): Add irelative_count_.
3640 (Output_data_plt_i386::set_final_data_size): Likewise.
3641 (class Target_i386): Add got_irelative_ and rel_irelative_
3642 fields. Update declarations.
3643 (Target_i386::Target_i386): Initialize new fields.
3644 (Target_i386::do_plt_address_for_global): New function replacing
3645 do_plt_section_for_global.
3646 (Target_i386::do_plt_address_for_local): New function replacing
3647 do_plt_section_for_local.
3648 (Target_i386::got_section): Create got_irelative_.
3649 (Target_i386::rel_irelative_section): New function.
3650 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
3651 fields. Don't define __rel_iplt_{start,end}.
3652 (Output_data_plt_i386::add_entry): Add symtab and layout
3653 parameters. Change all callers. Use different PLT and GOT for
3655 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
3656 layout parameters. Change all callers. Use different PLT and
3658 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
3659 (Output_data_plt_i386::rel_irelative): New function.
3660 (Output_data_plt_i386::address_for_global): New function.
3661 (Output_data_plt_i386::address_for_local): New function.
3662 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
3663 IRELATIVE GOT when changing IFUNC GOT entries.
3664 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
3666 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
3667 if we didn't create an IRELATIVE GOT.
3668 (Target_i386::Relocate::relocate): Use plt_address_for_global and
3669 plt_address_for_local.
3670 (Target_i386::do_dynsym_value): Use plt_address_for_global.
3671 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
3672 got_irelative_, and irelative_count_ fields. Update
3674 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3675 Initialize new fields. Remove symtab parameter. Change all
3677 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
3679 (Output_data_plt_x86_64::has_irelative_section): New function.
3680 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
3681 (class Target_x86_64): Add got_irelative_ and rel_irelative_
3682 fields. Update declarations.
3683 (Target_x86_64::Target_x86_64): Initialize new fields.
3684 (Target_x86_64::do_plt_address_for_global): New function replacing
3685 do_plt_section_for_global.
3686 (Target_x86_64::do_plt_address_for_local): New function replacing
3687 do_plt_section_for_local.
3688 (Target_x86_64::got_section): Create got_irelative_.
3689 (Target_x86_64::rela_irelative_section): New function.
3690 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
3691 all callers. Don't create __rel_iplt_{start,end}.
3692 (Output_data_plt_x86_64::add_entry): Add symtab and layout
3693 parameters. Change all callers. Use different PLT and GOT for
3695 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
3696 layout parameters. Change all callers. Use different PLT and
3698 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
3699 parameters. Change all callers. Use different PLT and GOT for
3701 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
3702 (Output_data_plt_x86_64::rela_irelative): New function.
3703 (Output_data_plt_x86_64::address_for_global): New function.
3704 (Output_data_plt_x86_64::address_for_local): New function.
3705 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3706 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
3707 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
3708 (Target_x86_64::register_global_plt_entry): Add symtab and layout
3710 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
3712 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
3713 symbols if we didn't create an IRELATIVE GOT.
3714 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
3715 plt_address_for_local.
3716 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
3717 * testsuite/ifuncvar1.c: New test file.
3718 * testsuite/ifuncvar2.c: New test file.
3719 * testsuite/ifuncvar3.c: New test file.
3720 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
3721 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
3722 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
3723 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
3724 * testsuite/Makefile.in: Rebuild.
3726 2011-07-07 Cary Coutant <ccoutant@google.com>
3728 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
3729 (two_file_test_1_ndebug.o): Likewise.
3730 (two_file_test_1b_ndebug.o): Likewise.
3731 (two_file_test_2_ndebug.o): Likewise.
3732 (two_file_test_main_ndebug.o): Likewise.
3733 (incremental_test_2): Link with no-debug versions.
3735 2011-07-06 Cary Coutant <ccoutant@google.com>
3737 * gold/incremental.cc
3738 (Output_section_incremental_inputs::write_info_blocks): Check for
3739 hidden and internal symbols.
3741 2011-07-06 Cary Coutant <ccoutant@google.com>
3743 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
3744 Check disposition for startup file.
3745 (Incremental_inputs::report_command_line): Ignore
3746 --incremental-startup-unchanged option.
3747 * options.cc (General_options::parse_incremental_startup_unchanged):
3749 (General_options::General_options): Initialize new data member.
3750 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
3751 (General_options): Add --incremental-startup-unchanged option.
3752 (General_options::incremental_startup_disposition): New function.
3753 (General_options::incremental_startup_disposition_): New data member.
3755 2011-07-06 Cary Coutant <ccoutant@google.com>
3757 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
3758 input file index to Script_info ctor.
3759 (Sized_incremental_binary::do_file_has_changed): Find the
3760 command-line argument for files named in scripts.
3761 * incremental.h (Script_info::Script_info): New ctor
3762 with input file index.
3763 (Script_info::input_file_index): New function.
3764 (Script_info::input_file_index_): New data member.
3765 (Incremental_binary::get_library): Add const.
3766 (Incremental_binary::get_script_info): Add const.
3767 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
3768 * testsuite/Makefile.am (incremental_test_5): New test case.
3769 (incremental_test_6): New test case.
3770 * testsuite/Makefile.in: Regenerate.
3772 2011-07-06 Cary Coutant <ccoutant@google.com>
3774 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
3775 debug output when command lines differ.
3777 2011-07-06 Cary Coutant <ccoutant@google.com>
3779 * incremental.cc (Incremental_inputs::report_command_line): Ignore
3780 --incremental-patch option.
3781 * layout.cc (Free_list::allocate): Extend allocation beyond original
3783 (Layout::make_output_section): Mark sections that should get
3785 * options.cc (parse_percent): New function.
3786 * options.h (parse_percent): New function.
3787 (DEFINE_percent): New macro.
3788 (General_options): Add --incremental-patch option.
3789 * output.cc (Output_section::Output_section): Initialize new data
3791 (Output_section::add_input_section): Print section name when out
3793 (Output_section::add_output_section_data): Likewise.
3794 (Output_section::set_final_data_size): Add patch space when
3795 doing --incremental-full.
3796 (Output_section::do_reset_address_and_file_offset): Remove patch
3798 (Output_segment::set_section_list_addresses): Print debug output
3799 only if --incremental-update.
3800 * output.h (Output_section::set_is_patch_space_allowed): New function.
3801 (Output_section::is_patch_space_allowed_): New data member.
3802 (Output_section::patch_space_): New data member.
3803 * parameters.cc (Parameters::incremental_full): New function.
3804 * parameters.h (Parameters::incremental_full): New function
3805 * testsuite/Makefile.am (incremental_test_2): Add test for
3806 --incremental-patch option.
3807 * testsuite/Makefile.in: Regenerate.
3808 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
3809 (t18): Remove function body.
3811 2011-07-05 Doug Kwan <dougkwan@google.com>
3814 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
3815 Arm_Address type for relocation result.
3816 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
3818 (Arm_relocate_functions::abs32): Use unaligned access.
3819 (Arm_relocate_functions::rel32): Ditto.
3820 (Arm_relocate_functions::prel31): Ditto.
3821 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
3822 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
3823 static data relocations.
3824 * testsuite/Makefile.in: Regnerate.
3825 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
3827 2011-07-05 Ian Lance Taylor <iant@google.com>
3830 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
3831 symbols if necessary.
3832 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3834 2011-07-05 Ian Lance Taylor <iant@google.com>
3837 * resolve.cc (Symbol::override_base_with_special): Simply override
3838 version with special symbol version, ignoring previous version.
3840 2011-07-05 Ian Lance Taylor <iant@google.com>
3842 * object.cc (Sized_relobj_file::include_section_group): Add
3843 information to comment about signature location.
3845 2011-07-02 Ian Lance Taylor <iant@google.com>
3848 * options.h (class General_options): Add -f and -F.
3849 * options.cc (General_options::finalize): Fatal error if -f/-F
3850 are used without -shared.
3851 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
3853 2011-07-02 Ian Lance Taylor <iant@google.com>
3855 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
3857 2011-07-01 Ian Lance Taylor <iant@google.com>
3861 * resolve.cc (Symbol::override_base_with_special): Don't override
3862 the version if the overriding symbol has a different name.
3863 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
3864 all callers. If we give an error about an undefined version,
3865 define the base version if necessary.
3866 * dynobj.h (class Versions): Update declaration.
3867 * testsuite/weak_alias_test_5.cc: New file.
3868 * testsuite/weak_alias_test.script: New file.
3869 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
3870 and versioned_alias have the right value, and call t2.
3871 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
3872 weak_alias_test_5.so.
3873 (weak_alias_test_LDADD): Likewise.
3874 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
3875 * testsuite/Makefile.in: Rebuild.
3877 2011-07-01 Ian Lance Taylor <iant@google.com>
3880 * options.h (class General_options): Support -z notext.
3881 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
3883 (two_file_shared_nonpic.so): Likewise.
3884 (two_file_shared_mixed.so): Likewise.
3885 (two_file_shared_mixed_1.so): Likewise.
3886 (weak_undef_lib_nonpic.so): Likewise.
3887 (alt/weak_undef_lib_nonpic.so): Likewise.
3888 (tls_test_shared_nonpic.so): Likewise.
3889 * testsuite/Makefile.in: Rebuild.
3891 2011-07-01 Ian Lance Taylor <iant@google.com>
3894 * configure.ac: Test whether static linking works, setting
3895 the automake conditional HAVE_STATIC.
3896 * testsuite/Makefile.am: Disable tests using -static if
3897 HAVE_STATIC is not true.
3898 * configure, testsuite/Makefile.in: Rebuild.
3900 2011-07-01 Ian Lance Taylor <iant@google.com>
3903 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
3904 Assert if we see DW_EH_PE_indirect.
3905 * target.h (Target::ehframe_datarel_base): New function.
3906 (Target::do_ehframe_datarel_base): New target function.
3907 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
3908 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
3911 2011-07-01 Ian Lance Taylor <iant@google.com>
3914 * options.h (class General_options): Add
3915 --ld-generated-unwind-info.
3916 * ehframe.cc (Fde::write): Add address parameter. Change all
3917 callers. If associated with PLT, fill in address and size.
3918 (Cie::set_output_offset): Only add merge mapping if there is an
3920 (Cie::write): Add address parameter. Change all callers.
3921 (Eh_frame::add_ehframe_for_plt): New function.
3922 * ehframe.h (class Fde): Update declarations. Move shndx_ and
3923 input_offset_ fields into union u_, with new plt field.
3924 (Fde::Fde): Adjust for new union field.
3925 (Fde::Fde) [Output_data version]: New constructor.
3926 (Fde::add_mapping): Only add merge mapping if there is an object.
3927 (class Cie): Update declarations.
3928 (class Eh_frame): Declare add_ehframe_for_plt.
3929 * layout.cc (Layout::layout_eh_frame): Break out code into
3930 make_eh_frame_section, and call it.
3931 (Layout::make_eh_frame_section): New function.
3932 (Layout::add_eh_frame_for_plt): New function.
3933 * layout.h (class Layout): Update declarations.
3934 * merge.cc (Merge_map::add_mapping): Add assertion.
3935 * i386.cc: Include "dwarf.h".
3936 (class Output_data_plt_i386): Make first_plt_entry,
3937 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
3938 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3939 and plt_eh_frame_fde.
3940 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
3941 boundary. Call add_eh_frame_for_plt if appropriate.
3942 * x86_64.cc: Include "dwarf.h".
3943 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
3944 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
3945 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3946 and plt_eh_frame_fde.
3947 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
3950 2011-06-29 Ian Lance Taylor <iant@google.com>
3953 * object.cc (Sized_relobj_file::layout_section): Change shdr
3954 parameter to be const.
3955 (Sized_relobj_file::layout_eh_frame_section): New function, broken
3957 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
3958 appropriate. Call layout_eh_frame_section.
3959 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
3961 * object.h (class Sized_relobj_file): Update declarations.
3963 2011-06-29 Ian Lance Taylor <iant@google.com>
3966 * script.cc (Token::integer_value): Accept trailing M/m/K/k
3968 (Lex::gather_token): Accept trailing M/m/K/k for integers.
3970 2011-06-29 Ian Lance Taylor <iant@google.com>
3973 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
3975 * layout.cc (Layout::layout_eh_frame): Likewise.
3977 2011-06-29 Ian Lance Taylor <iant@google.com>
3980 * layout.cc (Layout::symtab_section_shndx): New function.
3981 * layout.h (class Layout): Declare symtab_section_shndx.
3982 * output.cc (Output_section::write_header): Call it.
3984 2011-06-29 Ian Lance Taylor <iant@google.com>
3987 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
3988 symbols which are not used in a relocation.
3990 2011-06-28 Ian Lance Taylor <iant@google.com>
3993 * layout.cc (Layout::segment_precedes): Don't crash if a linker
3994 script create indistinguishable segments.
3995 (Layout::set_segment_offsets): Use stable_sort when sorting
3996 segments. Pass this to Compare_segments constructor.
3997 * layout.h (class Layout): Make segment_precedes non-static.
3998 (class Compare_segments): Change from struct to class. Add
3999 layout_ field. Add constructor.
4000 * script-sections.cc
4001 (Script_sections::attach_sections_using_phdrs_clause): Rename
4002 local orphan to is_orphan. Don't report failure to put empty
4003 section in segment. On attachment failure, report name of
4004 section, and attach to first PT_LOAD segment.
4006 2011-06-28 Ian Lance Taylor <iant@google.com>
4009 * target-select.cc (Target_selector::Target_selector): Add
4010 emulation parameter. Change all callers.
4011 (select_target_by_bfd_name): Rename from select_target_by_name.
4013 (select_target_by_emulation): New function.
4014 (supported_emulation_names): New function.
4015 * target-select.h (class Target_selector): Add emulation_ field.
4016 Update declarations.
4017 (Target_selector::recognize_by_bfd_name): Rename from
4018 recognize_by_name. Change all callers.
4019 (Target_selector::supported_bfd_names): Rename from
4020 supported_names. Change all callers.
4021 (Target_selector::recognize_by_emulation): New function.
4022 (Target_selector::supported_emulations): New function.
4023 (Target_selector::emulation): New function.
4024 (Target_selector::do_recognize_by_bfd_name): Rename from
4025 do_recognize_by_name. Change all callers.
4026 (Target_selector::do_supported_bfd_names): Rename from
4027 do_supported_names. Change all callers.
4028 (Target_selector::do_recognize_by_emulation): New function.
4029 (Target_selector::do_supported_emulations): New function.
4030 (select_target_by_bfd_name): Change name in declaration.
4031 (select_target_by_emulation): Declare.
4032 (supported_emulation_names): Declare.
4033 * parameters.cc (parameters_force_valid_target): Try to find
4034 target based on emulation from -m option.
4035 * options.h (class General_options): Change doc string for -m.
4036 * options.cc (help): Print emulations.
4037 (General_options::parse_V): Likewise.
4038 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
4039 Add emulation parameter. Change all callers.
4041 2011-06-28 Ian Lance Taylor <iant@google.com>
4043 * target.h (class Target): Add osabi_ field.
4044 (Target::osabi): New function.
4045 (Target::set_osabi): New function.
4046 (Target::Target): Initialize osabi_.
4047 (Target::do_adjust_elf_header): Make pure virtual.
4048 (Sized_target::do_adjust_elf_header): Declare.
4049 * target.cc (Sized_target::do_adjust_elf_header): New function.
4050 (class Sized_target): Instantiate all versions.
4051 * freebsd.h (class Target_freebsd): Remove.
4052 (Target_selector_freebsd::do_recognize): Call set_osabi on
4054 (Target_selector_freebsd::do_recognize_by_name): Likewise.
4055 (Target_selector_freebsd::set_osabi): Remove.
4056 * i386.cc (class Target_i386): Inherit from Sized_target rather
4057 than Target_freebsd.
4058 * x86_64.cc (class Target_x86_64): Likewise.
4060 2011-06-28 Ian Lance Taylor <iant@google.com>
4062 * target.h (Target::can_check_for_function_pointers): Rewrite.
4064 (Target::can_icf_inline_merge_sections): Likewise.
4065 (Target::section_may_have_icf_unsafe_poineters): Likewise.
4066 (Target::Target_info): Add can_icf_inline_merge_sections field.
4067 (Target::do_can_check_for_function_pointers): New virtual
4069 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
4070 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
4071 from can_check_for_function_pointers, move in file.
4072 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
4073 section_may_have_icf_unsafe_poineters, move in file.
4074 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
4075 * i386.cc (Target_i386::do_can_check_for_function_pointers):
4076 Rename from can_check_for_function_pointers, move in file.
4077 (Target_i386::can_icf_inline_merge_sections): Remove.
4078 (Target_i386::i386_info): Initialize
4079 can_icf_inline_merge_sections.
4080 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
4081 Initialize can_icf_inline_merge_sections.
4082 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
4083 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
4084 Rename from can_check_for_function_pointers, move in file.
4085 (Target_x86_64::can_icf_inline_merge_sections): Remove.
4086 (Target_x86_64::x86_64_info): Initialize
4087 can_icf_inline_merge_sections.
4088 * testsuite/testfile.cc (Target_test::test_target_info):
4090 * icf.cc (get_section_contents): Correct formatting.
4092 2011-06-27 Ian Lance Taylor <iant@google.com>
4094 * symtab.cc (Symbol::versioned_name): New function.
4095 (Symbol_table::add_to_final_symtab): Use versioned_name when
4097 (Symbol_table::sized_write_symbol): Likewise.
4098 * symtab.h (class Symbol): Declare versioned_name.
4099 * stringpool.h (class Stringpool_template): Add variant of add
4100 which takes a std::basic_string.
4101 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
4102 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
4103 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
4104 (ver_test_12.o): New target.
4105 * testsuite/Makefile.in: Rebuild.
4107 2011-06-27 Doug Kwan <dougkwan@google.com>
4109 * arm.cc (Arm_relocate_functions::thm_jump8,
4110 Arm_relocate_functions::thm_jump11): Use a wider signed
4111 type to compute offset.
4112 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
4114 * testsuite/Makefile.in: Regenerate.
4115 * testsuite/arm_branch_in_range.sh: Check test results of
4116 arm_thm_jump11 and arm_thm_jump8.
4117 * testsuite/arm_thm_jump11.s: New test source file.
4118 * testsuite/arm_thm_jump11.t: New linker script.
4119 * testsuite/arm_thm_jump8.s: New test source file.
4120 * testsuite/arm_thm_jump8.t: New linker script.
4122 2011-06-24 Ian Lance Taylor <iant@google.com>
4124 * layout.cc: Include "object.h".
4125 (ctors_sections_in_init_array): New static variable.
4126 (Layout::is_ctors_in_init_array): New function.
4127 (Layout::layout): Add entry to ctors_sections_in_init_array if
4129 * layout.h (class Layout): Declare is_ctors_in_init_array.
4130 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
4131 is_ctors_reverse_view is set.
4132 (Sized_relobj_file::write_sections): Add layout parameter. Change
4133 all callers. Set is_ctors_reverse_view field of View_size.
4134 (Sized_relobj_file::reverse_words): New function.
4135 * object.h (Sized_relobj_file::View_size): Add
4136 is_ctors_reverse_view field.
4137 (class Sized_relobj_file): Update declarations.
4138 * testsuite/initpri3.c: New test.
4139 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
4141 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
4142 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
4143 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
4144 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
4145 * testsuite/Makefile.in: Rebuild.
4147 2011-06-24 Cary Coutant <ccoutant@google.com>
4149 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
4150 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
4151 (debug_msg_cdebug.err): New targets.
4152 * testsuite/Makefile.in: Regenerate.
4153 * testsuite/debug_msg.sh: Check output of link with compressed debug.
4154 Fix checks for link with shared library.
4156 2011-06-24 Doug Kwan <dougkwan@google.com>
4158 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
4159 skip empty text sections.
4160 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
4162 2011-06-22 Ian Lance Taylor <iant@google.com>
4165 * options.h (class General_options): Add --ctors-in-init-array.
4166 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
4167 friends as SHT_PROGBITS for merging sections.
4168 (Layout::layout): Remove special handling of .init_array and
4169 friends. Don't sort if doing relocatable link. Sort for .ctors
4170 and .dtors if ctors_in_init_array.
4171 (Layout::make_output_section): Force correct section types for
4172 .init_array and friends. Don't sort if doing relocatable link,
4173 Don't sort .ctors and .dtors if ctors_in_init_array.
4174 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
4175 (Layout::output_section_name): Add relobj parameter. Change all
4176 callers. Handle .ctors. and .dtors. in code rather than table.
4177 Handle .ctors and .dtors if ctors_in_init_array.
4178 (Layout::match_file_name): New function, moved from output.cc.
4179 * layout.h (class Layout): Update declarations.
4180 * output.cc: Include "layout.h".
4181 (Input_section_sort_entry::get_priority): New function.
4182 (Input_section_sort_entry::match_file_name): Just call
4183 Layout::match_file_name.
4184 (Output_section::Input_section_sort_init_fini_compare::operator()):
4185 Handle .ctors and .dtors. Sort by explicit priority rather than
4187 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
4188 * testsuite/initpri2.c: New test.
4189 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
4190 (check_PROGRAMS): Add initpri2.
4191 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
4192 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
4193 * configure, testsuite/Makefile.in: Rebuild.
4195 2011-06-19 Ian Lance Taylor <iant@google.com>
4198 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
4199 .interp section to a PT_INTERP segment even if we have seen a
4200 --dynamic-linker option. Don't do it if we have seen a PHDRS
4201 clause in a linker script.
4202 (Layout::finalize): Don't create a .interp section if we've
4203 already create a PT_INTERP segment.
4204 (Layout::create_interp): Always call choose_output_section (revert
4205 patch of 2011-06-17). Don't create PT_INTERP segment.
4206 * script-sections.cc
4207 (Script_sections::create_note_and_tls_segments): Add a .interp
4208 section to a PT_INTERP segment even if we have seen a
4209 --dynamic-linker option.
4211 2011-06-18 Ian Lance Taylor <iant@google.com>
4213 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
4214 merely because a non-PT_LOAD segment has a dynamic reloc.
4216 2011-06-18 Ian Lance Taylor <iant@google.com>
4218 * layout.cc (Layout::finish_dynamic_section): Don't create
4219 DT_FLAGS entry if not needed.
4221 2011-06-18 Ian Lance Taylor <iant@google.com>
4224 * layout.cc (Layout::layout_eh_frame): Correct handling of
4225 writable .eh_frame section.
4227 2011-06-17 Ian Lance Taylor <iant@google.com>
4230 * resolve.cc (Symbol_table::resolve): Don't give an error if a
4231 symbol is redefined with the exact same object and value.
4233 2011-06-17 Ian Lance Taylor <iant@google.com>
4236 * layout.h (class Layout): Add interp_segment_ field.
4237 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
4238 (Layout::attach_allocated_section_to_segment): If making shared
4239 library, put .interp section in PT_INTERP segment.
4240 (Layout::finalize): Also call create_interp if -dynamic-linker
4242 (Layout::create_interp): Assert that there is no PT_INTERP
4243 segment. If not using a SECTIONS clause, use make_output_section.
4244 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
4245 * script-sections.cc
4246 (Script_sections::create_note_and_tls_segments): If making shared
4247 library, put .interp section in PT_INTERP segment.
4249 2011-06-17 Ian Lance Taylor <iant@google.com>
4251 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
4252 when making a shared library.
4254 2011-06-17 Ian Lance Taylor <iant@google.com>
4256 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
4257 parameter. Change all callers. Don't issue warning about PC32
4258 against locally defined symbol.
4260 2011-06-16 Ian Lance Taylor <iant@google.com>
4262 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
4263 occurs in same object.
4265 2011-06-14 Alan Modra <amodra@gmail.com>
4267 * po/POTFILES.in: Regenerate.
4269 2011-06-09 Ian Lance Taylor <iant@google.com>
4271 * script-sections.cc
4272 (Orphan_output_section::set_section_addresses): For a relocatable
4273 link set address to 0.
4275 2011-06-09 Cary Coutant <ccoutant@google.com>
4278 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
4279 used with --compress-debug-sections.
4280 * gold/object.cc (Sized_relobj_file::do_layout): Report
4281 uncompressed size of compressed input sections.
4283 2011-06-08 Cary Coutant <ccoutant@google.com>
4286 * testsuite/two_file_test_2_v1.cc: Change initialization of
4287 v2 to keep it in .data.
4289 2011-06-07 Cary Coutant <ccoutant@google.com>
4291 * common.cc (Symbol_table::do_allocate_commons_list): Call
4293 * errors.cc (Errors::fatal): Adjust call to gold_exit.
4294 (Errors::fallback): New function.
4295 (gold_fallback): New function.
4296 * errors.h (Errors::fallback): New function.
4297 * gold.cc (gold_exit): Change status parameter to enum; adjust
4299 (queue_initial_tasks): Call gold_fallback.
4300 * gold.h: Include cstdlib.
4301 (Exit_status): New enum type.
4302 (gold_exit): Change status parameter to enum.
4303 (gold_fallback): New function.
4304 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
4305 (Layout::create_symtab_sections): Likewise.
4306 (Layout::create_shdrs): Likewise.
4307 * main.cc (main): Adjust call to gold_exit.
4308 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
4309 (Output_data_got::add_got_entry_pair): Likewise.
4310 (Output_section::add_input_section): Likewise.
4311 (Output_section::add_output_section_data): Likewise.
4312 (Output_segment::set_section_list_addresses): Likewise.
4313 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
4315 2011-06-07 Cary Coutant <ccoutant@google.com>
4317 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
4318 for incremental links.
4319 * output.cc (Output_segment::set_section_list_addresses): Remove
4320 FIXME and test for TLS or BSS.
4322 2011-06-07 Cary Coutant <ccoutant@google.com>
4324 * testsuite/Makefile.am: Add incremental_copy_test,
4325 incremental_common_test_1.
4326 * testsuite/Makefile.in: Regenerate.
4327 * testsuite/common_test_1_v1.c: New source file.
4328 * testsuite/common_test_1_v2.c: New source file.
4329 * testsuite/copy_test_v1.cc: New source file.
4331 2011-06-07 Cary Coutant <ccoutant@google.com>
4333 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
4334 update, allocate common from bss section's free list.
4335 * incremental-dump.cc (dump_incremental_inputs): Print flag for
4336 linker-defined symbols.
4337 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4338 Skip GOT and PLT entries that are no longer referenced.
4339 (Output_section_incremental_inputs::write_info_blocks): Mark
4340 linker-defined symbols.
4341 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
4342 * output.cc (Output_section::allocate): New function.
4343 * output.h (Output_section::allocate): New function.
4344 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
4345 linker-defined symbols.
4346 (Symbol::override_base_with_special): Copy is_predefined_ flag.
4347 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
4348 (Symbol::init_base_output_data): Likewise.
4349 (Symbol::init_base_output_segment): Likewise.
4350 (Symbol::init_base_constant): Likewise.
4351 (Sized_symbol::init_output_data): Likewise.
4352 (Sized_symbol::init_output_segment): Likewise.
4353 (Sized_symbol::init_constant): Likewise.
4354 (Symbol_table::do_define_in_output_data): Likewise.
4355 (Symbol_table::do_define_in_output_segment): Likewise.
4356 (Symbol_table::do_define_as_constant): Likewise.
4357 * symtab.h (Symbol::is_predefined): New function.
4358 (Symbol::init_base_output_data): Add is_predefined parameter.
4359 (Symbol::init_base_output_segment): Likewise.
4360 (Symbol::init_base_constant): Likewise.
4361 (Symbol::is_predefined_): New data member.
4362 (Sized_symbol::init_output_data): Add is_predefined parameter.
4363 (Sized_symbol::init_output_segment): Likewise.
4364 (Sized_symbol::init_constant): Likewise.
4365 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
4367 2011-06-07 Cary Coutant <ccoutant@google.com>
4369 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
4370 instead of emit_copy_reloc.
4371 (Copy_relocs::emit_copy_reloc): Refactor.
4372 (Copy_relocs::make_copy_reloc): New function.
4373 (Copy_relocs::add_copy_reloc): Remove.
4374 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
4376 (Copy_relocs::make_copy_reloc): New function.
4377 (Copy_relocs::add_copy_reloc): Remove.
4378 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
4379 unchanged input files.
4380 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
4381 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
4382 Reserve BSS space for COPY relocations.
4383 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4384 (Output_section_incremental_inputs::write_info_blocks): Record
4385 whether a symbol is copied from a shared object.
4386 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
4387 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
4388 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
4389 (Incremental_input_entry_reader::get_output_symbol_index): Add
4391 (Incremental_binary::emit_copy_relocs): New function.
4392 (Incremental_binary::do_emit_copy_relocs): New function.
4393 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4395 (Sized_incremental_binary::add_copy_reloc): New function.
4396 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4397 (Sized_incremental_binary::Copy_reloc): New struct.
4398 (Sized_incremental_binary::Copy_relocs): New typedef.
4399 (Sized_incremental_binary::copy_relocs_): New data member.
4400 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
4401 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
4402 * target.h (Sized_target::emit_copy_reloc): New function.
4403 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
4405 2011-06-02 Cary Coutant <ccoutant@google.com>
4408 * gold/archive.cc (Archive::Archive): Initialize new data member.
4409 (Archive::include_all_members): Return if archive has already been
4411 * gold/archive.h (Archive::include_all_members_): New data member.
4413 2011-06-02 Nick Clifton <nickc@redhat.com>
4415 * dynobj.h: Fix spelling mistake in comment.
4416 * output.cc: Likewise.
4418 2011-05-31 Doug Kwan <dougkwan@google.com>
4422 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
4423 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
4424 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
4425 redundant arm_exidx_test.so.
4426 * testsuite/Makefile.in: Regenerate.
4427 (check_SCRIPTS): Add pr12826.sh
4428 (check_DATA): Add pr12826.stdout
4429 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
4430 * testsuite/pr12826.sh: New file.
4431 * testsuite/pr12826_1.s: Ditto.
4432 * testsuite/pr12826_1.s: Ditto.
4434 2011-05-30 Ian Lance Taylor <iant@google.com>
4436 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
4439 2011-05-29 Ian Lance Taylor <iant@google.com>
4442 * testsuite/Makefile.am: Use different file name for two_file_test
4443 temporary file for each incremental test.
4444 * testsuite/Makefile.in: Rebuild.
4446 2011-05-29 Ian Lance Taylor <iant@google.com>
4448 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
4449 binary input file is empty.
4451 2011-05-27 Ian Lance Taylor <iant@google.com>
4453 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
4454 (ver_test_9.so): Likewise.
4455 * testsuite/Makefile.in: Rebuild.
4457 2011-05-26 Cary Coutant <ccoutant@google.com>
4459 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
4460 * incremental.cc (Incremental_inputs::report_input_section): Fix
4461 comment, indentation.
4462 (Incremental_inputs::report_comdat_group): New function.
4463 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4464 of data for incremental input file entry.
4465 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
4466 group count, COMDAT group signatures.
4467 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
4468 an unchanged input file.
4469 * incremental.h (Incremental_object_entry::Incremental_object_entry):
4470 Initialize new data member.
4471 (Incremental_object_entry::add_comdat_group): New function.
4472 (Incremental_object_entry::get_comdat_group_count): New function.
4473 (Incremental_object_entry::get_comdat_signature_key): New function.
4474 (Incremental_object_entry::groups_): New data member.
4475 (Incremental_inputs::report_comdat_group): New function.
4476 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
4477 data for incremental input file entry.
4478 (Incremental_input_entry_reader::get_comdat_group_count): New function.
4479 (Incremental_input_entry_reader::get_input_section): Adjust size of
4480 data for incremental input file entry.
4481 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
4482 (Incremental_input_entry_reader::get_comdat_group_signature): New
4484 * object.cc (Sized_relobj::include_section_group): Report kept
4485 COMDAT groups for incremental links.
4487 2011-05-24 David Meyer <pdox@google.com>
4489 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
4490 with name parameter. Add found_name parameter.
4491 * fileread.cc (Input_file::find_file): Adjust code accordingly.
4492 * dirsearch.h (class Dirsearch): Update declaration.
4494 2011-05-24 Ian Lance Taylor <iant@google.com>
4496 * archive.cc (Library_base::should_include_member): Pull in object
4497 from archive if it defines the entry symbol.
4498 * parameters.cc (Parameters::entry): New function.
4499 * parameters.h (class Parameters): Declare entry.
4500 * output.h (class Output_file_header): Remove entry_ field.
4501 * output.cc (Output_file_header::Output_file_header): Remove entry
4502 parameter. Change all callers.
4503 (Output_file_header::entry): Use parameters->entry.
4504 * gold.cc (queue_middle_tasks): Likewise.
4505 * plugin.cc (Plugin_hook::run): Likewise.
4507 2011-05-24 Cary Coutant <ccoutant@google.com>
4509 * gold.cc (queue_initial_tasks): Pass incremental base filename
4510 to Output_file::open_base_file; don't print error message.
4511 * incremental-dump.cc (main): Adjust call to
4512 Output_file::open_for_modification.
4513 * incremental-dump.cc (main): Likewise.
4514 * incremental.cc (Incremental_inputs::report_command_line):
4515 Ignore --incremental-base option when comparing command lines.
4516 Ignore parameter when given as separate argument.
4517 * options.h (class General_options): Add --incremental-base.
4518 * output.cc (Output_file::Output_file):
4519 (Output_file::open_base_file): Add base_name and writable parameters;
4520 read base file into new file; print error message here.
4521 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4523 * output.h (Output_file::open_for_modification): Rename to...
4524 (Output_file::open_base_file): ...this; add base_name and
4525 writable parameters; adjust all callers.
4526 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4528 * testsuite/Makefile.am (incremental_test_4): Test
4530 * testsuite/Makefile.in: Regenerate.
4532 2011-05-24 Cary Coutant <ccoutant@google.com>
4534 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
4536 * testsuite/Makefile.in: Regenerate.
4537 * testsuite/two_file_test_1_v1.cc: New test source file.
4538 * testsuite/two_file_test_1b_v1.cc: New test source file.
4539 * testsuite/two_file_test_2_v1.cc: New test source file.
4541 2011-05-24 Cary Coutant <ccoutant@google.com>
4543 * dynobj.h (Dynobj::do_dynobj): New function.
4544 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
4545 flag and soname for shared objects.
4546 * incremental.cc (Incremental_inputs::report_object): Make
4547 either Incremental_object_entry or Incremental_dynobj_entry; add
4548 soname to string table.
4549 (Incremental_inputs::report_input_section): Add assertion.
4550 (Output_section_incremental_inputs::set_final_data_size): Adjust
4551 type of input file entry for shared libraries; adjust size of
4552 shared library info entry.
4553 (Output_section_incremental_inputs::write_input_files): Write
4554 as_needed flag for shared libraries.
4555 (Output_section_incremental_inputs::write_info_blocks): Adjust type
4556 of input file entry for shared libraries; write soname.
4557 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
4558 soname from incremental info.
4559 * incremental.h (enum Incremental_input_flags): Add
4560 INCREMENTAL_INPUT_AS_NEEDED.
4561 (Incremental_input_entry::Incremental_input_entry): Initialize new
4563 (Incremental_input_entry::set_as_needed): New function.
4564 (Incremental_input_entry::as_needed): New function.
4565 (Incremental_input_entry::do_dynobj_entry): New function.
4566 (Incremental_input_entry::as_needed_): New data member.
4567 (Incremental_object_entry::Incremental_object_entry): Don't check
4569 (Incremental_object_entry::do_type): Likewise.
4570 (class Incremental_dynobj_entry): New class.
4571 (Incremental_input_entry_reader::as_needed): New function.
4572 (Incremental_input_entry_reader::get_soname): New function.
4573 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
4574 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
4575 size of shared library info entry.
4576 * layout.cc (Layout::finish_dynamic_section): Don't test for
4577 incremental link when adding DT_NEEDED entries.
4578 * object.h (Object::Object): Initialize new data member.
4579 (Object::dynobj): New function.
4580 (Object::set_as_needed): New function.
4581 (Object::as_needed): New function.
4582 (Object::do_dynobj): New function.
4583 (Object::as_needed_): New data member.
4585 2011-05-24 Cary Coutant <ccoutant@google.com>
4587 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
4588 info; adjust display of GOT entries.
4589 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4590 vector of input objects; remove file_status_.
4591 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
4592 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
4593 got_plt reader; call target hooks to reserve GOT entries.
4594 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4595 of input file info header and GOT info entry.
4596 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
4598 (Got_plt_view_info::got_descriptor): Remove.
4599 (Got_plt_view_info::sym_index): New data member.
4600 (Got_plt_view_info::input_index): New data member.
4601 (Local_got_offset_visitor::visit): Write input file index.
4602 (Global_got_offset_visitor::visit): Write 0 for input file index.
4603 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
4604 with sym_index and input_index.
4605 (Output_section_incremental_inputs::write_got_plt): Adjust size of
4606 incremental info GOT entry; replace got_descriptor with input_index.
4607 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
4608 map from input file index to object.
4609 (Sized_relobj_incr::do_layout): Replace direct data member reference
4610 with accessor function.
4611 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
4612 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
4613 Adjust size of input file info header.
4614 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
4615 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
4616 (Incremental_input_entry_reader::get_input_section): Adjust size of
4617 input file info header.
4618 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
4619 of incremental info GOT entry.
4620 (Incremental_got_plt_reader::get_got_desc): Remove.
4621 (Incremental_got_plt_reader::get_got_symndx): New function.
4622 (Incremental_got_plt_reader::get_got_input_index): New function.
4623 (Sized_incremental_binary::Sized_incremental_binary): Remove
4624 file_status_; add input_objects_.
4625 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
4626 (Sized_incremental_binary::set_file_is_unchanged): Remove.
4627 (Sized_incremental_binary::file_is_unchanged): Remove.
4628 (Sized_incremental_binary::set_input_object): New function.
4629 (Sized_incremental_binary::input_object): New function.
4630 (Sized_incremental_binary::file_status_): Remove.
4631 (Sized_incremental_binary::input_objects_): New data member.
4632 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
4634 (Sized_relobj_incr::invalid_address): Move to base class.
4635 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
4637 (Sized_relobj_incr::do_output_section_offset): Likewise.
4638 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
4639 (Sized_relobj_incr::section_offsets_): Likewise.
4640 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
4642 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
4643 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
4644 with accessor function.
4645 (Sized_relobj_file::do_layout): Likewise.
4646 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
4647 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
4648 (Sized_relobj_file::compute_final_local_value): Replace refs to
4649 section_offsets_ with accessor function.
4650 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
4651 * object.h (Relobj::Relobj): Initialize new data members.
4652 (Relobj::add_dyn_reloc): New function.
4653 (Relobj::first_dyn_reloc): New function.
4654 (Relobj::dyn_reloc_count): New function.
4655 (Relobj::first_dyn_reloc_): New data member.
4656 (Relobj::dyn_reloc_count_): New data member.
4657 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
4659 (Sized_relobj::Address): New typedef.
4660 (Sized_relobj::invalid_address): Move here from child class.
4661 (Sized_relobj::Sized_relobj): Initialize new data members.
4662 (Sized_relobj::sized_relobj): New function.
4663 (Sized_relobj::is_output_section_offset_invalid): Move here from
4665 (Sized_relobj::get_output_section_offset): Likewise.
4666 (Sized_relobj::local_has_got_offset): Likewise.
4667 (Sized_relobj::local_got_offset): Likewise.
4668 (Sized_relobj::set_local_got_offset): Likewise.
4669 (Sized_relobj::do_for_all_local_got_entries): Likewise.
4670 (Sized_relobj::clear_got_offsets): New function.
4671 (Sized_relobj::section_offsets): Move here from child class.
4672 (Sized_relobj::do_output_section_offset): Likewise.
4673 (Sized_relobj::do_set_section_offset): Likewise.
4674 (Sized_relobj::Local_got_offsets): Likewise.
4675 (Sized_relobj::local_got_offsets_): Likewise.
4676 (Sized_relobj::section_offsets_): Likewise.
4677 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
4679 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
4681 (Sized_relobj_file::sized_relobj): New function
4682 (Sized_relobj_file::local_has_got_offset): Move to base class.
4683 (Sized_relobj_file::local_got_offset): Likewise.
4684 (Sized_relobj_file::set_local_got_offset): Likewise.
4685 (Sized_relobj_file::get_output_section_offset): Likewise.
4686 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
4687 (Sized_relobj_file::do_output_section_offset): Likewise.
4688 (Sized_relobj_file::do_set_section_offset): Likewise.
4689 (Sized_relobj_file::Local_got_offsets): Likewise.
4690 (Sized_relobj_file::local_got_offsets_): Likewise.
4691 (Sized_relobj_file::section_offsets_): Likewise.
4692 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
4694 (set_needs_dynsym_index): Convert relobj to derived class pointer.
4695 (Output_reloc::get_symbol_index): Likewise.
4696 (Output_reloc::local_section_offset): Likewise.
4697 (Output_reloc::get_address): Likewise.
4698 (Output_reloc::symbol_value): Likewise.
4699 (Output_data_got::reserve_slot): Move to class definition.
4700 (Output_data_got::reserve_local): New function.
4701 (Output_data_got::reserve_slot_for_global): Remove.
4702 (Output_data_got::reserve_global): New function.
4703 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
4704 (all constructors, two instantiations).
4705 (Output_reloc::get_relobj): New function (two instantiations).
4706 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
4707 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
4708 (Output_data_reloc::add_global): Adjust type of relobj.
4709 (Output_data_reloc::add_global_relative): Likewise.
4710 (Output_data_reloc::add_symbolless_global_addend): Likewise.
4711 (Output_data_reloc::add_local): Likewise.
4712 (Output_data_reloc::add_local_relative): Likewise.
4713 (Output_data_reloc::add_symbolless_local_addend): Likewise.
4714 (Output_data_reloc::add_local_section): Likewise.
4715 (Output_data_reloc::add_output_section): Likewise.
4716 (Output_data_reloc::add_absolute): Likewise.
4717 (Output_data_reloc::add_target_specific): Likewise.
4718 (Output_data_got::reserve_slot): Move definition here.
4719 (Output_data_got::reserve_local): New function.
4720 (Output_data_got::reserve_global): New function.
4721 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
4722 section_offsets_ with accessor function.
4723 (Sized_relobj_file::write_sections): Likewise.
4724 (Sized_relobj_file::do_relocate_sections): Likewise.
4725 * target.h (Sized_target::reserve_local_got_entry): New function.
4726 (Sized_target::reserve_global_got_entry): New function.
4727 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
4728 (Target_x86_64::reserve_global_got_entry): New function.
4729 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
4731 2011-05-23 Cary Coutant <ccoutant@google.com>
4733 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
4734 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
4735 bit when checking got_type.
4736 * incremental.cc (Sized_incremental_binary::setup_readers):
4737 Store symbol table and string table locations; initialize bit vector
4738 of file status flags.
4739 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
4741 (Sized_incremental_binary::do_process_got_plt): New function.
4742 (Sized_incremental_binary::get_symtab_view): Use stored locations.
4743 (Output_section_incremental_inputs::set_final_data_size): Record
4744 file index for each input file.
4745 (Output_section_incremental_inputs::write_got_plt): Store file index
4746 instead of input entry offset for each GOT entry.
4748 (Incremental_input_entry::Incremental_input_entry): Initialize new
4750 (Incremental_input_entry::set_offset): Store file index.
4751 (Incremental_input_entry::get_file_index): New function.
4752 (Incremental_input_entry::file_index_): New data member.
4753 (Incremental_binary::process_got_plt): New function.
4754 (Incremental_binary::do_process_got_plt): New function.
4755 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4757 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
4758 (Sized_incremental_binary::set_file_is_unchanged): New function.
4759 (Sized_incremental_binary::file_is_unchanged): New function.
4760 (Sized_incremental_binary::do_process_got_plt): New function.
4761 (Sized_incremental_binary::file_status_): New data member.
4762 (Sized_incremental_binary::main_symtab_loc_): New data member.
4763 (Sized_incremental_binary::main_strtab_loc_): New data member.
4764 * output.cc (Output_data_got::Got_entry::write): Add case
4766 (Output_data_got::add_global): Call add_got_entry.
4767 (Output_data_got::add_global_plt): Likewise.
4768 (Output_data_got::add_global_with_rel): Likewise.
4769 (Output_data_got::add_global_with_rela): Likewise.
4770 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
4771 (Output_data_got::add_global_pair_with_rela): Likewise.
4772 (Output_data_got::add_local): Call add_got_entry.
4773 (Output_data_got::add_local_plt): Likewise.
4774 (Output_data_got::add_local_with_rel): Likewise.
4775 (Output_data_got::add_local_with_rela): Likewise.
4776 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
4777 (Output_data_got::add_local_pair_with_rela): Likewise.
4778 (Output_data_got::reserve_slot): New function.
4779 (Output_data_got::reserve_slot_for_global): New function.
4780 (Output_data_got::add_got_entry): New function.
4781 (Output_data_got::add_got_entry_pair): New function.
4782 (Output_section::add_output_section_data): Edit FIXME.
4784 (Output_section_data_build::Output_section_data_build): New
4785 constructor with size parameter.
4786 (Output_data_space::Output_data_space): Likewise.
4787 (Output_data_got::Output_data_got): Initialize new data member; new
4788 constructor with size parameter.
4789 (Output_data_got::add_constant): Call add_got_entry.
4790 (Output_data_got::reserve_slot): New function.
4791 (Output_data_got::reserve_slot_for_global): New function.
4792 (class Output_data_got::Got_entry): Add RESERVED_CODE.
4793 (Output_data_got::add_got_entry): New function.
4794 (Output_data_got::add_got_entry_pair): New function.
4795 (Output_data_got::free_list_): New data member.
4796 * target.h (Sized_target::init_got_plt_for_update): New function.
4797 (Sized_target::register_global_plt_entry): New function.
4798 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4799 Initialize new data member; call init; add constructor with PLT count.
4800 (Output_data_plt_x86_64::init): New function.
4801 (Output_data_plt_x86_64::add_relocation): New function.
4802 (Output_data_plt_x86_64::reserve_slot): New function.
4803 (Output_data_plt_x86_64::free_list_): New data member.
4804 (Target_x86_64::init_got_plt_for_update): New function.
4805 (Target_x86_64::register_global_plt_entry): New function.
4806 (Output_data_plt_x86_64::add_entry): Allocate from free list for
4807 incremental updates.
4808 (Output_data_plt_x86_64::add_relocation): New function.
4809 * testsuite/object_unittest.cc (Object_test): Set default options.
4811 2011-05-16 Ian Lance Taylor <iant@google.com>
4813 * options.h (class General_options): Make -i a synonym for -r.
4815 2011-05-16 Ian Lance Taylor <iant@google.com>
4817 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
4819 2011-05-10 Cary Coutant <ccoutant@google.com>
4821 * object.cc (Sized_relobj::do_count_local_symbols): Check for
4824 2011-05-06 Ian Lance Taylor <iant@google.com>
4826 * layout.cc (Layout::layout): If the output section flags change,
4827 update the ordering.
4829 2011-04-25 Cary Coutant <ccoutant@google.com>
4831 * incremental-dump.cc (dump_incremental_inputs): Print local
4832 symbol info for each input file.
4834 (Output_section_incremental_inputs::set_final_data_size): Add local
4835 symbol info to input file entries in incremental info.
4836 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4837 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
4838 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
4839 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
4841 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
4842 (Sized_incr_relobj::do_relocate): Write the local symbols.
4843 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
4844 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
4845 Adjust size of input file header.
4846 (Incremental_inputs_reader::get_local_symbol_offset): New function.
4847 (Incremental_inputs_reader::get_local_symbol_count): New function.
4848 (Incremental_inputs_reader::get_input_section): Adjust size of input
4850 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
4851 (Sized_incr_relobj::This): New typedef.
4852 (Sized_incr_relobj::sym_size): New const data member.
4853 (Sized_incr_relobj::Local_symbol): New struct.
4854 (Sized_incr_relobj::do_output_local_symbol_count): New function.
4855 (Sized_incr_relobj::do_local_symbol_offset): New function.
4856 (Sized_incr_relobj::local_symbol_count_): New data member.
4857 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
4858 (Sized_incr_relobj::local_symbol_index_): New data member.
4859 (Sized_incr_relobj::local_symbol_offset_): New data member.
4860 (Sized_incr_relobj::local_dynsym_offset_): New data member.
4861 (Sized_incr_relobj::local_symbols_): New data member.
4862 * object.h (Relobj::output_local_symbol_count): New function.
4863 (Relobj::local_symbol_offset): New function.
4864 (Relobj::do_output_local_symbol_count): New function.
4865 (Relobj::do_local_symbol_offset): New function.
4866 (Sized_relobj::do_output_local_symbol_count): New function.
4867 (Sized_relobj::do_local_symbol_offset): New function.
4869 2011-04-22 Vladimir Simonov <sv@sw.ru>
4871 * descriptors.cc (set_close_on_exec): New function.
4872 (Descriptors::open): Use set_close_on_exec.
4873 * output.cc (S_ISLNK): Define if not defined.
4875 2011-04-22 Cary Coutant <ccoutant@google.com>
4877 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4879 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4880 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
4881 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
4883 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
4884 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
4885 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
4887 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
4889 (Incremental_binary::apply_incremental_relocs): New function.
4890 (Incremental_binary::do_apply_incremental_relocs): New function.
4891 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4893 (Sized_incremental_binary::add_global_symbol): New function.
4894 (Sized_incremental_binary::global_symbol): New function.
4895 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4896 (Sized_incremental_binary::symbol_map_): New data member.
4897 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
4898 * target.h (Sized_target::apply_relocation): New function.
4899 * target-reloc.h (apply_relocation): New function.
4900 * x86_64.cc (Target_x86_64::apply_relocation): New function.
4902 2011-04-22 Doug Kwan <dougkwan@google.com>
4904 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
4905 flag of a SHT_ARM_EXIDX section.
4906 * testsuite/Makefile.am (arm_exidx_test): New test rules.
4907 * testsuite/Makefile.in: Regenerate.
4908 * testsuite/arm_exidx_test.s: New file.
4909 * testsuite/arm_exidx_test.sh: Same.
4911 2011-04-20 Cary Coutant <ccoutant@google.com>
4914 * archive.h (Incremental_archive_entry::Archive_member):
4915 Initialize arg_serial_ (second constructor).
4917 2011-04-17 Ian Lance Taylor <iant@google.com>
4919 * object.cc (Relocate_info::location): Simplify location string.
4920 * errors.cc (Errors::error_at_location): Don't print program
4922 (Errors::warning_at_location): Likewise.
4923 (Errors::undefined_symbol): Likewise.
4924 * testsuite/debug_msg.sh: Update accordingly.
4926 2011-04-14 Cary Coutant <ccoutant@google.com>
4928 * gold/layout.cc (Layout::symtab_section_offset): New function.
4929 * gold/layout.h (Layout::symtab_section_offset): New function.
4930 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
4932 2011-04-12 Ian Lance Taylor <iant@google.com>
4934 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
4935 with MREMAP_MAYMOVE.
4936 * output.h (class Output_file): Add map_is_allocated_ field.
4937 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
4938 not available, provide stubs. If mremap is not available, #define
4940 (MREMAP_MAYMOVE): Define if not defined.
4941 (Output_file::Output_file): Initialize map_is_allocated_.
4942 (Output_file::resize): Check map_is_allocated_.
4943 (Output_file::map_anonymous): If mmap fails, use malloc.
4944 (Output_file::unmap): Don't do anything for an anonymous map.
4945 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
4946 is not available, provide stubs.
4947 (File_read::View::~View): Use free rather than delete[].
4948 (File_read::make_view): Use malloc rather than new[]. If mmap
4950 (File_read::find_or_make_view): Use malloc rather than new[].
4951 * gold.h: Remove HAVE_REMAP code.
4952 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
4953 exists. Rename mremap to gold_mremap. If mmap is not available
4955 * configure, config.in: Rebuild.
4957 2011-04-11 Ian Lance Taylor <iant@google.com>
4959 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
4960 initialize local variable v.
4962 2011-04-11 Cary Coutant <ccoutant@google.com>
4964 * archive.cc (Archive::include_member): Adjust call to
4966 (Add_archive_symbols::run): Track argument serial numbers.
4967 (Lib_group::include_member): Likewise.
4968 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
4969 * archive.h (Incremental_archive_entry::Archive_member):
4970 Initialize arg_serial_.
4971 (Archive_member::arg_serial_): New data member.
4972 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
4973 (Sized_dynobj::do_add_symbols): Track symbols when doing an
4975 (Sized_dynobj::do_for_all_local_got_entries): New function.
4976 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
4978 * fileread.cc (get_mtime): New function.
4979 * fileread.h (get_mtime): New function.
4980 * gold.cc (queue_initial_tasks): Check for incremental update.
4981 (process_incremental_input): New function.
4982 (queue_middle_tasks): Don't force valid target for incremental
4984 * incremental-dump.cc (find_input_containing_global): Adjust
4985 size of symbol info entry.
4986 (dump_incremental_inputs): Dump argument serial number and
4987 in_system_directory flag; bias shndx by 1; print symbol names
4988 when dumping per-file symbol lists; use new symbol info readers.
4990 (Output_section_incremental_inputs:update_data_size): New function.
4991 (Sized_incremental_binary::setup_readers): Setup input readers
4992 for each input file; build maps for files added from libraries
4994 (Sized_incremental_binary::check_input_args): New function.
4995 (Sized_incremental_binary::do_check_inputs): Build map of argument
4996 serial numbers to input arguments.
4997 (Sized_incremental_binary::do_file_has_changed): Rename
4998 do_file_is_unchanged to this; compare file modification times.
4999 (Sized_incremental_binary::do_init_layout): New function.
5000 (Sized_incremental_binary::do_reserve_layout): New function.
5001 (Sized_incremental_binary::do_get_input_reader): Remove.
5002 (Sized_incremental_binary::get_symtab_view): New function.
5003 (Incremental_checker::can_incrementally_link_output_file): Remove.
5004 (Incremental_inputs::report_command_line): Exclude --debug options.
5005 (Incremental_inputs::report_archive_begin): Add parameter; track
5006 argument serial numbers; don't put input file entry for archive
5007 before archive members.
5008 (Incremental_inputs::report_archive_end): Put input file entry
5009 for archive after archive members.
5010 (Incremental_inputs::report_object): Add parameter; track argument
5011 serial numbers and in_system_directory flag.
5012 (Incremental_inputs::report_script): Add parameter; track argument
5014 (Output_section_incremental_inputs::set_final_data_size): Adjust
5015 size of symbol info entry; check for forwarding symbols.
5016 (Output_section_incremental_inputs::write_input_files): Write
5017 in_system_directory flag and argument serial number.
5018 (Output_section_incremental_inputs::write_info_blocks): Map section
5019 indices between incremental info and original input file; store
5020 input section index for each symbol.
5021 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5022 change operator() to visit().
5023 (class Global_got_offset_visitor): Likewise.
5024 (class Global_symbol_visitor_got_plt):
5025 (Output_section_incremental_inputs::write_got_plt): Use new visitor
5027 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
5028 (Sized_incr_relobj::do_read_symbols): New function.
5029 (Sized_incr_relobj::do_layout): New function.
5030 (Sized_incr_relobj::do_layout_deferred_sections): New function.
5031 (Sized_incr_relobj::do_add_symbols): New function.
5032 (Sized_incr_relobj::do_should_include_member): New function.
5033 (Sized_incr_relobj::do_for_all_global_symbols): New function.
5034 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
5035 (Sized_incr_relobj::do_section_size): New function.
5036 (Sized_incr_relobj::do_section_name): New function.
5037 (Sized_incr_relobj::do_section_contents): New function.
5038 (Sized_incr_relobj::do_section_flags): New function.
5039 (Sized_incr_relobj::do_section_entsize): New function.
5040 (Sized_incr_relobj::do_section_address): New function.
5041 (Sized_incr_relobj::do_section_type): New function.
5042 (Sized_incr_relobj::do_section_link): New function.
5043 (Sized_incr_relobj::do_section_info): New function.
5044 (Sized_incr_relobj::do_section_addralign): New function.
5045 (Sized_incr_relobj::do_initialize_xindex): New function.
5046 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
5047 (Sized_incr_relobj::do_read_relocs): New function.
5048 (Sized_incr_relobj::do_gc_process_relocs): New function.
5049 (Sized_incr_relobj::do_scan_relocs): New function.
5050 (Sized_incr_relobj::do_count_local_symbols): New function.
5051 (Sized_incr_relobj::do_finalize_local_symbols): New function.
5052 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
5053 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
5054 (Sized_incr_relobj::do_relocate): New function.
5055 (Sized_incr_relobj::do_set_section_offset): New function.
5056 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
5057 (Sized_incr_dynobj::do_read_symbols): New function.
5058 (Sized_incr_dynobj::do_layout): New function.
5059 (Sized_incr_dynobj::do_add_symbols): New function.
5060 (Sized_incr_dynobj::do_should_include_member): New function.
5061 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
5062 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
5063 (Sized_incr_dynobj::do_section_size): New function.
5064 (Sized_incr_dynobj::do_section_name): New function.
5065 (Sized_incr_dynobj::do_section_contents): New function.
5066 (Sized_incr_dynobj::do_section_flags): New function.
5067 (Sized_incr_dynobj::do_section_entsize): New function.
5068 (Sized_incr_dynobj::do_section_address): New function.
5069 (Sized_incr_dynobj::do_section_type): New function.
5070 (Sized_incr_dynobj::do_section_link): New function.
5071 (Sized_incr_dynobj::do_section_info): New function.
5072 (Sized_incr_dynobj::do_section_addralign): New function.
5073 (Sized_incr_dynobj::do_initialize_xindex): New function.
5074 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
5075 (make_sized_incremental_object): New function.
5076 (Incremental_library::copy_unused_symbols): New function.
5077 (Incremental_library::do_for_all_unused_symbols): New function.
5078 * incremental.h (enum Incremental_input_flags): New type.
5079 (class Incremental_checker): Remove.
5080 (Incremental_input_entry::Incremental_input_entry): Add argument
5082 (Incremental_input_entry::arg_serial): New function.
5083 (Incremental_input_entry::set_is_in_system_directory): New function.
5084 (Incremental_input_entry::is_in_system_directory): New function.
5085 (Incremental_input_entry::arg_serial_): New data member.
5086 (Incremental_input_entry::is_in_system_directory_): New data member.
5087 (class Script_info): Move here from script.h.
5088 (Script_info::Script_info): Add filename parameter.
5089 (Script_info::filename): New function.
5090 (Script_info::filename_): New data member.
5091 (Incremental_script_entry::Incremental_script_entry): Add argument
5093 (Incremental_object_entry::Incremental_object_entry): Likewise.
5094 (Incremental_object_entry::add_input_section): Build list of input
5095 sections with map to original shndx.
5096 (Incremental_object_entry::get_input_section_index): New function.
5097 (Incremental_object_entry::shndx_): New data member.
5098 (Incremental_object_entry::name_key_): Rename; adjust all refs.
5099 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
5100 (Incremental_archive_entry::Incremental_archive_entry): Add argument
5102 (Incremental_inputs::report_archive_begin): Likewise.
5103 (Incremental_inputs::report_object): Likewise.
5104 (Incremental_inputs::report_script): Likewise.
5105 (class Incremental_global_symbol_reader): New class.
5106 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
5107 and store flags and input file type.
5108 (Incremental_input_entry_reader::arg_serial): New function.
5109 (Incremental_input_entry_reader::type): Extract type from flags.
5110 (Incremental_input_entry_reader::is_in_system_directory): New function.
5111 (Incremental_input_entry_reader::get_input_section_count): Call
5112 accessor function for type.
5113 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
5114 function for type; adjust size of global symbol entry.
5115 (Incremental_input_entry_reader::get_global_symbol_count): Call
5116 accessor function for type.
5117 (Incremental_input_entry_reader::get_object_count): Likewise.
5118 (Incremental_input_entry_reader::get_object_offset): Likewise.
5119 (Incremental_input_entry_reader::get_member_count): Likewise.
5120 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
5121 (Incremental_input_entry_reader::get_member_offset): Likewise.
5122 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
5123 (Incremental_input_entry_reader::Global_symbol_info): Remove.
5124 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
5125 (Incremental_input_entry_reader::get_global_symbol_reader): New
5127 (Incremental_input_entry_reader::get_output_symbol_index): New
5129 (Incremental_input_entry_reader::type_): Remove.
5130 (Incremental_input_entry_reader::flags_): New data member.
5131 (Incremental_inputs_reader::input_file_offset): New function.
5132 (Incremental_inputs_reader::input_file_index): New function.
5133 (Incremental_inputs_reader::input_file): Call input_file_offset.
5134 (Incremental_inputs_reader::input_file_at_offset): New function.
5135 (Incremental_relocs_reader::get_r_type): Reformat.
5136 (Incremental_relocs_reader::get_r_shndx): Reformat.
5137 (Incremental_relocs_reader::get_r_offset): Reformat.
5138 (Incremental_relocs_reader::data): New function.
5139 (Incremental_binary::Incremental_binary): Initialize new data members.
5140 (Incremental_binary::check_inputs): Add cmdline parameter.
5141 (Incremental_binary::file_is_unchanged): Remove.
5142 (Input_reader::arg_serial): New function.
5143 (Input_reader::get_unused_symbol_count): New function.
5144 (Input_reader::get_unused_symbol): New function.
5145 (Input_reader::do_arg_serial): New function.
5146 (Input_reader::do_get_unused_symbol_count): New function.
5147 (Input_reader::do_get_unused_symbol): New function.
5148 (Incremental_binary::input_file_count): New function.
5149 (Incremental_binary::get_input_reader): Change signature to use
5150 index instead of filename.
5151 (Incremental_binary::file_has_changed): New function.
5152 (Incremental_binary::get_input_argument): New function.
5153 (Incremental_binary::get_library): New function.
5154 (Incremental_binary::get_script_info): New function.
5155 (Incremental_binary::init_layout): New function.
5156 (Incremental_binary::reserve_layout): New function.
5157 (Incremental_binary::output_file): New function.
5158 (Incremental_binary::do_check_inputs): New function.
5159 (Incremental_binary::do_file_is_unchanged): Remove.
5160 (Incremental_binary::do_file_has_changed): New function.
5161 (Incremental_binary::do_init_layout): New function.
5162 (Incremental_binary::do_reserve_layout): New function.
5163 (Incremental_binary::do_input_file_count): New function.
5164 (Incremental_binary::do_get_input_reader): Change signature.
5165 (Incremental_binary::input_args_map_): New data member.
5166 (Incremental_binary::library_map_): New data member.
5167 (Incremental_binary::script_map_): New data member.
5168 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5170 (Sized_incremental_binary::output_section): New function.
5171 (Sized_incremental_binary::inputs_reader): Add const.
5172 (Sized_incremental_binary::symtab_reader): Add const.
5173 (Sized_incremental_binary::relocs_reader): Add const.
5174 (Sized_incremental_binary::got_plt_reader): Add const.
5175 (Sized_incremental_binary::get_symtab_view): New function.
5176 (Sized_incremental_binary::Inputs_reader): New typedef.
5177 (Sized_incremental_binary::Input_entry_reader): New typedef.
5178 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
5179 (Sized_incremental_binary::do_file_is_unchanged): Remove.
5180 (Sized_incremental_binary::do_file_has_changed): New function.
5181 (Sized_incremental_binary::do_init_layout): New function.
5182 (Sized_incremental_binary::do_reserve_layout): New function.
5183 (Sized_input_reader::Inputs_reader): Remove.
5184 (Sized_input_reader::Input_entry_reader): Remove.
5185 (Sized_input_reader::do_arg_serial): New function.
5186 (Sized_input_reader::do_get_unused_symbol_count): New function.
5187 (Sized_input_reader::do_get_unused_symbol): New function.
5188 (Sized_incremental_binary::do_input_file_count): New function.
5189 (Sized_incremental_binary::do_get_input_reader): Change signature;
5190 use index instead of filename.
5191 (Sized_incremental_binary::section_map_): New data member.
5192 (Sized_incremental_binary::input_entry_readers_): New data member.
5193 (class Sized_incr_relobj): New class.
5194 (class Sized_incr_dynobj): New class.
5195 (make_sized_incremental_object): New function.
5196 (class Incremental_library): New class.
5197 * layout.cc (Free_list::num_lists): New static data member.
5198 (Free_list::num_nodes): New static data member.
5199 (Free_list::num_removes): New static data member.
5200 (Free_list::num_remove_visits): New static data member.
5201 (Free_list::num_allocates): New static data member.
5202 (Free_list::num_allocate_visits): New static data member.
5203 (Free_list::init): New function.
5204 (Free_list::remove): New function.
5205 (Free_list::allocate): New function.
5206 (Free_list::dump): New function.
5207 (Free_list::print_stats): New function.
5208 (Layout_task_runner::run): Resize output file for incremental updates.
5209 (Layout::Layout): Initialize new data members.
5210 (Layout::set_incremental_base): New function.
5211 (Layout::init_fixed_output_section): New function.
5212 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
5213 incremental updates.
5214 (Layout::create_gold_note): Do not create gold note section for
5215 incremental updates.
5216 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
5217 for incremental updates.
5218 (Layout::set_section_offsets): For incremental updates, allocate space
5220 (Layout::create_symtab_sections): Layout with offsets relative to
5221 start of section; for incremental updates, allocate space from free
5223 (Layout::create_shdrs): For incremental updates, allocate space from
5225 (Layout::finish_dynamic_section): For incremental updates, do not
5226 check --as-needed (fixed in subsequent patch).
5227 * layout.h (class Free_list): New class.
5228 (Layout::set_incremental_base): New function.
5229 (Layout::incremental_base): New function.
5230 (Layout::init_fixed_output_section): New function.
5231 (Layout::allocate): New function.
5232 (Layout::incremental_base_): New data member.
5233 (Layout::free_list_): New data member.
5234 * main.cc (main): Print Free_list statistics.
5235 * object.cc (Relobj::finalize_incremental_relocs): Add
5236 clear_counts parameter; clear counts only when clear_counts is set.
5237 (Sized_relobj::Sized_relobj): Initialize new base class.
5238 (Sized_relobj::do_layout): Don't report special sections.
5239 (Sized_relobj::do_for_all_local_got_entries): New function.
5240 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
5241 symtab_off to all symbol table offsets.
5242 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
5243 * object.h (class Got_offset_list): Move to top of file.
5244 (Object::Object): Allow case where input_file == NULL.
5245 (Object::~Object): Likewise.
5246 (Object::input_file): Assert that input_file != NULL.
5247 (Object::lock): Allow case where input_file == NULL.
5248 (Object::unlock): Likewise.
5249 (Object::is_locked): Likewise.
5250 (Object::token): Likewise.
5251 (Object::release): Likewise.
5252 (Object::is_incremental): New function.
5253 (Object::get_mtime): New function.
5254 (Object::for_all_local_got_entries): New function.
5255 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
5256 (Object::set_is_in_system_directory): New function.
5257 (Object::is_in_system_directory): New function.
5258 (Object::do_is_incremental): New function.
5259 (Object::do_get_mtime): New function.
5260 (Object::do_for_all_local_got_entries): New function.
5261 (Object::is_in_system_directory_): New data member.
5262 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
5263 (class Sized_relobj_base): New class.
5264 (class Sized_relobj): Derive from Sized_relobj_base.
5265 (class Sized_relobj::Symbols): Redeclare from base class.
5266 (class Sized_relobj::local_got_offset_list): Remove.
5267 (class Sized_relobj::Output_sections): Redeclare from base class.
5268 (class Sized_relobj::do_for_all_local_got_entries): New function.
5269 (class Sized_relobj::write_local_symbols): Add offset parameter.
5270 (class Sized_relobj::local_symbol_offset_): Update comment.
5271 (class Sized_relobj::local_dynsym_offset_): Update comment.
5272 * options.cc (Input_arguments::add_file): Remove const.
5273 * options.h (Input_file_argument::Input_file_argument):
5274 Initialize arg_serial_ (all constructors).
5275 (Input_file_argument::set_arg_serial): New function.
5276 (Input_file_argument::arg_serial): New function.
5277 (Input_file_argument::arg_serial_): New data member.
5278 (Input_arguments::Input_arguments): Initialize file_count_.
5279 (Input_arguments::add_file): Remove const.
5280 (Input_arguments::number_of_input_files): New function.
5281 (Input_arguments::file_count_): New data member.
5282 (Command_line::number_of_input_files): Call
5283 Input_arguments::number_of_input_files.
5284 * output.cc (Output_segment_headers::Output_segment_headers):
5286 (Output_section::Input_section::current_data_size): New function.
5287 (Output_section::Output_section): Initialize new data members.
5288 (Output_section::add_input_section): Don't do merge sections for
5289 an incremental link; allocate space from free list for an
5291 (Output_section::add_output_section_data): Allocate space from
5292 free list for an incremental update.
5293 (Output_section::update_data_size): New function.
5294 (Output_section::set_fixed_layout): New function.
5295 (Output_section::reserve): New function.
5296 (Output_segment::set_section_addresses): Remove const.
5297 (Output_segment::set_section_list_addresses): Remove const; allocate
5298 space from free list for an incremental update.
5299 (Output_segment::set_offset): Adjust size of RELRO segment for an
5301 * output.h (Output_data::current_data_size): Move here from
5303 (Output_data::pre_finalize_data_size): New function.
5304 (Output_data::update_data_size): New function.
5305 (Output_section_headers::update_data_size): new function.
5306 (Output_section_data_build::current_data_size): Move to Output_data.
5307 (Output_data_strtab::update_data_size): New function.
5308 (Output_section::current_data_size): Move to Output_data.
5309 (Output_section::set_fixed_layout): New function.
5310 (Output_section::has_fixed_layout): New function.
5311 (Output_section::reserve): New function.
5312 (Output_section::update_data_size): New function.
5313 (Output_section::has_fixed_layout_): New data member.
5314 (Output_section::free_list_): New data member.
5315 (Output_segment::set_section_addresses): Remove const.
5316 (Output_segment::set_section_list_addresses): Remove const.
5317 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
5319 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
5321 * readsyms.cc (Read_symbols::do_read_symbols): Add library
5322 parameter when calling Add_symbols constructor; store argument
5323 serial number for members of a lib group.
5324 (Add_symbols::locks): Allow case where token == NULL.
5325 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
5326 (Read_member::~Read_member): New function.
5327 (Read_member::is_runnable): New function.
5328 (Read_member::locks): New function.
5329 (Read_member::run): New function.
5330 (Check_script::~Check_script): New function.
5331 (Check_script::is_runnable): New function.
5332 (Check_script::locks): New function.
5333 (Check_script::run): New function.
5334 (Check_library::~Check_library): New function.
5335 (Check_library::is_runnable): New function.
5336 (Check_library::locks): New function.
5337 (Check_library::run): New function.
5338 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
5339 (Add_symbols::library_): New data member.
5340 (class Read_member): New class.
5341 (class Check_script): New class.
5342 (class Check_library): New class.
5343 * reloc.cc (Read_relocs::is_runnable): Allow case where
5345 (Read_relocs::locks): Likewise.
5346 (Scan_relocs::locks): Likewise.
5347 (Relocate_task::locks): Likewise.
5348 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
5350 (Sized_relobj::incremental_relocs_scan): Fix comment.
5351 (Sized_relobj::do_relocate): Pass output file offset to
5352 write_local_symbols.
5353 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
5354 from class declaration.
5355 * script.cc (read_input_script): Allocate Script_info; pass
5356 argument serial number to report_script.
5357 * script.h (class Script_info): Move to incremental.h.
5358 * symtab.cc (Symbol_table::add_from_incrobj): New function.
5359 * symtab.h (Symbol_table::add_from_incrobj): New function.
5360 (Symbol_table::set_file_offset): New function.
5362 2011-04-05 Cary Coutant <ccoutant@google.com>
5364 * incremental-dump.cc (dump_incremental_inputs): Change signature
5365 to take a Sized_incremental_binary; change caller. Use readers
5366 in Sized_incremental_binary.
5368 (Sized_incremental_binary::find_incremental_inputs_sections):
5369 Rename do_find_incremental_inputs_sections to this.
5370 (Sized_incremental_binary::setup_readers): New function.
5371 (Sized_incremental_binary::do_check_inputs): Check
5372 has_incremental_info_ flag; move setup code to setup_readers;
5374 (Sized_incremental_binary::do_file_is_unchanged): New function.
5375 (Sized_incremental_binary::do_get_input_reader): New function.
5376 * incremental.h (class Incremental_binary): Move to end of file.
5377 (Incremental_binary::file_is_unchanged): New function.
5378 (Incremental_binary::do_file_is_unchanged): New function.
5379 (Incremental_binary::Input_reader): New class.
5380 (Incremental_binary::get_input_reader): New function.
5381 (class Sized_incremental_binary): Move to end of file.
5382 (Sized_incremental_binary::Sized_incremental_binary): Setup the
5383 input section reader classes.
5384 (Sized_incremental_binary::has_incremental_info): New function.
5385 (Sized_incremental_binary::inputs_reader): New function.
5386 (Sized_incremental_binary::symtab_reader): New function.
5387 (Sized_incremental_binary::relocs_reader): New function.
5388 (Sized_incremental_binary::got_plt_reader): New function.
5389 (Sized_incremental_binary::do_file_is_unchanged): New function.
5390 (Sized_incremental_binary::Sized_input_reader): New class.
5391 (Sized_incremental_binary::get_input_reader): New function.
5392 (Sized_incremental_binary::find_incremental_inputs_sections):
5393 Rename do_find_incremental_inputs_sections to this.
5394 (Sized_incremental_binary::setup_readers): New function.
5395 (Sized_incremental_binary::has_incremental_info_): New data member.
5396 (Sized_incremental_binary::inputs_reader_): New data member.
5397 (Sized_incremental_binary::symtab_reader_): New data member.
5398 (Sized_incremental_binary::relocs_reader_): New data member.
5399 (Sized_incremental_binary::got_plt_reader_): New data member.
5400 (Sized_incremental_binary::current_input_file_): New data member.
5402 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
5405 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
5408 2011-03-30 Cary Coutant <ccoutant@google.com>
5410 * archive.cc (Archive::include_member): Adjust call to report_object.
5411 (Add_archive_symbols::run): Add script_info to call to
5412 report_archive_begin.
5413 (Lib_group::include_member): Adjust call to report_object.
5414 (Add_lib_group_symbols::run): Adjust call to report_object.
5415 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
5416 blocks. Add object count for script input files.
5417 * incremental.cc (Incremental_inputs::report_archive_begin): Add
5418 script_info parameter; change all callers.
5419 (Incremental_inputs::report_object): Add script_info parameter;
5421 (Incremental_inputs::report_script): Store backpointer to
5422 incremental info entry.
5423 (Output_section_incremental_inputs::set_final_data_size): Record
5424 additional information for scripts.
5425 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5426 * incremental.h (Incremental_script_entry::add_object): New function.
5427 (Incremental_script_entry::get_object_count): New function.
5428 (Incremental_script_entry::get_object): New function.
5429 (Incremental_script_entry::objects_): New data member; adjust
5431 (Incremental_inputs::report_archive_begin): Add script_info parameter.
5432 (Incremental_inputs::report_object): Add script_info parameter.
5433 (Incremental_inputs_reader::get_object_count): New function.
5434 (Incremental_inputs_reader::get_object_offset): New function.
5435 * options.cc (Input_arguments::add_file): Return reference to
5437 * options.h (Input_argument::set_script_info): New function.
5438 (Input_argument::script_info): New function.
5439 (Input_argument::script_info_): New data member; adjust all
5441 (Input_file_group::add_file): Return reference to new input argument.
5442 (Input_file_lib::add_file): Likewise.
5443 (Input_arguments::add_file): Likewise.
5444 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
5445 * script.cc (Parser_closure::Parser_closure): Add script_info
5446 parameter; adjust all callers.
5447 (Parser_closure::script_info): New function.
5448 (Parser_closure::script_info_): New data member.
5449 (read_input_script): Report scripts earlier to incremental info.
5450 (script_add_file): Set script_info in Input_argument.
5451 (script_add_library): Likewise.
5452 * script.h (Script_options::Script_info): Rewrite class.
5454 2011-03-29 Cary Coutant <ccoutant@google.com>
5456 * archive.cc (Library_base::should_include_member): Move
5457 method here from class Archive.
5458 (Archive::Archive): Initialize base class.
5459 (Archive::should_include_member): Move to base class.
5460 (Archive::do_for_all_unused_symbols): New function.
5461 (Add_archive_symbols::run): Remove redundant access to
5463 (Lib_group::Lib_group): Initialize base class.
5464 (Lib_group::do_filename): New function.
5465 (Lib_group::include_member): Pass pointer to Lib_group to
5467 (Lib_group::do_for_all_unused_symbols): New function.
5468 (Add_lib_group_symbols::run): Report archive information for
5470 * archive.h (class Library_base): New base class.
5471 (class Archive): Derive from Library_base.
5472 (Archive::filename): Move to base class.
5473 (Archive::set_incremental_info): Likewise.
5474 (Archive::incremental_info): Likewise.
5475 (Archive::Should_include): Likewise.
5476 (Archive::should_include_member): Likewise.
5477 (Archive::Armap_entry): Remove.
5478 (Archive::Unused_symbol_iterator): Remove.
5479 (Archive::unused_symbols_begin): Remove.
5480 (Archive::unused_symbols_end): Remove.
5481 (Archive::do_filename): New function.
5482 (Archive::do_get_mtime): New function.
5483 (Archive::do_for_all_unused_symbols): New function.
5484 (Archive::task_): Move to base class.
5485 (Archive::incremental_info_): Likewise.
5486 (class Lib_group): Derive from Library_base.
5487 (Lib_group::do_filename): New function.
5488 (Lib_group::do_get_mtime): New function.
5489 (Lib_group::do_for_all_unused_symbols): New function.
5490 (Lib_group::task_): Move to base class.
5491 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
5493 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
5495 * incremental.cc (Incremental_inputs::report_archive_begin):
5496 Use Library_base; call library's get_mtime; add incremental inputs
5497 entry before members.
5498 (class Unused_symbol_visitor): New class.
5499 (Incremental_inputs::report_archive_end): Use Library_base; use
5500 visitor class to record unused symbols; don't add incremental inputs
5501 entry after members.
5502 (Incremental_inputs::report_object): Use Library_base.
5504 (Incremental_archive_entry::Incremental_archive_entry): Remove
5505 unused Archive parameter.
5506 (Incremental_inputs::report_archive_begin): Use Library_base.
5507 (Incremental_inputs::report_archive_end): Likewise.
5508 (Incremental_inputs::report_object): Likewise.
5509 * object.cc (Sized_relobj::do_for_all_global_symbols): New
5511 * object.h (Object::for_all_global_symbols): New function.
5512 (Object::do_for_all_global_symbols): New function.
5513 (Sized_relobj::do_for_all_global_symbols): New function.
5514 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
5516 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
5519 2011-03-27 Ian Lance Taylor <iant@google.com>
5521 * archive.cc (Archive::interpret_header): Return -1 if something
5522 goes wrong. Change callers accordingly.
5524 2011-03-25 Cary Coutant <ccoutant@google.com>
5526 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
5527 * testsuite/Makefile.in: Regenerate.
5529 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
5531 * plugin.cc (get_view): New.
5532 (Plugin::load): Pass get_view to the plugin.
5533 (Plugin_manager::get_view): New.
5535 2011-03-21 Ian Lance Taylor <iant@google.com>
5537 * testsuite/final_layout.sh: Rewrite to not use dc.
5538 * testsuite/relro_test.sh: Fail if dc is not present.
5540 2011-03-21 Sriraman Tallam <tmsriram@google.com>
5542 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
5544 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
5545 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
5547 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
5548 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
5550 2011-03-14 Ian Lance Taylor <iant@google.com>
5552 * script-sections.cc (Sort_output_sections::script_compare):
5553 Rename from is_before, change return type.
5554 (Sort_output_sections::operator()): Adjust accordingly.
5556 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
5559 * testsuite/odr_violation2.cc: Add comment to make all error line
5560 numbers double digits.
5561 * testsuite/debug_msg.sh: Adjust expected errors.
5563 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
5565 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
5566 but mark earlier ones as non-canonical
5567 (offset_to_iterator): Update search target and example
5568 (do_addr2line): Return extra lines in a vector*
5569 (format_file_lineno): Extract from do_addr2line
5570 (one_addr2line): Add vector* out-param
5571 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
5572 when a lineno entry appeared last for its instruction
5573 (Dwarf_line_info): Add vector* out-param
5574 * object.cc (Relocate_info): Pass NULL for the vector* out-param
5575 * symtab.cc (Odr_violation_compare): Include the lineno in the
5577 (linenos_from_loc): New. Combine the canonical line for an
5578 address with its other lines.
5579 (True_if_intersect): New. Helper functor to make
5580 std::set_intersection a query.
5581 (detect_odr_violations): Compare sets of lines instead of just
5582 one line for each function. This became less deterministic, but
5583 has fewer false positives.
5584 * symtab.h: Declarations.
5585 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
5586 mix an optimized and non-optimized object in the same binary
5587 (odr_violation2.so): Same.
5588 * testsuite/Makefile.in: Regenerate from Makefile.am.
5589 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
5590 * testsuite/debug_msg.sh: Update line numbers and add
5592 * testsuite/odr_violation1.cc: Use OdrDerived, in a
5593 non-optimized context.
5594 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
5595 isn't inlined, and use OdrDerived in an optimized context.
5596 * testsuite/odr_header1.h: Defines OdrDerived, where
5597 optimization will change the
5598 first-instruction-in-the-destructor's file and line number.
5599 * testsuite/odr_header2.h: Defines OdrBase.
5601 2011-03-09 Ian Lance Taylor <iant@google.com>
5603 * fileread.cc (File_read::clear_views): Don't delete the whole
5606 2011-03-08 Ian Lance Taylor <iant@google.com>
5609 * fileread.cc: #include <climits>.
5610 (GOLD_IOV_MAX): Define.
5611 (File_read::read_multiple): Limit number of entries by iov_max.
5612 * fileread.h (class File_read): Always set max_readv_entries to
5615 2011-03-07 Ian Lance Taylor <iant@google.com>
5618 * options.h (class General_options): Add -dy and -dn.
5620 2011-03-02 Cary Coutant <ccoutant@google.com>
5622 * testsuite/script_test_9.t: Add TLS segment.
5624 2011-03-02 Simon Baldwin <simonb@google.com>
5626 * configure.ac: Add check for gnu_indirect_function support in
5627 the toolchain building binutils.
5628 * configure: Rebuild.
5630 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
5632 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
5633 plugin only symbols.
5634 (Symbol_table::sized_finalize_symbol) Mark symbol only present
5635 in plugin files as not needed in the symbol table.
5637 2011-02-11 Sriraman Tallam <tmsriram@google.com>
5639 * output.cc (Output_section::add_input_section): Delay fill
5640 generation for section ordering.
5642 2011-02-09 Ian Lance Taylor <iant@google.com>
5645 * object.h (class Sized_relobj): Remove clear_local_symbols.
5646 * reloc.cc (Sized_relobj::do_relocate): Don't call
5647 clear_local_symbols.
5649 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
5651 * plugin.cc (is_visible_from_outside): Return true for symbols
5654 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
5656 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
5659 2011-02-02 Sriraman Tallam <tmsriram@google.com>
5661 * icf.h (is_section_foldable_candidate): Change type of parameter
5663 * icf.cc (Icf::find_identical_sections): Change type of local variable
5664 section_name to be std::string.
5665 (is_function_ctor_or_dtor): Change type of parameter to std::string.
5667 2011-01-25 Ian Lance Taylor <iant@google.com>
5669 * script.cc (script_add_extern): Rewrite to use
5670 add_symbol_reference.
5672 2011-01-25 Doug Kwan <dougkwan@google.com>
5674 * icf.cc (get_section_contents): Always lock section's object.
5676 2011-01-24 Ian Lance Taylor <iant@google.com>
5678 * options.h (class General_options): Accept
5679 --no-detect-odr-violations.
5681 2011-01-24 Ian Lance Taylor <iant@google.com>
5683 * version.cc (version_string): Bump to 1.11.
5685 2011-01-24 Ian Lance Taylor <iant@google.com>
5687 * plugin.cc (class Plugin_rescan): Define new class.
5688 (Plugin_manager::claim_file): Set any_claimed_.
5689 (Plugin_manager::save_archive): New function.
5690 (Plugin_manager::save_input_group): New function.
5691 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
5693 (Plugin_manager::new_undefined_symbol): New function.
5694 (Plugin_manager::rescan): New function.
5695 (Plugin_manager::rescannable_defines): New function.
5696 (Plugin_manager::add_input_file): Set any_added_.
5697 * plugin.h (class Plugin_manager): define new fields rescannable_,
5698 undefined_symbols_, any_claimed_, and any_added_. Declare
5699 Plugin_rescan as friend. Declare new functions.
5700 (Plugin_manager::Rescannable): Define type.
5701 (Plugin_manager::Rescannable_list): Define type.
5702 (Plugin_manager::Undefined_symbol_list): Define type.
5703 (Plugin_manager::Plugin_manager): Initialize new fields.
5704 * archive.cc (Archive::defines_symbol): New function.
5705 (Add_archive_symbols::run): Pass archive to plugins if any.
5706 * archive.h (class Archive): Declare defines_symbol.
5707 * readsyms.cc (Input_group::~Input_group): New function.
5708 (Finish_group::run): Pass input_group to plugins if any.
5709 * readsyms.h (class Input_group): Declare destructor.
5710 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
5713 2011-01-10 Ian Lance Taylor <iant@google.com>
5715 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
5717 (Layout::set_segment_offsets): Reset increase_relro before calling
5718 set_section_addresses a second time.
5720 2011-01-04 Cary Coutant <ccoutant@google.com>
5722 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
5723 sections before NOBITS sections.
5725 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
5727 * version.cc (print_version): Update copyright to 2011.
5729 2010-12-23 Cary Coutant <ccoutant@google.com>
5731 * output.h (Output_data_reloc::add_output_section): Pass OD instead
5732 of OS to this->add. Add OD parameter to second form of the function.
5734 2010-12-20 Ian Lance Taylor <iant@google.com>
5736 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
5737 second of two consecutive entries with same offset.
5739 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5741 * testsuite/Makefile.am (ifuncmain2static_LDADD)
5742 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
5743 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
5744 to avoid unneeded links against $(LDADD).
5745 * testsuite/Makefile.in: Regenerate.
5747 2010-12-15 Ian Lance Taylor <iant@google.com>
5750 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
5751 for R_X86_64_32 and R_X86_64_PC32.
5752 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
5753 ver_matching_def_pic.o.
5754 (ver_matching_def_pic.o): New target.
5756 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5758 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
5759 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
5760 Move definition before File_read::View member definitions.
5761 (File_read::View::~View): Initialize and hold lock before
5762 updating current_mapped_bytes.
5764 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5766 * dwarf_reader.cc: Remove outdated comment.
5767 * gold-threads.cc: Fix typo in error message.
5768 * archive.cc: Fix typos in comments.
5769 * archive.h: Likewise.
5770 * arm-reloc-property.cc: Likewise.
5771 * arm-reloc-property.h: Likewise.
5772 * arm-reloc.def: Likewise.
5774 * attributes.h: Likewise.
5775 * cref.cc: Likewise.
5776 * ehframe.cc: Likewise.
5777 * fileread.h: Likewise.
5779 * i386.cc: Likewise.
5781 * incremental.h: Likewise.
5782 * int_encoding.cc: Likewise.
5783 * layout.h: Likewise.
5784 * main.cc: Likewise.
5785 * merge.h: Likewise.
5786 * object.cc: Likewise.
5787 * object.h: Likewise.
5788 * options.cc: Likewise.
5789 * readsyms.cc: Likewise.
5790 * reduced_debug_output.cc: Likewise.
5791 * reloc.cc: Likewise.
5792 * script-sections.cc: Likewise.
5793 * sparc.cc: Likewise.
5794 * symtab.h: Likewise.
5795 * target-reloc.h: Likewise.
5796 * target.cc: Likewise.
5797 * target.h: Likewise.
5798 * timer.cc: Likewise.
5799 * timer.h: Likewise.
5800 * x86_64.cc: Likewise.
5802 2010-12-09 Cary Coutant <ccoutant@google.com>
5804 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
5806 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
5807 parameter; change all callers.
5808 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
5809 * options.h (warn_execstack): New option.
5811 2010-12-07 Doug Kwan <dougkwan@google.com>
5813 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
5814 like function call relocations.
5816 2010-12-07 Ian Lance Taylor <iant@google.com>
5818 * archive.cc (Archive::get_elf_object_for_member): Permit
5819 punconfigured to be NULL.
5820 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
5821 (Archive::include_member): Pass NULL to get_elf_object_for_member
5822 if we searched for the archive and this is the first included
5825 2010-12-01 Ian Lance Taylor <iant@google.com>
5827 * dwarf_reader.h (class Sized_dwarf_line_info): Add
5828 track_relocs_type_ field.
5829 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5830 Set track_relocs_type_.
5831 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
5832 contents when using RELA relocs.
5833 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
5835 * reloc.cc (Track_relocs::next_addend): New function.
5836 * reloc.h (class Track_relocs): Declare next_addend.
5838 2010-12-01 Ian Lance Taylor <iant@google.com>
5840 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
5843 2010-12-01 Ian Lance Taylor <iant@google.com>
5845 * README: Update compilers known to work and fail.
5847 2010-11-23 Matthias Klose <doko@ubuntu.com>
5849 * configure.in: For --enable-gold, handle value `default' instead of
5850 `both*'. Always install ld as ld.bfd, install as ld if gold is
5852 * configure: Regenerate.
5854 2010-11-18 Doug Kwan <dougkwan@google.com>
5856 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
5857 and right_alignment to be zero. Store result alignment only if it is
5858 greater than existing alignment.
5860 2010-11-16 Cary Coutant <ccoutant@google.com>
5863 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5864 Check for ".zdebug_line".
5866 2010-11-16 Doug Kwan <dougkwan@google.com>
5867 Cary Coutant <ccoutant@google.com>
5869 * output.h (Output_segment::set_section_addresses): Pass increase_relro
5870 by reference; adjust all callers.
5871 * output.cc (Output_segment::set_section_addresses): Adjust references
5872 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
5874 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
5875 end at page boundary.
5877 2010-11-16 Cary Coutant <ccoutant@google.com>
5880 * layout.cc (Layout::choose_output_section): Transform names of
5881 compressed sections even when using a script with a SECTIONS clause.
5882 (Layout::output_section_name): Remove code to transform
5883 compressed debug section names.
5884 * output.cc (Output_section::add_input_section): Use uncompressed
5885 section size when tracking input sections.
5887 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
5889 * symtab.h (Symbol::NON_PIC_REF): Remove.
5890 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
5891 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
5892 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
5893 (Symbol::use_plt_offset): Take a flags argument and pass it
5894 directly to needs_dynamic_reloc. Restrict check for undefined
5895 weak symbols to function calls.
5896 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
5897 (Target_arm::Scan::global): Use it.
5898 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
5899 (Target_arm::Relocate::relocate): Likewise.
5900 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
5901 parameter with an r_type parameter. Use get_reference_flags
5903 (Target_arm::Relocate::relocate): Update accordingly.
5904 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
5905 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
5906 (Target_i386::Scan::global): Likewise.
5907 (Target_i386::Relocate::relocate): Likewise.
5908 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
5909 parameter with an r_type parameter. Use get_reference_flags
5911 (Target_i386::Relocate::relocate): Update accordingly.
5912 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
5913 (Target_powerpc::Scan::global): Use it.
5914 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
5915 (Target_powerpc::Relocate::relocate): Likewise.
5916 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
5917 (Target_sparc::Scan::global): Use it.
5918 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
5919 (Target_sparc::Relocate::relocate): Likewise.
5920 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
5921 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
5922 (Target_x86_64::Scan::global): Likewise.
5923 (Target_x86_64::Relocate::relocate): Likewise.
5925 2010-11-08 Doug Kwan <dougkwan@google.com>
5926 Cary Coutant <ccoutant@google.com>
5928 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
5929 (Arm_exidx_merge_section::section_contents_): New data member.
5930 (Arm_input_section::Arm_input_section): Initialize original_contents_.
5931 (Arm_input_section::~Arm_input_section): De-allocate memory.
5932 (Arm_input_section::original_contents_): New data member.
5933 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
5934 in parameters instead of calling Object::section_contents without
5936 (Arm_output_section::group_section): New parameter TASK. Pass it
5937 to callees that need locking objects.
5938 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
5939 to lock EXIDX input sections. Fix a formatting issue. Call
5940 Arm_exidx_merged_section::build_contents to create merged section
5942 (Arm_output_section::create_stub_group): New parameter TASK. Use it
5943 to lock object of stub table owner.
5944 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
5945 TEXT_SIZE to initialize data member TEXT_SIZE_.
5946 (Arm_exidx_input_section::addralign): Fix typo in comment.
5947 (Arm_exidx_input_section::text_size): New method.
5948 (Target_arm::do_relax): New parameter TASK. Pass it to callees
5949 that require locking objects. Lock objects before scanning for stubs
5950 and updating local symbols.
5951 (Arm_input_section<big_endian>::init): Copy contents of original
5953 (Arm_input_section<big_endian>::do_write): Use saved contents of
5954 original input section instead of calling Object::section_contents
5956 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
5957 size without calling Object::section_size().
5958 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
5959 for size. Allocate a buffer for merged EXIDX entries.
5960 (Arm_exidx_merged_section::build_contents): New method.
5961 (Arm_exidx_merged_section::do_write): Move merge section contents
5962 building code to Arm_exidx_merged_section::build_contetns. Write
5963 out contetns in buffer instead of building it on the fly.
5964 (Arm_relobj::make_exidx_input_section): Also pass text section size
5965 to Arm_exidx_input_section constructor.
5966 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
5967 (Arm_dynobj::do_read_symbols): Fix memory leak.
5968 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
5969 * target.h: (class Task): Add forward declaration.
5970 (Target::relax): Add new parameter TASK and pass it to
5972 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
5974 2010-11-05 Cary Coutant <ccoutant@google.com>
5977 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
5978 object when reading from the file.
5979 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
5981 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
5982 when reading section contents.
5983 (get_section_contents): Likewise.
5984 (icf::find_identical_sections): Likewise.
5985 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
5986 object when reading from the file.
5987 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
5988 the object when doing deferred section layout.
5990 2010-11-03 Nick Clifton <nickc@redhat.com>
5993 * script.h (class Symbol_assignment: name): New member. Returns
5994 the name of the symbol.
5995 * scrfipt.cc (Script_options::is_pending_assignment): New member.
5996 Returns true if the given symbol name is on the list of
5997 assignments wating to be processed.
5998 * archive.cc (should_incldue_member): If the symbol is undefined,
5999 check to see if it is on the list of symbols pending assignment.
6001 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6003 * script-sections.cc (Script_sections::find_memory_region): Check
6004 for a NULL output section pointer.
6006 2010-10-29 Doug Kwan <dougkwan@google.com>
6008 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6009 Output_section::add_relaxed_input_section.
6010 * output.cc (Output_section::add_relaxed_input_section): Add new
6011 arguments LAYOUT and NAME. Set section order index.
6012 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6013 Copy section order index.
6014 * output.h (Output_section::add_relaxed_input_section): Add new
6015 arguments LAYOUT and NAME.
6017 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6019 * testsuite/Makefile.am: Move gcctestdir/ld rule to
6020 NATIVE_OR_CROSS_LINKER.
6021 * testsuite/Makefile.in: Regenerate.
6023 2010-10-20 Doug Kwan <dougkwan@google.com>
6025 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
6026 without SHF_LINK_ORDER flags.
6027 * layout.cc (Layout::choose_output_section): Do not filter
6028 SHF_LINK_ORDER flag in a relocatable link.
6030 2010-10-17 Cary Coutant <ccoutant@google.com>
6032 * output.h (Output_segment::set_section_addresses): Change function
6033 signature. Update all callers.
6034 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
6036 (Output_segment::set_section_addresses): Align after last TLS
6037 section. Add padding before last relro section instead of after.
6039 2010-10-17 Doug Kwan <dougkwan@google.com>
6041 * gold/arm.cc (Target_arm::got_section): Use correct order and set
6042 GOT output section to be writable.
6044 2010-10-14 Cary Coutant <ccoutant@google.com>
6046 * debug.h (DEBUG_INCREMENTAL): New flag.
6047 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
6048 * gold.cc (queue_initial_tasks): Check parameters for incremental link
6050 * incremental.cc (report_command_line): Ignore all forms of
6052 * layout.cc (Layout::Layout): Check parameters for incremental link
6054 * options.cc (General_options::parse_incremental): New function.
6055 (General_options::parse_no_incremental): New function.
6056 (General_options::parse_incremental_full): New function.
6057 (General_options::parse_incremental_update): New function.
6058 (General_options::incremental_mode_): New data member.
6059 (General_options::finalize): Check incremental_mode_.
6060 * options.h (General_options): Update help text for --incremental.
6061 Add --no-incremental, --incremental-full, --incremental-update.
6062 (General_options::Incremental_mode): New enum type.
6063 (General_options::incremental_mode): New function.
6064 (General_options::incremental_mode_): New data member.
6065 * parameters.cc (Parameters::incremental_mode_): New data member.
6066 (Parameters::set_options): Set incremental_mode_.
6067 (Parameters::set_incremental_full): New function.
6068 (Parameters::incremental): New function.
6069 (Parameters::incremental_update): New function.
6070 (set_parameters_incremental_full): New function.
6071 * parameters.h (Parameters::set_incremental_full): New function.
6072 (Parameters::incremental): New function.
6073 (Parameters::incremental_update): New function.
6074 (Parameters::incremental_mode_): New data member.
6075 (set_parameters_incremental_full): New function.
6076 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
6077 incremental link mode.
6078 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
6079 (Sized_relobj::do_relocate_sections): Likewise.
6080 * testsuite/Makefile.am (incremental_test): Use --incremental-full
6082 * testsuite/Makefile.in: Regenerate.
6083 * testsuite/incremental_test.sh: Filter all forms of --incremental.
6085 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6087 * script-sections.h (class Script_sections): Make
6088 Sections_elements typedef public.
6089 * script-sections.cc (class Sort_output_sections): Add elements_
6090 field. Add constructor which sets it; change all callers.
6091 (Sort_output_sections::is_before): New function.
6092 (Sort_output_sections::operator()): Call is_before.
6093 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
6095 * testsuite/script_test_10.sh: New test. Test script section
6097 * testsuite/script_test_10.t: Likewise.
6098 * testsuite/script_test_10.s: Likewise.
6099 * testsuite/Makefile.am: Wrap the cross linker tests and the
6100 common tests into NATIVE_OR_CROSS_LINKER.
6101 (check_SCRIPTS): Add script_test_10.sh.
6102 (check_DATA): Add script_test_10.stdout.
6103 (script_test_10.o, script_test_10): New targets.
6104 (script_test_10.stdout): New target.
6105 * configure, testsuite/Makefile.in: Regenerate.
6107 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6109 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
6110 error for the deprecated relocations.
6111 (Target_arm::Scan::global): Likewise.
6112 (Target_arm::Relocate::relocate): Likewise.
6114 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
6116 * fileread.cc (Input_file::find_file): Initialize *found_name
6117 and *namep when using the fallback search for case 4.
6119 2010-10-11 Cary Coutant <ccoutant@google.com>
6121 * options.h (class General_options): Redefine -z lazy as an alias for
6122 the negation of -z now.
6124 2010-10-11 Ian Lance Taylor <iant@google.com>
6126 * resolve.cc (symbol_to_bits): Report the value of the unsupported
6129 2010-10-06 Nick Clifton <nickc@redhat.com>
6131 * script-sections.cc(class Memory_region): Remove
6132 current_lma_offset_ field. Rename current_vma_offset_ to
6133 current_offset_. Add last_section_ field.
6134 (Memory_region::get_current_vma_address): Rename to
6135 get_current_address.
6136 (Memory_region::get_current_lma_address): Delete.
6137 (Memory_region::increment_vma_offset): Rename to
6139 (Memory_region::increment_lma_offset): Delete.
6140 (Memory_region::attributes_compatible): New method. Returns
6141 true if the provided section is compatible with the region.
6142 (Memory_region::get_last_section): New method. Returns the last
6143 section to use the region.
6144 (Memory_region::set_last_section): New method. Stores the last
6145 section to use the region.
6146 (Script_sections::block_in_region): New method. Returns true if
6147 a block of memory is contained within a region.
6148 (Script_sections::find_memory_region): New method. Locates a
6149 memory region to be used to set a VMA or LMA address.
6150 (Output_section_definition::set_section_addresses): Add code to
6151 check for addresses set by memory regions.
6152 (Output_segment::set_section_addresses): Remove memory region
6154 (Script_sections::create_segment): Add a warning if a header
6155 segment is created outside of any region.
6156 * script-sections.h (class Script_sections): Add prototypes for
6157 find_memory_region and block_in_region methods.
6158 * testsuite/memory_test.s: Use .long instead of .word.
6159 * testsuite/memory_test.t: Add some more output sections.
6160 * testsuite/memory_test.sh: Update expected output.
6162 2010-10-02 Doug Kwan <dougkwan@google.com>
6164 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
6165 defintion to symtab.h
6166 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
6167 declaration to defintion.
6169 2010-10-01 Nick Clifton <nickc@redhat.com>
6171 * expression.cc (eval): Replace dummy argument with NULL.
6172 (eval_maybe_dot): Check for a NULL result section pointer.
6173 (Symbol_expression::value): Likewise.
6174 (Dot_expression::value): Likewise.
6175 (BINARY_EXPRESSION): Likewise.
6176 (Max_expression::value): Likewise.
6177 (Min_expression::value): Likewise.
6178 (Absolute_expression::value): Likewise.
6179 (Addr_expression::value_from_output_section): Likewise.
6180 (Loaddddr_expression::value_from_output_section): Likewise.
6181 (Segment_start_expression::value): Likewise.
6182 * script-sections.cc
6183 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
6185 (Sections_elememt_dot_assignment::set_section_addresses):
6187 (Output_data_expression::do_write_to_buffer): Likewise.
6188 (Output_section_definition::finalize_symbols): Likewise.
6189 (Output_section_definition::set_section_addresses): Likewise.
6191 2010-09-30 Doug Kwan <dougkwan@google.com>
6193 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
6195 2010-09-28 Sriraman Tallam <tmsriram@google.com>
6197 * target.h (Target::can_icf_inline_merge_sections): New virtual
6199 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
6201 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
6203 * icf.cc (get_section_contents): Inline merge sections only when
6206 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6208 * configure: Regenerate.
6210 2010-09-17 Ian Lance Taylor <iant@google.com>
6212 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
6213 * testsuite/Makefile.am (memory_test.o): New target.
6214 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
6216 * testsuite/Makefile.in: Rebuild.
6218 2010-09-17 Doug Kwan <dougkwan@google.com>
6220 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
6221 defintion if relocation uses GOT entries of the symbol.
6222 * testsuite/icf_safe_test.sh: Fix test.
6223 * testsuite/icf_safe_so_test.sh: Fix test.
6225 2010-09-16 Cary Coutant <ccoutant@google.com>
6227 * script_sections.cc (class Memory_region): Remove "NULL" from
6228 vector initializations.
6230 2010-09-15 Cary Coutant <ccoutant@google.com>
6232 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
6233 Resolve forwarding symbols.
6235 2010-09-15 Doug Kwan <dougkwan@google.com>
6237 * gold/testsuite/script_test_3.t: Add ARM special sections.
6238 * gold/testsuite/script_test_4.t: Same.
6239 * gold/testsuite/script_test_5.t: Same.
6240 * gold/testsuite/script_test_6.t: Same.
6241 * gold/testsuite/script_test_7.t: Same.
6242 * gold/testsuite/script_test_7.t: Same.
6243 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
6245 2010-09-14 Cary Coutant <ccoutant@google.com>
6247 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
6248 (Target_x86_64::Relocate::relocate_tls): Replace check for
6249 saw_tls_block_reloc_ with test for executable section.
6251 2010-09-12 Cary Coutant <ccoutant@google.com>
6253 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
6254 position-independent executables to shared libraries need dynamic
6256 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
6257 position-independent executables.
6258 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
6259 * testsuite/Makefile.in: Regenerate.
6261 2010-09-10 Nick Clifton <nickc@redhat.com>
6264 * testsuite/memory_test.t: Discard any sections that are not
6267 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
6270 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
6271 "This::" to work around a bug in gcc 4.2.
6273 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
6275 2010-09-09 Rafael Espindola <espindola@google.com>
6277 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
6278 sections with different PF_X flags in the same segment.
6279 (Layout::find_first_load_seg): Search all segments to find the first
6281 * options.h (rosegment): New.
6283 2010-09-08 Rafael Espindola <espindola@google.com>
6285 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
6287 2010-09-08 Doug Kwan <dougkwan@google.com>
6289 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
6290 (Arm_relobj::do_relocate_sections): Add new parameter for output
6291 file to match the parent.
6292 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
6293 of local symbols instead of input values. Update code to track
6294 changes in gold::relocate_section.
6295 * object.cc (Sized_relobj::compute_final_local_value): New methods.
6296 (Sized_relobj::compute_final_local_value_internal): New methods.
6297 (Sized_relobj::do_finalize_local_symbols): Move code from loop
6298 body into private version of Sized_relobj::compute_final_local_value.
6299 Call the inline method.
6300 * object.h (Symbol_value::Symbol_value): Define destructor. Free
6301 merged symbol value if there is one.
6302 (Symbol_value::has_output_value): New method defintiion.
6303 (Sized_relobj::Compute_final_local_value_status): New enum type.
6304 (Sized_relobj::compute_final_local_value): New methods.
6305 (Sized_relobj::compute_final_local_value_internal): New methods.
6306 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
6307 and arm_cortex_a8.sh.
6308 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
6309 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
6311 * Makefile.in: Regenerate.
6312 * testsuite/arm_bl_out_of_range.s: Update test.
6313 * testsuite/thumb_bl_out_of_range.s: Ditto.
6314 * testsuite/thumb_blx_out_of_range.s: Ditto.
6315 * testsuite/arm_branch_out_of_range.sh: New file.
6316 * testsuite/arm_cortex_a8.sh: Ditto.
6317 * testsuite/arm_cortex_a8_b.s: Ditto.
6318 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
6319 * testsuite/arm_cortex_a8_b_local.s: Ditto.
6320 * testsuite/arm_cortex_a8_bl.s: Ditto.
6321 * testsuite/arm_cortex_a8_blx.s: Ditto.
6322 * testsuite/arm_cortex_a8_local.s: Ditto.
6323 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
6324 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
6326 2010-09-08 Rafael Espindola <espindola@google.com>
6328 * Makefile.am (memory_test.stdout): Run readelf with -W.
6329 * Makefile.in: Regenerate.
6330 * testsuite/memory_test.sh: Make the regexps accept both 32 and
6333 2010-09-08 Rafael Espindola <espindola@google.com>
6335 * script-sections.cc (Script_sections::add_memory_region): Convert
6336 field precision to int.
6337 * script.cc (script_set_section_region, script_set_section_region):
6338 Convert field precision to int.
6340 2010-09-08 Rafael Espindola <espindola@google.com>
6342 * arm.cc (do_finalize_sections): Create the __exidx_start and
6343 __exdix_end symbols even when the section is missing.
6345 2010-09-08 Nick Clifton <nickc@redhat.com>
6347 * README: Remove claim that MEMORY is not supported.
6348 * expression.cc (script_exp_function_origin)
6349 (script_exp_function_length): Move from here to ...
6350 * script.cc: ... here.
6351 (script_set_section_region, script_add_memory)
6352 (script_parse_memory_attr, script_include_directive): New
6354 * script-sections.cc
6355 (class Memory_region): New class.
6356 (class Output_section_definition): Add set_memory_region,
6357 set_section_vma, set_section_lma and get_section_name methods.
6358 (class Script_Sections): Add add_memory_region,
6359 find_memory_region, find_memory_region_origin,
6360 find_memory_region_length and set_memory_region methods.
6361 Have set_section_addresses method walk the list of set memory
6363 Extend the print methos to display memory regions.
6364 * script-sections.h: Add prototypes for new methods.
6365 Add enum for MEMORY region attributes.
6366 * yyscript.y: Add support for parsing MEMORY regions.
6367 * script-c.h: Add prototypes for new functions.
6368 * testsuite/Makefile.am: Add test of MEMORY region functionality.
6369 * testsuite/Makefile.in: Regenerate.
6370 * testsuite/memory_test.sh: New script.
6371 * testsuite/memory_test.s: New assembler source file.
6372 * testsuite/memory_test.t: New linker script.
6374 2010-08-27 Doug Kwan <dougkwan@google.com>
6376 * gold/resolve.cc (Symbol_table::should_override): Let a weak
6377 reference override an existing dynamic weak reference.
6378 * testsuite/Makefile.am: Add new test dyn_weak_ref.
6379 * testsuite/Makefile.in: Regenerate.
6380 * testsuite/dyn_weak_ref.sh: New file.
6381 * testsuite/dyn_weak_ref_1.c: Ditto.
6382 * testsuite/dyn_weak_ref_2.c: Ditto.
6384 2010-08-27 Ian Lance Taylor <iant@google.com>
6386 * incremental.h (class Incremental_input_entry): Add virtual
6389 2010-08-27 Ian Lance Taylor <iant@google.com>
6391 * testsuite/start_lib_test_3.c: Mark t3 as used.
6393 2010-08-27 Nick Clifton <nickc@redhat.com>
6395 * options.cc (version_script): Fix small typo in previous
6398 2010-08-25 Nick Clifton <nickc@redhat.com>
6400 * archive.cc: Formatting fixes: Remove whitespace between
6401 typename and following asterisk. Remove whitespace between
6402 function name and opening parenthesis.
6403 * archive.h: Likewise.
6405 * attributes.cc: Likewise.
6406 * attributes.h: Likewise.
6407 * common.cc: Likewise.
6408 * copy-relocs.cc: Likewise.
6409 * dirsearch.h: Likewise.
6410 * dynobj.cc: Likewise.
6411 * ehframe.cc: Likewise.
6412 * ehframe.h: Likewise.
6413 * expression.cc: Likewise.
6414 * fileread.cc: Likewise.
6415 * fileread.h: Likewise.
6417 * gold-threads.cc: Likewise.
6418 * gold.cc: Likewise.
6419 * i386.cc: Likewise.
6421 * incremental-dump.cc: Likewise.
6422 * incremental.cc: Likewise.
6423 * layout.cc: Likewise.
6424 * layout.h: Likewise.
6425 * main.cc: Likewise.
6426 * merge.cc: Likewise.
6427 * merge.h: Likewise.
6428 * object.cc: Likewise.
6429 * object.h: Likewise.
6430 * options.cc: Likewise.
6431 * options.h: Likewise.
6432 * output.cc: Likewise.
6433 * output.h: Likewise.
6434 * plugin.cc: Likewise.
6435 * plugin.h: Likewise.
6436 * powerpc.cc: Likewise.
6437 * reloc.cc: Likewise.
6438 * script-c.h: Likewise.
6439 * script-sections.cc: Likewise.
6440 * script.cc: Likewise.
6441 * stringpool.cc: Likewise.
6442 * symtab.cc: Likewise.
6443 * symtab.h: Likewise.
6444 * target.cc: Likewise.
6445 * timer.cc: Likewise.
6446 * timer.h: Likewise.
6447 * version.cc: Likewise.
6448 * x86_64.cc: Likewise.
6450 2010-08-24 Nick Clifton <nickc@redhat.com>
6453 * layout.cc (segment_precedes): Sort segments by their physical
6454 addresses, if they have been set.
6456 2010-08-23 Cary Coutant <ccoutant@google.com>
6458 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
6460 (Lib_group::include_member): Unlock object after deleting its
6462 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
6465 2010-08-19 Neil Vachharajani <nvachhar@google.com>
6466 Cary Coutant <ccoutant@google.com>
6468 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
6469 constructor, and set_blocker.
6470 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
6472 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
6473 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
6474 * testsuite/Makefile.am (start_lib_test): New test case.
6475 * testsuite/Makefile.in: Regenerate.
6476 * testsuite/start_lib_test_main.c: New file.
6477 * testsuite/start_lib_test_1.c: New file.
6478 * testsuite/start_lib_test_2.c: New file.
6479 * testsuite/start_lib_test_3.c: New file.
6481 2010-08-19 Ian Lance Taylor <iant@google.com>
6483 * Makefile.in: Rebuild with automake 1.11.1.
6484 * aclocal.m4: Likewise.
6485 * testsuite/Makefile.in: Likewise.
6487 2010-08-19 Ian Lance Taylor <iant@google.com>
6490 * i386.cc (class Output_data_plt_i386): Update declarations.
6491 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
6492 local_ifuncs_ fields.
6493 (Target_i386::do_plt_section_for_global): New function.
6494 (Target_i386::do_plt_section_for_local): New function.
6495 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
6496 parameter; change all callers. Initialize global_ifuncs_ and
6497 local_ifuncs_. If doing a static link define __rel_iplt_start and
6499 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
6500 (Output_data_plt_i386::add_local_ifunc_entry): New function.
6501 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
6503 (Target_i386::make_plt_section): New function, broken out of
6504 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
6505 (Target_i386::make_plt_entry): Call make_plt_section.
6506 (Target_i386::make_local_ifunc_plt_entry): New function.
6507 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
6508 (Target_i386::Scan::local): Handle IFUNC symbols. Add
6509 R_386_IRELATIVE to switch.
6510 (Target_i386::Scan::global): Likewise.
6511 (Target_i386::Relocate::relocate): Likewise.
6512 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
6514 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
6515 (Target_x86_64::do_plt_section_for_global): New function.
6516 (Target_x86_64::do_plt_section_for_local): New function.
6517 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
6518 parameter; change all callers. If doing a static link define
6519 __rela_iplt_start and __rela_iplt_end.
6520 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
6521 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
6522 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
6524 (Target_x86_64::make_local_ifunc_plt_entry): New function.
6525 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
6527 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
6528 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
6529 R_X86_64_IRELATIVE to switch.
6530 (Target_x86_64::Scan::global): Likewise.
6531 (Target_x86_64::Relocate::relocate): Likewise.
6532 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
6534 * target.h (class Target): Add plt_section_for_global and
6535 plt_section_for_local functions. Add do_plt_section_for_global
6536 and do_plt_section_for_local virtual functions.
6537 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
6538 clarifying comments.
6539 (Symbol::use_plt_offset): Handle IFUNC symbol.
6540 * object.cc (Sized_relobj::Sized_relobj): Initialize
6542 (Sized_relobj::local_has_plt_offset): New function.
6543 (Sized_relobj::local_plt_offset): New function.
6544 (Sized_relobj::set_local_plt_offset): New function.
6545 (Sized_relobj::do_count): Handle IFUNC symbol.
6546 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
6547 a bit away from input_shndx_ field. Add set_is_func_symbol and
6548 is_ifunc_symbol functions.
6549 (class Sized_relobj): Update declarations. Remove Tls_got_entry
6550 and Local_tls_got_offsets. Define Local_plt_offsets. Add
6551 local_plt_offsets_ field.
6552 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
6553 * output.h (class Output_section_data): Add non-const
6554 output_section function.
6555 (class Output_data_got): Update declarations.
6556 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
6557 Add use_plt_offset parameter to global and local constructors.
6558 Change all callers. Change local_sym_index_ field to 31 bits.
6559 Change GSYM_CODE and CONSTANT_CODE accordingly.
6560 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
6561 doing a static link don't set sh_link field.
6562 (Output_data_got::Got_entry::write): Use PLT offset if
6564 (Output_data_got::add_global_plt): New function.
6565 (Output_data_got::add_local_plt): New function.
6566 * target-reloc.h (relocate_section): Handle IFUNC symbol.
6567 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
6568 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
6569 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
6570 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
6572 * testsuite/ifunc-sel.h: New file.
6573 * testsuite/ifuncmain1.c: New file.
6574 * testsuite/ifuncmain1vis.c: New file.
6575 * testsuite/ifuncmod1.c: New file.
6576 * testsuite/ifuncdep2.c: New file.
6577 * testsuite/ifuncmain2.c: New file.
6578 * testsuite/ifuncmain3.c: New file.
6579 * testsuite/ifuncmod3.c: New file.
6580 * testsuite/ifuncmain4.c: New file.
6581 * testsuite/ifuncmain5.c: New file.
6582 * testsuite/ifuncmod5.c: New file.
6583 * testsuite/ifuncmain6pie.c: New file.
6584 * testsuite/ifuncmod6.c: New file.
6585 * testsuite/ifuncmain7.c: New file.
6586 * configure, testsuite/Makefile.in: Rebuild.
6588 2010-08-18 Ian Lance Taylor <iant@google.com>
6591 (Output_section_incremental_inputs::write_input_files): Add cast
6592 to avoid signed/unsigned comparison warning.
6593 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6595 2010-08-12 Cary Coutant <ccoutant@google.com>
6597 * common.cc (Sort_commons::operator()): Remove unnecessary code.
6599 2010-08-13 Ian Lance Taylor <iant@google.com>
6601 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
6603 2010-08-12 Cary Coutant <ccoutant@google.com>
6604 Doug Kwan <dougkwan@google.com>
6606 * resolve.cc (Symbol_table::should_override): When a weak dynamic
6607 defintion overrides non-weak undef, remember that the original undef
6609 * symtab.cc (Symbol_table::sized_write_global): For undef without
6610 an original weak binding, set binding to global in output.
6611 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
6612 * testsuite/Makefile.in: Regenerate.
6613 * testsuite/strong_ref_weak_def.sh: New file.
6614 * testsuite/strong_ref_weak_def_1.c: Ditto.
6615 * testsuite/strong_ref_weak_def_2.c: Ditto.
6617 2010-08-12 Cary Coutant <ccoutant@google.com>
6619 * testsuite/incremental_test.sh: Rewrite.
6620 * testsuite/incremental_test_1.c: Rewrite.
6621 * testsuite/incremental_test_2.c: Rewrite.
6623 2010-08-12 Cary Coutant <ccoutant@google.com>
6625 * arm.cc (Target_arm::got_size): Add const.
6626 (Target_arm::got_entry_count): New function.
6627 (Target_arm::plt_entry_count): New function.
6628 (Target_arm::first_plt_entry_offset): New function.
6629 (Target_arm::plt_entry_size): New function.
6630 (Output_data_plt_arm::entry_count): New function.
6631 (Output_data_plt_arm::first_plt_entry_offset): New function.
6632 (Output_data_plt_arm::get_plt_entry_size): New function.
6633 * i386.cc (Target_i386::got_size): Add const.
6634 (Target_i386::got_entry_count): New function.
6635 (Target_i386::plt_entry_count): New function.
6636 (Target_i386::first_plt_entry_offset): New function.
6637 (Target_i386::plt_entry_size): New function.
6638 (Output_data_plt_i386::entry_count): New function.
6639 (Output_data_plt_i386::first_plt_entry_offset): New function.
6640 (Output_data_plt_i386::get_plt_entry_size): New function.
6641 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
6642 find_incremental_inputs_sections. Dump incremental_got_plt section.
6643 * incremental.cc: Include target.h.
6644 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
6645 parameter. Adjust all callers. Find incremental_got_plt section.
6646 (Incremental_inputs::create_data_sections): Create incremental_got_plt
6648 (Output_section_incremental_inputs::set_final_data_size): Calculate
6649 size of incremental_got_plt section.
6650 (Output_section_incremental_inputs::do_write): Write the
6651 incremental_got_plt section.
6652 (Got_plt_view_info): New struct.
6653 (Local_got_offset_visitor): New class.
6654 (Global_got_offset_visitor): New class.
6655 (Global_symbol_visitor_got_plt): New class.
6656 (Output_section_incremental_inputs::write_got_plt): New function.
6657 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
6658 Add parameter. Adjust all callers.
6659 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6660 (Incremental_inputs::got_plt_section): New function.
6661 (Incremental_inputs::got_plt_section_): New data member.
6662 (Incremental_got_plt_reader): New class.
6663 * layout.cc (Layout::create_incremental_info_sections): Add the
6664 incremental_got_plt section.
6665 * object.h (Got_offset_list::get_list): New function.
6666 (Got offset_list::for_all_got_offsets): New function.
6667 (Sized_relobj::local_got_offset_list): New function.
6668 * powerpc.cc (Target_powerpc::got_size): Add const.
6669 (Target_powerpc::got_entry_count): New function.
6670 (Target_powerpc::plt_entry_count): New function.
6671 (Target_powerpc::first_plt_entry_offset): New function.
6672 (Target_powerpc::plt_entry_size): New function.
6673 (Output_data_plt_powerpc::entry_count): New function.
6674 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
6675 (Output_data_plt_powerpc::get_plt_entry_size): New function.
6676 * sparc.cc (Target_sparc::got_size): Add const.
6677 (Target_sparc::got_entry_count): New function.
6678 (Target_sparc::plt_entry_count): New function.
6679 (Target_sparc::first_plt_entry_offset): New function.
6680 (Target_sparc::plt_entry_size): New function.
6681 (Output_data_plt_sparc::entry_count): New function.
6682 (Output_data_plt_sparc::first_plt_entry_offset): New function.
6683 (Output_data_plt_sparc::get_plt_entry_size): New function.
6684 * symtab.h (Symbol::got_offset_list): New function.
6685 (Symbol_table::for_all_symbols): New function.
6686 * target.h (Sized_target::got_entry_count): New function.
6687 (Sized_target::plt_entry_count): New function.
6688 (Sized_target::plt_entry_size): New function.
6689 * x86_64.cc (Target_x86_64::got_size): Add const.
6690 (Target_x86_64::got_entry_count): New function.
6691 (Target_x86_64::plt_entry_count): New function.
6692 (Target_x86_64::first_plt_entry_offset): New function.
6693 (Target_x86_64::plt_entry_size): New function.
6694 (Output_data_plt_x86_64::entry_count): New function.
6695 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
6696 (Output_data_plt_x86_64::get_plt_entry_size): New function.
6698 2010-08-12 Cary Coutant <ccoutant@google.com>
6700 * archive.cc: Include incremental.h.
6701 (Archive::Archive): Initialize incremental_info_.
6702 (Archive::include_member): Record archive members in incremental info.
6703 (Add_archive_symbols::run): Record begin and end of an archive in
6705 (Lib_group::include_member): Record objects in incremental info.
6706 * archive.h (Incremental_archive_entry): Forward declaration.
6707 (Archive::set_incremental_info): New member function.
6708 (Archive::incremental_info): New member function.
6709 (Archive::Unused_symbol_iterator): New class.
6710 (Archive::unused_symbols_begin): New member function.
6711 (Archive::unused_symbols_end): New member function.
6712 (Archive::incremental_info_): New data member.
6713 * incremental-dump.cc (find_input_containing_global): New function.
6714 (dump_incremental_inputs): Dump new incremental info sections.
6715 * incremental.cc: Include symtab.h.
6716 (Output_section_incremental_inputs): New class.
6717 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
6718 new incremental info sections.
6719 (Sized_incremental_binary::do_check_inputs): Likewise.
6720 (Incremental_inputs::report_archive): Remove.
6721 (Incremental_inputs::report_archive_begin): New function.
6722 (Incremental_inputs::report_archive_end): New function.
6723 (Incremental_inputs::report_object): New function.
6724 (Incremental_inputs::finalize_inputs): Remove.
6725 (Incremental_inputs::report_input_section): New function.
6726 (Incremental_inputs::report_script): Rewrite.
6727 (Incremental_inputs::finalize): Do nothing but finalize string table.
6728 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6729 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6730 (Incremental_inputs::create_data_sections): New function.
6731 (Incremental_inputs::relocs_entsize): New function.
6732 (Output_section_incremental_inputs::set_final_data_size): New function.
6733 (Output_section_incremental_inputs::do_write): New function.
6734 (Output_section_incremental_inputs::write_header): New function.
6735 (Output_section_incremental_inputs::write_input_files): New function.
6736 (Output_section_incremental_inputs::write_info_blocks): New function.
6737 (Output_section_incremental_inputs::write_symtab): New function.
6738 * incremental.h (Incremental_script_entry): Forward declaration.
6739 (Incremental_object_entry): Forward declaration.
6740 (Incremental_archive_entry): Forward declaration.
6741 (Incremental_inputs): Forward declaration.
6742 (Incremental_inputs_header_data): Remove.
6743 (Incremental_inputs_header): Remove.
6744 (Incremental_inputs_header_write): Remove.
6745 (Incremental_inputs_entry_data): Remove.
6746 (Incremental_inputs_entry): Remove.
6747 (Incremental_inputs_entry_write): Remove.
6748 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
6749 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
6750 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6751 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
6753 (Incremental_input_entry): New class.
6754 (Incremental_script_entry): New class.
6755 (Incremental_object_entry): New class.
6756 (Incremental_archive_entry): New class.
6757 (Incremental_inputs::Incremental_inputs): Initialize new data members.
6758 (Incremental_inputs::report_inputs): Remove.
6759 (Incremental_inputs::report_archive): Remove.
6760 (Incremental_inputs::report_archive_begin): New function.
6761 (Incremental_inputs::report_archive_end): New function.
6762 (Incremental_inputs::report_object): Change prototype.
6763 (Incremental_inputs::report_input_section): New function.
6764 (Incremental_inputs::report_script): Change prototype.
6765 (Incremental_inputs::get_reloc_count): New function.
6766 (Incremental_inputs::set_reloc_count): New function.
6767 (Incremental_inputs::create_data_sections): New function.
6768 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6769 (Incremental_inputs::inputs_section): New function.
6770 (Incremental_inputs::symtab_section): New function.
6771 (Incremental_inputs::relocs_section): New function.
6772 (Incremental_inputs::get_stringpool): Add const.
6773 (Incremental_inputs::command_line): Add const.
6774 (Incremental_inputs::inputs): Remove.
6775 (Incremental_inputs::command_line_key): New function.
6776 (Incremental_inputs::input_file_count): New function.
6777 (Incremental_inputs::input_files): New function.
6778 (Incremental_inputs::relocs_entsize): New function.
6779 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6780 (Incremental_inputs::finalize_inputs): Remove.
6781 (Incremental_inputs::Input_info): Remove.
6782 (Incremental_inputs::lock_): Remove.
6783 (Incremental_inputs::inputs_): Change type.
6784 (Incremental_inputs::inputs_map_): Remove.
6785 (Incremental_inputs::current_object_entry_): New data member.
6786 (Incremental_inputs::inputs_section_): New data member.
6787 (Incremental_inputs::symtab_section_): New data member.
6788 (Incremental_inputs::relocs_section_): New data member.
6789 (Incremental_inputs::reloc_count_): New data member.
6790 (Incremental_inputs_reader): New class.
6791 (Incremental_symtab_reader): New class.
6792 (Incremental_relocs_reader): New class.
6793 * layout.cc (Layout::finalize): Move finalization of incremental info
6794 and creation of incremental info sections to follow finalization of
6795 symbol table. Set offsets for postprocessing sections.
6796 (Layout::create_incremental_info_sections): Call
6797 Incremental_inputs::create_data_sections. Add incremental symtab
6798 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
6799 sections to layout after input sections.
6800 * layout.h (struct Timespec): Forward declaration.
6801 (Layout::incremental_inputs): Add const.
6802 (Layout::create_incremental_info_sections): Add parameter.
6803 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
6804 * object.cc: Include incremental.h.
6805 (Relobj::finalize_incremental_relocs): New function.
6806 (Sized_relobj::do_layout): Record input sections in incremental info.
6807 * object.h (Object::output_section): New function.
6808 (Object::output_section_offset): Moved from Relobj.
6809 (Object::get_incremental_reloc_base): New function.
6810 (Object::get_incremental_reloc_count): New function.
6811 (Object::do_output_section): New function.
6812 (Object::do_output_section_offset): Moved from Relobj.
6813 (Object::do_get_incremental_reloc_base): New function.
6814 (Object::do_get_incremental_reloc_count): New function.
6815 (Object::Object): Initialize new data members.
6816 (Relobj::output_section): Renamed do_output_section and moved to
6818 (Relobj::output_section_offset): Moved to Object.
6819 (Relobj::do_get_incremental_reloc_base): New function.
6820 (Relobj::do_get_incremental_reloc_count): New function.
6821 (Relobj::allocate_incremental_reloc_counts): New function.
6822 (Relobj::count_incremental_reloc): New function.
6823 (Relobj::finalize_incremental_relocs): New function.
6824 (Relobj::next_incremental_reloc_index): New function.
6825 (Relobj::reloc_counts_): New data member.
6826 (Relobj::reloc_bases_): New data member.
6827 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
6828 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
6829 (Sized_relobj::incremental_relocs_scan): New function.
6830 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6831 (Sized_relobj::incremental_relocs_write): New function.
6832 (Sized_relobj::incremental_relocs_write_reltype): New function.
6833 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
6835 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
6836 archives and object files elsewhere.
6837 (Add_symbols::run): Report object files here.
6838 (Finish_group::run): Report end of archive at end of group.
6839 * reloc.cc: Include layout.h, incremental.h.
6840 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
6841 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
6842 (Sized_relobj::incremental_relocs_scan): New function.
6843 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6844 (Sized_relobj::do_relocate_sections): Write incremental relocations.
6845 (Sized_relobj::incremental_relocs_write): New function.
6846 (Sized_relobj::incremental_relocs_write_reltype): New function.
6847 * script.cc (read_input_script): Rewrite test for incremental link.
6848 Change call to Incremental_inputs::report_script.
6849 * symtab.h (Symbol_table::first_global_index): New function.
6850 (Symbol_table::output_count): New function.
6852 2010-08-12 Doug Kwan <dougkwan@google.com>
6854 * arm.cc (Target_arm::merge_object_attributes): Check command line
6855 options --no-wchar-size-warning and --no-enum-size-warning.
6856 * options.h (General_options): Add ld-compatible options
6857 --no-enum-size-warning and --no-wchar-size-warning.
6859 2010-08-04 Ian Lance Taylor <iant@google.com>
6861 * x86_64.cc (Target_x86_64::Scan::local): Use
6862 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
6863 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
6864 (Target_x86_64::Scan::global): Likewise.
6865 (Target_x86_64::Relocate::relocate): Likewise.
6866 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
6869 2010-08-03 Cary Coutant <ccoutant@google.com>
6871 * merge.cc (Output_merge_string::do_add_input_section): Count strings
6872 to reserve space in merged_strings vector. Keep total input size
6874 (Output_merge_string::do_print_merge_stats): Print total input size.
6875 * merge.h (Output_merge_string): Add input_size_ field.
6876 * stringpool.cc (Stringpool_template::string_length): Move
6877 implementations out of Stringpool_template class and place in
6879 * stringpool.h (string_length): Move out of Stringpool_template.
6881 2010-08-03 Ian Lance Taylor <iant@google.com>
6884 * layout.cc (relaxation_loop_body): If address of load segment is
6885 set, adjust address to include headers if possible.
6887 2010-08-03 Ian Lance Taylor <iant@google.com>
6889 * version.cc (version_string): Bump to 1.10.
6891 2010-08-03 Ian Lance Taylor <iant@google.com>
6894 * layout.h (enum Output_section_order): Define.
6895 (class Layout): Update declarations.
6896 * layout.cc (Layout::get_output_section): Add order parameter.
6897 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
6898 is_first_non_relro parameters. Change all callers.
6899 (Layout::choose_output_section): Likewise.
6900 (Layout::add_output_section_data): Likewise.
6901 (Layout::make_output_section): Likewise. Set order.
6902 (Layout::default_section_order): New function.
6903 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
6904 * output.cc (Output_section::Output_section): Initialize order_.
6905 Don't initialize deleted fields.
6906 (Output_segment::Output_segment): Don't initialize deleted
6908 (Output_segment::add_output_section_to_load): New function
6909 replacing add_output_section. Change all callers to call this or
6910 add_output_section_to_nonload.
6911 (Output_segment::add_output_section_to_nonload): New function.
6912 (Output_segment::remove_output_section): Rewrite.
6913 (Output_segment::add_initial_output_data): Likewise.
6914 (Output_segment::has_any_data_sections): Likewise.
6915 (Output_segment::is_first_section_relro): Likewise.
6916 (Output_segment::maximum_alignment): Likewise.
6917 (Output_segment::has_dynamic_reloc): New function replacing
6918 dynamic_reloc_count. Change all callers.
6919 (Output_segment::has_dynamic_reloc_list): New function replacing
6920 dynamic_reloc_count_list. Change all callers.
6921 (Output_segment::set_section_addresses): Rewrite.
6922 (Output_segment::set_offset): Rewrite.
6923 (Output_segment::find_first_and_last_list): Remove.
6924 (Output_segment::set_tls_offsets): Rewrite.
6925 (Output_segment::first_section_load_address): Likewise.
6926 (Output_segment::output_section_count): Likewise.
6927 (Output_segment::section_with_lowest_load_address): Likewise.
6928 (Output_segment::write_section_headers): Likewise.
6929 (Output_segment::print_sections_to_map): Likewise.
6930 * output.h (class Output_data): Remove dynamic_reloc_count_
6931 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
6932 (Output_data::add_dynamic_reloc): Rewrite.
6933 (Output_data::has_dynamic_reloc): New function.
6934 (Output_data::dynamic_reloc_count): Remove.
6935 (class Output_section): Add order_ field. Remvoe is_relro_local_,
6936 is_last_relro_, is_first_non_relro_, is_interp_,
6937 is_dynamic_linker_section_ fields. Add order and set_order
6938 functions. Remove is_relro_local, set_is_relro_local,
6939 is_last_relro, set_is_last_relro, is_first_non_relro,
6940 set_is_first_non_relro functions, is_interp, set_is_interp,
6941 is_dynamic_linker_section, and set_is_dynamic_linker_section
6943 (class Output_segment): Change Output_data_list from std::list to
6944 std:;vector. Add output_lists_ field. Remove output_data_ and
6945 output_bss_ fields. Update declarations.
6947 2010-08-02 Ian Lance Taylor <iant@google.com>
6949 * arm.cc (Target_arm::gc_process_relocs): Use typename.
6950 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
6951 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
6953 2010-08-02 Ian Lance Taylor <iant@google.com>
6956 * script.cc (Script_options::Script_options): Initialize
6957 symbol_definitions_ and symbol_references_.
6958 (Script_options::add_symbol_assignment): Update
6959 symbol_definitions_ and symbol_references_.
6960 (Script_options::add_symbol_reference): New function.
6961 (script_symbol): New function.
6962 * script.h (class Script_options): Add symbol_definitions_ and
6963 symbol_references_ fields.
6964 (Script_options::referenced_const_iterator): New type.
6965 (Script_options::referenced_begin): New function.
6966 (Script_options::referenced_end): New function.
6967 (Script_options::is_referenced): New function.
6968 (Script_options::any_unreferenced): New function.
6969 * script-c.h (script_symbol): Declare.
6970 * yyscript.y (exp): Call script_symbol.
6971 * symtab.cc: Include "script.h".
6972 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
6973 Change all callers. Check symbols referenced by scripts.
6974 (Symbol_table::add_undefined_symbols_from_command_line): Add
6975 layout parameter. Change all callers.
6976 (Symbol_table::do_add_undefined_symbols_from_command_line):
6977 Likewise. Break out loop body. Check symbols referenced by
6979 (Symbol_table::add_undefined_symbol_from_command_line): New
6980 function broken out of
6981 do_add_undefined_symbols_from_command_line.
6982 * symtab.h (class Symbol_table): Update declarations.
6983 * archive.cc: Include "layout.h".
6984 (Archive::should_include_member): Add layout parameter. Change
6985 all callers. Check for symbol mentioned in expression.
6986 * archive.h (class Archive): Update declaration.
6987 * object.cc (Sized_relobj::do_should_include_member): Add layout
6989 * object.h (Object::should_include_member): Add layout parameter.
6991 (Object::do_should_include_member): Add layout parameter.
6992 (class Sized_relobj): Update declaration.
6993 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
6995 * dynobj.h (class Sized_dynobj): Update declaration.
6996 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
6998 * plugin.h (class Sized_pluginobj): Update declaration.
7000 2010-08-02 Ian Lance Taylor <iant@google.com>
7003 * output.cc (Output_segment::set_offset): Search for the first and
7004 last sections rather than assuming that the list is in order.
7005 (Output_segment::find_first_and_last_list): New function.
7006 * output.h (class Output_segment): Update declarations.
7007 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7008 (relro_strip_test_SOURCES): New variable.
7009 (relro_strip_test_DEPENDENCIES): New variable.
7010 (relro_strip_test_LDFLAGS): New variable.
7011 (relro_strip_test_LDADD): New variable.
7012 (relro_strip_test.so): New target.
7014 2010-08-02 Ian Lance Taylor <iant@google.com>
7016 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7017 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7018 (Target_i386::got_tlsdesc_section): New function.
7019 (Target_i386::got_section): Create space for GOT entries for
7020 TLSDESC relocations.
7021 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7023 (Target_i386::Scan::global): Likewise.
7024 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
7026 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
7027 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
7028 (Target_x86_64::got_tlsdesc_section): New function.
7029 (Target_x86_64::got_section): Create space for GOT entries for
7030 TLSDESC relocations.
7031 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
7033 (Target_x86_64::Scan::global): Likewise.
7034 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
7037 2010-08-02 Ian Lance Taylor <iant@google.com>
7039 * testsuite/final_layout.sh: Use dc to convert from hex to
7042 2010-07-29 Sriraman Tallam <tmsriram@google.com>
7044 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
7045 paramter to the call to gold::gc_process_relocs.
7046 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
7047 paramter to the call to gold::gc_process_relocs.
7048 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
7049 parameter to the call to gold::gc_process_relocs.
7050 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
7051 template parameter to the call to gold::gc_process_relocs.
7052 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
7053 paramter to the call to gold::gc_process_relocs.
7054 * gc.h (get_embedded_addend_size): New function.
7055 (gc_process_relocs): Save the size of the reloc for use by ICF.
7056 * icf.cc (get_section_contents): Get the addend from the text section
7057 for SHT_REL relocation sections.
7058 * icf.h (Icf::Reloc_addend_size_info): New typedef.
7059 (Icf::Reloc_info): Add new member reloc_addend_size_info.
7060 * int_encoding.h (read_from_pointer): New overloaded function.
7061 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
7062 * testsuite/icf_sht_rel_addend_test.sh: New file.
7063 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
7064 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
7066 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7068 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
7069 * Makefile.in: Regenerate.
7070 * testsuite/Makefile.in: Regenerate.
7072 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
7074 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
7075 * gold/testsuite/debug_msg.cc: Likewise.
7076 * gold/testsuite/odr_violation1.cc
7077 * gold/testsuite/odr_violation2.cc
7079 2010-07-21 Cary Coutant <ccoutant@google.com>
7081 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
7082 string, and length fields.
7083 (Output_merge_string::Merged_strings_list): New type.
7084 (Output_merge_string::Merged_strings_lists): New typedef.
7085 (Output_merge_string): Replace merged_strings_ with
7086 merged_strings_lists_.
7087 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
7088 Merged_strings_list per input object and section. Don't store pointer
7089 to the string. Don't store length with each merged string entry.
7090 (Output_merge_string::finalize_merged_data): Loop over list of merged
7091 strings lists. Recompute length of each merged string.
7093 2010-07-15 Cary Coutant <ccoutant@google.com>
7095 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
7098 2010-07-14 Ian Lance Taylor <iant@google.com>
7100 * descriptors.cc (Descriptors::open): Report correct name in error
7103 2010-07-13 Doug Kwan <dougkwan@google.com>
7105 * arm.cc (Arm_input_section::Arm_input_section): For a
7106 SHT_ARM_EXIDX section, always keeps the input sections.
7107 (Arm_input_section::set_exidx_section_link): New method.
7108 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
7109 has_errors_ to false.
7110 (Arm_exidx_input_section::has_errors,
7111 Arm_exidx_input_section::set_has_errors): New methods.
7112 (Arm_exidx_input_section::has_errors_): New data member.
7113 (Arm_relobj::get_exidx_shndx_list): New method.
7114 (Arm_output_section::append_text_sections_to_list): Do not skip
7115 section without SHF_EXECINSTR.
7116 (Arm_output_section::fix_exidx_coverage): Skip input sections with
7118 (Arm_relobj::make_exidx_input_section): Add new parameter for text
7119 section header. Make error messages more verbose. Check for
7120 a non-executable section linked to an EXIDX section.
7121 (Arm_relobj::do_read_symbols): Remove error checking, which has been
7122 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
7123 check that there is no deferred EXIDX section if we exit early.
7124 Instead of not making an EXIDX section in case of an error, make one
7125 and set the has_errors flag of it.
7126 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
7127 in a relocatable link.
7128 (Target_arm::do_relax): Look for the EXIDX output section instead of
7129 assuming that it is called .ARM.exidx.
7130 (Target_arm::fix_exidx_coverage): Add a new parameter for input
7131 section list. Do not check for SHF_EXECINSTR section flags but
7132 skip any input section with errors.
7133 * output.cc (Output_section::Output_section): Initialize
7134 always_keeps_input_sections_ to false.
7135 (Output_section::add_input_section): Check for
7136 always_keeps_input_sections_.
7137 * output.h (Output_section::always_keeps_input_sections,
7138 Output_section::set_always_keeps_input_sections): New methods.
7139 (Output_section::always_keeps_input_sections): New data member.
7141 2010-07-13 Rafael Espindola <espindola@google.com>
7143 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
7144 * fileread.h (Input_file): Add try_extra_search_path and find_file.
7146 2010-07-13 Philip Herron <herron.philip@googlemail.com>
7147 Ian Lance Taylor <iant@google.com>
7149 * output.h (Output_section_lookup_maps::add_merge_section):
7150 Correct check of whether value was inserted.
7151 (Output_section_lookup_maps::add_merge_input_section): Likewise.
7152 (Output_section_lookup_maps::add_relaxed_input_section):
7154 * arm.cc (Target_arm::got_section): Remove used local os.
7155 * i386.cc (Target_i386::got_section): Likewise.
7156 * x86_64.cc (Target_x86_64::got_section): Likewise.
7157 * sparc.cc (Target_sparc::got_section): Likewise.
7158 (Target_sparc::relocate): Remove unused local have_got_offset.
7159 * powerpc.cc (Target_powerpc::relocate): Likewise.
7161 2010-07-13 Ian Lance Taylor <iant@google.com>
7163 * compressed_output.cc (zlib_decompress): Fix signature in
7166 * archive.cc (Archive::include_member): Unlock an external member
7167 of a thin archive. Don't bother to delete an object we know is
7170 2010-07-12 Cary Coutant <ccoutant@google.com>
7172 * compressed_output.cc (zlib_decompress): New function.
7173 (get_uncompressed_size): New function.
7174 (decompress_input_section): New function.
7175 * compressed_output.h (get_uncompressed_size): New function.
7176 (decompress_input_section): New function.
7177 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
7178 Handle compressed debug sections.
7179 * layout.cc (is_compressed_debug_section): New function.
7180 (Layout::output_section_name): Map compressed section names to
7182 * layout.h (is_compressed_debug_section): New function.
7183 (is_debug_info_section): Recognize compressed debug sections.
7184 * merge.cc: Include compressed_output.h.
7185 (Output_merge_data::do_add_input_section): Handle compressed
7187 (Output_merge_string::do_add_input_section): Handle compressed
7189 * object.cc: Include compressed_output.h.
7190 (Sized_relobj::Sized_relobj): Initialize new data members.
7191 (build_compressed_section_map): New function.
7192 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
7193 * object.h (Object::section_is_compressed): New method.
7194 (Object::do_section_is_compressed): New method.
7195 (Sized_relobj::Compressed_section_map): New type.
7196 (Sized_relobj::do_section_is_compressed): New method.
7197 (Sized_relobj::compressed_sections_): New data member.
7198 * output.cc (Output_section::add_input_section): Handle compressed
7200 * reloc.cc: Include compressed_output.h.
7201 (Sized_relobj::write_sections): Handle compressed debug sections.
7203 2010-07-08 Cary Coutant <ccoutant@google.com>
7205 * resolve.cc (Symbol_table::resolve): Remember whether undef was
7206 weak when resolving to a dynamic def.
7207 (Symbol_table::should_override): Add adjust_dyndef flag; set it
7208 for weak undef/dynamic def cases. Adjust callers.
7209 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
7210 undef_binding_weak_.
7211 (Symbol_table::sized_write_globals): Adjust symbol binding.
7212 (Symbol_table::sized_write_symbol): Add binding parameter.
7213 * symtab.h (Symbol::set_undef_binding): New method.
7214 (Symbol::is_undef_binding_weak): New method.
7215 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
7216 (Symbol_table::should_override): Add new parameter.
7217 (Symbol_table::sized_write_symbol): Add new parameter.
7219 * testsuite/weak_undef_file1.cc: Add new test case.
7220 * testsuite/weak_undef_file2.cc: Fix header comment.
7221 * testsuite/weak_undef_test.cc: Add new test case.
7223 2010-06-29 Doug Kwan <dougkwan@google.com>
7225 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
7226 Initialize USE_SYMBOL_.
7227 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
7229 (Arm_reloc_property::uses_symbol_): New data member declaration.
7230 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
7231 uses symbol value and symbol is undefined but not weakly undefined.
7233 2010-06-28 Rafael Espindola <espindola@google.com>
7235 * plugin.cc (Plugin::load): Use dlerror.
7237 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
7239 * symtab.cc (detect_odr_violations): When reporting an ODR
7240 violation, report an object where the symbol is defined.
7242 2010-06-25 Doug Kwan <dougkwan@google.com>
7244 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
7245 (Target_arm::section_may_have_icf_unsafe_pointers): New method
7247 (Target_arm::Scan::local_reloc_may_be_function_pointer,
7248 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
7249 target hook to detect function points.
7250 (Target_arm::Scan::possible_function_pointer_reloc): New method.
7251 * icf.h (Icf::check_section_for_function_pointers): Change type of
7252 parameter SECTION_NAME to const reference to std::string. Use
7253 target hook to determine if section may have unsafe pointers.
7254 * target.h (Target::section_may_have_icf_unsafe_pointers): New
7257 2010-06-21 Rafael Espindola <espindola@google.com>
7259 * fileread.cc (Input_file::find_fie): New
7260 (Input_file::open): Use Input_file::find_fie.
7261 * fileread.h (Input_file::find_fie): New
7262 * plugin.cc (set_extra_library_path): New.
7263 (Plugin::load): Add set_extra_library_path to the transfer vector.
7264 (Plugin_manager::set_extra_library_path): New.
7265 (Plugin_manager::add_input_file): Use the extra search path if set.
7266 (set_extra_library_path(): New.
7267 * plugin.h (Plugin_manager): Add set_extra_library_path and
7270 2010-06-19 Cary Coutant <ccoutant@google.com>
7272 * layout.cc (gdb_sections): Add .debug_types.
7273 (lines_only_debug_sections): Likewise.
7275 2010-06-18 Rafael Espindola <espindola@google.com>
7277 * plugin.cc (add_input_file,add_input_library)
7278 (Plugin_manager::add_input_file): Make filename arguments const.
7279 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
7282 2010-06-16 Doug Kwan <dougkwan@google.com>
7284 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
7285 .ARM.attributes section if we have not merged any input
7286 attributes sections.
7288 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7290 * arm.cc: Allow combining objects with no EABI version
7293 2010-06-15 Rafael Espindola <espindola@google.com>
7295 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
7297 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7299 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
7300 (struct iovec): Correct !HAVE_READV definition.
7302 2010-06-10 Cary Coutant <ccoutant@google.com>
7304 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
7305 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
7307 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
7310 * symtab.h (Symbol::is_placeholder): New member function.
7311 * target-reloc.h (relocate_section): Check for placeholder symbols.
7313 * testsuite/Makefile.am (plugin_test_8): New test.
7314 (plugin_test_9): New test.
7315 * testsuite/Makefile.in: Regenerate.
7317 2010-06-09 Nick Clifton <nickc@redhat.com>
7319 * yyscript.y (input_list_element): Allow strings prefixed with
7320 the '-' character. Treat these as libraries.
7321 * script.cc (script_add_library): New function. Adds a library
7322 specified by "-l<name>" found in an input script.
7323 * script-c.h: Add prototype for script_add_library.
7325 2010-06-07 Doug Kwan <dougkwan@google.com>
7327 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
7328 Restrict stub-group size to be within long conditional branch
7329 range when working around cortex-A8 erratum.
7331 2010-06-07 Damien Diederen <dd@crosstwine.com>
7333 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
7336 2010-06-03 Sriraman Tallam <tmsriram@google.com>
7340 (Output_section::Input_section_sort_entry::compare_section_ordering):
7341 Change to return non-zero correctly.
7342 (Output_section::Input_section_sort_section_order_index_compare
7343 ::operator()): Change to fix ambiguity in comparisons.
7345 2010-06-01 Sriraman Tallam <tmsriram@google.com>
7347 * gold.h (is_wildcard_string): New function.
7348 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
7349 (Layout::layout_eh_frame): Ditto.
7350 (Layout::find_section_order_index): New method.
7351 (Layout::read_layout_from_file): New method.
7352 * layout.h (Layout::find_section_order_index): New method.
7353 (Layout::read_layout_from_file): New method.
7354 (Layout::input_section_position_): New private member.
7355 (Layout::input_section_glob_): New private member.
7356 * main.cc (main): Call read_layout_from_file here.
7357 * options.h (--section-ordering-file): New option.
7358 * output.cc (Output_section::input_section_order_specified_): New
7360 (Output_section::Output_section): Initialize new member.
7361 (Output_section::add_input_section): Add new parameter.
7362 Keep input sections when --section-ordering-file is used.
7363 (Output_section::set_final_data_size): Sort input sections when
7364 section ordering file is specified.
7365 (Output_section::Input_section_sort_entry): Add new parameter.
7367 (Output_section::Input_section_sort_entry::compare_section_ordering):
7369 (Output_section::Input_section_sort_compare::operator()): Change to
7370 consider section_order_index.
7371 (Output_section::Input_section_sort_init_fini_compare::operator()):
7372 Change to consider section_order_index.
7373 (Output_section::Input_section_sort_section_order_index_compare
7374 ::operator()): New method.
7375 (Output_section::sort_attached_input_sections): Change to sort
7376 according to section order when specified.
7377 (Output_section::add_input_section<32, true>): Add new parameter.
7378 (Output_section::add_input_section<64, true>): Add new parameter.
7379 (Output_section::add_input_section<32, false>): Add new parameter.
7380 (Output_section::add_input_section<64, false>): Add new parameter.
7381 * output.h (Output_section::add_input_section): Add new parameter.
7382 (Output_section::input_section_order_specified): New
7384 (Output_section::set_input_section_order_specified): New method.
7385 (Input_section::Input_section): Initialize section_order_index_.
7386 (Input_section::section_order_index): New method.
7387 (Input_section::set_section_order_index): New method.
7388 (Input_section::section_order_index_): New member.
7389 (Input_section::Input_section_sort_section_order_index_compare): New
7391 (Output_section::input_section_order_specified_): New member.
7392 * script-sections.cc (is_wildcard_string): Delete and move modified
7394 (Output_section_element_input::Output_section_element_input): Modify
7395 call to is_wildcard_string.
7396 (Output_section_element_input::Input_section_pattern
7397 ::Input_section_pattern): Ditto.
7398 (Output_section_element_input::Output_section_element_input): Ditto.
7399 * testsuite/Makefile.am (final_layout): New test case.
7400 * testsuite/Makefile.in: Regenerate.
7401 * testsuite/final_layout.cc: New file.
7402 * testsuite/final_layout.sh: New file.
7404 2010-06-01 Rafael Espindola <espindola@google.com>
7406 * plugin.cc (Plugin::load): Pass the output name to the plugin.
7408 2010-06-01 Rafael Espindola <espindola@google.com>
7410 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
7411 visibility of symbols.
7413 2010-05-27 Doug Kwan <dougkwan@google.com>
7415 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
7416 from start of output section instead of address for a local symbol
7417 in a merged or relaxed section when doing a relocatable link.
7419 2010-05-26 Rafael Espindola <espindola@google.com>
7422 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
7423 adding sections the garbage collector removed.
7424 * gold/testsuite/Makefile.am: Add test.
7425 * gold/testsuite/Makefile.in: Regenerate.
7426 * gold/testsuite/plugin_test_7.sh: New.
7427 * gold/testsuite/plugin_test_7_1.c: New.
7428 * gold/testsuite/plugin_test_7_2.c: New.
7430 2010-05-26 Rafael Espindola <espindola@google.com>
7432 * script-sections.cc (Output_section_definition::set_section_addresses):
7433 Check for --section-start.
7435 2010-05-26 Doug Kwan <dougkwan@google.com>
7437 * arm.cc (Arm_scan_relocatable_relocs): New class.
7438 (Target_arm::relocate_special_relocatable): New method.
7439 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
7440 (Arm_relocate_functions::thumb_branch_common): Same.
7441 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
7442 instead of Default_scan_relocatable_relocs.
7443 * target-reloc.h (relocate_for_relocatable): Let target handle
7444 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
7445 * target.h (Sized_target::relocate_special_relocatable): New method.
7447 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7449 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
7451 2010-05-23 Doug Kwan <dougkwan@google.com>
7453 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
7455 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
7456 with a direct branch, not a conditional branch, to a stub.
7457 * merge.cc (Output_merge_base::record_input_section): New method
7459 (Output_merge_data::do_add_input_section): Record input section if
7460 keeps-input-sections flag is set.
7461 (Output_merge_string::do_add_input_section): Ditto.
7462 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
7463 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
7465 (Output_merge_base::keeps_input_sections,
7466 Output_merge_base::set_keeps_input_sections,
7467 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
7469 (Output_merge_base::Input_sections): New type declaration.
7470 (Output_merge_base::input_sections_begin,
7471 Output_merge_base::input_sections_end,
7472 Output_merge_base::do_set_keeps_input_sections): New method definitions.
7473 (Output_merge_base::bool keeps_input_sections_,
7474 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
7475 Output_merge_base::input_sections_): New data members.
7476 (Output_merge_data::do_set_keeps_input_sections): New method
7478 (Output_merge_string::do_set_keeps_input_sections): Ditto.
7479 * output.cc (Output_section::Input_section::relobj): Move method
7480 defintion from class declaration to here and handle merge sections.
7481 (Output_section::Input_section::shndx): Ditto.
7482 (Output_section::Output_section): Remove initializations of removed
7483 data members and initialize new data member LOOKUP_MAPS_.
7484 (Output_section::add_input_section): Set keeps-input-sections flag
7485 for a newly created merge output section as appropriate. Adjust code
7486 to use Output_section_lookup_maps class.
7487 (Output_section::add_relaxed_input_section): Adjst code for lookup
7488 maps code refactoring.
7489 (Output_section::add_merge_input_section): Add a new parameter
7490 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
7491 class. If adding input section to a newly created merge output
7492 section fails, remove the new merge section.
7493 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
7494 Adjust code for use of the Output_section_lookup_maps class.
7495 (Output_section::find_merge_section): Ditto.
7496 (Output_section::build_lookup_maps): New method defintion.
7497 (Output_section::find_relaxed_input_section): Adjust code to use
7498 Output_section_lookup_maps class.
7499 (Output_section::get_input_sections): Export merge sections. Adjust
7500 code to use Output_section_lookup_maps class.
7501 (Output_section:::add_script_input_section): Adjust code to use
7502 Output_section_lookup_maps class. Update lookup maps for merge
7504 (Output_section::discard_states): Use Output_section_lookup_maps.
7505 (Output_section::restore_states): Same.
7506 * output.h (Merge_section_properties): Move class defintion out of
7508 (Output_section_lookup_maps): New class.
7509 (Output_section::Input_section::is_merge_section): New method
7511 (Output_section::Input_section::relobj): Move defintion out of class
7512 defintion. Declare method only.
7513 (Output_section::Input_section::shndx): Ditto.
7514 (Output_section::Input_section::output_merge_base): New method defintion.
7515 (Output_section::Input_section::u2_.pomb): New union field.
7516 (Output_section::Merge_section_by_properties_map,
7517 Output_section::Output_section_data_by_input_section_map,
7518 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
7520 (Output_section::add_merge_input_section): Add new parameter
7521 KEEPS_INPUT_SECTIONS.
7522 (Output_section::build_lookup_maps): New method declaration.
7523 (Output_section::merge_section_map_,
7524 Output_section::merge_section_by_properties_map_,
7525 Output_section::relaxed_input_section_map_,
7526 Output_section::is_relaxed_input_section_map_valid_): Remove data
7528 (Output_section::lookup_maps_): New data member.
7530 2010-05-21 Doug Kwan <dougkwan@google.com>
7533 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
7534 avoid a compilation error.
7536 2010-05-19 Rafael Espindola <espindola@google.com>
7538 * script-sections.cc (Output_section_definition::allocate_to_segment):
7539 Update the phdrs_list even when the output section is NULL.
7540 * testsuite/Makefile.am: Add test.
7541 * testsuite/Makefile.in: Regenerate.
7542 * testsuite/script_test_9.cc: New.
7543 * testsuite/script_test_9.sh: New.
7544 * testsuite/script_test_9.t: New.
7546 2010-05-19 Doug Kwan <dougkwan@google.com>
7548 * arm.cc (Arm_input_section::original_size): New method.
7549 (Arm_input_section::do_addralign): Add a cast.
7550 (Arm_input_section::do_output_offset): Remove static cast.
7551 (Arm_input_section::original_addralign,
7552 Arm_input_section::original_size_): Change type to uint32_t.
7553 (Arm_input_section::init): Add safe casts for section alignment
7555 (Arm_input_section::set_final_data_size): Do not set address and
7556 offset of stub table.
7557 (Arm_output_section::fix_exidx_coverage): Change use of of
7558 Output_section::Simple_input_section to that of
7559 Output_section::Input_section.
7560 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
7561 except for the first pass.
7562 * output.cc (Output_section::get_input_sections): Change type of
7563 input_sections to std::list<Input_section>.
7564 (Output_section::add_script_input_section): Rename from
7565 Output_section::add_simple_input_section. Change type of SIS
7566 parameter from Simple_input_section to Input_section.
7567 * output.h (Output_section::Simple_input_section): Remove class.
7568 (Output_section::Input_section): Change class visibility to public.
7569 (Output_section::Input_section::addralign): Use stored alignments
7570 for special input sections if set.
7571 (Output_section::Input_section::set_addralign): New method.
7572 (Output_section::get_input_sections): Change parameter type from
7573 list of Simple_input_section to list of Input_section.
7574 (Output_section::add_script_input_section): Rename from
7575 Output_section::add_simple_input_section. Change first parameter's
7576 type from Simple_input_section to Input_section and remove the
7577 second and third parameters.
7578 * script-sections.cc (Input_section::Input_section_list): Change
7579 type to list of Output_section::Input_section/
7580 (Input_section_info::Input_section_info): Change parameter type of
7581 INPUT_SECTION to Output_section::Input_section.
7582 (Input_section_info::input_section): Change return type.
7583 (Input_section_info::input_section_): Change type to
7584 Output_section::Input_section.
7585 (Output_section_element_input::set_section_addresses): Adjust code
7586 to use Output_section::Input_section instead of
7587 Output_section::Simple_input_section. Adjust code for renaming
7588 of Output_section::add_simple_input_section.
7589 (Orphan_output_section::set_section_addresses): Ditto.
7591 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7593 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
7594 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
7596 2010-05-18 Rafael Espindola <espindola@google.com>
7598 * options.cc (General_options::finalize): Handle -nostdlib.
7599 * options.h (nostdlib): New option.
7600 * script.cc (script_add_search_dir): Handle -nostdlib.
7602 2010-05-12 Doug Kwan <dougkwan@google.com>
7604 * arm.cc (Target_arm::do_finalize_sections): Create an empty
7605 attributes section only if there no attributes section after merging.
7606 (Target_arm::merge_object_attributes): Move value of
7607 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
7608 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
7609 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
7610 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
7611 and arm_attr_merge_7.stdout.
7612 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
7613 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
7614 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
7615 arm_attr_merge_7b.o): New rules.
7616 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
7618 * testsuite/Makefile.in: Regenerate.
7619 * testsuite/arm_attr_merge.sh: New file.
7620 * testsuite/arm_attr_merge_[67][ab].s: Same.
7622 2010-05-05 Nick Clifton <nickc@redhat.com>
7624 * po/es.po: Updated Spanish translation.
7626 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7628 * Makefile.am (install-exec-local): Properly install gold as
7629 default cross linker.
7630 * Makefile.in: Regenerated.
7632 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7633 Nick Clifton <nickc@redhat.com>
7635 * configure.ac (install_as_default): Define and set to false
7636 unless --enable-gold or --enable-gold=both/gold has been
7638 * configure: Regenerate.
7640 * Makefile.am (install-exec-local): Install the executable as
7641 'ld.gold'. If install_as_default is true then also install it as
7643 * Makefile.in: Regenerated.
7645 2010-04-24 Ian Lance Taylor <iant@google.com>
7647 * layout.cc (Layout::layout_reloc): In relocatable link don't
7648 combine reloc sections for grouped sections.
7650 2010-04-23 Sriraman Tallam <tmsriram@google.com>
7652 * gc.h (gc_process_relocs): Pass information on relocs pointing to
7653 sections that are not ordinary to icf.
7654 * icf.cc (get_section_contents): Handle relocation pointing to section
7655 with no object or shndx information.
7656 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
7657 * testsuite/Makefile.in: Regenerate.
7658 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
7659 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
7661 2010-04-22 Ian Lance Taylor <iant@google.com>
7663 * expression.cc (Expression::Expression_eval_info): Add
7664 result_alignment_pointer field.
7665 (Expression::eval_with_dot): Add result_alignment_pointer
7666 parameter. Change all callers.
7667 (Expression::eval_maybe_dot): Likewise.
7668 (class Binary_expression): Add alignment_pointer parameter to
7669 left_value and right_value. Change all callers.
7670 (BINARY_EXPRESSION): Set result alignment.
7671 (class Trinary_expression): Add alignment_pointer parameter to
7672 arg2_value and arg3_value. Change all callers.
7673 (Trinary_cond::value): Set result alignment.
7674 (Max_expression::value, Min_expression::value): Likewise.
7675 (Align_expression::value): Likewise.
7676 * script-sections.cc (class Sections_element): Add dot_alignment
7677 parameter to set_section_addresses virtual function. Update
7679 (class Output_section_element): Likewise.
7680 (Script_sections::create_segments): Add dot_alignment parameter.
7682 (Script_sections::create_segments_from_phdrs_clause): Likewise.
7683 (Script_sections::set_phdrs_clause_addresses): Likewise.
7684 * script-sections.h: Update declarations.
7685 * script.h: Update declarations.
7686 * output.h (Output_segment::set_minimum_p_align): Don't decrease
7688 * testsuite/script_test_3.t: Set large alignment.
7689 * testsuite/script_test_3.sh: Make sure that at least one LOAD
7690 segment has expected alignment.
7692 2010-04-22 Nick Clifton <nickc@redhat.com>
7694 * po/gold.pot: Updated by the Translation project.
7695 * po/vi.po: Updated Vietnamese translation.
7697 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
7699 * testsuite/Makefile.am (check_PROGRAMS): Add
7700 icf_virtual_function_folding_test.
7701 * testsuite/Makefile.in: Regenerated.
7703 2010-04-15 Andrew Haley <aph@redhat.com>
7705 * options.h (merge_exidx_entries): New option.
7706 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
7707 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
7708 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
7709 (Target_arm::merge_exidx_entries): New function.
7710 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
7711 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
7712 to Arm_exidx_fixup constructor.
7713 Add new arg, merge_exidx_entries.
7714 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
7715 Arm_output_section::fix_exidx_coverage.
7717 2010-04-18 Sriraman Tallam <tmsriram@google.com>
7719 * icf.cc (get_section_contents): Check for preemptible functions.
7720 Ignore addend when appropriate.
7721 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
7723 (add_from_relobj): Check for section folded.
7724 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
7725 * symtab.h (should_add_dynsym_entry): Add new parameter.
7726 * target-reloc.h (scan_relocs): Check for section folded.
7727 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
7728 Check reloc types for function pointers in shared objects.
7729 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
7731 (icf_preemptible_functions_test): New test case.
7732 (icf_string_merge_test): New test case.
7733 * testsuite.Makefile.in: Regenerate.
7734 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
7735 bar_glob. Refactor code.
7736 * testsuite/icf_preemptible_functions_test.cc: New file.
7737 * testsuite/icf_preemptible_functions_test.sh: New file.
7738 * testsuite/icf_string_merge_test.cc: New file.
7739 * testsuite/icf_string_merge_test.sh: New file.
7740 * testsuite/icf_virtual_function_folding_test.cc: New file.
7741 * testsuite/icf_virtual_function_folding_test.sh: New file.
7743 2010-04-14 Doug Kwan <dougkwan@google.com>
7745 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
7746 for local symbol recounting if we remove a section due to ICF.
7747 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
7748 there are no regular objects in input.
7750 2010-04-13 Doug Kwan <dougkwan@google.com>
7752 * arm.cc (Arm_input_section::set_final_data_size): Compute
7753 accurate final data size instead of using current data size.
7755 2010-04-09 Doug Kwan <dougkwan@google.com>
7757 * layout.cc (Layout::choose_output_section): Handle script section
7759 (Layout::make_output_section_for_script): Add section type parameter.
7760 Handle script section types.
7761 * layout.h (Layout::make_output_section_for_script): Add section
7763 * output.cc (Output_section::Output_section): Initialize data member
7765 (Output_section::do_reset_address_and_file_offset): Do not set address
7766 to 0 if section is a NOLOAD section.
7767 * output.h (Output_section::is_noload): New method.
7768 (Output_section::set_is_noload): Ditto.
7769 (Output_section::is_noload_): New data member.
7770 * script-c.h (Script_section_type): New enum type.
7771 (struct Parser_output_section_header): Add new file section_type.
7772 * script-sections.cc (Sections_element::output_section_name): Add
7773 parameter for returning script section type.
7774 (Output_section_definition::output_section_name): Ditto.
7775 (Output_section_definition::section_type)P; New method.
7776 (Output_section_definiton::script_section_type_name): Ditto.
7777 (Output_section_definition::script_section_type_): New data member.
7778 (Output_section_definition::Output_section_definition): Initialize
7779 data member Output_section_definition::script_section_type_.
7780 (Output_section_definition::create_sections): Pass script section type
7781 to Layout::make_output_section_for_script.
7782 (Output_section_definition::output_section_name): Return script
7783 section type to caller.
7784 (Output_section_definition::set_section_address): Do not advance
7785 dot value and load address if section type is NOLOAD. Set address
7786 of NOLOAD sections regardless of section flags.
7787 (Output_section_definition::print): Print section type if it is
7788 not SCRIPT_SECTION_TYPE_NONE.
7789 (Output_section_definition::section_type): New method.
7790 (Output_section_definition::script_section_type_name): Ditto.
7791 (Script_sections::output_section_name): Add new parameter
7792 PSECTION_TYPE for returning script section type. Pass it to
7793 section elements. Handle discard sections.
7794 (Sort_output_sections::operator()): Handle NOLOAD sections.
7795 * script-sections.h (Script_sections::Section_type): New enum type.
7796 (Script_sections::output_section_name): Add a new parameter for
7797 returning script section type.
7798 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
7800 * yyscript.y (union): Add new field SECTION_TYPE.
7801 (COPY, DSECT, INFO, NOLOAD): New tokens.
7802 (opt_address_and_section_type): Change type to output_section_header.
7803 (section_type): New non-terminal
7804 (section_header): Handle section type.
7805 (opt_address_and_section_type): Return section type value.
7807 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
7809 * testsuite/plugin_common_test_1.c (foo): Add prototype.
7810 * testsuite/plugin_common_test_2.c (foo): Likewise.
7812 2010-04-08 Doug Kwan <dougkwan@google.com>
7814 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
7816 * output.cc (Output_section::add_merge_input_section): Simplify
7817 code and return status of Output_merge_base::add_input_section.
7818 Update merge section map only if Output_merge_base::add_input_section
7821 2010-04-07 Doug Kwan <dougkwan@google.com>
7823 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
7824 if section is marked as containing instructions but has no mapping
7826 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
7827 correct section index.
7828 (Arm_relobj::find_linked_text_section): Ditto.
7830 2010-04-07 Cary Coutant <ccoutant@google.com>
7832 * archive.cc (include_member): Destroy Read_symbols_data object before
7834 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
7835 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
7836 (Read_symbols_data::~Read_symbols_data) New destructor.
7837 (Section_relocs::Section_relocs) New constructor.
7838 (Section_relocs::~Section_relocs) New destructor.
7839 (Read_relocs_data::Read_relocs_data) New constructor.
7840 (Read_relocs_data::~Read_relocs_data) New destructor.
7841 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
7842 pointers to NULL after deleting.
7844 2010-04-07 Doug Kwan <dougkwan@google.com>
7846 * arm.cc: Replace "endianity" with "endianness" in comments.
7847 (Arm_exidx_cantunwind): Ditto.
7848 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
7849 (Arm_relobj::merge_flags_and_attributes): New method.
7850 (Arm_relobj::merge_flags_and_attributes_): New data member.
7851 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
7852 (Arm_relobj::scan_sections_for_stubs): Ditto.
7853 (Arm_relobj::do_read_symbols): Check to see if we really want to
7854 merge processor-specific flags and attributes. Exit early if
7855 an object is empty except for section names and the undefined symbol.
7856 (Target_arm::do_finalize_sections): Move check for ELF format to
7857 Arm_relobj::do_read_symbols. Merge processor specific flags and
7858 attributes from a regular object only when we have determined that
7859 it is aapropriate. Do not create an .ARM.attributes section in
7860 output if there is no regular input object.
7861 (Target_arm::merge_processor_specific_flags): Check
7862 --warn-mismatch before printing any error.
7863 (Target_arm::merge_object_attributes): Ditto.
7864 * gold.cc (queue_middle_tasks): Handle the case in which there is
7865 no regular object in input.
7866 * options.cc (General_options::parse_EB): New method.
7867 (General_options::parse_EL): Same.
7868 (General_options::General_options): Initialize endianness_.
7869 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
7871 (General_options::Endianness): New enum.
7872 (General_options::endianness): New method.
7873 (General_options::endianness_): New data member.
7874 * parameters.cc (Parameters::set_options): Check target endianness.
7875 (Parameters::set_target_once): Ditto.
7876 (Parameters::check_target_endianness): New method.
7877 (parameters_force_valid_target): If either -EL or -EB is specified,
7878 use it to define endianness of default target.
7879 * parameters.h (Parameters::check_target_endianness): New method
7881 * target.h (class Target): Change "endianity" to "endianness"
7884 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7886 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
7887 * configure: Regenerate.
7888 * Makefile.in: Regenerate.
7889 * testsuite/Makefile.in: Regenerate.
7891 2010-04-06 Cary Coutant <ccoutant@google.com>
7894 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
7895 prevailing definitions of common symbols.
7896 * testsuite/plugin_test_6.sh: New test case.
7897 * testsuite/plugin_common_test_1.c: New test case.
7898 * testsuite/plugin_common_test_2.c: New test case.
7899 * testsuite/Makefile.am (plugin_test_6): New test case.
7900 * testsuite/Makefile.in: Regenerate.
7902 2010-04-06 Nick Clifton <nickc@redhat.com>
7904 * po/vi.po: New Vietnamese translation.
7906 2010-03-30 Doug Kwan <dougkwan@google.com>
7908 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
7910 2010-03-25 Doug Kwan <dougkwan@google.com>
7912 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
7913 to avoid a conversion warning on a 32-bit host.
7915 2010-03-24 Ian Lance Taylor <iant@google.com>
7917 * testsuite/script_test_3.t: Add a TLS segment.
7918 * testsuite/Makefile.am (check_PROGRAMS): Add
7919 tls_phdrs_script_test.
7920 (tls_phdrs_script_test_SOURCES): Define.
7921 (tls_phdrs_script_test_DEPENDENCIES): Define.
7922 (tls_phdrs_script_test_LDFLAGS): Define.
7923 (tls_phdrs_script_test_LDADD): Define.
7924 * testsuite/Makefile.in: Rebuild.
7926 2010-03-23 Cary Coutant <ccoutant@google.com>
7928 * fileread.cc (find_or_make_view): Fix comment.
7930 2010-03-23 Ian Lance Taylor <iant@google.com>
7932 * script-sections.cc (class Orphan_section_placement): Define
7933 PLACE_TLS and PLACE_TLS_BSS.
7934 (Orphan_section_placement::Orphan_section_placement): Initialize
7936 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
7937 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
7938 (tls_script_test_SOURCES): Define.
7939 (tls_script_test_DEPENDENCIES): Define.
7940 (tls_script_test_LDFLAGS): Define.
7941 (tls_script_test_LDADD): Define.
7942 * testsuite/Makefile.in: Rebuild.
7944 2010-03-22 Doug Kwan <dougkwan@google.com>
7946 * arm.cc (Arm_relocate_functions::abs8,
7947 Arm_relocate_functions::abs16): Use correct check for overflow
7948 specified in the ARM ELF specs.
7949 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
7950 target of a BLX instruction specially.
7951 (Reloc_stub::stub_type_for_reloc): Ditto.
7952 (Relocate::relocate): Use symbolic names instead of numeric relocation
7953 codes to report error.
7954 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
7956 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
7957 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
7958 thumb2_blx_out_of_range.stdout
7959 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
7960 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
7961 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
7962 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
7963 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
7964 thumb2_blx_in_range, thumb2_blx_in_range.o,
7965 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
7966 thumb2_blx_out_of_range.o): New rules.
7967 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
7968 thumb2_blx_in_range and thumb2_blx_out_of_range.
7969 * testsuite/Makefile.in: Regenerate.
7970 * arm_branch_in_range.sh: Add tests for THUMB BLX.
7971 * testsuite/thumb_blx_in_range.s: New file.
7972 * testsuite/thumb_blx_out_of_range.s: New file.
7974 2010-03-22 Rafael Espindola <espindola@google.com>
7976 * archive.cc (Should_include): Move to archive.h.
7977 (should_include_member): Make it a member of Archive.
7979 (Add_lib_group_symbols): New.
7980 * archive.h: Include options.h.
7981 (Archive_member): Moved from Archive.
7982 (Should_include): Moved from archive.cc.
7984 (Add_lib_group_symbols): New.
7985 * dynobj.cc (do_should_include_member): New.
7986 * dynobj.h (do_should_include_member): New.
7987 * gold.cc (queue_initial_tasks): Update call to queue.
7988 * main.cc (main): Print lib group stats.
7989 * object.cc (do_should_include_member): New.
7990 * object.h: Include archive.h.
7991 (Object::should_include_member): New.
7992 (Object::do_should_include_member): New.
7993 (Sized_relobj::do_should_include_member): New.
7994 * options.cc (General_options::parse_start_lib): New.
7995 (General_options::parse_end_lib): New.
7996 (Input_arguments::add_file): Handle lib groups.
7997 (Input_arguments::start_group): Check we are not in a lib.
7998 (Input_arguments::start_lib): New.
7999 (Input_arguments::end_lib): New.
8000 * options.h (General_options): Add start_lib and end_lib.
8001 (Input_argument::lib_): New.
8002 (Input_argument::lib): New.
8003 (Input_argument::is_lib): New.
8004 (Input_file_lib): New.
8005 (Input_arguments::in_lib_): New.
8006 (Input_arguments::in_lib): New.
8007 (Input_arguments::start_lib): New.
8008 (Input_arguments::end_lib_): New.
8009 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8010 in unused members as preempted.
8011 (Sized_pluginobj::do_should_include_member): New.
8012 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8013 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8015 (Read_symbols::do_whole_lib_group): New.
8016 (Read_symbols::do_lib_group): New.
8017 (Read_symbols::do_read_symbols): Handle lib groups.
8018 (Read_symbols::get_name): Handle lib groups.
8019 * readsyms.h (Read_symbols): Add an archive member pointer.
8020 (Read_symbols::do_whole_lib_group): New.
8021 (Read_symbols::do_lib_group): New.
8022 (Read_symbols::member_): New.
8023 * script.cc (read_input_script): Update call to queue_soon.
8025 2010-03-19 Doug Kwan <dougkwan@google.com>
8027 * arm.cc (Stub_table::Stub_table): Initialize new data members
8028 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8029 (Stub_table::add_reloc_stub): Assign stub offset and update
8030 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8031 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
8033 (Stub_table::update_data_size_and_addralign): Use
8034 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
8035 instead of going over all reloc stubs.
8036 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
8037 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8038 Stringpool_template::offset_ to size of Stringpool_char.
8039 (Stringpool_template::new_key_offset): Remove code to initialize
8040 Stringpool_template::offset_.
8041 * stringpool.h (Stringpool_template::set_no_zero_null): Set
8042 Stringpool_template::offset_ to zero.
8044 2010-03-15 Doug Kwan <dougkwan@google.com>
8046 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8048 (Stringpool_template::new_key_offset): New method.
8049 (Stringpool_template::add_string): Assign offsets when adding new
8051 (Stringpool_template::set_string_offsets): Do not set string offsets
8052 when not optimizing.
8053 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
8055 (Chunked_vector::clear): Clear size_.
8056 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
8057 (Chunked_vector::size): Return size_.
8058 (Chunked_vector::push_back): Use size_ to find insert position.
8059 (Chunked_vector::size_): New data member.
8060 (Stringpool_template::set_no_zero_null): Assert string set is empty.
8061 (Stringpool_template::new_key_offset): New method declaration.
8062 (Stringpool_template::offset_): New data member.
8064 2010-03-15 Rafael Espindola <espindola@google.com>
8066 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
8067 Add_symbols' constructor.
8068 * readsyms.h (Add_symbols): Remove the input_group member.
8070 2010-03-10 Ian Lance Taylor <iant@google.com>
8072 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
8073 target to ask whether a reference to a symbol requires a stack
8075 * target.h (Target::is_call_to_non_split): New function.
8076 (Target::do_is_call_to_non_split): Declare virtual function.
8077 * target.cc: Include "symtab.h".
8078 (Target::do_is_call_to_non_split): New function.
8079 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
8081 2010-03-10 Cary Coutant <ccoutant@google.com>
8083 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
8084 (File_read::open[1]): Remove initial mapping of whole_file_view_.
8085 (File_read::open[2]): Add whole_file_view_ to list of views.
8086 (File_read::make_view): Remove test of whole_file_view_.
8087 (File_read::find_or_make_view): Create whole_file_view_ if
8089 (File_read::clear_views): Replace bool parameter with enum;
8090 adjust all callers. Don't delete views with permanent data;
8091 do delete cached views and views from archives if
8092 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
8093 if clearing the corresponding view.
8094 * fileread.h (File_read::Clear_views_mode): New enum.
8095 (File_read::View::is_permanent_view): New method.
8096 (File_read::clear_views): Replace bool parameter
8097 with enum; adjust all callers.
8098 * options.h (General_options): Change keep_files_mapped option;
8099 add map_whole_files.
8100 * readsyms.cc (Add_symbols::run): Delete sd_ object before
8102 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
8105 2010-03-10 David S. Miller <davem@davemloft.net>
8107 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
8109 2010-03-09 Sriraman Tallam <tmsriram@google.com>
8111 * icf.cc (get_section_contents): Add '@' marker after processing the
8114 2010-03-08 Doug Kwan <dougkwan@google.com>
8116 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
8117 due to a conversion warning.
8118 (Arm_relobj::update_output_local_symbol_count): Check for local
8119 symbol with unset output index.
8121 2010-03-05 Ian Lance Taylor <iant@google.com>
8123 * options.h (class General_options): Add --spare-dynamic-tags.
8124 * output.cc (Output_data_dynamic::set_final_data_size): Implement
8125 --spare-dynamic-tags.
8127 2010-03-05 Ian Lance Taylor <iant@google.com>
8129 * incremental.cc: Include "libiberty.h".
8131 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
8133 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
8134 function, is_info_ member.
8135 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
8136 (Versions::Versions): Update caller.
8137 (Versions::define_base_version): Likewise.
8138 (Versions::add_def): Likewise.
8140 2010-03-03 Sriraman Tallam <tmsriram@google.com>
8142 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
8143 (Scan::possible_function_pointer_reloc): New function.
8144 (Scan::local_reloc_may_be_function_pointer): Change to call
8145 possible_function_pointer_reloc.
8146 (Scan::global_reloc_may_be_function_pointer): Ditto.
8147 * icf.h (Icf::check_section_for_function_pointers): Change to reject
8148 relocations in ".data.rel.ro._ZTV" section.
8149 * testsuite/icf_safe_so_test.sh: Change to pass i386.
8150 * testsuite/icf_safe_so_test.cc: Ditto.
8151 * testsuite/icf_safe_test.cc: Ditto.
8152 * testsuite/icf_safe_test.sh: Ditto.
8154 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8155 Ian Lance Taylor <iant@google.com>
8157 * target-reloc.h (relocate_section): Check the symbol table index
8158 for -1U before setting the local symbol index.
8159 (scan_relocatable_relocs): If copying the relocation, record that
8160 the local symbol is required.
8161 * object.h (Symbol_value::is_output_symtab_index_set): New
8163 (Symbol_value::may_be_discarded_from_output_symtab): New
8165 (Symbol_value::has_output_symtab_entry): New function.
8166 (Symbol_value::needs_output_symtab_entry): Remove.
8167 (Symbol_value::output_symtab_index): Make sure the symbol index is
8169 (Symbol_value::set_output_symtab_index): Make sure the symbol
8170 index is not set. Make sure the new index is valid.
8171 (Symbol_value::set_must_have_output_symtab_entry): New function.
8172 (Symbol_value::has_output_dynsym_entry): New function.
8173 (Symbol_value::set_output_dynsym_index): Make sure the new index
8175 (Sized_relobj::set_must_have_output_symtab_entry): New function.
8176 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
8177 local symbol if permitted.
8178 (Sized_relobj::do_finalize_local_symbols): Call
8179 is_output_symtab_index_set rather than needs_output_symtab_entry.
8180 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
8181 rather than needs_output_symtab_entry. Call
8182 has_output_dynsym_entry rather than needs_output_dynsym_entry.
8183 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
8184 is_output_symtab_index_set rather than needs_output_symtab_entry.
8185 * testsuite/discard_locals_relocatable_test.c: New file.
8186 * testsuite/discard_locals_test.sh: Test -r.
8187 * testsuite/Makefile.am (check_DATA): Add
8188 discard_locals_relocatable_test1.syms,
8189 discard_local_relocatable_test2.syms.
8190 (MOSTLYCLEANFILES): Likewise. Also add
8191 discard_locals_relocatable_test1.lout and
8192 discard_locals_relocatable_test2.out.
8193 (discard_locals_relocatable_test1.syms): New target.
8194 (discard_locals_relocatable_test.o): New target.
8195 (discard_locals_relocatable_test1.out): New target.
8196 (discard_locals_relocatable_test2.syms): New target.
8197 (discard_locals_relocatable_test2.out): New target.
8198 (various): Add missing ../ld-new dependencies.
8199 * testsuite/Makefile.in: Rebuild.
8201 2010-03-03 Nick Clifton <nickc@redhat.com>
8203 * po/fi.po: New Finnish translation.
8205 2010-03-01 Doug Kwan <dougkwan@google.com>
8207 * layout.cc (Layout::Layout): Force section types of .init_array*,
8208 .preinit_array* and .fini_array* sections.
8209 * output.cc (Output_section::Input_section_sort_entry::has_priority):
8210 Fix check of return value of std::string::find.().
8211 (Output_section::Input_section_sort_compare::operator()): Remove
8212 comment about .init_array.
8213 (Output_section::Input_section_sort_init_fini_compare::operator()):
8215 (Output_section::sort_attached_input_sections): Handle .init_array
8216 and .fini_array specially.
8217 * output.h (Output_section::Inut_section_sort_compare): Update
8219 (Output_section::Input_section_sort_init_fini_compare): New struct.
8221 2010-02-26 Doug Kwan <dougkwan@google.com>
8223 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
8224 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
8225 * testsuite/debug_msg.sh: Avoid matching source line number for
8226 use of global variable undef_int.
8228 2010-02-26 Doug Kwan <dougkwan@google.com>
8230 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
8231 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
8232 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
8233 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
8234 * options.cc (General_options::General_options): Initialize member
8236 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
8237 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
8238 and rm_no_fix_v4bx.stdout
8239 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
8240 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
8241 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
8242 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
8243 and arm_no_fix_v4bx.
8244 * Makefile.in: Regenerate.
8245 * testsuite/arm_fix_v4bx.s: New file.
8246 * testsuite/arm_fix_v4bx.sh: Ditto.
8248 2010-02-24 Doug Kwan <dougkwan@google.com>
8250 * arm.cc (Target_arm::got_section): Make the .got section the first
8251 non RELRO section in the data segment.
8252 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
8253 suffixes of section names.
8255 2010-02-24 Doug Kwan <dougkwan@google.com>
8257 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
8258 flags and attributes merging if an input file is a binary file.
8259 * fileread.cc (Input_file::open): Record format of original file.
8260 * fileread.h (Input_file::Format): New enum type.
8261 (Input_file::Input_file): Initialize data member format_.
8262 (Input_file::format): New method definition.
8263 (Input_file::format_):: New data member.
8265 2010-02-24 Doug Kwan <dougkwan@google.com>
8267 * arm.cc (Arm_output_data_got): New class.
8268 (ARM_TCB_SIZE): New constant
8269 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
8270 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
8271 If user uses a script with a SECTIONS clause, issue only a warning
8272 for a misplaced EXIDX input section. Otherwise, issue an error.
8273 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
8275 (Target_arm::got_mode_index_entry): Handle static linking.
8276 (Target_arm::Scan::local): Ditto.
8277 (Target_arm::Scan::global): Ditto.
8278 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
8279 all incorrectly implemented relocations.
8280 (Target_arm::fix_exidx_coverage): Pass layout to
8281 Arm_output_section::fix_exidx_coverage.
8282 * layout.cc (Layout::section_name_mapping): Remove trailing dots
8283 from ".ARM.exidx." and ".ARM.extab.".
8285 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8287 * arm.cc (Target_arm::do_finalize_sections): Create attribute
8288 section if it does not already exist.
8289 * attributes.cc (Attributes_section_data::Attributes_section_data):
8290 Don't crash if size is zero.
8292 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8293 Ian Lance Taylor <iant@google.com>
8295 * gold.cc (queue_middle_tasks): If no input files were opened,
8297 * workqueue.h (Task_function::Task_function): Assert that there is
8300 2010-02-22 Doug Kwan <dougkwan@google.com>
8302 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
8303 * icf.cc (get_section_contents): Cast snprintf arguments to long long
8304 types to avoid warnings due to different uint64_t implementations
8307 2010-02-21 Doug Kwan <dougkwan@google.com>
8309 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
8310 handling of the maximum backward branch offset.
8311 (Arm_relocate_functions::thumb_branch_common): Ditto.
8312 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
8313 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
8314 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
8315 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
8316 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
8317 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
8318 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
8319 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
8320 thumb_bl_out_of_range thumb_bl_out_of_range.o,
8321 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
8322 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
8323 thumb2_bl_out_of_range.o): New rules.
8324 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
8325 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
8326 thumb2_bl_out_of_range
8327 * testsuite/Makefile.in: Regenerate.
8328 * testsuite/arm_bl_in_range.s: New file.
8329 * testsuite/arm_bl_out_of_range.s: Ditto.
8330 * testsuite/arm_branch_in_range.sh: Ditto.
8331 * testsuite/arm_branch_range.t: Ditto.
8332 * testsuite/thumb2_branch_range.t: Ditto.
8333 * testsuite/thumb_bl_in_range.s: Ditto.
8334 * testsuite/thumb_bl_out_of_range.s: Ditto.
8335 * testsuite/thumb_branch_range.t: Ditto.
8337 2010-02-20 Sriraman Tallam <tmsriram@google.com>
8339 * gc.h (gc_process_relocs): Change vectors to point to the new list.
8340 Add reloc offset information.
8341 * icf.cc (get_section_contents): Change iterators to point to the new
8342 vectors. Add reloc offset information to the contents.
8343 * icf.h (Icf::Sections_reachable_info): New typedef.
8344 (Icf::Sections_reachable_list): New typedef.
8345 (Icf::Offset_info): New typedef.
8346 (Icf::Reloc_info): New struct typedef.
8347 (Icf::Reloc_info_list): New typedef.
8348 (Icf::symbol_reloc_list): Delete method.
8349 (Icf::addend_reloc_list): Delete method.
8350 (Icf::section_reloc_list): Delete method.
8351 (Icf::reloc_info_list): New method.
8352 (Icf::reloc_info_list_): New member.
8354 2010-02-19 Doug Kwan <dougkwan@google.com>
8356 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
8357 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
8358 * arm.cc (Arm_relocation_functions): New forward declaration.
8359 (Target_arm::Target_arm): Initialize new data members
8360 got_mod_index_offset_ and tls_base_symbol_defined_.
8361 (Target_arm::Relocate::relocate_tls): New method.
8362 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
8363 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
8365 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
8366 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
8367 (Target_arm::got_mod_index_offset_,
8368 Target_arm::tls_base_symbol_defined_): New data members.
8369 (Target_arm::Scan::local, Target::Scan::global,
8370 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
8373 2010-02-18 Doug Kwan <dougkwan@google.com>
8375 * arm.cc (Arm_relobj::find_linked_text_section): New method.
8376 (Arm_relobj::make_exidx_input_section): Pass section index of linked
8377 text section as a parameter becuase some broken tools may not set
8378 the link in section header.
8379 (Target_arm::has_got_section): New method.
8380 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
8381 without any mapping symbol as data only. Remove warning.
8382 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
8383 link in its section header, try to discover the link by inspecting the
8384 REL31 relocation at the beginning of the section.
8385 (Target_arm::Scan::check_non_pic): Report name of offending relocation
8387 (Target_arm::Scan::global): Treat any reference to the symbol
8388 _GLOBAL_OFFSET_TABLE_ as a GOT access.
8390 2010-02-12 Sriraman Tallam <tmsriram@google.com>
8392 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
8393 (Scan::global_reloc_may_be_function_pointer): New function.
8394 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8395 (Scan::global_reloc_may_be_function_pointer): New function.
8396 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8397 (Scan::global_reloc_may_be_function_pointer): New function.
8398 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
8399 (Scan::global_reloc_may_be_function_pointer): New function.
8400 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
8401 (Scan::global_reloc_may_be_function_pointer): New function.
8402 (Scan::possible_function_pointer_reloc): New function.
8403 (Target_x86_64::can_check_for_function_pointers): New function.
8404 * gc.h (gc_process_relocs): Scan relocation types to determine if
8405 function pointers were taken for targets that support it.
8406 * icf.cc (Icf::find_identical_sections): Include functions for
8407 folding in safe ICF whose pointer is not taken.
8408 * icf.h (Secn_fptr_taken_set): New typedef.
8409 (fptr_section_id_): New member.
8410 (section_has_function_pointers): New function.
8411 (set_section_has_function_pointers): New function.
8412 (check_section_for_function_pointers): New function.
8413 * options.h: Fix comment for safe ICF option.
8414 * target.h (can_check_for_function_pointers): New function.
8415 * testsuite/Makefile.am: Add icf_safe_so_test test case.
8416 Modify icf_safe_test for X86-64.
8417 * testsuite/Makefile.in: Regenerate.
8418 * testsuite/icf_safe_so_test.cc: New file.
8419 * testsuite/icf_safe_so_test.sh: New file.
8420 * testsuite/icf_safe_test.cc (kept_func_3): New function.
8421 (main): Change to take pointer to function kept_func_3.
8422 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
8423 folding is done correctly for X86-64.
8425 2010-02-12 David S. Miller <davem@davemloft.net>
8427 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
8428 is_symbolless parameter.
8429 (Output_reloc<SHT_REL>::is_symbolless): New.
8430 (Output_reloc<SHT_REL>::is_symbolless_): New.
8431 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
8432 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
8433 (Output_reloc<SHT_RELA>::is_symbolless): New.
8434 (Output_data_reloc::add_global): Handle is_symbolless.
8435 (Output_data_reloc::add_global_relative): Likewise.
8436 (Output_data_reloc::add_local): Likewise.
8437 (Output_data_reloc::add_local_relative): Likewise.
8438 (Output_data_reloc::add_symbolless_global_addend): New.
8439 (Output_data_reloc::add_symbolless_local_addend): New.
8440 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
8442 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
8443 instead of ->is_relative_
8444 (Output_reloc::write): Likewise.
8445 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
8446 (Output_reloc::write_rel): Simplify.
8448 * sparc.cc (Target_sparc::Scan::local): Use
8449 ->add_symbolless_local_addend as needed.
8450 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
8451 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
8452 based upon relocation offset.
8454 2010-02-11 Doug Kwan <dougkwan@google.com>
8456 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
8457 (Target_arm::Scan::global): Ditto. Also remove a comment before the
8458 beginning of function.
8459 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
8460 and MOVT_ABS relocations. Those are non issued in scanning. Fix
8461 parameter is_32bit in calls to should_apply_static_reloc.
8462 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
8463 (check_DATA): Add arm_abs_global.stdout.
8464 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
8465 arm_abs_global.stdout): New rules.
8466 (MOSTLLYCLEANFILES): Add arm_abs_global
8467 * Makefile.in: Regenerate.
8468 * testsuite/arm_abs_global.s: New file.
8469 * testsuite/arm_abs_global.sh: Ditto.
8470 * testsuite/arm_abs_lib.s: Ditto.
8472 2010-02-11 Ian Lance Taylor <iant@google.com>
8474 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
8476 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
8477 Allocate_commons_task first.
8478 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
8479 task, rather than symtab_lock_.
8480 (Gc_process_relocs::~Gc_process_relocs): New function.
8481 (Gc_process_relocs::is_runnable): Check this_blocker_.
8482 (Gc_process_relocs::locks): Use next_blocker_ rather than
8484 (Scan_relocs::~Scan_relocs): New function.
8485 (Scan_relocs::is_runnable): Check this_blocker_ rather than
8487 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
8489 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
8490 fields. Add this_blocker_ and next_blocker_ fields. Adjust
8491 constructor accordingly.
8492 (class Gc_process_relocs): Likewise.
8493 (class Scan_relocs): Likewise.
8494 * common.h (class Allocate_commons_task): Remove symtab_lock_
8495 field, and corresponding constructor parameter.
8496 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
8498 (Allocate_commons_task::locks): Likewise.
8500 2010-02-11 Ian Lance Taylor <iant@google.com>
8502 * gold-threads.h (class Once): Define.
8503 (class Initialize_lock): Rewrite as child of Once.
8504 * gold-threads.cc (class Once_initialize): Define.
8505 (once_pointer_control): New static variable.
8506 (once_pointer, once_arg): New static variables.
8507 (c_run_once): New static function.
8508 (Once::Once, Once::run_once, Once::internal_run): New functions.
8509 (class Initialize_lock_once): Remove.
8510 (initialize_lock_control): Remove.
8511 (initialize_lock_pointer): Remove.
8512 (initialize_lock_once): Remove.
8513 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
8514 (Initialize_lock::initialize): Rewrite.
8515 (Initialize_lock::do_run_once): New function.
8516 * archive.cc (Archive::interpret_header): Only clear name if it is
8518 * fileread.cc: Include "gold-threads.h"
8519 (file_counts_lock): New static variable.
8520 (file_counts_initialize_lock): Likewise.
8521 (File_read::release): Only increment counts when using --stats.
8522 Use a lock around the increment.
8523 * parameters.cc (class Set_parameters_target_once): Define.
8524 (set_parameters_target_once): New static variable.
8525 (Parameters::Parameters): Move here from parameters.h.
8526 (Parameters::set_target): Rewrite.
8527 (Parameters::set_target_once): New function.
8528 (Parameters::clear_target): Move here and rewrite.
8529 * parameters.h (class Parameters): Update declarations. Add
8530 set_parameters_target_once_ field.
8531 (Parameters::Parameters): Move to parameters.cc.
8532 (Parameters::clear_target): Likewise.
8533 * readsyms.cc (Read_symbols::do_group): Create a Start_group
8535 (Start_group::~Start_group): New function.
8536 (Start_group::is_runnable): New function.
8537 (Start_group::locks, Start_group::run): New functions.
8538 (Finish_group::run): Change saw_undefined to size_t.
8539 * readsyms.h (class Start_group): Define.
8540 (class Finish_group): Change saw_undefined_ field to size_t.
8541 (Finish_group::Finish_group): Remove saw_undefined and
8542 this_blocker parameters. Change all callers.
8543 (Finish_group::set_saw_undefined): New function.
8544 (Finish_group::set_blocker): New function.
8545 * symtab.h (class Symbol_table): Change saw_undefined to return
8546 size_t. Change saw_undefined_ field to size_t.
8547 * target-select.cc (Set_target_once::do_run_once): New function.
8548 (Target_selector::Target_selector): Initialize set_target_once_
8549 field. Don't initialize lock_ and initialize_lock_ fields.
8550 (Target_selector::instantiate_target): Rewrite.
8551 (Target_selector::set_target): New function.
8552 * target-select.h (class Set_target_once): Define.
8553 (class Target_selector): Update declarations. Make
8554 Set_target_once a friend. Remove lock_ and initialize_lock_
8555 fields. Add set_target_once_ field.
8557 2010-02-10 Ian Lance Taylor <iant@google.com>
8559 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
8561 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
8562 (queue_middle_tasks): Add all blockers before queueing any tasks.
8563 (queue_final_tasks): Likewise.
8564 * token.h (Task_token::add_blockers): New function.
8565 * object.h (Input_objects::number_of_relobjs): New function.
8567 2010-02-10 Ian Lance Taylor <iant@google.com>
8569 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
8570 shared, not if not position independent.
8571 * x86_64.cc (Relocate::relocate_tls): Likewise.
8572 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
8573 (tls_pie_pic_test): New target.
8574 * testsuite/Makefile.in: Rebuild.
8576 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
8577 (tls_test_main_pie.o, tls_test_pie.o): New targets.
8578 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
8579 * testsuite/Makefile.in: Rebuild.
8581 2010-02-09 David S. Miller <davem@davemloft.net>
8583 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
8584 R_SPARC_RELATIVE using ->add_local_relative().
8585 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
8587 * output.h (Output_data_dynamic::add_section_size): New method
8588 that takes two Output_data objects.
8589 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
8590 entry param. Handle it in initializers.
8591 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
8592 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
8593 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
8595 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
8596 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
8597 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
8598 for dynrel_includes_plt.
8599 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8600 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8601 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
8603 (Target_sparc::do_finalize_sections): Update to pass true for
8604 dynrel_includes_plt.
8605 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
8606 output before .rela.plt
8607 (Target_powerpc::do_finalize_sections): Update to pass true for
8608 dynrel_includes_plt when 32-bit.
8610 2010-02-08 Doug Kwan <dougkwan@google.com>
8612 * arm.cc (Arm_relobj::simple_input_section_output_address): New
8614 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
8615 Arm_relobj::scan_section_for_cortex_a8_stubs,
8616 Arm_relobj::do_relocation_section): Instead of calling
8617 Output_section::output_address, use faster
8618 Arm_relobj::simple_input_section_output_address.
8620 2010-02-08 David S. Miller <davem@davemloft.net>
8622 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
8623 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
8624 relocation helper function.
8626 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
8627 just like R_SPARC_GOT{10,13,22}.
8628 (Target_sparc::Scan::local): Likewise.
8629 (Target_sparc::Relocate:relocate): Likewise.
8631 2010-02-06 Ian Lance Taylor <iant@google.com>
8633 * configure.ac: Rewrite targetobjs duplicate removal code to use
8634 only shell constructs.
8635 * configure: Rebuild.
8637 2010-02-05 Doug Kwan <dougkwan@google.com>
8640 * arm.cc (Arm_relobj::section_is_scannable): New method.
8641 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
8642 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
8644 2010-02-04 Doug Kwan <dougkwan@google.com>
8647 * arm-reloc-property.cc (cstdio): Include.
8648 * configure.ac (targetobjs): Remove duplicates.
8649 * configure: Regenerate.
8650 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
8651 big and little endian version for a given address size.
8653 2010-02-03 Doug Kwan <dougkwan@google.com>
8655 * arm-reloc-property.cc
8656 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8658 * arm-reloc-property.h
8659 (Arm_reloc_property_table::get_implemented_static_reloc_property):
8660 New method definition.
8661 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8663 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
8665 (GOT_PREL): Change implemented to Y.
8666 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
8667 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
8668 (Arm_relocate_functions::movw_abs_nc): Remove method.
8669 (Arm_relocate_functions::movt_abs): Ditto.
8670 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
8671 (Arm_relocate_functions::thm_movt_abs): Ditto.
8672 (Arm_relocate_functions::movw_rel_nc): Ditto.
8673 (Arm_relocate_functions::movw_rel): Ditto.
8674 (Arm_relocate_functions::movt_rel): Ditto.
8675 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
8676 (Arm_relocate_functions:thm_movw_rel): Ditto.
8677 (Arm_relocate_functions:thm_movt_rel): Ditto.
8678 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
8679 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
8680 New method definitions.
8681 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
8682 (Arm_relocation_functions::arm_grp_ldr): Ditto.
8683 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
8684 (Arm_relocation_functions::arm_grp_ldc): Ditto.
8685 (Target_arm::Relocate::relocate): Check for non-static or
8686 unimplemented relocation code and exit early. Change calls to
8687 Target_arm::reloc_uses_thumb_bit and
8688 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
8689 instead. Refactor code to handle similar relocations to increase
8690 code sharing. Remove check for unsupported relocation code in switch
8692 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
8693 relocation property table to find out size. Change error message to
8694 print out the name of a relocation code instead of the numeric value.
8695 (Target_arm::scan_reloc_for_stub): Use relocation property table
8696 instead of calling Target_arm::reloc_uses_thumb_bit().
8698 2010-02-02 Doug Kwan <dougkwan@google.com>
8700 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
8701 types of relaxed input section.
8703 2010-02-02 Doug Kwan <dougkwan@google.com>
8705 * Makefile.am (HFILES): Add arm-reloc-property.h.
8707 (TARGETSOURCES): Add arm-reloc-property.cc
8708 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
8709 (libgold_a_SOURCES): $(DEFFILES)
8710 * Makefile.in: Regenerate.
8711 * arm-reloc-property.cc: New file.
8712 * arm-reloc-property.h: New file.
8713 * arm-reloc.def: New file.
8714 * arm.cc: Update comments.
8715 (arm-reloc-property.h): New included header.
8716 (arm_reloc_property_table): New global variable.
8717 (Target_arm::do_select_as_default_target): New method definition.
8718 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
8719 arm-reloc-property to targ_extra_obj.
8720 * parameters.cc (set_parameters_target): Call
8721 Target::select_as_default_target().
8722 * target.h (Target::select_as_default_target): New method definition.
8723 (Target::do_select_as_default_target): Same.
8725 2010-02-01 Doug Kwan <dougkwan@google.com>
8727 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
8728 first_output_text_section_.
8729 (Arm_exidx_fixup::first_output_text_section): New method definition.
8730 (Arm_exidx_fixup::first_output_text_section_): New data member.
8731 (Arm_exidx_fixup::process_exidx_section): Record the first text
8732 output section seen.
8733 (Arm_output_section::fix_exidx_coverage): Set correct linked section
8734 and entsize in output section header.
8736 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8738 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
8739 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
8740 (Arm_relocate_functions::thm_alu11): New Method.
8741 (Arm_relocate_functions::thm_pc8): New Method.
8742 (Arm_relocate_functions::thm_pc12): New Method.
8743 (Target_arm::Scan::local): Handle the relocations.
8744 (Target_arm::Scan::global): Likewise.
8745 (Target_arm::Relocate::relocate): Likewise.
8746 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8748 2010-01-29 Doug Kwan <dougkwan@google.com>
8750 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
8751 of relocation types as ld.
8753 2010-01-29 Doug Kwan <dougkwan@google.com>
8755 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
8757 (Arm_relocate_functions::thumb_branch_common): Ditto.
8758 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
8759 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
8760 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
8761 Arm_relocate_functions::jump24): Remove.
8762 (Target_arm::Relocate::relocate): Adjust code to call
8763 Arm_relocation_functions::arm_branch_common and
8764 Arm_relocation_functions::thumb_branch_common instead of their removed
8765 wrappers. Merge switch-cases together to reduce source code size.
8767 2010-01-29 Doug Kwan <dougkwan@google.com>
8769 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
8770 output_local_symbol_count_needs_update_.
8771 (Arm_relobj::output_local_symbol_count_needs_update,
8772 Arm_relobj::set_output_local_symbol_count_needs_update,
8773 Arm_relobj::update_output_local_symbol_count): New methods.
8774 (Arm_relobj::output_local_symbol_count_needs_update_): New data
8776 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
8777 of pointed function as in a R_ARM_PREL31 relocation.
8778 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
8779 for output local symbol count updating.
8780 (Target_arm::do_relax): Update output local symbol counts in objects
8782 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
8784 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8786 * arm.cc: Added support for the ARM relocations:
8787 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
8788 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
8789 (Arm_relocate_functions::movw_rel_nc): Renamed (was
8791 (Arm_relocate_functions::movw_rel): New method.
8792 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
8793 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
8795 (Arm_relocate_functions::thm_movw_rel): New method.
8796 (Arm_relocate_functions::thm_movt_rel): Renamed (was
8798 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
8800 (Target_arm::Scan::global): Likewise.
8801 (Target_arm::Relocate::relocate): Likewise.
8802 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8805 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8807 * arm.cc: Added support for ARM group relocations.
8808 (Target_arm::reloc_needs_sym_origin): New method.
8809 (Arm_relocate_functions::calc_grp_kn): New method.
8810 (Arm_relocate_functions::calc_grp_residual): New method.
8811 (Arm_relocate_functions::calc_grp_gn): New method.
8812 (Arm_relocate_functions::arm_grp_alu): New Method.
8813 (Arm_relocate_functions::arm_grp_ldr): New Method.
8814 (Arm_relocate_functions::arm_grp_ldrs): New Method.
8815 (Arm_relocate_functions::arm_grp_ldc): New Method.
8816 (Target_arm::Scan::local): Handle the ARM group relocations.
8817 (Target_arm::Scan::global): Likewise.
8818 (Target_arm::Relocate::relocate): Likewise.
8819 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8822 2010-01-26 Doug Kwan <dougkwan@google.com>
8824 * arm.cc (set): Include.
8825 (class Arm_exidx_fixup): Change type of last_input_section_ to const
8827 (Arm_output_section::Text_section_list): New type.
8828 (Arm_output_section::append_text_sections_to_list): New method.
8829 (Arm_output_section::fix_exidx_coverage): Ditto.
8830 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
8831 (Arm_relobj::convert_input_section_to_relaxed_section): Use
8832 Relobj::set_section_offset() instead of
8833 Sized_relobj::invalidate_section_offset().
8834 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
8835 parameter for section headers. Ignore relocation sections for
8836 unallocated sections and EXIDX sections.
8837 (Target_arm::fix_exidx_coverage): New method.
8838 (Target_arm::output_section_address_less_than): New type.
8839 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
8840 linked text section instead of the EXIDX section.
8841 (Arm_output_section::create_stub_group): Add an assertion to check
8842 that this is not an EXIDX output section.
8843 (Arm_output_section::append_text_sections_to_list): New method.
8844 (Arm_output_section::fix_exidx_coverage): Ditto.
8845 (Arm_relobj::scan_sections_for_stubs): Adjust call to
8846 Arm_relobj::section_needs_reloc_stub_scanning.
8847 (Target_arm::do_relax): Fix EXIDX output section coverage in the
8849 (Target_arm::fix_exidx_coverage): New method.
8850 * object.h (Relobj::set_output_section): New method.
8851 (Sized_relobj::invalidate_section_offset): Remove method.
8852 (Sized_relobj::do_invalidate_section_offset): Remove method.
8853 (Sized_relobj::do_set_section_offset): Handle offset value -1.
8855 2010-01-25 Doug Kwan <dougkwan@google.com>
8857 * arm.cc (Arm_exidx_merged_section::do_output_offset):
8858 Fix warning due to signed and unsigned comparison on a 32-bit host.
8860 2010-01-22 Doug Kwan <dougkwan@google.com>
8862 * arm.cc (Target_arm::do_relax): Record an output section for section
8863 offset adjustment it contains any stub table that has changed.
8864 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
8865 offsets in an output section if necessary.
8866 * output.cc (Output_section::Output_section): Initialize
8867 section_offsets_need_adjustments_.
8868 (Output_section::add_input_section_for_script): Renamed to
8869 Output_section::add_simple_input_section.
8870 (Output_section::save_states): Add a comment.
8871 (Output_section::discard_states): New method defintion.
8872 (Output_section::adjust_section_offsets): Same.
8873 * output.h (Output_section::add_input_section_for_script): Renamed to
8874 Output_section::add_simple_input_section.
8875 (Output_section::discard_states): New method declaration.
8876 (Output_section::adjust_section_offsets): Same.
8877 (Output_section::section_offsets_need_adjustment,
8878 Output_section::set_section_offsets_need_adjustment): New method
8880 (Output_section::section_offsets_need_adjustment_): New data member.
8881 * script-sections.cc
8882 (Output_section_element_input::set_section_address): Adjust code for
8883 renaming of Output_section::add_input_section_for_script.
8884 (Orphan_output_section::set_section_address): Same.
8886 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8888 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
8889 Fix_v4bx enum values .
8890 * gold/options.h (General_options): New option definitions.
8891 (General_options::fix_v4bx): New method.
8892 (General_options::Fix_v4bx): New enum.
8893 * gold/options.cc (General_options::parse_fix_v4bx): New method.
8894 (General_options::parse_fix_v4bx_interworking): New method.
8896 2010-01-22 Doug Kwan <dougkwan@google.com>
8898 * arm.cc (Arm_exidx_fixup): New class.
8900 2010-01-21 Doug Kwan <dougkwan@google.com>
8902 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
8904 (Arm_exidx_section_offset_map): New type.
8906 2010-01-21 Doug Kwan <dougkwan@google.com>
8908 * arm.cc (Arm_exidx_input_section): New class.
8909 (Arm_relobj::exidx_input_section_by_link,
8910 Arm_relobj::exidx_input_section_by_shndx,
8911 Arm_relobj::make_exidx_input_section): New methods.
8912 (read_arm_attributes_section): Remove.
8913 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
8914 information about them.
8915 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
8918 2010-01-20 Doug Kwan <dougkwan@google.com>
8920 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
8921 Input_section_specifier to Section_id.
8922 (Target_arm::new_arm_input_section: Adjust code for change of key
8924 (Target_arm::find_arm_input_section): Ditto.
8925 * gc.h (object.h): Include for Section_id nand Section_id_hash.
8926 (Section_id): Remove.
8927 (Garbage_collection::Section_id_hash): Remove.
8928 * icf.h (object.h): Include for Section_id nand Section_id_hash.
8929 (Section_id): Remove.
8930 (Icf::Section_id_hash): Remove.
8931 * object.h (Section_id, Const_section_id, Section_id_hash,
8932 Const_section_id_hash): New type definitions.
8933 * output.cc (Output_section::add_relaxed_input_section): Change to
8934 use Const_section_id instead of Input_section_specifier as key type.
8935 (Output_section::add_merge_input_section): Ditto.
8936 (Output_section::build_relaxation_map): Change to use Section_id
8937 instead of Input_section_specifier as key type.
8938 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8940 (Output_section::convert_input_sections_to_relaxed_sections): Change
8941 to use Const_section_id instead of Input_section_specifier as key type.
8942 (Output_section::find_merge_section): Ditto.
8943 (Output_section::find_relaxed_input_section): Ditto.
8944 * output.h (Input_section_specifier): Remove class.
8945 (Output_section::Output_section_data_by_input_section_map): Change
8946 key type to Const_section_id.
8947 (Output_section::Output_relaxed_input_section_by_input_section_map):
8949 (Output_section::Relaxation_map): Change key type to Section_id.
8951 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8953 * gold/arm.cc: Added support for R_ARM_V4BX relocation
8954 (class Arm_v4bx_stub): New class.
8955 (DEF_STUBS): Updated definition to support v4_veneer_bx.
8956 (Stub_factory::make_arm_v4bx_stub): New method.
8957 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
8958 (Stub_table::empty): Handle v4bx stubs.
8959 (Stub_table::add_arm_v4bx_stub): New method.
8960 (Stub_table::find_arm_v4bx_stub): New method.
8961 (Arm_relocate_functions::v4bx): New method.
8962 (Target_arm::fix_v4bx): New method.
8963 (Target_arm::Target_arm): Handle R_ARM_V4BX.
8964 (Stub_table::relocate_stubs): Likewise.
8965 (Stub_table::do_write): Likewise.
8966 (Stub_table::update_data_size_and_addralign): Likewise.
8967 (Stub_table::finalize_stubs): Likewise.
8968 (Target_arm::Scan::local): Likewise.
8969 (Target_arm::Scan::global): Likewise.
8970 (Target_arm::do_finalize_sections): Likewise.
8971 (Target_arm::Relocate::relocate): Likewise.
8972 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8974 (Target_arm::scan_reloc_for_stub): Likewise.
8975 (Target_arm::scan_reloc_section_for_stubs): Likewise.
8977 2010-01-19 Ian Lance Taylor <iant@google.com>
8979 * output.cc (Output_section_headers::do_sized_write): Write large
8980 segment count to sh_info field.
8981 (Output_file_header::do_sized_write): For large segment count,
8982 write PN_XNUM to e_phnum field.
8984 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8986 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
8987 (Arm_relocate_functions::thm_jump8): New function.
8988 (Arm_relocate_functions::thm_jump11): New function.
8989 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
8991 (Target_arm::Scan::global): Likewise.
8992 (Target_arm::Relocate::relocate): Likewise.
8993 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8996 2010-01-14 Doug Kwan <dougkwan@google.com>
8998 * arm.cc (map, utility): Include headers.
8999 (Target_arm::apply_cortex_a8_workaround): New method.
9000 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9001 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9002 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9003 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9004 the --[no-]fix-cortex-a8 command line options.
9005 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9006 (Target_arm::relocate_stub): Use addend in instruction template.
9007 * options.h (DEFINE_bool): Set the user-set flag.
9008 (General_options): Add --[no-]-fix-cortex options.
9009 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
9010 : Update fast look-up map after conversion.
9012 2010-01-14 Sriraman Tallam <tmsriram@google.com>
9014 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9015 in the first pass of do_layout.
9017 2010-01-13 Doug Kwan <dougkwan@google.com>
9019 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9020 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9021 apparent compiler problem of not folding static constant integral
9022 data members of elfcpp::Elf_sizes<32>.
9024 2010-01-13 Doug Kwan <dougkwan@google.com>
9026 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9027 Arm_relobj::section_needs_cortex_a8_stub_scanning,
9028 Arm_relobj::scan_section_for_cortex_a8_erratum,
9029 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
9030 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
9031 sections to scan for relocation stubs into a new method
9032 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
9033 relocation and Cortex-A8 stub scanning.
9034 (Target_arm::do_relax): Force stubs to be after stubbed sections
9035 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
9036 the beginning of a new relaxation pass. Update a comment.
9037 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
9039 2010-01-12 Ian Lance Taylor <iant@google.com>
9041 * target-reloc.h (visibility_error): New inline function.
9042 (relocate_section): Call visibility_error.
9043 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
9044 (MOSTLYCLEANFILES): Likewise.
9045 (protected_4_pic.o, protected_3.err): New targets.
9046 * testsuite/protected_4.cc: New file.
9048 2010-01-12 Doug Kwan <dougkwan@google.com>
9050 * arm.cc (Cortex_a8_reloc): New class.
9051 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
9052 and cortex_a8_relocs_info_.
9053 (Target_arm::fix_cortex_a8): New method definition.
9054 (Target_arm::Cortex_a8_relocs_info): New type.
9055 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
9056 New data member declarations.
9057 (Target_arm::scan_reloc_for_stub): Record information about
9058 relocations for THUMB branches that might be exempted from the
9059 Cortex-A8 workaround.
9060 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
9061 at the beginning of a relaxation pass.
9063 2010-01-12 Doug Kwan <dougkwan@google.com>
9065 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
9066 (Arm_relobj::Mapping_symbol_position,
9067 Arm_reloj::Mapping_symbol_position_less,
9068 Arm_relobj::Mapping_symbols_info): New types.
9069 (Target_arm::is_mapping_symbol_name): New method definition.
9070 (Arm_relobj::do_count_local_symbols): Save information about mapping
9073 2010-01-11 Doug Kwan <dougkwan@google.com>
9075 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
9076 Arm_relocate_functions::thumb32_branch_upper,
9077 Arm_relocate_functions::thumb32_branch_lower,
9078 Arm_relocate_functions::thumb32_cond_branch_offset,
9079 Arm_relocate_functions::thumb32_cond_branch_upper,
9080 Arm_relocate_functions::thumb32_cond_branch_lower,
9081 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
9082 branch offset encoding.
9083 (Arm_relocate_functions::thumb_branch_common): Use new branch
9084 offset encoding methods to avoid code duplication.
9085 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
9086 (Stub_addend_reader::operator()): Use new branch encoding method
9087 to avoid code duplication.
9089 2010-01-11 Doug Kwan <dougkwan@google.com>
9091 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
9092 (Target_arm::do_finalize_sections): Define special EXIDX section
9093 symbols only if referenced.
9094 * gc.h (Garbage_collection::add_reference): New method.
9095 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
9098 2010-01-11 Ian Lance Taylor <iant@google.com>
9100 * script.cc (Version_script_info::build_expression_list_lookup):
9101 Change complaing about duplicate wildcard match from error to
9104 * script.cc (class Lazy_demangler): Recreate--revert part of patch
9106 (Version_script_info::Version_script_info): Initialize globs_,
9107 default_version_, default_is_global_, and exact_. Don't
9108 initialize globals_ or locals_.
9109 (Version_script_info::build_lookup_tables): Build local symbols
9111 (Version_script_info::unquote): New function.
9112 (Version_script_info::add_exact_match): New function.
9113 (Version_script_info::build_expression_list_lookup): Remove lookup
9114 parameter. Add is_global parameter. Change all callers. Handle
9115 wildcard pattern specially. Unquote pattern. Call
9117 (Version_script_info::get_name_to_match): New function.
9118 (Version_script_info::get_symbol_version): New function.
9119 (Version_script_info::get_symbol_version_helper): Remove.
9120 (Version_script_info::check_unmatched_names): Call unquote.
9121 * script.h (class Version_script_info): Change get_symbol_version
9122 to be non-inline and add is_global parameter; change all callers.
9123 Rewrite symbol_is_local. Update declarations. Define struct
9124 Version_tree_match, Exact, Globs. Don't define struct Lookup.
9125 Remove globals_ and locals_ members. Add exact_, globs_,
9126 default_version_, is_global_.
9127 (Version_script_info::Glob): Remove pattern, add expression and
9128 is_global. Update constructor. Change all callers.
9129 * dynobj.cc (Versions::finalize): Mark the version symbol as the
9131 (Versions::symbol_section_contents): If a symbol is undefined, or
9132 defined in a dynamic object, set the version index to
9134 * symtab.cc (Symbol_table::add_from_relobj): Don't call
9136 (Symbol_table::add_from_pluginobj): Likewise.
9137 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
9139 2010-01-11 Doug Kwan <dougkwan@google.com>
9141 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
9142 (incremental_dump_LDADD): Add linking option for libintl.
9143 * Makefile.in: Regenerate.
9145 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
9148 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
9150 * testsuite/Makefile.in: Regenerated.
9152 2010-01-10 Doug Kwan <dougkwan@google.com>
9154 * options.h (DEFINE_var): Use parentheses around argument varname__
9155 in macro body to avoid any unintended subsequent substitutions.
9157 2010-01-10 Ian Lance Taylor <iant@google.com>
9159 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
9160 candidates before doing symbol resolution.
9162 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
9163 ODR candidates if only one is weak.
9165 2010-01-08 Ian Lance Taylor <iant@google.com>
9167 * script.cc (Version_script_info::build_expression_list_lookup):
9168 Don't warn about ambiguous version, just record the ambiguity.
9169 (Version_script_info::get_symbol_version_helper): Give error if
9170 version is ambiguous.
9172 2010-01-08 Doug Kwan <dougkwan@google.com>
9174 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
9175 prev_data_size_ and prev_addralign_. Remove initializer for
9176 deleted data member has_been_changed_.
9177 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
9178 to determine if the table is empty.
9179 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
9181 (Stub_table::add_reloc_stub): Define method in class definition
9182 instead of just declaring it there.
9183 (Stub_table::add_cortex_a8_stub): New method definition.
9184 (Stub_table::update_data_size_and_addralign): Ditto.
9185 (Stub_table::finalize_stubs): Ditto.
9186 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
9187 (Stub_table::do_addralign_): Return address alignment in the
9188 (Stub_table::do_reset_address_and_file_offset): Define method in
9189 class definition instead of declaring it there. Set current data
9190 size to be the data size of the previous pass.
9191 (Stub_table::set_final_data_size): Use current data size as the
9193 (Stub_table::relocate_stub): Change parameter type of stub from
9194 Reloc_stub pointer to Stub pointer.
9195 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
9196 (Stub_table::Cortex_a8_stub_list): New typedef.
9197 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
9198 Stub_table::prev_addralign_): New data member.
9199 (Arm_relobj::Arm_relobj): Initialize data member
9200 section_has_cortex_a8_workaround_.
9201 (Arm_relobj::section_has_cortex_a8_workaround,
9202 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
9204 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
9206 (Target_arm::relocate_stub): Change parameter type of stub from
9207 Reloc_stub pointer to Stub pointer.
9208 (Insn_template::size, Insn_template::alignment): Handle
9209 THUMB16_SPECIAL_TYPE.
9210 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
9211 Stub_table::update_data_size_and_addralign,
9212 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
9214 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
9215 (Stub_table::do_write): Ditto.
9216 (Target_arm::do_relax): Adjust code for changes in Stub_table.
9218 2010-01-08 Ian Lance Taylor <iant@google.com>
9221 * symtab.h (class Symbol): Remove fields is_target_special_ and
9222 has_plt_offset_. Add field is_defined_in_discarded_section_.
9223 (Symbol::is_defined_in_discarded_section): New function.
9224 (Symbol::set_is_defined_in_discarded_section): New function.
9225 (Symbol::has_plt_offset): Rewrite.
9226 (Symbol::set_plt_offset): Verify that new offset is not -1U.
9227 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
9228 Don't initialize is_target_special_ or has_plt_offset_.
9229 Initialize is_defined_in_discarded_section_.
9230 (Symbol_table::add_from_relobj): If appropriate, set
9231 is_defined_in_discarded_section.
9232 * resolve.cc (Symbol::override_base_with_special): Don't test
9233 is_target_special_. Change has_plt_offset_ to has_plt_offset().
9234 * target-reloc.h (relocate_section): Do special handling for
9235 symbols defined in discarded sections for global symbols as well
9238 2010-01-08 Ian Lance Taylor <iant@google.com>
9240 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
9241 the SHT_SYMTAB case.
9243 2010-01-08 Ian Lance Taylor <iant@google.com>
9245 * object.cc (Sized_relobj::do_layout): Don't get confused if
9246 layout_eh_frame returns NULL.
9248 2010-01-08 Ian Lance Taylor <iant@google.com>
9251 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
9252 dynamic symbol table, use the normal symbol table.
9253 (Sized_dynobj::do_read_symbols): Remove assertion about type of
9256 2010-01-08 Ian Lance Taylor <iant@google.com>
9259 * layout.cc (Layout::include_section): Remove .gnu_debuglink
9262 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
9264 * version.cc (print_version): Change to "Copyright 2010".
9266 2010-01-08 Ian Lance Taylor <iant@google.com>
9270 * i386.cc (class Target_i386): Change return type of plt_section
9272 (class Output_data_plt_i386): Add tls_desc_rel_ field.
9273 (Output_data_plt_i386::Output_data_plt_i386): Initialize
9274 tls_desc_rel_ field.
9275 (Output_data_plt_i386::rel_tls_desc): New function.
9276 (Target_i386::rel_tls_desc_section): New function.
9277 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
9278 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
9279 R_386_TLS_DESC reloc in rel_tls_desc_section.
9280 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
9281 Define struct Tlsdesc_info.
9282 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
9283 (Target_x86_64::do_reloc_symbol_index): New function.
9284 (Target_x86_64::add_tlsdesc_info): New function.
9285 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
9286 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
9288 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
9290 (Output_data_plt_x86_64::rela_tlsdesc): New function.
9291 (Target_x86_64::rela_tlsdesc_section): New function.
9292 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
9294 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
9295 (Target_x86_64::do_reloc_addend): New function.
9296 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
9297 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
9298 declarations. Define TARGET_CODE. Add arg field to u1_ union.
9299 (Output_reloc::type): New function.
9300 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
9301 (Output_reloc::is_target_specific): New function.
9302 (Output_reloc::target_arg): New function.
9303 (class Output_reloc) [SHT_RELA]: Add four new constructors for
9304 absolute relocs and target specific relocs.
9305 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
9306 add_target_specific.
9307 (class Output_data_reloc) [SHT_RELA]: Likewise.
9308 * output.cc (Output_reloc::Output_reloc): Add four new versions
9309 for absolute relocs and target specific relocs.
9310 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
9311 (Output_reloc::get_symbol_index): Likewise.
9312 (Output_reloc::local_section_offset): Check that local_sym_index_
9313 is not TARGET_CODE or 0.
9314 (Output_reloc::symbol_value): Likewise.
9315 (Output_reloc::write) [SHT_RELA]: Call target for target specific
9317 * target.h (class Target): Add reloc_symbol_index and reloc_addend
9318 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
9320 * layout.cc (add_target_dynamic_tags): Use output section for
9321 DT_PLTRELSZ and DT_JMPREL.
9323 2010-01-07 Ian Lance Taylor <iant@google.com>
9326 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
9328 (class Output_data_reloc_generic): Define.
9329 (class Output_data_reloc_base): Change base class to
9330 Output_data_reloc_generic. Change add() method to call
9331 bump_relative_reloc_count for a relative reloc. Remove
9333 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
9335 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
9336 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
9338 * layout.h (class Layout): Update declaration.
9340 2010-01-07 Ian Lance Taylor <iant@google.com>
9342 * output.h (class Output_data): Add const version of
9343 output_section and do_output_section.
9344 (class Output_section_data): Add const version of
9346 (class Output_section): Likewise.
9347 * layout.cc (Layout::add_target_dynamic_tags): New function.
9348 * layout.h (class Layout): Update declarations.
9349 * arm.cc (Target_arm::do_finalize_sections): Use
9350 add_target_dynamic_tags.
9351 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9352 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9353 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9354 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9356 2010-01-07 Ian Lance Taylor <iant@google.com>
9359 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
9362 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
9363 Ian Lance Taylor <iant@google.com>
9366 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
9367 Xindex::read_symtab_xindex.
9369 2010-01-07 Doug Kwan <dougkwan@google.com>
9371 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
9372 (Insn_template::thumb16_bcond_insn): New method declaration.
9373 (Insn_template): Fix spelling.
9374 (Stub::thumb16_special): New method declaration.
9375 (Stub::do_write): Define virtual method which was previously pure
9377 (Stub::do_thumb16_special): New method declaration.
9378 (Stub::do_fixed_endian_write): New template member.
9379 (Reloc_stub::do_write): Remove.
9380 (Reloc_stub::do_fixed_endian_write): Remove.
9381 (Cortex_a8_stub): New class definition.
9382 (Stub_factory::make_cortex_a8_stub): New method definition.
9383 (Stub_factory::Stub_factory): Add missing static storage class
9384 qualifier for elf32_arm_stub_a8_veneer_blx.
9386 2010-01-07 Ian Lance Taylor <iant@google.com>
9389 * options.h (class General_options): Add --warn-unresolved-symbols
9390 and --error-unresolved-symbols.
9391 * errors.cc (Errors::undefined_symbol): Implement
9392 --warn-unresolved-symbols.
9394 * options.h (class General_options): Add -z text and -z textoff.
9395 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
9397 2010-01-06 Sriraman Tallam <tmsriram@google.com>
9399 * gc.h (Garbage_collection::Cident_section_map): New typedef.
9400 (Garbage_collection::cident_sections): New function.
9401 (Garbage_collection::add_cident_section): New function.
9402 (Garbage_collection::cident_sections_): New member.
9403 (gc_process_relocs): Add references to sections whose names are C
9405 * gold.h (cident_section_start_prefix): New constant.
9406 (cident_section_stop_prefix): New constant.
9407 (is_cident): New function.
9408 * layout.cc (Layout::define_section_symbols): Replace string constants
9409 with the newly defined constants.
9410 * object.cc (Sized_relobj::do_layout): Track sections whose names are
9412 * testsuite/Makefile.am: Add gc_orphan_section_test.
9413 * testsuite/Makefile.in: Regenerate.
9414 * testsuite/gc_orphan_section_test.cc: New file.
9415 * testsuite/gc_orphan_section_test.sh: New file.
9417 2010-01-06 Ian Lance Taylor <iant@google.com>
9420 * options.h (class General_options): Add --warn-shared-textrel.
9421 * layout.cc (Layout::finish_dynamic_section): Implement
9422 --warn-shared-textrel.
9425 * options.h (class General_options): Add --warn-multiple-gp.
9427 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9429 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
9430 $(THREADSLIB) and $(LIBDL).
9431 * Makefile.in: Rebuild.
9433 2010-01-06 Ian Lance Taylor <iant@google.com>
9436 * options.cc (General_options::parse_section_start): New function.
9437 (General_options::section_start): New function.
9438 (General_options::General_options): Initialize all members.
9439 * options.h: Include <map>
9440 (class General_options): Add --section-start. Add section_starts_
9442 * layout.cc (Layout::attach_allocated_section_to_segment): If
9443 --section-start was used, set the address of the segment. Remove
9444 local sort_sections.
9445 (Layout::relaxation_loop_body): If the address of the load segment
9446 has been set by --section-start, don't use it.
9447 * output.h (Output_segment::update_flags_for_output_section): New
9449 * output.cc (Output_segment::add_output_section): Call
9450 update_flags_for_output_section.
9452 2010-01-05 Ian Lance Taylor <iant@google.com>
9455 * options.h (class General_options): Add --undefined-version.
9456 * script.cc (struct Version_expression): Add was_matched_by_symbol
9458 (Version_script_info::matched_symbol): New function.
9459 (Version_script_info::get_symbol_version_helper): Call
9461 (Version_script_info::check_unmatched_names): New function.
9462 * script.h (class Version_script_info): Update declarations.
9463 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
9465 * options.h (class General_options): Use DEFINE_bool_alias for
9466 allow_multiple_definition.
9467 * resolve.cc (Symbol_table::should_override): Don't test
9468 allow_multiple_definition.
9471 * options.h (class General_options): Add --cref.
9472 * main.cc (main): Print cref table if --cref. Don't close mapfile
9473 until after printing cref table.
9474 * cref.cc: Include "symtab.h".
9475 (class Cref_inputs): Define Cref_table_compare and Cref_table.
9476 (Cref_table_compare::operator()): New function.
9477 (Cref_inputs::gather_cref): New function.
9478 (filecol): New static const.
9479 (Cref_inputs::print_cref): New function.
9480 (Cref::print_cref): New function.
9481 * cref.h: Include <cstdio>.
9482 (class Cref): Update declarations.
9483 * mapfile.h (Mapfile::file): New function.
9484 * object.h (class Object): Define Symbols. Declare virtual
9485 do_get_global_symbols.
9486 (Object::get_global_symbols): New function.
9487 * object.cc (Input_objects::add_object): Pass object to cref_ if
9489 (Input_objects::archive_start): Likewise.
9490 (Input_objects::archive_stop): Likewise.
9491 (Input_objects::print_cref): New function.
9492 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
9493 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
9495 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
9497 * plugin.h (class Sized_pluginobj): Update declarations.
9499 2010-01-05 Ian Lance Taylor <iant@google.com>
9501 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
9502 to is_default_version. Rename insdef to insdefault.
9503 (Symbol_table::add_from_relobj): Rename def to is_default_version
9504 and local to is_forced_local.
9505 (Symbol_table::add_from_pluginobj): Likewise.
9506 (Symbol_table::add_from_dynobj): Likewise.
9507 (Symbol_table::define_special_symbol): Rename insdef to
9510 2010-01-04 Ian Lance Taylor <iant@google.com>
9513 * options.h (class General_options): Add
9514 --allow-multiple-definition and -z muldefs.
9515 * resolve.cc (Symbol_table::should_override): Don't warn about a
9516 multiple symbol definition if --allow-multiple-definition or -z
9520 * options.h (class General_options): Add --add-needed and
9521 --copy-dt-needed-entries. Tweak --as-needed help entry.
9522 * object.cc (Input_objects::check_dynamic_dependencies): Give an
9523 error if --copy-dt-needed-entries aka --add-needed is used and
9524 would cause a change in behaviour.
9527 * options.h (class General_options): Add -G as a short version of
9528 --shared. Add no-op options -assert, -g, and -i.
9530 2010-01-04 Sriraman Tallam <tmsriram@google.com>
9532 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
9533 check for .text or .gnu.linkonce.t sections.
9534 * icf.cc (Icf::find_identical_sections): Ditto.
9535 Change the detection for mangled function name within the section
9537 * icf.h (is_section_foldable_candidate): New function.
9539 2009-12-30 Ian Lance Taylor <iant@google.com>
9542 * options.h (class General_options): Permit two dashes with
9543 --retain-symbols-file.
9545 2009-12-30 Ian Lance Taylor <iant@google.com>
9548 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
9549 don't put the file header and segment headers in the text
9553 * common.cc (Sort_commons::operator()): Stabilize sort when both
9555 (Symbol_table::do_allocate_commons_list): When allocating common
9556 symbols, skip a symbol which is no longer common.
9557 * symtab.h (Symbol::is_common): Test whether the symbol comes from
9558 an object before checking its type.
9559 * testsuite/common_test_2.c: New file.
9560 * testsuite/common_test_3.c: New file.
9561 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
9562 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
9563 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
9564 (common_test_2_pic.o, common_test_2.so): New targets.
9565 (common_test_3_pic.o, common_test_3.so): New targets.
9566 * testsuite/Makefile.in: Rebuild.
9569 * script.cc (read_input_script): If we see a new SECTIONS clause,
9570 and we have added an input section, give an error.
9571 * layout.h (class Layout): Add have_added_input_section function.
9572 Add have_added_input_section_ field.
9573 * layout.cc (Layout::Layout): Initialize
9574 have_added_input_section_.
9575 (Layout::layout): Set have_added_input_section_.
9576 (Layout::layout_eh_frame): Likewise.
9578 2009-12-30 Ian Lance Taylor <iant@google.com>
9581 * options.h (class General_options): Add --sort-common option.
9582 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
9583 * common.cc (Sort_common): Add sort_order parameter to
9584 constructor. Add sort_order_ field.
9585 (Sort_commons::operator): Check sort_order_.
9586 (Symbol_table::allocate_commons): Determine the sort order.
9587 (Symbol_table::do_allocate_commons): Add sort_order parameter.
9589 (Symbol_table::do_allocate_commons_list): Likewise.
9591 2009-12-30 Ian Lance Taylor <iant@google.com>
9594 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
9595 symbols from this object, don't change the visibility of an
9597 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
9599 2009-12-30 Ian Lance Taylor <iant@google.com>
9602 * script.h (class Version_script_info): Define Language enum.
9603 Update declarations. Define Glob, Exact, and Lookup types. Add
9604 new fields globals_, locals_, and is_finalized_.
9605 * script.cc: Various formatting fixes.
9606 (class Parser_closure): Change language_stack_ from a vector of
9607 std::string to one of Version_script_info::Language. Adjust all
9609 (class Lazy_demangler): Remove.
9610 (struct Version_expression): Change language from std::string to
9611 Version_script_info::Language.
9612 (Version_script_info::Version_script_info): New function.
9613 (Version_script_info::~Version_script_info): Don't call clear.
9614 (Version_script_info::finalize): New function.
9615 (Version_script_info::build_lookup_tables): New function.
9616 (Version_script_info::build_expression_list_lookup): New
9618 (Version_script_info::get_symbol_version_helper): Rewrite to use
9620 (Version_script_info::print_expression_list): Adjust to use
9621 Version_script_info::Language.
9622 (script_push_lex_into_version_mode): Check that the version script
9623 has not been finalized.
9624 (version_script_push_lang): Change language string to
9625 Version_script_info::Language.
9626 * options.cc (Command_line::version_script): New function.
9627 * options.h (class General_options): Add finalize_dynamic_list
9628 function. Change version_script from declaration to definition.
9629 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
9630 * testsuite/version_script.map: Remove duplicate def of foo.
9631 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
9633 * testsuite/Makefile.in: Rebuild.
9635 2009-12-30 Ian Lance Taylor <iant@google.com>
9638 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
9639 if the input symbol index is 0, make the output symbol index 0.
9641 2009-12-30 Ian Lance Taylor <iant@google.com>
9644 * options.h (class General_options): Add -x/--discard-all.
9645 * object.cc (Sized_relobj::do_count_local_symbols): Handle
9646 --discard-all. If the local symbol needs a dynamic entry, check
9647 that before handling --discard-locals.
9649 2009-12-30 Ian Lance Taylor <iant@google.com>
9652 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
9654 (Output_segment::add_output_section): Don't change the flags if
9658 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
9659 GNU hash table if they need a dynamic value. Otherwise, don't add
9660 them if they are defined in a dynamic object or are forced local.
9662 2009-12-29 Ian Lance Taylor <iant@google.com>
9665 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
9666 .gnu.hash table for a 32-bit target.
9669 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
9670 regular and a dynamic object only needs a dynamic symbol table
9671 entry if it is externally visible.
9674 * i386.cc (class Target_i386): Initialize global_offset_table_ in
9675 constructor. Add global_offset_table_ field.
9676 (Target_i386::got_section): Set global_offset_table_.
9677 (Target_i386::do_finalize_sections): Set global_offset_table_
9679 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
9680 in constructor. Add global_offset_table_ field.
9681 (Target_x86_64::got_section): Set global_offset_table_.
9682 (Target_x86_64::do_finalize_sections): Set global_offset_table_
9685 * layout.cc (Layout::Layout): Initialize increase_relro_.
9686 (Layout::get_output_section): Add is_relro, is_last_relro, and
9687 is_first_non_relro parameters. Change all callers.
9688 (Layout::choose_output_section): Likewise.
9689 (Layout::add_output_section_data): Likewise.
9690 (Layout::make_output_section): Likewise.
9691 (Layout::set_segment_offsets): Clear increase_relro when using a
9693 * layout.h (class Layout): Add increase_relro method. Add
9694 increase_relro_ field. Update declarations.
9695 * output.cc (Output_section::Output_section): Initialize
9696 is_last_relro_ and is_first_non_relro_.
9697 (Output_segment::add_output_section): Group relro sections is
9698 do_sort is true. Handle is_last_relro and is_first_non_relro.
9699 (Output_segment::maximum_alignment): Remove relro handling.
9700 (Output_segment::set_section_addresses): Add increase_relro
9701 parameter. Change all callers. Add initial alignment to align
9702 relro sections on separate page. Remove old relro handling.
9703 (Output_segment::set_section_list_addresses): Remove in_relro
9704 parameter. Change all callers.
9705 (Output_segment::set_offset): Add increase parameter. Change all
9706 callers. Remove old relro handling.
9707 * output.h (class Output_section): Add new methods: is_last_relro,
9708 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
9709 Add is_last_relro_ and is_first_non_relro_ fields.
9710 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
9711 Create separate .got.plt section. Call increase_relro.
9712 * x86_64.cc (Target_x86_64::got_section): Likewise.
9713 * testsuite/relro_script_test.t: Add .got.plt.
9716 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
9717 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
9718 (Layout::finalize): Call set_dynamic_symbol_size.
9719 (Layout::set_dynamic_symbol_size): New function.
9720 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
9721 set_dynamic_symbol_size.
9724 * output.h (class Output_section): Add is_entsize_zero_ field.
9725 * output.cc (Output_section::Output_section): Initialize
9727 (Output_section::set_entsize): If two different entsizes are
9728 requested, force it to zero.
9729 (Output_section::add_input_section): Set flags for .debug_str
9730 before updating section flags. Set entsize.
9731 (Output_section::update_flags_for_input_section): Set SHF_MERGE
9732 and SHF_STRING if all input sections have those flags.
9734 2009-12-29 Rafael Espindola <espindola@google.com>
9736 * main.cc (main): Fix the sys time reporting.
9737 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
9740 2009-12-29 Sriraman Tallam <tmsriram@google.com>
9742 * options.cc (General_options::parse_version): Allow -v to exit
9743 without an error if there is nothing to link.
9745 2009-12-29 Ian Lance Taylor <iant@google.com>
9747 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
9748 using a version of gcc before 4.1.
9749 * configure: Rebuild.
9751 2009-12-28 Chris Demetriou <cgd@google.com>
9753 * attributes.cc (Output_attributes_section_data::do_write): Use
9754 std::vector::front rather than std::vector::data.
9756 2009-12-28 Ian Lance Taylor <iant@google.com>
9758 * symtab.h (class Symbol_table): Add enum Defined.
9759 * resolve.cc (Symbol_table::should_override): Add defined
9760 parameter. Change all callers. Test whether object is NULL
9761 before calling a method on it.
9762 (Symbol_table::report_resolve_problem): Add defined parameter.
9764 (Symbol_table::should_override_with_special): Likewise.
9765 * symtab.cc (Symbol_table::define_in_output_data): Add defined
9766 parameter. Change all callers.
9767 (Symbol_table::do_define_in_output_data): Likewise.
9768 (Symbol_table::define_in_output_segment): Likewise.
9769 (Symbol_table::do_define_in_output_segment): Likewise.
9770 (Symbol_table::define_as_constant): Likewise.
9771 (Symbol_table::do_define_as_constant): Likewise.
9772 * script.h (class Symbol_assignment): Add is_defsym parameter to
9773 constructor; change all callers.
9774 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
9775 parameter. Change all callers. Add is_defsym_ field.
9776 (class Parser_closure): Add parsing_defsym parameter to
9777 constructor; change all callers. Add parsing_defsym accessor
9778 function. Add parsing_defsym_ field.
9780 2009-12-28 Ian Lance Taylor <iant@google.com>
9782 * gold.cc (queue_middle_tasks): Fix formatting.
9783 * object.cc (Relobj::is_section_name_included): Likewise.
9785 2009-12-23 Ian Lance Taylor <iant@google.com>
9787 * i386.cc (Target_i386::do_calls_non_split): Recognize
9788 -fsplit-stack prologue for a function with a static chain.
9789 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
9790 -fsplit-stack prologue when using %r11.
9792 2009-12-21 Sriraman Tallam <tmsriram@google.com>
9794 * options.cc (General_options::parse_version): Make -v continue and do
9795 the link like GNU ld does.
9797 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
9799 * Makefile.am (CCFILES): Add timer.cc.
9800 (HFILES): Add timer.h.
9801 * configure.ac: Check for sysconf and times.
9802 * main.cc: include timer.h.
9803 (main): Use Timer instead of get_run_time.
9806 * workqueue.cc: include timer.h.
9807 (Workqueue::find_and_run_task):
9808 Report user, sys and wall time.
9809 * Makefile.in: Regenerate.
9810 * config.in: Regenerate.
9811 * configure: Regenerate.
9813 2009-12-16 Doug Kwan <dougkwan@google.com>
9815 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
9817 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
9818 relaxed input sections.
9819 * output.cc (Output_section::find_relaxed_input_section): Change
9820 return type to Output_relaxed_input_section pointer. Adjust code
9821 for new type of relaxed_input_section_map_.
9822 * output.h (Output_section::find_relaxed_input_section): Change
9823 return type to Output_relaxed_input_section pointer.
9824 (Output_section::Output_relaxed_input_section_by_input_section_map):
9826 (Output_section::relaxed_input_section_map_): Change type to
9827 Output_section::Output_relaxed_input_section_by_input_section_map.
9828 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
9831 2009-12-15 Ian Lance Taylor <iant@google.com>
9833 * layout.cc (Layout::create_shstrtab): Only write out after input
9834 sections if we are compressing debug sections.
9836 2009-12-15 Ian Lance Taylor <iant@google.com>
9838 * archive.cc (Archive::add_symbols): Only look up a symbol without
9839 a version if there is, in fact, a version.
9841 2009-12-14 Ian Lance Taylor <iant@google.com>
9843 Revert -Wshadow changes, all changes from:
9844 2009-12-11 Doug Kwan <dougkwan@google.com>
9845 2009-12-11 Nick Clifton <nickc@redhat.com>
9846 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
9848 2009-12-11 Doug Kwan <dougkwan@google.com>
9850 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
9852 * attributes.cc (Object_attribute::size): Ditto.
9853 (Attributes_section_data::size): Ditto.
9854 (Attributes_section_data::Attributes_section_data): Ditto.
9855 (Output_attributes_section_data::do_write): Ditto.
9856 * attributes.h (Object_attribute::set_type): Ditto.
9857 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
9859 2009-12-11 Nick Clifton <nickc@redhat.com>
9861 * archive.cc: Fix shadowed variable warnings.
9863 * compressed_output.cc: Likewise.
9864 * compressed_output.h: Likewise.
9865 * configure: Likewise.
9866 * dwarf_reader.cc: Likewise.
9867 * dynobj.cc: Likewise.
9868 * dynobj.h: Likewise.
9869 * ehframe.cc: Likewise.
9870 * ehframe.h: Likewise.
9871 * errors.cc: Likewise.
9872 * expression.cc: Likewise.
9873 * fileread.cc: Likewise.
9874 * fileread.h: Likewise.
9875 * freebsd.h: Likewise.
9876 * i386.cc: Likewise.
9878 * incremental.h: Likewise.
9879 * layout.cc: Likewise.
9880 * layout.h: Likewise.
9881 * mapfile.cc: Likewise.
9882 * merge.cc: Likewise.
9883 * merge.h: Likewise.
9884 * object.cc: Likewise.
9885 * object.h: Likewise.
9886 * options.h: Likewise.
9887 * output.cc: Likewise.
9888 * output.h: Likewise.
9889 * parameters.cc: Likewise.
9890 * plugin.cc: Likewise.
9891 * powerpc.cc: Likewise.
9892 * reduced_debug_output.cc: Likewise.
9893 * reduced_debug_output.h: Likewise.
9894 * reloc.cc: Likewise.
9895 * reloc.h: Likewise.
9896 * resolve.cc: Likewise.
9897 * script-sections.cc: Likewise.
9898 * script.cc: Likewise.
9899 * script.h: Likewise.
9900 * sparc.cc: Likewise.
9901 * symtab.cc: Likewise.
9902 * symtab.h: Likewise.
9903 * target-select.cc: Likewise.
9904 * target-select.h: Likewise.
9905 * token.h: Likewise.
9906 * workqueue.cc: Likewise.
9907 * workqueue.h: Likewise.
9908 * x86_64.cc: Likewise.
9910 2009-12-10 Doug Kwan <dougkwan@google.com>
9912 * arm.cc (attributes.h): New include.
9913 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
9914 (Arm_relobj::~Arm_relobj): Delete object pointed by
9915 attributes_section_data_.
9916 (Arm_relobj::attributes_section_data): New method definition.
9917 (Arm_relobj::attributes_section_data_): New data member declaration.
9918 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
9919 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
9920 attributes_section_data_.
9921 (Arm_dynobj::attributes_section_data): New method definition.
9922 (Arm_dynobj::attributes_section_data_): New data member declaration.
9923 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
9924 initialization value of may_use_blx_ to false.
9925 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
9926 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
9927 object attributes to compute results instead of hard-coding.
9928 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
9929 Target_arm::get_secondary_compatible_arch,
9930 Target_arm::set_secondary_compatible_arch
9931 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9932 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
9933 New method declarations.
9934 (Target_arm::get_aeabi_object_attribute): New method definition.
9935 (Target_arm::attributes_section_data_): New data member declaration.
9936 (read_arm_attributes_section): New template definition.
9937 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
9938 (Arm_dynobj::do_read_symbols): Ditto.
9939 (Target_arm::do_finalize_sections): Merge attributes sections from
9940 input. Check for BLX use after attributes section merging.
9941 Fix __exidx_start and __exidx_end visibility. Create an
9942 .ARM.attributes section if necessary.
9943 (Target_arm::get_secondary_compatible_arch,
9944 Target_arm::set_secondary_compatible_arch,
9945 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9946 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
9947 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
9948 New method definitions.
9950 2009-12-09 Ian Lance Taylor <iant@google.com>
9952 * plugin.cc (Plugin::load): Don't cast from void* to a function
9955 2009-12-09 Ian Lance Taylor <iant@google.com>
9957 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
9960 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
9962 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
9963 Replace two_file_shared_1.so with two_file_shared_2.so.
9964 * testsuite/Makefile.in: Regenerated.
9966 2009-12-08 Doug Kwan <dougkwan@google.com>
9968 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
9969 (HFILES): Add attributes.h and int_encoding.h.
9970 * Makefile.in: Regenerate.
9971 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
9972 function definitions to int_encoding.cc
9973 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
9974 prototypes to int_encoding.h
9975 * reduced_debug_output.cc (int_encoding.h): New include.
9976 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
9977 function definitions to int_encoding.cc
9978 (insert_into_vector, read_from_pointer): Move template definitions to
9980 * attributes.cc: New file.
9981 * attributes.h: New file.
9982 * int_encoding.cc: New file.
9983 * int_encoding.h: New file.
9985 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
9988 * incremental-dump.cc (dump_incremental_inputs): New.
9989 (main): Use dump_incremental_inputs.
9991 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
9994 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
9995 checking elfcpp::STT_FUNC.
9996 (Target_i386::Relocate::relocate): Likewise.
9997 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
9999 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10000 symbols from shared libraries into normal FUNC symbols.
10002 * symtab.h (Symbol): Add is_func and use it.
10004 2009-12-05 Doug Kwan <dougkwan@google.com>
10006 * arm.cc (Target_arm::arm_info): Initialize new fields
10007 attributes_section and attributes_vendor.
10008 * i386.cc (Target_i386::i386_info): Same.
10009 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10010 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10011 fields attributes_section and attributes_vendor.
10012 * sparc.cc (Target_sparc::sparc_info): Same.
10013 * target.h (Target::attributes_section, Target::attributes_vendor,
10014 Target::is_attributes_section, Target::attribute_arg_type,
10015 Target::attributes_order): New method definitions.
10016 (Target::Target_info::attributes_section,
10017 Target::Target_info::attributes_vendor): New fields.
10018 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10019 virtual method definitions.
10020 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10021 attributes_section and attributes_vendor.
10022 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10024 2009-12-05 Doug Kwan <dougkwan@google.com>
10026 * arm.cc: Update comments about interworking and stub generation.
10027 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
10028 considered as non-PIC.
10029 (Arm_relocate_functions::base_abs): Fix formatting.
10030 (Arm_relocate_functions::got_prel): Fix comment. Change interface
10031 of function to use GOT entry address instead of offset.
10032 (Target_arm::Scan::global): Issue an error if a symbol would need a
10033 PLT does not get one because it is untyped. Remove code to create
10034 dynamic symbols for relative branches.
10035 (Target_arm::Relocate::relocate: Use 0 instead of false since function
10036 takes unsigned integer instead of boolean.
10038 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
10040 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
10041 (two_file_test_LDADD): Likewise.
10042 (common_test_1_LDADD): Likewise.
10043 (exception_test_LDADD) Likewise.
10044 (weak_test_LDADD): Likewise.
10045 (many_sections_test_LDADD): Likewise.
10046 (initpri1_LDADD): Likewise.
10047 (script_test_1_LDADD): Likewise.
10048 (script_test_2_LDADD): Likewise.
10049 (justsyms_LDADD): Likewise.
10050 (binary_test_LDADD): Likewise.
10051 (large_LDADD): Likewise.
10052 * testsuite/Makefile.in: Regenerated.
10054 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
10056 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
10057 (Symbol_table::override_with_special): Likewise.
10058 (Symbol_table::add_from_object): Likewise.
10060 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
10062 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10063 Don't set the data_offset twice.
10065 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
10067 * testsuite/Makefile.in: Regenerate.
10069 2009-12-03 Doug Kwan <dougkwan@google.com>
10071 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
10072 (Target_arm::do_finalize_sections): Add parameter for symbol table
10073 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
10074 * i386.cc (Target_i386::do_finalize_sections): Add an additional
10075 parameter for symbol table pointer.
10076 * layout.cc (Layout::finalize): Call Target::finalize_sections with
10077 an additional parameter for a pointer to symbol table.
10078 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
10079 parameter for a symbol table pointer.
10080 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
10081 * target.h (Target::finalize_sections, Target::do_finalize_sections):
10083 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
10084 parameter for a symbol table pointer.
10086 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
10088 * incremental.cc (Incremental_inputs_header)
10089 (Incremental_inputs_header_write, Incremental_inputs_entry)
10090 (Incremental_inputs_entry_write): Move ...
10091 * incremental.h (Incremental_inputs_header)
10092 (Incremental_inputs_header_write, Incremental_inputs_entry)
10093 (Incremental_inputs_entry_write): here.
10095 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10097 * incremental.cc (make_sized_incremental_binary): Set the target.
10098 Error if it is incompatible.
10099 * output.h (Output_file): Add filename method.
10101 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10103 * incremental.cc (Incremental_inputs_entry): Remove unused argument
10104 from the get_* methods.
10106 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10108 * incremental-dump.cc (main): Check that the offeset of a script is 0.
10109 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10110 Write 0 for the data_offset of scripts.
10112 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10114 * testsuite/Makefile.am: Add the incremental_test.sh test.
10115 * testsuite/incremental_test.sh: New.
10116 * testsuite/incremental_test_1.c: New.
10117 * testsuite/incremental_test_2.c: New.
10119 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
10121 * incremental-dump.cc (main): Fix typos.
10123 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
10126 * incremental-dump.cc (main): Use llu to print 64 bit values.
10128 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
10129 H.J. Lu <hongjiu.lu@intel.com>
10131 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
10133 (incremental_dump_LDADD): Likewise.
10134 * Makefile.in: Regenerated.
10136 2009-11-25 Doug Kwan <dougkwan@google.com>
10140 2009-11-25 Doug Kwan <dougkwan@google.com>
10142 * arm.cc (Target_arm::Target_arm): Move method definition
10143 outside of class definition. Add code to handle
10144 --target1-rel, --target1-abs and --target2= options.
10145 (Target_arm::get_reloc_reloc_type): Change method to be
10146 non-static and const.
10147 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
10148 New data member declaration.
10149 (Target_arm::Scan::local, Target_arm::Scan::global,
10150 Target_arm::Relocate::relocate,
10151 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10152 Adjust call to Target_arm::get_real_reloc_type.
10153 (Target_arm::get_real_reloc_type): Use command line options
10154 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10155 * options.h (--target1-rel, --target1-abs, --target2): New
10158 2009-11-25 Doug Kwan <dougkwan@google.com>
10160 * arm.cc (Target_arm::Target_arm): Move method definition outside of
10161 class definition. Add code to handle --target1-rel, --target1-abs
10162 and --target2= options.
10163 (Target_arm::get_reloc_reloc_type): Change method to be non-static
10165 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
10166 member declaration.
10167 (Target_arm::Scan::local, Target_arm::Scan::global,
10168 Target_arm::Relocate::relocate,
10169 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
10170 call to Target_arm::get_real_reloc_type.
10171 (Target_arm::get_real_reloc_type): Use command line options to
10172 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10173 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
10176 2009-11-25 Doug Kwan <dougkwan@google.com>
10178 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
10179 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
10180 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
10182 (Arm_relocate_functions::thm_call): Replace body with a call to
10183 Arm_relocate_functions::thumb_branch_common.
10184 (Arm_relocate_functions::thm_jump24,
10185 Arm_relocate_functions::thm_xpc22): New method definitions.
10186 (Arm_relocate_functions::thumb_branch_common): New method definition.
10187 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
10189 (Target_arm::Relocate::relocate): Adjust call to thm_call.
10190 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
10192 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10194 * Makefile.am: Build incremental-dump
10195 * Makefile.in: Regenerate.
10196 * incremental-dump.cc: New.
10197 * incremental.cc (Incremental_inputs_header_data,
10198 Incremental_inputs_entry_data): Move to incremental.h
10199 * incremental.h: (Incremental_inputs_header_data,
10200 Incremental_inputs_entry_data): Move from incremental.cc
10202 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10204 * incremental.cc (Incremental_inputs_header,
10205 Incremental_inputs_header_write, Incremental_inputs_entry,
10206 Incremental_inputs_entry_write): Add a typedef with the data type.
10208 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10210 * incremental.cc (Incremental_inputs_header,
10211 Incremental_inputs_header_write, Incremental_inputs_entry,
10212 Incremental_inputs_entry_write): Update comment about which
10213 type has the filed descriptions.
10215 2009-11-15 Doug Kwan <dougkwan@google.com>
10217 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
10218 (Arm_relocate_functions::arm_branch_common): Change method defintion
10219 in class definition to a method declaration and update list of formal
10221 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
10222 Arm_relocation_functions::jump24): Adjust call to
10223 Arm_relocate_functions::arm_branch_common. Update list of formal
10225 (Arm_relocate_functions::xpc25): New method definition.
10226 (Arm_relocate_functions::arm_branch_common): Move method defintion
10227 out from class definition. Use stubs for mode-switching and extending
10229 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
10230 specially. Change code to enable use of stubs in ARM branches.
10232 2009-11-10 Doug Kwan <dougkwan@google.com>
10234 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
10235 in method declaration.
10236 (Target_arm::relocate_stub): New method declaration.
10237 (Target_arm::default_target): Change to return a pointer instead of
10239 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
10240 Target_arm::default_target.
10241 (Arm_Relobj::do_relocate_sections): Remove options paramater in
10243 (Target_arm::relocate_section): Adjust view.
10244 (Target_arm::relocate_stub): New method definition.
10246 2009-11-10 Doug Kwan <dougkwan@google.com>
10248 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
10250 * incremental.cc (open_incremental_binary): Initialized local
10251 variables to avoid warnings.
10252 * object.cc (make_elf_object): Ditto.
10253 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
10256 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
10259 * testsuite/plugin_test.c: Include "config.h".
10261 2009-11-09 Doug Kwan <dougkwan@google.com>
10263 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
10264 (arm_symbol_value): Remove.
10265 (Arm_relocate_functions::arm_branch_common,
10266 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
10267 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
10268 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
10269 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
10270 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
10271 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
10272 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
10273 Arm_relocate_functions::thm_mobw_abs_nc,
10274 Arm_relocate_functions::thm_mov_abs,
10275 Arm_relocate_functions::movw_prel_nc,
10276 Arm_relocate_functions::thm_movt_abs,
10277 Arm_relocate_functions::movt_prel,
10278 Arm_relocate_functions::thm_movw_prel_nc,
10279 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
10280 (Target_arm::Relocate::relocate): Only decompose address into two
10281 parts if relocation type uses the thumb-bit and pass the actual
10282 bit instead of a flag indicating that the thumb-bit is used. Adjust
10283 calls to methods in Arm_relocate_functions for this change.
10285 2009-11-08 Ian Lance Taylor <iant@google.com>
10288 * reloc.cc: Instantiate
10289 Sized_relobj::initialize_input_to_output_maps and
10290 Sized_relobj:free_input_to_output_maps.
10292 2009-11-06 Ian Lance Taylor <iant@google.com>
10295 * defstd.cc (in_segment): Set only_if_ref true for "end".
10297 2009-11-06 Doug Kwan <dougkwan@google.com>
10299 * arm.cc (class Reloc_stub): Correct a comment.
10300 (Target_arm::Target_arm): Initialize arm_input_section_map_.
10301 (Target_arm::scan_section_for_stubs): New method declaration.
10302 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
10303 Change methods from private to protected.
10304 (Target_arm::do_may_relax): New method definition.
10305 (Target_arm::do_relax, Target_arm::group_sections,
10306 Target_arm::scan_reloc_for_stub,
10307 Target_arm::scan_reloc_section_for_stubs): New method declarations.
10308 (Target_arm::arm_input_section_map_): New data member declaration.
10309 (Target_arm::scan_reloc_for_stub,
10310 Target_arm::scan_reloc_section_for_stubs,
10311 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
10312 Target_arm::do_relax): New method definitions.
10314 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
10316 * configure.ac: Check for (struct stat)::st_mtim
10317 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
10318 * config.in: Regenerate.
10319 * configure: Regenerate.
10321 2009-11-05 Ian Lance Taylor <iant@google.com>
10324 * output.cc (Output_segment::add_output_section): Add missing
10327 2009-11-04 Ian Lance Taylor <iant@google.com>
10330 * object.h (class Object): Add is_needed and set_is_needed
10331 methods. Add is_needed_ field. Make bool fields into bitfields.
10332 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
10333 defined in a dynamic object and referenced by a regular object,
10334 set is_needed for the dynamic object.
10335 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
10336 if the file is marked with as_needed and it is not needed.
10338 2009-11-04 Ian Lance Taylor <iant@google.com>
10341 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
10342 tags if data is discarded by linker script.
10343 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10344 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10345 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10346 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10348 2009-11-04 Ian Lance Taylor <iant@google.com>
10350 * layout.cc (Layout::get_output_section): Add is_interp and
10351 is_dynamic_linker_section parameters. Change all callers.
10352 (Layout::choose_output_section): Likewise.
10353 (Layout::make_output_section): Likewise.
10354 (Layout::add_output_section_data): Add is_dynamic_linker_section
10355 parameter. Change all callers.
10356 * layout.h (class Layout): Update declarations.
10357 * output.h (class Output_section): Add is_interp, set_is_interp,
10358 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
10359 Add is_interp_, is_dynamic_linker_section_ fields. Change
10360 generate_code_fills_at_write_ to a bitfield.
10361 * output.cc (Output_section::Output_sections): Initialize new
10363 (Output_segment::add_output_section): Add do_sort parameter.
10364 Change all callers.
10366 2009-11-03 Ian Lance Taylor <iant@google.com>
10369 * options.h (class General_options): Add --warn-common.
10370 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
10371 merging two common symbols.
10372 (Symbol_table::should_override): Handle --warn-common when merging
10373 a common symbol with a defined symbol. Use report_resolve_problem
10374 for multiple definitions.
10375 (Symbol_table::report_resolve_problem): New function.
10376 * symtab.h (class Symbol_table): Declare report_resolve_problem.
10378 2009-11-03 Doug Kwan <dougkwan@google.com>
10380 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
10382 (Target_arm::stub_factory): New method definition.
10383 (Target_arm::new_arm_input_section,
10384 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
10385 Target_arm::reloc_uses_thumb_bit): New method declarations.
10386 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
10387 New type definitions.
10388 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
10389 member declarations.
10390 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
10391 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
10392 New method definitions.
10394 2009-11-03 Ian Lance Taylor <iant@google.com>
10396 * options.h (class General_options): Add --warn_constructors.
10398 2009-11-03 Ian Lance Taylor <iant@google.com>
10401 * defstd.cc (in_section): Add entries for __rel_iplt_start,
10402 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
10404 2009-11-03 Ian Lance Taylor <iant@google.com>
10407 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
10408 --msgid-bugs-address.
10409 (install-pdf): New target.
10410 (install-data_yes): Look up one directory to find mkinstalldirs.
10412 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
10414 * po/Make-in (.po.gmo): Don't generate .gmo files in source
10417 2009-10-30 Doug Kwan <dougkwan@google.com>
10419 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
10421 2009-10-30 Doug Kwan <dougkwan@google.com>
10423 * arm.cc (Stub_addend_reader): New struct template definition
10424 and partial specializations.
10425 (Stub_addend_reader::operator()): New method definition for a
10426 partially specialized template.
10428 2009-10-30 Doug Kwan <dougkwan@google.com>
10430 * arm.cc (Arm_relobj::processor_specific_flags): New method
10432 (Arm_relobj::do_read_symbols): New method declaration.
10433 (Arm_relobj::processor_specific_flags_): New data member declaration.
10434 (Arm_dynobj): New class definition.
10435 (Target_arm::do_finalize_sections): Add input_objects parameter.
10436 (Target_arm::do_adjust_elf_header): New method declaration.
10437 (Target_arm::are_eabi_versions_compatible,
10438 (Target_arm::merge_processor_specific_flags): New method declaration.
10439 (Target_arm::do_make_elf_object): New overloaded method definitions
10441 (Arm_relobj::do_read_symbols): New method definition.
10442 (Arm_dynobj::do_read_symbols): Ditto.
10443 (Target_arm::do_finalize_sections): Add input_objects parameters.
10444 Merge processor-specific flags from all input objects.
10445 (Target_arm::are_eabi_versions_compatible,
10446 Target_arm::merge_processor_specific_flags,
10447 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
10448 New method definitions.
10449 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
10450 Input_objects pointer type parameter.
10451 * layout.cc (Layout::finalize): Pass input objects to target's.
10452 finalize_sections function.
10453 * output.cc (Output_file_header::do_sized_write): Set ELF file
10454 header's processor-specific flags.
10455 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
10456 Input_objects pointer type parameter.
10457 * sparc.cc (Target_sparc::do_finalize_sections): Same.
10458 * target.h (Input_objects): New forward class declaration.
10459 (Target::processor_specific_flags,
10460 Target::are_processor_specific_flags_sect): New method definitions.
10461 (Target::finalize_sections): Add input_objects parameter.
10462 (Target::Target): Initialize processor_specific_flags_ and
10463 are_processor_specific_flags_set_.
10464 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
10466 (Target::set_processor_specific_flags): New method definition.
10467 (Target::processor_specific_flags_,
10468 Target::are_processor_specific_flags_set_): New data member
10470 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
10471 Input_objects pointer type parameter.
10473 2009-10-30 Doug Kwan <dougkwan@google.com>
10475 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
10477 2009-10-28 Ian Lance Taylor <iant@google.com>
10479 * object.h (class Relobj): Drop options parameter from
10480 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
10481 do_scan_relocs, do_relocate. Change all callers.
10482 (class Sized_relobj): Drop options parameters from
10483 do_gc_process_relocs, do_scan_relocs, do_relocate,
10484 do_relocate_sections, relocate_sections, emit_relocs_scan,
10485 emit_relocs_scan_reltype. Change all callers.
10486 (struct Relocate_info): Remove options field and all references to
10488 * reloc.h (class Read_relocs): Remove options constructor
10489 parameter and options_ field. Change all callers.
10490 (class Gc_process_relocs, class Scan_relocs): Likewise.
10491 (class Relocate_task): Likewise.
10492 * target-reloc.h (scan_relocs): Remove options parameter. Change
10494 (scan_relocatable_relocs): Likewise.
10495 * target.h (class Sized_target): Remove options parameter from
10496 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
10498 * gc.h (gc_process_relocs): Remove options parameter. Change all
10500 * arm.cc: Update functions to remove options parameters.
10501 * i386.cc: Likewise.
10502 * powerpc.cc: Likewise.
10503 * sparc.cc: Likewise.
10504 * x86_64.cc: Likewise.
10505 * testsuite/testfile.cc: Likewise.
10507 2009-10-28 Doug Kwan <dougkwan@google.com>
10509 * arm.cc (Arm_relobj): New class definition.
10510 (Arm_relobj::scan_sections_for_stubs,
10511 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
10512 New method definitions.
10514 2009-10-28 Cary Coutant <ccoutant@google.com>
10516 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
10517 (Plugin::cleanup_done_): New member.
10518 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
10519 (Plugin_manager::cleanup_done_): Remove.
10520 (Plugin_manager::add_input_file): Edit error message.
10521 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
10522 (Plugin_manager::cleanup): Remove use of cleanup_done_.
10524 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
10526 * fileread.cc: (File_read::View::~View): Use the new
10527 data_ownership_ filed.
10528 (File_read::~File_read): Dispose the new whole_file_view_.
10529 (File_read::open): Mmap the whole file if needed.
10530 (File_read::open): Use whole_file_view_ instead of contents_.
10531 (File_read::find_view): Use whole_file_view_ if applicable.
10532 (File_read::do_read): Use whole_file_view_ instead of contents_.
10533 (File_read::make_view): Use whole_file_view_ instead of contents_,
10534 update File_read::View::View call.
10535 (File_read::find_or_make_view): Update File_read::View::View
10537 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
10539 (File_read::View::Data_ownership): New enum.
10540 (File_read::View::View): Replace bool mapped_ with Data_ownership
10542 (File_read::View::mapped_): Remove (replaced by data_ownership_).
10543 (File_read::View::data_ownership_): New field.
10544 (File_read::contents_): Remove (replaced by whole_file_view_).
10545 (File_read::whole_file_view_): New field.
10546 * options.h (class General_options): Add --keep-files-mapped.
10548 2009-10-27 Cary Coutant <ccoutant@google.com>
10550 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
10551 * testsuite/Makefile.am (plugin_test_5): New test case.
10552 * testsuite/Makefile.in: Regenerate.
10554 2009-10-25 Doug Kwan <dougkwan@google.com>
10556 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
10557 from private to protected to allow access by child class.
10558 (Sized_relobj::do_relocate_sections): New method declaration.
10559 (Sized_relobj::relocate_sections): Virtualize.
10560 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
10561 Sized_relobj::relocate_sections. Instantiate template explicitly
10562 for different target sizes and endianity.
10564 2009-10-24 Doug Kwan <dougkwan@google.com>
10566 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
10567 (Arm_input_section::as_arm_input_section): New method.
10568 (Arm_output_section): New class definition.
10569 (Arm_output_section::create_stub_group,
10570 Arm_output_section::group_sections): New method definitions.
10572 2009-10-22 Doug Kwan <dougkwan@google.com>
10574 * arm.cc (Arm_input_section): New class definition.
10575 (Arm_input_section::init, Arm_input_section:do_write,
10576 Arm_input_section::set_final_data_size,
10577 Arm_input_section::do_reset_address_and_file_offset): New method
10580 2009-10-21 Doug Kwan <dougkwan@google.com>
10582 * arm.cc (Stub_table, Arm_input_section): New forward class
10584 (Stub_table): New class defintion.
10585 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
10586 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
10587 New method definition.
10589 2009-10-21 Doug Kwan <dougkwan@google.com>
10591 * arm.cc: Update copyright comments.
10592 (Target_arm): New forward class template declaration.
10593 (Arm_address): New type.
10594 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
10595 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
10596 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
10598 (Insn_template): Same.
10599 (DEF_STUBS): New macro.
10600 (Stub_type): New enum type.
10601 (Stub_template): New class definition.
10603 (Reloc_stub): Same.
10604 (Stub_factory): Same.
10605 (Target_arm::Target_arm): Initialize may_use_blx_ and
10606 should_force_pic_veneer_.
10607 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
10608 Target_arm::should_force_pic_veneer,
10609 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
10610 Target_arm::using_thumb_only, Target_arm:;default_target): New
10612 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
10613 New data member declarations.
10614 (Insn_template::size, Insn_template::alignment): New method defintions.
10615 (Stub_template::Stub_template): New method definition.
10616 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
10617 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
10618 (Stub_factory::Stub_factory): New method definition.
10619 * gold.h (string_hash): New template.
10620 * output.h (Input_section_specifier::hash_value): Use
10622 (Input_section_specifier::string_hash): Remove.
10623 * stringpool.cc (Stringpool_template::string_hash): Use
10626 2009-10-20 Doug Kwan <dougkwan@google.com>
10628 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
10629 symbols of relaxed input sections.
10630 * output.h (Output_section::find_relaxed_input_section): Make
10633 2009-10-16 Doug Kwan <dougkwan@google.com>
10635 * dynobj.cc (Versions::Versions): Initialize version_script_.
10636 Only insert base version symbol definition for a shared object
10637 if version script defines any version versions.
10638 (Versions::define_base_version): New method definition.
10639 (Versions::add_def): Check that base version is not needed.
10640 (Versions::add_need): Define base version lazily.
10641 * dynobj.h (Versions::define_base_version): New method declaration.
10642 (Versions::needs_base_version_): New data member declaration.
10643 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
10644 (check_DATA): Add no_version_test.stdout.
10645 (libno_version_test.so, no_version_test.o no_version_test.stdout):
10647 * testsuite/Makefile.in: Regenerate.
10648 * testsuite/no_version_test.c: New file.
10649 * testsuite/no_version_test.sh: Ditto.
10651 2009-10-16 Doug Kwan <dougkwan@google.com>
10653 * expression.cc (class Segment_start_expression): New class definition.
10654 (Segment_start_expression::value): New method definition.
10655 (script_exp_function_segment_start): Return a new
10656 Segment_start_expression.
10657 * gold/script-c.h (script_saw_segment_start_expression): New function
10659 * script-sections.cc (Script_sections::Script_sections): Initialize
10660 SAW_SEGMENT_START_EXPRESSION_ to false.
10661 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
10662 and -Tbbs options to specify section addresses if given in
10663 command line and no SEGMENT_START expression is seen in a script.
10664 * script-sections.h (Script_sections::saw_segment_start_expression,
10665 Script_sections::set_saw_segment_start_expression): New method
10667 (Script_sections::saw_segment_start_expression_): New data member
10669 * script.cc (script_saw_segment_start_expression): New function.
10670 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
10671 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
10672 script_test_7.sh and script_test_8.sh.
10673 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
10674 script_test_8.stdout.
10675 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
10676 (script_test_6, script_test_6.stdout, script_test_7,
10677 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
10678 * Makefile.in: Regenerate.
10679 * testsuite/script_test_6.sh: New file.
10680 * testsuite/script_test_6.t: Same.
10681 * testsuite/script_test_7.sh: Same.
10682 * testsuite/script_test_7.t: Same.
10683 * testsuite/script_test_8.sh: Same.
10685 2009-10-16 Doug Kwan <dougkwan@google.com>
10687 * output.cc (Output_segment::set_section_list_address): Cast
10688 expressions to unsigned long long type to avoid format warnings.
10690 2009-10-15 Ian Lance Taylor <iant@google.com>
10692 * script.cc (Script_options::add_symbol_assignment): Always add a
10693 dot assignment to script_sections_.
10694 * script-sections.cc (Script_sections::add_dot_assignment):
10695 Initialize if necessary.
10697 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
10698 program headers with no load segment if there is a linker script.
10700 * layout.cc (Layout::set_segment_offsets): Align the file offset
10701 to the segment aligment for -N or -n with no load segment.
10702 * output.cc (Output_segment::add_output_section): Don't crash if
10703 the first section is a TLS section.
10704 (Output_segment::set_section_list_addresses): Print an error
10705 message if the address moves backward in a linker script.
10706 * script-sections.cc
10707 (Output_section_element_input::set_section_addresses): Don't
10708 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
10709 (Orphan_output_section::set_section_addresses): Likewise.
10711 2009-10-15 Doug Kwan <dougkwan@google.com>
10713 * layout.cc (Layout::finish_dynamic_section): Generate tags
10714 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
10715 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
10716 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
10718 2009-10-14 Ian Lance Taylor <iant@google.com>
10720 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
10722 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
10723 data_shdr fields of relinfo.
10724 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
10725 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
10726 R_386_TLS_LDO_32, adjust based on section flags.
10727 (Target_i386::Relocate::fix_up_ldo): Remove.
10729 2009-10-13 Ian Lance Taylor <iant@google.com>
10731 Add support for -pie.
10732 * options.h (class General_options): Add -pie and
10734 (General_options::output_is_position_independent): Test -pie.
10735 (General_options::output_is_executable): Return true if not shared
10736 and not relocatable.
10737 (General_options::output_is_pie): Remove.
10738 * options.cc (General_options::finalize): Reject incompatible uses
10740 * gold.cc (queue_middle_tasks): A -pie link is not static.
10741 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
10742 * symtab.cc (Symbol::final_value_is_known): Return false if
10743 output_is_position_independent.
10744 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
10745 output_is_position_independent.
10746 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
10747 output_is_position_independent.
10748 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
10749 output_is_position_independent.
10750 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
10752 (basic_pie_test.o, basic_pie_test): New targets.
10753 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
10754 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
10755 (two_file_pie_test): New target.
10756 * testsuite/Makefile.in: Rebuild.
10757 * README: Remove note saying that -pie is not supported.
10759 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
10761 * options.h (class General_options): Add -init and -fini.
10762 * layout.cc (Layout::finish_dynamic_section): Emit
10763 given init and fini functions.
10765 2009-10-13 Sriraman Tallam <tmsriram@google.com>
10767 * gc.h (gc_process_relocs): Check if icf is enabled using new
10769 * gold.cc (queue_initial_tasks): Likewise.
10770 (queue_middle_tasks): Likewise.
10771 * object.cc (do_layout): Likewise.
10772 * symtab.cc (is_section_folded): Likewise.
10773 * main.cc (main): Likewise.
10774 * reloc.cc (Read_relocs::run): Likewise.
10775 (Sized_relobj::do_scan_relocs): Likewise.
10776 * icf.cc (is_function_ctor_or_dtor): New function.
10777 (Icf::find_identical_sections): Check if function is ctor or dtor when
10778 safe icf is chosen.
10779 * options.h (General_options::icf): Change option to be an enum.
10780 (Icf_status): New enum.
10781 (icf_enabled): New method.
10782 (icf_safe_folding): New method.
10783 (set_icf_status): New method.
10784 (icf_status_): New variable.
10785 * (options.cc) (General_options::finalize): Set icf_status_.
10786 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
10787 icf_test and icf_keep_unique_test to use the --icf enum flag.
10788 * testsuite/icf_safe_test.sh: New file.
10789 * testsuite/icf_safe_test.cc: New file.
10791 2009-10-12 Sriraman Tallam <tmsriram@google.com>
10793 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
10794 includes to gc.h and icf.h.
10795 * arm.cc: Include gc.h.
10796 * gold.cc: Likewise.
10797 * i386.cc: Likewise.
10798 * powerpc.cc: Likewise.
10799 * sparc.cc: Likewise.
10800 * x86_64.cc: Likewise.
10801 * gc.h: Include icf.h.
10803 2009-10-11 Ian Lance Taylor <iant@google.com>
10805 * plugin.cc: Include "gold.h" before other header files.
10807 2009-10-10 Chris Demetriou <cgd@google.com>
10809 * options.h (Input_file_argument::Input_file_type): New enum.
10810 (Input_file_argument::is_lib_): Replace with...
10811 (Input_file_argument::type_): New member.
10812 (Input_file_argument::Input_file_argument): Take Input_file_type
10813 'type' rather than boolean 'is_lib' as second argument.
10814 (Input_file_argument::is_lib): Use type_.
10815 (Input_file_argument::is_searched_file): New function.
10816 (Input_file_argument::may_need_search): Handle is_searched_file.
10817 * options.cc (General_options::parse_library): Support -l:filename.
10818 (General_options::parse_just_symbols): Update for Input_file_argument
10820 (Command_line::process): Likewise.
10821 * archive.cc (Archive::get_file_and_offset): Likewise.
10822 * plugin.cc (Plugin_manager::release_input_file): Likewise.
10823 * script.cc (read_script_file, script_add_file): Likewise.
10824 * fileread.cc (Input_file::Input_file): Likewise.
10825 (Input_file::will_search_for): Handle is_searched_file.
10826 (Input_file::open): Likewise.
10827 * readsyms.cc (Read_symbols::get_name): Likewise.
10828 * testsuite/Makefile.am (searched_file_test): New test.
10829 * testsuite/Makefile.in: Regenerate.
10830 * testsuite/searched_file_test.cc: New file.
10831 * testsuite/searched_file_test_lib.cc: New file.
10833 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10834 Ian Lance Taylor <iant@google.com>
10836 * descriptor.cc: Include <cstdio> and "binary-io.h".
10837 (Descriptors::open): Open the files in binary mode always.
10838 * script.cc (Lex::get_token): Treat \r as whitespace.
10840 2009-10-09 Ian Lance Taylor <iant@google.com>
10842 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
10844 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10845 Ian Lance Taylor <iant@google.com>
10847 * configure.ac: Check for readv function also.
10848 * fileread.cc (readv): Define if not HAVE_READV.
10849 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
10851 * config.in: Regenerate.
10852 * configure: Regenerate.
10854 2009-10-09 Doug Kwan <dougkwan@google.com>
10856 * layout.cc (Layout::make_output_section): Call target hook to make
10857 ordinary output section.
10858 (Layout::finalize): Adjust parameter list of call the
10859 Target::may_relax().
10860 * layout.h (class Layout::section_list): New method.
10861 * merge.h (Output_merge_base::entsize): Change visibility to public.
10862 (Output_merge_base::is_string, Output_merge_base::do_is_string):
10864 (Output_merge_string::do_is_string): New method.
10865 * object.cc (Sized_relobj::do_setup): renamed from
10866 Sized_relobj::set_up.
10867 * object.h (Sized_relobj::adjust_shndx,
10868 Sized_relobj::initializ_input_to_output_maps,
10869 Sized_relobj::free_input_to_output_maps): Change visibilities to
10871 (Sized_relobj::setup): Virtualize.
10872 (Sized_relobj::do_setup): New method declaration.
10873 (Sized_relobj::invalidate_section_offset,
10874 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
10875 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
10876 * options.cc (parse_int): New function.
10877 * options.h (parse_int): New declaration.
10878 (DEFINE_int): New macro.
10879 (stub_group_size): New option.
10880 * output.cc (Output_section::Output_section): Initialize memebers
10881 merge_section_map_, merge_section_by_properties_map_,
10882 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
10883 (Output_section::add_input_section): Handled deferred code-fill
10884 generation and remove an old comment.
10885 (Output_section::add_relaxed_input_section): New method definition.
10886 (Output_section::add_merge_input_section): Use merge section by
10887 properties map to speed to search. Update merge section maps
10889 (Output_section::build_relaxation_map): New method definition.
10890 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
10892 (Output_section::relax_input_section): Renamed to
10893 Output_section::convert_input_sections_to_relaxed_sections and change
10894 interface to take a vector of pointers to relaxed sections.
10895 (Output_section::find_merge_section,
10896 Output_section::find_relaxed_input_section): New method definitions.
10897 (Output_section::is_input_address_mapped,
10898 Output_section::output_offset, Output_section::output_address):
10899 Use output section data maps to speed up searching.
10900 (Output_section::find_starting_output_address): Add comments.
10901 (Output_section::do_write,
10902 Output_section::write_to_postprocessing_buffer): Do code-fill
10903 generation as appropriate.
10904 (Output_section::get_input_sections): Invalidate relaxed input section
10906 (Output_section::restore_states): Adjust type of checkpoint .
10907 Invalidate relaxed input section map.
10908 * output.h (Output_merge_base): New class declaration.
10909 (Input_section_specifier): New class defintion.
10910 (class Output_relaxed_input_section) Change base class to
10911 Output_section_data_build.
10912 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
10913 base class initializer.
10914 (Output_section::add_relaxed_input_section): New method declaration.
10915 (Output_section::Input_section): Change visibility to protected.
10916 (Output_section::Input_section::relobj,
10917 Output_section::Input_section::shndx): Handle relaxed input sections.
10918 Output_section::input_sections) Change visibility to protected. Also
10919 define overload to return a non-const pointer.
10920 (Output_section::Merge_section_properties): New class defintion.
10921 (Output_section::Merge_section_by_properties_map,
10922 Output_section::Output_section_data_by_input_section_map,
10923 Output_section::Relaxation_map): New types.
10924 (Output_section::relax_input_section): Rename method to
10925 Output_section::convert_input_sections_to_relaxed_sections and change
10926 interface to take a vector of relaxed section pointers.
10927 (Output_section::find_merge_section,
10928 Output_section::find_relaxed_input_section,
10929 Output_section::build_relaxation_map,
10930 Output_section::convert_input_sections_in_list_to_relaxed_sections):
10931 New method declarations.
10932 (Output_section::merge_section_map_
10933 Output_section::merge_section_by_properties_map_,
10934 Output_section::relaxed_input_section_map_,
10935 Output_section::is_relaxed_input_section_map_valid_,
10936 Output_section::generate_code_fills_at_write_): New data members.
10937 * script-sections.cc
10938 (Output_section_element_input::set_section_addresses): Call
10939 current_data_size and addralign methods of relaxed input sections.
10940 (Orphan_output_section::set_section_addresses): Call current_data_size
10941 and addralign methods of relaxed input sections.
10942 * symtab.cc (Symbol_table::compute_final_value): Extract template
10943 from the body of Symbol_table::sized_finalize_symbol.
10944 (Symbol_table::sized_finalized_symbol): Call
10945 Symbol_table::compute_final_value.
10946 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
10947 (Symbol_table::compute_final_value): New templated method declaration.
10948 * target.cc (Target::do_make_output_section): New method defintion.
10949 * target.h (Target::make_output_section): New method declaration.
10950 (Target::relax): Add more parameters for input objects, symbol table
10951 and layout. Adjust call to do_relax.
10952 (Target::do_make_output_section): New method declaration.
10953 (Target::do_relax): Add parameters for input objects, symbol table
10956 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10958 * pread.c: Include stdio.h.
10960 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10962 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
10965 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10967 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
10968 Change read_shndx type to unsigned int.
10969 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10971 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10972 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
10973 Change read_shndx type to unsigned int.
10974 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10976 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10977 * layout.cc (Layout::create_symtab_sections): Cast the result of
10978 local_symcount * symsize to off_t in the gold_assert.
10980 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10982 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
10983 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
10985 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
10986 (Arm_relocate_functions::thm_abs5): New function.
10987 (Arm_relocate_functions::abs12): New function.
10988 (Arm_relocate_functions::abs16): New function.
10989 (Arm_relocate_functions::base_abs): New function.
10990 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
10991 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
10992 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
10994 (Scan::global): Likewise.
10995 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
10996 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
10997 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
10998 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11001 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11003 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11004 (Arm_relocate_functions::movt_prel): New function.
11005 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11006 (Arm_relocate_functions::thm_movt_prel): New function.
11007 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11008 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11009 (Scan::global, Relocate::relocate): Likewise.
11010 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11012 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11014 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11015 Incremental_checker.
11016 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11018 (class Incremental_inputs_header): New class.
11019 (Incremental_inputs_header_writer): Edit comment.
11020 (Incremental_inputs_entry): New class.
11021 (Incremental_inputs_entry_writer): Edit comment.
11022 (Sized_incremental_binary::do_find_incremental_inputs_section):
11023 Add *strtab_shndx parameter, fill it.
11024 (Sized_incremental_binary::do_check_inputs): New method.
11025 (Incremental_checker::can_incrementally_link_output_file): Use
11026 Sized_incremental_binary::check_inputs.
11027 (Incremental_inputs::report_command_line): Save command line in
11030 (Incremental_binary::find_incremental_inputs_section): New
11032 (Incremental_binary::do_find_incremental_inputs_section): Add
11033 strtab_shndx parameter.
11034 (Incremental_binary::do_check_inputs): New pure virtual method.
11035 (Sized_incremental_binary::do_check_inputs): Declare.
11036 (Incremental_checker::Incremental_checker): Add incremental_inputs
11037 parameter, use it to initialize incremental_inputs_.
11038 (Incremental_checker::incremental_inputs_): New field.
11039 (Incremental_checker::command_line): New method.
11040 (Incremental_checker::inputs): New method.
11041 (Incremental_checker::command_line_): New field.
11043 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11045 * incremental.cc: Include <cstdarg> and "target-select.h".
11046 (vexplain_no_incremental): New function.
11047 (explain_no_incremental): New function.
11048 (Incremental_binary::error): New method.
11049 (Sized_incremental_binary::do_find_incremental_inputs_section): New
11051 (make_sized_incremental_binary): New function.
11052 (open_incremental_binary): New function.
11053 (can_incrementally_link_file): Add checks if output is ELF and has
11055 * incremental.h: Include "elfcpp_file.h" and "output.h".
11056 (Incremental_binary): New class.
11057 (Sized_incremental_binary): New class.
11058 (open_incremental_binary): Declare.
11059 * object.cc (is_elf_object): Use
11060 elfcpp::Elf_recognizer::is_elf_file.
11061 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
11062 * output.h (Output_file::filesize): New method.
11064 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11066 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
11068 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
11069 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
11071 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
11073 (Arm_relocate_functions::movw_abs_nc): New function.
11074 (Arm_relocate_functions::movt_abs): New function.
11075 (Arm_relocate_functions::thm_movw_abs_nc): New function.
11076 (Arm_relocate_functions::thm_movt_abs): New function.
11077 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
11078 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
11079 (Scan::global): Likewise.
11080 (Relocate::relocate): Likewise.
11081 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11083 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11085 * arm.cc (Arm_relocate_functions::got_prel) New function.
11086 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
11087 (Relocate::relocate): Likewise.
11088 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11090 2009-10-06 Ian Lance Taylor <iant@google.com>
11092 * options.h (class General_options): Define
11093 split_stack_adjust_size parameter.
11094 * object.h (class Object): Add uses_split_stack_ and
11095 has_no_split_stack_ fields. Add uses_split_stack and
11096 has_no_split_stack accessor functions. Declare
11097 handle_split_stack_section.
11098 (class Reloc_symbol_changes): Define.
11099 (class Sized_relobj): Define Function_offsets. Declare
11100 split_stack_adjust, split_stack_adjust_reltype, and
11102 * object.cc (Object::handle_split_stack_section): New function.
11103 (Sized_relobj::do_layout): Call handle_split_stack_section.
11104 * dynobj.cc (Sized_dynobj::do_layout): Call
11105 handle_split_stack_section.
11106 * reloc.cc (Sized_relobj::relocate_sections): Call
11107 split_stack_adjust for executable sections in split_stack
11108 objects. Pass reloc_map to relocate_section.
11109 (Sized_relobj::split_stack_adjust): New function.
11110 (Sized_relobj::split_stack_adjust_reltype): New function.
11111 (Sized_relobj::find_functions): New function.
11112 * target-reloc.h: Include "object.h".
11113 (relocate_section): Add reloc_symbol_changes parameter. Change
11115 * target.h (class Target): Add calls_non_split method. Declare
11116 do_calls_non_split virtual method. Declare match_view and
11118 * target.cc: Include "elfcpp.h".
11119 (Target::do_calls_non_split): New function.
11120 (Target::match_view): New function.
11121 (Target::set_view_to_nop): New function.
11122 * gold.cc (queue_middle_tasks): Give an error if mixing
11123 split-stack and non-split-stack objects with -r.
11124 * i386.cc (Target_i386::relocate_section): Add
11125 reloc_symbol_changes parameter.
11126 (Target_i386::do_calls_non_split): New function.
11127 * x86_64.cc (Target_x86_64::relocate_section): Add
11128 reloc_symbol_changes parameter.
11129 (Target_x86_64::do_calls_non_split): New function.
11130 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
11132 * powerpc.cc (Target_powerpc::relocate_section): Add
11133 reloc_symbol_changes parameter.
11134 * sparc.cc (Target_sparc::relocate_section): Add
11135 reloc_symbol_changes parameter.
11136 * configure.ac: Call AM_CONDITIONAL for the default target.
11137 * configure: Rebuild.
11138 * testsuite/Makefile.am (TEST_AS): New variable.
11139 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
11140 (check_DATA): Add split_i386 and split_x86_64 files.
11141 (SPLIT_DEFSYMS): Define.
11142 (split_i386_[1234n].o): New targets.
11143 (split_i386_[124]): New targets.
11144 (split_i386_[1234r].stdout): New targets.
11145 (split_x86_64_[1234n].o): New targets.
11146 (split_x86_64_[124]): New targets.
11147 (split_x86_64_[1234r].stdout): New targets.
11148 (MOSTLYCLEANFILES): Add new executables.
11149 * testsuite/split_i386.sh: New file.
11150 * testsuite/split_x86_64.sh: New file.
11151 * testsuite/split_i386_1.s: New file.
11152 * testsuite/split_i386_2.s: New file.
11153 * testsuite/split_i386_3.s: New file.
11154 * testsuite/split_i386_4.s: New file.
11155 * testsuite/split_i386_n.s: New file.
11156 * testsuite/split_x86_64_1.s: New file.
11157 * testsuite/split_x86_64_2.s: New file.
11158 * testsuite/split_x86_64_3.s: New file.
11159 * testsuite/split_x86_64_4.s: New file.
11160 * testsuite/split_x86_64_n.s: New file.
11161 * testsuite/testfile.cc (Target_test): Update relocation_section
11163 * testsuite/Makefile.in: Rebuild.
11165 2009-10-06 Ian Lance Taylor <iant@google.com>
11167 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
11168 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
11169 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
11170 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
11171 the address on ldo_addrs_.
11172 (Target_i386::Relocate::fix_up_ldo): New function.
11174 2009-10-06 Rafael Espindola <espindola@google.com>
11176 * plugin.cc (add_input_library): New.
11177 (Plugin::load): Add add_input_library to tv.
11178 (Plugin_manager::add_input_file): Add the is_lib argument.
11179 (add_input_file): Update call to Plugin_manager::add_input_file.
11180 (add_input_library): New.
11181 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
11183 2009-09-30 Doug Kwan <dougkwan@google.com>
11185 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
11186 symbol and call Symbol::may_need_copy_reloc to determine if
11187 a copy reloc is needed.
11188 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
11189 nocopyreloc is given in command line.
11190 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
11191 given in command line.
11192 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
11193 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
11194 of the removed Target_i386::may_need_copy_reloc.
11195 * options.h (copyreloc): New option with default value false.
11196 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11197 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
11198 instead of the removed Target_powerpc::may_need_copy_reloc.
11199 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11200 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
11201 instead of the removed Target_sparc::may_need_copy_reloc.
11202 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
11203 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
11204 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
11205 instead of the removed Target_x86_64::may_need_copy_reloc.
11207 2009-09-30 Ian Lance Taylor <iant@google.com>
11209 * object.h (class Object): Remove target_ field, and target,
11210 sized_target, and set_target methods.
11211 (Object::sized_target): Remove.
11212 (class Sized_relobj): Update declarations. Remove sized_target.
11213 * object.cc (Sized_relobj::setup): Remove target parameter.
11214 Change all callers.
11215 (Input_objects::add_object): Don't do anything with the target.
11216 (make_elf_sized_object): Add punconfigured parameter. Change all
11217 callers. Set or test parameter target.
11218 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
11219 Change all callers.
11220 * parameters.cc (Parameters::set_target): Change parameter type to
11222 (Parameters::default_target): Remove.
11223 (set_parameters_target): Change parameter type to be non-const.
11224 (parameters_force_valid_target): New function.
11225 (parameters_clear_target): New function.
11226 * parameters.h (class Parameters): Update declarations. Remove
11227 default_target method. Add sized_target and clear_target
11228 methods. Change target_ to be non-const.
11229 (set_parameters_target): Update declaration.
11230 (parameters_force_valid_target): Declare.
11231 (parameters_clear_target): Declare.
11232 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
11233 as NULL if we aren't searching.
11234 (Add_symbols::run): Don't check for compatible target.
11235 * fileread.cc (Input_file::open_binary): Call
11236 parameters_force_valid_target.
11237 * gold.cc (queue_middle_tasks): Likewise.
11238 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
11239 set_target on object.
11240 * dynobj.h (class Sized_dynobj): Update declarations.
11241 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
11242 make_elf_object returns NULL.
11243 (Archive::include_member): Don't check whether object target is
11245 * output.cc (Output_section::add_input_section): Get target from
11247 (Output_section::relax_input_section): Likewise.
11248 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
11250 (Sized_relobj::do_scan_relocs): Likewise.
11251 (Sized_relobj::relocate_sections): Likewise.
11252 * resolve.cc (Symbol_table::resolve): Likewise.
11253 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
11254 parameter. Change all callers.
11255 (Symbol_table::add_from_object): Get target from parameters.
11256 (Symbol_table::add_from_relobj): Don't check object target.
11257 (Symbol_table::add_from_dynobj): Likewise.
11258 (Symbol_table::define_special_symbol): Get target from
11260 * symtab.h (class Symbol_table): Update declaration.
11261 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
11262 parameter. Change all callers. Clear parameter target.
11263 (Binary_test): Test target here.
11264 * testsuite/object_unittest.cc (gold_testsuite): Remove
11265 target_test_pointer parameter. Change all callers.
11266 (Object_test): Test target here.
11268 2009-09-26 Ian Lance Taylor <iant@google.com>
11270 * testsuite/initpri1.c: Don't try to use constructor priorities if
11271 compiling with gcc before 4.3.
11273 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
11275 * testsuite/retain_symbols_file_test.sh (check_present): Change
11276 output file name to retain_symbols_file_test.stdout.
11277 (check_absent): Likewise.
11279 2009-09-18 Craig Silverstein <csilvers@google.com>
11281 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
11282 * options.cc: Include <cerrno> and <fstream>.
11283 (General_options::finalize): Parse -retain-symbols-file tag.
11284 * options.h: New flag.
11285 (General_options): New method should_retain_symbol, new
11286 variable symbols_to_retain.
11287 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
11288 should_retain_symbol map.
11289 * testsuite/Makefile.am (retain_symbols_file_test): New test.
11290 * testsuite/Makefile.in: Regenerate.
11291 * testsuite/retain_symbols_file_test.sh: New file.
11293 2009-09-18 Nick Clifton <nickc@redhat.com>
11295 * po/es.po: Updated Spanish translation.
11297 2009-09-17 Doug Kwan <dougkwan@google.com>
11299 * debug.h (DEBUG_RELAXATION): New constant.
11300 (DEBUG_ALL): Add DEBUG_RELAXATION.
11301 (debug_string_to_enum): Add relaxation debug option.
11303 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
11304 Layout::Relaxation_debug_check::read_sections,
11305 Layout::Relaxation_debug_check::read_sections): New method definitions.
11306 (Layout::Layout): Initialize data members
11307 record_output_section_data_from_scrips_,
11308 script_output_section_data_list_ and relaxation_debug_check_.
11309 (Layout::save_segments, Layout::restore_segments,
11310 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11311 Layout::relaxation_loop_body): New method definitions.
11312 (Layout::finalize): Support relaxation. Move section layout code to
11313 Layout::relaxation_loop_body.
11314 (Layout::set_asection_address_from_script): Move code for orphan
11315 section placement out.
11316 (Layout::place_orphan_sections_in_script): New method definition.
11317 * layout.h (Output_segment_headers, Output_file_header):
11318 New forward class declarations.
11319 (Layout::~Layout): Define.
11320 (Layout::new_output_section_data_from_script): New method definition.
11321 (Layout::place_orphan_sections_in_script): New method declaration.
11322 (Layout::Segment_states): New type declaration.
11323 (Layout::save_segments, Layout::restore_segments,
11324 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11325 Layout::relaxation_loop_body): New method declarations.
11326 (Layout::Output_section_data_list): New type declaration.
11327 (Layout::Relaxation_debug_check): New class definition.
11328 (Layout::record_output_section_data_from_script_,
11329 Layout::script_output_section_data_list_, Layout::segment_states_,
11330 Layout::relaxation_debug_check_): New data members.
11331 * output.cc: (Output_section_headers::do_size): New method definition.
11332 (Output_section_headers::Output_section_headers): Move size
11333 computation to Output_section_headers::do_size.
11334 (Output_segment_headers::do_size): New method definition.
11335 (Output_file_header::Output_file_header): Move size computation to
11336 Output_file_header::do_size and call it.
11337 (Output_file_header::do_size): New method definition.
11338 (Output_data_group::Output_data_group): Adjust call to
11339 Output_section_data.
11340 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
11341 (Output_symtab_xindex::do_write): Add array bound check.
11342 (Output_section::Input_section::print_to_mapfile): Handle
11343 RELAXED_INPUT_SECTION_CODE.
11344 (Output_section::Output_section): Initialize data member checkpoint_.
11345 (Output_section::~Output_section): Delete checkpoint object pointed
11347 (Output_section::add_input_section): Always add an Input_section if
11349 (Output_section::add_merge_input_section): Add assert.
11350 (Output_section::relax_input_section): New method definition.
11351 (Output_section::set_final_data_size): Set load address to zero for
11352 an unallocated section.
11353 (Output_section::do_address_and_file_offset_have_reset_values):
11354 New method definition.
11355 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
11356 Handle relaxed input section.
11357 (Output_section::sort_attached_input_sections): Checkpoint input
11358 section list lazily.
11359 (Output_section::get_input_sections): Change type of input_sections to
11360 list of Simple_input_section pointers. Checkpoint input section list
11361 lazily. Also handle relaxed input sections.
11362 (Output_section::add_input_section_for_script): Take a reference to
11363 a Simple_input_section object instead of Relobj pointer and section
11364 index as parameter. Handle relaxed input sections.
11365 (Output_section::save_states, Output_section::restore_states): New
11366 method definitions.
11367 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
11368 (Output_data::is_data_size_fixed): New method definition.
11369 (Output_data::reset_addresss_and_file_offset): Do not reset data size
11371 (Output_data::address_and_file_offset_have_reset_values): New method
11373 (Output_data::do_address_and_file_offset_have_reset_values): New method
11375 (Output_data::set_data_size): Check that data size is not fixed.
11376 (Output_data::fix_data_size): New method definition.
11377 (Output_data::is_data_size_fixed_): New data member.
11378 (Output_section_headers::set_final_data_size): New method definition.
11379 (Output_section_headers::do_size): New method declaration.
11380 (Output_segment_headers::set_final_data_size): New method definition.
11381 (Output_segment_headers::do_size): New method declaration.
11382 (Output_file_header::set_final_data_size)::New method definition.
11383 (Output_file_header::do_size)::New method declaration.
11384 (Output_section_data::Output_section_data): Add new parameter
11385 is_data_size_fixed and use it to fix data size.
11386 (Output_data_const::Output_data_const): Adjust call to base class
11387 constructor and fix data size.
11388 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
11389 base class constructor and fix data size.
11390 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
11391 base class constructor and fix data size.
11392 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
11393 class constructor and fix data size.
11394 (Output_data_group::set_final_data_size): New method definition.
11395 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
11396 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
11397 class constructor and fix data size.
11398 (Output_relaxed_input_section): New class definition.
11399 (Output_section::Simple_input_section): New class definition.
11400 (Output_section::get_input_sections): Adjust parameter list.
11401 (Output_section::add_input_section_for_script): Same.
11402 (Output_section::save_states, Output_section::restore_states,
11403 Output_section::do_address_and_file_offset_have_reset_values,
11404 (Output_section::Input_section::Input_section): Handle
11405 RELAXED_INPUT_SECTION_CODE. Add new overload for
11406 Output_relaxed_input_section.
11407 (Output_section::Input_section::is_input_section,
11408 Output_section::Input_section::set_output_section): Handle relaxed
11410 (Output_section::Input_section::is_relaxed_input_section,
11411 Output_section::Input_section::output_section_data,
11412 Output_section::Input_section::relaxed_input_section): New method
11414 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
11416 (Output_section::Input_section::u1_): Update comments.
11417 (Output_section::Input_section::u2_): Add new union member poris.
11418 (Output_section::Checkpoint_output_section): New classs definition.
11419 (Output_section::relax_input_section): New method declaration.
11420 (Output_section::checkpoint_): New data member.
11421 (Output_segment): Update comments.
11422 (Output_segment::Output_segment): Un-privatize copy constructor.
11423 (Output_segment::operator=): Un-privatize.
11424 * script-sections.cc (Output_section_element::Input_section_list):
11425 Change element type to Output_section::Simple_input_section.
11426 (Output_section_element_dot_assignment::set_section_addresses):
11427 Register output section data for relaxation clean up.
11428 (Output_data_exression::Output_data_expression): Adjust call to base
11429 constructor to fix data size.
11430 (Output_section_element_data::set_section_addresses): Register
11431 Output_data_expression object for relaxation clean up.
11432 (struct Input_section_info): Replace Relobj pointer and section index
11433 pair with Output_section::Simple_input_section and Convert struct to a
11435 (Input_section_sorter::operator()): Adjust access to
11436 Input_section_info data member to use accessors.
11437 (Output_section_element_input::set_section_addresses): Use layout
11438 parameter. Adjust code to use Output_section::Simple_input_section
11439 and Input_secction_info classes. Register filler for relaxation
11441 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
11442 and section index pair with Output_section::Simple_input_section
11443 class. Adjust code accordingly.
11444 (Phdrs_element::release_segment): New method definition.
11445 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
11447 (Script_sections::release_segments): New method definition.
11448 * gold/script-sections.h (Script_sections::release_segments): New
11449 method declaration.
11450 * gold/target.h (Target::may_relax, Target::relax,
11451 Target::do_may_relax, Target::do_relax): New method definitions.
11453 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11455 * arm.cc (has_signed_unsigned_overflow): New function.
11456 (Arm_relocate_functions::abs8): New function.
11457 (Target_arm::Scan::local): Handle R_ARM_ABS8.
11458 (Target_arm::Scan::global): Likewise.
11459 (Target_arm::relocate::relocate): Likewise.
11460 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11463 2009-09-16 Cary Coutant <ccoutant@google.com>
11465 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
11466 * testsuite/Makefile.in: Regenerate.
11468 2009-09-11 Nick Clifton <nickc@redhat.com>
11470 * po/gold.pot: Updated by the Translation project.
11472 2009-09-08 Cary Coutant <ccoutant@google.com>
11474 * output.cc (Output_file::open): Add execute permission to empty file.
11475 * testsuite/Makefile.am (permission_test): New test.
11476 * testsuite/Makefile.in: Regenerate.
11478 2009-09-02 Ian Lance Taylor <iant@google.com>
11480 * output.cc (Output_file::resize): Call map_no_anonymous rather
11483 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
11485 * gold.cc: Include "incremental.h".
11486 (queue_initial_tasks): Call Incremental_checker methods.
11487 * incremental.cc: Include "output.h".
11488 (Incremental_checker::can_incrementally_link_output_file): New
11490 * incremental.h (Incremental_checker): New class.
11492 * output.cc (Output_file::open_for_modification): New method.
11493 (Output_file::map_anonymous): Changed return type to bool. Record
11494 map in base_ field.
11495 (Output_file::map_no_anonymous): New method, broken out of map.
11496 (Output_file::map): Use map_no_anonymous and map_anonymous.
11497 * output.h (class Output_file): Update declarations.
11499 2009-08-24 Cary Coutant <ccoutant@google.com>
11501 * options.h (Command_line::Pre_options): New class.
11502 (Command_line::pre_options): New member.
11503 * options.cc (gold::options::ready_to_register): New variable.
11504 (One_option::register_option): Do nothing if not registering options.
11505 Assert if same short option registered twice.
11506 (General_options::General_options): Turn off option registration when
11508 (Command_line::Pre_options::Pre_options): New constructor.
11510 2009-08-24 Cary Coutant <ccoutant@google.com>
11512 * options.h (General_options::no_keep_memory): Remove incorrect
11515 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11517 * Makefile.am (am__skiplex, am__skipyacc): New.
11518 * Makefile.in: Regenerate.
11520 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11522 * Makefile.am (AM_CPPFLAGS): Renamed from ...
11523 (INCLUDES): ... this.
11524 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
11525 (AM_CPPFLAGS): Renamed from ...
11526 (INCLUDE): ... this.
11527 * Makefile.in, testsuite/Makefile.in: Regenerate.
11529 * Makefile.in: Regenerate.
11530 * aclocal.m4: Likewise.
11531 * config.in: Likewise.
11532 * configure: Likewise.
11533 * testsuite/Makefile.in: Likewise.
11535 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11536 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11537 * Makefile.in: Regenerate.
11538 * testsuite/Makefile.in: Regenerate.
11540 2009-08-19 Cary Coutant <ccoutant@google.com>
11542 * resolve.cc (Symbol_table::resolve): Don't complain about defined
11543 symbols in shared libraries overridden by hidden or internal symbols
11544 in the main program.
11546 2009-08-19 Chris Demetriou <cgd@google.com>
11548 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
11549 checking source file names in error messages.
11551 2009-08-18 Doug Kwan <dougkwan@google.com>
11553 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
11554 an elcpp::Ehdr as parameter. Adjust call to set_target.
11555 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
11556 an elfcpp::Ehdr as parameter.
11557 * object.cc (Object::set_target): Remove the version that looks up
11558 a target and sets it.
11559 (Sized_relobj::setup): Take a Target object instead of
11560 an elfcpp::Ehdr as parameter. Adjust call to set_target.
11561 (make_elf_sized_object): Find target and ask target to
11562 make an ELF object.
11563 * object.h: (Object::set_target): Remove the version that looks up
11564 a target and sets it.
11565 (Sized_relobj::setup): Take a Target object instead of
11566 an elfcpp:Ehdr as parameter.
11567 * target.cc: Include dynobj.h.
11568 (Target::do_make_elf_object_implementation): New.
11569 (Target::do_make_elf_object): New.
11570 * target.h (Target::make_elf_object): New template declaration.
11571 (Target::do_make_elf_object): New method declarations.
11572 (Target::do_make_elf_object_implementation): New template declaration.
11574 2009-08-14 Ian Lance Taylor <iant@google.com>
11576 * gold.h (FUNCTION_NAME): Define.
11577 (gold_unreachable): Use FUNCTION_NAME.
11579 2009-08-12 Sriraman Tallam <tmsriram@google.com>
11581 * icf.cc (Icf::find_identical_sections): Issue a warning when a
11582 symbol in the --keep-unique list is not found.
11584 2009-08-12 Sriraman Tallam <tmsriram@google.com>
11586 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
11587 been maked as --keep-unique.
11588 (Icf::unfold_section): New function.
11589 * icf.h (Icf::unfold_section): New function.
11590 * options.h (General_options::keep_unique): New option.
11591 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
11592 * testsuite/Makefile.in: Regenerate.
11593 * testsuite/icf_keep_unique_test.sh: New file.
11594 * testsuite/icf_keep_unique_test.cc: New file.
11596 2009-08-12 Cary Coutant <ccoutant@google.com>
11599 * resolve.cc (Symbol_table::resolve): Check for references from
11600 dynamic objects to hidden and internal symbols.
11601 * testsuite/Makefile.am (hidden_test.sh): New test.
11602 * testsuite/Makefile.in: Regenerate.
11603 * testsuite/hidden_test.sh: New script.
11604 * testsuite/hidden_test_1.c: New test source.
11605 * testsuite/hidden_test_main.c: New test source.
11607 2009-08-11 Doug Kwan <dougkwan@google.com>
11609 * arm.cc: Update comments.
11610 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
11611 segment to locate the .ARM.exidx section if present.
11613 2009-08-09 Doug Kwan <dougkwan@google.com>
11615 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
11618 2009-08-07 Sriraman Tallam <tmsriram@google.com>
11619 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
11622 2009-08-06 Sriraman Tallam <tmsriram@google.com>
11624 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
11625 valid tls_segment only for non-debug-section relocations.
11626 * testsuite/Makefile.am: Add gc_tls_test.
11627 * testsuite/Makefile.in: Regenerate.
11628 * testsuite/gc_tls_test.cc: New file.
11629 * testsuite/gc_tls_test.sh: New file.
11631 2009-08-05 Sriraman Tallam <tmsriram@google.com>
11633 * icf.cc: New file.
11635 * Makefile.am (CCFILES): Add icf.cc.
11636 (HFILES): Add icf.h
11637 * Makefile.in: Regenerate.
11638 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
11639 * gc.h (gc_process_relocs): Populate lists used by icf to contain
11640 section, symbol and addend information for the relocs.
11641 * gold.cc (queue_middle_tasks): Call identical code folding.
11642 * gold.h: Add defines for multimap.
11643 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
11644 to the call of finalize_local_symbols.
11645 * main.cc (main): Create object of class Icf.
11646 * object.cc (Sized_relobj::do_layout): Allow this function to be
11647 called twice during icf.
11648 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
11649 to sections marked as identical by icf.
11650 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
11652 (Sized_relobj::do_section_entsize): New function.
11653 * object.h (Object::section_entsize): New function.
11654 (Object::do_section_entsize): New pure virtual function.
11655 (Relobj::finalize_local_symbols): Add new parameter.
11656 (Relobj::do_section_entsize): New function.
11657 * options.h (General_options::icf): New option.
11658 (General_options::icf_iterations): New option.
11659 (General_options::print_icf_sections): New option.
11660 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
11661 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
11662 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
11664 * symtab.cc (Symbol_table::is_section_folded): New function.
11665 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
11666 to sections marked as identical by icf.
11667 * symtab.h (Symbol_table::set_icf): New function.
11668 (Symbol_table::icf): New function.
11669 (Symbol_table::is_section_folded): New function.
11670 (Symbol_table::icf_): New data member.
11671 * target-reloc.h (relocate_section): Ignore sections folded by icf.
11672 * testsuite/Makefile.am: Add commands to build icf_test.
11673 * testsuite/Makefile.in: Regenerate.
11674 * testsuite/icf_test.sh: New file.
11675 * testsuite/icf_test.cc: New file.
11677 2009-07-24 Chris Demetriou <cgd@google.com>
11679 * layout.cc (is_compressible_debug_section): Fix incorrect
11680 comment about compressed section names.
11682 2009-07-20 Ian Lance Taylor <ian@airs.com>
11685 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
11687 2009-07-16 Ian Lance Taylor <iant@google.com>
11690 * layout.h: #include <map>.
11691 (class Kept_section): Change from struct to class. Add accessors
11692 and setters. Add section size to Comdat_group mapping. Change
11693 Comdat_group to std::map. Add is_comdat_ field. Add
11694 linkonce_size field in union.
11695 (class Layout): Update declaration of find_or_add_kept_section.
11696 Don't declare find_kept_object.
11697 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
11698 parameter. Add object, shndx, is_comdat, and is_group_name
11699 parameters. Change all callers. Adjust for new Kept_section.
11700 (Layout::find_kept_object): Remove.
11701 * object.cc (Sized_relobj::include_section_group): Update use of
11702 Kept_section. Rename secnum to shndx. Only record
11703 Kept_comdat_section if sections are the same size.
11704 (Sized_relobj::include_linkonce_section): Update use of
11705 Kept_section. Only record Kept_comdat_section if sections are the
11706 same size. Set size of linkonce section.
11707 (Sized_relobj::map_to_kept_section): Update call to
11708 get_kept_comdat_section.
11709 * object.h (class Sized_relobj): Rename fields in
11710 Kept_comdat_section to drop trailing underscores; change object
11711 field to Relobj*. Change Kept_comdat_section_table to store
11712 struct rather than pointer.
11713 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
11714 Add kept_object and kept_shndx parameters. Change all callers.
11715 (Sized_relobj::get_kept_comdat_section): Change return type to
11716 bool. Add kept_object and kept_shndx parameters. Change all
11718 * plugin.cc (Pluginobj::include_comdat_group): Update call to
11719 Layout::find_or_add_kept_section.
11721 2009-07-09 Ian Lance Taylor <iant@google.com>
11723 * merge.cc (Object_merge_map::initialize_input_to_output_map):
11724 Reserve space in the hash table.
11726 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
11728 * fileread.cc (File_read::get_mtime): New method.
11729 * fileread.h (Timespec): New structure.
11730 (File_read::get_mtime): New method.
11731 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
11732 Renamed from timestamp_nsec.
11733 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
11735 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
11737 (Incremental_inputs::report_archive): Save mtime; style fix.
11738 (Incremental_inputs::report_obejct): Save mtime; style fix.
11739 (Incremental_inputs::report_script): Save mtime; style fix.
11740 (Incremental_inputs::finalize_inputs): Style fix.
11741 (Incremental_inputs::finalize): Style fix.
11742 (Incremental_inputs::create_input_section_data): Store inputs
11744 * incremental.h (Incremental_inputs::report_script): Add mtime
11746 (Incremental_inputs::Input_info::Input_info): Intialize only one
11748 (Incremental_inputs::Input_info::archive): Move to nameless
11750 (Incremental_inputs::Input_info::obejct): Move to nameless union.
11751 (Incremental_inputs::Input_info::script): Move to nameless union.
11752 (Incremental_inputs::mtime): New field.
11753 * script.cc (read_input_script): Pass file mtime to
11755 * script.h (Script_info::inputs): Style fix.
11757 2009-07-01 Ian Lance Taylor <ian@airs.com>
11759 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
11762 2009-06-24 Ian Lance Taylor <iant@google.com>
11765 * layout.cc (Layout::choose_output_section): If we find an
11766 existing section, update the flags.
11767 (Layout::create_notes): New function, broken out of
11769 (Layout::finalize): Don't create note sections.
11770 (Layout::create_note): Don't crash if linker script discards
11772 (Layout::create_gold_note): Likewise.
11773 (Layout::create_build_id): Likewise. Don't set
11774 after_input_sections on the section.
11775 (Layout::create_executable_stack_info): Remove target parameter.
11777 * layout.h (class Layout): Declare create_notes. Update
11778 declaration of create_executable_stack_info.
11779 * gold.cc (queue_middle_tasks): Call create_notes.
11780 * output.cc (Output_section::update_flags_for_input_section): Move
11781 here from output.h. If SHF_ALLOC flag is newly set, mark address
11783 * output.h (Output_data::mark_address_invalid): New function.
11784 (class Output_section): Only declare, not define,
11785 update_flags_for_input_section. Remove set_flags.
11787 2009-06-24 Ian Lance Taylor <iant@google.com>
11789 * script-sections.cc (Output_section_definition::
11790 set_section_addresses): Rename shadowing local load_address to
11793 2009-06-24 Ian Lance Taylor <iant@google.com>
11796 * reloc.cc (relocate_sections): Skip empty relocation sections.
11798 2009-06-23 Ian Lance Taylor <iant@google.com>
11801 * layout.cc (Layout::create_note): Use choose_output_section
11802 rather than make_output_section.
11804 2009-06-23 Ian Lance Taylor <iant@google.com>
11807 * options.cc (General_options::parse_V): Set printed_version_.
11808 (General_options::General_options): Initialize printed_version_.
11809 * options.h (class General_options): Add printed_version_ field.
11810 * gold.cc (queue_initial_tasks): If there are no input files,
11811 don't give a fatal error if we printed the version information.
11812 (queue_middle_tasks): If using -r with a shared object, give a
11813 fatal error rather than an ordinary error.
11815 2009-06-23 Ian Lance Taylor <iant@google.com>
11818 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
11819 (Layout::make_output_section): Set have_stabstr_section_ if we see
11820 a .stab*str section.
11821 (Layout::finalize): Call link_stabs_sections.
11822 (Layout::link_stabs_sections): New file.
11823 * layout.h (class Layout): Add have_stabstr_section_ field.
11824 Declare link_stabs_sections.
11826 2009-06-23 Doug Kwan <dougkwan@google.com>
11828 * Makefile.am (libgold_a_LIBADD): New.
11829 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
11830 * Makefile.in: Regenerate.
11831 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
11832 * configure: Regenerate.
11833 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
11834 * fileread.cc: Include sys/state.h
11835 * gold.h: Declare memmem and strndup if found missing.
11836 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
11838 2009-06-23 Ian Lance Taylor <iant@google.com>
11840 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
11841 * configure: Rebuild.
11843 2009-06-23 Ian Lance Taylor <iant@google.com>
11846 * object.cc (Object::section_contents): Don't try to get a view if
11847 the section has length zero.
11848 (Object::handle_gnu_warning_section): If the section is empty, use
11849 the name of the section as the warning.
11851 2009-06-23 Ian Lance Taylor <iant@google.com>
11854 * stringpool.h (class Stringpool_template): Add optimize_ field.
11855 (Stringpool_template::set_optimize): New function.
11856 * stringpool.cc (Stringpool_template::Stringpool_template):
11857 Initialize optimize_ field.
11858 (Stringpool_template::set_string_offsets): Test local optimize
11859 fild rather than parameter.
11860 * layout.cc (Layout::Layout): Call set_optimize on the section
11863 2009-06-22 Ian Lance Taylor <iant@google.com>
11866 * yyscript.y: Parse TARGET.
11867 * script.cc (script_set_target): New function.
11868 * script-c.h (script_set_target): Declare.
11869 * options.cc (General_options::string_to_object_format): Rename
11870 from string_to_object_format in anonymous namespace. Change
11872 * options.h (class General_options): Declare
11873 string_to_object_format.
11875 2009-06-22 Ian Lance Taylor <iant@google.com>
11877 * script-sections.cc (Script_sections::create_segments): Don't put
11878 program headers in a PT_LOAD segment if -n or -N.
11880 2009-06-22 Ian Lance Taylor <iant@google.com>
11883 * options.h (class General_options): Add -z lazy and -z now. Sort
11884 -z options into alphabetical order.
11885 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
11887 2009-06-21 Ian Lance Taylor <iant@google.com>
11889 * layout.cc (Layout::make_output_section): Call
11890 Target::new_output_section.
11891 (Layout::attach_allocated_section_to_segment): Put large section
11892 sections in a separate load segment with the large segment flag
11894 (Layout::segment_precedes): Sort large data segments after other
11896 (align_file_offset): New static function.
11897 (Layout::set_segment_offsets): Use align_file_offset.
11898 * output.h (class Output_section): Add is_small_section_ and
11899 is_large_section_ fields.
11900 (Output_section::is_small_section): New function.
11901 (Output_section::set_is_small_section): New function.
11902 (Output_section::is_large_section): New function.
11903 (Output_section::set_is_large_section): New function.
11904 (Output_section::is_large_data_section): New function.
11905 (class Output_segment): Add is_large_data_segment_ field.
11906 (Output_segment::is_large_data_segment): New function.
11907 (Output_segment::set_is_large_data_segment): New function.
11908 * output.cc (Output_section::Output_section): Initialize new
11910 (Output_segment::Output_segment): Likewise.
11911 (Output_segment::add_output_section): Add assertion that large
11912 data sections always go in large data segments. Force small data
11913 sections to the end of the list of data sections. Force small BSS
11914 sections to the start of the list of BSS sections. For large BSS
11915 sections to the end of the list of BSS sections.
11916 * symtab.h (class Symbol): Declare is_common_shndx.
11917 (Symbol::is_defined): Check Symbol::is_common_shndx.
11918 (Symbol::is_common): Likewise.
11919 (class Symbol_table): Define enum Commons_section_type. Update
11920 declarations. Add small_commons_ and large_commons_ fields.
11921 * symtab.cc (Symbol::is_common_shndx): New function.
11922 (Symbol_table::Symbol_table): Initialize new fields.
11923 (Symbol_table::add_from_object): Put small and large common
11924 symbols in the right list.
11925 (Symbol_table::sized_finalized_symbol): Check
11926 Symbol::is_common_shndx.
11927 (Symbol_table::sized_write_globals): Likewise.
11928 * common.cc (Symbol_table::do_allocate_commons): Allocate new
11929 common symbol lists. Don't call do_allocate_commons_list if the
11931 (Symbol_table::do_allocate_commons_list): Remove is_tls
11932 parameter. Add comons_section_type parameter. Change all
11933 callers. Handle small and large common symbols.
11934 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
11935 Symbol::is_common_shndx.
11936 * resolve.cc (symbol_to_bits): Likewise.
11937 * target.h (Target::small_common_shndx): New function.
11938 (Target::small_common_section_flags): New function.
11939 (Target::large_common_shndx): New function.
11940 (Target::large_common_section_flags): New function.
11941 (Target::new_output_section): New function.
11942 (Target::Target_info): Add small_common_shndx, large_common_shndx,
11943 small_common_section_flags, and large_common_section_flags
11945 (Target::do_new_output_section): New virtual function.
11946 * arm.cc (Target_arm::arm_info): Initialize new fields.
11947 * i386.cc (Target_i386::i386_info): Likewise.
11948 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
11950 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
11951 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11952 (Target_x86_64::do_new_output_section): New function.
11953 * configure.ac: Define conditional MCMODEL_MEDIUM.
11954 * testsuite/Makefile.am (check_PROGRAMS): Add large.
11955 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
11956 (large_LDFLAGS): Define.
11957 * testsuite/large.c: New file.
11958 * testsuite/testfile.cc (Target_test::test_target_info):
11959 Initialize new fields.
11960 * configure, testsuite/Makefile.in: Rebuild.
11962 2009-06-05 Doug Kwan <dougkwan@google.com>
11964 * Makefile.am (CCFILES): Add target.cc.
11965 * Makefile.in: Regenerate.
11966 * i386.cc (class Target_i386): Define new virtual method to
11967 override do_is_local_label_name in parent.
11968 * object.cc (Sized_relobj::do_count_local_symbols): Discard
11969 local symbols if --discard-locals or -X is given.
11970 * options.h (class General_options): Declare new options
11971 '--discard-locals' and '-X' for discarding locals.
11972 * target.h (class Target): Define new methods is_local_label_name.
11973 Declare new virtual method do_is_local_label_name.
11974 * target.cc: New file.
11975 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
11976 (check_SCRIPTS): Add discard_locals_test.sh.
11977 (check_DATA): Add discard_local_tests.syms.
11978 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
11979 (discard_local_tests.syms, discard_locals_test.o): New make rules.
11980 * testsuite/Makefile.in: Regenerate.
11981 * testsuite/discard_locals_test.c: New file.
11982 * testsuite/discard_locals_test.sh: Same.
11984 2009-06-05 Doug Kwan <dougkwan@google.com>
11986 * object.cc (Sized_relobj::Sized_relobj): Initialize
11987 discarded_eh_frame_shndx_ to -1U.
11988 (Sized_relobj::do_layout): Record index of a discard .eh_frame
11990 (Sized_relobj::do_count_local_symbols): Skip local symbols in
11991 a discarded .eh_frame section.
11992 (Sized_relobj::do_finalize_local_symbols): Ditto.
11993 * object.h (class Sized_relobj): Declare new member
11994 discarded_eh_frame_shndx_.
11995 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
11996 (local_labels_test.o, local_labels_test): New rules.
11997 * testsuite/Makefile.in: Regenerate.
11999 2009-06-04 Doug Kwan <dougkwan@google.com>
12001 * layout.cc (Layout::section_name_mapping): Add mapping for
12002 special ARM sections.
12004 2009-06-03 Doug Kwan <dougkwan@google.com>
12006 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12007 (utils::has_overflow): Same.
12009 2009-06-03 Ian Lance Taylor <iant@google.com>
12011 * layout.cc (Layout::section_name_mapping): New array, replacing
12012 Layout::linkonce_mapping.
12013 (Layout::section_name_mapping_count): New variable, replacing
12014 Layout::linkonce_mapping_count.
12015 (Layout::linkonce_output_name): Remove.
12016 (Layout::output_section_name): Rewrite.
12017 * layout.h (class Layout): Rename Linkonce_mapping to
12018 Section_name_mapping, linkonce_mapping to section_name_mapping,
12019 linkonce_mapping_count to section_name_mapping_count. Don't
12020 declare linkonce_output_name.
12022 2009-06-03 Doug Kwan <dougkwan@google.com>
12024 * gold/arm.cc (namespace utils): New.
12025 (Target_arm::reloc_is_non_pic): Define new method.
12026 (class Arm_relocate_functions): New.
12027 (Target_arm::Relocate::relocate): Handle relocation types used by
12030 2009-06-03 Ian Lance Taylor <iant@google.com>
12032 * arm.cc (Target_arm::scan::global): Use || instead of |.
12034 2009-06-02 Doug Kwan <dougkwan@google.com>
12036 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
12037 issued_non_pic_error_.
12038 (class Target_arm::Scan): Declare new method check_non_pic.
12039 Define new method symbol_needs_plt_entry.
12040 Declare new data member issued_non_pic_error_.
12041 (class Target_arm::Relocate): Declare new method
12042 should_apply_static_reloc.
12043 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
12044 (Target_arm::Scan::check_non_pic): Define new method.
12045 (Target_arm::Scan::local): Handle a small subset of reloc types used
12047 (Target_arm::Scan::local): Same.
12048 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
12050 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
12052 * incremental.cc (Incremental_inputs::report_command_line): Filter
12053 out --incremental-* options.
12055 2009-05-29 Doug Kwan <dougkwan@google.com>
12057 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
12059 (class Target_arm): Update comment.
12060 (Target_arm::Target_arm): Initialize new data members GOT_,
12061 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
12062 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
12063 and Target_arm::rel_dyn_section.
12064 Declare new_enum Target_arm::Got_type.
12065 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
12067 Update commments for member do_dynsym_value.
12068 (Target_arm::got_size, Target_arm::plt_section,
12069 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
12070 new methods inside class defintion.
12071 (Target_arm::got_section): Define new method.
12072 (Target_arm::rel_dyn_section): Same.
12073 (Output_data_plt_arm): New template class.
12074 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
12075 (Output_data_plt_arm:do_adjust_output_section): Define new method.
12076 (Output_data_plt_arm::add_entry): Same.
12077 (Output_data_plt_arm::first_plt_entry): Define new
12078 static data member for PLT instruction template.
12079 (Output_data_plt_arm::plt_entry): Same.
12080 (Output_data_plt_arm::do_write): Define new method.
12081 (Target_arm::make_plt_entry): Same.
12082 (Target_arm::do_finalize_sections): Same.
12083 (Target_arm::do_dynsym_value): Same.
12085 2009-05-28 Doug Kwan <dougkwan@google.com>
12087 * Makefile.am (TARGETSOURCES): Add arm.cc.
12088 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
12089 * Makefile.in: Regenerate.
12090 * arm.cc: New file.
12091 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
12093 2009-05-26 Doug Kwan <dougkwan@google.com>
12095 * options.cc (General_options::parse_exclude_libs). Fix a comment.
12096 (General_options::check_excluded_libs): Strip off directories in
12097 archive name before matching like GNU ld does.
12098 * testsuite/Makefile.am (MOSTLYCLEANFILES,
12099 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
12100 (exclude_libs_test_LDFLAGS): Add linker option
12101 -Wl,--exclude-libs,libexclude_libs_test_3
12102 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
12103 an explicit archive without using -l.
12104 (alt/libexclude_libs_test_3.a): New make rule.
12105 * testsuite/Makefile.in: Regenerate.
12106 * testsuite/exclude_libs_test.c : Declare lib3_default().
12108 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
12109 * exclude_libs_test_3.c: New file.
12111 2009-05-26 Nick Clifton <nickc@redhat.com>
12113 * po/id.po: New Indonesian translation.
12114 * po/gold.pot: Updated template file.
12116 2009-05-22 Sriraman Tallam <tmsriram@google.com>
12118 * testsuite/Makefile.am: Add -ffunction-sections to compile
12119 gc_comdat_test files. Add -Wl,--gc-sections to build
12121 * testsuite/Makefile.in: Regenerate.
12122 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
12124 2009-05-21 Sriraman Tallam <tmsriram@google.com>
12126 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
12127 kept comdat section was garbage collected.
12128 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
12129 * testsuite/Makefile.in: Regenerate.
12130 * testsuite/gc_comdat_test.sh: New file.
12131 * testsuite/gc_comdat_test_1.cc: New file.
12132 * testsuite/gc_comdat_test_2.cc: New file.
12134 2009-05-19 Doug Kwan <dougkwan@google.com>
12136 * archive.cc (Archive::Archive): Move constructor from archive.h
12137 to here. Initialize no_export_.
12138 (Archive::get_elf_object_for_member): Set no_export flag of object.
12139 * archive.h (Archive::Archive): Move constructor body to
12141 (Archive::no_export): New method.
12142 (Archive::no_export_): New field.
12143 * object.h (Object::Object): Initialize no_export_ to false.
12144 (Object::no_export, Object::set_no_export): New methods.
12145 (Object::no_export_): New field.
12146 * options.cc (General_options::parse_exclude_libs): New method.
12147 (General_options::check_excluded_libs) Same.
12148 * options.h (exclude_libs): New option.
12149 (General_options::check_excluded_libs): New method declaration.
12150 (General_options::excluded_libs_): New field.
12151 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
12152 default or protected visibility if an object has no-export flag set.
12153 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
12154 (check_SCRIPTS): Add exclude_libs_test.sh.
12155 (check_DATA): Add exclude_libs_test.syms.
12156 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
12157 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
12158 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
12159 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
12160 (exclude_libs_test.syms, libexclude_libs_test_1.a,
12161 libexclude_libs_test_2.a): New rules.
12162 * testsuite/Makefile.in: Regenerate.
12163 * testsuite/exclude_libs_test.c: New file.
12164 * testsuite/exclude_libs_test.sh: Ditto.
12165 * testsuite/exclude_libs_test_1.c: Ditto.
12166 * testsuite/exclude_libs_test_2.c: Ditto.
12168 2009-05-15 Ian Lance Taylor <iant@google.com>
12170 * configure.ac: Check for declarations for cases where libiberty.h
12171 checks HAVE_DECL_xxx.
12172 * configure, config.in: Rebuild.
12174 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
12176 * gold.h (Incremental_argument_list): Remove (invalid) forward
12178 * incremental.cc (Incremental_inputs::report_achive): New method.
12179 (Incremental_inputs::report_object): New method.
12180 (Incremental_inputs::report_script): New method.
12181 (Incremental_inputs::finalize_inputs): New method.
12182 (Incremental_inputs::finalize): Call finalize_inputs().
12183 (Incremental_inputs::sized_create_incremental_inputs_section_data):
12184 Create inputs entries.
12185 * incremental.h (Incremental_input_type): New enum.
12186 (Incremental_inputs::Incremental_input): Initialize new fields.
12187 (Incremental_inputs::report_inputs): New method.
12188 (Incremental_inputs::report_achive): New method.
12189 (Incremental_inputs::report_object): New method.
12190 (Incremental_inputs::report_script): New method.
12191 (Incremental_inputs::finalize_inputs): New method.
12192 (Incremental_inputs::Input_info): New struct.
12193 (Incremental_inputs::Input_info_map): New typedef.
12194 (Incremental_inputs::lock_): New field.
12195 (Incremental_inputs::Inputs_): New field.
12196 (Incremental_inputs::Inputs_map): New field.
12197 * main.cc (main): Call Incremental_input::report_inputs.
12198 * options.h (Input_argument_list): Typedef moved from
12200 (Input_file_group::Files): Remove, use ::Input_argument_list.
12201 (Input_file_group::Input_argument_list): Remove, use
12202 ::Input_argument_list.
12203 * plugin.cc (Plugin_manager::add_input_file): Add error in
12205 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
12207 * script.cc (read_input_script): Call
12208 Incremental_input::report_script.
12209 * script.h (Script_info): New class.
12211 2009-04-27 Ian Lance Taylor <iant@google.com>
12213 * x86_64.cc (do_adjust_output_section): Set entsize to
12216 2009-04-23 Elliott Hughes <enh@google.com>
12218 * output.cc (Output_file::close): After short writes, continue
12219 writing from the correct offset in the buffer being written.
12221 2009-04-23 Chris Demetriou <cgd@google.com>
12223 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
12224 * configure: Regenerate.
12225 * config.in: Regenerate.
12226 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
12227 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
12229 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
12231 * incremental.cc (Incremental_inputs_header_data): Renamed from
12232 Incremental_input_header_data.
12233 (Incremental_inputs_header_data::data_size): New field.
12234 (Incremental_inputs_header_data::put_input_file_count): Renamed
12235 from input_file_count.
12236 (Incremental_inputs_header_data::put_command_line_offset): Renamed
12237 from command_line_offset.
12238 (Incremental_inputs_header_data::put_reserved): Renamed from
12240 (Incremental_inputs_entry_data): Renamed from
12241 Incremental_input_entry_data.
12242 (Incremental_inputs_entry_data::data_size): New field.
12243 (Incremental_inputs::report_command_line): New method.
12244 (Incremental_inputs::finalize): New method.
12245 (Incremental_inputs::create_incremental_inputs_data): New method.
12246 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
12247 * incremental.h: New file.
12248 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
12249 (Layout::finalize): Create incremental inputs section in
12250 incremental builds.
12251 (Layout::create_incremental_info_sections): New method.
12252 * layout.h (Layout::incremental_inputs): New method.
12253 (Layout::create_incremental_info_sections): New method.
12254 (Layout::incremental_inputs_): New field.
12255 * main.cc (main): Notify Incremental_input of the command line.
12257 2009-04-01 Ian Lance Taylor <iant@google.com>
12258 Mikolaj Zalewski <mikolajz@google.com>
12260 * gold.h (reserve_unordered_map): Define, three versions, one for
12261 each version of Unordered_map.
12262 * layout.cc (Layout::Layout): Remove options parameter. Add
12263 number_of_input_files parameter. Don't initialize options_.
12264 Initialize number_of_input_files_ and resized_signatures_. Move
12265 sections_are_attached_.
12266 (Layout::layout_group): Reserve space for group_signatures_.
12267 (Layout::find_or_add_kept_section): Change name parameter to be a
12268 reference. Resize signatures_ map when it gets large enough.
12269 (Layout::layout_eh_frame): Use parameters->options() instead of
12271 (Layout::make_output_section): Likewise.
12272 (Layout::attach_allocated_section_to_segment): Likewise.
12273 (Layout::finalize, Layout::create_executable_stack): Likewise.
12274 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
12275 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
12276 * layout.h (class Layout): Update declarations. Remove options_
12277 field. Add number_of_input_files_ and resized_signatures_
12278 fields. Move sections_are_attached_ field.
12279 * main.cc (main): Pass number of input files to Layout
12280 constructor. Don't pass options.
12282 2009-03-30 Ian Lance Taylor <iant@google.com>
12284 * ffsll.c (ffsll): Correct implementation.
12286 2009-03-27 Ian Lance Taylor <iant@google.com>
12288 * ffsll.c: New file.
12289 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
12290 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
12291 * ftruncate.c (ftruncate): Declare before definition.
12292 * mremap.c (mremap): Likewise.
12293 * pread.c (pread): Likewise.
12294 * configure, Makefile.in, config.in: Rebuild.
12296 * mremap.c: New file.
12297 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
12298 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
12299 (mremap): Declare if HAVE_MREMAP is not defined.
12300 * configure, Makefile.in, config.in: Rebuild.
12302 2009-03-27 Cary Coutant <ccoutant@google.com>
12304 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
12305 position independent.
12306 * sparc.cc (Target_sparc::check_non_pic): Likewise.
12307 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
12309 2009-03-24 Cary Coutant <ccoutant@google.com>
12311 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
12313 (needs_dynamic_reloc): Likewise.
12315 2009-03-24 Ian Lance Taylor <iant@google.com>
12317 * yyscript.y (file_cmd): Recognize EXTERN.
12318 (extern_name_list, extern_name_list_body): New nonterminals.
12319 * script.cc (script_add_extern): Define.
12320 * script-c.h (script_add_extern): Declare.
12322 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
12324 * object.cc (is_elf_object): Define.
12325 * object.h (is_elf_object): Declare.
12326 * archive.cc (Archive::get_elf_object_for_member): Call
12328 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
12330 2009-03-24 Elliott Hughes <enh@google.com>
12332 * output.cc (Output_file::map_anonymous): Define.
12333 (Output_file::map): Use map_anonymous. If the regular mmap fails,
12334 try an anonymous one. Report the size if the mmap fails.
12335 * output.h (class Output_file): Declare map_anonymous.
12337 2009-03-24 Ian Lance Taylor <iant@google.com>
12339 * target-select.cc (instantiate_target): Don't acquire the lock if
12340 the instantiated_target_ field has already been set.
12342 2009-03-23 Ian Lance Taylor <iant@google.com>
12344 * gold-threads.h (class Initialize_lock): Define.
12345 * gold-threads.cc (class Initialize_lock_once): Define.
12346 (initialize_lock_control): New static variable.
12347 (initialize_lock_pointer): New static variable.
12348 (initialize_lock_once): New static function.
12349 (Initialize_lock::Initialize_lock): Define.
12350 (Initialize_lock::initialize): Define.
12351 * target-select.h: Include "gold-threads.h".
12352 (class Target_selector): Add lock_ and initialize_lock_ fields.
12353 Don't define instantiate_target, just declare it.
12354 * target-select.cc (Target_selector::Target_selector): Initialize
12356 (Target_selector::instantiate_target): Define.
12357 * descriptors.h: Include "gold-threads.h".
12358 (class Descriptors): Add initialize_lock_ field.
12359 * descriptors.cc (Descriptors::Descriptors): Initialize new
12361 (Descriptors::open): Use initialize_lock_ field
12362 * errors.h (class Errors): Add initialize_lock_ field.
12363 * errors.cc (Errors::Errors): Initialize new field.
12364 (Errors::initialize_lock): Use initialize_lock_ field.
12365 * powerpc.cc (class Target_selector_powerpc): Remove
12366 instantiated_target_ field. In do_recognize call
12367 instantiate_target rather than do_instantiate_target. In
12368 do_instantiate_target just allocate a new target.
12369 * sparc.cc (class Target_selector_sparc): Likewise.
12371 * freebsd.h: New file.
12372 * i386.cc: Include "freebsd.h".
12373 (Target_i386): Derive from Target_freebsd rather than
12375 (Target_selector_i386): Derive from Target_selector_freebsd rather
12376 than Target_selector.
12377 * x86_64.cc: Include "freebsd.h".
12378 (Target_x86_64): Derive from Target_freebsd rather than
12380 (Target_selector_x86_64): Derive from Target_selector_freebsd
12381 rather than Target_selector.
12382 * target.h (class Target): Add adjust_elf_header and
12383 do_adjust_elf_header.
12384 * output.cc (Output_file_header:: do_sized_write): Call target
12385 adjust_elf_header routine.
12386 * configure.tgt: Set targ_osabi.
12387 * configure.ac: Define GOLD_DEFAULT_OSABI.
12388 * parameters.cc (Parameters::default_target): Pass
12389 GOLD_DEFAULT_OSABI to select_target.
12390 * target-select.h (class Target_selector): Make instantiate_target
12391 protected rather than private.
12392 * Makefile.am (HFILES): Add freebsd.h.
12393 * configure, Makefile.in, config.in: Rebuild.
12395 * merge.cc (do_add_input_section): Correct pend value. Change
12396 message about last entry not being null terminated from error to
12399 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
12401 * incremental.cc: New file.
12402 * Makefile.am (CCFILES): Add incremental.cc.
12403 * Makefile.in: Rebuild.
12405 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
12407 * layout.cc (Layout::output_section_name): Preserve names
12408 of '.note.' sections.
12410 2009-03-19 Ian Lance Taylor <iant@google.com>
12412 * descriptors.cc (Descriptors::open): Check that the options are
12413 valid before using them.
12415 2009-03-18 Ian Lance Taylor <iant@google.com>
12417 * script-sections.h: Include <list>.
12418 (class Script_sections): Change Sections_elements from std::vector
12419 to std::list. Typedef public Elements_iterator. Add
12420 orphan_section_placement_, data_segment_align_start_, and
12421 saw_data_segment_align_ fields. Remove data_segment_align_index_
12423 * script-sections.cc (class Orphan_section_placement): New class.
12424 (class Sections_element): Add virtual functions is_relro and
12425 orphan_section_init. Remove virtual function place_orphan_here.
12426 (class Output_section_definition): Add is_relro and
12427 orphan_section_init. Remove place_orphan_here.
12428 (class Orphan_output_section): Likewise.
12429 (Script_sections::Script_sections): Update for field changes.
12430 (Script_sections::data_segment_align): Set saw_data_segment_align_
12431 and data_segment_align_start_, not data_segment_align_index.
12432 (Script_sections::data_segment_relro_end): Check
12433 saw_data_segment_align_. Use data_segment_align_start_ rather
12434 than data_segment_align_index_.
12435 (Script_sections::place_orphan): Rewrite to use
12436 Orphan_section_placement.
12438 2009-03-17 Ian Lance Taylor <iant@google.com>
12440 * archive.cc (Archive::add_symbols): Check for a version attached
12441 to the symbol name in the archive map.
12442 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
12443 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
12444 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
12445 (ver_test_11.a): New target.
12446 * testsuite/Makefile.in: Rebuild.
12448 * configure.ac: Check for chsize and posix_fallocate. Replace
12450 * ftruncate.c: New file, from gnulib.
12451 * output.cc (posix_fallocate): Define dummy version if not
12452 HAVE_POSIX_FALLOCATE.
12453 (Output_file::map): Call posix_fallocate rather than lseek and
12455 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
12456 * configure, Makefile.in, config.in: Rebuild.
12458 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
12460 * layout.h (Layout::create_note): Add section_name parameter.
12461 * layout.cc (Layout::create_note): Likewise.
12462 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
12464 2009-03-17 Ian Lance Taylor <iant@google.com>
12466 * descriptors.cc: Include "options.h".
12467 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
12468 (Descriptors::open): Always use O_CLOEXEC when opening a new
12469 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
12470 then set FD_CLOEXEC.
12472 * sparc.cc (class Target_sparc): Add has_got_section.
12473 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
12474 make sure we have a GOT section.
12476 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
12477 (Target_sparc::Scan::local): Likewise.
12478 (Target_sparc::Scan::global): Likewise.
12479 (Target_sparc::Relocate::relocate): Likewise.
12480 (Target_sparc::Relocate::relocate_tls): Likewise.
12482 * symtab.cc (Symbol_table::define_default_version): New function,
12483 broken out of add_from_object.
12484 (Symbol_table::add_from_object): Call define_default_version.
12485 (Symbol_table::define_special_symbol): Add resolve_oldsym
12486 parameter. Change all callers. If the version for a symbol comes
12487 from a version script, resolve it with the symbol with the same
12488 name with no version. Also add the symbol without a version if
12490 (do_define_in_output_data): If resolving with oldsym, don't delete
12492 (do_define_in_output_segment): Likewise.
12493 (do_define_as_constant): Likewise.
12494 * symtab.h (class Symbol_table): Update declarations.
12496 2009-03-13 Ian Lance Taylor <iant@google.com>
12498 * readsyms.cc (Read_symbols::incompatible_warning): New function.
12499 (Read_symbols::requeue): New function.
12500 (Read_symbols::do_read_symbols): If make_elf_object fails because
12501 the target type is not configured, and the file was searched for,
12502 issue a warning and retry with the next directory.
12503 (Add_symbols::run): If the file has an incompatible format, and
12504 it was searched for, requeue the Read_symbols task. On error,
12505 release the object.
12506 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
12507 dirindex parameter to constructor. Change all callers. Declare
12508 incompatible_warning and requeue.
12509 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
12510 input_argument_ and input_group_ fields. Add them to
12511 constructor. Change all callers.
12512 (class Read_script): Add dirindex_ field. Add it to constructor.
12513 Change all callers.
12514 * archive.cc (Archive::setup): Remove input_objects parameter.
12515 Change all callers.
12516 (Archive::get_file_and_offset): Likewise.
12517 (Archive::read_all_symbols): Likewise.
12518 (Archive::read_symbols): Likewise.
12519 (Archive::get_elf_object_for_member): Remove input_objects
12520 parameter. Add punconfigured parameter. Change all callers.
12521 (Archive::add_symbols): Change return type to bool. Check return
12522 value of include_member.
12523 (Archive::include_all_members): Likewise.
12524 (Archive::include_member): Change return type to bool. Return
12525 false if first included object has incompatible target. Set
12526 included_member_ field.
12527 (Add_archive_symbols::run): If add_symbols returns false, requeue
12529 * archive.h (class Archive): Add included_member_ field.
12530 Initialize it in constructor. Add input_file and searched_for
12531 methods. Update declarations.
12532 (class Add_archive_symbols): Add dirpath_, dirindex_, and
12533 input_argument_ fields. Add them to constructor. Change all
12535 * script.cc: Include "target-select.h".
12536 (class Parser_closure): Add skip_on_incompatible_target_ and
12537 found_incompatible_target_ fields. Add
12538 skip_on_incompatible_target parameter to constructor. Change all
12539 callers. Add methods skip_on_incompatible_target,
12540 clear_skip_on_incompatible_target, found_incompatible_target, and
12541 set_found_incompatible_target.
12542 (read_input_script): Add dirindex parameter. Change all callers.
12543 If parser finds an incompatible target, requeue Read_symbols
12545 (script_set_symbol): Clear skip_on_incompatible_target in
12547 (script_add_assertion, script_parse_option): Likewise.
12548 (script_start_sections, script_add_phdr): Likewise.
12549 (script_check_output_format): New function.
12550 * script.h (read_input_script): Update declaration.
12551 * script-c.h (script_check_output_format): Declare.
12552 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
12553 (ignore_cmd): Remove OUTPUT_FORMAT.
12554 * fileread.cc (Input_file::Input_file): Add explicit this.
12555 (Input_file::will_search_for): New function.
12556 (Input_file::open): Add pindex parameter. Change all callers.
12557 * fileread.h (class Input_file): Add input_file_argument method.
12558 Declare will_search_for. Update declarations.
12559 * object.cc (make_elf_object): Add punconfigured parameter.
12560 Change all callers.
12561 * object.h (class Object): Make input_file public. Add
12562 searched_for method.
12563 (make_elf_object): Update declaration.
12564 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
12566 * dirsearch.h (class Dirsearch): Update declaration.
12567 * options.h (class General_options): Add --warn-search-mismatch.
12568 * parameters.cc (Parameters::is_compatible_target): New function.
12569 * parameters.h (class Parameters): Declare is_compatible_target.
12570 * workqueue.cc (Workqueue::add_blocker): New function.
12571 * workqueue.h (class Workqueue): Declare add_blocker.
12573 * fileread.cc (Input_file::open): Remove options parameter.
12574 Change all callers.
12575 (Input_file::open_binary): Likewise.
12576 * script.cc (read_input_script): Likewise.
12577 * readsyms.h (class Read_symbols): Remove options_ field. Remove
12578 options parameter from constructor. Change all callers.
12579 (class Read_script): Likewise.
12580 * fileread.h (class Input_file): Update declarations.
12581 * script.h (read_input_script): Update declaration.
12583 2009-03-10 Nick Clifton <nickc@redhat.com>
12585 * po/es.po: New Spanish translation.
12587 2009-03-06 Cary Coutant <ccoutant@google.com>
12589 * options.cc (parse_short_option): Keep dash_z from registering itself.
12591 2009-03-03 Ian Lance Taylor <iant@google.com>
12594 * target-reloc.h (relocate_section): Pass output_section to
12596 * i386.cc (Target_i386::should_apply_static_reloc): Add
12597 output_section parameter. Change all callers.
12598 (Target_i386::Relocate::relocate): Add output_section parameter.
12599 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12600 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
12601 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
12602 * testsuite/two_file_shared.sh: New script.
12603 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
12604 (check_DATA): Add two_file_shared.dbg.
12605 (two_file_shared.dbg): New target.
12606 * testsuite/Makefile.in: Rebuild.
12608 2009-03-01 Ian Lance Taylor <iant@google.com>
12610 * configure.ac: Check for byteswap.h.
12611 * configure: Rebuild.
12612 * config.in: Rebuild.
12614 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
12616 * layout.cc (Layout::find_or_add_kept_section): New function.
12617 (Layout::add_comdat): Removed.
12618 * layout.h (struct Kept_section): Move out of class Layout.
12619 Remove trailing underscores from field names. Add group_sections
12620 field. Rename group_ field to is_group. Change all uses.
12621 (class Layout): Declare find_or_add_kept_section, not add_comdat.
12622 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
12623 comdat_groups_ field.
12624 (Sized_relobj::include_section_group): Use
12625 find_or_add_kept_section and Kept_section::group_sections.
12626 (Sized_relobj::include_linkonce_section): Likewise.
12627 * object.cc (class Sized_relobj): Don't define Comdat_group or
12628 Comdat_group_table. Remove find_comdat_group and
12629 add_comdat_group. Remove comdat_groups_ field.
12630 * plugin.cc (include_comdat_group): Use
12631 Layout::find_or_add_kept_section.
12633 2009-02-28 Ian Lance Taylor <iant@google.com>
12635 * README: --gc-sections and map files are now supported. Document
12636 some build requirements.
12639 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
12640 relocatable link set the value of the section symbol to zero.
12641 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
12642 relocatable link don't include the section address in the local
12645 2009-02-27 Ian Lance Taylor <iant@google.com>
12648 * options.h (class Search_directory): Add is_system_directory.
12649 (class General_options): Declare is_in_system_directory.
12650 * options.cc (get_relative_sysroot): Make static.
12651 (get_default_sysroot): Make static.
12652 (General_optoins::is_in_system_directory): New function.
12653 * fileread.cc (Input_file::is_in_system_directory): New function.
12654 * fileread.h (class Input_file): Declare is_in_system_directory.
12655 * object.h (class Object): Add is_in_system_directory.
12656 (class Input_objects): Remove system_library_directory_ field.
12657 * object.cc (Input_objects::add_object): Don't set
12658 system_library_directory_.
12659 (input_objects::found_in_system_library_directory): Remove.
12660 * symtab.cc (Symbol_table::write_globals): Remove input_objects
12661 parameter. Change all callers.
12662 (Symbol_table::sized_write_globals): Likewise.
12663 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
12664 Call Object::is_in_system_directory.
12665 * symtab.h (class Symbol_table): Update declarations.
12668 * descriptors.h (Open_descriptor): Add is_on_stack field.
12669 * descriptors.cc (Descriptors::open): If the descriptor is on the
12670 top of the stack, remove it. Initialize is_on_stack field.
12671 (Descriptors::release): Only add pod to stack if it is not on the
12673 (Descriptors::close_some_descriptor): Clear stack_next and
12674 is_on_stack fields.
12677 * output.cc (Output_section::find_starting_output_address): Rename
12678 from starting_output_address; add PADDR parameter; change return
12680 * output.h (class Output_section): Declare
12681 find_starting_output_address instead of starting_output_address.
12682 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
12683 section symbol for which we can't find a merge section.
12686 * symtab.cc (Symbol_table::add_from_object): If the visibility is
12687 hidden or internal, force the symbol to be local.
12688 * resolve.cc (Symbol::override_visibility): Define.
12689 (Symbol::override_base): Use override_visibility.
12690 (Symbol_table::resolve): Likewise.
12691 (Symbol::override_base_with_special): Likewise.
12692 (Symbol_table::override_with_special): If the visibility is hidden
12693 or internal, force the symbol to be local.
12694 * symtab.h (class Symbol): Add set_visibility and
12695 override_visibility.
12696 * testsuite/ver_test_1.sh: New file.
12697 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
12698 (check_DATA): Add ver_test_1.syms.
12699 (ver_test_1.syms): New target.
12700 * testsuite/Makefile.in: Rebuild.
12702 2009-02-25 Cary Coutant <ccoutant@google.com>
12704 * layout.cc (Layout::choose_output_section): Don't rename sections
12705 when using a linker script that has a SECTIONS clause.
12706 * Makefile.in: Regenerate.
12708 * testsuite/Makefile.am (script_test_5.sh): New test case.
12709 * testsuite/Makefile.in: Regenerate.
12710 * testsuite/script_test_5.cc: New file.
12711 * testsuite/script_test_5.sh: New file.
12712 * testsuite/script_test_5.t: New file.
12714 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
12716 * archive.cc (Archive::include_member): Update calls to add_symbols.
12717 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
12718 the Layout argument.
12719 * dynobj.h (do_add_symbols): Add the Layout argument.
12720 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
12722 * object.h (Object::add_symbols): Add the Layout argument.
12723 (Object::do_add_symbols): Add the Layout argument.
12724 (Sized_relobj::do_add_symbols): Add the Layout argument.
12725 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
12726 Unify the two versions.
12727 (Add_plugin_symbols): Remove.
12728 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
12729 (Sized_pluginobj::do_add_symbols): Unify the two versions.
12730 (Add_plugin_symbols): Remove.
12731 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
12732 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
12733 (Add_symbols::run): Make it work with Pulginobj.
12735 2009-02-06 Ian Lance Taylor <iant@google.com>
12737 * object.cc (Sized_relobj::do_layout): Make info message start
12738 with lower case letter.
12740 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
12742 * binary.cc: Fix file comment.
12744 * options.h (enum Incremental_disposition): Define.
12745 (class General_options): Add new options: --incremental,
12746 --incremental_changed, --incremental_unchanged,
12747 --incremental_unknown. Add incremental_disposition_ and
12748 implicit_incremental_ fields.
12749 (General_options::incremental_disposition): New function.
12750 (class Position_dependent_options): Add incremental_disposition
12752 (Position_dependent_options::copy_from_options): Set incremental
12754 * options.cc (General_options::parse_incremental_changed): New
12756 (General_options::parse_incremental_unchanged): New function.
12757 (General_options::parse_incremental_unknown): New function.
12758 (General_options::General_options): Initialize new fields
12759 incremental_disposition_ and implicit_incremental_.
12760 (General_options::finalize): Check for uasge of --incremental-*
12761 without --incremental.
12763 2009-02-06 Chris Demetriou <cgd@google.com>
12765 * gold.h (gold_undefined_symbol): Change to take only a Symbol
12766 pointer and to report location as the file name associated with
12768 (gold_undefined_symbol_at_location): New function to replace the
12769 old gold_undefined_symbol functionality.
12770 * target-reloc.h (relocate_section): Update to use
12771 gold_undefined_symbol_at_location.
12772 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12773 Call gold_undefined_symbol function rather than gold_error.
12774 * errors.h (Errors::undefined_symbol): Take location as a
12775 string, rather than calculating it from a relocation.
12776 * errors.cc (Errors::fatal): Print "fatal error:" before the
12778 (Errors::error, Errors::error_at_location): Print "error: "
12779 before the formatted message.
12780 (Errors::undefined_symbol): Take location as a string, rather
12781 than calculating it from a relocation.
12782 (gold_undefined_symbol_at_location): New function akin to
12783 old gold_undefined_symbol, calculates location from relocation.
12784 (gold_undefined_symbol): Change to take only a Symbol pointer
12785 and to report location as the file name associated with the symbol.
12786 * testsuite/debug_msg.sh: Update for changed error messages.
12787 * testsuite/undef_symbol.sh: Likewise.
12789 2009-02-04 Duncan Sands <baldrick@free.fr>
12792 * reduced_debug_output.h
12793 (Output_reduced_debug_abbrev_section::failed): Use format for
12795 (Output_reduced_debug_info_section::faild): Likewise.
12797 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
12799 * script.cc (Lazy_demangler): New class.
12800 (Version_script_info::get_symbol_version_helper): Demangle a
12803 2009-01-29 Cary Coutant <ccoutant@google.com>
12805 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
12807 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12809 2009-01-28 Ian Lance Taylor <iant@google.com>
12811 * version.cc (version_string): Bump to 1.9.
12813 * gold.h: Include <cstring> and <stdint.h>.
12814 * version.cc: Include <cstdio>.
12815 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
12817 * reduced_debug_output.cc (insert_into_vector): Rename from
12818 Insert_into_vector; change all callers. Use Swap_unaligned to
12819 avoid aliasing issue; remove union since it is unnecessary.
12821 2009-01-27 Sriraman Tallam <tmsriram@google.com>
12823 * Makefile.am (CCFILES): Add gc.cc.
12824 (HFILES): Add gc.h.
12825 * Makefile.in: Regenerate.
12826 * gold.cc (Gc_runner): New class.
12827 (queue_initial_tasks): Call garbage collection related tasks
12828 when corresponding options are invoked.
12829 (queue_middle_gc_tasks): New function.
12830 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
12831 processed early before laying out sections during garbage collection.
12832 * gold.h (queue_middle_gc_tasks): New function.
12833 (is_prefix_of): Move from "layout.cc".
12834 * i386.cc (Target_i386::gc_process_relocs): New function.
12835 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
12836 * main.cc (main): Create object of class "Garbage_collection".
12837 * object.cc (Relobj::copy_symbols_data): New function.
12838 (Relobj::is_section_name_included): New function.
12839 (Sized_relobj::do_layout): Allow this function to be called twice
12840 during garbage collection and defer layout of section during the
12842 * object.h (Relobj::get_symbols_data): New function.
12843 (Relobj::is_section_name_included): New function.
12844 (Relobj::copy_symbols_data): New function.
12845 (Relobj::set_symbols_data): New function.
12846 (Relobj::get_relocs_data): New function.
12847 (Relobj::set_relocs_data): New function.
12848 (Relobj::is_output_section_offset_invalid): New pure virtual function.
12849 (Relobj::gc_process_relocs): New function.
12850 (Relobj::do_gc_process_relocs): New pure virtual function.
12851 (Relobj::sd_): New data member.
12852 (Sized_relobj::is_output_section_offset_invalid): New function.
12853 (Sized_relobj::do_gc_process_relocs): New function.
12854 * options.h (General_options::gc_sections): Modify to not be a no-op.
12855 (General_options::print_gc_sections): New option.
12856 * plugin.cc (Plugin_finish::run): Remove function call to
12857 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
12858 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
12859 * reloc.cc (Read_relocs::run): Add task to process relocs and
12860 determine unreferenced sections when doing garbage collection.
12861 (Gc_process_relocs): New class.
12862 (Sized_relobj::do_gc_process_relocs): New function.
12863 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
12864 sections that are garbage collected.
12865 * reloc.h (Gc_process_relocs): New class.
12866 * sparc.cc (Target_sparc::gc_process_relocs): New function.
12867 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
12868 symbols whose corresponding sections are garbage collected.
12869 (Symbol_table::Symbol_table): Add new parameter for the garbage
12871 (Symbol_table::gc_mark_undef_symbols): New function.
12872 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12873 (Symbol_table::gc_mark_dyn_syms): New function.
12874 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
12876 (Symbol_table::add_from_object): Likewise.
12877 (Symbol_table::add_from_relobj): When building shared objects, do not
12878 treat externally visible symbols as garbage.
12879 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
12880 table information for static and relocatable links.
12881 * symtab.h (Symbol_table::set_gc): New function.
12882 (Symbol_table::gc): New function.
12883 (Symbol_table::gc_mark_undef_symbols): New function.
12884 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12885 (Symbol_table::gc_mark_dyn_syms): New function.
12886 (Symbol_table::gc_): New data member.
12887 * target.h (Sized_target::gc_process_relocs): New pure virtual
12889 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
12890 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
12892 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
12894 * options.h (General_options::gc_sections): Define as a no-op for now.
12895 (General_options::no_keep_memory): Ditto.
12896 (General_options::Bshareable): Define.
12897 * options.cc (General_options::finalize): Honor -Bshareable.
12899 2009-01-20 Andreas Schwab <schwab@suse.de>
12901 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
12902 read the value in the contents, since we don't use it. Use the
12903 template endianness when writing.
12904 (Relocate::relocate): Use it for R_PPC_REL16_HA.
12906 2009-01-19 Andreas Schwab <schwab@suse.de>
12908 * configure.tgt (powerpc64-*): Fix targ_obj.
12910 2009-01-15 Ian Lance Taylor <iant@google.com>
12912 * object.cc (Sized_relobj::write_local_symbols): Don't write out
12913 local symbols when stripping all symbols.
12915 2009-01-14 Cary Coutant <ccoutant@google.com>
12917 * output.cc (Output_reloc): Add explicit instantiations.
12919 2009-01-14 Cary Coutant <ccoutant@google.com>
12921 * archive.cc (Archive::get_elf_object_for_member): Remove call
12922 to File_read::claim_for_plugin.
12923 * descriptors.cc (Descriptors::open): Remove reference to
12925 (Descriptors::claim_for_plugin): Remove.
12926 * descriptors.h (Descriptors::claim_for_plugin): Remove.
12927 (Descriptors::is_claimed): Remove.
12928 (claim_descriptor_for_plugin): Remove.
12929 * fileread.cc (File_read::claim_for_plugin): Remove.
12930 * fileread.h (File_read::claim_for_plugin): Remove.
12931 (File_read::descriptor): Reopen descriptor if necessary.
12932 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
12933 (Plugin_manager::all_symbols_read): Add task parameter. Change
12935 (Plugin_manager::get_input_file): New function.
12936 (Plugin_manager::release_input_file): New function.
12937 (Pluginobj::Pluginobj): Add filesize parameter and initialize
12938 corresponding data member.
12939 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
12940 and pass to base constructor. Change all callers.
12941 (get_input_file, release_input_file): New functions.
12942 (make_sized_plugin_object): Add filesize parameter. Change all callers.
12943 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
12944 (Plugin_manager::all_symbols_read): Add task parameter.
12945 (Plugin_manager::get_input_file): New function.
12946 (Plugin_manager::release_input_file): New function.
12947 (Plugin_manager::task_): New data member.
12948 (Pluginobj::Pluginobj): Add filesize parameter.
12949 (Pluginobj::filename): New function.
12950 (Pluginobj::descriptor): New function.
12951 (Pluginobj::filesize): New function.
12952 (Pluginobj::filesize_): New data member.
12953 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
12954 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
12955 File_read::claim_for_plugin; use Object::unlock to unlock the file.
12957 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
12958 with archive libraries.
12959 * testsuite/Makefile.in: Regenerate.
12960 * testsuite/plugin_test.c (struct sym_info): New type.
12961 (get_input_file, release_input_file): New static variables.
12962 (onload): Capture new transfer vector entries.
12963 (claim_file_hook): Stop reading at end of file according to filesize.
12964 Factor out parsing of readelf output into separate function.
12965 (all_symbols_read_hook): Exercise get_input_file and release_input_file
12966 APIs and get the source file name from the symbol table. Convert
12967 source file name to corresponding object file name. Print info
12968 message when adding new input files.
12969 (parse_readelf_line): New function.
12970 * testsuite/plugin_test_1.sh: Add checks for new info messages.
12971 * testsuite/plugin_test_2.sh: Likewise.
12972 * testsuite/plugin_test_3.sh: Likewise.
12973 * testsuite/plugin_test_4.sh: New test case.
12975 2009-01-07 Ian Lance Taylor <iant@google.com>
12977 * version.cc (version_string): Bump to 1.8.
12979 2008-12-23 Cary Coutant <ccoutant@google.com>
12981 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
12982 * plugin.cc (Plugin_manager::finish): Rename as
12983 layout_deferred_objects. Move cleanup to separate function.
12984 (Plugin_manager::cleanup): New function.
12985 (Plugin_finish::run): Call layout_deferred_objects and cleanup
12987 * plugin.h (Plugin_manager::finish): Rename as
12988 layout_deferred_objects.
12989 (Plugin_manager::cleanup): New function.
12990 (Plugin_manager::cleanup_done): New field.
12992 2008-12-23 Cary Coutant <ccoutant@google.com>
12994 * plugin.cc (is_visible_from_outside): New function.
12995 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
12996 so we don't return "IR only" status for exported symbols or -r links.
12998 * testsuite/Makefile.am (plugin_test_3): New test case.
12999 * testsuite/Makefile.in: Regenerate.
13000 * testsuite/plugin_test_3.sh: New file.
13002 2008-12-22 Cary Coutant <ccoutant@google.com>
13004 * object.cc (Sized_relobj::layout_section): New function.
13005 (Sized_relobj::do_layout): Defer layout of input sections until after
13006 plugin has provided replacement files.
13007 (Sized_relobj::do_layout_deferred_sections): New function.
13008 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13009 (Relobj::layout_deferred_sections): New function.
13010 (Relobj::do_layout_deferred_sections): New function.
13011 (Sized_relobj::do_layout_deferred_sections): New function.
13012 (Sized_relobj::layout_section): New function.
13013 (Sized_relobj::Deferred_layout): New structure.
13014 (Sized_relobj::deferred_layout_): New field.
13015 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13016 Change all callers. Layout deferred sections.
13017 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13019 (Plugin_hook::run): Move code from do_plugin_hook inline.
13020 (Plugin_hook::do_plugin_hook): Remove.
13021 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13022 (Plugin_manager::finish): Renamed, was cleanup.
13023 (Plugin_manager::should_defer_layout): New function.
13024 (Plugin_manager::add_deferred_layout_object): New function.
13025 (Plugin_manager::Deferred_layout_list): New type.
13026 (Plugin_manager::deferred_layout_objects_): New field.
13027 (Plugin_hook::do_plugin_hook): Remove.
13029 2008-12-17 Ian Lance Taylor <iant@google.com>
13031 * options.h (class General_options): Add --no case for
13034 2008-12-16 Cary Coutant <ccoutant@google.com>
13036 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
13038 (Plugin_manager::claim_file): Create plugin object even if
13039 plugin did not call the add_symbols callback.
13040 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
13041 asking for more symbols than were added.
13042 * testsuite/Makefile.am (plugin_test_1): Add test case with
13044 (empty.syms): New target.
13045 * testsuite/Makefile.in: Regenerate.
13046 * testsuite/plugin_test.c (claim_file_hook): Add new debug
13047 message. Don't call add_symbols if no globals.
13048 (all_symbols_read_hook): Don't provide replacement for empty
13051 2008-12-12 Ian Lance Taylor <iant@google.com>
13053 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
13054 r_type == 0 for a local symbol with r_sym == 0.
13055 (scan_relocatable_relocs): Pass r_sym to
13056 local_non_section_strategy.
13057 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
13060 * configure.ac: Update test for TLS descriptors: they are
13061 supported as of glibc 2.9.
13062 * configure: Rebuild.
13064 2008-12-11 Ian Lance Taylor <iant@google.com>
13067 * target-reloc.h (Default_scan_relocatable_relocs): For each
13068 function, map r_type == 0 to RELOC_DISCARD.
13070 2008-12-10 Cary Coutant <ccoutant@google.com>
13072 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
13073 object to override a kept COMDAT group from a plugin object.
13075 2008-12-09 Ian Lance Taylor <iant@google.com>
13078 * yyscript.y (file_cmd): Handle INPUT.
13080 * testsuite/initpri1.c: Change all declarations to be full
13081 prototypes by adding void, to avoid compiler warnings.
13083 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
13085 * options.cc (General_options::parse_plugin_opt): New.
13086 (General_options::add_plugin): The argument now is just the filename.
13087 (General_options::add_plugin_option): New.
13088 * options.h (plugin_opt): New.
13089 (add_plugin): Change argument name.
13090 (add_plugin_option): New.
13091 * plugin.cc (Plugin::load): Don't parse the plugin option.
13092 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
13093 (Plugin::add_option): New.
13094 (Plugin::args_): Change type.
13095 (Plugin::filename_): New.
13096 (Plugin_manager::add_plugin_option): New.
13097 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
13098 * testsuite/Makefile.in: Regenerate.
13100 2008-12-05 Cary Coutant <ccoutant@google.com>
13102 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
13103 Handle --strip-lto-sections option.
13104 * options.h (strip_lto_sections): New option.
13106 2008-12-01 Cary Coutant <ccoutant@google.com>
13108 * plugin.cc (ld_plugin_message): Change format parameter to const.
13109 Fix mismatch between new[] and delete.
13111 2008-11-14 Cary Coutant <ccoutant@google.com>
13113 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
13116 2008-11-05 Craig Silverstein <csilvers@google.com>
13118 * options.cc (General_options::parse_dynamic_list): New function.
13119 * options.h (General_options): New flags dynamic_list,
13120 dynamic_list_data, dynamic_list_cpp_new, and
13121 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
13122 (General_options::in_dynamic_list): New function.
13123 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
13124 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
13125 (Lex::can_continue_name): Likewise.
13127 (read_script_file): New parameter script_options.
13128 (read_dynamic_list): New function.
13129 (Script_options::define_dynamic_list): New function.
13130 (dynamic_list_keyword_parsecodes): New variable.
13131 (dynamic_list_keywords): New variable.
13132 * script.h (Script_options::define_dynamic_list): New function
13134 (read_dynamic_list): New function prototype.
13135 * symtab.cc (strprefix): New macro.
13136 (Symbol::should_add_dynsym_entry): Support dynamic_list,
13137 dynamic_list_data, dynamic_list_cpp_new, and
13138 dynamic_list_cpp_typeinfo.
13139 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
13140 (dynamic_list_expr): New rule.
13141 (dynamic_list_nodes): Likewise.
13142 (dynamic_list_node): Likewise.
13143 * testsuite/Makefile.am (dynamic_list): New test.
13144 * testsuite/Makefile.in: Regenerated.
13145 * testsuite/dynamic_list.t: New file.
13146 * testsuite/dynamic_list.sh: New file.
13148 2008-11-05 Craig Silverstein <csilvers@google.com>
13150 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
13151 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
13152 (t11_last): Likewise.
13153 * testsuite/ver_test_6.c (main): Likewise.
13155 2008-10-07 Cary Coutant <ccoutant@google.com>
13157 * options.c (General_options::finalize): Add check for -static and
13159 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
13162 2008-10-02 Cary Coutant <ccoutant@google.com>
13164 * plugin.cc (make_sized_plugin_object): Fix conditional
13165 compilation to work when not all targets are enabled.
13167 2008-09-29 Cary Coutant <ccoutant@google.com>
13169 * archive.cc (Archive::get_file_and_offset): Use filename instead
13170 of name to get library path.
13171 (Archive::include_member): Unlock external member of a thin archive.
13173 * testsuite/Makefile.am (TEST_AR): New variable.
13174 (thin_archive_test_1): New test.
13175 (thin_archive_test_2): New test.
13176 * testsuite/Makefile.in: Regenerate.
13177 * testsuite/thin_archive_main.cc: New file.
13178 * testsuite/thin_archive_test_1.cc: New file.
13179 * testsuite/thin_archive_test_2.cc: New file.
13180 * testsuite/thin_archive_test_3.cc: New file.
13181 * testsuite/thin_archive_test_4.cc: New file.
13183 2008-09-29 Cary Coutant <ccoutant@google.com>
13185 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
13186 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
13188 (Sized_relobj::do_finalize_local_symbols): Likewise.
13189 (Sized_relobj::map_to_kept_section): Likewise.
13190 * object.h (Sized_relobj::invalid_address): New constant.
13191 (Sized_relobj::do_output_section_offset): Check for invalid_address
13193 * output.cc (Output_reloc::local_section_offset): Use constant
13194 invalid_address instead of -1U.
13195 (Output_reloc::get_address): Likewise.
13196 (Output_section::output_address): Change -1U to -1ULL.
13197 * output.h (Output_reloc::invalid_address): New constant.
13198 * reloc.cc (Sized_relobj::write_sections): Use constant
13199 invalid_address instead of -1U.
13200 (Sized_relobj::relocate_sections): Likewise.
13201 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
13202 values for merge sections.
13203 * target-reloc.h (relocate_for_relocatable): Use constant
13204 invalid_address instead of -1U.
13206 2008-09-19 Cary Coutant <ccoutant@google.com>
13208 Add plugin functionality for link-time optimization (LTO).
13209 * configure.ac (plugins): Add --enable-plugins option.
13210 * configure: Regenerate.
13211 * config.in: Regenerate.
13212 * Makefile.am (LIBDL): New variable.
13213 (CCFILES): Add plugin.cc.
13214 (HFILES): Add plugin.h.
13215 (ldadd_var): Add LIBDL.
13216 * Makefile.in: Regenerate.
13218 * archive.cc: Include "plugin.h".
13219 (Archive::setup): Don't preread archive symbols when using a plugin.
13220 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
13221 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
13223 (Archive::include_member): Add symbols from plugin objects.
13224 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
13225 * descriptors.cc (Descriptors::open): Check for file descriptors
13226 abandoned by plugins.
13227 (Descriptors::claim_for_plugin): New function.
13228 * descriptors.h (Descriptors::claim_for_plugin): New function.
13229 (Open_descriptor::is_claimed): New field.
13230 (claim_descriptor_for_plugin): New function.
13231 * fileread.cc (File_read::claim_for_plugin): New function.
13232 * fileread.h (File_read::claim_for_plugin): New function.
13233 (File_read::descriptor): New function.
13234 * gold.cc: Include "plugin.h".
13235 (queue_initial_tasks): Add task to call plugin hooks for generating
13237 * main.cc: Include "plugin.h".
13238 (main): Load plugin libraries.
13239 * object.h (Pluginobj): Declare.
13240 (Object::pluginobj): New function.
13241 (Object::do_pluginobj): New function.
13242 (Object::set_target): New function.
13243 * options.cc: Include "plugin.h".
13244 (General_options::parse_plugin): New function.
13245 (General_options::General_options): Initialize plugins_ field.
13246 (General_options::add_plugin): New function.
13247 * options.h (Plugin_manager): Declare.
13248 (General_options): Add --plugin option.
13249 (General_options::has_plugins): New function.
13250 (General_options::plugins): New function.
13251 (General_options::add_plugin): New function.
13252 (General_options::plugins_): New field.
13253 * plugin.cc: New file.
13254 * plugin.h: New file.
13255 * readsyms.cc: Include "plugin.h".
13256 (Read_symbols::do_read_symbols): Check for archive before checking
13257 for ELF file. Call plugin hooks to claim files.
13258 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
13259 from a real object file; force override when processing replacement
13261 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
13262 (Symbol::init_base_object): Likewise.
13263 (Symbol::init_base_output_data): Likewise.
13264 (Symbol::init_base_output_segment): Likewise.
13265 (Symbol::init_base_constant): Likewise.
13266 (Symbol::init_base_undefined): Likewise.
13267 (Symbol::output_section): Assert that object is not a plugin.
13268 (Symbol_table::add_from_pluginobj): New function.
13269 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
13271 (Symbol_table::sized_write_globals): Likewise.
13272 (Symbol_table::add_from_pluginobj): Instantiate template.
13273 * symtab.h (Sized_pluginobj): Declare.
13274 (Symbol::in_real_elf): New function.
13275 (Symbol::set_in_real_elf): New function.
13276 (Symbol::in_real_elf_): New field.
13277 (Symbol_table::add_from_pluginobj): New function.
13279 * testsuite/Makefile.am (AM_CFLAGS): New variable.
13280 (LIBDL): New variable.
13281 (LDADD): Add LIBDL.
13282 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
13283 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
13284 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
13285 (MOSTLYCLEANFILES): Likewise.
13286 * testsuite/Makefile.in: Regenerate.
13287 * testsuite/plugin_test.c: New file.
13288 * testsuite/plugin_test_1.sh: New file.
13289 * testsuite/plugin_test_2.sh: New file.
13291 2008-09-16 Ian Lance Taylor <iant@google.com>
13293 * target-reloc.h (relocate_section): Check whether a symbol is
13294 defined by the ABI before reporting an undefined symbol error.
13295 * target.h (Target::is_defined_by_abi): Make parameter const.
13296 (Target::do_is_defined_by_abi): Likewise.
13297 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
13298 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
13299 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
13300 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
13301 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
13302 * testsuite/Makefile.in: Rebuild.
13304 * fileread.cc (make_view): Add casts to avoid warning.
13306 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
13308 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
13309 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13311 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
13313 * options.h (General_options::output_is_executable): New.
13314 (General_options::output_is_pie): New.
13315 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
13316 for shared libraries.
13317 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13319 2008-09-11 Chris Demetriou <cgd@google.com>
13321 * options.h (origin): New -z option.
13322 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
13323 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
13326 2008-09-05 Cary Coutant <ccoutant@google.com>
13328 * fileread.cc (File_read::make_view): Add check for attempt to map
13329 beyond end of file.
13331 2008-09-05 Cary Coutant <ccoutant@google.com>
13333 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
13334 explicit instantiations.
13336 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
13339 * options.cc (General_options::finalize): Allow undefined symbols
13340 in shlibs if linking -shared.
13343 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
13344 symbols as not needing a dynsym entry.
13346 2008-08-20 Craig Silverstein <csilvers@google.com>
13348 * fileread.cc (File_read::open): Do not lock the file unless it
13349 was successfully opened.
13351 2008-08-14 Cary Coutant <ccoutant@google.com>
13353 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
13354 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
13355 * testsuite/tls_test.cc (struct int128): 128-bit struct
13356 for testing TLS relocs with non-zero addend.
13357 (v12): New TLS variable.
13359 (t_last): Add check for v12.
13360 * testsuite/tls_test.h (t12): New function.
13361 * testsuite/tls_test_main.cc (thread_routine): Call new test.
13363 2008-08-13 Ian Lance Taylor <iant@google.com>
13365 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
13366 set tls_segment_ or relro_segment_.
13367 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
13369 * output.h (Output_section::clear_is_relro): New function.
13370 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
13371 sections specially even when output_data_ is empty.
13372 (Output_segment::maximum_alignment): When first section is relro,
13373 only force alignment for PT_LOAD segments.
13374 * script.cc (script_data_segment_align): New function.
13375 (script_data_segment_relro_end): New function.
13376 * script-c.h (script_data_segment_align): Declare.
13377 (script_data_segment_relro_end): Declare.
13378 * script-sections.h (class Script_sections): Declare
13379 data_segment_align and data_segment_relro_end. Add fields
13380 segment_align_index_ and saw_relro_end_.
13381 * script-sections.cc (class Sections_element): Add set_is_relro
13382 virtual function. Add new bool* parameter to place_orphan_here.
13383 Add get_output_section virtual function.
13384 (class Output_section_definition): Add set_is_relro. Add new
13385 bool* parameter to place_orphan_here. Add get_output_section.
13386 Add is_relro_ field.
13387 (Output_section_definition::Output_section_definition): Initialize
13388 evaluated_address_, evaluated_load_address, evaluated_addralign_,
13389 and is_relro_ fields.
13390 (Output_section_definition::place_orphan_here): Add is_relro
13392 (Output_section_definition::set_section_addresses): Set relro for
13394 (Output_section_definition::alternate_constraint): Likewise.
13395 (class Orphan_output_section): Add new bool* parameter to
13396 place_orphan_here. Add get_output_section.
13397 (Orphan_output_section::place_orphan_here): Add is_relro
13399 (Script_sections::Script_sections): Initialize
13400 data_segment_align_index_ and saw_relro_end_.
13401 (Script_sections::data_segment_align): New function.
13402 (Script_sections::data_segment_relro_end): New function.
13403 (Script_sections::place_orphan): Set or clear is_relro.
13404 (Script_sections::set_section_addresses): Force alignment of first
13406 * yyscript.y (exp): Call script_data_segment_align and
13407 script_data_segment_relro_end.
13408 * testsuite/relro_script_test.t: New file.
13409 * testsuite/relro_test.cc (using_script): Declare.
13410 (t1, t2): Test using_script.
13411 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
13412 (relro_script_test_SOURCES): Define.
13413 (relro_script_test_DEPENDENCIES): Define.
13414 (relro_script_test_LDFLAGS): Define.
13415 (relro_script_test_LDADD): Define.
13416 (relro_script_test.so): New target.
13417 * testsuite/Makefile.in: Rebuild.
13419 2008-08-06 Cary Coutant <ccoutant@google.com>
13421 * archive.cc (Archive::total_archives, Archive::total_members)
13422 (Archive::total_members_loaded): New variables.
13423 (Archive::setup): Add parameter. Add option to preread
13425 (Archive::read_armap): Add counter.
13426 (Archive::get_file_and_offset): New function.
13427 (Archive::get_elf_object_for_member): New function.
13428 (Archive::read_all_symbols): New function.
13429 (Archive::read_symbols): New function.
13430 (Archive::add_symbols): Add counters.
13431 (Archive::include_all_members): Use armap to find members if it's
13433 (Archive::include_member): Skip reading symbols if already read.
13434 Factored code into Archive::get_file_and_offset and
13435 Archive::get_elf_object_for_member. Changed call to
13436 Mapfile::report_include_archive_member.
13437 (Archive::print_stats): New function.
13438 * archive.h: Declare Object and Read_symbols_data classes.
13439 (Archive::Archive): Add initializers for new members.
13440 (Archive::setup): Add parameter.
13441 (Archive::print_stats): New function.
13442 (Archive::total_archives, Archive::total_members)
13443 (Archive::total_members_loaded): New variables.
13444 (Archive::get_file_and_offset): New function.
13445 (Archive::get_elf_object_for_member): New function.
13446 (Archive::read_all_symbols): New function.
13447 (Archive::read_symbols): New function.
13448 (Archive::Archive_member): New class.
13449 (Archive::members_): New member.
13450 (Archive::num_members_): New member.
13451 * main.cc: Include archive.h.
13452 (main): Call Archive::print_stats.
13453 * mapfile.cc (Mapfile::report_include_archive_member): Delete
13454 archive parameter; member_name is now the fully-decorated name.
13455 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
13456 * options.h: (General_options): Add --preread-archive-symbols option.
13457 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
13460 2008-08-04 Ian Lance Taylor <iant@google.com>
13462 * symtab.h (Symbol::use_plt_offset): New function.
13463 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
13464 * powerpc.cc (Relocate::relocate): Likewise.
13465 * sparc.cc (Relocate::relocate): Likewise.
13466 * x86_64.cc (Relocate::relocate): Likewise.
13467 * testsuite/weak_plt.sh: New test.
13468 * testsuite/weak_plt_main.cc: New test.
13469 * testsuite/weak_plt_shared.cc: New test.
13470 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
13471 (check_PROGRAMS): Add weak_plt.
13472 (check_DATA): Add weak_plt_shared.so.
13473 (weak_plt_main_pic.o, weak_plt): New targets.
13474 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
13475 * testsuite/Makefile.in: Rebuild.
13477 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
13479 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
13480 * testsuite/Makefile.in: Rebuild.
13482 2008-08-04 Alan Modra <amodra@bigpond.net.au>
13484 * Makefile.am (POTFILES.in): Set LC_ALL=C.
13485 * Makefile.in: Regenerate.
13486 * po/POTFILES.in: Regenerate.
13488 2008-07-29 Ian Lance Taylor <iant@google.com>
13490 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
13491 symbols before other symbols.
13492 * testsuite/script_test_2.cc (test_addr): Declare.
13493 (test_addr_alias): Declare.
13494 (main): Check that test_addr and test_addr_alias have the right
13496 * testsuite/script_test_2.t: Define test_addr_alias and
13499 2008-07-24 Ian Lance Taylor <iant@google.com>
13502 * descriptors.cc: New file.
13503 * descriptors.h: New file.
13504 * gold-threads.h (class Hold_optional_lock): New class.
13505 * fileread.cc: Include "descriptors.h".
13506 (File_read::~File_read): Release descriptor rather than closing
13508 (File_read::open) [file]: Call open_descriptor rather than open.
13509 Set is_descriptor_opened_.
13510 (File_read::open) [memory]: Assert that descriptor is not open.
13511 (File_read::reopen_descriptor): New function.
13512 (File_read::release): Release descriptor.
13513 (File_read::do_read): Make non-const. Reopen descriptor.
13514 (File_read::read): Make non-const.
13515 (File_read::make_view): Reopen descriptor.
13516 (File_read::do_readv): Likewise.
13517 * fileread.h (class File_read): Add is_descriptor_opened_ field.
13518 Update declarations.
13519 * layout.cc: Include "descriptors.h".
13520 (Layout::create_build_id): Use open_descriptor rather than open.
13521 * output.cc: Include "descriptors.h".
13522 (Output_file::open): Use open_descriptor rather than open.
13523 * archive.cc (Archive::const_iterator): Change Archive to be
13525 (Archive::begin, Archive::end): Make non-const.
13526 (Archive::count_members): Likewise.
13527 * archive.h (class Archive): Update declarations.
13528 * object.h (Object::read): Make non-const.
13529 * Makefile.am (CCFILES): Add descriptors.cc.
13530 (HFILES): Add descriptors.h.
13531 * Makefile.in: Rebuild.
13534 * gold.h: Always include <clocale>. Add Solaris workarounds
13535 following code in binutils/sysdep.h.
13538 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
13539 this->eh_frame_hdr_ is NULL before using it.
13541 * dynobj.cc (Versions::Versions): Update comment.
13543 * dynobj.cc (Versions::Versions): If there is an soname, use it as
13544 the base version name.
13546 * stringpool.cc (Stringpool_template::add_with_length): Set key to
13547 array size plus one.
13548 (Stringpool_template::set_string_offsets): Subtract one from key
13549 before using it as an array index.
13550 (Stringpool_template::get_offset_with_length): Likewise.
13551 (Stringpool_template::write_to_buffer): Likewise.
13552 * stringpool.h (Stringpool_template::get_offset_from_key):
13555 2008-07-23 Ian Lance Taylor <iant@google.com>
13558 * object.h (Merged_symbol_value::value): Do our best to handle a
13562 * script.cc (Version_script_info::get_versions): Don't add empty
13563 version tag to return value.
13564 (Version_script_info::get_symbol_version_helper): Change return
13565 type to bool. Add pversion parameter. Change all callers.
13566 (script_register_vers_node): Don't require a non-NULL tag.
13567 * script.h (class Version_script_info): Update declarations.
13568 (Version_script_info::get_symbol_version): Change return type to
13569 bool. Add version parameter. Change all callers.
13570 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
13571 handling. Handle an empty version from a version script.
13572 (Symbol_table::define_special_symbol): Likewise.
13573 * testsuite/ver_test_10.script: New file.
13574 * testsuite/ver_test_10.sh: New file.
13575 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
13576 (check_DATA): Add ver_test_10.syms.
13577 (ver_test_10.syms, ver_test_10.so): New target.
13578 * testsuite/Makefile.in: Rebuild.
13580 2008-07-23 Simon Baldwin <simonb@google.com>
13582 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
13583 to zero for undefined symbols from dynamic libraries.
13585 2008-07-23 Ian Lance Taylor <iant@google.com>
13587 * symtab.cc (Symbol_table::resolve): Remove version parameter.
13588 Change all callers.
13589 * symtab.h (class Symbol_table): Update declaration.
13590 * testsuite/ver_test_9.cc: New file.
13591 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
13592 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
13593 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
13594 (ver_test_9.so, ver_test_9.o): New targets.
13595 * testsuite/Makefile.in: Rebuild.
13597 2008-07-22 Ian Lance Taylor <iant@google.com>
13599 * options.h (class General_options): Define --check-sections.
13600 * layout.cc (Layout::set_segment_offsets): Handle
13603 * options.h (class General_options): Define -n/--nmagic and
13605 * options.cc (General_options::finalize): For -n/--nmagic or
13606 -N/--omagic, set -static.
13607 * layout.cc (Layout::attach_allocated_section_to_segment): If
13608 -N/--omagic, don't put read-only and read-write sections in
13609 different segments.
13610 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
13611 finding a read-only segment.
13612 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
13613 don't set the minimum segment alignment to the common page size,
13614 and don't set the file offset to the address modulo the page size.
13615 * script-sections.cc (Script_sections::create_segments): If
13616 -n/--omagic, don't put read-only and read-write sections in
13617 different segments.
13619 * cref.cc: New file.
13620 * cref.h: New file.
13621 * options.h (class General_options): Add --print-symbol-counts.
13622 * main.cc (main): Issue defined symbol report if requested.
13623 * archive.cc (Archive::interpret_header): Make into a const member
13625 (Archive::add_symbols): Call Input_objects::archive_start and
13627 (Archive::const_iterator): Define new class.
13628 (Archive::begin, Archive::end): New functions.
13629 (Archive::include_all_members): Rewrite to use iterator.
13630 (Archive::count_members): New function.
13631 * archive.h (class Archive): Update declarations.
13632 (Archive::filename): New function.
13633 * object.cc: Include "cref.h".
13634 (Sized_relobj::Sized_relobj): Initialize defined_count_.
13635 (Sized_relobj::do_get_global_symbol_counts): New function.
13636 (Input_objects::add_object): Add object to cross-referencer.
13637 (Input_objects::archive_start): New function.
13638 (Input_objects::archive_stop): New function.
13639 (Input_objects::print_symbol_counts): New function.
13640 * object.h: Declare Cref and Archive.
13641 (Object::get_global_symbol_counts): New function.
13642 (Object::do_get_global_symbol_counts): New pure virtual function.
13643 (class Sized_relobj): Add defined_count_ field. Update
13645 (class Input_objects): Add cref_ field. Update constructor.
13646 Update declarations.
13647 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
13649 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
13651 (Sized_dynobj::do_get_global_symbol_counts): New function.
13652 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
13653 defined_count_. Update declarations. Define Symbols typedef.
13654 * symtab.cc (Symbol_table::add_from_relobj): Add defined
13655 parameter. Change all callers.
13656 (Symbol_table::add_from_dynobj): Add sympointers and defined
13657 parameters. Change all callers.
13658 * symtab.h (class Symbol_table): Update declarations.
13659 * Makefile.am (CCFILES): Add cref.cc.
13660 (HFILES): Add cref.h.
13661 * Makefile.in: Rebuild.
13663 2008-07-22 Simon Baldwin <simonb@google.com>
13665 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
13666 to zero when writing undefined symbols.
13668 2008-07-22 Ian Lance Taylor <iant@google.com>
13670 * output.cc (Output_section::add_input_section): Don't try to
13671 merge empty merge sections.
13673 2008-07-21 Craig Silverstein <csilvers@google.com>
13675 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13676 Include symbol version in error message.
13678 2008-07-20 Chris Demetriou <cgd@google.com>
13680 * configure.ac (gold_cv_c_random_seed): New configured variable.
13681 (RANDOM_SEED_CFLAGS): New substituted variable.
13682 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
13683 * configure: Rebuild.
13684 * Makefile.in: Likewise.
13685 * testsuite/Makefile.in: Likewise.
13687 2008-07-18 Ian Lance Taylor <iant@google.com>
13689 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
13690 where we see NAME/NULL and NAME/VERSION as separate symbols.
13691 * testsuite/ver_test_main.cc (main): Call t4.
13692 (t4, t4_2a): Define.
13693 * testsuite/ver_test_2.cc (t4_2): Define.
13694 * testsuite/ver_test_2.script: Put t4_2a in VER2.
13695 * testsuite/ver_test_4.cc (t4_2a): Define.
13696 * testsuite/ver_test_4.script: Put t4_2a in VER2.
13697 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
13699 2008-07-17 Ian Lance Taylor <iant@google.com>
13701 * dynobj.cc (Versions::add_def): If we give an error about a
13702 missing version, go ahead and create the version anyhow.
13704 2008-07-10 Ian Lance Taylor <iant@google.com>
13706 Handle output sections with more than 0x7fffffff bytes.
13707 * object.h (class Relobj): Change map_to_output_ to
13708 output_sections_, and just keep a section pointer. Change all
13709 uses. Move comdat group support to Sized_relobj.
13710 (Relobj::is_section_specially_mapped): Remove.
13711 (Relobj::output_section): Remove poff parameter. Change all
13713 (Relobj::output_section_offset): New function.
13714 (Relobj::set_section_offset): Rewrite.
13715 (Relobj::map_to_output): Remove.
13716 (Relobj::output_sections): New function.
13717 (Relobj::do_output_section_offset): New pure virtual function.
13718 (Relobj::do_set_section_offset): Likewise.
13719 (class Sized_relobj): Add section_offsets_ field. Add comdat
13720 group support from Relobj. Update declarations.
13721 (Sized_relobj::get_output_section_offset): New function.
13722 (Sized_relobj::do_output_section_offset): New function.
13723 (Sized_relobj::do_set_section_offset): New function.
13724 * object.cc (Relobj::output_section_address): Remove.
13725 (Sized_relobj::Sized_relobj): Initialize new fields.
13726 (Sized_relobj::include_section_group): Cast find_kept_object to
13728 (Sized_relobj::include_linkonce_section): Likewise.
13729 (Sized_relobj::do_layout): Use separate arrays for output section
13731 (Sized_relobj::do_count_local_symbols): Change map_to_output to
13733 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
13734 output_sections and section_offsets.
13735 (Sized_relobj::write_local_symbols): Likewise.
13736 (map_to_kept_section): Compute output address directly.
13737 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
13738 output_sections and section_offsets.
13739 (Sized_relobj::write_sections): Likewise.
13740 (Sized_relobj::relocate_sections): Likewise.
13741 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
13742 * output.h (class Output_reloc): Update declarations. Change
13743 u2_.relobj to Sized_relobj*.
13744 (class Output_data_reloc): Change add functions to use
13746 * output.cc (Output_reloc::Output_reloc): Change relobj to
13748 (Output_reloc::local_section_offset): Change return type to
13749 Elf_Addr. Use get_output_section_offset.
13750 (Output_reloc::get_address): Likewise.
13751 (Output_section::is_input_address_mapped): Don't call
13752 is_section_specially_mapped.
13753 (Output_section::output_offset): Likewise.
13754 (Output_section::output_address): Likewise.
13755 (Output_section::starting_output_address): Likewise.
13756 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
13757 parameter to Sized_relobj*.
13758 (Copy_relocs::need_copy_reloc): Likewise.
13759 (Copy_relocs::save): Likewise.
13760 * copy-relocs.h (class Copy_relocs): Update declarations.
13761 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
13762 Sized_relobj*. Change relobj_ field to Sized_relobj*.
13763 * target-reloc.h (relocate_for_relocatable): Change
13764 offset_in_output_section type to Elf_Addr. Change code that uses
13766 * layout.cc (Layout::layout): Always set *off.
13767 * mapfile.cc (Mapfile::print_input_section): Use
13768 output_section_offset.
13769 * i386.cc (Target_i386::copy_reloc): Change object parameter to
13771 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
13772 * sparc.cc (Target_sparc::copy_reloc): Likewise.
13773 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
13775 2008-07-03 Ian Lance Taylor <iant@google.com>
13777 * layout.cc (Layout::include_section): Do not discard unrecognized
13778 SHT_STRTAB sections.
13780 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
13782 * script.cc (Lex::can_continue_name): Make '?' allowable in
13783 version-script names.
13784 * testsuite/version_script.map: Change glob pattern to use '?'
13786 2008-06-30 Manish Singh <yosh@gimp.org>
13789 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
13792 2008-06-30 Ian Lance Taylor <iant@google.com>
13796 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
13797 versions]: Don't try to read the value in the contents, since we
13798 don't use it. Use the template endianness when writing.
13800 2008-06-25 Cary Coutant <ccoutant@google.com>
13802 * fileread.cc (File_read::make_view): Assert on zero-length view.
13803 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
13804 symbol table when there are no symbols to read.
13806 2008-06-23 Craig Silverstein <csilvers@google.com>
13808 * version.cc (version_string): Bump to 1.7
13810 2008-06-18 Craig Silverstein <csilvers@google.com>
13812 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
13813 constant 0xFFFF to type Valtype.
13814 (Powerpc_relocate_functions::rel16_ha): Likewise.
13816 2008-06-17 Ian Lance Taylor <iant@google.com>
13818 * output.h (Output_section::Input_section): Initialize p2align_ to
13819 zero for Output_section_data constructors.
13820 (Output_section::Input_section::addralign): If not an input
13821 section, return the alignment of the Output_section_data.
13822 * testsuite/copy_test.cc: New file.
13823 * testsuite/copy_test_1.cc: New file.
13824 * testsuite/copy_test_2.cc: New file.
13825 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
13826 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
13827 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
13828 (copy_test_1_pic.o, copy_test_1.so): New targets.
13829 (copy_test_2_pic.o, copy_test_2.so): New targets.
13830 * testsuite/Makefile.in: Rebuild.
13832 * script-sections.cc (Script_sections::place_orphan): Initialize
13833 local variable exact.
13835 2008-06-13 David Edelsohn <edelsohn@gnu.org>
13837 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
13839 2008-06-12 David Edelsohn <edelsohn@gnu.org>
13840 David S. Miller <davem@davemloft.net>
13842 * powerpc.cc: New file.
13843 * Makefile.am (TARGETSOURCES): Add powerpc.cc
13844 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
13845 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
13846 * Makefile.in: Rebuild.
13848 2008-06-09 Ian Lance Taylor <iant@google.com>
13850 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
13852 (throwing, orig_terminate): New static variables.
13853 (terminate_handler): New static function.
13854 (t2): Set terminate handler.
13856 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
13859 * binary.cc (Binary_to_elf::sized_convert): Fix .data
13862 2008-05-30 Cary Coutant <ccoutant@google.com>
13864 * archive.cc (Archive::include_all_members) Correct to step
13865 over symbol table and extended name table in thin archives.
13867 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
13870 * target-reloc.h (relocate_for_relocatable): Fix new_offset
13873 2008-05-28 Caleb Howe <cshowe@google.com>
13875 * reduced_debug_output.cc: New file.
13876 * reduced_debug_output.h: New file.
13877 * options.h (class General_options): Add --strip-debug-non-line.
13878 * options.cc (General_options::finalize): Add strip_debug_non_line
13879 to the strip heirarchy.
13880 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
13882 * layout.cc: Include "reduced_debug_output.h".
13883 (Layout::Layout): Initialize new fields.
13884 (line_only_debug_sections): New static array.
13885 (is_lines_only_debug_sections): New static inline function.
13886 (Layout::include_section): Handle --strip-debug-non-line.
13887 (Layout::make_output_section): If --strip-debug-non-line, build
13888 new output sections for .debug_abbrev and .debug_info.
13889 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
13890 gold. Warn about possible overflow.
13891 (read_signed_LEB_128): Likewise.
13892 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
13893 (read_signed_LEB_128): Declare.
13894 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
13895 (HFILES): Add reduced_debug_output.h.
13896 * Makefile.in: Rebuild.
13898 2008-05-21 Ian Lance Taylor <iant@google.com>
13900 * mapfile.cc: New file.
13901 * mapfile.h: New file.
13902 * options.h (class General_options): Add -M/--print-map and -Map.
13903 * options.cc (General_options::finalize): Make -M equivalent to
13905 * main.cc: Include <cstdio> and "mapfile.h".
13906 (main): Open mapfile if requested.
13907 * gold.cc (class Middle_runner): Add mapfile_ field. Update
13908 constructor. Change caller.
13909 (queue_initial_tasks): Add mapfile parameter. Change caller.
13910 (queue_middle_tasks): Likewise.
13911 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
13913 * archive.cc: Include "mapfile.h".
13914 (Archive::add_symbols): Add mapfile parameter. Change all
13915 callers. Pass mapfile, symbol, and reason to include_member.
13916 (Archive::include_all_members): Add mapfile parameter. Change all
13918 (Archive::include_member): Add mapfile, sym, and why parameters.
13919 Change all callers. Report inclusion to map file.
13920 * archive.h: Include "fileread.h".
13921 (class Archive): Update declarations.
13922 (Archive::file): New const method.
13923 (class Add_archive_symbols): Add mapfile_ field. Update
13924 constructor. Change all callers.
13925 * readsyms.h (class Read_symbols): Likewise.
13926 (class Finish_group): Likewise.
13927 (class Read_script): Likewise.
13928 * common.cc: Include "mapfile.h".
13929 (Symbol_table::allocate_commons): Add mapfile parameter. Change
13931 (Symbol_table::do_allocate_commons): Likewise.
13932 (Symbol_table::do_allocate_commons_list): Likewise. Report common
13933 symbol allocation to mapfile.
13934 * common.h (class Allocate_commons_task): Add mapfile_ field.
13935 Update constructor. Change all callers.
13936 * symtab.h (class Symbol_table): Update declarations.
13937 * layout.cc: Include "mapfile.h".
13938 (Layout_task_runner::run): Print information to mapfile.
13939 (Layout::create_gold_note): Change Output_data_fixed_space to
13940 Output_data_zero_fill.
13941 (Layout::create_build_id): Likewise.
13942 (Layout::print_to_mapfile): New function.
13943 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
13944 constructor. Change caller.
13945 (class Layout): Declare print_to_mapfile.
13946 * output.cc (Output_section::Input_section::print_to_mapfile): New
13948 (Output_section::add_input_section): If producing a map, always
13949 add to input_sections_ list.
13950 (Output_section::do_print_to_mapfile): New function.
13951 (Output_segment::print_sections_to_mapfile): New function.
13952 (Output_segment::print_section_list_to_mapfile): New function.
13953 * output.h: Include "mapfile.h".
13954 (Output_data::print_to_mapfile): New function.
13955 (Output_data::do_print_to_mapfile): New virtual function.
13956 (Output_segment_headers::do_print_to_mapfile): New function.
13957 (Output_file_header::do_print_to_mapfile): New function.
13958 (Output_data_const::do_print_to_mapfile): New function.
13959 (class Output_data_const_buffer): Add map_name_ field. Update
13960 constructor. Change all callers. Add do_print_to_mapfile
13962 (class Output_data_fixed_space): Likewise.
13963 (class Output_data_space): Likewise.
13964 (class Output_data_zero_fill): New class.
13965 (Output_data_strtab::do_print_to_mapfile): New function.
13966 (Output_data_reloc_base::do_print_to_mapfile): New function.
13967 (Output_relocatable_relocs::do_print_to_mapfile): New function.
13968 (Output_data_group::do_print_to_mapfile): New function.
13969 (Output_data_got::do_print_to_mapfile): New function.
13970 (Output_data_dynamic::do_print_to_mapfile): New function.
13971 (Output_symtab_xindex::do_print_to_mapfile): New function.
13972 (class Output_section): Declare do_print_to_mapflie. Declare
13973 print_to_mapfile in Input_section.
13974 (class Output_segment): Declare new functions.
13975 * object.h (Sized_relobj::symbol_count): New function.
13976 * script-sections.cc
13977 (Output_section_element_dot_assignment::set_section_addresses):
13978 Change Output_data_fixed_space to Output_data_zero_fill.
13979 (Output_data_expression::do_print_to_mapfile): New function.
13980 * script.cc (read_input_script): Add mapfile parameter. Change
13982 * script.h (read_input_script): Update declaration.
13983 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
13984 (Eh_frame::do_print_to_mapfile): New function.
13985 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
13986 (Output_merge_string::do_print_to_mapfile): New function.
13987 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
13989 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
13991 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
13993 * Makefile.am (CCFILES): Add mapfile.cc.
13994 (HFILES): Add mapfile.h.
13995 * Makefile.in: Rebuild.
13997 2008-05-19 Ian Lance Taylor <iant@google.com>
13999 * options.h (class General_options): Add -z relro.
14000 * layout.cc (Layout::Layout): Initialize relro_segment_.
14001 (Layout::add_output_section_data): Return the output section.
14002 (Layout::make_output_section): Rcognize relro sections and mark
14003 them appropriately.
14004 (Layout::attach_allocated_section_to_segment): Put relro sections
14005 in a PT_GNU_RELRO segment.
14006 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14008 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14010 (Layout::linkonce_mapping): Map d.rel.ro.local to
14011 .data.rel.ro.local.
14012 (Layout::output_section_name): Us .data.rel.ro.local for any
14013 section which begins with that.
14014 * layout.h (class Layout): Update add_output_section_data
14015 declaration. Add relro_segment_ field.
14016 * output.cc (Output_section::Output_section): Initialize is_relro_
14017 and is_relro_local_ fields.
14018 (Output_segment::add_output_section): Group relro sections.
14019 (Output_segment::is_first_section_relro): New function.
14020 (Output_segment::maximum_alignment): If there is a relro section,
14021 align the segment to the common page size.
14022 (Output_segment::set_section_addresses): Track whether we are
14023 looking at relro sections. If the last section is a relro
14024 section, align to the common page size.
14025 (Output_segment::set_section_list_addresses): Add in_relro
14026 parameter. Change all callers. Align to the page size when
14027 moving from relro to non-relro section.
14028 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
14030 * output.h (class Output_section): Add is_relro_ and
14031 is_relro_local_ fields.
14032 (Output_section::is_relro): New function.
14033 (Output_section::set_is_relro): New function.
14034 (Output_section::is_relro_local): New function.
14035 (Output_section::set_is_relro_local): New function.
14036 (class Output_segment): Update declarations.
14037 * i386.cc (Target_i386::got_section): Mark .got section as relro.
14038 * sparc.cc (Target_sparc::got_section): Likewise.
14039 * x86_64.cc (Target_x86_64::got_section): Likewise.
14040 * testsuite/relro_test_main.cc: New file.
14041 * testsuite/relro_test.cc: New file.
14042 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
14043 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
14044 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
14045 (relro_test.so, relro_test_pic.o): New targets.
14046 * testsuite/Makefile.in: Rebuild.
14048 2008-05-16 Ian Lance Taylor <iant@google.com>
14050 * output.cc (Output_segment::add_output_section): Remove front
14052 * output.h (class Output_segment): Remove
14053 add_initial_output_section and overloaded add_output_section.
14054 Update declaration of remaining add_output_section.
14055 * layout.cc (Layout::create_interp): Call add_output_section
14056 rather than add_initial_output_section.
14057 (Layout::finish_dynamic_section): Likewise.
14059 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
14060 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
14061 know the dynamic type.
14062 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
14063 field. Initialize it in constructor.
14064 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
14065 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
14066 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
14069 * output.cc (Output_reloc::get_address): Change return type to
14071 * output.h (class Output_reloc): Update get_address declaration.
14072 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
14073 for section addresses.
14075 2008-05-09 Ian Lance Taylor <iant@google.com>
14078 * gold.cc (gold_nomem): Use return value of write.
14080 2008-05-08 Ian Lance Taylor <iant@google.com>
14082 * symtab.c (Symbol::init_base_output_data): Add version
14083 parameter. Change all callers.
14084 (Symbol::init_base_output_segment): Likewise.
14085 (Symbol::init_base_constant): Likewise.
14086 (Symbol::init_base_undefined): Likewise.
14087 (Sized_symbol::init_output_data): Likewise.
14088 (Sized_symbol::init_output_segment): Likewise.
14089 (Sized_symbol::init_constant): Likewise.
14090 (Sized_symbol::init_undefined): Likewise.
14091 (Symbol_table::do_define_in_output_data): If the new symbol has a
14092 version, mark it as the default.
14093 (Symbol_table::do_define_in_output_segment): Likewise.
14094 (Symbol_table::do_define_as_constant): Likewise.
14095 * symtab.h (class Symbol): Update declarations.
14096 (class Sized_symbol): Likewise.
14097 * resolve.cc (Symbol::override_version): New function.
14098 (Symbol::override_base): Call override_version.
14099 (Symbol::override_base_with_special): Likewise.
14100 * testsuite/ver_script_8.script: New file.
14101 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
14102 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
14103 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
14104 (ver_test_8_1.so, ver_test_8_2.so): New targets.
14106 2008-05-06 Ian Lance Taylor <iant@google.com>
14109 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
14111 (class General_options): Remove existing --undefined, and add
14112 --no-undefined instead. Add new --undefined as synonym for -u.
14113 * archive.cc (Archive::add_symbols): Check whether symbol was
14115 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
14116 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
14117 all uses. Add IS_UNDEFINED. Update declarations to split
14118 different versions of init_base. Declare init_base_undefined.
14119 (Symbol::is_defined): Handle IS_UNDEFINED.
14120 (Symbol::is_undefined): Likewise.
14121 (Symbol::is_weak_undefined): Call is_undefined.
14122 (Symbol::is_absolute): Handle IS_CONSTANT.
14123 (class Sized_symbol): Update declarations to split different
14124 versions of init. Declare init_undefined.
14125 (class Symbol_table): Declare new functions.
14126 * symtab.cc (Symbol::init_base_object): Rename from init_base.
14127 Change all callers.
14128 (Symbol::init_base_output_data): Likewise.
14129 (Symbol::init_base_output_segment): Likewise.
14130 (Symbol::init_base_constant): Likewise.
14131 (Symbol::init_base_undefined): New function.
14132 (Sized_symbol::init_object): Rename from init. Change all
14134 (Sized_symbol::init_output_data): Likewise.
14135 (Sized_symbol::init_output_segment): Likewise.
14136 (Sized_symbol::init_constant): Likewise.
14137 (Sized_symbol::init_undefined): New function.
14138 (Symbol_table::add_undefined_symbols_from_command_line): New
14140 (Symbol_table::do_add_undefined_symbols_from_command_line): New
14142 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
14143 (Symbol::output_section): Likewise.
14144 (Symbol::set_output_section): Likewise.
14145 (Symbol_table::sized_finalize_symbol): Likewise.
14146 (Symbol_table::sized_write_globals): Likewise.
14147 * resolve.cc (Symbol_table::should_override): Likewise.
14148 (Symbol::override_base_with_special): Likewise.
14150 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
14151 symbol, change it to have default visibility.
14152 * testsuite/protected_1.cc: New file.
14153 * testsuite/protected_2.cc: New file.
14154 * testsuite/protected_3.cc: New file.
14155 * testsuite/protected_main_1.cc: New file.
14156 * testsuite/protected_main_2.cc: New file.
14157 * testsuite/protected_main_3.cc: New file.
14158 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
14159 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
14160 (protected_1_LDFLAGS, protected_1_LDADD): Define.
14161 (protected_1.so): New target.
14162 (protected_1_pic.o, protected_2_pic.o): New targets.
14163 (protected_3_pic.o): New target.
14164 (check_PROGRAMS): Add protected_2.
14165 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
14166 (protected_2_LDFLAGS, protected_2_LDADD): Define.
14167 * testsuite/Makefile.in: Rebuild.
14169 * options.h (DEFINE_var): Add set_user_set_##varname__.
14170 (DEFINE_bool_alias): New macro.
14171 (class General_options): Define -Bstatic using DEFINE_bool_alias
14172 rather than DEFINE_special. Add --undefined as an alias for -z
14174 * options.cc (General_options::parse_Bstatic): Remove.
14176 * options.h (class General_options): Add --fatal-warnings.
14177 * main.cc (main): Implement --fatal-warnings.
14178 * errors.h (Errors::warning_count): New function.
14180 * options.h (class General_options): Add -Bsymbolic-functions.
14181 * symtab.h (Symbol::is_preemptible): Check for
14182 -Bsymbolic-functions.
14184 2008-05-05 Ian Lance Taylor <iant@google.com>
14186 * options.h (DEFINE_bool): For DASH_Z, create the negative option
14187 as noVARNAME rather than no-VARNAME.
14188 (class General_options): Add option -z combreloc.
14189 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
14191 (Output_reloc::sort_before) [SHT_REL]: New function.
14192 (Output_reloc::sort_before) [SHT_RELA]: New function.
14193 (class Output_data_reloc_base): Add sort_relocs_ field. Define
14194 Sort_relocs_comparison.
14195 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
14196 parameter. Change all callers.
14197 (Output_data_reloc::Output_data_reloc) [both versions]: Add
14198 sort_relocs parameter. Change all callers.
14199 * output.cc (Output_reloc::get_address): New function, broken out
14201 (Output_reloc::write_rel): Call it.
14202 (Output_reloc::compare): New function.
14203 (Output_data_reloc_base::do_write): Optionally sort relocs.
14205 * configure.ac: If targ_extra_obj is set, link it in.
14206 * configure.tgt: Initialize all variables.
14207 (x86_64*): Set targ_extra_obj and targ_extra_size.
14208 * configure: Rebuild.
14210 * object.cc (Sized_relobj::include_section_group): Adjust section
14211 indexes read from group data. Build vector to pass to
14213 * layout.cc (Layout::layout_group): Add flags and shndxes
14214 parameters. Remove contents parameter. Change caller. Update
14215 explicit instantiations.
14216 * layout.h (class Layout): Update layout_group declaration.
14217 * output.cc (Output_data_group::Output_data_group): Add flags and
14218 input_shndxes parameters. Remove contents parameter. Change
14220 (Output_data_group::do_write): Change input_sections_ to
14222 * output.h (class Output_data_group): Update constructor
14223 declaration. Rename input_sections_ to input_shndxes_.
14224 * testsuite/many_sections_test.cc: Add template.
14226 2008-04-30 Cary Coutant <ccoutant@google.com>
14228 * target-reloc.h (relocate_section): Fix dead-pointer bug.
14230 * layout.cc (Layout::include_section): Refactored check for debug
14232 (Layout::add_comdat): Add new parameters. Change type
14233 of signature parameter. Add object and shndx to signatures table.
14234 (Layout::find_kept_object): New function.
14235 * layout.h: Include <cstring>.
14236 (Layout::is_debug_info_section): New function.
14237 (Layout::add_comdat): Add new parameters.
14238 (Layout::find_kept_object): New function.
14239 (Layout::Kept_section): New struct.
14240 (Layout::Signatures): Change type of map range.
14241 * object.cc (Relobj::output_section_address): New function.
14242 (Sized_relobj::include_section_group): Add new parameters. Change
14243 calls to Layout::add_comdat. Change to build table of kept comdat
14244 groups and table mapping discarded sections to kept sections.
14245 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
14246 (Sized_relobj::do_layout): Change calls to include_section_group and
14247 include_linkonce_section.
14248 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
14249 value to zero when section is discarded.
14250 (Sized_relobj::map_to_kept_section): New function.
14251 * object.h (Relobj::output_section_address): New function.
14252 (Relobj::Comdat_group): New type.
14253 (Relobj::find_comdat_group): New function.
14254 (Relobj::Comdat_group_table): New type.
14255 (Relobj::Kept_comdat_section): New type.
14256 (Relobj::Kept_comdat_section_table): New type.
14257 (Relobj::add_comdat_group): New function.
14258 (Relobj::set_kept_comdat_section): New function.
14259 (Relobj::get_kept_comdat_section): New function.
14260 (Relobj::comdat_groups_): New field.
14261 (Relobj::kept_comdat_sections_): New field.
14262 (Symbol_value::input_value): Update comment.
14263 (Sized_relobj::map_to_kept_section) New function.
14264 (Sized_relobj::include_linkonce_section): Add new parameter.
14265 * target-reloc.h (Comdat_behavior): New type.
14266 (get_comdat_behavior): New function.
14267 (relocate_section): Add code to map a discarded section to the
14268 corresponding kept section when applying a relocation.
14270 2008-04-30 Craig Silverstein <csilvers@google.com>
14272 * dwarf_reader.cc (next_generation_count): New static var.
14273 (Addr2line_cache_entry): New struct.
14274 (addr2line_cache): New static var.
14275 (Dwarf_line_info::one_addr2line): Added caching.
14276 (Dwarf_line_info::clear_addr2line_cache): New function.
14277 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
14278 cache-size parameter.
14279 (Dwarf_line_info::one_addr2line_cache): New function.
14280 * symtab.cc (Symbol_table::detect_odr_violations): Pass
14281 new cache-size argument to one_addr2line(), and clear cache.
14283 2008-04-28 Cary Coutant <ccoutant@google.com>
14285 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
14286 R_386_PC8 relocations.
14288 2008-04-23 Ian Lance Taylor <iant@google.com>
14290 * object.cc (Sized_relobj::include_section_group): Check for
14291 invalid section group.
14293 * object.cc (make_elf_object): Correct test for 64-bit ELF file
14296 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
14297 than read for file header.
14298 * archive.cc (Archive::include_member): Likewise.
14300 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
14302 * aclocal.m4: Regenerate.
14303 * configure: Regenerate.
14305 2008-04-19 Ian Lance Taylor <iant@google.com>
14307 * version.cc (version_string): Bump to 1.6.
14309 * testsuite/Makefile.am (many_sections_r_test): New target.
14310 (many_sections_r_test_SOURCES): Remove.
14311 (many_sections_r_test_DEPENDENCIES): Remove.
14312 (many_sections_r_test_LDFLAGS): Remove.
14313 (many_sections_r_test_LDADD): Remove.
14315 * object.cc (Sized_relobj::do_add_symbols): Always pass
14316 local_symbol_count_ to add_from_relobj.
14318 * testsuite/Makefile.am (many_sections_check.h): Only check one in
14319 every thousand variables.
14320 * testsuite/Makefile.in: Rebuild.
14322 * object.cc (Xindex::initialize_symtab_xindex): New function.
14323 (Xindex::read_symtab_xindex): New function.
14324 (Xindex::sym_xindex_to_shndx): New function.
14325 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
14327 (Sized_relobj::do_initialize_xindex): New function.
14328 (Sized_relobj::do_read_symbols): Adjust section links.
14329 (Sized_relobj::symbol_section_and_value): Add is_ordinary
14330 parameter. Change all callers.
14331 (Sized_relobj::include_section_group): Adjust section links and
14332 symbol section indexes.
14333 (Sized_relobj::do_layout): Adjust section links.
14334 (Sized_relobj::do_count_local_symbols): Adjust section links and
14335 symbol section indexes.
14336 (Sized_relobj::do_finalize_local_symbols): Distinguish between
14337 ordinary and special symbols.
14338 (Sized_relobj::write_local_symbols): Add symtab_xindex and
14339 dynsym_xindex parameters. Change all callers. Adjust section
14340 links. Use SHN_XINDEX when needed.
14341 (Sized_relobj::get_symbol_location_info): Adjust section links.
14342 Don't get fooled by special symbols.
14343 * object.h (class Xindex): Define.
14344 (class Object): Add xindex_ parameter. Declare virtual functoin
14345 do_initialize_xindex.
14346 (Object::adjust_sym_shndx): New function.
14347 (Object::set_xindex): New protected function.
14348 (class Symbol_value): Add is_ordinary_shndx_ field.
14349 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
14350 (Symbol_value::value): Assert ordinary section.
14351 (Symbol_value::initialize_input_to_output_map): Likewise.
14352 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
14353 Change all callers.
14354 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
14356 (class Sized_relobj): Update declarations.
14357 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
14358 parameter. Change all callers.
14359 (Sized_relobj::adjust_shndx): New function.
14360 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
14362 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
14363 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
14364 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
14365 (Sized_dynobj::read_dynsym_section): Adjust section links.
14366 (Sized_dynobj::read_dynamic): Likewise.
14367 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
14369 (Sized_dynobj::do_initialize_xindex): New function.
14370 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
14371 do_initialize_xindex.
14372 (Sized_dynobj::adjust_shndx): New function.
14373 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
14374 dynsym_xindex_ fields.
14375 (Layout::finalize): Add a call to set_section_indexes before
14376 creating the symtab sections.
14377 (Layout::set_section_indexes): Don't do anything if the section
14378 already has a section index.
14379 (Layout::create_symtab_sections): Add shnum parameter. Change
14380 caller. Create .symtab_shndx section if needed.
14381 (Layout::create_shdrs): Add shstrtab_section parameter. Change
14383 (Layout::allocated_output_section_count): New function.
14384 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
14386 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
14387 fields. Update declarations.
14388 (Layout::symtab_xindex): New function.
14389 (Layout::dynsym_xindex): New function.
14390 (class Write_symbols_task): Add layout_ field.
14391 (Write_symbols_task::Write_symbols_task): Add layout parameter.
14393 * output.cc (Output_section_headers::Output_section_headers): Add
14394 shstrtab_section parameter. Change all callers.
14395 (Output_section_headers::do_sized_write): Store overflow values
14396 for section count and section string table section index in
14397 section header zero.
14398 (Output_file_header::do_sized_write): Check for overflow of
14399 section count and section string table section index.
14400 (Output_symtab_xindex::do_write): New function.
14401 (Output_symtab_xindex::endian_do_write): New function.
14402 * output.h (class Output_section_headers): Add shstrtab_section_.
14403 Update declarations.
14404 (class Output_symtab_xindex): Define.
14405 (Output_section::has_out_shndx): New function.
14406 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
14408 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
14409 Change all callers.
14410 (Sized_symbol::init): Likewise.
14411 (Symbol::output_section): Check for ordinary symbol.
14412 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
14413 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
14415 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
14416 Change all callers. Simplify handling of symbols from sections
14417 not included in the link.
14418 (Symbol_table::add_from_dynobj): Handle ordinary symbol
14420 (Weak_alias_sorter::operator()): Assert that symbols are
14422 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
14424 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
14425 parameters. Change all callers.
14426 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
14427 symbol distinction. Use SHN_XINDEX when needed.
14428 (Symbol_table::write_section_symbol): Add symtab_xindex
14429 parameter. Change all callers.
14430 (Symbol_table::sized_write_section_symbol): Likewise. Use
14431 SHN_XINDEX when needed.
14432 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
14434 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
14435 (Symbol::is_defined): Check is_ordinary.
14436 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
14437 (Symbol::is_absolute, Symbol::is_common): Likewise.
14438 (class Sized_symbol): Update declarations.
14439 (class Symbol_table): Update declarations.
14440 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
14441 parameters. Change all callers.
14442 (Sized_symbol::override): Likewise.
14443 (Symbol_table::override): Likewise.
14444 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
14445 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
14446 is_ordinary, and orig_st_shndx parameters. Change all callers.
14447 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
14448 to be in an ordinary section.
14449 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
14450 object and is_ordinary parameters. Change all callers.
14451 (Sized_dwarf_line_info::read_relocs): Add object parameter.
14452 Change all callers. Don't add undefined or non-ordinary symbols
14454 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
14455 Change all callers.
14456 * dwarf_reader.h (class Sized_dwarf_line_info): Update
14458 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
14459 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
14460 (Sized_relobj::relocate_sections): Likewise.
14461 * target-reloc.h (scan_relocs): Adjust section symbol index.
14462 (scan_relocatable_relocs): Likewise.
14463 * i386.cc (Scan::local): Check for ordinary symbols.
14464 * sparc.cc (Scan::local): Likewise.
14465 * x86_64.cc (Scan::local): Likewise.
14466 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
14467 to symbol_section_and_value.
14468 * testsuite/many_sections_test.cc: New file.
14469 * testsuite/Makefile.am (BUILT_SOURCES): Define.
14470 (check_PROGRAMS): Add many_sections_test.
14471 (many_sections_test_SOURCES): Define.
14472 (many_sections_test_DEPENDENCIES): Define.
14473 (many_sections_test_LDFLAGS): Define.
14474 (BUILT_SOURCES): Add many_sections_define.h.
14475 (many_sections_define.h): New target.
14476 (BUILT_SOURCES): Add many_sections_check.h.
14477 (many_sections_check.h): New target.
14478 (check_PROGRAMS): Add many_sections_r_test.
14479 (many_sections_r_test_SOURCES): Define.
14480 (many_sections_r_test_DEPENDENCIES): Define.
14481 (many_sections_r_test_LDFLAGS): Define.
14482 (many_sections_r_test_LDADD): Define.
14483 (many_sections_r_test.o): New target.
14484 * testsuite/Makefile.in: Rebuild.
14486 2008-04-17 Cary Coutant <ccoutant@google.com>
14488 * errors.cc (Errors::info): New function.
14489 (gold_info): New function.
14490 * errors.h (Errors::info): New function.
14491 * gold.h (gold_info): New function.
14492 * object.cc (Input_objects::add_object): Print trace output.
14493 * options.cc (options::parse_set): New function.
14494 (General_options::parse_wrap): Deleted.
14495 (General_options::General_options): Deleted initializer.
14496 * options.h (options::String_set): New typedef.
14497 (options::parse_set): New function.
14498 (DEFINE_set): New macro.
14499 (General_options::wrap): Changed to use DEFINE_set. Changed
14500 callers of any_wrap_symbols and is_wrap_symbol.
14501 (General_options::trace, General_options::trace_symbol):
14503 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
14504 (General_options::wrap_symbols_): Deleted.
14505 * symtab.cc (Symbol_table::add_from_object): Print trace output.
14507 2008-04-17 David S. Miller <davem@davemloft.net>
14509 * options.cc (General_options::parse_V): New function.
14510 * options.h: Add entries for -V and -Qy.
14512 2008-04-17 Ian Lance Taylor <iant@google.com>
14514 * common.cc (Symbol_table::allocate_commons): Remove options
14515 parameter. Change caller.
14516 (Symbol_table::do_allocate_commons): Remove options parameter.
14517 Change caller. Just call do_allocate_commons_list twice.
14518 (Symbol_table::do_allocate_commons_list): New function, broken out
14519 of do_allocate_commons.
14520 * common.h (class Allocate_commons_task): Remove options_ field.
14521 Update constructor.
14522 * symtab.cc (Symbol_table::Symbol_table): Initialize
14524 (Symbol_table::add_from_object): Put TLS common symbols on
14526 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
14527 which are IN_OUTPUT_DATA.
14528 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
14529 allocate_commons and do_allocate_commons declarations. Declare
14530 do_allocate_commons_list.
14531 * gold.cc (queue_middle_tasks): Update creation of
14532 Allocate_commons_task to not pass options.
14533 * testsuite/Makefile.am (INCLUDES): Add -I.. .
14534 (TLS_TEST_C_FLAGS): New variable.
14535 (tls_test_c_pic.o): New target.
14536 (tls_test_shared.so): Link in tls_test_c_pic.o.
14537 (tls_test_c_pic_ie.o): New target.
14538 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
14539 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
14540 (tls_test_c.o): New target.
14541 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
14542 (tls_pic_test_LDADD): Likewise.
14543 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
14544 (tls_shared_gd_to_ie_test_LDADD): Likewise.
14545 (tls_test_c_gnu2.o): New target.
14546 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
14548 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
14549 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
14550 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
14551 * testsuite/tls_test.cc: Include "config.h".
14552 (t_last): Call t11_last.
14553 * testsuite/tls_test.h (t11, t11_last): Declare.
14554 * testsuite/tls_test_c.c: New file.
14555 * testsuite/tls_test_main.cc (thread_routine): Call t11.
14556 * configure.ac: Check for OpenMP support.
14557 * configure, config.in, Makefile.in: Rebuild.
14558 * testsuite/Makefile.in: Rebuild.
14560 2008-04-16 Cary Coutant <ccoutant@google.com>
14562 * i386.cc (Target_i386::define_tls_base_symbol): New function.
14563 (Target_i386::tls_base_symbol_defined_): New field.
14564 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14565 (Target_i386::Scan::global): Likewise.
14566 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
14567 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
14568 (Target_x86_64::tls_base_symbol_defined_): New field.
14569 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14570 (Target_x86_64::Scan::global): Likewise.
14572 2008-04-16 Cary Coutant <ccoutant@google.com>
14574 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
14575 (Symbol::needs_plt_entry): Allow weak undefined symbols.
14576 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
14577 building shared libraries.
14578 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
14579 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
14580 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
14581 * testsuite/Makefile.in: Rebuild.
14582 * testsuite/weak_undef.h: New file.
14583 * testsuite/weak_undef_file1.cc: Add extra test cases.
14584 * testsuite/weak_undef_file2.cc: Likewise.
14585 * testsuite/weak_undef_test.cc: Likewise.
14587 2008-04-16 David S. Miller <davem@davemloft.net>
14589 * sparc.cc (Target_sparc::Scan): Change from struct to class.
14590 Add issued_non_pic_error_ field. Declare check_non_pic.
14591 (Target_sparc::Scan::check_non_pic): New function.
14592 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
14593 (Target_sparc::Scan::global): Likewise.
14595 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
14596 * configure: Rebuild.
14598 * options.h (DEFINE_enable): New macro.
14599 (new_dtags): New enable option.
14600 (initfirst, interpose, loadfltr, nodefaultlib,
14601 nodelete, nodlopen, nodump): New -z options.
14602 * layout.cc (Layout:finish_dynamic_section): If new
14603 dtags enabled, emit DT_RUNPATH. Also, emit a
14604 DT_FLAGS_1 containing any specified -z flags.
14606 2008-04-16 Ian Lance Taylor <iant@google.com>
14608 * copy-relocs.cc: New file.
14609 * copy-relocs.h: New file.
14610 * reloc.cc: Remove Copy_relocs code.
14611 * reloc.h: Likewise.
14612 * reloc-types.h (struct Reloc_types) [both versions]: Add
14613 get_reloc_addend_noerror.
14614 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
14615 variants of add_global which take an addend which must be zero.
14616 * i386.cc: Include "copy-relocs.h".
14617 (class Target_i386): Change type of copy_relocs_ to variable,
14618 update initializer.
14619 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
14620 Change all callers.
14621 (Target_i386::do_finalize_sections): Change handling of
14623 * sparc.cc: Include "copy-relocs.h".
14624 (class Target_sparc): Change type of copy_relocs_ to variable,
14625 update initializer.
14626 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
14627 Change all callers.
14628 (Target_sparc::do_finalize_sections): Change handling of
14630 * x86_64.cc: Include "copy-relocs.h".
14631 (class Target_x86_64): Change type of copy_relocs_ to variable,
14632 update initializer.
14633 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
14634 class. Change all callers.
14635 (Target_x86_64::do_finalize_sections): Change handling of
14637 * Makefile.am (CCFILES): Add copy-relocs.cc.
14638 (HFILES): Add copy-relocs.h.
14640 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
14642 * testsuite/script_test_4.sh: Permit leading zeroes.
14644 2008-04-15 Ian Lance Taylor <iant@google.com>
14646 * script-sections.cc (Script_sections::create_segments): Use
14647 header_size_adjustment even when there is enough room for the
14649 * testsuite/script_test_4.sh: New file.
14650 * testsuite/script_test_4.t: New file.
14651 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
14652 (check_DATA): Add script_test_4.stdout.
14653 (MOSTLYCLEANFILES): Likewise.
14654 (script_test_4): New target.
14655 (script_test_4.stdout): New target.
14656 * testsuite/Makefile.in: Rebuild.
14658 * sparc.cc: Add definitions for Output_data_plt_sparc class
14661 2008-04-14 David S. Miller <davem@davemloft.net>
14663 * sparc.cc: New file.
14664 * Makefile.am (TARGETSOURCES): Add sparc.cc
14665 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
14666 * configure.tgt: Document targ_extra_size and
14667 targ_extra_big_endian. Add entries for sparc-* and
14669 * configure.ac: Handle targ_extra_size and
14670 targ_extra_big_endian.
14671 * Makefile.in: Rebuild.
14672 * configure: Likewise.
14673 * po/POTFILES.in: Likewise.
14674 * po/gold.pot: Likewise.
14676 2008-04-14 Ian Lance Taylor <iant@google.com>
14678 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
14679 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
14680 in the name/type/flags to section mapping. Don't call
14681 allocate_output_section.
14682 (Layout::choose_output_section): Change parameter from adjust_name
14683 to is_input_section. Don't permit input sections after sections
14684 are attached to segments. Don't call allocate_output_section.
14685 (Layout::layout_eh_frame): Call update_flags_for_input_section,
14686 not write_enable_output_section.
14687 (Layout::make_output_section): Don't push to
14688 unattached_section_list_ nor call attach_to_segment. Call
14689 attach_section_to_segment if sections are attached.
14690 (Layout::attach_sections_to_segments): New function.
14691 (Layout::attach_section_to_segment): New function.
14692 (Layout::attach_allocated_section_to_segment): Rename from
14693 attach_to_segment. Remove flags parameter.
14694 (Layout::allocate_output_section): Remove function.
14695 (Layout::write_enable_output_section): Remove function.
14696 * layout.h (class Layout): Update for above changes. Add new
14697 field sections_are_attached_.
14698 * output.h (Output_section::update_flags_for_input_section): New
14700 * output.cc (Output_section::add_input_section): Call
14701 update_flags_for_input_section.
14702 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
14704 2008-04-11 Cary Coutant <ccoutant@google.com>
14706 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
14707 thought unnecessary.
14708 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
14710 2008-04-11 Ian Lance Taylor <iant@google.com>
14712 * output.h (class Output_section_data): Remove inline definition
14714 * output.cc (Output_section_data::set_addralign): New function.
14716 2008-04-11 Cary Coutant <ccoutant@google.com>
14718 Add support for TLS descriptors for i386 and x86_64.
14719 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
14720 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
14721 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
14723 (Target_i386::got_mod_index_entry): Remove unnecessary code.
14724 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
14725 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
14727 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
14728 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
14729 Fix problem with initial-exec relocations.
14730 (Target_i386::Relocate::relocate_tls): Likewise.
14731 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
14733 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
14734 support for section-plus-offset dynamic table entries.
14735 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
14736 (Output_data_dynamic::Dynamic_entry): Add support for
14737 section-plus-offset dynamic table entries.
14738 (Output_data_dynamic::Classification): Likewise.
14739 (Output_data_dynamic::classification_): Renamed offset_.
14740 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
14741 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
14742 (Target_x86_64::make_plt_section): New function.
14743 (Target_x86_64::reserve_tlsdesc_entries): New function.
14744 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
14745 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
14746 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
14747 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
14748 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
14749 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
14750 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
14751 add extra PLT entry for TLS descriptors.
14752 (Output_data_plt_x86_64::got_): New field.
14753 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
14754 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
14756 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
14758 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
14759 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
14760 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
14761 R_386_TLS_DESC_CALL relocations.
14762 (Target_x86_64::Scan::global): Likewise.
14763 (Target_x86_64::do_finalize_sections): Add dynamic table entries
14764 for TLS descriptors.
14765 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
14766 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
14767 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
14768 GD-to-IE relaxation.
14769 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
14770 and TLS_DESCRIPTORS.
14771 * Makefile.in: Rebuild.
14772 * configure: Rebuild.
14773 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
14774 (tls_test_shared2.so): New target.
14775 (tls_shared_gd_to_ie_test_SOURCES): New variable.
14776 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
14777 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
14778 (tls_shared_gd_to_ie_test_LDADD): New variable.
14779 (tls_shared_gnu2_gd_to_ie_test): New target.
14780 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
14782 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
14783 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
14784 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
14785 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
14786 (tls_shared_gnu2_test): New target.
14787 (tls_test_gnu2_shared.so): New target.
14788 (tls_shared_gnu2_test_SOURCES): New variable.
14789 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
14790 (tls_shared_gnu2_test_LDFLAGS): New variable.
14791 (tls_shared_gnu2_test_LDADD): New variable.
14792 * testsuite/Makefile.in: Rebuild.
14793 * testsuite/Makefile.
14795 2008-04-11 Ian Lance Taylor <iant@google.com>
14797 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
14799 * testsuite/Makefile.in: Rebuild.
14801 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
14803 * testsuite/script_test_2.cc (main): Adjust test.
14805 2008-04-11 David S. Miller <davem@davemloft.net>
14806 Ian Lance Taylor <iant@google.com>
14808 * options.h (General_options): Add entries for '-Y' and
14810 * options.cc (General_options:finalize): If -Y was used, add those
14811 entries to the library path instead of the default "/lib" and
14814 2008-04-11 David S. Miller <davem@davemloft.net>
14816 * testsuite/justsyms.t: Start at 0x100.
14817 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
14818 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
14820 * testsuite/script_test_2.cc: Adjust string and section length
14823 2008-04-09 Ian Lance Taylor <iant@google.com>
14826 * script-sections.cc (Sections_element::allocate_to_segment): Add
14828 (Output_section_definition::allocate_to_segment): Likewise.
14829 (Orphan_output_section::allocate_to_segment): Likewise.
14830 (Script_sections::attach_sections_using_phdrs_clause): Don't
14831 propagate non-PT_LOAD segments to orphan sections.
14832 * testsuite/Makefile.am (script_test_3.stdout): Generate using
14833 readelf rather than objdump.
14834 * testsuite/script_test_3.sh: Adjust accordingly. Test that
14835 .interp section and PT_INTERP segment are the same size.
14836 * testsuite/Makefile.in: Rebuild.
14838 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
14839 aliases for symbols defined in the same object.
14840 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
14841 (weak_alias_test_SOURCES): New variable.
14842 (weak_alias_test_DEPENDENCIES): New variable.
14843 (weak_alias_test_LDFLAGS): New variable.
14844 (weak_alias_test_LDADD): New variable.
14845 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
14846 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
14847 (weak_alias_test_3.o): New target.
14848 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
14849 * testsuite/weak_alias_test_main.cc: New file.
14850 * testsuite/weak_alias_test_1.cc: New file.
14851 * testsuite/weak_alias_test_2.cc: New file.
14852 * testsuite/weak_alias_test_3.cc: New file.
14854 2008-04-08 Ian Lance Taylor <iant@google.com>
14856 * options.h (class General_options): Add --noinhibit-exec option.
14857 * main.cc (main): Check --noinhibit-exec.
14859 * options.h (class General_options): Define --wrap as a special
14860 option. Add wrap_symbols_ field.
14861 (General_options::any_wrap_symbols): New function.
14862 (General_options::is_wrap_symbol): New function.
14863 * options.cc (General_options::parse_wrap): New function.
14864 (General_options::General_options): Initialize wrap_symbols_.
14865 * symtab.cc (Symbol_table::wrap_symbol): New function.
14866 (Symbol_table::add_from_object): Handle --wrap.
14867 * symtab.h (class Symbol_table): Declare wrap_symbol.
14868 * target.h (Target::wrap_char): New function.
14869 (Target::Target_info): Add wrap_char field.
14870 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
14871 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14872 * testsuite/testfile.cc (Target_test::test_target_info):
14875 * errors.cc (Errors::undefined_symbol): Mention symbol version if
14878 * layout.h (class Layout): Add added_eh_frame_data_ field.
14879 * layout.cc (Layout::Layout): Initialize new field.
14880 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
14881 output section until we find a section we merged successfully.
14882 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
14883 that the size be non-zero.
14885 * merge.cc (Object_merge_map::get_output_offset): Remove inline
14888 2008-04-08 Craig Silverstein <csilvers@google.com>
14890 * configure.ac: Export new conditional variable HAVE_ZLIB.
14891 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
14893 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
14894 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14896 2008-04-07 Ian Lance Taylor <iant@google.com>
14898 * version.cc (version_string): Set to "1.5".
14900 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
14901 Add issued_non_pic_error_ field. Declare check_non_pic.
14902 (Target_x86_64::Scan::check_non_pic): New function.
14903 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
14904 (Target_x86_64::Scan::global): Likewise.
14906 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
14907 addend parameter. Change caller. Handle merge sections.
14908 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
14909 Address to Addend. Don't add in the result of
14910 local_section_offset, pass down the addend and use the returned
14912 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
14913 Update declarations of local_section_offset and symbol_value.
14914 * testsuite/two_file_test_1.cc (t18): New function.
14915 * testsuite/two_file_test_2.cc (f18): New function.
14916 * testsuite/two_file_test_main.cc (main): Call t18.
14917 * testsuite/two_file_test.h (t18, f18): Declare.
14919 * configure.ac: Don't test for objdump, c++filt, or readelf.
14920 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
14922 (TEST_READELF): New variable.
14923 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
14924 (check_PROGRAMS): Add two_file_strip_test.
14925 (two_file_strip_test): New target.
14926 (check_PROGRAMS): Add two_file_same_shared_strip_test.
14927 (two_file_same_shared_strip_test_SOURCES): New variable.
14928 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
14929 (two_file_same_shared_strip_test_LDFLAGS): New variable.
14930 (two_file_same_shared_strip_test_LDADD): New variable.
14931 (two_file_shared_strip.so): New target.
14932 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
14933 (ver_test_5.syms, ver_test_7.syms): Likewise.
14934 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
14935 (strip_test_3.stdout): Use TEST_OBJDUMP.
14936 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14938 2008-04-04 Cary Coutant <ccoutant@google.com>
14940 * symtab.h (Symbol::is_weak_undefined): New function.
14941 (Symbol::is_strong_undefined): New function.
14942 (Symbol::is_absolute): New function.
14943 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
14944 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
14946 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
14947 (weak_undef_test): New target.
14948 * testsuite/Makefile.in: Rebuild.
14949 * testsuite/weak_undef_file1.cc: New file.
14950 * testsuite/weak_undef_file2.cc: New file.
14951 * testsuite/weak_undef_test.cc: New file.
14953 2008-04-03 Craig Silverstein <csilvers@google.com>
14955 * compressed_output.h (class Output_compressed_section): Use
14957 * compressed_output.cc (zlib_compress): Use unsigned buffers,
14959 (zlib_compressed_suffix): Removed.
14960 (Output_compressed_section::set_final_data_size): Use unsigned
14962 * testsuite/Makefile.am (flagstest_compress_debug_sections):
14963 Fix linker invocation.
14964 (flagstest_o_specialfile_and_compress_debug_sections):
14966 * testsuite/Makefile.in: Regenerated.
14968 2008-04-02 David S. Miller <davem@davemloft.net>
14970 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
14971 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
14973 2008-04-02 Craig Silverstein <csilvers@google.com>
14977 2008-04-02 Ian Lance Taylor <iant@google.com>
14979 * fileread.cc (File_read::find_view): Add byteshift and vshifted
14980 parameters. Update for new key type to views_. Change all
14982 (File_read::read): Adjust for byteshift in returned view.
14983 (File_read::add_view): New function, broken out of
14984 find_and_make_view.
14985 (File_read::make_view): New function, broken out of
14986 find_and_make_view.
14987 (File_read::find_or_make_view): Add offset and aligned
14988 parameters. Rewrite accordingly. Change all callers.
14989 (File_read::get_view): Add offset and aligned parameters. Adjust
14990 for byteshift in return value.
14991 (File_read::get_lasting_view): Likewise.
14992 * fileread.h (class File_read): Update declarations.
14993 (class File_read::View): Add byteshift_ field. Add byteshift to
14994 constructor. Add byteshift method.
14995 * archive.h (Archive::clear_uncached_views): New function.
14996 (Archive::get_view): Add aligned parameter. Change all callers.
14997 * object.h (Object::get_view): Add aligned parameter. Change all
14999 (Object::get_lasting_view): Likewise.
15001 * fileread.cc (File_read::release): Don't call clear_views if
15002 there are multiple objects.
15003 * fileread.h (File_read::clear_uncached_views): New function.
15004 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15007 2008-03-31 Cary Coutant <ccoutant@google.com>
15009 Add thin archive support.
15010 * archive.cc (Archive::armagt): New const.
15011 (Archive::setup): Remove task parameter and calls to unlock.
15012 (Archive::unlock_nested_archives): New function.
15013 (Archive::read_header): Add nested_off parameter. Change
15015 (Archive::interpret_header): Likewise.
15016 (Archive::include_all_members): Change to handle thin
15018 (Archive::include_member): Likewise.
15019 * archive.h (Archive::Archive): Add new parameters and
15021 (Archive::armagt): New const.
15022 (Archive::setup): Remove task parameter.
15023 (Archive::unlock_nested_archives): New function.
15024 (Archive::read_header): Add nested_off parameter.
15025 (Archive::interpret_header): Likewise.
15026 (Archive::Nested_archive_table): New typedef.
15027 (Archive::is_thin_archive_): New field.
15028 (Archive::nested_archives_): New field.
15029 (Archive::options_): New field.
15030 (Archive::dirpath_): New field.
15031 (Archive::task_): New field.
15032 * readsyms.cc (Read_symbols::do_read_symbols): Add check
15033 for thin archives. Pass additional parameters to
15034 Archive::Archive. Unlock the archive file after calling
15037 2008-03-29 Ian Lance Taylor <iant@google.com>
15039 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
15040 version symbol to be local.
15041 * testsuite/ver_test_4.sh: New file.
15042 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
15043 (check_DATA): Add ver_test_4.syms.
15044 (ver_test_4.syms): New target.
15045 * testsuite/Makefile.in: Rebuild.
15048 (Output_section::Input_section_sort_entry::has_priority): New
15050 (Output_section::Input_section_sort_entry::match_file_name): New
15052 (Output_section::Input_section_sort_entry::match_section_name):
15054 (Output_section::Input_section_sort_entry::match_section_name_prefix):
15056 (Output_section::Input_section_sort_entry::match_section_file):
15058 (Output_section::Input_section_sort_compare::operator()): Rewrite
15059 using new Input_section_sort_entry functions. Sort crtbegin and
15060 crtend first. Sort sections with no priority before sections with
15062 * testsuite/initpri1.c (d3): Check j != 4.
15063 (cd5): New constructor/destructor function.
15064 (main): Check j != 2.
15066 * symtab.cc (Symbol_table::add_from_object): If we don't use the
15067 new symbol when resolving, don't call set_is_default.
15068 * testsuite/ver_test_7.cc: New file.
15069 * testsuite/ver_test_7.sh: New file.
15070 * testsuite/Makefile.am (ver_test_7.so): New target.
15071 (ver_test_7.o): New target.
15072 (check_SCRIPTS): Add ver_test_7.sh.
15073 (check_DATA): Add ver_test_7.syms.
15074 (ver_test_7.syms): New target.
15076 2008-03-28 Ian Lance Taylor <iant@google.com>
15078 * layout.cc (Layout::layout): If we see an input section with a
15079 name that needs sorting, set the must_sort flag for the output
15081 (Layout::make_output_section): If the name of the output section
15082 indicates that it might require sorting, set the may_sort flag.
15083 * output.h (Output_section::may_sort_attached_input_sections): New
15085 (Output_section::set_may_sort_attached_input_sections): New
15087 (Output_section::must_sort_attached_input_sections): New
15089 (Output_section::set_must_sort_attached_input_sections): New
15091 (class Output_section): Declare Input_section_sort_entry. Define
15092 Input_section_sort_compare. Declare
15093 sort_attached_input_sections. Add new fields:
15094 may_sort_attached_input_sections_,
15095 must_sort_attached_input_sections_,
15096 attached_input_sections_are_sorted_.
15097 * output.cc (Output_section::Output_section): Initialize new
15099 (Output_section::add_input_section): Add an entry to
15100 input_sections_ if may_sort or must_sort are true.
15101 (Output_section::set_final_data_size): Call
15102 sort_attached_input_sections if necessary.
15103 (Output_section::Input_section_sort_entry): Define new class.
15104 (Output_section::Input_section_sort_compare::operator()): New
15106 (Output_section::sort_attached_input_sections): New function.
15107 * configure.ac: Check whether the compiler supports constructor
15108 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
15109 * testsuite/initpri1.c: New file.
15110 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
15111 CONSTRUCTOR_PRIORITY.
15112 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
15113 (initpri1_LDFLAGS): New variable.
15114 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15116 2008-03-27 Ian Lance Taylor <iant@google.com>
15118 * common.cc (Sort_commons::operator): Correct sorting algorithm.
15119 * testsuite/common_test_1.c: New file.
15120 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
15121 (common_test_1_SOURCES): New variable.
15122 (common_test_1_DEPENDENCIES): New variable.
15123 (common_test_1_LDFLAGS): New variable.
15125 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
15126 and commons_ correctly when NAME/VERSION does not override
15128 * testsuite/ver_test_6.c: New file.
15129 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
15130 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
15131 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
15133 2008-03-26 Ian Lance Taylor <iant@google.com>
15135 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
15136 of an undefined symbol from a version script.
15137 * testsuite/Makefile.am (ver_test_5.so): New target.
15138 (ver_test_5.o): New target.
15139 (check_SCRIPTS): Add ver_test_5.sh.
15140 (check_DATA): Add ver_test_5.syms.
15141 (ver_test_5.syms): New target.
15142 * testsuite/ver_test_5.cc: New file.
15143 * testsuite/ver_test_5.script: New file.
15144 * testsuite/ver_test_5.sh: New file.
15145 * Makefile.in, testsuite/Makefile.in: Rebuild.
15148 Fix problems building gold with gcc 4.3.0.
15149 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
15150 (gold_error_at_location, gold_warning_at_location): Use it.
15151 * configure.ac: Check whether we can compile and use a template
15152 function with a printf attribute.
15153 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
15154 when jumping over bytes.
15155 * object.cc: Instantiate Object::read_section_data.
15156 * debug.h: Include <cstring>
15157 * dwarf_reader.cc: Include <algorithm>
15158 * main.cc: Include <cstring>.
15159 * options.cc: Include <cstring>.
15160 * output.cc: Include <cstring>.
15161 * script.cc: Include <cstring>.
15162 * script.h: Include <string>.
15163 * symtab.cc: Include <cstring> and <algorithm>.
15164 * target-select.cc: Include <cstring>.
15165 * version.cc: Include <string>.
15166 * testsuite/testmain.cc: Include <cstdlib>.
15167 * configure, config.in: Rebuild.
15169 2008-03-25 Ian Lance Taylor <iant@google.com>
15171 * options.cc: Include "../bfd/bfdver.h".
15172 (options::help): Print bug reporting address.
15174 * version.cc (print_version): Adjust output for current value of
15175 BFD_VERSION_STRING.
15179 * options.cc (options::help): Print list of supported targets.
15180 * target-select.h: Include <vector>.
15181 (class Target_selector): Make machine_, size_, and is_big_endian_
15182 fields const. Add bfd_name_ and instantiated_target_ fields.
15183 (Target_selector::Target_selector): Add bfd_name parameter.
15184 (Target_selector::recognize): Make non-virtual, call
15186 (Target_selector::recognize_by_name): Make non-virtual, call
15187 do_recognize_by_name.
15188 (Target_selector::supported_names): New function.
15189 (Target_selector::bfd_name): New function.
15190 (Target_selector::do_instantiate_target): New pure virtual
15192 (Target_selector::do_recognize): New virtual function.
15193 (Target_selector::do_recognize_by_name): New virtual function.
15194 (Target_selector::instantiate_target): New private function.
15195 (supported_target_names): Declare.
15196 * target-select.cc (Target_selector::Target_selector): Update for
15197 new parameter and fields.
15198 (select_target_by_name): Check that the name matches before
15199 calling recognize_by_name.
15200 (supported_target_names): New function.
15201 * i386.cc (class Target_selector_i386): Update Target_selector
15202 constructor call. Remove recognize and recognize_by_name. Add
15203 do_instantiate_target.
15204 * x86_64.cc (class Target_selector_x86_64): Likewise.
15205 * testsuite/testfile.cc (class Target_selector_test): Update for
15206 changes to Target_selector.
15208 * README: Rewrite, with some notes on unsupported features.
15210 2008-03-24 Cary Coutant <ccoutant@google.com>
15212 * i386.cc (Target_i386::Got_type): New enum declaration.
15213 (Target_i386::Scan::local): Updated callers of Output_data_got
15215 (Target_i386::Scan::global): Likewise.
15216 (Target_i386::Relocate::relocate): Likewise.
15217 (Target_i386::Relocate::relocate_tls): Likewise.
15218 * object.h (Got_offset_list): New class.
15219 (Sized_relobj::local_has_got_offset): Added got_type parameter.
15220 (Sized_relobj::local_got_offset): Likewise.
15221 (Sized_relobj::set_local_got_offset): Likewise.
15222 (Sized_relobj::local_has_tls_got_offset): Removed.
15223 (Sized_relobj::local_tls_got_offset): Removed.
15224 (Sized_relobj::set_local_tls_got_offset): Removed.
15225 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
15226 * output.cc (Output_data_got::add_global): Added got_type parameter.
15227 (Output_data_got::add_global_with_rel): Likewise.
15228 (Output_data_got::add_global_with_rela): Likewise.
15229 (Output_data_got::add_global_pair_with_rel): New function.
15230 (Output_data_got::add_global_pair_with_rela): New function.
15231 (Output_data_got::add_local): Added got_type parameter.
15232 (Output_data_got::add_local_with_rel): Likewise.
15233 (Output_data_got::add_local_with_rela): Likewise.
15234 (Output_data_got::add_local_pair_with_rel): New function.
15235 (Output_data_got::add_local_pair_with_rela): New function.
15236 (Output_data_got::add_global_tls): Removed.
15237 (Output_data_got::add_global_tls_with_rel): Removed.
15238 (Output_data_got::add_global_tls_with_rela): Removed.
15239 (Output_data_got::add_local_tls): Removed.
15240 (Output_data_got::add_local_tls_with_rel): Removed.
15241 (Output_data_got::add_local_tls_with_rela): Removed.
15242 * output.h (Output_data_got::add_global): Added got_type parameter.
15243 (Output_data_got::add_global_with_rel): Likewise.
15244 (Output_data_got::add_global_with_rela): Likewise.
15245 (Output_data_got::add_global_pair_with_rel): New function.
15246 (Output_data_got::add_global_pair_with_rela): New function.
15247 (Output_data_got::add_local): Added got_type parameter.
15248 (Output_data_got::add_local_with_rel): Likewise.
15249 (Output_data_got::add_local_with_rela): Likewise.
15250 (Output_data_got::add_local_pair_with_rel): New function.
15251 (Output_data_got::add_local_pair_with_rela): New function.
15252 (Output_data_got::add_global_tls): Removed.
15253 (Output_data_got::add_global_tls_with_rel): Removed.
15254 (Output_data_got::add_global_tls_with_rela): Removed.
15255 (Output_data_got::add_local_tls): Removed.
15256 (Output_data_got::add_local_tls_with_rel): Removed.
15257 (Output_data_got::add_local_tls_with_rela): Removed.
15258 * resolve.cc (Symbol::override_base_with_special): Removed
15259 reference to has_got_offset_ field.
15260 * symtab.cc (Symbol::init_fields): Replaced initialization
15261 of got_offset_ with got_offsets_. Removed initialization
15263 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
15264 (Symbol::got_offset): Likewise.
15265 (Symbol::set_got_offset): Likewise.
15266 (Symbol::has_tls_got_offset): Removed.
15267 (Symbol::tls_got_offset): Removed.
15268 (Symbol::set_tls_got_offset): Removed.
15269 (Symbol::got_offset_): Removed.
15270 (Symbol::tls_mod_got_offset_): Removed.
15271 (Symbol::tls_pair_got_offset_): Removed.
15272 (Symbol::got_offsets_): New field.
15273 (Symbol::has_got_offset): Removed.
15274 (Symbol::has_tls_mod_got_offset): Removed.
15275 (Symbol::has_tls_pair_got_offset): Removed.
15276 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
15277 (Target_x86_64::Scan::local): Updated callers of Output_data_got
15279 (Target_x86_64::Scan::global): Likewise.
15280 (Target_x86_64::Relocate::relocate): Likewise.
15281 (Target_x86_64::Relocate::relocate_tls): Likewise.
15283 2008-03-25 Ben Elliston <bje@au.ibm.com>
15285 * yyscript.y: Fix spelling error in comment.
15287 2008-03-24 Ian Lance Taylor <iant@google.com>
15289 * options.h (class General_options): Define build_id option.
15290 * layout.h (class Layout): Declare write_build_id, create_note,
15291 create_build_id. Add build_id_note_ member.
15292 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
15293 "libiberty.h", "md5.h", "sha1.h".
15294 (Layout::Layout): Initialize eh_frame_data_,
15295 eh_frame_hdr_section_, and build_id_note_.
15296 (Layout::finalize): Call create_build_id.
15297 (Layout::create_note): New function, broken out of
15298 Layout::create_gold_note.
15299 (Layout::create_gold_note): Call create_note.
15300 (Layout::create_build_id): New function.
15301 (Layout::write_build_id): New function.
15302 (Close_task_runner::run): Call write_build_id.
15304 * x86_64.cc: Correct license to GPLv3.
15306 2008-03-23 Ian Lance Taylor <iant@google.com>
15308 * options.cc: Include "demangle.h".
15309 (parse_optional_string): New function.
15310 (parse_long_option): Handle takes_optional_argument.
15311 (parse_short_option): Update dash_z initializer. Handle
15312 takes_optional_argument.
15313 (General_options::General_options): Initialize do_demangle_.
15314 (General_options::finalize): Set do_demangle_. Handle demangling
15316 * options.h (parse_optional_string): Declare.
15317 (struct One_option): Add optional_arg field. Update constructor.
15318 Update call constructor calls. Add takes_optional_argument
15320 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
15321 (DEFINE_optional_string): Define.
15322 (General_options::demangle): Change from DEFINE_bool to
15323 DEFINE_optional_string.
15324 (General_options::no_demangle): New function.
15325 (General_options::do_demangle): New function.
15326 (General_options::set_do_demangle): New function.
15327 (General_options::execstack_status_): Move definition to end of
15329 (General_options::static_): Likewise.
15330 (General_options::do_demangle_): New field.
15331 * object.cc (big_endian>::get_symbol_location_info): Call
15332 Options::do_demangle, not Options::demangle.
15333 * symtab.cc (demangle): Likewise.
15335 2008-03-22 Ian Lance Taylor <iant@google.com>
15337 * gold.h: Include <cstddef> and <sys/types.h>
15338 * options.h: Include <cstring>.
15340 2008-03-21 Ian Lance Taylor <iant@google.com>
15342 * Added source code to GNU binutils.
15344 Copyright (C) 2008-2013 Free Software Foundation, Inc.
15346 Copying and distribution of this file, with or without modification,
15347 are permitted in any medium without royalty provided the copyright
15348 notice and this notice are preserved.
15354 version-control: never