1 2013-12-19 Dimitry Andric <dimitry@andric.com>
3 * stringpool.cc (Stringpool_template::reserve): Add
4 HAVE_UNORDERED_MAP case.
5 * stringpool.cc (Stringpool_template::print_stats): Likewise.
7 2013-12-18 Cary Coutant <ccoutant@google.com>
9 * configure.ac: Check for <unordered_set> and <unordered_map>.
10 * config.in: Regenerate.
11 * configure: Regenerate.
12 * system.h: Use <unordered_set> and <unordered_map> if available.
14 2013-12-10 Roland McGrath <mcgrathr@google.com>
16 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
17 with $(INSTALL_PROGRAM_ENV).
18 * Makefile.in: Regenerate.
20 2013-11-22 Cary Coutant <ccoutant@google.com>
22 * configure.ac: Add check for which library is needed for
24 * configure: Regenerate.
26 2013-11-22 Cary Coutant <ccoutant@google.com>
28 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
30 * testsuite/Makefile.in: Regenerate.
32 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
34 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
35 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
36 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
37 (Target_x86_64<size>::Scan::local): Likewise.
38 (Target_x86_64<size>::Scan::global): Likewise.
39 (Target_x86_64<size>::Relocate::relocate): Likewise.
40 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
42 (Target_x86_64<size>::Scan::check_non_pic(): Handle
45 * testsuite/Makefile.am (check_PROGRAMS): Add
46 exception_x86_64_bnd_test.
47 (exception_x86_64_bnd_test_SOURCES): New macro.
48 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
49 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
50 (exception_x86_64_bnd_test_LDADD): Likewise.
51 (exception_x86_64_bnd_1.o): New rule.
52 (exception_x86_64_bnd_2.o): Likewise.
53 * testsuite/Makefile.in: Regenerated.
55 2013-11-15 Alan Modra <amodra@gmail.com>
57 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
59 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
60 Only call ppc64_local_entry_offset for 64-bit. Restrict
61 symval_for_branch lookup to ELFv1.
62 (Stub_table::add_plt_call_entry): Use unsigned int off.
63 (Output_data_glink::Address, invalid_address): New.
64 (Output_data_glink::add_eh_frame): Move out of line. Add
66 (Output_data_glink::add_global_entry, find_global_entry,
67 global_entry_address): New functions.
68 (Output_data_glink::global_entry_stubs_, end_branch_table_,
69 ge_size): New variables.
70 (Output_data_glink::set_final_data_size): Add global entry
72 (Output_data_glink::do_write): Write global entry stubs.
73 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
74 parameter. Return true for ELFv2. Adjust callers.
75 (Target_powerpc::Scan::local, global): Restrict opd lookup to
76 ELFv1. Similarly for ifunc and dynamic relocation processing
77 specific to ELFv1. Recognize that symbols are defined on
78 their plt entries for ELFv2.
79 (Target_powerpc::symval_for_branch): Assert if called for
81 (Target_powerpc::Relocate::relocate): Use global entry plt
82 stub for symbol value if such exists on ELFv2.
83 (Target_powerpc::Relocate::relocate): Don't call
84 symval_for_branch when ELFv2. Do adjust for local entry
86 (Target_powerpc::do_dynsym_value): Set symbols to global entry
88 (Target_powerpc::do_plt_address_for_global): Similarly.
90 2013-11-14 Cary Coutant <ccoutant@google.com>
92 Revert patch -- this did not fix the problem, and there is
95 2013-11-14 Cary Coutant <ccoutant@google.com>
98 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
99 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
100 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
101 updating fde_offsets_.
102 (Eh_frame_hdr::lock_): New data member.
104 2013-11-14 Cary Coutant <ccoutant@google.com>
106 * dwp.cc (Dwo_file_entry): New type.
107 (File_list): Use Dwo_file_entry.
108 (Dwo_file::verify): New function.
109 (Dwo_file::verify_dwo_list): New function.
110 (Dwo_file::sized_verify_dwo_list): New function.
111 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
113 (Dwp_options): New enum type.
114 (dwp_options): Add --verify-only.
117 * dwp.h (gold_info): Add declaration.
119 2013-11-14 Cary Coutant <ccoutant@google.com>
122 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
123 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
124 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
125 updating fde_offsets_.
126 (Eh_frame_hdr::lock_): New data member.
128 2013-11-06 Cary Coutant <ccoutant@google.com>
131 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
132 before reloc sections.
134 2013-11-04 Alan Modra <amodra@gmail.com>
136 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
137 (Symbol::needs_dynamic_reloc): Test new flag.
138 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
139 (Target_powerpc::Scan::get_reference_flags): Add target param.
140 Return FUNC_DESC_ABI for 64-bit ELFv1.
141 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
143 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
144 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
146 2013-10-31 Cary Coutant <ccoutant@google.com>
148 Restore support for dwp v2 DWARF package file format.
150 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
151 tu_length parameter. Adjust all callers.
152 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
153 * dwp.cc: Include dwarf.h.
154 (Section_bounds): New struct type.
155 (Unit_set): New struct type.
156 (Dwo_file::Dwo_file): Initialize new data member.
157 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
158 Combine and rename to...
159 (Dwo_file::read_unit_index): ...this.
160 (Dwo_file::sized_read_compunit_index)
161 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
162 (Dwo_file::sized_read_unit_index): ...this.
163 (Dwo_file::copy_section): Remove section_name, is_str_offsets
164 parameters; add section_id parameter.
165 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
166 (Dwo_file::add_unit_set): ...this.
167 (Dwo_file::shndx_map_): Remove.
168 (Dwo_file::sect_offsets_): New data member.
169 (Dwp_output_file::Dwp_output_file): Initialize new data members.
170 (Dwp_output_file::add_section): Rename to...
171 (Dwp_output_file::add_contribution): ...this.
172 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
173 (Dwp_output_file::add_tu_set): Likewise.
174 (Dwp_output_file::Contribution): New type.
175 (Dwp_output_file::Section::contributions): New data member.
176 (Dwp_output_file::Cu_or_tu_set): Remove.
177 (Dwp_output_file::Section::Section): New ctor.
178 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
179 (Dwp_output_file::Dwp_index::Section_table): New type.
180 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
181 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
183 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
184 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
185 (Dwp_output_file::Dwp_index::section_table): New member function.
186 (Dwp_output_file::Dwp_index::section_table_end): New member function.
187 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
188 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
189 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
190 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
191 (Dwp_output_file::Dwp_index::section_table_): New data member.
192 (Dwp_output_file::Dwp_index::section_mask_): New data member.
193 (Dwp_output_file::add_output_section): New member function.
194 (Dwp_output_file::write_new_section): New member function.
195 (Dwp_output_file::write_contributions): New member function.
196 (Dwp_output_file::section_id_map_): New data member.
197 (class Dwo_id_info_reader): Remove.
198 (class Unit_reader): New class.
199 (get_dwarf_section_name): New function.
200 (Dwo_file::read_executable): Adjust initializations of class data.
201 (Dwo_file::read): Add support for v2 package file format.
202 (Dwo_file::read_unit_index): Likewise.
203 (Dwo_file::sized_read_unit_index): Likewise.
204 (Dwo_file::copy_section): Likewise.
205 (Dwo_file::add_unit_set): Likewise.
206 (Dwp_output_file::add_output_section): Likewise.
207 (Dwp_output_file::add_contribution): Likewise.
208 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
210 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
212 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
214 (Dwp_output_file::initialize): Remove unused function.
215 (Dwp_output_file::finalize): Add support for v2 package file format.
216 (Dwp_output_file::write_index): Likewise.
217 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
220 2013-10-31 Cary Coutant <ccoutant@google.com>
222 * configure.ac: Fix check for -fmerge-constants.
223 * configure.ac: Regenerate.
225 2013-10-30 Roland McGrath <mcgrathr@google.com>
227 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
228 Correct 9-byte nop sequence to match what the assembler generates.
230 2013-10-30 Alan Modra <amodra@gmail.com>
232 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
233 ppc64_local_entry_offset, ppc64_local_entry_offset,
234 do_read_symbols): New functions.
235 (Powerpc_relobj::e_flags_, st_other_): New vars.
236 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
237 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
238 (Powerpc_relobj::e_flags_): New var.
239 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
240 and adjust for ELFv2.
241 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
242 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
243 (Powerpc_dynobj::do_find_special_sections): Likewise.
244 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
245 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
246 to ELFv2 local entry.
247 (Target_powerpc::do_relax): No thread safe barriers needed for
249 (Output_data_plt_powerpc::initial_plt_entry_size_,
250 plt_entry_size): Delete. Replace all uses with
251 first_plt_entry_offset() and plt_entry_size().
252 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
253 reserved_size parm. Update callers.
254 (Output_data_plt_powerpc::entry_count): Update.
255 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
256 and use Target_powerpc::first_plt_entry_offset().
257 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
258 rename to plt_entry_size.
259 (Output_data_plt_powerpc::add_ifunc_entry,
260 add_local_ifunc_entry): Adjust reloc for ELFv2.
261 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
262 (glink_eh_frame_fde_64v2): New.
263 (Stub_table::plt_call_size): Support ELFv2 sizing.
264 (Output_data_glink::add_eh_frame): Use the new FDE.
265 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
266 (Stub_table::do_write): Write ELFv2 stubs and glink.
267 (Target_powerpc::Relocate::relocate): Replaces nop after call
268 with ld 2,24(1) and adjust local offset destination for ELFv2.
270 2013-10-30 Alan Modra <amodra@gmail.com>
272 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
273 (Target_powerpc::Scan::global, local): Likewise.
274 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
275 on all ppc64 @h and @ha relocs.
277 2013-10-14 Alan Modra <amodra@gmail.com>
279 * output.h (Output_data_got::add_constant): Tidy.
280 (Output_data_got::add_constant_pair): New function.
281 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
282 methods used so as to first call reserve_ent().
284 2013-10-11 Roland McGrath <mcgrathr@google.com>
286 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
287 add_got_entry and add_got_entry_pair.
289 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
290 (HAVE_PUBNAMES): Likewise.
291 * configure: Regenerate.
293 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
294 * testsuite/Makefile.in: Regenerate.
296 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
297 Remove const from declaration.
298 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
299 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
300 * output.h (Output_file_header): Remove const from member target_
301 and corresponding constructor argument.
302 * output.cc (Output_file_header::Output_file_header): Update prototype.
303 (Output_file_header::do_sized_write): Use this->target_ in place
304 of parameters()->target().
306 * testsuite/undef_symbol.cc (Foo::get_a): New method.
308 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
309 * configure: Regenerate.
310 * Makefile.in: Regenerate.
311 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
312 * testsuite/merge_string_literals_2.c: Likewise.
313 * testsuite/Makefile.am
314 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
315 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
316 literal -fmerge-constants.
317 * testsuite/Makefile.in: Regenerate.
319 * i386.cc (Target_i386): Remove unused member dynbss_.
320 * arm.cc (Target_arm): Likewise.
321 * powerpc.cc (Target_powerpc): Likewise.
322 * sparc.cc (Target_sparc): Likewise.
323 * tilegx.cc (Target_tilegx): Likewise.
324 * x86_64.cc (Target_x86_64): Likewise.
325 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
326 type_signature_, type_offset_.
327 * plugin.h (Plugin_hook): Remove unused member layout_.
328 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
330 (Read_member): Remove unused members input_objects_, symtab_,
332 (Check_library): Remove unused member symtab_.
333 * archive.h (Lib_group): Remove unused member lib_.
334 * archive.cc (Lib_group::Lib_group): Update initializer.
335 * incremental.h (Incremental_binary): Remove unused member target_.
336 (Incremental_script_entry): Removed unused member script_.
337 * layout.h (Write_symbols_task): Remove unused member input_objects_.
338 * icf.h (Icf): Remove unused member num_tracked_relocs.
340 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
341 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
343 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
345 * archive.h: Use struct rather than class for forward declaration
346 of Read_symbols_data.
348 2013-10-07 Cary Coutant <ccoutant@google.com>
351 * testsuite/Makefile.am (icf_test): Fix dependencies.
352 (icf_safe_test): Likewise.
353 (icf_safe_so_test): Likewise.
354 (large_symbol_alignment): Add empty _LDADD rule.
355 * testsuite/Makefile.in: Regenerate.
357 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
360 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
361 relocation for R_X86_64_32 on x32.
363 2013-08-27 Roland McGrath <mcgrathr@google.com>
365 * output.cc (Output_segment::set_section_addresses): Take new
366 Target* argument. If target->isolate_execinstr() and the segment
367 is executable and starts at a target->abi_pagesize() boundary,
368 pad its end out to a target->abi_pagesize() boundary with code fill.
369 * output.h (Output_segment::set_section_addresses): Update decl.
370 * layout.h (Layout::check_output_data_for_reset_values): Take new
371 argument RELAX_OUTPUTS.
372 (Layout): New member relax_output_list_.
373 (Layout::add_relax_output): New method.
374 * layout.cc (Layout::Layout): Update constructor.
375 (Layout::reset_relax_output): New method.
376 (Layout::clean_up_after_relaxation): Call it.
377 (Layout::prepare_for_relaxation): Update caller.
378 (Layout::set_segment_offsets): Update callers of set_section_addresses.
379 Call reset_relax_output before re-processing segments for
380 isolate_execinstr case.
381 (Layout::write_data): Handle relax_output_list_.
382 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
383 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
385 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
388 * object.h: Fix typos.
390 2013-08-16 Roland McGrath <mcgrathr@google.com>
392 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
393 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
395 2013-08-07 Cary Coutant <ccoutant@google.com>
397 Revert support for v2 DWP files:
399 2013-03-01 Cary Coutant <ccoutant@google.com>
401 Add dwp support for v2 DWARF package file format.
402 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
403 tu_length parameter. Adjust all callers.
404 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
405 * dwp.cc: Include dwarf.h.
406 (Section_bounds): New struct type.
407 (Unit_set): New struct type.
408 (Dwo_file::Dwo_file): Initialize new data member.
409 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
410 Combine and rename to...
411 (Dwo_file::read_unit_index): ...this.
412 (Dwo_file::sized_read_compunit_index)
413 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
414 (Dwo_file::sized_read_unit_index): ...this.
415 (Dwo_file::copy_section): Remove section_name, is_str_offsets
416 parameters; add section_id parameter.
417 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
418 (Dwo_file::add_unit_set): ...this.
419 (Dwo_file::shndx_map_): Remove.
420 (Dwo_file::sect_offsets_): New data member.
421 (Dwp_output_file::Dwp_output_file): Initialize new data members.
422 (Dwp_output_file::add_section): Rename to...
423 (Dwp_output_file::add_contribution): ...this.
424 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
425 (Dwp_output_file::add_tu_set): Likewise.
426 (Dwp_output_file::Contribution): New type.
427 (Dwp_output_file::Section::contributions): New data member.
428 (Dwp_output_file::Cu_or_tu_set): Remove.
429 (Dwp_output_file::Section::Section): New ctor.
430 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
431 (Dwp_output_file::Dwp_index::Section_table): New type.
432 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
433 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
435 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
436 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
437 (Dwp_output_file::Dwp_index::section_table): New member function.
438 (Dwp_output_file::Dwp_index::section_table_end): New member function.
439 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
440 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
441 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
442 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
443 (Dwp_output_file::Dwp_index::section_table_): New data member.
444 (Dwp_output_file::Dwp_index::section_mask_): New data member.
445 (Dwp_output_file::add_output_section): New member function.
446 (Dwp_output_file::write_new_section): New member function.
447 (Dwp_output_file::write_contributions): New member function.
448 (Dwp_output_file::section_id_map_): New data member.
449 (class Dwo_id_info_reader): Remove.
450 (class Unit_reader): New class.
451 (get_dwarf_section_name): New function.
452 (Dwo_file::read_executable): Adjust initializations of class data.
453 (Dwo_file::read): Add support for v2 package file format.
454 (Dwo_file::read_unit_index): Likewise.
455 (Dwo_file::sized_read_unit_index): Likewise.
456 (Dwo_file::copy_section): Likewise.
457 (Dwo_file::add_unit_set): Likewise.
458 (Dwp_output_file::add_output_section): Likewise.
459 (Dwp_output_file::add_contribution): Likewise.
460 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
462 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
464 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
466 (Dwp_output_file::initialize): Remove unused function.
467 (Dwp_output_file::finalize): Add support for v2 package file format.
468 (Dwp_output_file::write_index): Likewise.
469 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
472 2013-07-31 Cary Coutant <ccoutant@google.com>
474 * object.cc (Sized_relobj::do_output_section_address): New function.
475 (Sized_relobj): Instantiate explicitly.
476 * object.h (Object::output_section_address): New function.
477 (Object::do_output_section_address): New function.
478 (Sized_relobj::do_output_section_address): New function.
479 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
481 2013-07-30 Cary Coutant <ccoutant@google.com>
482 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
484 * parameters.cc (Parameters::entry): Return target-specific entry
486 * target.h (Target::entry_symbol_name): New function.
487 (Target_info::entry_symbol_name): New data member.
489 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
490 * i386.cc (Target_i386::i386_info): Likewise.
491 (Target_i386_nacl::i386_nacl_info): Likewise.
492 * sparc.cc (Target_sparc::sparc_info): Likewise.
493 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
494 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
495 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
496 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
498 2013-07-22 Sterling Augustine <saugustine@google.com>
500 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
501 Convert parameter shndx to local variable. Add parameters symtab
502 and symtab_size. Scan over section names. Find relocation
503 section corresponding to current section. Create and initialize
504 reloc_mapper_ and reloc_type_.
505 (Dwarf_pubnames_table::read_header): Add assertion. Change
506 unit_length to off_t. Initialize member unit_length_. Fill in field
508 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
509 Initialize new fields unit_length_ and cu_offset_.
510 (Dwarf_pubnames_table::read_section): Update prototype.
511 (Dwarf_pubnames_table::cu_offset): New member function.
512 (Dwarf_pubnames_table::subsection_size): Likewise.
513 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
515 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
516 member functions public.
517 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
518 Update comment. Rework logic. Move repeated parts to...
519 (Gdb_index_info_reader::read_pubtable): ...here. New function.
520 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
521 pubtypes_table_, and stmt_list_offset.
522 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
523 Gdb_index::find_pubtype_offset,
524 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
525 (Gdb_index::pubnames_read): Update prototype and rework logic.
526 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
528 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
529 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
530 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
531 Gdb_index::map_pubtable_to_dies):
533 (Gdb_index::pubnames_read): Update declaration.
534 (Gdb_index::Pubname_offset_map): New type.
535 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
536 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
537 Gdb_index::stmt_list_offset): Declare.
538 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
539 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
540 Gdb_index::pubtypes_offset_): Remove.
542 2013-07-19 Roland McGrath <mcgrathr@google.com>
544 * options.h (General_options): Add -Trodata-segment option.
545 * parameters.cc (Parameters::check_rodata_segment): New function.
546 (Parameters::set_target_once): Call it.
547 * parameters.h (Parameters): Declare it (private member function).
548 * layout.cc (load_seg_unusable_for_headers): New function, broken
549 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
550 then validate rodata segment rather than text segment.
551 (relaxation_loop_body): Call that.
552 (is_text_segment): New function. Don't admit a non-executable
553 segment if TARGET->isolate_execinstr().
554 (set_segment_offsets): Call it. Honor -Trodata-segment option.
556 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
559 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
560 * nacl.h (Sniff_file::View::View): Request aligned view.
562 2013-07-11 Cary Coutant <ccoutant@google.com>
564 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
565 correct BRLT entry size.
567 2013-07-03 Alan Modra <amodra@gmail.com>
569 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
572 2013-07-01 Cary Coutant <ccoutant@google.com>
574 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
576 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
577 (Dwarf_ranges_table::lookup_reloc): New function.
578 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
580 (Dwarf_ranges_table::lookup_reloc): New function.
581 (Dwarf_ranges_table::reloc_type_): New data member.
583 2013-06-27 Jing Yu <jingyu@google.com>
586 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
588 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
589 (Target_powerpc::do_relax): Call the above.
591 2013-06-27 Cary Coutant <ccoutant@google.com>
593 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
594 on garbage collected .opd section.
596 2013-06-27 Alan Modra <amodra@gmail.com>
598 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
600 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
601 (Target_powerpc::do_function_location): Likewise for loc->shndx.
603 2013-06-14 Cary Coutant <ccoutant@google.com>
605 * resolve.cc (Symbol::override_base): Don't override st_type
606 from plugin placeholder symbols.
607 (Symbol_table::resolve): Likewise.
608 (Symbol_table::should_override): Don't complain about TLS mismatch
609 if the TO symbol is a plugin placeholder.
610 * testsuite/Makefile.am (plugin_test_tls): New test.
611 * testsuite/Makefile.in: Regenerate.
612 * testsuite/plugin_test_tls.sh: New test script.
613 * testsuite/two_file_test_2_tls.cc: New test source.
614 * testsuite/two_file_test_tls.cc: New test source.
616 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
618 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
619 the maximum segment alignment is larger than the page size.
620 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
621 correctly aligns the symbols with large alignemnt.
622 * testsuite/Makefile.in: Regenerate.
623 * testsuite/large_symbol_alignment.cc: New file.
625 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
626 Sriraman Tallam <tmsriram@google.com>
628 * options.h (sort_section): New option.
629 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
630 Rename from Input_section_sort_section_name_special_ordering_compare.
631 (Input_section_sort_section_name_compare): New struct.
632 * output.cc (Output_section::Input_section_sort_section_name_compare::
633 operator()): New function.
634 (Output_section::sort_attached_input_sections): Use new sort function
635 for .text if --sort-section=name is specified.
636 * layout.cc (Layout::make_output_section):
637 Add sorting by name when --sort-section=name is specified.
638 * testsuite/Makefile.am (text_section_grouping): Test option
640 * testsuite/Makefile.in: Regenerate.
641 * testsuite/section_sorting_name.cc: New file.
642 * testsuite/section_sorting_name.sh: New file.
644 2013-05-21 Cary Coutant <ccoutant@google.com>
646 * symtab.h (Symbol::is_cxx_vtable): New function.
647 * target-reloc.h (relocate_section): Check for vtable symbol.
648 * testsuite/Makefile.am (missing_key_func.sh): New test case.
649 * testsuite/Makefile.in: Regenerate.
650 * testsuite/missing_key_func.cc: New test source.
651 * testsuite/missing_key_func.sh: New test script.
653 2013-05-21 Cary Coutant <ccoutant@google.com>
655 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
656 type of enclosing symbol.
657 (Relocate_info::location): Check symbol type when describing symbol.
658 * object.h (Symbol_location_info): Remove unused line_number;
659 add enclosing_symbol_type.
660 * testsuite/debug_msg.sh: Adjust expected output.
662 2013-05-13 Cary Coutant <ccoutant@google.com>
664 * configure.ac: Export DEFAULT_TARGET.
665 * configure: Regenerate.
666 * Makefile.in: Regenerate.
667 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
668 * testsuite/Makefile.in: Regenerate.
669 * testsuite/debug_msg.sh: Delete duplicate tests.
670 Don't check undef_int error message match for powerpc where the
671 source file and line number aren't available.
673 2013-05-10 Roland McGrath <mcgrathr@google.com>
675 * options.h (General_options): Add --rosegment-gap option.
676 * options.cc (finalize): --rosegment-gap implies --rosegment.
677 * layout.cc (set_segment_offsets): Let user option override
678 target->rosegment_gap().
680 2013-05-10 Roland McGrath <mcgrathr@google.com>
682 * options.h (General_options): Remove leading space from help
683 messages for -nostdlib and --rosegment.
685 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
688 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
690 2013-05-03 Alan Modra <amodra@gmail.com>
692 * merge.cc (Output_merge_string::do_add_input_section): Correct
693 scan for number of strings. Rename vars to avoid shadowing.
694 Include missing terminator in input_size_.
696 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
698 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
699 Restore empty string handling.
701 2013-05-01 Cary Coutant <ccoutant@google.com>
703 * stringpool.cc (Stringpool_template::new_key_offset): Fix
704 uninitialized warning.
706 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
708 * output.cc (Output_section::add_merge_input_section): Allow
709 to merge sections if the alignment is more than character size.
710 * merge.h (Output_merge_string::Output_merge_string): Remove
712 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
713 only not-null strings. Check the alignment of strings.
715 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
716 alignment as the argument.
717 (Stringpool_template<Stringpool_char>::addralign_): New class member.
718 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
719 Align non-zero length strings according to the addralign_.
720 (Stringpool_template<Stringpool_char>::set_string_offsets):
721 Updating offsets according to the given alignment.
722 * testsuite/Makefile.am (text_section_grouping): Test if string
723 literals are getting merged.
724 * testsuite/Makefile.in: Regenerate.
725 * testsuite/merge_string_literals_1.c: New file.
726 * testsuite/merge_string_literals_2.c: Ditto.
727 * testsuite/merge_string_literals.sh: Ditto.
729 2013-04-26 Ian Lance Taylor <iant@google.com>
731 * target-reloc.h (relocate_section): If the reloc offset is out of
732 range, pass VIEW as NULL to relocate.relocate.
733 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
734 * i386.cc (Target_i386::Relocate::relocate): Likewise.
735 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
736 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
737 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
738 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
740 2013-04-26 Geoff Pike <gpike@chromium.org>
742 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
743 * layout.cc (Hash_task): New class.
744 (Layout::queue_build_id_tasks): New function.
745 (Layout::write_build_id): Handle single-thread portion of build ID
746 computation. (In some cases, all of it is single-threaded.) Replace
747 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
748 functionality in fewer lines of code.
749 * layout.h (Layout::queue_build_id_tasks): New function declaration.
750 * options.h (General_options): make "--build-id" default to tree
751 rather than sha1. Add two new options related to --build-id=tree:
752 --build-id-chunk-size-for-treehash and
753 --build-id-min-file-size-for-treehash.
754 * Makefile.am: add testing of --build-id=tree and related new options
755 (these tests will be invoked by "make check").
756 * Makefile.in: Regenerate.
758 2013-04-25 Alan Modra <amodra@gmail.com>
760 * configure.tgt: Add powerpcle and powerpc64le.
762 2013-04-22 Alan Modra <amodra@gmail.com>
765 * layout.cc (Layout::segment_precedes): Allow more than one
766 segment with the same type and flags.
768 2013-04-15 Cary Coutant <ccoutant@google.com>
770 * layout.cc (Layout::set_relocatable_section_offsets): Don't
771 allocate space in file for BSS sections.
773 2013-04-15 Cary Coutant <ccoutant@google.com>
775 * script-sections.cc (Orphan_output_section): Reset address
776 to zero after each orphaned section for relocatable links.
778 2013-04-15 Cary Coutant <ccoutant@google.com>
780 * symtab.cc (Symbol_table::sized_write_globals): Subtract
781 section starting address for relocatable link.
782 * testsuite/Makefile.am (script_test_11): New test.
783 * testsuite/Makefile.in: Regenerate.
784 * testsuite/script_test_11.c: New source file.
785 * testsuite/script_test_11.t: New linker script.
787 2013-04-13 Alan Modra <amodra@gmail.com>
789 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
790 owner when sections are not adjacent and exceed group size.
791 (Target_powerpc::group_sections): Handle corner case.
792 (Target_powerpc::Branch_info::make_stub): Handle case where
793 stub table doesn't exist due to branches in non-exec sections.
794 (Target_powerpc::Relocate::relocate): Likewise.
796 2013-04-11 Alan Modra <amodra@gmail.com>
799 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
800 .branch_lt to match bfd ld. Adjust comments throughout file.
802 2013-04-04 Ian Lance Taylor <iant@google.com>
805 * object.cc (do_layout_deferred_sections): Handle .eh_frame
806 sections before checking whether they are included in the link.
808 2013-03-29 Sriraman Tallam <tmsriram@google.com>
810 * archive.cc (Archive::get_elf_object_for_member): Create the elf
811 object before calling the plugin claim_file handler. Pass the elf
812 object of the archive to the plugin. Delete the elf object if the
813 plugin claims the file.
815 2013-03-21 Alan Modra <amodra@gmail.com>
817 * layout.cc (Layout::set_segment_offsets): Accept writable .text
820 2013-03-21 Alan Modra <amodra@gmail.com>
822 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
824 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
825 uninitialized" warning.
827 2013-03-20 Alan Modra <amodra@gmail.com>
829 * symtab.h (Symbol::clear_version): New function.
830 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
831 is_needed by weak references. Clear version for symbols defined
832 in as-needed objects that are not needed.
834 2013-03-15 Alan Modra <amodra@gmail.com>
836 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
837 static and public. Add report_err param. Return false for data refs.
838 (Target_powerpc::rela_dyn_section): New overloaded function.
839 (Target_powerpc::plt_, iplt_): Elucidate.
840 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
841 (Output_data_plt_powerpc::do_write): Don't write .iplt.
842 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
843 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
844 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
845 push_branch and make_plt_entry for ifunc syms when
846 reloc_needs_plt_for_ifunc.
847 (Target_powerpc::Relocate::relocate): Don't use plt entry value
848 for ifunc unless reloc_needs_plt_for_ifunc.
850 2013-03-15 Alan Modra <amodra@gmail.com>
852 * gc.h (gc_process_relocs): Don't look through function descriptors.
853 * icf.cc (get_section_contents): Do so here instead.
855 2013-03-13 Alan Modra <amodra@gmail.com>
857 * powerpc.cc (is_branch_reloc): Forward declare.
858 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
859 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
860 false for 64-bit, true for 32-bit non-branch relocs.
861 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
862 * testsuite/Makefile.am (icf_test): Use linker map file instead of
864 (icf_safe_test): Generate linker map file as well as nm output.
865 (icf_safe_so_test): Likewise.
866 * testsuite/Makefile.in: Regenerate.
867 * testsuite/icf_test.sh: Parse linker map file to determine
869 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
870 * testsuite/icf_safe_so_test.sh: Likewise.
871 (X86_32_or_ARM_specific_safe_fold): Merge into..
872 (arch_specific_safe_fold): ..this.
873 (X86_64_specific_safe_fold): Delete unused function.
875 2013-03-12 Alan Modra <amodra@gmail.com>
877 * gc.h (gc_process_relocs): Look through function descriptors
878 to determine shndx, symvalue and addend used by ICF. Tidy
879 variable duplication.
881 2013-03-11 Alan Modra <amodra@gmail.com>
883 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
884 * layout.cc (Layout_task_runner::run): ..to here.
885 * symtab.h (struct Symbol_location): Extract from..
886 (class Symbol_table): ..here.
887 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
888 * target.h (class Target): Add function_location and
889 do_function_location functions.
890 (class Sized_target): Add do_function_location.
891 * object.h (class Sized_relobj_file): Move find_shdr..
892 (class Object): ..to here.
893 * object.cc: Likewise. Update to suit. Instantiate.
894 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
895 * powerpc.cc (class Powerpc_dynobj): New.
896 (Target_powerpc::do_function_location): New function.
897 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
898 (Powerpc_dynobj::do_read_symbols): New function.
899 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
901 2013-03-08 Ian Lance Taylor <iant@google.com>
903 * options.cc (General_options::string_to_object_format): Accept
906 2013-03-08 Alan Modra <amodra@gmail.com>
908 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
910 (struct Post_fde): Move definition to here..
911 * ehframe.cc (struct Post_fde): ..from here.
912 (Cie::write): Don't alloc Post_fde.
913 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
915 2013-03-07 Alan Modra <amodra@gmail.com>
917 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
918 relocation referencing .LC0.
919 * testsuite/discard_locals_test.sh: Remove FIXMEs.
921 2013-03-07 Alan Modra <amodra@gmail.com>
923 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
924 always_inline. Add assembly for powerpc to avoid GOT.
926 2013-03-07 Alan Modra <amodra@gmail.com>
928 * testsuite/script_test_10.sh: Don't test .bss section
931 2013-03-06 Alan Modra <amodra@gmail.com>
933 * powerpc.cc (class Powerpc_relobj): Move some member functions.
934 (Target_powerpc::symval_for_branch): Add symtab param. Update
935 all callers. Handle folded sections.
936 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
938 (Global_symbol_visitor_opd::operator()): Likewise.
940 2013-03-04 Alan Modra <amodra@gmail.com>
942 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
943 * testsuite/Makefile.in: Regenerate.
945 2013-03-01 Cary Coutant <ccoutant@google.com>
947 Add dwp support for v2 DWARF package file format.
948 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
949 tu_length parameter. Adjust all callers.
950 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
951 * dwp.cc: Include dwarf.h.
952 (Section_bounds): New struct type.
953 (Unit_set): New struct type.
954 (Dwo_file::Dwo_file): Initialize new data member.
955 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
956 Combine and rename to...
957 (Dwo_file::read_unit_index): ...this.
958 (Dwo_file::sized_read_compunit_index)
959 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
960 (Dwo_file::sized_read_unit_index): ...this.
961 (Dwo_file::copy_section): Remove section_name, is_str_offsets
962 parameters; add section_id parameter.
963 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
964 (Dwo_file::add_unit_set): ...this.
965 (Dwo_file::shndx_map_): Remove.
966 (Dwo_file::sect_offsets_): New data member.
967 (Dwp_output_file::Dwp_output_file): Initialize new data members.
968 (Dwp_output_file::add_section): Rename to...
969 (Dwp_output_file::add_contribution): ...this.
970 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
971 (Dwp_output_file::add_tu_set): Likewise.
972 (Dwp_output_file::Contribution): New type.
973 (Dwp_output_file::Section::contributions): New data member.
974 (Dwp_output_file::Cu_or_tu_set): Remove.
975 (Dwp_output_file::Section::Section): New ctor.
976 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
977 (Dwp_output_file::Dwp_index::Section_table): New type.
978 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
979 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
981 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
982 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
983 (Dwp_output_file::Dwp_index::section_table): New member function.
984 (Dwp_output_file::Dwp_index::section_table_end): New member function.
985 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
986 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
987 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
988 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
989 (Dwp_output_file::Dwp_index::section_table_): New data member.
990 (Dwp_output_file::Dwp_index::section_mask_): New data member.
991 (Dwp_output_file::add_output_section): New member function.
992 (Dwp_output_file::write_new_section): New member function.
993 (Dwp_output_file::write_contributions): New member function.
994 (Dwp_output_file::section_id_map_): New data member.
995 (class Dwo_id_info_reader): Remove.
996 (class Unit_reader): New class.
997 (get_dwarf_section_name): New function.
998 (Dwo_file::read_executable): Adjust initializations of class data.
999 (Dwo_file::read): Add support for v2 package file format.
1000 (Dwo_file::read_unit_index): Likewise.
1001 (Dwo_file::sized_read_unit_index): Likewise.
1002 (Dwo_file::copy_section): Likewise.
1003 (Dwo_file::add_unit_set): Likewise.
1004 (Dwp_output_file::add_output_section): Likewise.
1005 (Dwp_output_file::add_contribution): Likewise.
1006 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1008 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1010 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1012 (Dwp_output_file::initialize): Remove unused function.
1013 (Dwp_output_file::finalize): Add support for v2 package file format.
1014 (Dwp_output_file::write_index): Likewise.
1015 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1018 2013-03-01 Cary Coutant <ccoutant@google.com>
1020 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1021 function into class definition in header file.
1022 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1023 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1025 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1027 2013-02-28 Alan Modra <amodra@gmail.com>
1029 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1030 * target.cc (Target::do_plt_fde_location): New function.
1031 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1032 accessor function, and constructor param.
1033 (struct Post_fde, Post_fdes): Declare.
1034 (Cie::write): Add post_fdes param.
1035 * ehframe.cc (Fde::write): Use plt_fde_location.
1036 (struct Post_fde): Define.
1037 (Cie::write): Stash FDEs added post merge mapping.
1038 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1039 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1040 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1042 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1043 (Target_powerpc::has_glink): New function.
1044 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1045 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1046 glink_eh_frame_fde_32, default_fde): New data.
1047 (Stub_table::eh_frame_added_): New var.
1048 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1050 (Stub_table::add_eh_frame): New function.
1051 (Output_data_glink::add_eh_frame): New function.
1052 (Target_powerpc::make_glink_section): Call add_eh_frame.
1054 2013-02-15 Ian Lance Taylor <iant@google.com>
1056 * options.h (DEFINE_uint64_alias): Define.
1057 (class General_options): Add -Ttext-segment as an alias for
1060 2013-02-15 Alan Modra <amodra@gmail.com>
1062 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1063 (Stub_table::do_write): ..here, two places.
1064 (Stub_table::plt_call_size): Use it here too.
1066 2013-02-11 Ian Lance Taylor <iant@google.com>
1068 * descriptors.cc (Descriptors::close_all): New function.
1069 * descriptors.h (class Descriptors): Declare close_all.
1070 (close_all_descriptors): New inline function.
1071 * plugin.cc: Include "descriptors.h".
1072 (Plugin_manager::cleanup): Call close_all_descriptors.
1074 2013-02-06 Alan Modra <amodra@gmail.com>
1076 * README: Update coding style link.
1078 2013-01-28 Cary Coutant <ccoutant@google.com>
1080 * dwp.cc (File_list): New typedef.
1081 (Dwo_name_info_reader): New class.
1082 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1083 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1084 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1085 (Dwo_file::read_executable): New function.
1086 (Dwo_file::read): Move common setup code to ...
1087 (Dwo_file::make_object): ... here.
1088 (dwp_options): Add --exec/-e.
1092 2013-01-24 Sriraman Tallam <tmsriram@google.com>
1094 * layout.cc (Layout::layout): Check for option text_reorder.
1095 (Layout::make_output_section): Ditto.
1096 * options.h (text_reorder): New option.
1097 * output.cc (Input_section_sort_compare): Remove special ordering
1100 Input_section_sort_section_name_special_ordering_compare::
1101 operator()): New function.
1102 (Output_section::sort_attached_input_sections): Use new sort function
1104 * output.h (Input_section_sort_section_name_special_ordering_compare):
1106 * testsuite/Makefile.am (text_section_grouping): Test option
1108 * testsuite/Makefile.in: Regenerate.
1109 * testsuite/text_section_grouping.sh: Check order of functions without
1110 default text reordering.
1112 2013-01-18 Mike Frysinger <vapier@gentoo.org>
1114 * options.h (General_options): Change default to true for new_dtags.
1116 2013-01-18 Mike Frysinger <vapier@gentoo.org>
1118 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1119 when enable_new_dtags is false. Only add DT_RUNPATH when
1120 enable_new_dtags is true.
1122 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1124 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1125 used in declaration and definition consistent.
1126 (Target_powerpc::symval_for_branch): Ditto.
1128 2013-01-16 Sriraman Tallam <tmsriram@google.com>
1130 * testsuite/plugin_final_layout.cc: Fix comment.
1132 2013-01-16 Sriraman Tallam <tmsriram@google.com>
1134 * layout.cc (Layout::layout): Do not do default sorting for
1135 text sections when section ordering is specified.
1136 (make_output_section): Ditto.
1137 * testsuite/plugin_final_layout.cc: Name the function sections
1138 to catch reordering issues.
1140 2013-01-15 Alan Modra <amodra@gmail.com>
1142 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1145 2013-01-15 Alan Modra <amodra@gmail.com>
1147 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1148 * testsuite/Makefile.in: Regenerate.
1150 2013-01-14 Alan Modra <amodra@gmail.com>
1152 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1153 * testsuite/Makefile.in: Regenerate.
1155 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1158 Fix mingw gold build with plugins enabled
1159 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1160 * configure.ac: Export DLOPEN_LIBS and add headers check.
1161 * plugin.cc: Handle non-dlfcn case.
1162 * Makefile.in: Regenerate.
1163 * config.in: Regenerate.
1164 * configure: Regenerate.
1165 * testsuite/Makefile.in: Regenerate.
1167 2013-01-09 Sriraman Tallam <tmsriram@google.com>
1169 * output.h (sort_attached_input_sections): Change to be public.
1170 * script-sections.cc
1171 (Output_section_definition::set_section_addresses): Sort
1172 attached input sections according to section order before linker
1173 script assigns section addresses.
1174 (Orphan_output_section::set_section_addresses): Sort
1175 attached input sections according to section order before linker
1176 script assigns section addresses.
1177 * Makefile.am (final_layout.sh): Use a simple linker script to
1178 check if section ordering still works.
1179 * Makefile.in: Regenerate.
1181 2013-01-09 Ben Cheng <bccheng@google.com>
1183 * arm.cc (Target_arm::attributes_accept_div): New function.
1184 (Target_arm::attributes_forbid_div): New function.
1185 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
1186 attribute using the same new functions as what bfd/elf32_arm.c
1189 2013-01-07 Cary Coutant <ccoutant@google.com>
1192 * output.cc (Output_section::add_input_section): For incremental
1193 updates, don't track input sections that are allocated from patch
1196 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1197 Ian Lance Taylor <iant@google.com>
1200 * configure.ac (--enable-ld): Removed.
1201 (install_as_default): Set to yes only for --enable-gold=default
1203 * configure: Regenerated.
1205 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1207 * options.h (General_options): Add -fuse-ld= for GCC linker
1208 option compatibility.
1210 2013-01-04 Cary Coutant <ccoutant@google.com>
1212 * configure.ac: Fix typo restoring CXXFLAGS.
1213 * configure: Regenerate.
1215 2013-01-04 Cary Coutant <ccoutant@google.com>
1217 * testsuite/Makefile.am (CXXLINK_S): New macro.
1218 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
1219 * testsuite/Makefile.in: Regenerate.
1221 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
1223 * version.cc (print_version): Update copyright year to 2013.
1225 2012-12-20 Ian Lance Taylor <iant@google.com>
1227 * layout.cc (Layout::special_ordering_of_input_section): New
1229 (Layout::layout): If input section requires special ordering, must
1230 sort input sections.
1231 (Layout::make_output_section): May sort .text input sections.
1232 (Layout::is_section_name_prefix_grouped): Remove.
1233 * layout.h (class Layout): Declare
1234 special_ordering_of_input_section. Don't declare
1235 is_section_name_prefix_grouped.
1236 * output.cc (Output_section::add_input_section): Revert last
1238 (Output_section::Input_section_sort::match_file_name): Don't crash
1239 if called on output section data.
1240 (Output_section::Input_section_sort_compare): Sort based on
1242 (Output_section::Input_section_sort_section_order_index_compare):
1244 (Output_section::sort_attached_input_sections): Likewise.
1246 2012-12-18 Sriraman Tallam <tmsriram@google.com>
1248 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
1249 * layout.h (Layout::is_section_name_prefix_grouped): New function.
1250 * output.cc (Output_section::add_input_section): Check if section
1251 name contains special prefix. Keep input sections to sort such
1253 (Output_section::Input_section_sort_section_order_index_compare
1254 ::operator()): Group sections according to prefixes.
1255 (Output_section::sort_attached_input_sections): Add condition to
1256 Input_section_entry constructor call.
1257 * testsuite/Makefile.am (text_section_grouping): New test.
1258 * testsuite/Makefile.in: Regenerate.
1259 * testsuite/text_section_grouping.cc: New file.
1260 * testsuite/text_section_grouping.sh: New file.
1262 2012-12-17 Nick Clifton <nickc@redhat.com>
1264 * Makefile.am: Add copyright notice.
1267 * configure.ac: Likewise.
1268 * ftruncate.c: Likewise.
1269 * Makefile.in: Regenerate.
1271 2012-12-14 Cary Coutant <ccoutant@google.com>
1273 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
1274 --no-as-needed flag.
1275 (exception_separate_shared_12_test): Likewise.
1276 (incremental_copy_test): Likewise.
1277 * testsuite/Makefile.in: Regenerate.
1279 2012-12-14 Cary Coutant <ccoutant@google.com>
1281 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
1282 (Dwp_output_file::Dwp_index::enter_set): Add assert.
1284 2012-12-12 Alan Modra <amodra@gmail.com>
1286 * powerpc.cc (class Track_tls): New.
1287 (class Relocate, class Scan): Inherit Track_tls.
1288 (Target_powerpc::Scan::local, global): Track tls optimization
1289 and avoid creating plt entry for __tls_get_addr if all uses
1291 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
1293 2012-12-12 Alan Modra <amodra@gmail.com>
1295 * options.h (General_options): Add --toc-sort/--no-toc-sort.
1296 Replace no_toc_optimize with toc_optimize.
1297 * output.h (Output_section::input_sections): Provide non-const variant.
1298 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
1299 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
1301 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
1302 (class Sort_toc_sections): New.
1303 (Target_powerpc::do_finalize_sections): Sort toc sections.
1304 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
1306 2012-12-10 Roland McGrath <mcgrathr@google.com>
1308 * testsuite/binary_unittest.cc (read_all): New function.
1309 (Sized_binary_test): Use it instead of ::read.
1310 * fileread.cc (do_read): Don't assume pread always reads the whole
1311 amount in a single call.
1313 2012-12-10 Alan Modra <amodra@gmail.com>
1315 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
1316 Set EM_PPC64 or EM_PPC here.
1317 (Target_selector_powerpc::do_recognize): Delete.
1319 2012-12-10 Alan Modra <amodra@gmail.com>
1321 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
1323 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
1325 2012-12-07 Roland McGrath <mcgrathr@google.com>
1327 * testsuite/binary_unittest.cc (Sized_binary_test):
1328 Use open_descriptor rather than ::open.
1330 2012-12-07 Alan Modra <amodra@gmail.com>
1332 * powerpc.cc (Stub_table::do_write): Delete redundant Address
1333 typedef and invalid_address constant.
1334 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
1335 instantiate constants.
1337 2012-12-06 Roland McGrath <mcgrathr@google.com>
1339 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
1340 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
1341 * aclocal.m4: Regenerate.
1342 * configure: Regenerate.
1343 * Makefile.in: Regenerate.
1344 * testsuite/Makefile.in: Regenerate.
1346 2012-12-07 Alan Modra <amodra@gmail.com>
1348 * options.h (General_options): Add no_toc_optimize.
1349 * powerpc.cc (ok_lo_toc_insn): New function.
1350 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
1352 2012-12-06 Alan Modra <amodra@gmail.com>
1354 * options.h (General_options): Add plt_align, plt_static_chain,
1355 plt_thread_safe. Update stub_group_size help text.
1356 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
1357 for new plt_thread_safe_ var.
1358 (use_plt_offset): Correct comments.
1359 (Target_powerpc::do_relax): Look for thread creation symbols to
1360 determine default plt_thread_safe value. Clear plt call stubs
1361 as well as branch stubs each iteration.
1362 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
1364 (l, hi, ha, write_insn): Move earlier.
1365 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
1366 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
1368 (Stub_table::update_size): Adjust.
1369 (Stub_table::prev_size, set_prev_size): Delete.
1370 (Stub_table::stub_align): Let --plt-align affect result.
1371 (Stub_table::plt_call_size): Calculate sizes for various stubs.
1372 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
1373 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
1374 (Stub_table::do_write): Support more stub variants.
1376 2012-12-04 Alan Modra <amodra@gmail.com>
1378 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
1379 (Target_powerpc::do_define_standard_symbols): New function.
1381 2012-12-03 Alan Modra <amodra@gmail.com>
1383 * output.h: Formatting, whitespace.
1385 2012-12-03 Alan Modra <amodra@gmail.com>
1387 * layout.h (Layout::get_executable_sections): Declare.
1388 * layout.cc (Layout::get_executable_sections): New function.
1389 * arm.cc (Target_arm::group_sections): Use it.
1390 (Arm_output_section::group_sections): Delete now redundant test.
1391 * output.cc (Output_reloc::Output_reloc): Add is_relative.
1392 param to handle relative relocs.
1393 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
1394 (Output_data_reloc::add_absolute): Adjust.
1395 (Output_data_reloc::add_relative): New function.
1396 (Output_data::reset_data_size): New function.
1397 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
1398 (Output_section::set_addralign): New function.
1399 (Output_section::checkpoint_set_addralign): New function.
1400 (Output_section::clear_section_offsets_need_adjustment): New function.
1401 (Output_section::input_sections): Make public.
1402 * powerpc.cc (class Output_data_brlt_powerpc): New.
1403 (class Stub_table, class Stub_control): New.
1404 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
1405 stub_table_, set_stub_table, stub_table): New vectors and accessor
1407 (Target_powerpc::do_may_relax, do_relax, push_branch,
1408 new_stub_table, stub_tables, brlt_section, group_sections,
1409 add_branch_lookup_table, find_branch_lookup_table,
1410 write_branch_lookup_table, make_brlt_section): New functions.
1411 (Target_powerpc::struct Sort_sections, class Branch_info): New.
1412 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
1413 branch_info_): New vars.
1414 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
1415 make call stubs here.
1416 (Output_data_glink): Remove all call stub handling from this class.
1417 (Target_powerpc::Scan::local, global): Save interesting branch
1418 relocs and relocs for ifunc. Adjust calls to plt entry functions.
1419 (Target_powerpc::do_finalize_sections): Only make reg save/restore
1420 functions on final link.
1421 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
1422 Handle long branch destinations too.
1423 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
1424 do_plt_address_for_local): Adjust lookup of plt call stubs.
1426 2012-11-30 Alan Modra <amodra@gmail.com>
1428 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
1429 relocs against protected symbols when building 32-bit shared libs.
1431 2012-11-30 Alan Modra <amodra@gmail.com>
1433 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
1434 param. Call got_section() to make .got. Update all callers
1435 and their callers and so on.
1437 2012-11-30 Alan Modra <amodra@gmail.com>
1439 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
1440 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
1441 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
1442 value if it already exists.
1444 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
1447 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
1449 2012-11-14 Roland McGrath <mcgrathr@google.com>
1451 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
1452 than bfc instruction for data sandboxing.
1454 2012-11-08 Alan Modra <amodra@gmail.com>
1456 * po/POTFILES.in: Regenerate.
1458 2012-11-05 Alan Modra <amodra@gmail.com>
1460 * configure.ac: Apply 2012-09-10 change to config.in here.
1461 * configure: Regenerate.
1463 2012-11-05 Alan Modra <amodra@gmail.com>
1465 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
1466 (struct Opd_ent): Use "Address" rather than "Offset".
1467 (Output_data_got_powerpc::got_base_offset): Return Valtype.
1468 (Target_powerpc::got_section): Make public.
1469 (Target_powerpc::scan_relocs): Move code setting symbols..
1470 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
1471 Create _SDA_BASE_ only when referenced.
1473 2012-11-02 Roland McGrath <mcgrathr@google.com>
1475 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
1478 2012-11-01 Roland McGrath <mcgrathr@google.com>
1480 * target.h (Sized_target::relocate_relocs): Use Elf_Off
1481 for offset_in_output_section parameter.
1482 (Sized_target::relocate_special_relocatable): Likewise.
1483 * arm.cc (Target_arm::relocate_relocs): Likewise.
1484 (Target_arm::relocate_special_relocatable): Likewise.
1485 * i386.cc (Target_i386::relocate_relocs): Likewise.
1486 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
1487 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
1488 * target-reloc.h (relocate_relocs): Likewise.
1489 * testsuite/testfile.cc (Target_test): Likewise.
1490 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
1491 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
1493 * system.h: Move inclusion of <clocale> to after <libintl.h> in
1494 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
1496 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
1497 parameter, which is unused in the [!F_SETFD] case.
1499 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
1500 SYMNDX to off_t before comparing it to this->data_size().
1501 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
1502 * incremental.cc (Output_section_incremental_inputs::do_write):
1503 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
1505 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
1507 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
1509 * gold.cc (Target_arm::do_adjust_elf_header): Add the
1510 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
1513 2012-10-29 Cary Coutant <ccoutant@google.com>
1515 * dwp.cc (usage): Add file and exit status parameters;
1516 add --help and --version options.
1517 (print_version): New function.
1518 (main): Add --help and --version options.
1520 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1522 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
1523 final_layout_sequence.txt.
1524 * testsuite/Makefile.in: Regenerated.
1526 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1528 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
1529 COMPILE generated by automake.
1531 (CXXCOMPILE1): Likewise.
1532 (CXXLINK1): Likewise.
1533 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
1535 (CXXCOMPILE): Likewise.
1536 (CXXLINK): Likewise.
1537 * testsuite/Makefile.in: Regenerated.
1539 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1541 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
1542 on bad fwrite return.
1544 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1546 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
1549 2012-10-23 Cary Coutant <ccoutant@google.com>
1551 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
1552 * testsuite/Makefile.in: Regenerate.
1553 * testsuite/dwp_test.h: New source file.
1554 * testsuite/dwp_test_1.cc: New source file.
1555 * testsuite/dwp_test_1.s: New source file.
1556 * testsuite/dwp_test_1.sh: New source file.
1557 * testsuite/dwp_test_1b.cc: New source file.
1558 * testsuite/dwp_test_1b.s: New source file.
1559 * testsuite/dwp_test_2.cc: New source file.
1560 * testsuite/dwp_test_2.s: New source file.
1561 * testsuite/dwp_test_2.sh: New source file.
1562 * testsuite/dwp_test_main.cc: New source file.
1563 * testsuite/dwp_test_main.s: New source file.
1565 2012-10-23 Cary Coutant <ccoutant@google.com>
1567 * dwp.h: New header file.
1568 * dwp.cc: New source file.
1569 * gold.h: Move shared declarations to system.h.
1570 * system.h: New header file.
1571 * Makefile.am: Add dwp.
1572 * Makefile.in: Regenerate.
1574 2012-10-23 Cary Coutant <ccoutant@google.com>
1576 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
1577 Dwarf_info_reader::read_from_pointer.
1578 (Dwarf_pubnames_table::read_header): Likewise.
1579 (Dwarf_pubnames_table::next_name): Likewise.
1580 (Dwarf_die::read_attributes): Likewise.
1581 (Dwarf_die::skip_attributes): Likewise.
1582 (Dwarf_info_reader::read_from_pointer): New function template.
1583 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
1584 (Dwarf_pubnames_table): Likewise.
1585 (Dwarf_info_reader::read_from_pointer): New function template.
1586 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
1587 Dwarf_pubnames_table ctor.
1589 2012-10-23 Cary Coutant <ccoutant@google.com>
1591 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
1593 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
1595 (Dwarf_info_reader::set_abbrev_shndx): New method.
1596 (Dwarf_info_reader::abbrev_shndx_): New data member.
1598 2012-10-23 Cary Coutant <ccoutant@google.com>
1600 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
1601 from object, not parameters.
1602 (Dwarf_info_reader::parse): Likewise.
1603 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
1604 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
1605 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
1608 2012-10-23 Cary Coutant <ccoutant@google.com>
1610 * fileread.cc (Input_file::Input_file): New constructor.
1611 * fileread.h (class Input_file): Add new constructor.
1613 2012-10-18 Alan Modra <amodra@gmail.com>
1616 * object.cc (Relobj::is_section_name_included): Also match
1617 .sdata personality section.
1619 2012-10-18 Alan Modra <amodra@gmail.com>
1621 * target-reloc.h (class Default_comdat_behavior): New, package up..
1622 (get_comdat_behaviour): ..this.
1623 (relocate_section): Add Relocate_comdat_behavior template arg,
1624 adjust code to suit.
1625 * arm.cc (Target_arm::relocate_section): Adjust to suit.
1626 (Target_arm::scan_reloc_section): Likewise.
1627 * i386.cc (Target_i386::relocate_section): Likewise.
1628 * sparc.cc (Target_sparc::relocate_section): Likewise.
1629 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
1630 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
1631 * powerpc.cc (class Relocate_comdat_behavior): New.
1632 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
1633 gold::relocate_section with new template arg.
1635 2012-10-18 Alan Modra <amodra@gmail.com>
1637 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
1638 dynamic relocs for GOT_TPREL got entries, without symbol if
1640 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
1641 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
1642 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
1644 2012-10-17 Alan Modra <amodra@gmail.com>
1647 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
1649 2012-10-16 Sriraman Tallam <tmsriram@google.com>
1651 * layout.cc (Layout::include_section): Keep sections marked
1652 SHF_EXCLUDE when doing relocatable links.
1654 2012-10-16 Alan Modra <amodra@gmail.com>
1656 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
1657 (Target_powerpc::do_finalize_sections): Call it.
1658 (Output_data_save_res): New class and supporting functions.
1659 (Target_powerpc::symval_for_branch): Only look up .opd entry for
1660 normal symbols defined in object files.
1662 2012-10-12 Alan Modra <amodra@gmail.com>
1664 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
1665 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
1666 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
1667 section if scan_opd_relocs not yet called.
1668 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
1670 2012-10-12 Alan Modra <amodra@gmail.com>
1672 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1673 add_local_ifunc_entry): Revert last change.
1674 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
1676 2012-10-05 Alan Modra <amodra@gmail.com>
1678 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
1679 do_plt_address_for_global): New functions.
1680 (Output_data_got_powerpc::do_write): Don't segfault when linking
1682 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1683 add_local_ifunc_entry): Return true on adding entry..
1684 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
1685 glink->add_entry call. Remove unused symtab param. Adjust calls.
1686 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
1687 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
1688 set up symbols here.
1689 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
1690 syms here. Do so even when no .iplt. Don't segfault when linking
1692 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
1693 new variants without reloc param.
1694 (Glink_sym_ent::Glink_sym_ent): Likewise.
1695 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
1696 reloc when refs will resolve to plt call stub.
1697 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
1698 R_PPC_PLTREL24 to resolve locally.
1699 (Target_powerpc::Scan::global): Correct ifunc handling.
1700 (Target_powerpc::Relocate::relocate): Correct local sym glink
1701 lookup. Don't destroy "value" when we have a plt call stub,
1702 and when checking plt call validity.
1703 (Target_powerpc::do_dynsym_value): Simplify.
1705 2012-10-05 Alan Modra <amodra@gmail.com>
1707 * i386.cc (Output_data_plt_i386::address_for_global,
1708 address_for_local): Add plt offset to returned value. Adjust uses.
1709 * sparc.cc (Output_data_plt_sparc::address_for_global,
1710 address_for_local): Likewise.
1711 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
1712 address_for_local): Likewise.
1713 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
1714 address_for_local): Likewise.
1715 * target.h (Target::plt_address_for_global, plt_address_for_local):
1717 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
1718 (Output_data_got::Got_entry::write): Nor here.
1719 * output.h: Comment fix.
1721 2012-10-02 Jiong Wang <jiwang@tilera.com>
1723 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
1724 global_offset_table_ value for larget got.
1725 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
1727 2012-09-29 Alan Modra <amodra@gmail.com>
1729 * powerpc.cc (Target_powerpc::iplt_): New output section.
1730 (Target_powerpc::iplt_section, make_iplt_section,
1731 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
1732 (Target_powerpc::make_plt_entry): Handle ifunc syms.
1733 Target_powerpc::plt_entry_count): Count iplt entries too.
1734 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
1735 reloc section in constructor. New params.
1736 (Target_powerpc::make_plt_section): Create reloc section here instead.
1737 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
1739 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
1740 (Output_data_glink::add_entry, find_entry): New functions to
1741 deal with local syms.
1742 (Glink_sym_ent): Add support for local syms.
1743 (Output_data_glink::do_write): Handle ifunc plt entries.
1744 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1745 (Target_powerpc::Scan::local, global): Handle ifunc syms.
1746 (Target_powerpc::Relocate::relocate): Likewise.
1747 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
1749 2012-09-25 Alan Modra <amodra@gmail.com>
1751 * object.h (Sized_relobj_file::adjust_local_symbol,
1752 do_adjust_local_symbol): New functions.
1753 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
1754 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
1755 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
1756 and irregular opd entry spacing.
1757 (Powerpc_relobj::do_read_relocs): Add opd size checks.
1758 (Global_symbol_visitor_opd): New functor.
1759 (Target_powerpc::do_finalize_sections): Omit global symbols defined
1760 on deleted opd entries.
1762 2012-09-15 Jiong Wang <jiwang@tilera.com>
1764 * tilegx.cc: New file.
1765 * Makefile.am (TARGETSOURCES): Add tilegx.cc
1766 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
1767 * configure.tgt: Add entries for tilegx*.
1768 * configure.ac: Likewise.
1769 * Makefile.in: Rebuild.
1770 * configure: Likewise.
1771 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
1774 2012-09-13 Alan Modra <amodra@gmail.com>
1776 * target-reloc.h (scan_relocs): Call scan.local for relocs
1777 against symbols in discarded sections. Pass is_discarded
1779 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
1780 Add is_discarded param.
1781 * powerpc (Target_powerpc::Scan::local): Likewise. Use
1782 is_discarded to flag opd entry as discarded. Don't emit dyn
1783 relocs on such entries.
1784 (Target_powerpc::Scan::global): Similarly detect and handle
1786 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
1787 opd_ent_. Update all uses.
1788 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
1789 (Target_powerpc::relocate_section): Zero out discarded opd
1792 2012-09-12 Ian Lance Taylor <iant@google.com>
1795 * output.cc: Rename Output_data_got template parameter from size
1796 to got_size for all functions. Compile all variants of
1798 (Output_data_got::Got_entry::write): Correct use of size for
1799 symbol value. Use local_is_tls rather than casting to
1801 * object.h (class Object): Add local_is_tls and do_local_is_tls.
1802 (class Sized_relobj_file): Add do_local_is_tls.
1803 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
1805 2012-09-11 Alan Modra <amodra@gmail.com>
1808 * layout.cc (Layout::set_segment_offsets): When using
1809 common-page-size alignment, ensure we are on a new max-page-size
1811 * output.cc (Output_segment::set_section_addresses): Use
1812 abi_pagesize, not common_pagesize for relro boundary.
1813 (Output_segment::set_offset): Likewise.
1815 2012-09-11 Alan Modra <amodra@gmail.com>
1817 * output.h (Output_data_got::add_global_tls, add_local_tls,
1818 add_local_tls_pair): New functions.
1819 (Output_data_got::add_local_pair_with_rel): Remove second
1820 reloc param. Expand comment.
1821 (Output_data_got::Got_entry): Rename use_plt_offset_ to
1822 use_plt_or_tls_offset_, similarly for constructor param.
1823 (Output_data_got::Got_entry::write): Add got_index param.
1824 * output.cc (Output_data_got::add_global_tls, add_local_tls,
1825 add_local_tls_pair): New functions.
1826 (Output_data_got::Got_entry::write): Handle tls symbols
1827 with use_plt_or_tls_offset_ set specially.
1828 (Output_data_got::add_local_pair_with_rel): Only one reloc.
1829 (Output_data_got::do_write): Replace iterator with index, pass
1830 index to entry write function.
1831 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
1832 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
1833 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
1835 * i386.cc (Target_i386::Scan::local): Likewise.
1836 * sparc.cc (Target_sparc::Scan::local): Likewise.
1837 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
1838 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
1839 do_tls_offset_for_global): New functions.
1840 (Target_powerpc::Scan::local): Correct TLS relocations and got
1842 (Target_powerpc::Scan::global): Don't emit unnecessary
1843 dynamic relocations on TLS GOT entries.
1845 2012-09-10 Matthias Klose <doko@ubuntu.com>
1847 * config.in: Disable sanity check for kfreebsd.
1849 2012-09-10 Sterling Augustine <saugustine@google.com>
1851 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
1852 (Gdb_index::pubtypes_read): New parameter.
1853 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
1855 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
1858 2012-09-09 Alan Modra <amodra@gmail.com>
1860 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
1861 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
1862 * gc.h (gc_process_relocs): Call target gc_add_reference.
1863 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
1864 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
1865 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
1867 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
1868 to cater for when we don't need code offset. Update use.
1869 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
1870 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
1871 set_opd_valid): New functions.
1872 (Target_powerpc::do_gc_add_reference): New function.
1873 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
1875 (Target_powerpc::do_gc_mark_symbol): New function.
1877 2012-09-06 Cary Coutant <ccoutant@google.com>
1879 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
1880 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
1881 (Dwarf_die::skip_attributes): Likewise.
1882 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
1883 * testsuite/gdb_index_test.cc (inline_func_1): New function.
1885 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
1887 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
1889 * testsuite/script_test_3.t: Add .got.plt output section
1891 * testsuite/script_test_4.t: Likewise.
1893 2012-09-05 Alan Modra <amodra@gmail.com>
1895 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
1896 update all uses and lose "enum" when using type.
1898 2012-09-05 Alan Modra <amodra@gmail.com>
1900 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
1901 * configure: Regenerate.
1902 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
1903 (plugin_final_layout.stdout): Likewise.
1904 (memory_test): Set page sizes to 0x1000.
1905 * testsuite/Makefile.in: Regenerate.
1906 * testsuite/discard_locals_test.sh: Add FIXME comment.
1907 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
1908 * testsuite/pr14265.t: Add .got output section statement.
1909 * testsuite/script_test_2.t: Likewise.
1910 * testsuite/script_test_3.t: Likewise.
1911 * testsuite/script_test_4.t: Likewise.
1912 * testsuite/script_test_5.t: Likewise.
1913 * testsuite/script_test_6.t: Likewise.
1914 * testsuite/script_test_7.t: Likewise.
1915 * testsuite/script_test_9.t: Likewise.
1917 2012-09-05 Alan Modra <amodra@gmail.com>
1919 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
1920 (Powerpc_relocate_functions::Status): New typedef.
1921 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1922 (Target_powerpc::Scan::local): Handle REL64.
1923 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
1924 for REL32 and REL64.
1925 (Target_powerpc::symval_for_branch): New function, extracted from..
1926 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
1927 checks. Report overflow errors.
1929 2012-09-05 Alan Modra <amodra@gmail.com>
1931 * object.h (Sized_relobj_file::emit_relocs): Delete.
1932 (Sized_relobj_file::emit_relocs_reltype): Delete.
1933 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
1934 relocate_relocs for --emit-relocs.
1935 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
1936 * output.h: Update comment.
1937 (Output_segment::first_section): New function.
1938 (Output_segment::first_section_load_address): Use first_section.
1939 * output.cc (Output_segment::first_section): New function extracted..
1940 (Output_segment::first_section_load_address): ..from here. Delete.
1941 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
1942 * target.h (Sized_target::relocate_for_relocatable): Likewise.
1943 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
1944 adjust call to target.h function.
1945 * i386.cc (Target_i386): Likewise.
1946 * sparc.cc (Target_sparc): Likewise.
1947 * x86_64.cc (Target_x86_64): Likewise.
1948 * powerpc.cc (Target_powerpc): Likewise.
1949 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
1950 first tls section has section symbol for optimised local dynamic
1952 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
1953 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
1955 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
1956 Rename to relocate_relocs. Update error message.
1958 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
1960 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
1963 2012-08-31 Alan Modra <amodra@gmail.com>
1965 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
1966 (Powerpc_relobj::toc_base_offset): New stub function.
1967 (Target_powerpc): Add tp_offset, dtp_offset. Rename
1968 got_mod_index_offset to tlsld_got_offset. Update all refs.
1969 (Target_powerpc::Relocate::enum skip_tls): New.
1970 (Target_powerpc::call_tls_get_addr_): New var.
1971 (Target_powerpc::is_branch_reloc): Move to file scope.
1972 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
1973 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
1975 (Target_powerpc::enum Got_type): Delete old values, add new ones.
1976 (powerpc_info): Correct common_pagesize for ppc64.
1977 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
1978 (Powerpc_relocate_functions): Add overflow check enums and functions.
1979 Add non-shift version of rela, rela_ua. Delete all rel public
1980 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
1981 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
1982 addr16_ha3, addr14 functions.
1983 (Output_data_got_powerpc::add_constant_pair): New function.
1984 (Output_data_got_powerpc::got_base_offset): Likewise.
1985 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
1986 (instruction constants): Sort, add some more.
1987 (Output_data_glink::do_write): Add and use Address typedef. Use
1988 object->toc_base_offset() stub for 64-bit.
1989 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
1990 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1991 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
1992 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
1993 Always treat .opd relocs as against locally defined symbol.
1994 Correct condition for RELATIVE relocs.
1995 (Target_powerpc::do_finalize_sections): Test for NULL sections.
1996 (Target_powerpc::Relocate::relocate): Use plt call stub as value
1997 for 32-bit syms with a plt entry. Correct ppc64 toc base
1998 calculations. Handle TLS relocs, and more. Add overflow
1999 checking and adjust for Powerpc_relocate_functions changes.
2000 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2001 Reinstate --emit-relocs code with FIXME.
2003 2012-08-30 Alan Modra <amodra@gmail.com>
2005 * layout.cc (Layout::set_segment_offsets): Set p_align to
2006 abi_pagesize, not common_pagesize.
2007 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2008 to determine whether file header can go in segment.
2010 2012-08-30 Alan Modra <amodra@gmail.com>
2012 * output.h (Output_reloc::Output_reloc <output section>): Add
2013 is_relative param. Adjust calls.
2014 (Output_reloc::add_output_section_relative): New functions.
2015 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2017 (Output_reloc::symbol_value): Handle SECTION_CODE.
2019 2012-08-24 Sriraman Tallam <tmsriram@google.com>
2021 * gold.cc (queue_middle_tasks): Call layout again when unique
2022 segments for sections is desired.
2023 * layout.cc (Layout::Layout): Initialize new members.
2024 (Layout::get_output_section_flags): New function.
2025 (Layout::choose_output_section): Call get_output_section_flags.
2026 (Layout::layout): Make output section for mapping to a unique segment.
2027 (Layout::insert_section_segment_map): New function.
2028 (Layout::attach_allocated_section_to_segment): Make unique segment for
2029 output sections marked so.
2030 (Layout::segment_precedes): Check for unique segments when sorting.
2031 * layout.h (Layout::Unique_segment_info): New struct.
2032 (Layout::Section_segment_map): New typedef.
2033 (Layout::insert_section_segment_map): New function.
2034 (Layout::get_output_section_flags): New function.
2035 (Layout::is_unique_segment_for_sections_specified): New function.
2036 (Layout::set_unique_segment_for_sections_specified): New function.
2037 (Layout::unique_segment_for_sections_specified_): New member.
2038 (Layout::section_segment_map_): New member.
2039 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2040 Rename is_gc_pass_one to is_pass_one.
2041 Rename is_gc_pass_two to is_pass_two.
2042 Rename is_gc_or_icf to is_two_pass.
2043 Check for which pass based on whether symbols data is present.
2044 Make it two pass when unique segments for sections is desired.
2045 * output.cc (Output_section::Output_section): Initialize new
2047 * output.h (Output_section::is_unique_segment): New function.
2048 (Output_section::set_is_unique_segment): New function.
2049 (Output_section::is_unique_segment_): New member.
2050 (Output_section::extra_segment_flags): New function.
2051 (Output_section::set_extra_segment_flags): New function.
2052 (Output_section::extra_segment_flags_): New member.
2053 (Output_section::segment_alignment): New function.
2054 (Output_section::set_segment_alignment): New function.
2055 (Output_section::segment_alignment_): New member.
2056 (Output_segment::Output_segment): Initialize is_unique_segment_.
2057 (Output_segment::is_unique_segment): New function.
2058 (Output_segment::set_is_unique_segment): New function.
2059 (Output_segment::is_unique_segment_): New member.
2060 * plugin.cc (allow_unique_segment_for_sections): New function.
2061 (unique_segment_for_sections): New function.
2062 (Plugin::load): Add new functions to transfer vector.
2063 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2064 * Makefile.in: Regenerate.
2065 * testsuite/plugin_final_layout.sh: Check if unique segment
2066 functionality works.
2067 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2069 (allow_unique_segment_for_sections): New global.
2070 (unique_segment_for_sections): New global.
2071 (claim_file_hook): Call allow_unique_segment_for_sections.
2072 (all_symbols_read_hook): Call unique_segment_for_sections.
2074 2012-08-22 Cary Coutant <ccoutant@google.com>
2076 * layout.cc (Layout::include_section): Don't assert on GROUP
2077 sections with --emit-relocs.
2079 2012-08-21 Cary Coutant <ccoutant@google.com>
2081 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2082 if --export-dynamic-symbol names an undef symbol.
2084 2012-08-18 Alan Modra <amodra@gmail.com>
2086 * powerpc.cc: Formatting and white space.
2087 (Powerpc_relobj): Rename got2_section_ to special_.
2088 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2089 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2090 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2091 (Target_powerpc): Add Address typedef and invalid_address. Use
2093 (Target_powerpc::is_branch_reloc): New function.
2094 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2095 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2096 for dst_mask, value and addend.
2097 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2098 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2099 (Output_data_glink::do_write): Correct toc base. Don't try to use
2100 uint16_t for 24-bit offset. Use get_output_section_offset and
2102 (Target_powerpc::Scan::local): Handle more relocs.
2103 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2104 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2105 Plug in toc restoring insn after plt calls. Translate branches
2106 to function descriptor symbols to corresponding entry point.
2107 (Target_powerpc::relocate_for_relocatable): Check return from
2108 get_output_section_offset.
2109 * symtab.h: Comment typo.
2111 2012-08-14 Ian Lance Taylor <iant@google.com>
2113 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2114 unsupported_relocal_local to call unsupported_reloc_global.
2116 2012-08-14 Nick Clifton <nickc@redhat.com>
2119 * script-sections.cc (Sections_element::output_section_name): Add
2120 keep return parameter.
2121 (Output_section_element::match_name): Add keep return parameter.
2122 Return the value of the keep_ member.
2123 * script-sections.h (class Output_section): Update
2124 output_section_name prototype.
2125 * layout.cc (Layout::keep_input_section): New public member
2127 (Layout::choose_output_section): Pass keep parameter to
2128 output_section_name.
2129 * layout.h (class Layout): Add keep_input_section.
2130 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2132 * testsuite/Makefile.am: Add a test.
2133 * testsuite/Makefile.in: Regenerate.
2134 * testsuite/pr14265.c: Source file for the test.
2135 * testsuite/pr14265.t: Linker script for the test.
2136 * testsuite/pr14265.sh: Shell script for the test.
2138 2012-08-14 Alan Modra <amodra@gmail.com>
2140 * target.h (Target::output_section_name): New function.
2141 (Target::do_output_section_name): New function.
2142 * layout.cc (Layout::choose_output_section): Call the above.
2143 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2145 2012-08-14 Alan Modra <amodra@gmail.com>
2147 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2148 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2149 for replace_constant call.
2150 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2151 (Output_data_glink::do_print_to_mapfile): New function.
2152 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2153 (Target_powerpc::Relocate::relocate): Likewise.
2155 2012-08-14 Alan Modra <amodra@gmail.com>
2157 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2158 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2159 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2160 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2161 all references to shndx_. Handle special case for R_PPC_PLTREL24
2163 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2164 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2165 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2167 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2168 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2170 2012-08-12 Alan Modra <amodra@gmail.com>
2172 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
2173 (glink insn constants): Use uint32_t.
2174 (Output_data_glink::add_entry): Use insert, not [] operator.
2176 2012-08-11 Alan Modra <amodra@gmail.com>
2178 * object.h (Sized_relobj_file::find_shdr): New function.
2179 (Sized_relobj_file::find_special_sections): New function.
2180 * object.cc (Sized_relobj_file::find_shdr): New function.
2181 (Sized_relobj_file::find_eh_frame): Use find_shdr.
2182 (Sized_relobj_file::find_special_sections): New function, split out..
2183 (Sized_relobj_file::do_read_symbols): ..from here.
2184 * output.h (Output_data_got::replace_constant): New function.
2185 (Output_data_got::num_entries): New function.
2186 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
2187 (Output_data_got::got_offset): Protected rather than private.
2188 (Output_data_got::replace_got_entry): New function.
2189 * output.cc (Output_data_got::replace_got_entry): New function.
2190 * powerpc.cc (class Powerpc_relobj): New.
2191 (class Powerpc_relocate_functions): Delete all psymval variants or
2192 convert to value,addend type. Delete pcrela, pcrela_unaligned.
2193 Implement _ha functions using corresponding _hi function.
2194 (Powerpc_relobj::find_special_sections): New function.
2195 (Target_powerpc::do_make_elf_object): New function.
2196 (class Output_data_got_powerpc): New.
2197 (class Output_data_glink): New.
2198 (class Powerpc_scan_relocatable_reloc): New.
2199 Many more changes througout file.
2201 2012-08-09 Nick Clifton <nickc@redhat.com>
2203 * po/vi.po: Updated Vietnamese translation.
2205 2012-08-07 Ian Lance Taylor <iant@google.com>
2207 * layout.cc (Layout::add_target_dynamic_tags): If
2208 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
2211 2012-07-30 Nick Clifton <nickc@redhat.com>
2213 * po/gold.pot: Updated template.
2214 * po/es.po: Updated Spanish translation.
2216 2012-07-18 Cary Coutant <ccoutant@google.com>
2219 * configure.ac: Add check for -gpubnames support.
2220 * configure: Regenerate.
2221 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
2222 support; force -gno-pubnames.
2223 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
2225 (gdb_index_test_4): New test.
2226 * testsuite/Makefile.in: Regenerate.
2227 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
2228 * testsuite/gdb_index_test_2.sh: Likewise.
2229 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
2230 * testsuite/gdb_index_test_4.sh: New script.
2231 * testsuite/gdb_index_test_comm.sh: New script with common code;
2232 don't look for space after colon.
2234 2012-07-16 Sriraman Tallam <tmsriram@google.com>
2236 * gold.cc (queue_middle_tasks): Update function order only after
2237 deferred objects due to plugins are processed.
2239 2012-07-11 Ian Lance Taylor <iant@google.com>
2241 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
2242 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
2243 (Target_arm::scan_reloc_for_stub): Likewise.
2244 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
2245 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
2246 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
2247 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
2248 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
2250 2012-07-10 Dodji Seketeli <dodji@redhat.com>
2251 Ian Lance Taylor <iant@google.com>
2254 * configure.ac: Test whether std::tr1::hash<off_t> works.
2255 * gold.h: Add a specialization for std::tr1::hash<off_t> if
2257 * output.h (class Output_fill): Add virtual destructor.
2258 * configure, config.in: Rebuild.
2260 2012-06-22 Roland McGrath <mcgrathr@google.com>
2262 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
2264 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
2266 * plugin.cc (Plugin::load): Handle position independent executables.
2268 2012-06-06 Cary Coutant <ccoutant@google.com>
2270 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
2272 (lines_only_debug_sections): Likewise.
2273 (gdb_fast_lookup_sections): New static array.
2274 (is_gdb_debug_section): Rename formal parameter.
2275 (is_lines_only_debug_section): Likewise.
2276 (is_gdb_fast_lookup_section): New function.
2277 (Layout::include_section): Check for ".zdebug_" prefix; pass
2278 section name suffix to is_gdb_debug_section, et al.; check for
2279 fast-lookup sections when building .gdb_index.
2280 * options.h (--strip-debug-gdb): Update GDB version number.
2282 2012-06-06 Cary Coutant <ccoutant@google.com>
2284 * configure.ac: Add check for fallocate.
2285 * configure: Regenerate.
2286 * config.in: Regenerate.
2288 * options.h (class General_options): Add --mmap-output-file and
2289 --posix-fallocate options.
2290 * output.cc: (posix_fallocate): Remove; replace with...
2291 (gold_fallocate): New function.
2292 (Output_file::map_no_anonymous): Call gold_fallocate.
2293 (Output_file::map): Check --mmap-output-file option.
2295 2012-06-05 Jing Yu <jingyu@google.com>
2297 * gold.h (textdomain): Add do {} to empty while(0).
2298 (bindtextdomain): Likewise.
2300 2012-06-04 Cary Coutant <ccoutant@google.com>
2302 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
2305 2012-05-25 Sriraman Tallam <tmsriram@google.com>
2307 * symtab.cc (Symbol_table::define_special_symbol):
2308 Initialize *poldsym to prevent uninitialized variable errors.
2310 2012-05-23 Cary Coutant <ccoutant@google.com>
2312 * layout.cc (Layout::section_name_mapping): Add rules to handle
2313 exact match on .data.rel.ro.local or .data.rel.ro.
2314 (Layout::output_section_name): Check for exact matches.
2316 2012-05-23 Cary Coutant <ccoutant@google.com>
2318 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
2321 2012-05-22 Cary Coutant <ccoutant@google.com>
2323 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
2324 object before exporting symbol.
2326 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
2328 * testsuite/tls_test.cc: Include "config.h" first.
2329 * testsuite/tls_test_c.c: Likewise.
2331 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
2332 Nick Clifton <nickc@redhat.com>
2335 * configure.in: Add check that sysdep.h has been included before
2336 any system header files.
2337 * configure: Regenerate.
2338 * config.in: Regenerate.
2340 2012-05-14 Cary Coutant <ccoutant@google.com>
2342 * layout.cc (Layout::make_output_section): Mark .tdata section
2344 * testsuite/relro_test.cc: Add a TLS variable.
2346 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
2349 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
2350 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
2353 2012-05-08 Cary Coutant <ccoutant@google.com>
2355 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
2356 (lines_only_debug_sections): Likewise.
2358 2012-05-02 Roland McGrath <mcgrathr@google.com>
2360 * nacl.cc: New file.
2362 * Makefile.am (CCFILES, HFILES): Add them.
2363 * Makefile.in: Regenerate.
2364 * i386.cc (Output_data_plt_i386_nacl): New class.
2365 (Output_data_plt_i386_nacl_exec): New class.
2366 (Output_data_plt_i386_nacl_dyn): New class.
2367 (Target_i386_nacl): New class.
2368 (Target_selector_i386_nacl): New class.
2369 (target_selector_i386): Use it instead of Target_selector_i386.
2370 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
2371 (Target_x86_64_nacl): New class.
2372 (Target_selector_x86_64_nacl): New class.
2373 (target_selector_x86_64, target_selector_x32): Use it instead of
2374 Target_selector_x86_64.
2375 * arm.cc (Output_data_plt_arm_nacl): New class.
2376 (Target_arm_nacl): New class.
2377 (Target_selector_arm_nacl): New class.
2378 (target_selector_arm, target_selector_armbe): Use it instead of
2379 Target_selector_arm.
2381 * target-select.cc (select_target): Take new Input_file* and off_t
2382 arguments, pass them on to recognize method of selector.
2383 * object.cc (make_elf_sized_object): Update caller.
2384 * parameters.cc (parameters_force_valid_target): Likewise.
2385 * incremental.cc (make_sized_incremental_binary): Likewise.
2386 * target-select.h: Update decl.
2387 (Target_selector::recognize): Take new Input_file* argument,
2388 pass it on to do_recognize.
2389 (Target_selector::do_recognize): Take new Input_file* argument.
2390 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
2391 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
2392 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
2393 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
2395 * target.h (Target::Target_info): New members isolate_execinstr
2397 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
2398 * arm.cc (Target_arm::arm_info): Update initializer.
2399 * i386.cc (Target_i386::i386_info): Likewise.
2400 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
2401 * sparc.cc (Target_sparc::sparc_info): Likewise.
2402 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
2403 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2404 * layout.cc (Layout::attach_allocated_section_to_segment):
2405 Take new const Target* argument. If target->isolate_execinstr(), act
2407 (Layout::find_first_load_seg): Take new const Target* argument;
2408 if target->isolate_execinstr(), reject PF_X segments.
2409 (Layout::relaxation_loop_body): Update caller.
2410 (Layout::set_segment_offsets): If target->isolate_execinstr(),
2411 reset file offset to zero when we hit LOAD_SEG, and then do a second
2412 loop over the segments before LOAD_SEG to reassign offsets after
2413 addresses have been determined. Handle target->rosegment_gap().
2414 (Layout::attach_section_to_segment): Take new const Target* argument;
2415 pass it to attach_allocated_section_to_segment.
2416 (Layout::make_output_section): Update caller.
2417 (Layout::attach_sections_to_segments): Take new const Target* argument;
2418 pass it to attach_section_to_segment.
2419 * gold.cc (queue_middle_tasks): Update caller.
2420 * layout.h (Layout): Update method decls with new arguments.
2422 * arm.cc (Target_arm::Target_arm): Take optional argument for the
2423 Target_info pointer to use.
2424 (Target_arm::do_make_data_plt): New virtual method.
2425 (Target_arm::make_data_plt): New method that calls it.
2426 (Target_arm::make_plt_entry): Use it.
2427 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
2428 for the section alignment.
2429 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
2431 (Output_data_plt_arm::first_plt_entry_offset): Call it.
2432 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
2434 (Output_data_plt_arm::get_plt_entry_size): Call it.
2435 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
2436 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
2437 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
2439 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
2440 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
2441 method instead of sizeof(plt_entry).
2442 (Output_data_plt_arm::add_entry): Likewise.
2443 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
2444 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
2446 (Target_arm::plt_entry_size): Likewise.
2447 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
2449 (Output_data_plt_arm_standard): ... here, new class.
2450 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
2451 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
2452 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
2454 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2455 Take additional argument for the PLT entry size.
2456 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
2457 Use get_plt_entry_size method rather than plt_entry_size variable.
2458 (Output_data_plt_x86_64::reserve_slot): Likewise.
2459 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
2460 (Output_data_plt_x86_64::add_entry): Likewise.
2461 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
2462 (Output_data_plt_x86_64::address_for_global): Likewise.
2463 (Output_data_plt_x86_64::address_for_local): Likewise.
2464 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2465 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
2466 Make method non-static.
2467 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
2469 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
2470 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
2471 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
2472 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
2474 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
2475 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
2477 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
2478 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
2480 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
2481 (Output_data_plt_x86_64::plt_entry_size)
2482 (Output_data_plt_x86_64::first_plt_entry)
2483 (Output_data_plt_x86_64::plt_entry)
2484 (Output_data_plt_x86_64::tlsdesc_plt_entry)
2485 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
2486 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
2487 (Output_data_plt_x86_64_standard): ... here, new class.
2488 (Target_x86_64::Target_x86_64): Take optional argument for the
2489 Target_info pointer to use.
2490 (Target_x86_64::do_make_data_plt): New virtual method.
2491 (Target_x86_64::make_data_plt): New method to call it.
2492 (Target_x86_64::init_got_plt_for_update): Use that.
2493 Call this->plt_->add_eh_frame method here.
2494 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
2495 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
2496 rather than static method.
2497 (Target_x86_64::plt_entry_size): Likewise.
2498 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
2499 rather than plt_entry_size variable. Move guts of PLT filling to...
2500 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
2501 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
2502 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
2504 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
2505 additional argument for the section alignment.
2506 Don't do add_eh_frame_for_plt here.
2507 (Output_data_plt_i386::first_plt_entry_offset): Make the method
2508 non-static. Use get_plt_entry_size method rather than plt_entry_size
2510 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
2512 (Output_data_plt_i386::get_plt_entry_size): Call it.
2513 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
2514 (Output_data_plt_i386::add_eh_frame): New method to call it.
2515 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
2517 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
2518 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
2520 (Output_data_plt_i386::fill_plt_entry): New method to call it.
2521 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
2522 method instead of plt_entry_size.
2523 (Output_data_plt_i386::plt_entry_size)
2524 (Output_data_plt_i386::plt_eh_frame_fde_size)
2525 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
2526 (Output_data_plt_i386_standard): ... here, new class.
2527 (Output_data_plt_i386_exec): New class.
2528 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
2529 (Output_data_plt_i386_exec::first_plt_entry): ... here.
2530 (Output_data_plt_i386::exec_plt_entry): Move to ...
2531 (Output_data_plt_i386_exec::plt_entry): ... here.
2532 (Output_data_plt_i386_dyn): New class.
2533 (Output_data_plt_i386::first_plt_entry): Move to ...
2534 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
2535 (Output_data_plt_i386::dyn_plt_entry): Move to ...
2536 (Output_data_plt_i386_dyn::plt_entry): ... here.
2537 (Target_i386::Target_i386): Take optional argument for the Target_info
2539 (Target_i386::do_make_data_plt): New virtual method.
2540 (Target_i386::make_data_plt): New method to call it.
2541 (Target_i386::make_plt_section): Use that.
2542 Call this->plt_->add_eh_frame method here.
2543 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
2544 rather than plt_entry_size variable.
2545 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
2546 (Output_data_plt_i386::address_for_local): Likewise.
2547 (Output_data_plt_i386::do_write): Likewise.
2548 Move guts of PLT filling to...
2549 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
2550 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
2551 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
2552 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
2554 2012-05-01 Cary Coutant <ccoutant@google.com>
2556 * dwarf_reader.cc (Dwarf_die::read_attributes)
2557 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
2558 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
2559 * reduced_debug_output.cc
2560 (Output_reduced_debug_info_section::get_die_end): Remove
2561 DW_FORM_GNU_ref_index. Add default case.
2563 2012-04-26 Mark Wielaard <mjw@redhat.com>
2565 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
2566 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
2567 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
2568 DW_AT_high_pc as offset from DW_AT_low_pc.
2570 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
2571 * testsuite/Makefile.in: Regenerate.
2572 * testsuite/gdb_index_test_3.c: New test source file.
2573 * testsuite/gdb_index_test_3.sh: New test source file.
2575 2012-04-25 Ian Lance Taylor <iant@google.com>
2577 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
2579 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
2580 as a class, not a struct.
2581 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
2582 (Target_arm::apply_cortex_a8_workaround): Likewise.
2583 * gc.h: Declare Reloc_types as a struct, not a class.
2584 * object.h: Declare Symbols_data as a struct.
2585 * reloc.h: Declare Read_relocs_data as a struct.
2586 * target.h: Declare Relocate_info as a struct.
2588 2012-04-24 David S. Miller <davem@davemloft.net>
2590 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
2591 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
2594 2012-04-24 Cary Coutant <ccoutant@google.com>
2596 * incremental-dump.cc (find_input_containing_global): Replace
2597 magic number with symbolic constant.
2598 (dump_incremental_inputs): Update version number.
2599 * incremental.cc (Output_section_incremental_inputs): Update version
2600 number; import symbolic constants from Incremental_inputs_reader.
2601 (Incremental_inputs::create_data_sections): Align relocations
2602 section correctly for 64-bit targets.
2603 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
2604 constants; add padding.
2605 (Output_section_incremental_inputs::write_header): Add assert for
2607 (Output_section_incremental_inputs::write_input_files): Add assert
2608 for input_entry_size.
2609 (Output_section_incremental_inputs::write_info_blocks): Add padding;
2610 add assert for object_info_size, input_section_entry_size,
2611 global_sym_entry_size.
2612 * incremental.h (Incremental_inputs_reader): Add symbolic constants
2613 for data structure sizes; use them.
2614 (Incremental_input_entry_reader): Import symbolic constants from
2615 Incremental_inputs_reader; use them.
2617 2012-04-23 David S. Miller <davem@davemloft.net>
2619 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
2621 (Target_sparc::Target_sparc): Initialize new fields.
2622 (Target_sparc::do_make_elf_object): New function.
2623 (Target_sparc::do_adjust_elf_header): New function.
2625 2012-04-23 Cary Coutant <ccoutant@google.com>
2627 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
2628 CU range table of gdb index.
2630 2012-04-20 David S. Miller <davem@davemloft.net>
2632 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
2635 2012-04-16 David S. Miller <davem@davemloft.net>
2637 * sparc.cc (Target_sparc::got_address): New function.
2638 (Sparc_relocate_functions::gdop_hix22): New function.
2639 (Sparc_relocate_functions::gdop_lox10): New function.
2640 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
2642 (Target_sparc::Scan::local): Likewise if the global symbol is not
2643 preemptible and is not IFUNC.
2644 (Target_sparc::Relocate::relocate): Perform GOTDATA code
2645 transformations for local and non-preemptible non-IFUNC global
2648 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
2649 writing out 64-bit part of ranges.
2651 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
2652 -fpic and -fpie respectively.
2653 * Makefile.in: Regenerate.
2655 * sparc.cc (class Target_sparc): Add rela_ifunc_.
2656 (Target_sparc::Target_sparc): Initialize new field.
2657 (Target_sparc::do_plt_section_for_global): New function.
2658 (Target_sparc::do_plt_section_for_local): New function.
2659 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
2660 (Target_sparc::make_plt_section): New function, broken out of
2661 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
2662 (Target_sparc::make_plt_entry): Call make_plt_section.
2663 (Target_sparc::make_local_ifunc_plt_entry): New function.
2664 (Target_sparc::rela_ifunc_section): New function.
2665 (Target_sparc::plt_section): Remove const.
2666 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
2667 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
2668 and ifunc_count_ fields.
2669 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
2670 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
2671 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
2672 (Output_data_plt_sparc::rela_ifunc): New function.
2673 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
2674 (Output_data_plt_sparc::has_ifunc_section): New function.
2675 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
2676 (Output_data_plt_sparc::address_for_global): New function.
2677 (Output_data_plt_sparc::address_for_local): New function.
2678 (Output_data_plt_sparc::plt_index_to_offset): New function.
2679 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
2681 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
2683 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
2684 R_SPARC_JMP_IREL to switch.
2685 (Target_sparc::Scan::check_non_pic): Likewise.
2686 (Target_sparc::Scan::local): Handle IFUNC symbols.
2687 (Target_sparc::Scan::local): Likewise.
2688 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
2689 and plt_address_for_local.
2690 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
2691 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
2693 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
2694 (class Output_data_reloc): Adjust calls to Output_reloc_type.
2695 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
2696 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
2698 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
2699 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
2701 * sparc.cc (Target_sparc::Scan::global): Likewise.
2702 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2704 2012-04-16 Cary Coutant <ccoutant@google.com>
2706 * archive.cc (Library_base::should_include_member): Check for
2707 --export-dynamic-symbol.
2708 * options.h (class General_options): Add --export-dynamic-symbol.
2709 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
2710 --export-dynamic-symbol.
2711 (Symbol_table::gc_mark_undef_symbols): Likewise.
2712 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
2714 2012-04-12 David S. Miller <davem@davemloft.net>
2716 * sparc.cc (Reloc::wdisp10): New relocation method.
2717 (Reloc::h34): Likewise.
2718 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
2719 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
2721 (Target_sparc::Scan::local): Likewise.
2722 (Target_sparc::Scan::global): Likewise.
2723 (Target_sparc::Relocate::relocate): Likewise.
2725 2012-04-09 Cary Coutant <ccoutant@google.com>
2727 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
2730 2012-04-06 Ian Lance Taylor <iant@google.com>
2732 * timer.cc: #include <unistd.h>.
2734 2012-04-06 Roland McGrath <mcgrathr@google.com>
2736 * configure.in (AC_CHECK_HEADERS): Add locale.h.
2737 * config.in: Regenerate.
2738 * configure: Regenerate.
2740 2012-04-05 Nick Clifton <nickc@redhat.com>
2742 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
2743 (AM_LC_MESSAGES): Add.
2744 * aclocal.m4: Regenerate.
2745 * config.in: Regenerate.
2746 * configure: Regenerate.
2748 2012-03-21 Cary Coutant <ccoutant@google.com>
2750 * Makefile.am: Add gdb-index.cc, gdb-index.h.
2751 * Makefile.in: Regenerate.
2752 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
2753 (Sized_elf_reloc_mapper::symbol_section): New function.
2754 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
2755 (make_elf_reloc_mapper): New function.
2756 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
2757 (Dwarf_abbrev_table::do_read_abbrevs): New function.
2758 (Dwarf_abbrev_table::do_get_abbrev): New function.
2759 (Dwarf_ranges_table::read_ranges_table): New function.
2760 (Dwarf_ranges_table::read_range_list): New function.
2761 (Dwarf_pubnames_table::read_section): New function.
2762 (Dwarf_pubnames_table::read_header): New function.
2763 (Dwarf_pubnames_table::next_name): New function.
2764 (Dwarf_die::Dwarf_die): New function.
2765 (Dwarf_die::read_attributes): New function.
2766 (Dwarf_die::skip_attributes): New function.
2767 (Dwarf_die::set_name): New function.
2768 (Dwarf_die::set_linkage_name): New function.
2769 (Dwarf_die::attribute): New function.
2770 (Dwarf_die::string_attribute): New function.
2771 (Dwarf_die::int_attribute): New function.
2772 (Dwarf_die::uint_attribute): New function.
2773 (Dwarf_die::ref_attribute): New function.
2774 (Dwarf_die::child_offset): New function.
2775 (Dwarf_die::sibling_offset): New function.
2776 (Dwarf_info_reader::check_buffer): New function.
2777 (Dwarf_info_reader::parse): New function.
2778 (Dwarf_info_reader::do_parse): New function.
2779 (Dwarf_info_reader::do_read_string_table): New function.
2780 (Dwarf_info_reader::lookup_reloc): New function.
2781 (Dwarf_info_reader::get_string): New function.
2782 (Dwarf_info_reader::visit_compilation_unit): New function.
2783 (Dwarf_info_reader::visit_type_unit): New function.
2784 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
2785 Sized_elf_reloc_mapper.
2786 (Sized_dwarf_line_info::symbol_section): Remove function.
2787 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
2788 (Sized_dwarf_line_info::read_line_mappings): Remove object
2789 parameter, adjust callers.
2790 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
2791 * dwarf_reader.h: Include <sys/types.h>.
2792 (class Track_relocs): Remove forward declaration.
2793 (class Elf_reloc_mapper): New class.
2794 (class Sized_elf_reloc_mapper): New class.
2795 (class Dwarf_abbrev_table): New class.
2796 (class Dwarf_range_list): New class.
2797 (class Dwarf_ranges_table): New class.
2798 (class Dwarf_pubnames_table): New class.
2799 (class Dwarf_die): New class.
2800 (class Dwarf_info_reader): New class.
2801 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
2802 (Sized_dwarf_line_info::symbol_section): Remove member function.
2803 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
2805 * gdb-index.cc: New source file.
2806 * gdb-index.h: New source file.
2807 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
2808 and .debug_types sections, call Layout::add_to_gdb_index.
2809 (Sized_relobj_incr::do_section_name): Implement.
2810 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
2811 return type; Implement.
2812 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
2814 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
2815 parameter list and return type.
2816 (Sized_incr_dynobj::do_section_contents): Likewise.
2817 * layout.cc: Include gdb-index.h.
2818 (Layout::Layout): Initialize gdb_index_data_.
2819 (Layout::init_fixed_output_section): Check for .gdb_index section.
2820 (Layout::add_to_gdb_index): New function. Instantiate.
2821 * layout.h: Add forward declaration for class Gdb_index.
2822 (Layout::add_to_gdb_index): New member function.
2823 (Layout::gdb_index_data_): New data member.
2824 * main.cc: Include gdb-index.h.
2825 (main): Print statistics for gdb index.
2826 * object.cc (Object::section_contents): Move code into
2827 do_section_contents.
2828 (need_decompressed_section): Check for sections needed when building
2830 (build_compressed_section_map): Likewise.
2831 (Sized_relobj_file::do_read_symbols): Need local symbols when building
2833 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
2834 sections; call Layout::add_to_gdb_index.
2835 (Sized_relobj_file::do_decompressed_section_contents): Call
2836 do_section_contents directly.
2837 * object.h (Object::do_section_contents): Adjust parameter list and
2839 (Object::do_decompressed_section_contents): Call do_section_contents
2841 (Sized_relobj_file::do_section_contents): Adjust parameter list and
2843 * options.h (class General_options): Add --gdb-index option.
2844 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
2845 list and return type.
2846 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
2847 * reloc.h (Track_relocs::checkpoint): New function.
2848 (Track_relocs::reset): New function.
2850 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
2852 * testsuite/Makefile.in: Regenerate.
2853 * testsuite/gdb_index_test.cc: New test source file.
2854 * testsuite/gdb_index_test_1.sh: New test source file.
2855 * testsuite/gdb_index_test_2.sh: New test source file.
2857 2012-03-19 Doug Kwan <dougkwan@google.com>
2859 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2860 (Target_arm::do_finalize_sections): Remove code which defines
2861 __exidx_start and __exidx_end. Make symbol table parameter
2862 anonymous as it is not used.
2863 * gold.cc (queue_middle_tasks): Call target hook to define any
2864 target-specific symbols.
2865 * target.h (Target::define_standard_symbols): New method.
2866 (Target::do_define_standard_symbols): Same.
2867 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
2868 * testsuite/Makefile.in: Regenerate.
2869 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
2871 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
2872 relocations are generated for __exidx_start and __exidx_end.
2874 2012-03-16 Doug Kwan <dougkwan@google.com>
2876 * testsuite/Makefile.am: Disable test initpri3b.
2877 * testsuite/Makefile.in: Regenerate.
2879 2012-03-15 Doug Kwan <dougkwan@google.com>
2881 * arm.cc (Target_arm::got_section): Make .got section read-only
2884 2012-03-15 Ian Lance Taylor <iant@google.com>
2887 * layout.cc (Layout::make_output_section): Correctly mark
2888 SHT_INIT_ARRAY, et. al., as relro.
2890 2012-03-14 Doug Kwan <dougkwan@google.com>
2892 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
2893 dynamic relocations for protected symbols in shared objects.
2895 2012-03-13 Ian Lance Taylor <iant@google.com>
2897 * resolve.cc (Symbol_table::resolve): When merging common symbols,
2898 keep the larger alignment.
2900 2012-03-12 Cary Coutant <ccoutant@google.com>
2902 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
2903 handling of DW_LNE_define_file.
2905 2012-03-12 Cary Coutant <ccoutant@google.com>
2907 * reduced_debug_output.cc
2908 (Output_reduced_debug_info_section::get_die_end): Add new FORM
2911 2012-02-29 Cary Coutant <ccoutant@google.com>
2913 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
2915 2012-02-29 Cary Coutant <ccoutant@google.com>
2917 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2918 Call Object::decompressed_section_contents.
2919 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
2921 (Sized_dwarf_line_info::buffer_start_): New data member.
2922 * merge.cc (Output_merge_data::do_add_input_section): Call
2923 Object::decompressed_section_contents.
2924 (Output_merge_string::do_add_input_section): Likewise.
2925 * object.cc (need_decompressed_section): New function.
2926 (build_compressed_section_map): Decompress sections needed later.
2927 (Sized_relobj_file::do_decompressed_section_contents): New function.
2928 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2929 * object.h (Object::decompressed_section_contents): New function.
2930 (Object::discard_decompressed_sections): New function.
2931 (Object::do_decompressed_section_contents): New function.
2932 (Object::do_discard_decompressed_sections): New function.
2933 (Compressed_section_info): New type.
2934 (Compressed_section_map): Include decompressed section contents.
2935 (Sized_relobj_file::do_decompressed_section_contents): New function.
2936 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2938 2012-02-16 Cary Coutant <ccoutant@google.com>
2940 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
2941 * testsuite/Makefile.in: Regenerate.
2943 2012-02-14 Cary Coutant <ccoutant@google.com>
2945 * options.cc (General_options::finalize): Disallow -pie and -static.
2947 2012-02-03 Doug Kwan <dougkwan@google.com>
2949 * arm.cc (Arm_relocate_functions::abs8,
2950 Arm_relocate_functions::abs16): Use
2951 Bits::has_signed_unsigned_overflow32.
2952 (Arm_relocate_functions::thm_abs8): Correct range of
2954 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
2957 2012-02-02 Doug Kwan <dougkwan@google.com>
2959 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
2960 position independent outputs, not just shared objects.
2962 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
2964 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
2965 * configure: Regenerated.
2967 2012-01-27 Ian Lance Taylor <iant@google.com>
2969 * reloc.h (Bits): New class with static functions, copied from
2970 namespace utils in arm.cc.
2971 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
2974 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2976 * incremental.cc (write_info_blocks): Correct relocation offset.
2978 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2980 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
2981 (Relocate::tls_gd_to_le): Likewise.
2983 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2985 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
2987 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2989 * configure.ac: Check if -mcmodel=medium works.
2990 * configure: Regenerated.
2992 2012-01-24 Cary Coutant <ccoutant@google.com>
2994 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
2996 (read_unsigned_LEB_128_x): ... this new function.
2997 (read_signed_LEB_128): Replaced with inline definition and ...
2998 (read_signed_LEB_128_x): ... this new function.
2999 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3000 (read_unsigned_LEB_128): Add inline definition.
3001 (read_signed_LEB_128_x): New function.
3002 (read_signed_LEB_128): Add inline definition.
3003 * testsuite/Makefile.am (leb128_unittest): New unit test.
3004 * testsuite/Makefile.in: Regenerate.
3005 * testsuite/leb128_unittest.cc: New unit test.
3007 2012-01-23 Ian Lance Taylor <iant@google.com>
3010 * i386.cc (Target_i386::do_code_fill): When using a jmp
3011 instruction, pad with nop instructions.
3012 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3014 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3016 * x86_64.cc (gc_process_relocs): Add typename on types used in
3018 (scan_relocs): Likewise.
3019 (relocate_section): Likewise.
3020 (apply_relocation): Likewise.
3022 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3024 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3025 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3028 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3030 * x86_64.cc: Initial support for x32.
3032 2012-01-03 Cary Coutant <ccoutant@google.com>
3034 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3035 Use abstract base class for GOT.
3036 * gold/output.h (class Output_data_got_base): New abstract base class.
3037 (class Output_data_got): Derive from new base class, adjust ctors.
3038 (Output_data_got::reserve_slot): Make virtual; rename to
3039 do_reserve_slot; Adjust callers.
3040 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3041 pointer to abstract base class.
3042 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3044 2011-12-18 Ian Lance Taylor <iant@google.com>
3046 * object.h (Relobj::local_symbol_value): New function.
3047 (Relobj::local_plt_offset): New function.
3048 (Relobj::local_has_got_offset): New function.
3049 (Relobj::local_got_offset): New function.
3050 (Relobj::set_local_got_offset): New function.
3051 (Relobj::do_local_symbol_value): New pure virtual function.
3052 (Relobj::do_local_plt_offset): Likewise.
3053 (Relobj::do_local_has_got_offset): Likewise.
3054 (Relobj::do_local_got_offset): Likewise.
3055 (Relobj::do_set_local_got_offset): Likewise.
3056 (Sized_relobj::do_local_has_got_offset): Rename from
3057 local_has_got_offset.
3058 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3059 (Sized_relobj::do_set_local_got_offset): Rename from
3060 set_local_got_offset.
3061 (Sized_relobj_file::do_local_plt_offset): Rename from
3063 (Sized_relobj_file::do_local_symbol_value): New function.
3064 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3066 * output.cc (Output_data_got::Got_entry::write): Change object to
3067 Relobj. Use local_symbol_value.
3068 (Output_data_got::add_global_with_rel): Change rel_dyn to
3069 Output_data_reloc_generic*. Use add_global_generic.
3070 (Output_data_got::add_global_with_rela): Remove. Change all
3071 callers to use add_global_with_rel.
3072 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3073 Output_data_reloc_generic*. Use add_global_generic.
3074 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3075 callers to use add_global_pair_with_rel.
3076 (Output_data_got::add_local): Change object to Relobj*.
3077 (Output_data_got::add_local_plt): Likewise.
3078 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3079 change rel_dyn to Output_data_reloc_generic*. Use
3081 (Output_data_got::add_local_with_rela): Remove. Change all
3082 callers to use all_local_with_rel.
3083 (Output_data_got::add_local_pair_with_rel): Change object to
3084 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3085 add_output_section_generic.
3086 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3087 callers to use add_local_pair_with_rel.
3088 (Output_data_got::reserve_local): Change object to Relobj*.
3089 * output.h: (class Output_data_reloc_generic): Add pure virtual
3090 declarations for add_global_generic, add_local_generic,
3091 add_output_section_generic.
3092 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3093 functions for Output_data_reloc_generic. Update declarations for
3094 changes listed in output.cc.
3095 (class Output_data_got): Change template parameter to got_size.
3096 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3097 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3099 (Sized_relobj_incr::do_local_plt_offset): New function.
3100 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3103 2011-12-17 Cary Coutant <ccoutant@google.com>
3105 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3106 * resolve.cc (Symbol_table::resolve): Likewise.
3107 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3109 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3111 2011-12-16 Ian Lance Taylor <iant@google.com>
3113 * output.h (Output_data_reloc_generic::add): Only call
3114 add_dynamic_reloc if this is a dynamic reloc section.
3116 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3119 * target-reloc.h (apply_relocation): Replace <64, false> with
3122 2011-11-25 Nick Clifton <nickc@redhat.com>
3124 * po/it.po: New Italian translation.
3126 2011-11-17 Sterling Augustine <saugustine@google.com>
3128 * script.cc (script_include_directive): Implement.
3129 (read_script_file): New local variables name and search_path. Update
3130 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3131 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3132 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
3134 2011-11-11 Sterling Augustine <saugustine@google.com>
3136 * yyscript.y (section_cmd): Add support for INCLUDE directive.
3137 (file_or_sections_cmd): Likewise.
3139 2011-11-11 Doug Kwan <dougkwan@google.com>
3141 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
3142 if --just-symbols is given.
3144 2011-11-10 Doug Kwan <dougkwan@google.com>
3147 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3148 when processing data relocs.
3149 * reloc.h (Relocate_functions::rel_unaligned): New method.
3150 (Relocate_functions::pcrel_unaligned): Ditto.
3151 (Relocate_functions::rel32_unaligned): Ditto.
3152 (Relocate_functions::pcrel32_unaligned): Ditto.
3154 2011-11-09 Doug Kwan <dougkwan@google.com>
3157 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3158 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3159 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3160 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3161 (Relocate_functions::rel_unaligned): New.
3162 (Relocate_functions::rel32_unaligned): New.
3163 * target-reloc.h (relocate_for_relocatable): Add code to handle
3164 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3165 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3166 arm_unaligned_reloc_r): New targets.
3167 * testsuite/Makefile.in: Regenerate.
3168 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3171 2011-11-02 Ian Lance Taylor <iant@google.com>
3173 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
3175 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
3176 * options.cc (General_options::finalize): Use library search path
3177 from configure script if specified. If not native and no sysroot,
3178 only search TOOLLIBDIR.
3179 * options.h (Search_directory::Search_directory): Change name to
3181 (General_options::add_to_library_path_with_sysroot): Change arg to
3183 * configure, Makefile.in, config.in: Rebuild.
3185 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3187 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
3188 we are working around the ARM1176 Erratum.
3189 * options.h (General_options::fix_arm1176): Add option.
3190 * testsuite/Makefile.am: Add testcases, and keep current ones
3192 * testsuite/Makefile.in: Regenerate.
3193 * testsuite/arm_fix_1176.s: New file.
3194 * testsuite/arm_fix_1176.sh: Likewise.
3196 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3198 * arm.cc (Target_arm::Target_arm): Remove initialisation of
3200 (Target_arm::may_use_blx): Remove method.
3201 (Target_arm::set_may_use_blx): Likewise.
3202 (Target_arm::may_use_v4t_interworking): New method.
3203 (Target_arm::may_use_v5t_interworking): Likewise.
3204 (Target_arm::may_use_blx_): Remove member variable.
3205 (Arm_relocate_functions::arm_branch_common): Check for v5T
3207 (Arm_relocate_functions::thumb_branch_common): Likewise.
3208 (Reloc_stub::stub_type_for_reloc): Likewise.
3209 (Target_arm::do_finalize_sections): Correct interworking checks.
3210 * testsuite/Makefile.am: Add new tests.
3211 * testsuite/Makefile.in: Regenerate.
3212 * testsuite/arm_farcall_arm_arm.s: New test.
3213 * testsuite/arm_farcall_arm_arm.sh: Likewise.
3214 * testsuite/arm_farcall_arm_thumb.s: Likewise.
3215 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
3216 * testsuite/arm_farcall_thumb_arm.s: Likewise.
3217 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
3218 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
3219 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
3221 2011-10-31 Cary Coutant <ccoutant@google.com>
3224 * expression.cc (Expression::eval_with_dot): Add
3225 is_section_dot_assignment parameter.
3226 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
3227 absolute and assigning to dot within a section.
3228 * script-sections.cc
3229 (Output_section_element_assignment::set_section_addresses): Pass
3230 dot_section to set_if_absolute.
3231 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
3232 as is_section_dot_assignment flag to eval_with_dot.
3233 (Output_section_element_dot_assignment::set_section_addresses):
3235 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
3236 parameter. Also set value if relative to dot_section; set the
3237 symbol's output_section.
3238 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
3239 parameter. Adjust all callers.
3240 (Expression::eval_maybe_dot): Likewise.
3241 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
3243 * testsuite/script_test_2.t: Test assignment of an absolute value
3244 to dot within an output section element.
3246 2011-10-31 Cary Coutant <ccoutant@google.com>
3248 * options.h (class General_options): Add --[no-]gnu-unique options.
3249 * symtab.cc (Symbol_table::sized_write_globals): Convert
3250 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
3252 2011-10-31 Cary Coutant <ccoutant@google.com>
3255 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
3256 unnecessary assertion.
3257 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
3259 2011-10-31 Sriraman Tallam <tmsriram@google.com>
3261 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3263 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3265 Change to just keep the section associated with symbol.
3266 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
3267 they are externally visible and --export-dynamic is turned on.
3268 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
3270 2011-10-19 Ian Lance Taylor <iant@google.com>
3273 * script-sections.cc
3274 (Output_section_element_dot_assignment::needs_output_section): New
3277 2011-10-19 Ian Lance Taylor <iant@google.com>
3280 * layout.cc (Layout::segment_precedes): Don't assert failure if a
3281 --section-start option was seen.
3282 * options.h (General_options::any_section_start): New function.
3284 2011-10-18 David S. Miller <davem@davemloft.net>
3287 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
3288 member to track relocation locations that have moved during TLS
3289 reloc optimizations.
3290 (Target_sparc::Relocate::Relocate): Initialize to NULL.
3291 (Target_sparc::Relocate::relocate): Adjust view down by 4
3292 bytes if it matches reloc_adjust_addr_.
3293 (Target_sparc::Relocate::relocate_tls): Always move the
3294 __tls_get_addr call delay slot instruction forward 4 bytes when
3295 performing relaxation.
3297 2011-10-18 Cary Coutant <ccoutant@google.com>
3299 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
3300 (Output_file::map_no_anonymous): Check for non-zero
3301 return code from posix_fallocate.
3303 2011-10-17 Cary Coutant <ccoutant@google.com>
3306 * plugin.cc (is_visible_from_outside): Check for symbols
3307 referenced from dynamic objects.
3308 * resolve.cc (Symbol_table::resolve): Don't count references
3309 from dynamic objects as references from real ELF files.
3310 * testsuite/plugin_test_2.sh: Adjust expected result.
3312 2011-10-17 Cary Coutant <ccoutant@google.com>
3314 * gold.cc: Include timer.h.
3315 (queue_middle_tasks): Stamp time.
3316 (queue_final_tasks): Likewise.
3317 * main.cc (main): Store timer in parameters. Print timers
3319 * parameters.cc (Parameters::Parameters): Initialize timer_.
3320 (Parameters::set_timer): New function.
3321 (set_parameters_timer): New function.
3322 * parameters.h (Parameters::set_timer): New function.
3323 (Parameters::timer): New function.
3324 (Parameters::timer_): New data member.
3325 (set_parameters_timer): New function.
3326 * timer.cc (Timer::stamp): New function.
3327 (Timer::get_pass_time): New function.
3328 * timer.h (Timer::stamp): New function.
3329 (Timer::get_pass_time): New function.
3330 (Timer::pass_times_): New data member.
3332 2011-10-17 Cary Coutant <ccoutant@google.com>
3334 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
3335 task for members of lib groups.
3337 2011-10-17 Cary Coutant <ccoutant@google.com>
3340 * fileread.cc (File_read::find_view): Add assert.
3341 (File_read::make_view): Move bounds check (replace with assert)...
3342 (File_read::find_or_make_view): ... to here.
3344 2011-10-12 Cary Coutant <ccoutant@google.com>
3346 * output.cc (Output_file::open_base_file): Handle case where
3347 ::read returns less than requested size.
3349 2011-10-10 Cary Coutant <ccoutant@google.com>
3351 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
3352 Initialize defined_count_.
3353 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
3354 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
3355 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
3356 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
3357 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
3358 * incremental.h (Sized_relobj_incr::defined_count_): New data
3360 (Sized_incr_dynobj::defined_count_): New data member.
3361 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
3362 Return zeroes instead of internal error.
3364 2011-10-10 Cary Coutant <ccoutant@google.com>
3367 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
3368 (Output_reloc::symbol_value): Return PLT offset if flag is set.
3369 * output.h (class Output_reloc): Add use_plt_offset flag.
3370 (Output_reloc::type_): Adjust size of bit field.
3371 (Output_reloc::use_plt_offset_): New bit field.
3372 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
3373 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
3374 flag. Adjust all callers.
3375 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
3376 creating RELATIVE relocations.
3378 2011-10-10 Nick Clifton <nickc@redhat.com>
3380 * po/es.po: Updated Spanish translation.
3381 * po/fi.po: Updated Finnish translation.
3383 2011-10-03 Diego Novillo <dnovillo@google.com>
3385 * options.cc (parse_uint): Fix dereference of RETVAL.
3387 2011-09-29 Sriraman Tallam <tmsriram@google.com>
3389 * layout.h (section_order_map_): New member.
3390 (get_section_order_map): New member function.
3391 * output.cc (Output_section::add_input_section): Check for patterns
3392 only when --section-ordering-file is specified.
3393 * gold.cc (queue_middle_tasks): Delay updating order of sections till
3394 output_sections have been formed.
3395 * layout.cc (Layout_Layout): Initialize section_order_map_.
3396 * plugin.cc (update_section_order): Store order in order_map. Do not
3398 * testsuite/Makefile.am: Add test case for plugin_final_layout.
3399 * testsuite/Makefile.in: Regenerate.
3400 * testsuite/plugin_section_order.c: New file.
3401 * testsuite/plugin_final_layout.cc: New file.
3402 * testsuite/plugin_final_layout.sh: New file.
3404 2011-09-29 Cary Coutant <ccoutant@google.com>
3406 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3408 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
3409 symbols during incremental update.
3410 (Symbol_table::add_from_dynobj): Likewise.
3412 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3413 Ian Lance Taylor <iant@google.com>
3415 * symtab.cc (Symbol_table::define_special_symbol): Always
3416 canonicalize version string.
3418 2011-09-26 Cary Coutant <ccoutant@google.com>
3420 * gold.cc (queue_initial_tasks): Move option checks ...
3421 * options.cc (General_options::finalize): ... to here. Disable
3422 some options; make others fatal.
3424 2011-09-26 Cary Coutant <ccoutant@google.com>
3427 * plugin.cc (get_symbols_v2): New function.
3428 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
3429 (is_referenced_from_outside): New function.
3430 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
3431 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
3432 (get_symbols): Pass version parameter.
3433 (get_symbols_v2): New function.
3434 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
3436 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
3437 (onload): Add LDPT_GET_SYMBOLS_V2.
3438 (all_symbols_read_hook): Use get_symbols_v2; check for
3439 LDPR_PREVAILING_DEF_IRONLY_EXP.
3440 * testsuite/plugin_test_3.sh: Update expected results.
3442 2011-09-23 Simon Baldwin <simonb@google.com>
3444 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
3445 configuration options.
3446 * configure: Regenerate.
3447 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
3448 * Makefile.in: Regenerate.
3449 * testsuite/Makefile.in: Regenerate.
3451 2011-09-19 Sriraman Tallam <tmsriram@google.com>
3453 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
3455 2011-09-19 Cary Coutant <ccoutant@google.com>
3457 * incremental.cc (can_incremental_update): Fix typo in comment.
3458 * incremental.h (can_incremental_update): Likewise.
3460 2011-09-18 Cary Coutant <ccoutant@google.com>
3462 * incremental.cc (can_incremental_update): New function.
3463 * incremental.h (can_incremental_update): New function.
3464 * layout.cc (Layout::init_fixed_output_section): Call it.
3465 (Layout::make_output_section): Don't allow patch space in .eh_frame.
3466 * object.cc (Sized_relobj_file::do_layout): Call
3467 can_incremental_update.
3469 2011-09-13 Cary Coutant <ccoutant@google.com>
3471 * configure.ac: Check for glibc support for gnu_indirect_function
3472 support with static linking, setting automake conditional
3474 * Makefile.in: Regenerate.
3475 * configure: Regenerate.
3477 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
3478 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
3480 * testsuite/Makefile.in: Regenerate.
3482 2011-09-13 Cary Coutant <ccoutant@google.com>
3484 * incremental.cc (Sized_relobj_incr::do_layout): Call
3485 report_comdat_group for kept comdat sections.
3486 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
3487 * testsuite/Makefile.in: Regenerate.
3488 * testsuite/incr_comdat_test_1.cc: New source file.
3489 * testsuite/incr_comdat_test_2_v1.cc: New source file.
3490 * testsuite/incr_comdat_test_2_v2.cc: New source file.
3491 * testsuite/incr_comdat_test_2_v3.cc: New source file.
3493 2011-09-13 Ian Lance Taylor <iant@google.com>
3495 * object.cc (Sized_relobj_file::do_layout): Remove unused local
3496 variable external_symbols_offset.
3498 2011-09-12 Ian Lance Taylor <iant@google.com>
3500 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
3501 triggered if object has no symbols.
3503 2011-09-09 David S. Miller <davem@davemloft.net>
3505 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
3506 (Output_fill_debug_line::do_write): Likewise.
3508 2011-08-29 Cary Coutant <ccoutant@google.com>
3510 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
3511 casts to match formatting specs.
3512 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
3514 2011-08-26 Cary Coutant <ccoutant@google.com>
3516 * layout.cc (Free_list::allocate): Provide guarantee of minimum
3517 remaining hole size when allocating.
3518 (Layout::make_output_section): Set fill methods for debug sections.
3519 * layout.h (Free_list::Free_list_node): Move from private to
3521 (Free_list::set_min_hole_size): New function.
3522 (Free_list::begin, Free_list::end): New functions.
3523 (Free_list::min_hole_): New data member.
3524 * output.cc: Include dwarf.h.
3525 (Output_fill_debug_info::do_minimum_hole_size): New function.
3526 (Output_fill_debug_info::do_write): New function.
3527 (Output_fill_debug_line::do_minimum_hole_size): New function.
3528 (Output_fill_debug_line::do_write): New function.
3529 (Output_section::Output_section): Initialize new data member.
3530 (Output_section::set_final_data_size): Ensure patch space is larger
3531 than minimum hole size.
3532 (Output_section::do_write): Fill holes in debug sections.
3533 * output.h (Output_fill): New class.
3534 (Output_fill_debug_info): New class.
3535 (Output_fill_debug_line): New class.
3536 (Output_section::set_free_space_fill): New function.
3537 (Output_section::free_space_fill_): New data member.
3538 * testsuite/Makefile.am (incremental_test_3): Add
3539 --incremental-patch option.
3540 (incremental_test_4): Likewise.
3541 (incremental_test_5): Likewise.
3542 (incremental_test_6): Likewise.
3543 (incremental_copy_test): Likewise.
3544 (incremental_common_test_1): Likewise.
3545 * testsuite/Makefile.in: Regenerate.
3547 2011-08-26 Nick Clifton <nickc@redhat.com>
3549 * po/es.po: Updated Spanish translation.
3551 2011-08-01 Cary Coutant <ccoutant@google.com>
3553 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
3554 * gold/testsuite/Makefile.in: Regenerate.
3555 * gold/testsuite/justsyms_exec.c: New source file.
3556 * gold/testsuite/justsyms_lib.c: New source file.
3558 2011-08-01 Cary Coutant <ccoutant@google.com>
3560 * layout.cc (Layout::set_segment_offsets): Don't realign text
3561 segment if -Ttext was specified.
3562 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
3564 * object.h (Sized_relobj_file::e_type): New function.
3565 (Sized_relobj_file::e_type_): New data member.
3566 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
3567 base address for ET_EXEC files.
3568 * target.cc (Target::do_make_elf_object_implementation): Allow
3569 ET_EXEC files with --just-symbols option.
3571 2011-07-28 Cary Coutant <ccoutant@google.com>
3573 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
3574 Add thread_number parameter.
3575 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
3576 * workqueue-threads.cc
3577 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
3578 current thread if its thread number is greater than desired thread
3580 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
3581 Add thread_number parameter.
3582 (Workqueue::should_cancel_thread): Likewise.
3583 (Workqueue::find_runnable_or_wait): Pass thread_number to
3584 should_cancel_thread.
3585 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
3588 2011-07-22 Sriraman Tallam <tmsriram@google.com>
3590 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
3591 only after checking if it cannot be forced local.
3592 * symtab.h (is_externally_visible): Check if the symbol is not forced
3595 2011-07-15 Ian Lance Taylor <iant@google.com>
3597 * options.h (class General_options): Add --print-output-format.
3598 Move -EL next to -EB, for better --help output.
3599 * target-select.cc: Include <cstdio>, "options.h", and
3601 (Target_selector::do_target_bfd_name): New function.
3602 (print_output_format): New function.
3603 * target-select.h (class Target_selector): Update declarations.
3604 (Target_selector::target_bfd_name): New function.
3605 (print_output_format): Declare.
3606 * main.cc: Include "target-select.h".
3607 (main): Handle --print-output-format.
3608 * gold.cc: Include "target-select.h".
3609 (queue_initial_tasks): Handle --print-output-format when there are
3611 * parameters.cc (parameters_force_valid_target): Give a better
3612 error message if -EB/-EL does not match target.
3613 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
3616 2011-07-15 Ian Lance Taylor <iant@google.com>
3618 * i386.cc (class Output_data_plt_i386): Add layout_ field.
3619 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
3620 (Output_data_plt_i386::do_write): Write address of .dynamic
3621 section to first entry in .got.plt section.
3622 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
3623 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3625 (Output_data_plt_x86_64::do_write): Write address of .dynamic
3626 section to first entry in .got.plt section.
3627 * layout.h (Layout::dynamic_section): New function.
3629 2011-07-13 Sriraman Tallam <tmsriram@google.com>
3631 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
3633 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
3634 input_section_position_, and input_section_glob_.
3635 (read_layout_from_file): Call function section_ordering_specified.
3636 * layout.h (is_section_ordering_specified): New function.
3637 (section_ordering_specified): New function.
3638 (section_ordering_specified_): New boolean member.
3639 * main.cc(main): Call load_plugins after layout object is defined.
3640 * output.cc (Output_section::add_input_section): Use
3641 function section_ordering_specified to check if section ordering is
3643 * output.cc (Output_section::add_relaxed_input_section): Use
3644 function section_ordering_specified to check if section ordering is
3646 (Output_section::update_section_layout): New function.
3647 (Output_section::sort_attached_input_sections): Check if input section
3649 * output.h (Output_section::update_section_layout): New function.
3650 * plugin.cc (get_section_count): New function.
3651 (get_section_type): New function.
3652 (get_section_name): New function.
3653 (get_section_contents): New function.
3654 (update_section_order): New function.
3655 (allow_section_ordering): New function.
3656 (Plugin::load): Add the new interfaces to the transfer vector.
3657 (Plugin_manager::load_plugins): New parameter.
3658 (Plugin_manager::all_symbols_read): New parameter.
3659 (Plugin_manager::claim_file): New parameter. Save the elf object for
3661 (Plugin_manager::get_elf_object): New function.
3662 (Plugin_manager::get_view): Change to directly use the bool to check
3663 if get_view is called from claim_file_hook.
3664 * plugin.h (input_objects): New function
3665 (Plugin__manager::load_plugins): New parameter.
3666 (Plugin_manager::claim_file): New parameter.
3667 (Plugin_manager::get_elf_object): New function.
3668 (Plugin_manager::in_claim_file_handler): New function.
3669 (Plugin_manager::in_claim_file_handler_): New member.
3670 (layout): New function.
3671 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
3672 handler with an extra parameter. Make the elf object before calling
3674 * testsuite/plugin_test.c (get_section_count): New function pointer.
3675 (get_section_type): New function pointer.
3676 (get_section_name): New function pointer.
3677 (get_section_contents): New function pointer.
3678 (update_section_order): New function pointer.
3679 (allow_section_ordering): New function pointer.
3680 (onload): Check if the new interfaces exist.
3682 2011-07-13 Ian Lance Taylor <iant@google.com>
3684 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
3686 * x86_64.cc (Target_x86_64::got_section): Likewise.
3687 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
3688 (relro_now_test_SOURCES): New variable.
3689 (relro_now_test_DEPENDENCIES): New variable.
3690 (relro_now_test_LDFLAGS): New variable.
3691 (relro_now_test_LDADD): New variable.
3692 (relro_now_test.so): New target.
3693 * testsuite/Makefile.in: Rebuild.
3695 2011-07-12 Ian Lance Taylor <iant@google.com>
3698 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
3699 GLOB_DAT relocation rather than a RELATIVE relocation for a
3700 protected symbol when creating a shared library.
3701 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3702 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
3703 * testsuite/protected_main_1.cc (main): Test that protected
3704 function has same address.
3706 2011-07-11 Ian Lance Taylor <iant@google.com>
3709 * options.h (class General_options): Add -Bgroup.
3710 * options.cc (General_options::finalize): If -Bgroup is set,
3711 default to --unresolved-symbols=report-all.
3712 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
3713 * target-reloc.h (issue_undefined_symbol_error): Handle
3714 --unresolved-symbols=report-all.
3716 2011-07-08 Ian Lance Taylor <iant@google.com>
3719 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
3720 if linker script discards key sections.
3721 (Layout::create_dynamic_symtab): Likewise.
3722 (Layout::assign_local_dynsym_offsets): Likewise.
3723 (Layout::sized_create_version_sections): Likewise.
3724 (Layout::create_interp): Likewise.
3725 (Layout::finish_dynamic_section): Likewise.
3726 (Layout::set_dynamic_symbol_size): Likewise.
3728 2011-07-08 Ian Lance Taylor <iant@google.com>
3731 * options.h (class General_options): Add --unresolved-symbols.
3732 * target-reloc.h (issue_undefined_symbol_error): Check
3733 --unresolved-symbols. Add comments.
3735 2011-07-08 Ian Lance Taylor <iant@google.com>
3737 * testsuite/odr_violation2.cc (Ordering::operator()): Make
3738 expression more complex.
3740 2011-07-08 Ian Lance Taylor <iant@google.com>
3743 * target-reloc.h (issue_undefined_symbol_error): New inline
3744 function, broken out of relocate_section.
3745 (relocate_section): Call issue_undefined_symbol_error.
3746 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3747 there is no TLS segment if we are about to issue an undefined
3749 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3751 2011-07-08 Ian Lance Taylor <iant@google.com>
3754 * resolve.cc (Symbol_table::should_override): Add fromtype
3755 parameter. Change all callers. Give error when linking together
3756 TLS and non-TLS symbol.
3757 (Symbol_table::should_override_with_special): Add fromtype
3758 parameter. Change all callers.
3759 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3760 there is no TLS segment if we have reported some errors.
3761 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3763 2011-07-08 Ian Lance Taylor <iant@google.com>
3766 * target.h (Target::plt_address_for_global): New function.
3767 (Target::plt_address_for_local): New function.
3768 (Target::plt_section_for_global): Remove.
3769 (Target::plt_section_for_local): Remove.
3770 (Target::do_plt_address_for_global): New virtual function.
3771 (Target::do_plt_address_for_local): New virtual function.
3772 (Target::do_plt_section_for_global): Remove.
3773 (Target::do_plt_section_for_local): Remove.
3774 (Target::register_global_plt_entry): Add Symbol_table and Layout
3776 * output.cc (Output_data_got::Got_entry::write): Use
3777 plt_address_for_global and plt_address_for_local.
3778 * layout.cc (Layout::add_target_dynamic_tags): Use size and
3779 address of output section.
3780 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
3781 got_irelative_, and irelative_count_ fields. Update
3783 (Output_data_plt_i386::has_irelative_section): New function.
3784 (Output_data_plt_i386::entry_count): Add irelative_count_.
3785 (Output_data_plt_i386::set_final_data_size): Likewise.
3786 (class Target_i386): Add got_irelative_ and rel_irelative_
3787 fields. Update declarations.
3788 (Target_i386::Target_i386): Initialize new fields.
3789 (Target_i386::do_plt_address_for_global): New function replacing
3790 do_plt_section_for_global.
3791 (Target_i386::do_plt_address_for_local): New function replacing
3792 do_plt_section_for_local.
3793 (Target_i386::got_section): Create got_irelative_.
3794 (Target_i386::rel_irelative_section): New function.
3795 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
3796 fields. Don't define __rel_iplt_{start,end}.
3797 (Output_data_plt_i386::add_entry): Add symtab and layout
3798 parameters. Change all callers. Use different PLT and GOT for
3800 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
3801 layout parameters. Change all callers. Use different PLT and
3803 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
3804 (Output_data_plt_i386::rel_irelative): New function.
3805 (Output_data_plt_i386::address_for_global): New function.
3806 (Output_data_plt_i386::address_for_local): New function.
3807 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
3808 IRELATIVE GOT when changing IFUNC GOT entries.
3809 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
3811 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
3812 if we didn't create an IRELATIVE GOT.
3813 (Target_i386::Relocate::relocate): Use plt_address_for_global and
3814 plt_address_for_local.
3815 (Target_i386::do_dynsym_value): Use plt_address_for_global.
3816 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
3817 got_irelative_, and irelative_count_ fields. Update
3819 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3820 Initialize new fields. Remove symtab parameter. Change all
3822 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
3824 (Output_data_plt_x86_64::has_irelative_section): New function.
3825 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
3826 (class Target_x86_64): Add got_irelative_ and rel_irelative_
3827 fields. Update declarations.
3828 (Target_x86_64::Target_x86_64): Initialize new fields.
3829 (Target_x86_64::do_plt_address_for_global): New function replacing
3830 do_plt_section_for_global.
3831 (Target_x86_64::do_plt_address_for_local): New function replacing
3832 do_plt_section_for_local.
3833 (Target_x86_64::got_section): Create got_irelative_.
3834 (Target_x86_64::rela_irelative_section): New function.
3835 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
3836 all callers. Don't create __rel_iplt_{start,end}.
3837 (Output_data_plt_x86_64::add_entry): Add symtab and layout
3838 parameters. Change all callers. Use different PLT and GOT for
3840 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
3841 layout parameters. Change all callers. Use different PLT and
3843 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
3844 parameters. Change all callers. Use different PLT and GOT for
3846 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
3847 (Output_data_plt_x86_64::rela_irelative): New function.
3848 (Output_data_plt_x86_64::address_for_global): New function.
3849 (Output_data_plt_x86_64::address_for_local): New function.
3850 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3851 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
3852 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
3853 (Target_x86_64::register_global_plt_entry): Add symtab and layout
3855 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
3857 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
3858 symbols if we didn't create an IRELATIVE GOT.
3859 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
3860 plt_address_for_local.
3861 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
3862 * testsuite/ifuncvar1.c: New test file.
3863 * testsuite/ifuncvar2.c: New test file.
3864 * testsuite/ifuncvar3.c: New test file.
3865 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
3866 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
3867 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
3868 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
3869 * testsuite/Makefile.in: Rebuild.
3871 2011-07-07 Cary Coutant <ccoutant@google.com>
3873 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
3874 (two_file_test_1_ndebug.o): Likewise.
3875 (two_file_test_1b_ndebug.o): Likewise.
3876 (two_file_test_2_ndebug.o): Likewise.
3877 (two_file_test_main_ndebug.o): Likewise.
3878 (incremental_test_2): Link with no-debug versions.
3880 2011-07-06 Cary Coutant <ccoutant@google.com>
3882 * gold/incremental.cc
3883 (Output_section_incremental_inputs::write_info_blocks): Check for
3884 hidden and internal symbols.
3886 2011-07-06 Cary Coutant <ccoutant@google.com>
3888 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
3889 Check disposition for startup file.
3890 (Incremental_inputs::report_command_line): Ignore
3891 --incremental-startup-unchanged option.
3892 * options.cc (General_options::parse_incremental_startup_unchanged):
3894 (General_options::General_options): Initialize new data member.
3895 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
3896 (General_options): Add --incremental-startup-unchanged option.
3897 (General_options::incremental_startup_disposition): New function.
3898 (General_options::incremental_startup_disposition_): New data member.
3900 2011-07-06 Cary Coutant <ccoutant@google.com>
3902 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
3903 input file index to Script_info ctor.
3904 (Sized_incremental_binary::do_file_has_changed): Find the
3905 command-line argument for files named in scripts.
3906 * incremental.h (Script_info::Script_info): New ctor
3907 with input file index.
3908 (Script_info::input_file_index): New function.
3909 (Script_info::input_file_index_): New data member.
3910 (Incremental_binary::get_library): Add const.
3911 (Incremental_binary::get_script_info): Add const.
3912 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
3913 * testsuite/Makefile.am (incremental_test_5): New test case.
3914 (incremental_test_6): New test case.
3915 * testsuite/Makefile.in: Regenerate.
3917 2011-07-06 Cary Coutant <ccoutant@google.com>
3919 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
3920 debug output when command lines differ.
3922 2011-07-06 Cary Coutant <ccoutant@google.com>
3924 * incremental.cc (Incremental_inputs::report_command_line): Ignore
3925 --incremental-patch option.
3926 * layout.cc (Free_list::allocate): Extend allocation beyond original
3928 (Layout::make_output_section): Mark sections that should get
3930 * options.cc (parse_percent): New function.
3931 * options.h (parse_percent): New function.
3932 (DEFINE_percent): New macro.
3933 (General_options): Add --incremental-patch option.
3934 * output.cc (Output_section::Output_section): Initialize new data
3936 (Output_section::add_input_section): Print section name when out
3938 (Output_section::add_output_section_data): Likewise.
3939 (Output_section::set_final_data_size): Add patch space when
3940 doing --incremental-full.
3941 (Output_section::do_reset_address_and_file_offset): Remove patch
3943 (Output_segment::set_section_list_addresses): Print debug output
3944 only if --incremental-update.
3945 * output.h (Output_section::set_is_patch_space_allowed): New function.
3946 (Output_section::is_patch_space_allowed_): New data member.
3947 (Output_section::patch_space_): New data member.
3948 * parameters.cc (Parameters::incremental_full): New function.
3949 * parameters.h (Parameters::incremental_full): New function
3950 * testsuite/Makefile.am (incremental_test_2): Add test for
3951 --incremental-patch option.
3952 * testsuite/Makefile.in: Regenerate.
3953 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
3954 (t18): Remove function body.
3956 2011-07-05 Doug Kwan <dougkwan@google.com>
3959 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
3960 Arm_Address type for relocation result.
3961 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
3963 (Arm_relocate_functions::abs32): Use unaligned access.
3964 (Arm_relocate_functions::rel32): Ditto.
3965 (Arm_relocate_functions::prel31): Ditto.
3966 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
3967 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
3968 static data relocations.
3969 * testsuite/Makefile.in: Regnerate.
3970 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
3972 2011-07-05 Ian Lance Taylor <iant@google.com>
3975 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
3976 symbols if necessary.
3977 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3979 2011-07-05 Ian Lance Taylor <iant@google.com>
3982 * resolve.cc (Symbol::override_base_with_special): Simply override
3983 version with special symbol version, ignoring previous version.
3985 2011-07-05 Ian Lance Taylor <iant@google.com>
3987 * object.cc (Sized_relobj_file::include_section_group): Add
3988 information to comment about signature location.
3990 2011-07-02 Ian Lance Taylor <iant@google.com>
3993 * options.h (class General_options): Add -f and -F.
3994 * options.cc (General_options::finalize): Fatal error if -f/-F
3995 are used without -shared.
3996 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
3998 2011-07-02 Ian Lance Taylor <iant@google.com>
4000 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4002 2011-07-01 Ian Lance Taylor <iant@google.com>
4006 * resolve.cc (Symbol::override_base_with_special): Don't override
4007 the version if the overriding symbol has a different name.
4008 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4009 all callers. If we give an error about an undefined version,
4010 define the base version if necessary.
4011 * dynobj.h (class Versions): Update declaration.
4012 * testsuite/weak_alias_test_5.cc: New file.
4013 * testsuite/weak_alias_test.script: New file.
4014 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4015 and versioned_alias have the right value, and call t2.
4016 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4017 weak_alias_test_5.so.
4018 (weak_alias_test_LDADD): Likewise.
4019 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4020 * testsuite/Makefile.in: Rebuild.
4022 2011-07-01 Ian Lance Taylor <iant@google.com>
4025 * options.h (class General_options): Support -z notext.
4026 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4028 (two_file_shared_nonpic.so): Likewise.
4029 (two_file_shared_mixed.so): Likewise.
4030 (two_file_shared_mixed_1.so): Likewise.
4031 (weak_undef_lib_nonpic.so): Likewise.
4032 (alt/weak_undef_lib_nonpic.so): Likewise.
4033 (tls_test_shared_nonpic.so): Likewise.
4034 * testsuite/Makefile.in: Rebuild.
4036 2011-07-01 Ian Lance Taylor <iant@google.com>
4039 * configure.ac: Test whether static linking works, setting
4040 the automake conditional HAVE_STATIC.
4041 * testsuite/Makefile.am: Disable tests using -static if
4042 HAVE_STATIC is not true.
4043 * configure, testsuite/Makefile.in: Rebuild.
4045 2011-07-01 Ian Lance Taylor <iant@google.com>
4048 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4049 Assert if we see DW_EH_PE_indirect.
4050 * target.h (Target::ehframe_datarel_base): New function.
4051 (Target::do_ehframe_datarel_base): New target function.
4052 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4053 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4056 2011-07-01 Ian Lance Taylor <iant@google.com>
4059 * options.h (class General_options): Add
4060 --ld-generated-unwind-info.
4061 * ehframe.cc (Fde::write): Add address parameter. Change all
4062 callers. If associated with PLT, fill in address and size.
4063 (Cie::set_output_offset): Only add merge mapping if there is an
4065 (Cie::write): Add address parameter. Change all callers.
4066 (Eh_frame::add_ehframe_for_plt): New function.
4067 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4068 input_offset_ fields into union u_, with new plt field.
4069 (Fde::Fde): Adjust for new union field.
4070 (Fde::Fde) [Output_data version]: New constructor.
4071 (Fde::add_mapping): Only add merge mapping if there is an object.
4072 (class Cie): Update declarations.
4073 (class Eh_frame): Declare add_ehframe_for_plt.
4074 * layout.cc (Layout::layout_eh_frame): Break out code into
4075 make_eh_frame_section, and call it.
4076 (Layout::make_eh_frame_section): New function.
4077 (Layout::add_eh_frame_for_plt): New function.
4078 * layout.h (class Layout): Update declarations.
4079 * merge.cc (Merge_map::add_mapping): Add assertion.
4080 * i386.cc: Include "dwarf.h".
4081 (class Output_data_plt_i386): Make first_plt_entry,
4082 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4083 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4084 and plt_eh_frame_fde.
4085 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4086 boundary. Call add_eh_frame_for_plt if appropriate.
4087 * x86_64.cc: Include "dwarf.h".
4088 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4089 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4090 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4091 and plt_eh_frame_fde.
4092 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4095 2011-06-29 Ian Lance Taylor <iant@google.com>
4098 * object.cc (Sized_relobj_file::layout_section): Change shdr
4099 parameter to be const.
4100 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4102 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4103 appropriate. Call layout_eh_frame_section.
4104 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4106 * object.h (class Sized_relobj_file): Update declarations.
4108 2011-06-29 Ian Lance Taylor <iant@google.com>
4111 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4113 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4115 2011-06-29 Ian Lance Taylor <iant@google.com>
4118 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4120 * layout.cc (Layout::layout_eh_frame): Likewise.
4122 2011-06-29 Ian Lance Taylor <iant@google.com>
4125 * layout.cc (Layout::symtab_section_shndx): New function.
4126 * layout.h (class Layout): Declare symtab_section_shndx.
4127 * output.cc (Output_section::write_header): Call it.
4129 2011-06-29 Ian Lance Taylor <iant@google.com>
4132 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
4133 symbols which are not used in a relocation.
4135 2011-06-28 Ian Lance Taylor <iant@google.com>
4138 * layout.cc (Layout::segment_precedes): Don't crash if a linker
4139 script create indistinguishable segments.
4140 (Layout::set_segment_offsets): Use stable_sort when sorting
4141 segments. Pass this to Compare_segments constructor.
4142 * layout.h (class Layout): Make segment_precedes non-static.
4143 (class Compare_segments): Change from struct to class. Add
4144 layout_ field. Add constructor.
4145 * script-sections.cc
4146 (Script_sections::attach_sections_using_phdrs_clause): Rename
4147 local orphan to is_orphan. Don't report failure to put empty
4148 section in segment. On attachment failure, report name of
4149 section, and attach to first PT_LOAD segment.
4151 2011-06-28 Ian Lance Taylor <iant@google.com>
4154 * target-select.cc (Target_selector::Target_selector): Add
4155 emulation parameter. Change all callers.
4156 (select_target_by_bfd_name): Rename from select_target_by_name.
4158 (select_target_by_emulation): New function.
4159 (supported_emulation_names): New function.
4160 * target-select.h (class Target_selector): Add emulation_ field.
4161 Update declarations.
4162 (Target_selector::recognize_by_bfd_name): Rename from
4163 recognize_by_name. Change all callers.
4164 (Target_selector::supported_bfd_names): Rename from
4165 supported_names. Change all callers.
4166 (Target_selector::recognize_by_emulation): New function.
4167 (Target_selector::supported_emulations): New function.
4168 (Target_selector::emulation): New function.
4169 (Target_selector::do_recognize_by_bfd_name): Rename from
4170 do_recognize_by_name. Change all callers.
4171 (Target_selector::do_supported_bfd_names): Rename from
4172 do_supported_names. Change all callers.
4173 (Target_selector::do_recognize_by_emulation): New function.
4174 (Target_selector::do_supported_emulations): New function.
4175 (select_target_by_bfd_name): Change name in declaration.
4176 (select_target_by_emulation): Declare.
4177 (supported_emulation_names): Declare.
4178 * parameters.cc (parameters_force_valid_target): Try to find
4179 target based on emulation from -m option.
4180 * options.h (class General_options): Change doc string for -m.
4181 * options.cc (help): Print emulations.
4182 (General_options::parse_V): Likewise.
4183 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
4184 Add emulation parameter. Change all callers.
4186 2011-06-28 Ian Lance Taylor <iant@google.com>
4188 * target.h (class Target): Add osabi_ field.
4189 (Target::osabi): New function.
4190 (Target::set_osabi): New function.
4191 (Target::Target): Initialize osabi_.
4192 (Target::do_adjust_elf_header): Make pure virtual.
4193 (Sized_target::do_adjust_elf_header): Declare.
4194 * target.cc (Sized_target::do_adjust_elf_header): New function.
4195 (class Sized_target): Instantiate all versions.
4196 * freebsd.h (class Target_freebsd): Remove.
4197 (Target_selector_freebsd::do_recognize): Call set_osabi on
4199 (Target_selector_freebsd::do_recognize_by_name): Likewise.
4200 (Target_selector_freebsd::set_osabi): Remove.
4201 * i386.cc (class Target_i386): Inherit from Sized_target rather
4202 than Target_freebsd.
4203 * x86_64.cc (class Target_x86_64): Likewise.
4205 2011-06-28 Ian Lance Taylor <iant@google.com>
4207 * target.h (Target::can_check_for_function_pointers): Rewrite.
4209 (Target::can_icf_inline_merge_sections): Likewise.
4210 (Target::section_may_have_icf_unsafe_poineters): Likewise.
4211 (Target::Target_info): Add can_icf_inline_merge_sections field.
4212 (Target::do_can_check_for_function_pointers): New virtual
4214 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
4215 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
4216 from can_check_for_function_pointers, move in file.
4217 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
4218 section_may_have_icf_unsafe_poineters, move in file.
4219 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
4220 * i386.cc (Target_i386::do_can_check_for_function_pointers):
4221 Rename from can_check_for_function_pointers, move in file.
4222 (Target_i386::can_icf_inline_merge_sections): Remove.
4223 (Target_i386::i386_info): Initialize
4224 can_icf_inline_merge_sections.
4225 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
4226 Initialize can_icf_inline_merge_sections.
4227 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
4228 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
4229 Rename from can_check_for_function_pointers, move in file.
4230 (Target_x86_64::can_icf_inline_merge_sections): Remove.
4231 (Target_x86_64::x86_64_info): Initialize
4232 can_icf_inline_merge_sections.
4233 * testsuite/testfile.cc (Target_test::test_target_info):
4235 * icf.cc (get_section_contents): Correct formatting.
4237 2011-06-27 Ian Lance Taylor <iant@google.com>
4239 * symtab.cc (Symbol::versioned_name): New function.
4240 (Symbol_table::add_to_final_symtab): Use versioned_name when
4242 (Symbol_table::sized_write_symbol): Likewise.
4243 * symtab.h (class Symbol): Declare versioned_name.
4244 * stringpool.h (class Stringpool_template): Add variant of add
4245 which takes a std::basic_string.
4246 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
4247 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
4248 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
4249 (ver_test_12.o): New target.
4250 * testsuite/Makefile.in: Rebuild.
4252 2011-06-27 Doug Kwan <dougkwan@google.com>
4254 * arm.cc (Arm_relocate_functions::thm_jump8,
4255 Arm_relocate_functions::thm_jump11): Use a wider signed
4256 type to compute offset.
4257 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
4259 * testsuite/Makefile.in: Regenerate.
4260 * testsuite/arm_branch_in_range.sh: Check test results of
4261 arm_thm_jump11 and arm_thm_jump8.
4262 * testsuite/arm_thm_jump11.s: New test source file.
4263 * testsuite/arm_thm_jump11.t: New linker script.
4264 * testsuite/arm_thm_jump8.s: New test source file.
4265 * testsuite/arm_thm_jump8.t: New linker script.
4267 2011-06-24 Ian Lance Taylor <iant@google.com>
4269 * layout.cc: Include "object.h".
4270 (ctors_sections_in_init_array): New static variable.
4271 (Layout::is_ctors_in_init_array): New function.
4272 (Layout::layout): Add entry to ctors_sections_in_init_array if
4274 * layout.h (class Layout): Declare is_ctors_in_init_array.
4275 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
4276 is_ctors_reverse_view is set.
4277 (Sized_relobj_file::write_sections): Add layout parameter. Change
4278 all callers. Set is_ctors_reverse_view field of View_size.
4279 (Sized_relobj_file::reverse_words): New function.
4280 * object.h (Sized_relobj_file::View_size): Add
4281 is_ctors_reverse_view field.
4282 (class Sized_relobj_file): Update declarations.
4283 * testsuite/initpri3.c: New test.
4284 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
4286 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
4287 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
4288 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
4289 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
4290 * testsuite/Makefile.in: Rebuild.
4292 2011-06-24 Cary Coutant <ccoutant@google.com>
4294 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
4295 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
4296 (debug_msg_cdebug.err): New targets.
4297 * testsuite/Makefile.in: Regenerate.
4298 * testsuite/debug_msg.sh: Check output of link with compressed debug.
4299 Fix checks for link with shared library.
4301 2011-06-24 Doug Kwan <dougkwan@google.com>
4303 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
4304 skip empty text sections.
4305 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
4307 2011-06-22 Ian Lance Taylor <iant@google.com>
4310 * options.h (class General_options): Add --ctors-in-init-array.
4311 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
4312 friends as SHT_PROGBITS for merging sections.
4313 (Layout::layout): Remove special handling of .init_array and
4314 friends. Don't sort if doing relocatable link. Sort for .ctors
4315 and .dtors if ctors_in_init_array.
4316 (Layout::make_output_section): Force correct section types for
4317 .init_array and friends. Don't sort if doing relocatable link,
4318 Don't sort .ctors and .dtors if ctors_in_init_array.
4319 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
4320 (Layout::output_section_name): Add relobj parameter. Change all
4321 callers. Handle .ctors. and .dtors. in code rather than table.
4322 Handle .ctors and .dtors if ctors_in_init_array.
4323 (Layout::match_file_name): New function, moved from output.cc.
4324 * layout.h (class Layout): Update declarations.
4325 * output.cc: Include "layout.h".
4326 (Input_section_sort_entry::get_priority): New function.
4327 (Input_section_sort_entry::match_file_name): Just call
4328 Layout::match_file_name.
4329 (Output_section::Input_section_sort_init_fini_compare::operator()):
4330 Handle .ctors and .dtors. Sort by explicit priority rather than
4332 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
4333 * testsuite/initpri2.c: New test.
4334 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
4335 (check_PROGRAMS): Add initpri2.
4336 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
4337 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
4338 * configure, testsuite/Makefile.in: Rebuild.
4340 2011-06-19 Ian Lance Taylor <iant@google.com>
4343 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
4344 .interp section to a PT_INTERP segment even if we have seen a
4345 --dynamic-linker option. Don't do it if we have seen a PHDRS
4346 clause in a linker script.
4347 (Layout::finalize): Don't create a .interp section if we've
4348 already create a PT_INTERP segment.
4349 (Layout::create_interp): Always call choose_output_section (revert
4350 patch of 2011-06-17). Don't create PT_INTERP segment.
4351 * script-sections.cc
4352 (Script_sections::create_note_and_tls_segments): Add a .interp
4353 section to a PT_INTERP segment even if we have seen a
4354 --dynamic-linker option.
4356 2011-06-18 Ian Lance Taylor <iant@google.com>
4358 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
4359 merely because a non-PT_LOAD segment has a dynamic reloc.
4361 2011-06-18 Ian Lance Taylor <iant@google.com>
4363 * layout.cc (Layout::finish_dynamic_section): Don't create
4364 DT_FLAGS entry if not needed.
4366 2011-06-18 Ian Lance Taylor <iant@google.com>
4369 * layout.cc (Layout::layout_eh_frame): Correct handling of
4370 writable .eh_frame section.
4372 2011-06-17 Ian Lance Taylor <iant@google.com>
4375 * resolve.cc (Symbol_table::resolve): Don't give an error if a
4376 symbol is redefined with the exact same object and value.
4378 2011-06-17 Ian Lance Taylor <iant@google.com>
4381 * layout.h (class Layout): Add interp_segment_ field.
4382 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
4383 (Layout::attach_allocated_section_to_segment): If making shared
4384 library, put .interp section in PT_INTERP segment.
4385 (Layout::finalize): Also call create_interp if -dynamic-linker
4387 (Layout::create_interp): Assert that there is no PT_INTERP
4388 segment. If not using a SECTIONS clause, use make_output_section.
4389 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
4390 * script-sections.cc
4391 (Script_sections::create_note_and_tls_segments): If making shared
4392 library, put .interp section in PT_INTERP segment.
4394 2011-06-17 Ian Lance Taylor <iant@google.com>
4396 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
4397 when making a shared library.
4399 2011-06-17 Ian Lance Taylor <iant@google.com>
4401 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
4402 parameter. Change all callers. Don't issue warning about PC32
4403 against locally defined symbol.
4405 2011-06-16 Ian Lance Taylor <iant@google.com>
4407 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
4408 occurs in same object.
4410 2011-06-14 Alan Modra <amodra@gmail.com>
4412 * po/POTFILES.in: Regenerate.
4414 2011-06-09 Ian Lance Taylor <iant@google.com>
4416 * script-sections.cc
4417 (Orphan_output_section::set_section_addresses): For a relocatable
4418 link set address to 0.
4420 2011-06-09 Cary Coutant <ccoutant@google.com>
4423 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
4424 used with --compress-debug-sections.
4425 * gold/object.cc (Sized_relobj_file::do_layout): Report
4426 uncompressed size of compressed input sections.
4428 2011-06-08 Cary Coutant <ccoutant@google.com>
4431 * testsuite/two_file_test_2_v1.cc: Change initialization of
4432 v2 to keep it in .data.
4434 2011-06-07 Cary Coutant <ccoutant@google.com>
4436 * common.cc (Symbol_table::do_allocate_commons_list): Call
4438 * errors.cc (Errors::fatal): Adjust call to gold_exit.
4439 (Errors::fallback): New function.
4440 (gold_fallback): New function.
4441 * errors.h (Errors::fallback): New function.
4442 * gold.cc (gold_exit): Change status parameter to enum; adjust
4444 (queue_initial_tasks): Call gold_fallback.
4445 * gold.h: Include cstdlib.
4446 (Exit_status): New enum type.
4447 (gold_exit): Change status parameter to enum.
4448 (gold_fallback): New function.
4449 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
4450 (Layout::create_symtab_sections): Likewise.
4451 (Layout::create_shdrs): Likewise.
4452 * main.cc (main): Adjust call to gold_exit.
4453 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
4454 (Output_data_got::add_got_entry_pair): Likewise.
4455 (Output_section::add_input_section): Likewise.
4456 (Output_section::add_output_section_data): Likewise.
4457 (Output_segment::set_section_list_addresses): Likewise.
4458 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
4460 2011-06-07 Cary Coutant <ccoutant@google.com>
4462 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
4463 for incremental links.
4464 * output.cc (Output_segment::set_section_list_addresses): Remove
4465 FIXME and test for TLS or BSS.
4467 2011-06-07 Cary Coutant <ccoutant@google.com>
4469 * testsuite/Makefile.am: Add incremental_copy_test,
4470 incremental_common_test_1.
4471 * testsuite/Makefile.in: Regenerate.
4472 * testsuite/common_test_1_v1.c: New source file.
4473 * testsuite/common_test_1_v2.c: New source file.
4474 * testsuite/copy_test_v1.cc: New source file.
4476 2011-06-07 Cary Coutant <ccoutant@google.com>
4478 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
4479 update, allocate common from bss section's free list.
4480 * incremental-dump.cc (dump_incremental_inputs): Print flag for
4481 linker-defined symbols.
4482 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4483 Skip GOT and PLT entries that are no longer referenced.
4484 (Output_section_incremental_inputs::write_info_blocks): Mark
4485 linker-defined symbols.
4486 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
4487 * output.cc (Output_section::allocate): New function.
4488 * output.h (Output_section::allocate): New function.
4489 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
4490 linker-defined symbols.
4491 (Symbol::override_base_with_special): Copy is_predefined_ flag.
4492 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
4493 (Symbol::init_base_output_data): Likewise.
4494 (Symbol::init_base_output_segment): Likewise.
4495 (Symbol::init_base_constant): Likewise.
4496 (Sized_symbol::init_output_data): Likewise.
4497 (Sized_symbol::init_output_segment): Likewise.
4498 (Sized_symbol::init_constant): Likewise.
4499 (Symbol_table::do_define_in_output_data): Likewise.
4500 (Symbol_table::do_define_in_output_segment): Likewise.
4501 (Symbol_table::do_define_as_constant): Likewise.
4502 * symtab.h (Symbol::is_predefined): New function.
4503 (Symbol::init_base_output_data): Add is_predefined parameter.
4504 (Symbol::init_base_output_segment): Likewise.
4505 (Symbol::init_base_constant): Likewise.
4506 (Symbol::is_predefined_): New data member.
4507 (Sized_symbol::init_output_data): Add is_predefined parameter.
4508 (Sized_symbol::init_output_segment): Likewise.
4509 (Sized_symbol::init_constant): Likewise.
4510 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
4512 2011-06-07 Cary Coutant <ccoutant@google.com>
4514 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
4515 instead of emit_copy_reloc.
4516 (Copy_relocs::emit_copy_reloc): Refactor.
4517 (Copy_relocs::make_copy_reloc): New function.
4518 (Copy_relocs::add_copy_reloc): Remove.
4519 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
4521 (Copy_relocs::make_copy_reloc): New function.
4522 (Copy_relocs::add_copy_reloc): Remove.
4523 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
4524 unchanged input files.
4525 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
4526 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
4527 Reserve BSS space for COPY relocations.
4528 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4529 (Output_section_incremental_inputs::write_info_blocks): Record
4530 whether a symbol is copied from a shared object.
4531 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
4532 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
4533 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
4534 (Incremental_input_entry_reader::get_output_symbol_index): Add
4536 (Incremental_binary::emit_copy_relocs): New function.
4537 (Incremental_binary::do_emit_copy_relocs): New function.
4538 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4540 (Sized_incremental_binary::add_copy_reloc): New function.
4541 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4542 (Sized_incremental_binary::Copy_reloc): New struct.
4543 (Sized_incremental_binary::Copy_relocs): New typedef.
4544 (Sized_incremental_binary::copy_relocs_): New data member.
4545 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
4546 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
4547 * target.h (Sized_target::emit_copy_reloc): New function.
4548 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
4550 2011-06-02 Cary Coutant <ccoutant@google.com>
4553 * gold/archive.cc (Archive::Archive): Initialize new data member.
4554 (Archive::include_all_members): Return if archive has already been
4556 * gold/archive.h (Archive::include_all_members_): New data member.
4558 2011-06-02 Nick Clifton <nickc@redhat.com>
4560 * dynobj.h: Fix spelling mistake in comment.
4561 * output.cc: Likewise.
4563 2011-05-31 Doug Kwan <dougkwan@google.com>
4567 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
4568 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
4569 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
4570 redundant arm_exidx_test.so.
4571 * testsuite/Makefile.in: Regenerate.
4572 (check_SCRIPTS): Add pr12826.sh
4573 (check_DATA): Add pr12826.stdout
4574 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
4575 * testsuite/pr12826.sh: New file.
4576 * testsuite/pr12826_1.s: Ditto.
4577 * testsuite/pr12826_1.s: Ditto.
4579 2011-05-30 Ian Lance Taylor <iant@google.com>
4581 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
4584 2011-05-29 Ian Lance Taylor <iant@google.com>
4587 * testsuite/Makefile.am: Use different file name for two_file_test
4588 temporary file for each incremental test.
4589 * testsuite/Makefile.in: Rebuild.
4591 2011-05-29 Ian Lance Taylor <iant@google.com>
4593 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
4594 binary input file is empty.
4596 2011-05-27 Ian Lance Taylor <iant@google.com>
4598 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
4599 (ver_test_9.so): Likewise.
4600 * testsuite/Makefile.in: Rebuild.
4602 2011-05-26 Cary Coutant <ccoutant@google.com>
4604 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
4605 * incremental.cc (Incremental_inputs::report_input_section): Fix
4606 comment, indentation.
4607 (Incremental_inputs::report_comdat_group): New function.
4608 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4609 of data for incremental input file entry.
4610 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
4611 group count, COMDAT group signatures.
4612 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
4613 an unchanged input file.
4614 * incremental.h (Incremental_object_entry::Incremental_object_entry):
4615 Initialize new data member.
4616 (Incremental_object_entry::add_comdat_group): New function.
4617 (Incremental_object_entry::get_comdat_group_count): New function.
4618 (Incremental_object_entry::get_comdat_signature_key): New function.
4619 (Incremental_object_entry::groups_): New data member.
4620 (Incremental_inputs::report_comdat_group): New function.
4621 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
4622 data for incremental input file entry.
4623 (Incremental_input_entry_reader::get_comdat_group_count): New function.
4624 (Incremental_input_entry_reader::get_input_section): Adjust size of
4625 data for incremental input file entry.
4626 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
4627 (Incremental_input_entry_reader::get_comdat_group_signature): New
4629 * object.cc (Sized_relobj::include_section_group): Report kept
4630 COMDAT groups for incremental links.
4632 2011-05-24 David Meyer <pdox@google.com>
4634 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
4635 with name parameter. Add found_name parameter.
4636 * fileread.cc (Input_file::find_file): Adjust code accordingly.
4637 * dirsearch.h (class Dirsearch): Update declaration.
4639 2011-05-24 Ian Lance Taylor <iant@google.com>
4641 * archive.cc (Library_base::should_include_member): Pull in object
4642 from archive if it defines the entry symbol.
4643 * parameters.cc (Parameters::entry): New function.
4644 * parameters.h (class Parameters): Declare entry.
4645 * output.h (class Output_file_header): Remove entry_ field.
4646 * output.cc (Output_file_header::Output_file_header): Remove entry
4647 parameter. Change all callers.
4648 (Output_file_header::entry): Use parameters->entry.
4649 * gold.cc (queue_middle_tasks): Likewise.
4650 * plugin.cc (Plugin_hook::run): Likewise.
4652 2011-05-24 Cary Coutant <ccoutant@google.com>
4654 * gold.cc (queue_initial_tasks): Pass incremental base filename
4655 to Output_file::open_base_file; don't print error message.
4656 * incremental-dump.cc (main): Adjust call to
4657 Output_file::open_for_modification.
4658 * incremental-dump.cc (main): Likewise.
4659 * incremental.cc (Incremental_inputs::report_command_line):
4660 Ignore --incremental-base option when comparing command lines.
4661 Ignore parameter when given as separate argument.
4662 * options.h (class General_options): Add --incremental-base.
4663 * output.cc (Output_file::Output_file):
4664 (Output_file::open_base_file): Add base_name and writable parameters;
4665 read base file into new file; print error message here.
4666 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4668 * output.h (Output_file::open_for_modification): Rename to...
4669 (Output_file::open_base_file): ...this; add base_name and
4670 writable parameters; adjust all callers.
4671 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4673 * testsuite/Makefile.am (incremental_test_4): Test
4675 * testsuite/Makefile.in: Regenerate.
4677 2011-05-24 Cary Coutant <ccoutant@google.com>
4679 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
4681 * testsuite/Makefile.in: Regenerate.
4682 * testsuite/two_file_test_1_v1.cc: New test source file.
4683 * testsuite/two_file_test_1b_v1.cc: New test source file.
4684 * testsuite/two_file_test_2_v1.cc: New test source file.
4686 2011-05-24 Cary Coutant <ccoutant@google.com>
4688 * dynobj.h (Dynobj::do_dynobj): New function.
4689 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
4690 flag and soname for shared objects.
4691 * incremental.cc (Incremental_inputs::report_object): Make
4692 either Incremental_object_entry or Incremental_dynobj_entry; add
4693 soname to string table.
4694 (Incremental_inputs::report_input_section): Add assertion.
4695 (Output_section_incremental_inputs::set_final_data_size): Adjust
4696 type of input file entry for shared libraries; adjust size of
4697 shared library info entry.
4698 (Output_section_incremental_inputs::write_input_files): Write
4699 as_needed flag for shared libraries.
4700 (Output_section_incremental_inputs::write_info_blocks): Adjust type
4701 of input file entry for shared libraries; write soname.
4702 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
4703 soname from incremental info.
4704 * incremental.h (enum Incremental_input_flags): Add
4705 INCREMENTAL_INPUT_AS_NEEDED.
4706 (Incremental_input_entry::Incremental_input_entry): Initialize new
4708 (Incremental_input_entry::set_as_needed): New function.
4709 (Incremental_input_entry::as_needed): New function.
4710 (Incremental_input_entry::do_dynobj_entry): New function.
4711 (Incremental_input_entry::as_needed_): New data member.
4712 (Incremental_object_entry::Incremental_object_entry): Don't check
4714 (Incremental_object_entry::do_type): Likewise.
4715 (class Incremental_dynobj_entry): New class.
4716 (Incremental_input_entry_reader::as_needed): New function.
4717 (Incremental_input_entry_reader::get_soname): New function.
4718 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
4719 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
4720 size of shared library info entry.
4721 * layout.cc (Layout::finish_dynamic_section): Don't test for
4722 incremental link when adding DT_NEEDED entries.
4723 * object.h (Object::Object): Initialize new data member.
4724 (Object::dynobj): New function.
4725 (Object::set_as_needed): New function.
4726 (Object::as_needed): New function.
4727 (Object::do_dynobj): New function.
4728 (Object::as_needed_): New data member.
4730 2011-05-24 Cary Coutant <ccoutant@google.com>
4732 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
4733 info; adjust display of GOT entries.
4734 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4735 vector of input objects; remove file_status_.
4736 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
4737 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
4738 got_plt reader; call target hooks to reserve GOT entries.
4739 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4740 of input file info header and GOT info entry.
4741 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
4743 (Got_plt_view_info::got_descriptor): Remove.
4744 (Got_plt_view_info::sym_index): New data member.
4745 (Got_plt_view_info::input_index): New data member.
4746 (Local_got_offset_visitor::visit): Write input file index.
4747 (Global_got_offset_visitor::visit): Write 0 for input file index.
4748 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
4749 with sym_index and input_index.
4750 (Output_section_incremental_inputs::write_got_plt): Adjust size of
4751 incremental info GOT entry; replace got_descriptor with input_index.
4752 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
4753 map from input file index to object.
4754 (Sized_relobj_incr::do_layout): Replace direct data member reference
4755 with accessor function.
4756 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
4757 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
4758 Adjust size of input file info header.
4759 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
4760 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
4761 (Incremental_input_entry_reader::get_input_section): Adjust size of
4762 input file info header.
4763 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
4764 of incremental info GOT entry.
4765 (Incremental_got_plt_reader::get_got_desc): Remove.
4766 (Incremental_got_plt_reader::get_got_symndx): New function.
4767 (Incremental_got_plt_reader::get_got_input_index): New function.
4768 (Sized_incremental_binary::Sized_incremental_binary): Remove
4769 file_status_; add input_objects_.
4770 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
4771 (Sized_incremental_binary::set_file_is_unchanged): Remove.
4772 (Sized_incremental_binary::file_is_unchanged): Remove.
4773 (Sized_incremental_binary::set_input_object): New function.
4774 (Sized_incremental_binary::input_object): New function.
4775 (Sized_incremental_binary::file_status_): Remove.
4776 (Sized_incremental_binary::input_objects_): New data member.
4777 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
4779 (Sized_relobj_incr::invalid_address): Move to base class.
4780 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
4782 (Sized_relobj_incr::do_output_section_offset): Likewise.
4783 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
4784 (Sized_relobj_incr::section_offsets_): Likewise.
4785 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
4787 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
4788 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
4789 with accessor function.
4790 (Sized_relobj_file::do_layout): Likewise.
4791 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
4792 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
4793 (Sized_relobj_file::compute_final_local_value): Replace refs to
4794 section_offsets_ with accessor function.
4795 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
4796 * object.h (Relobj::Relobj): Initialize new data members.
4797 (Relobj::add_dyn_reloc): New function.
4798 (Relobj::first_dyn_reloc): New function.
4799 (Relobj::dyn_reloc_count): New function.
4800 (Relobj::first_dyn_reloc_): New data member.
4801 (Relobj::dyn_reloc_count_): New data member.
4802 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
4804 (Sized_relobj::Address): New typedef.
4805 (Sized_relobj::invalid_address): Move here from child class.
4806 (Sized_relobj::Sized_relobj): Initialize new data members.
4807 (Sized_relobj::sized_relobj): New function.
4808 (Sized_relobj::is_output_section_offset_invalid): Move here from
4810 (Sized_relobj::get_output_section_offset): Likewise.
4811 (Sized_relobj::local_has_got_offset): Likewise.
4812 (Sized_relobj::local_got_offset): Likewise.
4813 (Sized_relobj::set_local_got_offset): Likewise.
4814 (Sized_relobj::do_for_all_local_got_entries): Likewise.
4815 (Sized_relobj::clear_got_offsets): New function.
4816 (Sized_relobj::section_offsets): Move here from child class.
4817 (Sized_relobj::do_output_section_offset): Likewise.
4818 (Sized_relobj::do_set_section_offset): Likewise.
4819 (Sized_relobj::Local_got_offsets): Likewise.
4820 (Sized_relobj::local_got_offsets_): Likewise.
4821 (Sized_relobj::section_offsets_): Likewise.
4822 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
4824 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
4826 (Sized_relobj_file::sized_relobj): New function
4827 (Sized_relobj_file::local_has_got_offset): Move to base class.
4828 (Sized_relobj_file::local_got_offset): Likewise.
4829 (Sized_relobj_file::set_local_got_offset): Likewise.
4830 (Sized_relobj_file::get_output_section_offset): Likewise.
4831 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
4832 (Sized_relobj_file::do_output_section_offset): Likewise.
4833 (Sized_relobj_file::do_set_section_offset): Likewise.
4834 (Sized_relobj_file::Local_got_offsets): Likewise.
4835 (Sized_relobj_file::local_got_offsets_): Likewise.
4836 (Sized_relobj_file::section_offsets_): Likewise.
4837 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
4839 (set_needs_dynsym_index): Convert relobj to derived class pointer.
4840 (Output_reloc::get_symbol_index): Likewise.
4841 (Output_reloc::local_section_offset): Likewise.
4842 (Output_reloc::get_address): Likewise.
4843 (Output_reloc::symbol_value): Likewise.
4844 (Output_data_got::reserve_slot): Move to class definition.
4845 (Output_data_got::reserve_local): New function.
4846 (Output_data_got::reserve_slot_for_global): Remove.
4847 (Output_data_got::reserve_global): New function.
4848 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
4849 (all constructors, two instantiations).
4850 (Output_reloc::get_relobj): New function (two instantiations).
4851 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
4852 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
4853 (Output_data_reloc::add_global): Adjust type of relobj.
4854 (Output_data_reloc::add_global_relative): Likewise.
4855 (Output_data_reloc::add_symbolless_global_addend): Likewise.
4856 (Output_data_reloc::add_local): Likewise.
4857 (Output_data_reloc::add_local_relative): Likewise.
4858 (Output_data_reloc::add_symbolless_local_addend): Likewise.
4859 (Output_data_reloc::add_local_section): Likewise.
4860 (Output_data_reloc::add_output_section): Likewise.
4861 (Output_data_reloc::add_absolute): Likewise.
4862 (Output_data_reloc::add_target_specific): Likewise.
4863 (Output_data_got::reserve_slot): Move definition here.
4864 (Output_data_got::reserve_local): New function.
4865 (Output_data_got::reserve_global): New function.
4866 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
4867 section_offsets_ with accessor function.
4868 (Sized_relobj_file::write_sections): Likewise.
4869 (Sized_relobj_file::do_relocate_sections): Likewise.
4870 * target.h (Sized_target::reserve_local_got_entry): New function.
4871 (Sized_target::reserve_global_got_entry): New function.
4872 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
4873 (Target_x86_64::reserve_global_got_entry): New function.
4874 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
4876 2011-05-23 Cary Coutant <ccoutant@google.com>
4878 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
4879 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
4880 bit when checking got_type.
4881 * incremental.cc (Sized_incremental_binary::setup_readers):
4882 Store symbol table and string table locations; initialize bit vector
4883 of file status flags.
4884 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
4886 (Sized_incremental_binary::do_process_got_plt): New function.
4887 (Sized_incremental_binary::get_symtab_view): Use stored locations.
4888 (Output_section_incremental_inputs::set_final_data_size): Record
4889 file index for each input file.
4890 (Output_section_incremental_inputs::write_got_plt): Store file index
4891 instead of input entry offset for each GOT entry.
4893 (Incremental_input_entry::Incremental_input_entry): Initialize new
4895 (Incremental_input_entry::set_offset): Store file index.
4896 (Incremental_input_entry::get_file_index): New function.
4897 (Incremental_input_entry::file_index_): New data member.
4898 (Incremental_binary::process_got_plt): New function.
4899 (Incremental_binary::do_process_got_plt): New function.
4900 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4902 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
4903 (Sized_incremental_binary::set_file_is_unchanged): New function.
4904 (Sized_incremental_binary::file_is_unchanged): New function.
4905 (Sized_incremental_binary::do_process_got_plt): New function.
4906 (Sized_incremental_binary::file_status_): New data member.
4907 (Sized_incremental_binary::main_symtab_loc_): New data member.
4908 (Sized_incremental_binary::main_strtab_loc_): New data member.
4909 * output.cc (Output_data_got::Got_entry::write): Add case
4911 (Output_data_got::add_global): Call add_got_entry.
4912 (Output_data_got::add_global_plt): Likewise.
4913 (Output_data_got::add_global_with_rel): Likewise.
4914 (Output_data_got::add_global_with_rela): Likewise.
4915 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
4916 (Output_data_got::add_global_pair_with_rela): Likewise.
4917 (Output_data_got::add_local): Call add_got_entry.
4918 (Output_data_got::add_local_plt): Likewise.
4919 (Output_data_got::add_local_with_rel): Likewise.
4920 (Output_data_got::add_local_with_rela): Likewise.
4921 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
4922 (Output_data_got::add_local_pair_with_rela): Likewise.
4923 (Output_data_got::reserve_slot): New function.
4924 (Output_data_got::reserve_slot_for_global): New function.
4925 (Output_data_got::add_got_entry): New function.
4926 (Output_data_got::add_got_entry_pair): New function.
4927 (Output_section::add_output_section_data): Edit FIXME.
4929 (Output_section_data_build::Output_section_data_build): New
4930 constructor with size parameter.
4931 (Output_data_space::Output_data_space): Likewise.
4932 (Output_data_got::Output_data_got): Initialize new data member; new
4933 constructor with size parameter.
4934 (Output_data_got::add_constant): Call add_got_entry.
4935 (Output_data_got::reserve_slot): New function.
4936 (Output_data_got::reserve_slot_for_global): New function.
4937 (class Output_data_got::Got_entry): Add RESERVED_CODE.
4938 (Output_data_got::add_got_entry): New function.
4939 (Output_data_got::add_got_entry_pair): New function.
4940 (Output_data_got::free_list_): New data member.
4941 * target.h (Sized_target::init_got_plt_for_update): New function.
4942 (Sized_target::register_global_plt_entry): New function.
4943 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4944 Initialize new data member; call init; add constructor with PLT count.
4945 (Output_data_plt_x86_64::init): New function.
4946 (Output_data_plt_x86_64::add_relocation): New function.
4947 (Output_data_plt_x86_64::reserve_slot): New function.
4948 (Output_data_plt_x86_64::free_list_): New data member.
4949 (Target_x86_64::init_got_plt_for_update): New function.
4950 (Target_x86_64::register_global_plt_entry): New function.
4951 (Output_data_plt_x86_64::add_entry): Allocate from free list for
4952 incremental updates.
4953 (Output_data_plt_x86_64::add_relocation): New function.
4954 * testsuite/object_unittest.cc (Object_test): Set default options.
4956 2011-05-16 Ian Lance Taylor <iant@google.com>
4958 * options.h (class General_options): Make -i a synonym for -r.
4960 2011-05-16 Ian Lance Taylor <iant@google.com>
4962 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
4964 2011-05-10 Cary Coutant <ccoutant@google.com>
4966 * object.cc (Sized_relobj::do_count_local_symbols): Check for
4969 2011-05-06 Ian Lance Taylor <iant@google.com>
4971 * layout.cc (Layout::layout): If the output section flags change,
4972 update the ordering.
4974 2011-04-25 Cary Coutant <ccoutant@google.com>
4976 * incremental-dump.cc (dump_incremental_inputs): Print local
4977 symbol info for each input file.
4979 (Output_section_incremental_inputs::set_final_data_size): Add local
4980 symbol info to input file entries in incremental info.
4981 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4982 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
4983 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
4984 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
4986 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
4987 (Sized_incr_relobj::do_relocate): Write the local symbols.
4988 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
4989 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
4990 Adjust size of input file header.
4991 (Incremental_inputs_reader::get_local_symbol_offset): New function.
4992 (Incremental_inputs_reader::get_local_symbol_count): New function.
4993 (Incremental_inputs_reader::get_input_section): Adjust size of input
4995 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
4996 (Sized_incr_relobj::This): New typedef.
4997 (Sized_incr_relobj::sym_size): New const data member.
4998 (Sized_incr_relobj::Local_symbol): New struct.
4999 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5000 (Sized_incr_relobj::do_local_symbol_offset): New function.
5001 (Sized_incr_relobj::local_symbol_count_): New data member.
5002 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5003 (Sized_incr_relobj::local_symbol_index_): New data member.
5004 (Sized_incr_relobj::local_symbol_offset_): New data member.
5005 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5006 (Sized_incr_relobj::local_symbols_): New data member.
5007 * object.h (Relobj::output_local_symbol_count): New function.
5008 (Relobj::local_symbol_offset): New function.
5009 (Relobj::do_output_local_symbol_count): New function.
5010 (Relobj::do_local_symbol_offset): New function.
5011 (Sized_relobj::do_output_local_symbol_count): New function.
5012 (Sized_relobj::do_local_symbol_offset): New function.
5014 2011-04-22 Vladimir Simonov <sv@sw.ru>
5016 * descriptors.cc (set_close_on_exec): New function.
5017 (Descriptors::open): Use set_close_on_exec.
5018 * output.cc (S_ISLNK): Define if not defined.
5020 2011-04-22 Cary Coutant <ccoutant@google.com>
5022 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5024 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5025 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5026 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5028 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5029 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5030 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5032 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5034 (Incremental_binary::apply_incremental_relocs): New function.
5035 (Incremental_binary::do_apply_incremental_relocs): New function.
5036 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5038 (Sized_incremental_binary::add_global_symbol): New function.
5039 (Sized_incremental_binary::global_symbol): New function.
5040 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5041 (Sized_incremental_binary::symbol_map_): New data member.
5042 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5043 * target.h (Sized_target::apply_relocation): New function.
5044 * target-reloc.h (apply_relocation): New function.
5045 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5047 2011-04-22 Doug Kwan <dougkwan@google.com>
5049 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5050 flag of a SHT_ARM_EXIDX section.
5051 * testsuite/Makefile.am (arm_exidx_test): New test rules.
5052 * testsuite/Makefile.in: Regenerate.
5053 * testsuite/arm_exidx_test.s: New file.
5054 * testsuite/arm_exidx_test.sh: Same.
5056 2011-04-20 Cary Coutant <ccoutant@google.com>
5059 * archive.h (Incremental_archive_entry::Archive_member):
5060 Initialize arg_serial_ (second constructor).
5062 2011-04-17 Ian Lance Taylor <iant@google.com>
5064 * object.cc (Relocate_info::location): Simplify location string.
5065 * errors.cc (Errors::error_at_location): Don't print program
5067 (Errors::warning_at_location): Likewise.
5068 (Errors::undefined_symbol): Likewise.
5069 * testsuite/debug_msg.sh: Update accordingly.
5071 2011-04-14 Cary Coutant <ccoutant@google.com>
5073 * gold/layout.cc (Layout::symtab_section_offset): New function.
5074 * gold/layout.h (Layout::symtab_section_offset): New function.
5075 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5077 2011-04-12 Ian Lance Taylor <iant@google.com>
5079 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5080 with MREMAP_MAYMOVE.
5081 * output.h (class Output_file): Add map_is_allocated_ field.
5082 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5083 not available, provide stubs. If mremap is not available, #define
5085 (MREMAP_MAYMOVE): Define if not defined.
5086 (Output_file::Output_file): Initialize map_is_allocated_.
5087 (Output_file::resize): Check map_is_allocated_.
5088 (Output_file::map_anonymous): If mmap fails, use malloc.
5089 (Output_file::unmap): Don't do anything for an anonymous map.
5090 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5091 is not available, provide stubs.
5092 (File_read::View::~View): Use free rather than delete[].
5093 (File_read::make_view): Use malloc rather than new[]. If mmap
5095 (File_read::find_or_make_view): Use malloc rather than new[].
5096 * gold.h: Remove HAVE_REMAP code.
5097 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5098 exists. Rename mremap to gold_mremap. If mmap is not available
5100 * configure, config.in: Rebuild.
5102 2011-04-11 Ian Lance Taylor <iant@google.com>
5104 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5105 initialize local variable v.
5107 2011-04-11 Cary Coutant <ccoutant@google.com>
5109 * archive.cc (Archive::include_member): Adjust call to
5111 (Add_archive_symbols::run): Track argument serial numbers.
5112 (Lib_group::include_member): Likewise.
5113 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5114 * archive.h (Incremental_archive_entry::Archive_member):
5115 Initialize arg_serial_.
5116 (Archive_member::arg_serial_): New data member.
5117 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5118 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5120 (Sized_dynobj::do_for_all_local_got_entries): New function.
5121 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5123 * fileread.cc (get_mtime): New function.
5124 * fileread.h (get_mtime): New function.
5125 * gold.cc (queue_initial_tasks): Check for incremental update.
5126 (process_incremental_input): New function.
5127 (queue_middle_tasks): Don't force valid target for incremental
5129 * incremental-dump.cc (find_input_containing_global): Adjust
5130 size of symbol info entry.
5131 (dump_incremental_inputs): Dump argument serial number and
5132 in_system_directory flag; bias shndx by 1; print symbol names
5133 when dumping per-file symbol lists; use new symbol info readers.
5135 (Output_section_incremental_inputs:update_data_size): New function.
5136 (Sized_incremental_binary::setup_readers): Setup input readers
5137 for each input file; build maps for files added from libraries
5139 (Sized_incremental_binary::check_input_args): New function.
5140 (Sized_incremental_binary::do_check_inputs): Build map of argument
5141 serial numbers to input arguments.
5142 (Sized_incremental_binary::do_file_has_changed): Rename
5143 do_file_is_unchanged to this; compare file modification times.
5144 (Sized_incremental_binary::do_init_layout): New function.
5145 (Sized_incremental_binary::do_reserve_layout): New function.
5146 (Sized_incremental_binary::do_get_input_reader): Remove.
5147 (Sized_incremental_binary::get_symtab_view): New function.
5148 (Incremental_checker::can_incrementally_link_output_file): Remove.
5149 (Incremental_inputs::report_command_line): Exclude --debug options.
5150 (Incremental_inputs::report_archive_begin): Add parameter; track
5151 argument serial numbers; don't put input file entry for archive
5152 before archive members.
5153 (Incremental_inputs::report_archive_end): Put input file entry
5154 for archive after archive members.
5155 (Incremental_inputs::report_object): Add parameter; track argument
5156 serial numbers and in_system_directory flag.
5157 (Incremental_inputs::report_script): Add parameter; track argument
5159 (Output_section_incremental_inputs::set_final_data_size): Adjust
5160 size of symbol info entry; check for forwarding symbols.
5161 (Output_section_incremental_inputs::write_input_files): Write
5162 in_system_directory flag and argument serial number.
5163 (Output_section_incremental_inputs::write_info_blocks): Map section
5164 indices between incremental info and original input file; store
5165 input section index for each symbol.
5166 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5167 change operator() to visit().
5168 (class Global_got_offset_visitor): Likewise.
5169 (class Global_symbol_visitor_got_plt):
5170 (Output_section_incremental_inputs::write_got_plt): Use new visitor
5172 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
5173 (Sized_incr_relobj::do_read_symbols): New function.
5174 (Sized_incr_relobj::do_layout): New function.
5175 (Sized_incr_relobj::do_layout_deferred_sections): New function.
5176 (Sized_incr_relobj::do_add_symbols): New function.
5177 (Sized_incr_relobj::do_should_include_member): New function.
5178 (Sized_incr_relobj::do_for_all_global_symbols): New function.
5179 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
5180 (Sized_incr_relobj::do_section_size): New function.
5181 (Sized_incr_relobj::do_section_name): New function.
5182 (Sized_incr_relobj::do_section_contents): New function.
5183 (Sized_incr_relobj::do_section_flags): New function.
5184 (Sized_incr_relobj::do_section_entsize): New function.
5185 (Sized_incr_relobj::do_section_address): New function.
5186 (Sized_incr_relobj::do_section_type): New function.
5187 (Sized_incr_relobj::do_section_link): New function.
5188 (Sized_incr_relobj::do_section_info): New function.
5189 (Sized_incr_relobj::do_section_addralign): New function.
5190 (Sized_incr_relobj::do_initialize_xindex): New function.
5191 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
5192 (Sized_incr_relobj::do_read_relocs): New function.
5193 (Sized_incr_relobj::do_gc_process_relocs): New function.
5194 (Sized_incr_relobj::do_scan_relocs): New function.
5195 (Sized_incr_relobj::do_count_local_symbols): New function.
5196 (Sized_incr_relobj::do_finalize_local_symbols): New function.
5197 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
5198 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
5199 (Sized_incr_relobj::do_relocate): New function.
5200 (Sized_incr_relobj::do_set_section_offset): New function.
5201 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
5202 (Sized_incr_dynobj::do_read_symbols): New function.
5203 (Sized_incr_dynobj::do_layout): New function.
5204 (Sized_incr_dynobj::do_add_symbols): New function.
5205 (Sized_incr_dynobj::do_should_include_member): New function.
5206 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
5207 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
5208 (Sized_incr_dynobj::do_section_size): New function.
5209 (Sized_incr_dynobj::do_section_name): New function.
5210 (Sized_incr_dynobj::do_section_contents): New function.
5211 (Sized_incr_dynobj::do_section_flags): New function.
5212 (Sized_incr_dynobj::do_section_entsize): New function.
5213 (Sized_incr_dynobj::do_section_address): New function.
5214 (Sized_incr_dynobj::do_section_type): New function.
5215 (Sized_incr_dynobj::do_section_link): New function.
5216 (Sized_incr_dynobj::do_section_info): New function.
5217 (Sized_incr_dynobj::do_section_addralign): New function.
5218 (Sized_incr_dynobj::do_initialize_xindex): New function.
5219 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
5220 (make_sized_incremental_object): New function.
5221 (Incremental_library::copy_unused_symbols): New function.
5222 (Incremental_library::do_for_all_unused_symbols): New function.
5223 * incremental.h (enum Incremental_input_flags): New type.
5224 (class Incremental_checker): Remove.
5225 (Incremental_input_entry::Incremental_input_entry): Add argument
5227 (Incremental_input_entry::arg_serial): New function.
5228 (Incremental_input_entry::set_is_in_system_directory): New function.
5229 (Incremental_input_entry::is_in_system_directory): New function.
5230 (Incremental_input_entry::arg_serial_): New data member.
5231 (Incremental_input_entry::is_in_system_directory_): New data member.
5232 (class Script_info): Move here from script.h.
5233 (Script_info::Script_info): Add filename parameter.
5234 (Script_info::filename): New function.
5235 (Script_info::filename_): New data member.
5236 (Incremental_script_entry::Incremental_script_entry): Add argument
5238 (Incremental_object_entry::Incremental_object_entry): Likewise.
5239 (Incremental_object_entry::add_input_section): Build list of input
5240 sections with map to original shndx.
5241 (Incremental_object_entry::get_input_section_index): New function.
5242 (Incremental_object_entry::shndx_): New data member.
5243 (Incremental_object_entry::name_key_): Rename; adjust all refs.
5244 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
5245 (Incremental_archive_entry::Incremental_archive_entry): Add argument
5247 (Incremental_inputs::report_archive_begin): Likewise.
5248 (Incremental_inputs::report_object): Likewise.
5249 (Incremental_inputs::report_script): Likewise.
5250 (class Incremental_global_symbol_reader): New class.
5251 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
5252 and store flags and input file type.
5253 (Incremental_input_entry_reader::arg_serial): New function.
5254 (Incremental_input_entry_reader::type): Extract type from flags.
5255 (Incremental_input_entry_reader::is_in_system_directory): New function.
5256 (Incremental_input_entry_reader::get_input_section_count): Call
5257 accessor function for type.
5258 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
5259 function for type; adjust size of global symbol entry.
5260 (Incremental_input_entry_reader::get_global_symbol_count): Call
5261 accessor function for type.
5262 (Incremental_input_entry_reader::get_object_count): Likewise.
5263 (Incremental_input_entry_reader::get_object_offset): Likewise.
5264 (Incremental_input_entry_reader::get_member_count): Likewise.
5265 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
5266 (Incremental_input_entry_reader::get_member_offset): Likewise.
5267 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
5268 (Incremental_input_entry_reader::Global_symbol_info): Remove.
5269 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
5270 (Incremental_input_entry_reader::get_global_symbol_reader): New
5272 (Incremental_input_entry_reader::get_output_symbol_index): New
5274 (Incremental_input_entry_reader::type_): Remove.
5275 (Incremental_input_entry_reader::flags_): New data member.
5276 (Incremental_inputs_reader::input_file_offset): New function.
5277 (Incremental_inputs_reader::input_file_index): New function.
5278 (Incremental_inputs_reader::input_file): Call input_file_offset.
5279 (Incremental_inputs_reader::input_file_at_offset): New function.
5280 (Incremental_relocs_reader::get_r_type): Reformat.
5281 (Incremental_relocs_reader::get_r_shndx): Reformat.
5282 (Incremental_relocs_reader::get_r_offset): Reformat.
5283 (Incremental_relocs_reader::data): New function.
5284 (Incremental_binary::Incremental_binary): Initialize new data members.
5285 (Incremental_binary::check_inputs): Add cmdline parameter.
5286 (Incremental_binary::file_is_unchanged): Remove.
5287 (Input_reader::arg_serial): New function.
5288 (Input_reader::get_unused_symbol_count): New function.
5289 (Input_reader::get_unused_symbol): New function.
5290 (Input_reader::do_arg_serial): New function.
5291 (Input_reader::do_get_unused_symbol_count): New function.
5292 (Input_reader::do_get_unused_symbol): New function.
5293 (Incremental_binary::input_file_count): New function.
5294 (Incremental_binary::get_input_reader): Change signature to use
5295 index instead of filename.
5296 (Incremental_binary::file_has_changed): New function.
5297 (Incremental_binary::get_input_argument): New function.
5298 (Incremental_binary::get_library): New function.
5299 (Incremental_binary::get_script_info): New function.
5300 (Incremental_binary::init_layout): New function.
5301 (Incremental_binary::reserve_layout): New function.
5302 (Incremental_binary::output_file): New function.
5303 (Incremental_binary::do_check_inputs): New function.
5304 (Incremental_binary::do_file_is_unchanged): Remove.
5305 (Incremental_binary::do_file_has_changed): New function.
5306 (Incremental_binary::do_init_layout): New function.
5307 (Incremental_binary::do_reserve_layout): New function.
5308 (Incremental_binary::do_input_file_count): New function.
5309 (Incremental_binary::do_get_input_reader): Change signature.
5310 (Incremental_binary::input_args_map_): New data member.
5311 (Incremental_binary::library_map_): New data member.
5312 (Incremental_binary::script_map_): New data member.
5313 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5315 (Sized_incremental_binary::output_section): New function.
5316 (Sized_incremental_binary::inputs_reader): Add const.
5317 (Sized_incremental_binary::symtab_reader): Add const.
5318 (Sized_incremental_binary::relocs_reader): Add const.
5319 (Sized_incremental_binary::got_plt_reader): Add const.
5320 (Sized_incremental_binary::get_symtab_view): New function.
5321 (Sized_incremental_binary::Inputs_reader): New typedef.
5322 (Sized_incremental_binary::Input_entry_reader): New typedef.
5323 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
5324 (Sized_incremental_binary::do_file_is_unchanged): Remove.
5325 (Sized_incremental_binary::do_file_has_changed): New function.
5326 (Sized_incremental_binary::do_init_layout): New function.
5327 (Sized_incremental_binary::do_reserve_layout): New function.
5328 (Sized_input_reader::Inputs_reader): Remove.
5329 (Sized_input_reader::Input_entry_reader): Remove.
5330 (Sized_input_reader::do_arg_serial): New function.
5331 (Sized_input_reader::do_get_unused_symbol_count): New function.
5332 (Sized_input_reader::do_get_unused_symbol): New function.
5333 (Sized_incremental_binary::do_input_file_count): New function.
5334 (Sized_incremental_binary::do_get_input_reader): Change signature;
5335 use index instead of filename.
5336 (Sized_incremental_binary::section_map_): New data member.
5337 (Sized_incremental_binary::input_entry_readers_): New data member.
5338 (class Sized_incr_relobj): New class.
5339 (class Sized_incr_dynobj): New class.
5340 (make_sized_incremental_object): New function.
5341 (class Incremental_library): New class.
5342 * layout.cc (Free_list::num_lists): New static data member.
5343 (Free_list::num_nodes): New static data member.
5344 (Free_list::num_removes): New static data member.
5345 (Free_list::num_remove_visits): New static data member.
5346 (Free_list::num_allocates): New static data member.
5347 (Free_list::num_allocate_visits): New static data member.
5348 (Free_list::init): New function.
5349 (Free_list::remove): New function.
5350 (Free_list::allocate): New function.
5351 (Free_list::dump): New function.
5352 (Free_list::print_stats): New function.
5353 (Layout_task_runner::run): Resize output file for incremental updates.
5354 (Layout::Layout): Initialize new data members.
5355 (Layout::set_incremental_base): New function.
5356 (Layout::init_fixed_output_section): New function.
5357 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
5358 incremental updates.
5359 (Layout::create_gold_note): Do not create gold note section for
5360 incremental updates.
5361 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
5362 for incremental updates.
5363 (Layout::set_section_offsets): For incremental updates, allocate space
5365 (Layout::create_symtab_sections): Layout with offsets relative to
5366 start of section; for incremental updates, allocate space from free
5368 (Layout::create_shdrs): For incremental updates, allocate space from
5370 (Layout::finish_dynamic_section): For incremental updates, do not
5371 check --as-needed (fixed in subsequent patch).
5372 * layout.h (class Free_list): New class.
5373 (Layout::set_incremental_base): New function.
5374 (Layout::incremental_base): New function.
5375 (Layout::init_fixed_output_section): New function.
5376 (Layout::allocate): New function.
5377 (Layout::incremental_base_): New data member.
5378 (Layout::free_list_): New data member.
5379 * main.cc (main): Print Free_list statistics.
5380 * object.cc (Relobj::finalize_incremental_relocs): Add
5381 clear_counts parameter; clear counts only when clear_counts is set.
5382 (Sized_relobj::Sized_relobj): Initialize new base class.
5383 (Sized_relobj::do_layout): Don't report special sections.
5384 (Sized_relobj::do_for_all_local_got_entries): New function.
5385 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
5386 symtab_off to all symbol table offsets.
5387 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
5388 * object.h (class Got_offset_list): Move to top of file.
5389 (Object::Object): Allow case where input_file == NULL.
5390 (Object::~Object): Likewise.
5391 (Object::input_file): Assert that input_file != NULL.
5392 (Object::lock): Allow case where input_file == NULL.
5393 (Object::unlock): Likewise.
5394 (Object::is_locked): Likewise.
5395 (Object::token): Likewise.
5396 (Object::release): Likewise.
5397 (Object::is_incremental): New function.
5398 (Object::get_mtime): New function.
5399 (Object::for_all_local_got_entries): New function.
5400 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
5401 (Object::set_is_in_system_directory): New function.
5402 (Object::is_in_system_directory): New function.
5403 (Object::do_is_incremental): New function.
5404 (Object::do_get_mtime): New function.
5405 (Object::do_for_all_local_got_entries): New function.
5406 (Object::is_in_system_directory_): New data member.
5407 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
5408 (class Sized_relobj_base): New class.
5409 (class Sized_relobj): Derive from Sized_relobj_base.
5410 (class Sized_relobj::Symbols): Redeclare from base class.
5411 (class Sized_relobj::local_got_offset_list): Remove.
5412 (class Sized_relobj::Output_sections): Redeclare from base class.
5413 (class Sized_relobj::do_for_all_local_got_entries): New function.
5414 (class Sized_relobj::write_local_symbols): Add offset parameter.
5415 (class Sized_relobj::local_symbol_offset_): Update comment.
5416 (class Sized_relobj::local_dynsym_offset_): Update comment.
5417 * options.cc (Input_arguments::add_file): Remove const.
5418 * options.h (Input_file_argument::Input_file_argument):
5419 Initialize arg_serial_ (all constructors).
5420 (Input_file_argument::set_arg_serial): New function.
5421 (Input_file_argument::arg_serial): New function.
5422 (Input_file_argument::arg_serial_): New data member.
5423 (Input_arguments::Input_arguments): Initialize file_count_.
5424 (Input_arguments::add_file): Remove const.
5425 (Input_arguments::number_of_input_files): New function.
5426 (Input_arguments::file_count_): New data member.
5427 (Command_line::number_of_input_files): Call
5428 Input_arguments::number_of_input_files.
5429 * output.cc (Output_segment_headers::Output_segment_headers):
5431 (Output_section::Input_section::current_data_size): New function.
5432 (Output_section::Output_section): Initialize new data members.
5433 (Output_section::add_input_section): Don't do merge sections for
5434 an incremental link; allocate space from free list for an
5436 (Output_section::add_output_section_data): Allocate space from
5437 free list for an incremental update.
5438 (Output_section::update_data_size): New function.
5439 (Output_section::set_fixed_layout): New function.
5440 (Output_section::reserve): New function.
5441 (Output_segment::set_section_addresses): Remove const.
5442 (Output_segment::set_section_list_addresses): Remove const; allocate
5443 space from free list for an incremental update.
5444 (Output_segment::set_offset): Adjust size of RELRO segment for an
5446 * output.h (Output_data::current_data_size): Move here from
5448 (Output_data::pre_finalize_data_size): New function.
5449 (Output_data::update_data_size): New function.
5450 (Output_section_headers::update_data_size): new function.
5451 (Output_section_data_build::current_data_size): Move to Output_data.
5452 (Output_data_strtab::update_data_size): New function.
5453 (Output_section::current_data_size): Move to Output_data.
5454 (Output_section::set_fixed_layout): New function.
5455 (Output_section::has_fixed_layout): New function.
5456 (Output_section::reserve): New function.
5457 (Output_section::update_data_size): New function.
5458 (Output_section::has_fixed_layout_): New data member.
5459 (Output_section::free_list_): New data member.
5460 (Output_segment::set_section_addresses): Remove const.
5461 (Output_segment::set_section_list_addresses): Remove const.
5462 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
5464 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
5466 * readsyms.cc (Read_symbols::do_read_symbols): Add library
5467 parameter when calling Add_symbols constructor; store argument
5468 serial number for members of a lib group.
5469 (Add_symbols::locks): Allow case where token == NULL.
5470 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
5471 (Read_member::~Read_member): New function.
5472 (Read_member::is_runnable): New function.
5473 (Read_member::locks): New function.
5474 (Read_member::run): New function.
5475 (Check_script::~Check_script): New function.
5476 (Check_script::is_runnable): New function.
5477 (Check_script::locks): New function.
5478 (Check_script::run): New function.
5479 (Check_library::~Check_library): New function.
5480 (Check_library::is_runnable): New function.
5481 (Check_library::locks): New function.
5482 (Check_library::run): New function.
5483 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
5484 (Add_symbols::library_): New data member.
5485 (class Read_member): New class.
5486 (class Check_script): New class.
5487 (class Check_library): New class.
5488 * reloc.cc (Read_relocs::is_runnable): Allow case where
5490 (Read_relocs::locks): Likewise.
5491 (Scan_relocs::locks): Likewise.
5492 (Relocate_task::locks): Likewise.
5493 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
5495 (Sized_relobj::incremental_relocs_scan): Fix comment.
5496 (Sized_relobj::do_relocate): Pass output file offset to
5497 write_local_symbols.
5498 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
5499 from class declaration.
5500 * script.cc (read_input_script): Allocate Script_info; pass
5501 argument serial number to report_script.
5502 * script.h (class Script_info): Move to incremental.h.
5503 * symtab.cc (Symbol_table::add_from_incrobj): New function.
5504 * symtab.h (Symbol_table::add_from_incrobj): New function.
5505 (Symbol_table::set_file_offset): New function.
5507 2011-04-05 Cary Coutant <ccoutant@google.com>
5509 * incremental-dump.cc (dump_incremental_inputs): Change signature
5510 to take a Sized_incremental_binary; change caller. Use readers
5511 in Sized_incremental_binary.
5513 (Sized_incremental_binary::find_incremental_inputs_sections):
5514 Rename do_find_incremental_inputs_sections to this.
5515 (Sized_incremental_binary::setup_readers): New function.
5516 (Sized_incremental_binary::do_check_inputs): Check
5517 has_incremental_info_ flag; move setup code to setup_readers;
5519 (Sized_incremental_binary::do_file_is_unchanged): New function.
5520 (Sized_incremental_binary::do_get_input_reader): New function.
5521 * incremental.h (class Incremental_binary): Move to end of file.
5522 (Incremental_binary::file_is_unchanged): New function.
5523 (Incremental_binary::do_file_is_unchanged): New function.
5524 (Incremental_binary::Input_reader): New class.
5525 (Incremental_binary::get_input_reader): New function.
5526 (class Sized_incremental_binary): Move to end of file.
5527 (Sized_incremental_binary::Sized_incremental_binary): Setup the
5528 input section reader classes.
5529 (Sized_incremental_binary::has_incremental_info): New function.
5530 (Sized_incremental_binary::inputs_reader): New function.
5531 (Sized_incremental_binary::symtab_reader): New function.
5532 (Sized_incremental_binary::relocs_reader): New function.
5533 (Sized_incremental_binary::got_plt_reader): New function.
5534 (Sized_incremental_binary::do_file_is_unchanged): New function.
5535 (Sized_incremental_binary::Sized_input_reader): New class.
5536 (Sized_incremental_binary::get_input_reader): New function.
5537 (Sized_incremental_binary::find_incremental_inputs_sections):
5538 Rename do_find_incremental_inputs_sections to this.
5539 (Sized_incremental_binary::setup_readers): New function.
5540 (Sized_incremental_binary::has_incremental_info_): New data member.
5541 (Sized_incremental_binary::inputs_reader_): New data member.
5542 (Sized_incremental_binary::symtab_reader_): New data member.
5543 (Sized_incremental_binary::relocs_reader_): New data member.
5544 (Sized_incremental_binary::got_plt_reader_): New data member.
5545 (Sized_incremental_binary::current_input_file_): New data member.
5547 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
5550 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
5553 2011-03-30 Cary Coutant <ccoutant@google.com>
5555 * archive.cc (Archive::include_member): Adjust call to report_object.
5556 (Add_archive_symbols::run): Add script_info to call to
5557 report_archive_begin.
5558 (Lib_group::include_member): Adjust call to report_object.
5559 (Add_lib_group_symbols::run): Adjust call to report_object.
5560 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
5561 blocks. Add object count for script input files.
5562 * incremental.cc (Incremental_inputs::report_archive_begin): Add
5563 script_info parameter; change all callers.
5564 (Incremental_inputs::report_object): Add script_info parameter;
5566 (Incremental_inputs::report_script): Store backpointer to
5567 incremental info entry.
5568 (Output_section_incremental_inputs::set_final_data_size): Record
5569 additional information for scripts.
5570 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5571 * incremental.h (Incremental_script_entry::add_object): New function.
5572 (Incremental_script_entry::get_object_count): New function.
5573 (Incremental_script_entry::get_object): New function.
5574 (Incremental_script_entry::objects_): New data member; adjust
5576 (Incremental_inputs::report_archive_begin): Add script_info parameter.
5577 (Incremental_inputs::report_object): Add script_info parameter.
5578 (Incremental_inputs_reader::get_object_count): New function.
5579 (Incremental_inputs_reader::get_object_offset): New function.
5580 * options.cc (Input_arguments::add_file): Return reference to
5582 * options.h (Input_argument::set_script_info): New function.
5583 (Input_argument::script_info): New function.
5584 (Input_argument::script_info_): New data member; adjust all
5586 (Input_file_group::add_file): Return reference to new input argument.
5587 (Input_file_lib::add_file): Likewise.
5588 (Input_arguments::add_file): Likewise.
5589 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
5590 * script.cc (Parser_closure::Parser_closure): Add script_info
5591 parameter; adjust all callers.
5592 (Parser_closure::script_info): New function.
5593 (Parser_closure::script_info_): New data member.
5594 (read_input_script): Report scripts earlier to incremental info.
5595 (script_add_file): Set script_info in Input_argument.
5596 (script_add_library): Likewise.
5597 * script.h (Script_options::Script_info): Rewrite class.
5599 2011-03-29 Cary Coutant <ccoutant@google.com>
5601 * archive.cc (Library_base::should_include_member): Move
5602 method here from class Archive.
5603 (Archive::Archive): Initialize base class.
5604 (Archive::should_include_member): Move to base class.
5605 (Archive::do_for_all_unused_symbols): New function.
5606 (Add_archive_symbols::run): Remove redundant access to
5608 (Lib_group::Lib_group): Initialize base class.
5609 (Lib_group::do_filename): New function.
5610 (Lib_group::include_member): Pass pointer to Lib_group to
5612 (Lib_group::do_for_all_unused_symbols): New function.
5613 (Add_lib_group_symbols::run): Report archive information for
5615 * archive.h (class Library_base): New base class.
5616 (class Archive): Derive from Library_base.
5617 (Archive::filename): Move to base class.
5618 (Archive::set_incremental_info): Likewise.
5619 (Archive::incremental_info): Likewise.
5620 (Archive::Should_include): Likewise.
5621 (Archive::should_include_member): Likewise.
5622 (Archive::Armap_entry): Remove.
5623 (Archive::Unused_symbol_iterator): Remove.
5624 (Archive::unused_symbols_begin): Remove.
5625 (Archive::unused_symbols_end): Remove.
5626 (Archive::do_filename): New function.
5627 (Archive::do_get_mtime): New function.
5628 (Archive::do_for_all_unused_symbols): New function.
5629 (Archive::task_): Move to base class.
5630 (Archive::incremental_info_): Likewise.
5631 (class Lib_group): Derive from Library_base.
5632 (Lib_group::do_filename): New function.
5633 (Lib_group::do_get_mtime): New function.
5634 (Lib_group::do_for_all_unused_symbols): New function.
5635 (Lib_group::task_): Move to base class.
5636 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
5638 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
5640 * incremental.cc (Incremental_inputs::report_archive_begin):
5641 Use Library_base; call library's get_mtime; add incremental inputs
5642 entry before members.
5643 (class Unused_symbol_visitor): New class.
5644 (Incremental_inputs::report_archive_end): Use Library_base; use
5645 visitor class to record unused symbols; don't add incremental inputs
5646 entry after members.
5647 (Incremental_inputs::report_object): Use Library_base.
5649 (Incremental_archive_entry::Incremental_archive_entry): Remove
5650 unused Archive parameter.
5651 (Incremental_inputs::report_archive_begin): Use Library_base.
5652 (Incremental_inputs::report_archive_end): Likewise.
5653 (Incremental_inputs::report_object): Likewise.
5654 * object.cc (Sized_relobj::do_for_all_global_symbols): New
5656 * object.h (Object::for_all_global_symbols): New function.
5657 (Object::do_for_all_global_symbols): New function.
5658 (Sized_relobj::do_for_all_global_symbols): New function.
5659 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
5661 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
5664 2011-03-27 Ian Lance Taylor <iant@google.com>
5666 * archive.cc (Archive::interpret_header): Return -1 if something
5667 goes wrong. Change callers accordingly.
5669 2011-03-25 Cary Coutant <ccoutant@google.com>
5671 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
5672 * testsuite/Makefile.in: Regenerate.
5674 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
5676 * plugin.cc (get_view): New.
5677 (Plugin::load): Pass get_view to the plugin.
5678 (Plugin_manager::get_view): New.
5680 2011-03-21 Ian Lance Taylor <iant@google.com>
5682 * testsuite/final_layout.sh: Rewrite to not use dc.
5683 * testsuite/relro_test.sh: Fail if dc is not present.
5685 2011-03-21 Sriraman Tallam <tmsriram@google.com>
5687 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
5689 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
5690 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
5692 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
5693 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
5695 2011-03-14 Ian Lance Taylor <iant@google.com>
5697 * script-sections.cc (Sort_output_sections::script_compare):
5698 Rename from is_before, change return type.
5699 (Sort_output_sections::operator()): Adjust accordingly.
5701 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
5704 * testsuite/odr_violation2.cc: Add comment to make all error line
5705 numbers double digits.
5706 * testsuite/debug_msg.sh: Adjust expected errors.
5708 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
5710 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
5711 but mark earlier ones as non-canonical
5712 (offset_to_iterator): Update search target and example
5713 (do_addr2line): Return extra lines in a vector*
5714 (format_file_lineno): Extract from do_addr2line
5715 (one_addr2line): Add vector* out-param
5716 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
5717 when a lineno entry appeared last for its instruction
5718 (Dwarf_line_info): Add vector* out-param
5719 * object.cc (Relocate_info): Pass NULL for the vector* out-param
5720 * symtab.cc (Odr_violation_compare): Include the lineno in the
5722 (linenos_from_loc): New. Combine the canonical line for an
5723 address with its other lines.
5724 (True_if_intersect): New. Helper functor to make
5725 std::set_intersection a query.
5726 (detect_odr_violations): Compare sets of lines instead of just
5727 one line for each function. This became less deterministic, but
5728 has fewer false positives.
5729 * symtab.h: Declarations.
5730 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
5731 mix an optimized and non-optimized object in the same binary
5732 (odr_violation2.so): Same.
5733 * testsuite/Makefile.in: Regenerate from Makefile.am.
5734 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
5735 * testsuite/debug_msg.sh: Update line numbers and add
5737 * testsuite/odr_violation1.cc: Use OdrDerived, in a
5738 non-optimized context.
5739 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
5740 isn't inlined, and use OdrDerived in an optimized context.
5741 * testsuite/odr_header1.h: Defines OdrDerived, where
5742 optimization will change the
5743 first-instruction-in-the-destructor's file and line number.
5744 * testsuite/odr_header2.h: Defines OdrBase.
5746 2011-03-09 Ian Lance Taylor <iant@google.com>
5748 * fileread.cc (File_read::clear_views): Don't delete the whole
5751 2011-03-08 Ian Lance Taylor <iant@google.com>
5754 * fileread.cc: #include <climits>.
5755 (GOLD_IOV_MAX): Define.
5756 (File_read::read_multiple): Limit number of entries by iov_max.
5757 * fileread.h (class File_read): Always set max_readv_entries to
5760 2011-03-07 Ian Lance Taylor <iant@google.com>
5763 * options.h (class General_options): Add -dy and -dn.
5765 2011-03-02 Cary Coutant <ccoutant@google.com>
5767 * testsuite/script_test_9.t: Add TLS segment.
5769 2011-03-02 Simon Baldwin <simonb@google.com>
5771 * configure.ac: Add check for gnu_indirect_function support in
5772 the toolchain building binutils.
5773 * configure: Rebuild.
5775 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
5777 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
5778 plugin only symbols.
5779 (Symbol_table::sized_finalize_symbol) Mark symbol only present
5780 in plugin files as not needed in the symbol table.
5782 2011-02-11 Sriraman Tallam <tmsriram@google.com>
5784 * output.cc (Output_section::add_input_section): Delay fill
5785 generation for section ordering.
5787 2011-02-09 Ian Lance Taylor <iant@google.com>
5790 * object.h (class Sized_relobj): Remove clear_local_symbols.
5791 * reloc.cc (Sized_relobj::do_relocate): Don't call
5792 clear_local_symbols.
5794 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
5796 * plugin.cc (is_visible_from_outside): Return true for symbols
5799 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
5801 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
5804 2011-02-02 Sriraman Tallam <tmsriram@google.com>
5806 * icf.h (is_section_foldable_candidate): Change type of parameter
5808 * icf.cc (Icf::find_identical_sections): Change type of local variable
5809 section_name to be std::string.
5810 (is_function_ctor_or_dtor): Change type of parameter to std::string.
5812 2011-01-25 Ian Lance Taylor <iant@google.com>
5814 * script.cc (script_add_extern): Rewrite to use
5815 add_symbol_reference.
5817 2011-01-25 Doug Kwan <dougkwan@google.com>
5819 * icf.cc (get_section_contents): Always lock section's object.
5821 2011-01-24 Ian Lance Taylor <iant@google.com>
5823 * options.h (class General_options): Accept
5824 --no-detect-odr-violations.
5826 2011-01-24 Ian Lance Taylor <iant@google.com>
5828 * version.cc (version_string): Bump to 1.11.
5830 2011-01-24 Ian Lance Taylor <iant@google.com>
5832 * plugin.cc (class Plugin_rescan): Define new class.
5833 (Plugin_manager::claim_file): Set any_claimed_.
5834 (Plugin_manager::save_archive): New function.
5835 (Plugin_manager::save_input_group): New function.
5836 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
5838 (Plugin_manager::new_undefined_symbol): New function.
5839 (Plugin_manager::rescan): New function.
5840 (Plugin_manager::rescannable_defines): New function.
5841 (Plugin_manager::add_input_file): Set any_added_.
5842 * plugin.h (class Plugin_manager): define new fields rescannable_,
5843 undefined_symbols_, any_claimed_, and any_added_. Declare
5844 Plugin_rescan as friend. Declare new functions.
5845 (Plugin_manager::Rescannable): Define type.
5846 (Plugin_manager::Rescannable_list): Define type.
5847 (Plugin_manager::Undefined_symbol_list): Define type.
5848 (Plugin_manager::Plugin_manager): Initialize new fields.
5849 * archive.cc (Archive::defines_symbol): New function.
5850 (Add_archive_symbols::run): Pass archive to plugins if any.
5851 * archive.h (class Archive): Declare defines_symbol.
5852 * readsyms.cc (Input_group::~Input_group): New function.
5853 (Finish_group::run): Pass input_group to plugins if any.
5854 * readsyms.h (class Input_group): Declare destructor.
5855 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
5858 2011-01-10 Ian Lance Taylor <iant@google.com>
5860 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
5862 (Layout::set_segment_offsets): Reset increase_relro before calling
5863 set_section_addresses a second time.
5865 2011-01-04 Cary Coutant <ccoutant@google.com>
5867 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
5868 sections before NOBITS sections.
5870 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
5872 * version.cc (print_version): Update copyright to 2011.
5874 2010-12-23 Cary Coutant <ccoutant@google.com>
5876 * output.h (Output_data_reloc::add_output_section): Pass OD instead
5877 of OS to this->add. Add OD parameter to second form of the function.
5879 2010-12-20 Ian Lance Taylor <iant@google.com>
5881 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
5882 second of two consecutive entries with same offset.
5884 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5886 * testsuite/Makefile.am (ifuncmain2static_LDADD)
5887 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
5888 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
5889 to avoid unneeded links against $(LDADD).
5890 * testsuite/Makefile.in: Regenerate.
5892 2010-12-15 Ian Lance Taylor <iant@google.com>
5895 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
5896 for R_X86_64_32 and R_X86_64_PC32.
5897 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
5898 ver_matching_def_pic.o.
5899 (ver_matching_def_pic.o): New target.
5901 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5903 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
5904 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
5905 Move definition before File_read::View member definitions.
5906 (File_read::View::~View): Initialize and hold lock before
5907 updating current_mapped_bytes.
5909 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5911 * dwarf_reader.cc: Remove outdated comment.
5912 * gold-threads.cc: Fix typo in error message.
5913 * archive.cc: Fix typos in comments.
5914 * archive.h: Likewise.
5915 * arm-reloc-property.cc: Likewise.
5916 * arm-reloc-property.h: Likewise.
5917 * arm-reloc.def: Likewise.
5919 * attributes.h: Likewise.
5920 * cref.cc: Likewise.
5921 * ehframe.cc: Likewise.
5922 * fileread.h: Likewise.
5924 * i386.cc: Likewise.
5926 * incremental.h: Likewise.
5927 * int_encoding.cc: Likewise.
5928 * layout.h: Likewise.
5929 * main.cc: Likewise.
5930 * merge.h: Likewise.
5931 * object.cc: Likewise.
5932 * object.h: Likewise.
5933 * options.cc: Likewise.
5934 * readsyms.cc: Likewise.
5935 * reduced_debug_output.cc: Likewise.
5936 * reloc.cc: Likewise.
5937 * script-sections.cc: Likewise.
5938 * sparc.cc: Likewise.
5939 * symtab.h: Likewise.
5940 * target-reloc.h: Likewise.
5941 * target.cc: Likewise.
5942 * target.h: Likewise.
5943 * timer.cc: Likewise.
5944 * timer.h: Likewise.
5945 * x86_64.cc: Likewise.
5947 2010-12-09 Cary Coutant <ccoutant@google.com>
5949 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
5951 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
5952 parameter; change all callers.
5953 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
5954 * options.h (warn_execstack): New option.
5956 2010-12-07 Doug Kwan <dougkwan@google.com>
5958 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
5959 like function call relocations.
5961 2010-12-07 Ian Lance Taylor <iant@google.com>
5963 * archive.cc (Archive::get_elf_object_for_member): Permit
5964 punconfigured to be NULL.
5965 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
5966 (Archive::include_member): Pass NULL to get_elf_object_for_member
5967 if we searched for the archive and this is the first included
5970 2010-12-01 Ian Lance Taylor <iant@google.com>
5972 * dwarf_reader.h (class Sized_dwarf_line_info): Add
5973 track_relocs_type_ field.
5974 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5975 Set track_relocs_type_.
5976 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
5977 contents when using RELA relocs.
5978 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
5980 * reloc.cc (Track_relocs::next_addend): New function.
5981 * reloc.h (class Track_relocs): Declare next_addend.
5983 2010-12-01 Ian Lance Taylor <iant@google.com>
5985 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
5988 2010-12-01 Ian Lance Taylor <iant@google.com>
5990 * README: Update compilers known to work and fail.
5992 2010-11-23 Matthias Klose <doko@ubuntu.com>
5994 * configure.in: For --enable-gold, handle value `default' instead of
5995 `both*'. Always install ld as ld.bfd, install as ld if gold is
5997 * configure: Regenerate.
5999 2010-11-18 Doug Kwan <dougkwan@google.com>
6001 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6002 and right_alignment to be zero. Store result alignment only if it is
6003 greater than existing alignment.
6005 2010-11-16 Cary Coutant <ccoutant@google.com>
6008 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6009 Check for ".zdebug_line".
6011 2010-11-16 Doug Kwan <dougkwan@google.com>
6012 Cary Coutant <ccoutant@google.com>
6014 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6015 by reference; adjust all callers.
6016 * output.cc (Output_segment::set_section_addresses): Adjust references
6017 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6019 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6020 end at page boundary.
6022 2010-11-16 Cary Coutant <ccoutant@google.com>
6025 * layout.cc (Layout::choose_output_section): Transform names of
6026 compressed sections even when using a script with a SECTIONS clause.
6027 (Layout::output_section_name): Remove code to transform
6028 compressed debug section names.
6029 * output.cc (Output_section::add_input_section): Use uncompressed
6030 section size when tracking input sections.
6032 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6034 * symtab.h (Symbol::NON_PIC_REF): Remove.
6035 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6036 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6037 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6038 (Symbol::use_plt_offset): Take a flags argument and pass it
6039 directly to needs_dynamic_reloc. Restrict check for undefined
6040 weak symbols to function calls.
6041 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6042 (Target_arm::Scan::global): Use it.
6043 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6044 (Target_arm::Relocate::relocate): Likewise.
6045 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6046 parameter with an r_type parameter. Use get_reference_flags
6048 (Target_arm::Relocate::relocate): Update accordingly.
6049 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6050 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6051 (Target_i386::Scan::global): Likewise.
6052 (Target_i386::Relocate::relocate): Likewise.
6053 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6054 parameter with an r_type parameter. Use get_reference_flags
6056 (Target_i386::Relocate::relocate): Update accordingly.
6057 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6058 (Target_powerpc::Scan::global): Use it.
6059 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6060 (Target_powerpc::Relocate::relocate): Likewise.
6061 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6062 (Target_sparc::Scan::global): Use it.
6063 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6064 (Target_sparc::Relocate::relocate): Likewise.
6065 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6066 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6067 (Target_x86_64::Scan::global): Likewise.
6068 (Target_x86_64::Relocate::relocate): Likewise.
6070 2010-11-08 Doug Kwan <dougkwan@google.com>
6071 Cary Coutant <ccoutant@google.com>
6073 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6074 (Arm_exidx_merge_section::section_contents_): New data member.
6075 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6076 (Arm_input_section::~Arm_input_section): De-allocate memory.
6077 (Arm_input_section::original_contents_): New data member.
6078 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6079 in parameters instead of calling Object::section_contents without
6081 (Arm_output_section::group_section): New parameter TASK. Pass it
6082 to callees that need locking objects.
6083 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6084 to lock EXIDX input sections. Fix a formatting issue. Call
6085 Arm_exidx_merged_section::build_contents to create merged section
6087 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6088 to lock object of stub table owner.
6089 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6090 TEXT_SIZE to initialize data member TEXT_SIZE_.
6091 (Arm_exidx_input_section::addralign): Fix typo in comment.
6092 (Arm_exidx_input_section::text_size): New method.
6093 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6094 that require locking objects. Lock objects before scanning for stubs
6095 and updating local symbols.
6096 (Arm_input_section<big_endian>::init): Copy contents of original
6098 (Arm_input_section<big_endian>::do_write): Use saved contents of
6099 original input section instead of calling Object::section_contents
6101 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6102 size without calling Object::section_size().
6103 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6104 for size. Allocate a buffer for merged EXIDX entries.
6105 (Arm_exidx_merged_section::build_contents): New method.
6106 (Arm_exidx_merged_section::do_write): Move merge section contents
6107 building code to Arm_exidx_merged_section::build_contetns. Write
6108 out contetns in buffer instead of building it on the fly.
6109 (Arm_relobj::make_exidx_input_section): Also pass text section size
6110 to Arm_exidx_input_section constructor.
6111 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6112 (Arm_dynobj::do_read_symbols): Fix memory leak.
6113 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6114 * target.h: (class Task): Add forward declaration.
6115 (Target::relax): Add new parameter TASK and pass it to
6117 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6119 2010-11-05 Cary Coutant <ccoutant@google.com>
6122 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6123 object when reading from the file.
6124 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6126 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6127 when reading section contents.
6128 (get_section_contents): Likewise.
6129 (icf::find_identical_sections): Likewise.
6130 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6131 object when reading from the file.
6132 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
6133 the object when doing deferred section layout.
6135 2010-11-03 Nick Clifton <nickc@redhat.com>
6138 * script.h (class Symbol_assignment: name): New member. Returns
6139 the name of the symbol.
6140 * scrfipt.cc (Script_options::is_pending_assignment): New member.
6141 Returns true if the given symbol name is on the list of
6142 assignments wating to be processed.
6143 * archive.cc (should_incldue_member): If the symbol is undefined,
6144 check to see if it is on the list of symbols pending assignment.
6146 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6148 * script-sections.cc (Script_sections::find_memory_region): Check
6149 for a NULL output section pointer.
6151 2010-10-29 Doug Kwan <dougkwan@google.com>
6153 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6154 Output_section::add_relaxed_input_section.
6155 * output.cc (Output_section::add_relaxed_input_section): Add new
6156 arguments LAYOUT and NAME. Set section order index.
6157 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6158 Copy section order index.
6159 * output.h (Output_section::add_relaxed_input_section): Add new
6160 arguments LAYOUT and NAME.
6162 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6164 * testsuite/Makefile.am: Move gcctestdir/ld rule to
6165 NATIVE_OR_CROSS_LINKER.
6166 * testsuite/Makefile.in: Regenerate.
6168 2010-10-20 Doug Kwan <dougkwan@google.com>
6170 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
6171 without SHF_LINK_ORDER flags.
6172 * layout.cc (Layout::choose_output_section): Do not filter
6173 SHF_LINK_ORDER flag in a relocatable link.
6175 2010-10-17 Cary Coutant <ccoutant@google.com>
6177 * output.h (Output_segment::set_section_addresses): Change function
6178 signature. Update all callers.
6179 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
6181 (Output_segment::set_section_addresses): Align after last TLS
6182 section. Add padding before last relro section instead of after.
6184 2010-10-17 Doug Kwan <dougkwan@google.com>
6186 * gold/arm.cc (Target_arm::got_section): Use correct order and set
6187 GOT output section to be writable.
6189 2010-10-14 Cary Coutant <ccoutant@google.com>
6191 * debug.h (DEBUG_INCREMENTAL): New flag.
6192 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
6193 * gold.cc (queue_initial_tasks): Check parameters for incremental link
6195 * incremental.cc (report_command_line): Ignore all forms of
6197 * layout.cc (Layout::Layout): Check parameters for incremental link
6199 * options.cc (General_options::parse_incremental): New function.
6200 (General_options::parse_no_incremental): New function.
6201 (General_options::parse_incremental_full): New function.
6202 (General_options::parse_incremental_update): New function.
6203 (General_options::incremental_mode_): New data member.
6204 (General_options::finalize): Check incremental_mode_.
6205 * options.h (General_options): Update help text for --incremental.
6206 Add --no-incremental, --incremental-full, --incremental-update.
6207 (General_options::Incremental_mode): New enum type.
6208 (General_options::incremental_mode): New function.
6209 (General_options::incremental_mode_): New data member.
6210 * parameters.cc (Parameters::incremental_mode_): New data member.
6211 (Parameters::set_options): Set incremental_mode_.
6212 (Parameters::set_incremental_full): New function.
6213 (Parameters::incremental): New function.
6214 (Parameters::incremental_update): New function.
6215 (set_parameters_incremental_full): New function.
6216 * parameters.h (Parameters::set_incremental_full): New function.
6217 (Parameters::incremental): New function.
6218 (Parameters::incremental_update): New function.
6219 (Parameters::incremental_mode_): New data member.
6220 (set_parameters_incremental_full): New function.
6221 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
6222 incremental link mode.
6223 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
6224 (Sized_relobj::do_relocate_sections): Likewise.
6225 * testsuite/Makefile.am (incremental_test): Use --incremental-full
6227 * testsuite/Makefile.in: Regenerate.
6228 * testsuite/incremental_test.sh: Filter all forms of --incremental.
6230 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6232 * script-sections.h (class Script_sections): Make
6233 Sections_elements typedef public.
6234 * script-sections.cc (class Sort_output_sections): Add elements_
6235 field. Add constructor which sets it; change all callers.
6236 (Sort_output_sections::is_before): New function.
6237 (Sort_output_sections::operator()): Call is_before.
6238 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
6240 * testsuite/script_test_10.sh: New test. Test script section
6242 * testsuite/script_test_10.t: Likewise.
6243 * testsuite/script_test_10.s: Likewise.
6244 * testsuite/Makefile.am: Wrap the cross linker tests and the
6245 common tests into NATIVE_OR_CROSS_LINKER.
6246 (check_SCRIPTS): Add script_test_10.sh.
6247 (check_DATA): Add script_test_10.stdout.
6248 (script_test_10.o, script_test_10): New targets.
6249 (script_test_10.stdout): New target.
6250 * configure, testsuite/Makefile.in: Regenerate.
6252 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6254 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
6255 error for the deprecated relocations.
6256 (Target_arm::Scan::global): Likewise.
6257 (Target_arm::Relocate::relocate): Likewise.
6259 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
6261 * fileread.cc (Input_file::find_file): Initialize *found_name
6262 and *namep when using the fallback search for case 4.
6264 2010-10-11 Cary Coutant <ccoutant@google.com>
6266 * options.h (class General_options): Redefine -z lazy as an alias for
6267 the negation of -z now.
6269 2010-10-11 Ian Lance Taylor <iant@google.com>
6271 * resolve.cc (symbol_to_bits): Report the value of the unsupported
6274 2010-10-06 Nick Clifton <nickc@redhat.com>
6276 * script-sections.cc(class Memory_region): Remove
6277 current_lma_offset_ field. Rename current_vma_offset_ to
6278 current_offset_. Add last_section_ field.
6279 (Memory_region::get_current_vma_address): Rename to
6280 get_current_address.
6281 (Memory_region::get_current_lma_address): Delete.
6282 (Memory_region::increment_vma_offset): Rename to
6284 (Memory_region::increment_lma_offset): Delete.
6285 (Memory_region::attributes_compatible): New method. Returns
6286 true if the provided section is compatible with the region.
6287 (Memory_region::get_last_section): New method. Returns the last
6288 section to use the region.
6289 (Memory_region::set_last_section): New method. Stores the last
6290 section to use the region.
6291 (Script_sections::block_in_region): New method. Returns true if
6292 a block of memory is contained within a region.
6293 (Script_sections::find_memory_region): New method. Locates a
6294 memory region to be used to set a VMA or LMA address.
6295 (Output_section_definition::set_section_addresses): Add code to
6296 check for addresses set by memory regions.
6297 (Output_segment::set_section_addresses): Remove memory region
6299 (Script_sections::create_segment): Add a warning if a header
6300 segment is created outside of any region.
6301 * script-sections.h (class Script_sections): Add prototypes for
6302 find_memory_region and block_in_region methods.
6303 * testsuite/memory_test.s: Use .long instead of .word.
6304 * testsuite/memory_test.t: Add some more output sections.
6305 * testsuite/memory_test.sh: Update expected output.
6307 2010-10-02 Doug Kwan <dougkwan@google.com>
6309 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
6310 defintion to symtab.h
6311 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
6312 declaration to defintion.
6314 2010-10-01 Nick Clifton <nickc@redhat.com>
6316 * expression.cc (eval): Replace dummy argument with NULL.
6317 (eval_maybe_dot): Check for a NULL result section pointer.
6318 (Symbol_expression::value): Likewise.
6319 (Dot_expression::value): Likewise.
6320 (BINARY_EXPRESSION): Likewise.
6321 (Max_expression::value): Likewise.
6322 (Min_expression::value): Likewise.
6323 (Absolute_expression::value): Likewise.
6324 (Addr_expression::value_from_output_section): Likewise.
6325 (Loaddddr_expression::value_from_output_section): Likewise.
6326 (Segment_start_expression::value): Likewise.
6327 * script-sections.cc
6328 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
6330 (Sections_elememt_dot_assignment::set_section_addresses):
6332 (Output_data_expression::do_write_to_buffer): Likewise.
6333 (Output_section_definition::finalize_symbols): Likewise.
6334 (Output_section_definition::set_section_addresses): Likewise.
6336 2010-09-30 Doug Kwan <dougkwan@google.com>
6338 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
6340 2010-09-28 Sriraman Tallam <tmsriram@google.com>
6342 * target.h (Target::can_icf_inline_merge_sections): New virtual
6344 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
6346 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
6348 * icf.cc (get_section_contents): Inline merge sections only when
6351 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6353 * configure: Regenerate.
6355 2010-09-17 Ian Lance Taylor <iant@google.com>
6357 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
6358 * testsuite/Makefile.am (memory_test.o): New target.
6359 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
6361 * testsuite/Makefile.in: Rebuild.
6363 2010-09-17 Doug Kwan <dougkwan@google.com>
6365 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
6366 defintion if relocation uses GOT entries of the symbol.
6367 * testsuite/icf_safe_test.sh: Fix test.
6368 * testsuite/icf_safe_so_test.sh: Fix test.
6370 2010-09-16 Cary Coutant <ccoutant@google.com>
6372 * script_sections.cc (class Memory_region): Remove "NULL" from
6373 vector initializations.
6375 2010-09-15 Cary Coutant <ccoutant@google.com>
6377 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
6378 Resolve forwarding symbols.
6380 2010-09-15 Doug Kwan <dougkwan@google.com>
6382 * gold/testsuite/script_test_3.t: Add ARM special sections.
6383 * gold/testsuite/script_test_4.t: Same.
6384 * gold/testsuite/script_test_5.t: Same.
6385 * gold/testsuite/script_test_6.t: Same.
6386 * gold/testsuite/script_test_7.t: Same.
6387 * gold/testsuite/script_test_7.t: Same.
6388 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
6390 2010-09-14 Cary Coutant <ccoutant@google.com>
6392 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
6393 (Target_x86_64::Relocate::relocate_tls): Replace check for
6394 saw_tls_block_reloc_ with test for executable section.
6396 2010-09-12 Cary Coutant <ccoutant@google.com>
6398 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
6399 position-independent executables to shared libraries need dynamic
6401 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
6402 position-independent executables.
6403 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
6404 * testsuite/Makefile.in: Regenerate.
6406 2010-09-10 Nick Clifton <nickc@redhat.com>
6409 * testsuite/memory_test.t: Discard any sections that are not
6412 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
6415 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
6416 "This::" to work around a bug in gcc 4.2.
6418 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
6420 2010-09-09 Rafael Espindola <espindola@google.com>
6422 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
6423 sections with different PF_X flags in the same segment.
6424 (Layout::find_first_load_seg): Search all segments to find the first
6426 * options.h (rosegment): New.
6428 2010-09-08 Rafael Espindola <espindola@google.com>
6430 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
6432 2010-09-08 Doug Kwan <dougkwan@google.com>
6434 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
6435 (Arm_relobj::do_relocate_sections): Add new parameter for output
6436 file to match the parent.
6437 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
6438 of local symbols instead of input values. Update code to track
6439 changes in gold::relocate_section.
6440 * object.cc (Sized_relobj::compute_final_local_value): New methods.
6441 (Sized_relobj::compute_final_local_value_internal): New methods.
6442 (Sized_relobj::do_finalize_local_symbols): Move code from loop
6443 body into private version of Sized_relobj::compute_final_local_value.
6444 Call the inline method.
6445 * object.h (Symbol_value::Symbol_value): Define destructor. Free
6446 merged symbol value if there is one.
6447 (Symbol_value::has_output_value): New method defintiion.
6448 (Sized_relobj::Compute_final_local_value_status): New enum type.
6449 (Sized_relobj::compute_final_local_value): New methods.
6450 (Sized_relobj::compute_final_local_value_internal): New methods.
6451 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
6452 and arm_cortex_a8.sh.
6453 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
6454 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
6456 * Makefile.in: Regenerate.
6457 * testsuite/arm_bl_out_of_range.s: Update test.
6458 * testsuite/thumb_bl_out_of_range.s: Ditto.
6459 * testsuite/thumb_blx_out_of_range.s: Ditto.
6460 * testsuite/arm_branch_out_of_range.sh: New file.
6461 * testsuite/arm_cortex_a8.sh: Ditto.
6462 * testsuite/arm_cortex_a8_b.s: Ditto.
6463 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
6464 * testsuite/arm_cortex_a8_b_local.s: Ditto.
6465 * testsuite/arm_cortex_a8_bl.s: Ditto.
6466 * testsuite/arm_cortex_a8_blx.s: Ditto.
6467 * testsuite/arm_cortex_a8_local.s: Ditto.
6468 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
6469 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
6471 2010-09-08 Rafael Espindola <espindola@google.com>
6473 * Makefile.am (memory_test.stdout): Run readelf with -W.
6474 * Makefile.in: Regenerate.
6475 * testsuite/memory_test.sh: Make the regexps accept both 32 and
6478 2010-09-08 Rafael Espindola <espindola@google.com>
6480 * script-sections.cc (Script_sections::add_memory_region): Convert
6481 field precision to int.
6482 * script.cc (script_set_section_region, script_set_section_region):
6483 Convert field precision to int.
6485 2010-09-08 Rafael Espindola <espindola@google.com>
6487 * arm.cc (do_finalize_sections): Create the __exidx_start and
6488 __exdix_end symbols even when the section is missing.
6490 2010-09-08 Nick Clifton <nickc@redhat.com>
6492 * README: Remove claim that MEMORY is not supported.
6493 * expression.cc (script_exp_function_origin)
6494 (script_exp_function_length): Move from here to ...
6495 * script.cc: ... here.
6496 (script_set_section_region, script_add_memory)
6497 (script_parse_memory_attr, script_include_directive): New
6499 * script-sections.cc
6500 (class Memory_region): New class.
6501 (class Output_section_definition): Add set_memory_region,
6502 set_section_vma, set_section_lma and get_section_name methods.
6503 (class Script_Sections): Add add_memory_region,
6504 find_memory_region, find_memory_region_origin,
6505 find_memory_region_length and set_memory_region methods.
6506 Have set_section_addresses method walk the list of set memory
6508 Extend the print methos to display memory regions.
6509 * script-sections.h: Add prototypes for new methods.
6510 Add enum for MEMORY region attributes.
6511 * yyscript.y: Add support for parsing MEMORY regions.
6512 * script-c.h: Add prototypes for new functions.
6513 * testsuite/Makefile.am: Add test of MEMORY region functionality.
6514 * testsuite/Makefile.in: Regenerate.
6515 * testsuite/memory_test.sh: New script.
6516 * testsuite/memory_test.s: New assembler source file.
6517 * testsuite/memory_test.t: New linker script.
6519 2010-08-27 Doug Kwan <dougkwan@google.com>
6521 * gold/resolve.cc (Symbol_table::should_override): Let a weak
6522 reference override an existing dynamic weak reference.
6523 * testsuite/Makefile.am: Add new test dyn_weak_ref.
6524 * testsuite/Makefile.in: Regenerate.
6525 * testsuite/dyn_weak_ref.sh: New file.
6526 * testsuite/dyn_weak_ref_1.c: Ditto.
6527 * testsuite/dyn_weak_ref_2.c: Ditto.
6529 2010-08-27 Ian Lance Taylor <iant@google.com>
6531 * incremental.h (class Incremental_input_entry): Add virtual
6534 2010-08-27 Ian Lance Taylor <iant@google.com>
6536 * testsuite/start_lib_test_3.c: Mark t3 as used.
6538 2010-08-27 Nick Clifton <nickc@redhat.com>
6540 * options.cc (version_script): Fix small typo in previous
6543 2010-08-25 Nick Clifton <nickc@redhat.com>
6545 * archive.cc: Formatting fixes: Remove whitespace between
6546 typename and following asterisk. Remove whitespace between
6547 function name and opening parenthesis.
6548 * archive.h: Likewise.
6550 * attributes.cc: Likewise.
6551 * attributes.h: Likewise.
6552 * common.cc: Likewise.
6553 * copy-relocs.cc: Likewise.
6554 * dirsearch.h: Likewise.
6555 * dynobj.cc: Likewise.
6556 * ehframe.cc: Likewise.
6557 * ehframe.h: Likewise.
6558 * expression.cc: Likewise.
6559 * fileread.cc: Likewise.
6560 * fileread.h: Likewise.
6562 * gold-threads.cc: Likewise.
6563 * gold.cc: Likewise.
6564 * i386.cc: Likewise.
6566 * incremental-dump.cc: Likewise.
6567 * incremental.cc: Likewise.
6568 * layout.cc: Likewise.
6569 * layout.h: Likewise.
6570 * main.cc: Likewise.
6571 * merge.cc: Likewise.
6572 * merge.h: Likewise.
6573 * object.cc: Likewise.
6574 * object.h: Likewise.
6575 * options.cc: Likewise.
6576 * options.h: Likewise.
6577 * output.cc: Likewise.
6578 * output.h: Likewise.
6579 * plugin.cc: Likewise.
6580 * plugin.h: Likewise.
6581 * powerpc.cc: Likewise.
6582 * reloc.cc: Likewise.
6583 * script-c.h: Likewise.
6584 * script-sections.cc: Likewise.
6585 * script.cc: Likewise.
6586 * stringpool.cc: Likewise.
6587 * symtab.cc: Likewise.
6588 * symtab.h: Likewise.
6589 * target.cc: Likewise.
6590 * timer.cc: Likewise.
6591 * timer.h: Likewise.
6592 * version.cc: Likewise.
6593 * x86_64.cc: Likewise.
6595 2010-08-24 Nick Clifton <nickc@redhat.com>
6598 * layout.cc (segment_precedes): Sort segments by their physical
6599 addresses, if they have been set.
6601 2010-08-23 Cary Coutant <ccoutant@google.com>
6603 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
6605 (Lib_group::include_member): Unlock object after deleting its
6607 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
6610 2010-08-19 Neil Vachharajani <nvachhar@google.com>
6611 Cary Coutant <ccoutant@google.com>
6613 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
6614 constructor, and set_blocker.
6615 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
6617 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
6618 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
6619 * testsuite/Makefile.am (start_lib_test): New test case.
6620 * testsuite/Makefile.in: Regenerate.
6621 * testsuite/start_lib_test_main.c: New file.
6622 * testsuite/start_lib_test_1.c: New file.
6623 * testsuite/start_lib_test_2.c: New file.
6624 * testsuite/start_lib_test_3.c: New file.
6626 2010-08-19 Ian Lance Taylor <iant@google.com>
6628 * Makefile.in: Rebuild with automake 1.11.1.
6629 * aclocal.m4: Likewise.
6630 * testsuite/Makefile.in: Likewise.
6632 2010-08-19 Ian Lance Taylor <iant@google.com>
6635 * i386.cc (class Output_data_plt_i386): Update declarations.
6636 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
6637 local_ifuncs_ fields.
6638 (Target_i386::do_plt_section_for_global): New function.
6639 (Target_i386::do_plt_section_for_local): New function.
6640 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
6641 parameter; change all callers. Initialize global_ifuncs_ and
6642 local_ifuncs_. If doing a static link define __rel_iplt_start and
6644 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
6645 (Output_data_plt_i386::add_local_ifunc_entry): New function.
6646 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
6648 (Target_i386::make_plt_section): New function, broken out of
6649 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
6650 (Target_i386::make_plt_entry): Call make_plt_section.
6651 (Target_i386::make_local_ifunc_plt_entry): New function.
6652 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
6653 (Target_i386::Scan::local): Handle IFUNC symbols. Add
6654 R_386_IRELATIVE to switch.
6655 (Target_i386::Scan::global): Likewise.
6656 (Target_i386::Relocate::relocate): Likewise.
6657 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
6659 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
6660 (Target_x86_64::do_plt_section_for_global): New function.
6661 (Target_x86_64::do_plt_section_for_local): New function.
6662 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
6663 parameter; change all callers. If doing a static link define
6664 __rela_iplt_start and __rela_iplt_end.
6665 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
6666 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
6667 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
6669 (Target_x86_64::make_local_ifunc_plt_entry): New function.
6670 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
6672 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
6673 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
6674 R_X86_64_IRELATIVE to switch.
6675 (Target_x86_64::Scan::global): Likewise.
6676 (Target_x86_64::Relocate::relocate): Likewise.
6677 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
6679 * target.h (class Target): Add plt_section_for_global and
6680 plt_section_for_local functions. Add do_plt_section_for_global
6681 and do_plt_section_for_local virtual functions.
6682 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
6683 clarifying comments.
6684 (Symbol::use_plt_offset): Handle IFUNC symbol.
6685 * object.cc (Sized_relobj::Sized_relobj): Initialize
6687 (Sized_relobj::local_has_plt_offset): New function.
6688 (Sized_relobj::local_plt_offset): New function.
6689 (Sized_relobj::set_local_plt_offset): New function.
6690 (Sized_relobj::do_count): Handle IFUNC symbol.
6691 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
6692 a bit away from input_shndx_ field. Add set_is_func_symbol and
6693 is_ifunc_symbol functions.
6694 (class Sized_relobj): Update declarations. Remove Tls_got_entry
6695 and Local_tls_got_offsets. Define Local_plt_offsets. Add
6696 local_plt_offsets_ field.
6697 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
6698 * output.h (class Output_section_data): Add non-const
6699 output_section function.
6700 (class Output_data_got): Update declarations.
6701 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
6702 Add use_plt_offset parameter to global and local constructors.
6703 Change all callers. Change local_sym_index_ field to 31 bits.
6704 Change GSYM_CODE and CONSTANT_CODE accordingly.
6705 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
6706 doing a static link don't set sh_link field.
6707 (Output_data_got::Got_entry::write): Use PLT offset if
6709 (Output_data_got::add_global_plt): New function.
6710 (Output_data_got::add_local_plt): New function.
6711 * target-reloc.h (relocate_section): Handle IFUNC symbol.
6712 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
6713 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
6714 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
6715 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
6717 * testsuite/ifunc-sel.h: New file.
6718 * testsuite/ifuncmain1.c: New file.
6719 * testsuite/ifuncmain1vis.c: New file.
6720 * testsuite/ifuncmod1.c: New file.
6721 * testsuite/ifuncdep2.c: New file.
6722 * testsuite/ifuncmain2.c: New file.
6723 * testsuite/ifuncmain3.c: New file.
6724 * testsuite/ifuncmod3.c: New file.
6725 * testsuite/ifuncmain4.c: New file.
6726 * testsuite/ifuncmain5.c: New file.
6727 * testsuite/ifuncmod5.c: New file.
6728 * testsuite/ifuncmain6pie.c: New file.
6729 * testsuite/ifuncmod6.c: New file.
6730 * testsuite/ifuncmain7.c: New file.
6731 * configure, testsuite/Makefile.in: Rebuild.
6733 2010-08-18 Ian Lance Taylor <iant@google.com>
6736 (Output_section_incremental_inputs::write_input_files): Add cast
6737 to avoid signed/unsigned comparison warning.
6738 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6740 2010-08-12 Cary Coutant <ccoutant@google.com>
6742 * common.cc (Sort_commons::operator()): Remove unnecessary code.
6744 2010-08-13 Ian Lance Taylor <iant@google.com>
6746 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
6748 2010-08-12 Cary Coutant <ccoutant@google.com>
6749 Doug Kwan <dougkwan@google.com>
6751 * resolve.cc (Symbol_table::should_override): When a weak dynamic
6752 defintion overrides non-weak undef, remember that the original undef
6754 * symtab.cc (Symbol_table::sized_write_global): For undef without
6755 an original weak binding, set binding to global in output.
6756 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
6757 * testsuite/Makefile.in: Regenerate.
6758 * testsuite/strong_ref_weak_def.sh: New file.
6759 * testsuite/strong_ref_weak_def_1.c: Ditto.
6760 * testsuite/strong_ref_weak_def_2.c: Ditto.
6762 2010-08-12 Cary Coutant <ccoutant@google.com>
6764 * testsuite/incremental_test.sh: Rewrite.
6765 * testsuite/incremental_test_1.c: Rewrite.
6766 * testsuite/incremental_test_2.c: Rewrite.
6768 2010-08-12 Cary Coutant <ccoutant@google.com>
6770 * arm.cc (Target_arm::got_size): Add const.
6771 (Target_arm::got_entry_count): New function.
6772 (Target_arm::plt_entry_count): New function.
6773 (Target_arm::first_plt_entry_offset): New function.
6774 (Target_arm::plt_entry_size): New function.
6775 (Output_data_plt_arm::entry_count): New function.
6776 (Output_data_plt_arm::first_plt_entry_offset): New function.
6777 (Output_data_plt_arm::get_plt_entry_size): New function.
6778 * i386.cc (Target_i386::got_size): Add const.
6779 (Target_i386::got_entry_count): New function.
6780 (Target_i386::plt_entry_count): New function.
6781 (Target_i386::first_plt_entry_offset): New function.
6782 (Target_i386::plt_entry_size): New function.
6783 (Output_data_plt_i386::entry_count): New function.
6784 (Output_data_plt_i386::first_plt_entry_offset): New function.
6785 (Output_data_plt_i386::get_plt_entry_size): New function.
6786 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
6787 find_incremental_inputs_sections. Dump incremental_got_plt section.
6788 * incremental.cc: Include target.h.
6789 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
6790 parameter. Adjust all callers. Find incremental_got_plt section.
6791 (Incremental_inputs::create_data_sections): Create incremental_got_plt
6793 (Output_section_incremental_inputs::set_final_data_size): Calculate
6794 size of incremental_got_plt section.
6795 (Output_section_incremental_inputs::do_write): Write the
6796 incremental_got_plt section.
6797 (Got_plt_view_info): New struct.
6798 (Local_got_offset_visitor): New class.
6799 (Global_got_offset_visitor): New class.
6800 (Global_symbol_visitor_got_plt): New class.
6801 (Output_section_incremental_inputs::write_got_plt): New function.
6802 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
6803 Add parameter. Adjust all callers.
6804 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6805 (Incremental_inputs::got_plt_section): New function.
6806 (Incremental_inputs::got_plt_section_): New data member.
6807 (Incremental_got_plt_reader): New class.
6808 * layout.cc (Layout::create_incremental_info_sections): Add the
6809 incremental_got_plt section.
6810 * object.h (Got_offset_list::get_list): New function.
6811 (Got offset_list::for_all_got_offsets): New function.
6812 (Sized_relobj::local_got_offset_list): New function.
6813 * powerpc.cc (Target_powerpc::got_size): Add const.
6814 (Target_powerpc::got_entry_count): New function.
6815 (Target_powerpc::plt_entry_count): New function.
6816 (Target_powerpc::first_plt_entry_offset): New function.
6817 (Target_powerpc::plt_entry_size): New function.
6818 (Output_data_plt_powerpc::entry_count): New function.
6819 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
6820 (Output_data_plt_powerpc::get_plt_entry_size): New function.
6821 * sparc.cc (Target_sparc::got_size): Add const.
6822 (Target_sparc::got_entry_count): New function.
6823 (Target_sparc::plt_entry_count): New function.
6824 (Target_sparc::first_plt_entry_offset): New function.
6825 (Target_sparc::plt_entry_size): New function.
6826 (Output_data_plt_sparc::entry_count): New function.
6827 (Output_data_plt_sparc::first_plt_entry_offset): New function.
6828 (Output_data_plt_sparc::get_plt_entry_size): New function.
6829 * symtab.h (Symbol::got_offset_list): New function.
6830 (Symbol_table::for_all_symbols): New function.
6831 * target.h (Sized_target::got_entry_count): New function.
6832 (Sized_target::plt_entry_count): New function.
6833 (Sized_target::plt_entry_size): New function.
6834 * x86_64.cc (Target_x86_64::got_size): Add const.
6835 (Target_x86_64::got_entry_count): New function.
6836 (Target_x86_64::plt_entry_count): New function.
6837 (Target_x86_64::first_plt_entry_offset): New function.
6838 (Target_x86_64::plt_entry_size): New function.
6839 (Output_data_plt_x86_64::entry_count): New function.
6840 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
6841 (Output_data_plt_x86_64::get_plt_entry_size): New function.
6843 2010-08-12 Cary Coutant <ccoutant@google.com>
6845 * archive.cc: Include incremental.h.
6846 (Archive::Archive): Initialize incremental_info_.
6847 (Archive::include_member): Record archive members in incremental info.
6848 (Add_archive_symbols::run): Record begin and end of an archive in
6850 (Lib_group::include_member): Record objects in incremental info.
6851 * archive.h (Incremental_archive_entry): Forward declaration.
6852 (Archive::set_incremental_info): New member function.
6853 (Archive::incremental_info): New member function.
6854 (Archive::Unused_symbol_iterator): New class.
6855 (Archive::unused_symbols_begin): New member function.
6856 (Archive::unused_symbols_end): New member function.
6857 (Archive::incremental_info_): New data member.
6858 * incremental-dump.cc (find_input_containing_global): New function.
6859 (dump_incremental_inputs): Dump new incremental info sections.
6860 * incremental.cc: Include symtab.h.
6861 (Output_section_incremental_inputs): New class.
6862 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
6863 new incremental info sections.
6864 (Sized_incremental_binary::do_check_inputs): Likewise.
6865 (Incremental_inputs::report_archive): Remove.
6866 (Incremental_inputs::report_archive_begin): New function.
6867 (Incremental_inputs::report_archive_end): New function.
6868 (Incremental_inputs::report_object): New function.
6869 (Incremental_inputs::finalize_inputs): Remove.
6870 (Incremental_inputs::report_input_section): New function.
6871 (Incremental_inputs::report_script): Rewrite.
6872 (Incremental_inputs::finalize): Do nothing but finalize string table.
6873 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6874 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6875 (Incremental_inputs::create_data_sections): New function.
6876 (Incremental_inputs::relocs_entsize): New function.
6877 (Output_section_incremental_inputs::set_final_data_size): New function.
6878 (Output_section_incremental_inputs::do_write): New function.
6879 (Output_section_incremental_inputs::write_header): New function.
6880 (Output_section_incremental_inputs::write_input_files): New function.
6881 (Output_section_incremental_inputs::write_info_blocks): New function.
6882 (Output_section_incremental_inputs::write_symtab): New function.
6883 * incremental.h (Incremental_script_entry): Forward declaration.
6884 (Incremental_object_entry): Forward declaration.
6885 (Incremental_archive_entry): Forward declaration.
6886 (Incremental_inputs): Forward declaration.
6887 (Incremental_inputs_header_data): Remove.
6888 (Incremental_inputs_header): Remove.
6889 (Incremental_inputs_header_write): Remove.
6890 (Incremental_inputs_entry_data): Remove.
6891 (Incremental_inputs_entry): Remove.
6892 (Incremental_inputs_entry_write): Remove.
6893 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
6894 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
6895 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6896 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
6898 (Incremental_input_entry): New class.
6899 (Incremental_script_entry): New class.
6900 (Incremental_object_entry): New class.
6901 (Incremental_archive_entry): New class.
6902 (Incremental_inputs::Incremental_inputs): Initialize new data members.
6903 (Incremental_inputs::report_inputs): Remove.
6904 (Incremental_inputs::report_archive): Remove.
6905 (Incremental_inputs::report_archive_begin): New function.
6906 (Incremental_inputs::report_archive_end): New function.
6907 (Incremental_inputs::report_object): Change prototype.
6908 (Incremental_inputs::report_input_section): New function.
6909 (Incremental_inputs::report_script): Change prototype.
6910 (Incremental_inputs::get_reloc_count): New function.
6911 (Incremental_inputs::set_reloc_count): New function.
6912 (Incremental_inputs::create_data_sections): New function.
6913 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6914 (Incremental_inputs::inputs_section): New function.
6915 (Incremental_inputs::symtab_section): New function.
6916 (Incremental_inputs::relocs_section): New function.
6917 (Incremental_inputs::get_stringpool): Add const.
6918 (Incremental_inputs::command_line): Add const.
6919 (Incremental_inputs::inputs): Remove.
6920 (Incremental_inputs::command_line_key): New function.
6921 (Incremental_inputs::input_file_count): New function.
6922 (Incremental_inputs::input_files): New function.
6923 (Incremental_inputs::relocs_entsize): New function.
6924 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6925 (Incremental_inputs::finalize_inputs): Remove.
6926 (Incremental_inputs::Input_info): Remove.
6927 (Incremental_inputs::lock_): Remove.
6928 (Incremental_inputs::inputs_): Change type.
6929 (Incremental_inputs::inputs_map_): Remove.
6930 (Incremental_inputs::current_object_entry_): New data member.
6931 (Incremental_inputs::inputs_section_): New data member.
6932 (Incremental_inputs::symtab_section_): New data member.
6933 (Incremental_inputs::relocs_section_): New data member.
6934 (Incremental_inputs::reloc_count_): New data member.
6935 (Incremental_inputs_reader): New class.
6936 (Incremental_symtab_reader): New class.
6937 (Incremental_relocs_reader): New class.
6938 * layout.cc (Layout::finalize): Move finalization of incremental info
6939 and creation of incremental info sections to follow finalization of
6940 symbol table. Set offsets for postprocessing sections.
6941 (Layout::create_incremental_info_sections): Call
6942 Incremental_inputs::create_data_sections. Add incremental symtab
6943 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
6944 sections to layout after input sections.
6945 * layout.h (struct Timespec): Forward declaration.
6946 (Layout::incremental_inputs): Add const.
6947 (Layout::create_incremental_info_sections): Add parameter.
6948 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
6949 * object.cc: Include incremental.h.
6950 (Relobj::finalize_incremental_relocs): New function.
6951 (Sized_relobj::do_layout): Record input sections in incremental info.
6952 * object.h (Object::output_section): New function.
6953 (Object::output_section_offset): Moved from Relobj.
6954 (Object::get_incremental_reloc_base): New function.
6955 (Object::get_incremental_reloc_count): New function.
6956 (Object::do_output_section): New function.
6957 (Object::do_output_section_offset): Moved from Relobj.
6958 (Object::do_get_incremental_reloc_base): New function.
6959 (Object::do_get_incremental_reloc_count): New function.
6960 (Object::Object): Initialize new data members.
6961 (Relobj::output_section): Renamed do_output_section and moved to
6963 (Relobj::output_section_offset): Moved to Object.
6964 (Relobj::do_get_incremental_reloc_base): New function.
6965 (Relobj::do_get_incremental_reloc_count): New function.
6966 (Relobj::allocate_incremental_reloc_counts): New function.
6967 (Relobj::count_incremental_reloc): New function.
6968 (Relobj::finalize_incremental_relocs): New function.
6969 (Relobj::next_incremental_reloc_index): New function.
6970 (Relobj::reloc_counts_): New data member.
6971 (Relobj::reloc_bases_): New data member.
6972 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
6973 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
6974 (Sized_relobj::incremental_relocs_scan): New function.
6975 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6976 (Sized_relobj::incremental_relocs_write): New function.
6977 (Sized_relobj::incremental_relocs_write_reltype): New function.
6978 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
6980 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
6981 archives and object files elsewhere.
6982 (Add_symbols::run): Report object files here.
6983 (Finish_group::run): Report end of archive at end of group.
6984 * reloc.cc: Include layout.h, incremental.h.
6985 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
6986 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
6987 (Sized_relobj::incremental_relocs_scan): New function.
6988 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6989 (Sized_relobj::do_relocate_sections): Write incremental relocations.
6990 (Sized_relobj::incremental_relocs_write): New function.
6991 (Sized_relobj::incremental_relocs_write_reltype): New function.
6992 * script.cc (read_input_script): Rewrite test for incremental link.
6993 Change call to Incremental_inputs::report_script.
6994 * symtab.h (Symbol_table::first_global_index): New function.
6995 (Symbol_table::output_count): New function.
6997 2010-08-12 Doug Kwan <dougkwan@google.com>
6999 * arm.cc (Target_arm::merge_object_attributes): Check command line
7000 options --no-wchar-size-warning and --no-enum-size-warning.
7001 * options.h (General_options): Add ld-compatible options
7002 --no-enum-size-warning and --no-wchar-size-warning.
7004 2010-08-04 Ian Lance Taylor <iant@google.com>
7006 * x86_64.cc (Target_x86_64::Scan::local): Use
7007 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7008 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7009 (Target_x86_64::Scan::global): Likewise.
7010 (Target_x86_64::Relocate::relocate): Likewise.
7011 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7014 2010-08-03 Cary Coutant <ccoutant@google.com>
7016 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7017 to reserve space in merged_strings vector. Keep total input size
7019 (Output_merge_string::do_print_merge_stats): Print total input size.
7020 * merge.h (Output_merge_string): Add input_size_ field.
7021 * stringpool.cc (Stringpool_template::string_length): Move
7022 implementations out of Stringpool_template class and place in
7024 * stringpool.h (string_length): Move out of Stringpool_template.
7026 2010-08-03 Ian Lance Taylor <iant@google.com>
7029 * layout.cc (relaxation_loop_body): If address of load segment is
7030 set, adjust address to include headers if possible.
7032 2010-08-03 Ian Lance Taylor <iant@google.com>
7034 * version.cc (version_string): Bump to 1.10.
7036 2010-08-03 Ian Lance Taylor <iant@google.com>
7039 * layout.h (enum Output_section_order): Define.
7040 (class Layout): Update declarations.
7041 * layout.cc (Layout::get_output_section): Add order parameter.
7042 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7043 is_first_non_relro parameters. Change all callers.
7044 (Layout::choose_output_section): Likewise.
7045 (Layout::add_output_section_data): Likewise.
7046 (Layout::make_output_section): Likewise. Set order.
7047 (Layout::default_section_order): New function.
7048 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7049 * output.cc (Output_section::Output_section): Initialize order_.
7050 Don't initialize deleted fields.
7051 (Output_segment::Output_segment): Don't initialize deleted
7053 (Output_segment::add_output_section_to_load): New function
7054 replacing add_output_section. Change all callers to call this or
7055 add_output_section_to_nonload.
7056 (Output_segment::add_output_section_to_nonload): New function.
7057 (Output_segment::remove_output_section): Rewrite.
7058 (Output_segment::add_initial_output_data): Likewise.
7059 (Output_segment::has_any_data_sections): Likewise.
7060 (Output_segment::is_first_section_relro): Likewise.
7061 (Output_segment::maximum_alignment): Likewise.
7062 (Output_segment::has_dynamic_reloc): New function replacing
7063 dynamic_reloc_count. Change all callers.
7064 (Output_segment::has_dynamic_reloc_list): New function replacing
7065 dynamic_reloc_count_list. Change all callers.
7066 (Output_segment::set_section_addresses): Rewrite.
7067 (Output_segment::set_offset): Rewrite.
7068 (Output_segment::find_first_and_last_list): Remove.
7069 (Output_segment::set_tls_offsets): Rewrite.
7070 (Output_segment::first_section_load_address): Likewise.
7071 (Output_segment::output_section_count): Likewise.
7072 (Output_segment::section_with_lowest_load_address): Likewise.
7073 (Output_segment::write_section_headers): Likewise.
7074 (Output_segment::print_sections_to_map): Likewise.
7075 * output.h (class Output_data): Remove dynamic_reloc_count_
7076 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7077 (Output_data::add_dynamic_reloc): Rewrite.
7078 (Output_data::has_dynamic_reloc): New function.
7079 (Output_data::dynamic_reloc_count): Remove.
7080 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7081 is_last_relro_, is_first_non_relro_, is_interp_,
7082 is_dynamic_linker_section_ fields. Add order and set_order
7083 functions. Remove is_relro_local, set_is_relro_local,
7084 is_last_relro, set_is_last_relro, is_first_non_relro,
7085 set_is_first_non_relro functions, is_interp, set_is_interp,
7086 is_dynamic_linker_section, and set_is_dynamic_linker_section
7088 (class Output_segment): Change Output_data_list from std::list to
7089 std:;vector. Add output_lists_ field. Remove output_data_ and
7090 output_bss_ fields. Update declarations.
7092 2010-08-02 Ian Lance Taylor <iant@google.com>
7094 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7095 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7096 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7098 2010-08-02 Ian Lance Taylor <iant@google.com>
7101 * script.cc (Script_options::Script_options): Initialize
7102 symbol_definitions_ and symbol_references_.
7103 (Script_options::add_symbol_assignment): Update
7104 symbol_definitions_ and symbol_references_.
7105 (Script_options::add_symbol_reference): New function.
7106 (script_symbol): New function.
7107 * script.h (class Script_options): Add symbol_definitions_ and
7108 symbol_references_ fields.
7109 (Script_options::referenced_const_iterator): New type.
7110 (Script_options::referenced_begin): New function.
7111 (Script_options::referenced_end): New function.
7112 (Script_options::is_referenced): New function.
7113 (Script_options::any_unreferenced): New function.
7114 * script-c.h (script_symbol): Declare.
7115 * yyscript.y (exp): Call script_symbol.
7116 * symtab.cc: Include "script.h".
7117 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7118 Change all callers. Check symbols referenced by scripts.
7119 (Symbol_table::add_undefined_symbols_from_command_line): Add
7120 layout parameter. Change all callers.
7121 (Symbol_table::do_add_undefined_symbols_from_command_line):
7122 Likewise. Break out loop body. Check symbols referenced by
7124 (Symbol_table::add_undefined_symbol_from_command_line): New
7125 function broken out of
7126 do_add_undefined_symbols_from_command_line.
7127 * symtab.h (class Symbol_table): Update declarations.
7128 * archive.cc: Include "layout.h".
7129 (Archive::should_include_member): Add layout parameter. Change
7130 all callers. Check for symbol mentioned in expression.
7131 * archive.h (class Archive): Update declaration.
7132 * object.cc (Sized_relobj::do_should_include_member): Add layout
7134 * object.h (Object::should_include_member): Add layout parameter.
7136 (Object::do_should_include_member): Add layout parameter.
7137 (class Sized_relobj): Update declaration.
7138 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
7140 * dynobj.h (class Sized_dynobj): Update declaration.
7141 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
7143 * plugin.h (class Sized_pluginobj): Update declaration.
7145 2010-08-02 Ian Lance Taylor <iant@google.com>
7148 * output.cc (Output_segment::set_offset): Search for the first and
7149 last sections rather than assuming that the list is in order.
7150 (Output_segment::find_first_and_last_list): New function.
7151 * output.h (class Output_segment): Update declarations.
7152 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7153 (relro_strip_test_SOURCES): New variable.
7154 (relro_strip_test_DEPENDENCIES): New variable.
7155 (relro_strip_test_LDFLAGS): New variable.
7156 (relro_strip_test_LDADD): New variable.
7157 (relro_strip_test.so): New target.
7159 2010-08-02 Ian Lance Taylor <iant@google.com>
7161 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7162 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7163 (Target_i386::got_tlsdesc_section): New function.
7164 (Target_i386::got_section): Create space for GOT entries for
7165 TLSDESC relocations.
7166 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7168 (Target_i386::Scan::global): Likewise.
7169 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
7171 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
7172 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
7173 (Target_x86_64::got_tlsdesc_section): New function.
7174 (Target_x86_64::got_section): Create space for GOT entries for
7175 TLSDESC relocations.
7176 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
7178 (Target_x86_64::Scan::global): Likewise.
7179 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
7182 2010-08-02 Ian Lance Taylor <iant@google.com>
7184 * testsuite/final_layout.sh: Use dc to convert from hex to
7187 2010-07-29 Sriraman Tallam <tmsriram@google.com>
7189 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
7190 paramter to the call to gold::gc_process_relocs.
7191 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
7192 paramter to the call to gold::gc_process_relocs.
7193 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
7194 parameter to the call to gold::gc_process_relocs.
7195 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
7196 template parameter to the call to gold::gc_process_relocs.
7197 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
7198 paramter to the call to gold::gc_process_relocs.
7199 * gc.h (get_embedded_addend_size): New function.
7200 (gc_process_relocs): Save the size of the reloc for use by ICF.
7201 * icf.cc (get_section_contents): Get the addend from the text section
7202 for SHT_REL relocation sections.
7203 * icf.h (Icf::Reloc_addend_size_info): New typedef.
7204 (Icf::Reloc_info): Add new member reloc_addend_size_info.
7205 * int_encoding.h (read_from_pointer): New overloaded function.
7206 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
7207 * testsuite/icf_sht_rel_addend_test.sh: New file.
7208 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
7209 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
7211 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7213 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
7214 * Makefile.in: Regenerate.
7215 * testsuite/Makefile.in: Regenerate.
7217 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
7219 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
7220 * gold/testsuite/debug_msg.cc: Likewise.
7221 * gold/testsuite/odr_violation1.cc
7222 * gold/testsuite/odr_violation2.cc
7224 2010-07-21 Cary Coutant <ccoutant@google.com>
7226 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
7227 string, and length fields.
7228 (Output_merge_string::Merged_strings_list): New type.
7229 (Output_merge_string::Merged_strings_lists): New typedef.
7230 (Output_merge_string): Replace merged_strings_ with
7231 merged_strings_lists_.
7232 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
7233 Merged_strings_list per input object and section. Don't store pointer
7234 to the string. Don't store length with each merged string entry.
7235 (Output_merge_string::finalize_merged_data): Loop over list of merged
7236 strings lists. Recompute length of each merged string.
7238 2010-07-15 Cary Coutant <ccoutant@google.com>
7240 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
7243 2010-07-14 Ian Lance Taylor <iant@google.com>
7245 * descriptors.cc (Descriptors::open): Report correct name in error
7248 2010-07-13 Doug Kwan <dougkwan@google.com>
7250 * arm.cc (Arm_input_section::Arm_input_section): For a
7251 SHT_ARM_EXIDX section, always keeps the input sections.
7252 (Arm_input_section::set_exidx_section_link): New method.
7253 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
7254 has_errors_ to false.
7255 (Arm_exidx_input_section::has_errors,
7256 Arm_exidx_input_section::set_has_errors): New methods.
7257 (Arm_exidx_input_section::has_errors_): New data member.
7258 (Arm_relobj::get_exidx_shndx_list): New method.
7259 (Arm_output_section::append_text_sections_to_list): Do not skip
7260 section without SHF_EXECINSTR.
7261 (Arm_output_section::fix_exidx_coverage): Skip input sections with
7263 (Arm_relobj::make_exidx_input_section): Add new parameter for text
7264 section header. Make error messages more verbose. Check for
7265 a non-executable section linked to an EXIDX section.
7266 (Arm_relobj::do_read_symbols): Remove error checking, which has been
7267 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
7268 check that there is no deferred EXIDX section if we exit early.
7269 Instead of not making an EXIDX section in case of an error, make one
7270 and set the has_errors flag of it.
7271 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
7272 in a relocatable link.
7273 (Target_arm::do_relax): Look for the EXIDX output section instead of
7274 assuming that it is called .ARM.exidx.
7275 (Target_arm::fix_exidx_coverage): Add a new parameter for input
7276 section list. Do not check for SHF_EXECINSTR section flags but
7277 skip any input section with errors.
7278 * output.cc (Output_section::Output_section): Initialize
7279 always_keeps_input_sections_ to false.
7280 (Output_section::add_input_section): Check for
7281 always_keeps_input_sections_.
7282 * output.h (Output_section::always_keeps_input_sections,
7283 Output_section::set_always_keeps_input_sections): New methods.
7284 (Output_section::always_keeps_input_sections): New data member.
7286 2010-07-13 Rafael Espindola <espindola@google.com>
7288 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
7289 * fileread.h (Input_file): Add try_extra_search_path and find_file.
7291 2010-07-13 Philip Herron <herron.philip@googlemail.com>
7292 Ian Lance Taylor <iant@google.com>
7294 * output.h (Output_section_lookup_maps::add_merge_section):
7295 Correct check of whether value was inserted.
7296 (Output_section_lookup_maps::add_merge_input_section): Likewise.
7297 (Output_section_lookup_maps::add_relaxed_input_section):
7299 * arm.cc (Target_arm::got_section): Remove used local os.
7300 * i386.cc (Target_i386::got_section): Likewise.
7301 * x86_64.cc (Target_x86_64::got_section): Likewise.
7302 * sparc.cc (Target_sparc::got_section): Likewise.
7303 (Target_sparc::relocate): Remove unused local have_got_offset.
7304 * powerpc.cc (Target_powerpc::relocate): Likewise.
7306 2010-07-13 Ian Lance Taylor <iant@google.com>
7308 * compressed_output.cc (zlib_decompress): Fix signature in
7311 * archive.cc (Archive::include_member): Unlock an external member
7312 of a thin archive. Don't bother to delete an object we know is
7315 2010-07-12 Cary Coutant <ccoutant@google.com>
7317 * compressed_output.cc (zlib_decompress): New function.
7318 (get_uncompressed_size): New function.
7319 (decompress_input_section): New function.
7320 * compressed_output.h (get_uncompressed_size): New function.
7321 (decompress_input_section): New function.
7322 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
7323 Handle compressed debug sections.
7324 * layout.cc (is_compressed_debug_section): New function.
7325 (Layout::output_section_name): Map compressed section names to
7327 * layout.h (is_compressed_debug_section): New function.
7328 (is_debug_info_section): Recognize compressed debug sections.
7329 * merge.cc: Include compressed_output.h.
7330 (Output_merge_data::do_add_input_section): Handle compressed
7332 (Output_merge_string::do_add_input_section): Handle compressed
7334 * object.cc: Include compressed_output.h.
7335 (Sized_relobj::Sized_relobj): Initialize new data members.
7336 (build_compressed_section_map): New function.
7337 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
7338 * object.h (Object::section_is_compressed): New method.
7339 (Object::do_section_is_compressed): New method.
7340 (Sized_relobj::Compressed_section_map): New type.
7341 (Sized_relobj::do_section_is_compressed): New method.
7342 (Sized_relobj::compressed_sections_): New data member.
7343 * output.cc (Output_section::add_input_section): Handle compressed
7345 * reloc.cc: Include compressed_output.h.
7346 (Sized_relobj::write_sections): Handle compressed debug sections.
7348 2010-07-08 Cary Coutant <ccoutant@google.com>
7350 * resolve.cc (Symbol_table::resolve): Remember whether undef was
7351 weak when resolving to a dynamic def.
7352 (Symbol_table::should_override): Add adjust_dyndef flag; set it
7353 for weak undef/dynamic def cases. Adjust callers.
7354 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
7355 undef_binding_weak_.
7356 (Symbol_table::sized_write_globals): Adjust symbol binding.
7357 (Symbol_table::sized_write_symbol): Add binding parameter.
7358 * symtab.h (Symbol::set_undef_binding): New method.
7359 (Symbol::is_undef_binding_weak): New method.
7360 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
7361 (Symbol_table::should_override): Add new parameter.
7362 (Symbol_table::sized_write_symbol): Add new parameter.
7364 * testsuite/weak_undef_file1.cc: Add new test case.
7365 * testsuite/weak_undef_file2.cc: Fix header comment.
7366 * testsuite/weak_undef_test.cc: Add new test case.
7368 2010-06-29 Doug Kwan <dougkwan@google.com>
7370 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
7371 Initialize USE_SYMBOL_.
7372 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
7374 (Arm_reloc_property::uses_symbol_): New data member declaration.
7375 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
7376 uses symbol value and symbol is undefined but not weakly undefined.
7378 2010-06-28 Rafael Espindola <espindola@google.com>
7380 * plugin.cc (Plugin::load): Use dlerror.
7382 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
7384 * symtab.cc (detect_odr_violations): When reporting an ODR
7385 violation, report an object where the symbol is defined.
7387 2010-06-25 Doug Kwan <dougkwan@google.com>
7389 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
7390 (Target_arm::section_may_have_icf_unsafe_pointers): New method
7392 (Target_arm::Scan::local_reloc_may_be_function_pointer,
7393 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
7394 target hook to detect function points.
7395 (Target_arm::Scan::possible_function_pointer_reloc): New method.
7396 * icf.h (Icf::check_section_for_function_pointers): Change type of
7397 parameter SECTION_NAME to const reference to std::string. Use
7398 target hook to determine if section may have unsafe pointers.
7399 * target.h (Target::section_may_have_icf_unsafe_pointers): New
7402 2010-06-21 Rafael Espindola <espindola@google.com>
7404 * fileread.cc (Input_file::find_fie): New
7405 (Input_file::open): Use Input_file::find_fie.
7406 * fileread.h (Input_file::find_fie): New
7407 * plugin.cc (set_extra_library_path): New.
7408 (Plugin::load): Add set_extra_library_path to the transfer vector.
7409 (Plugin_manager::set_extra_library_path): New.
7410 (Plugin_manager::add_input_file): Use the extra search path if set.
7411 (set_extra_library_path(): New.
7412 * plugin.h (Plugin_manager): Add set_extra_library_path and
7415 2010-06-19 Cary Coutant <ccoutant@google.com>
7417 * layout.cc (gdb_sections): Add .debug_types.
7418 (lines_only_debug_sections): Likewise.
7420 2010-06-18 Rafael Espindola <espindola@google.com>
7422 * plugin.cc (add_input_file,add_input_library)
7423 (Plugin_manager::add_input_file): Make filename arguments const.
7424 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
7427 2010-06-16 Doug Kwan <dougkwan@google.com>
7429 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
7430 .ARM.attributes section if we have not merged any input
7431 attributes sections.
7433 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7435 * arm.cc: Allow combining objects with no EABI version
7438 2010-06-15 Rafael Espindola <espindola@google.com>
7440 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
7442 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7444 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
7445 (struct iovec): Correct !HAVE_READV definition.
7447 2010-06-10 Cary Coutant <ccoutant@google.com>
7449 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
7450 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
7452 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
7455 * symtab.h (Symbol::is_placeholder): New member function.
7456 * target-reloc.h (relocate_section): Check for placeholder symbols.
7458 * testsuite/Makefile.am (plugin_test_8): New test.
7459 (plugin_test_9): New test.
7460 * testsuite/Makefile.in: Regenerate.
7462 2010-06-09 Nick Clifton <nickc@redhat.com>
7464 * yyscript.y (input_list_element): Allow strings prefixed with
7465 the '-' character. Treat these as libraries.
7466 * script.cc (script_add_library): New function. Adds a library
7467 specified by "-l<name>" found in an input script.
7468 * script-c.h: Add prototype for script_add_library.
7470 2010-06-07 Doug Kwan <dougkwan@google.com>
7472 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
7473 Restrict stub-group size to be within long conditional branch
7474 range when working around cortex-A8 erratum.
7476 2010-06-07 Damien Diederen <dd@crosstwine.com>
7478 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
7481 2010-06-03 Sriraman Tallam <tmsriram@google.com>
7485 (Output_section::Input_section_sort_entry::compare_section_ordering):
7486 Change to return non-zero correctly.
7487 (Output_section::Input_section_sort_section_order_index_compare
7488 ::operator()): Change to fix ambiguity in comparisons.
7490 2010-06-01 Sriraman Tallam <tmsriram@google.com>
7492 * gold.h (is_wildcard_string): New function.
7493 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
7494 (Layout::layout_eh_frame): Ditto.
7495 (Layout::find_section_order_index): New method.
7496 (Layout::read_layout_from_file): New method.
7497 * layout.h (Layout::find_section_order_index): New method.
7498 (Layout::read_layout_from_file): New method.
7499 (Layout::input_section_position_): New private member.
7500 (Layout::input_section_glob_): New private member.
7501 * main.cc (main): Call read_layout_from_file here.
7502 * options.h (--section-ordering-file): New option.
7503 * output.cc (Output_section::input_section_order_specified_): New
7505 (Output_section::Output_section): Initialize new member.
7506 (Output_section::add_input_section): Add new parameter.
7507 Keep input sections when --section-ordering-file is used.
7508 (Output_section::set_final_data_size): Sort input sections when
7509 section ordering file is specified.
7510 (Output_section::Input_section_sort_entry): Add new parameter.
7512 (Output_section::Input_section_sort_entry::compare_section_ordering):
7514 (Output_section::Input_section_sort_compare::operator()): Change to
7515 consider section_order_index.
7516 (Output_section::Input_section_sort_init_fini_compare::operator()):
7517 Change to consider section_order_index.
7518 (Output_section::Input_section_sort_section_order_index_compare
7519 ::operator()): New method.
7520 (Output_section::sort_attached_input_sections): Change to sort
7521 according to section order when specified.
7522 (Output_section::add_input_section<32, true>): Add new parameter.
7523 (Output_section::add_input_section<64, true>): Add new parameter.
7524 (Output_section::add_input_section<32, false>): Add new parameter.
7525 (Output_section::add_input_section<64, false>): Add new parameter.
7526 * output.h (Output_section::add_input_section): Add new parameter.
7527 (Output_section::input_section_order_specified): New
7529 (Output_section::set_input_section_order_specified): New method.
7530 (Input_section::Input_section): Initialize section_order_index_.
7531 (Input_section::section_order_index): New method.
7532 (Input_section::set_section_order_index): New method.
7533 (Input_section::section_order_index_): New member.
7534 (Input_section::Input_section_sort_section_order_index_compare): New
7536 (Output_section::input_section_order_specified_): New member.
7537 * script-sections.cc (is_wildcard_string): Delete and move modified
7539 (Output_section_element_input::Output_section_element_input): Modify
7540 call to is_wildcard_string.
7541 (Output_section_element_input::Input_section_pattern
7542 ::Input_section_pattern): Ditto.
7543 (Output_section_element_input::Output_section_element_input): Ditto.
7544 * testsuite/Makefile.am (final_layout): New test case.
7545 * testsuite/Makefile.in: Regenerate.
7546 * testsuite/final_layout.cc: New file.
7547 * testsuite/final_layout.sh: New file.
7549 2010-06-01 Rafael Espindola <espindola@google.com>
7551 * plugin.cc (Plugin::load): Pass the output name to the plugin.
7553 2010-06-01 Rafael Espindola <espindola@google.com>
7555 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
7556 visibility of symbols.
7558 2010-05-27 Doug Kwan <dougkwan@google.com>
7560 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
7561 from start of output section instead of address for a local symbol
7562 in a merged or relaxed section when doing a relocatable link.
7564 2010-05-26 Rafael Espindola <espindola@google.com>
7567 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
7568 adding sections the garbage collector removed.
7569 * gold/testsuite/Makefile.am: Add test.
7570 * gold/testsuite/Makefile.in: Regenerate.
7571 * gold/testsuite/plugin_test_7.sh: New.
7572 * gold/testsuite/plugin_test_7_1.c: New.
7573 * gold/testsuite/plugin_test_7_2.c: New.
7575 2010-05-26 Rafael Espindola <espindola@google.com>
7577 * script-sections.cc (Output_section_definition::set_section_addresses):
7578 Check for --section-start.
7580 2010-05-26 Doug Kwan <dougkwan@google.com>
7582 * arm.cc (Arm_scan_relocatable_relocs): New class.
7583 (Target_arm::relocate_special_relocatable): New method.
7584 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
7585 (Arm_relocate_functions::thumb_branch_common): Same.
7586 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
7587 instead of Default_scan_relocatable_relocs.
7588 * target-reloc.h (relocate_for_relocatable): Let target handle
7589 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
7590 * target.h (Sized_target::relocate_special_relocatable): New method.
7592 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7594 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
7596 2010-05-23 Doug Kwan <dougkwan@google.com>
7598 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
7600 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
7601 with a direct branch, not a conditional branch, to a stub.
7602 * merge.cc (Output_merge_base::record_input_section): New method
7604 (Output_merge_data::do_add_input_section): Record input section if
7605 keeps-input-sections flag is set.
7606 (Output_merge_string::do_add_input_section): Ditto.
7607 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
7608 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
7610 (Output_merge_base::keeps_input_sections,
7611 Output_merge_base::set_keeps_input_sections,
7612 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
7614 (Output_merge_base::Input_sections): New type declaration.
7615 (Output_merge_base::input_sections_begin,
7616 Output_merge_base::input_sections_end,
7617 Output_merge_base::do_set_keeps_input_sections): New method definitions.
7618 (Output_merge_base::bool keeps_input_sections_,
7619 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
7620 Output_merge_base::input_sections_): New data members.
7621 (Output_merge_data::do_set_keeps_input_sections): New method
7623 (Output_merge_string::do_set_keeps_input_sections): Ditto.
7624 * output.cc (Output_section::Input_section::relobj): Move method
7625 defintion from class declaration to here and handle merge sections.
7626 (Output_section::Input_section::shndx): Ditto.
7627 (Output_section::Output_section): Remove initializations of removed
7628 data members and initialize new data member LOOKUP_MAPS_.
7629 (Output_section::add_input_section): Set keeps-input-sections flag
7630 for a newly created merge output section as appropriate. Adjust code
7631 to use Output_section_lookup_maps class.
7632 (Output_section::add_relaxed_input_section): Adjst code for lookup
7633 maps code refactoring.
7634 (Output_section::add_merge_input_section): Add a new parameter
7635 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
7636 class. If adding input section to a newly created merge output
7637 section fails, remove the new merge section.
7638 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
7639 Adjust code for use of the Output_section_lookup_maps class.
7640 (Output_section::find_merge_section): Ditto.
7641 (Output_section::build_lookup_maps): New method defintion.
7642 (Output_section::find_relaxed_input_section): Adjust code to use
7643 Output_section_lookup_maps class.
7644 (Output_section::get_input_sections): Export merge sections. Adjust
7645 code to use Output_section_lookup_maps class.
7646 (Output_section:::add_script_input_section): Adjust code to use
7647 Output_section_lookup_maps class. Update lookup maps for merge
7649 (Output_section::discard_states): Use Output_section_lookup_maps.
7650 (Output_section::restore_states): Same.
7651 * output.h (Merge_section_properties): Move class defintion out of
7653 (Output_section_lookup_maps): New class.
7654 (Output_section::Input_section::is_merge_section): New method
7656 (Output_section::Input_section::relobj): Move defintion out of class
7657 defintion. Declare method only.
7658 (Output_section::Input_section::shndx): Ditto.
7659 (Output_section::Input_section::output_merge_base): New method defintion.
7660 (Output_section::Input_section::u2_.pomb): New union field.
7661 (Output_section::Merge_section_by_properties_map,
7662 Output_section::Output_section_data_by_input_section_map,
7663 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
7665 (Output_section::add_merge_input_section): Add new parameter
7666 KEEPS_INPUT_SECTIONS.
7667 (Output_section::build_lookup_maps): New method declaration.
7668 (Output_section::merge_section_map_,
7669 Output_section::merge_section_by_properties_map_,
7670 Output_section::relaxed_input_section_map_,
7671 Output_section::is_relaxed_input_section_map_valid_): Remove data
7673 (Output_section::lookup_maps_): New data member.
7675 2010-05-21 Doug Kwan <dougkwan@google.com>
7678 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
7679 avoid a compilation error.
7681 2010-05-19 Rafael Espindola <espindola@google.com>
7683 * script-sections.cc (Output_section_definition::allocate_to_segment):
7684 Update the phdrs_list even when the output section is NULL.
7685 * testsuite/Makefile.am: Add test.
7686 * testsuite/Makefile.in: Regenerate.
7687 * testsuite/script_test_9.cc: New.
7688 * testsuite/script_test_9.sh: New.
7689 * testsuite/script_test_9.t: New.
7691 2010-05-19 Doug Kwan <dougkwan@google.com>
7693 * arm.cc (Arm_input_section::original_size): New method.
7694 (Arm_input_section::do_addralign): Add a cast.
7695 (Arm_input_section::do_output_offset): Remove static cast.
7696 (Arm_input_section::original_addralign,
7697 Arm_input_section::original_size_): Change type to uint32_t.
7698 (Arm_input_section::init): Add safe casts for section alignment
7700 (Arm_input_section::set_final_data_size): Do not set address and
7701 offset of stub table.
7702 (Arm_output_section::fix_exidx_coverage): Change use of of
7703 Output_section::Simple_input_section to that of
7704 Output_section::Input_section.
7705 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
7706 except for the first pass.
7707 * output.cc (Output_section::get_input_sections): Change type of
7708 input_sections to std::list<Input_section>.
7709 (Output_section::add_script_input_section): Rename from
7710 Output_section::add_simple_input_section. Change type of SIS
7711 parameter from Simple_input_section to Input_section.
7712 * output.h (Output_section::Simple_input_section): Remove class.
7713 (Output_section::Input_section): Change class visibility to public.
7714 (Output_section::Input_section::addralign): Use stored alignments
7715 for special input sections if set.
7716 (Output_section::Input_section::set_addralign): New method.
7717 (Output_section::get_input_sections): Change parameter type from
7718 list of Simple_input_section to list of Input_section.
7719 (Output_section::add_script_input_section): Rename from
7720 Output_section::add_simple_input_section. Change first parameter's
7721 type from Simple_input_section to Input_section and remove the
7722 second and third parameters.
7723 * script-sections.cc (Input_section::Input_section_list): Change
7724 type to list of Output_section::Input_section/
7725 (Input_section_info::Input_section_info): Change parameter type of
7726 INPUT_SECTION to Output_section::Input_section.
7727 (Input_section_info::input_section): Change return type.
7728 (Input_section_info::input_section_): Change type to
7729 Output_section::Input_section.
7730 (Output_section_element_input::set_section_addresses): Adjust code
7731 to use Output_section::Input_section instead of
7732 Output_section::Simple_input_section. Adjust code for renaming
7733 of Output_section::add_simple_input_section.
7734 (Orphan_output_section::set_section_addresses): Ditto.
7736 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7738 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
7739 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
7741 2010-05-18 Rafael Espindola <espindola@google.com>
7743 * options.cc (General_options::finalize): Handle -nostdlib.
7744 * options.h (nostdlib): New option.
7745 * script.cc (script_add_search_dir): Handle -nostdlib.
7747 2010-05-12 Doug Kwan <dougkwan@google.com>
7749 * arm.cc (Target_arm::do_finalize_sections): Create an empty
7750 attributes section only if there no attributes section after merging.
7751 (Target_arm::merge_object_attributes): Move value of
7752 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
7753 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
7754 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
7755 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
7756 and arm_attr_merge_7.stdout.
7757 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
7758 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
7759 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
7760 arm_attr_merge_7b.o): New rules.
7761 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
7763 * testsuite/Makefile.in: Regenerate.
7764 * testsuite/arm_attr_merge.sh: New file.
7765 * testsuite/arm_attr_merge_[67][ab].s: Same.
7767 2010-05-05 Nick Clifton <nickc@redhat.com>
7769 * po/es.po: Updated Spanish translation.
7771 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7773 * Makefile.am (install-exec-local): Properly install gold as
7774 default cross linker.
7775 * Makefile.in: Regenerated.
7777 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7778 Nick Clifton <nickc@redhat.com>
7780 * configure.ac (install_as_default): Define and set to false
7781 unless --enable-gold or --enable-gold=both/gold has been
7783 * configure: Regenerate.
7785 * Makefile.am (install-exec-local): Install the executable as
7786 'ld.gold'. If install_as_default is true then also install it as
7788 * Makefile.in: Regenerated.
7790 2010-04-24 Ian Lance Taylor <iant@google.com>
7792 * layout.cc (Layout::layout_reloc): In relocatable link don't
7793 combine reloc sections for grouped sections.
7795 2010-04-23 Sriraman Tallam <tmsriram@google.com>
7797 * gc.h (gc_process_relocs): Pass information on relocs pointing to
7798 sections that are not ordinary to icf.
7799 * icf.cc (get_section_contents): Handle relocation pointing to section
7800 with no object or shndx information.
7801 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
7802 * testsuite/Makefile.in: Regenerate.
7803 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
7804 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
7806 2010-04-22 Ian Lance Taylor <iant@google.com>
7808 * expression.cc (Expression::Expression_eval_info): Add
7809 result_alignment_pointer field.
7810 (Expression::eval_with_dot): Add result_alignment_pointer
7811 parameter. Change all callers.
7812 (Expression::eval_maybe_dot): Likewise.
7813 (class Binary_expression): Add alignment_pointer parameter to
7814 left_value and right_value. Change all callers.
7815 (BINARY_EXPRESSION): Set result alignment.
7816 (class Trinary_expression): Add alignment_pointer parameter to
7817 arg2_value and arg3_value. Change all callers.
7818 (Trinary_cond::value): Set result alignment.
7819 (Max_expression::value, Min_expression::value): Likewise.
7820 (Align_expression::value): Likewise.
7821 * script-sections.cc (class Sections_element): Add dot_alignment
7822 parameter to set_section_addresses virtual function. Update
7824 (class Output_section_element): Likewise.
7825 (Script_sections::create_segments): Add dot_alignment parameter.
7827 (Script_sections::create_segments_from_phdrs_clause): Likewise.
7828 (Script_sections::set_phdrs_clause_addresses): Likewise.
7829 * script-sections.h: Update declarations.
7830 * script.h: Update declarations.
7831 * output.h (Output_segment::set_minimum_p_align): Don't decrease
7833 * testsuite/script_test_3.t: Set large alignment.
7834 * testsuite/script_test_3.sh: Make sure that at least one LOAD
7835 segment has expected alignment.
7837 2010-04-22 Nick Clifton <nickc@redhat.com>
7839 * po/gold.pot: Updated by the Translation project.
7840 * po/vi.po: Updated Vietnamese translation.
7842 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
7844 * testsuite/Makefile.am (check_PROGRAMS): Add
7845 icf_virtual_function_folding_test.
7846 * testsuite/Makefile.in: Regenerated.
7848 2010-04-15 Andrew Haley <aph@redhat.com>
7850 * options.h (merge_exidx_entries): New option.
7851 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
7852 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
7853 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
7854 (Target_arm::merge_exidx_entries): New function.
7855 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
7856 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
7857 to Arm_exidx_fixup constructor.
7858 Add new arg, merge_exidx_entries.
7859 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
7860 Arm_output_section::fix_exidx_coverage.
7862 2010-04-18 Sriraman Tallam <tmsriram@google.com>
7864 * icf.cc (get_section_contents): Check for preemptible functions.
7865 Ignore addend when appropriate.
7866 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
7868 (add_from_relobj): Check for section folded.
7869 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
7870 * symtab.h (should_add_dynsym_entry): Add new parameter.
7871 * target-reloc.h (scan_relocs): Check for section folded.
7872 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
7873 Check reloc types for function pointers in shared objects.
7874 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
7876 (icf_preemptible_functions_test): New test case.
7877 (icf_string_merge_test): New test case.
7878 * testsuite.Makefile.in: Regenerate.
7879 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
7880 bar_glob. Refactor code.
7881 * testsuite/icf_preemptible_functions_test.cc: New file.
7882 * testsuite/icf_preemptible_functions_test.sh: New file.
7883 * testsuite/icf_string_merge_test.cc: New file.
7884 * testsuite/icf_string_merge_test.sh: New file.
7885 * testsuite/icf_virtual_function_folding_test.cc: New file.
7886 * testsuite/icf_virtual_function_folding_test.sh: New file.
7888 2010-04-14 Doug Kwan <dougkwan@google.com>
7890 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
7891 for local symbol recounting if we remove a section due to ICF.
7892 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
7893 there are no regular objects in input.
7895 2010-04-13 Doug Kwan <dougkwan@google.com>
7897 * arm.cc (Arm_input_section::set_final_data_size): Compute
7898 accurate final data size instead of using current data size.
7900 2010-04-09 Doug Kwan <dougkwan@google.com>
7902 * layout.cc (Layout::choose_output_section): Handle script section
7904 (Layout::make_output_section_for_script): Add section type parameter.
7905 Handle script section types.
7906 * layout.h (Layout::make_output_section_for_script): Add section
7908 * output.cc (Output_section::Output_section): Initialize data member
7910 (Output_section::do_reset_address_and_file_offset): Do not set address
7911 to 0 if section is a NOLOAD section.
7912 * output.h (Output_section::is_noload): New method.
7913 (Output_section::set_is_noload): Ditto.
7914 (Output_section::is_noload_): New data member.
7915 * script-c.h (Script_section_type): New enum type.
7916 (struct Parser_output_section_header): Add new file section_type.
7917 * script-sections.cc (Sections_element::output_section_name): Add
7918 parameter for returning script section type.
7919 (Output_section_definition::output_section_name): Ditto.
7920 (Output_section_definition::section_type)P; New method.
7921 (Output_section_definiton::script_section_type_name): Ditto.
7922 (Output_section_definition::script_section_type_): New data member.
7923 (Output_section_definition::Output_section_definition): Initialize
7924 data member Output_section_definition::script_section_type_.
7925 (Output_section_definition::create_sections): Pass script section type
7926 to Layout::make_output_section_for_script.
7927 (Output_section_definition::output_section_name): Return script
7928 section type to caller.
7929 (Output_section_definition::set_section_address): Do not advance
7930 dot value and load address if section type is NOLOAD. Set address
7931 of NOLOAD sections regardless of section flags.
7932 (Output_section_definition::print): Print section type if it is
7933 not SCRIPT_SECTION_TYPE_NONE.
7934 (Output_section_definition::section_type): New method.
7935 (Output_section_definition::script_section_type_name): Ditto.
7936 (Script_sections::output_section_name): Add new parameter
7937 PSECTION_TYPE for returning script section type. Pass it to
7938 section elements. Handle discard sections.
7939 (Sort_output_sections::operator()): Handle NOLOAD sections.
7940 * script-sections.h (Script_sections::Section_type): New enum type.
7941 (Script_sections::output_section_name): Add a new parameter for
7942 returning script section type.
7943 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
7945 * yyscript.y (union): Add new field SECTION_TYPE.
7946 (COPY, DSECT, INFO, NOLOAD): New tokens.
7947 (opt_address_and_section_type): Change type to output_section_header.
7948 (section_type): New non-terminal
7949 (section_header): Handle section type.
7950 (opt_address_and_section_type): Return section type value.
7952 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
7954 * testsuite/plugin_common_test_1.c (foo): Add prototype.
7955 * testsuite/plugin_common_test_2.c (foo): Likewise.
7957 2010-04-08 Doug Kwan <dougkwan@google.com>
7959 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
7961 * output.cc (Output_section::add_merge_input_section): Simplify
7962 code and return status of Output_merge_base::add_input_section.
7963 Update merge section map only if Output_merge_base::add_input_section
7966 2010-04-07 Doug Kwan <dougkwan@google.com>
7968 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
7969 if section is marked as containing instructions but has no mapping
7971 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
7972 correct section index.
7973 (Arm_relobj::find_linked_text_section): Ditto.
7975 2010-04-07 Cary Coutant <ccoutant@google.com>
7977 * archive.cc (include_member): Destroy Read_symbols_data object before
7979 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
7980 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
7981 (Read_symbols_data::~Read_symbols_data) New destructor.
7982 (Section_relocs::Section_relocs) New constructor.
7983 (Section_relocs::~Section_relocs) New destructor.
7984 (Read_relocs_data::Read_relocs_data) New constructor.
7985 (Read_relocs_data::~Read_relocs_data) New destructor.
7986 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
7987 pointers to NULL after deleting.
7989 2010-04-07 Doug Kwan <dougkwan@google.com>
7991 * arm.cc: Replace "endianity" with "endianness" in comments.
7992 (Arm_exidx_cantunwind): Ditto.
7993 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
7994 (Arm_relobj::merge_flags_and_attributes): New method.
7995 (Arm_relobj::merge_flags_and_attributes_): New data member.
7996 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
7997 (Arm_relobj::scan_sections_for_stubs): Ditto.
7998 (Arm_relobj::do_read_symbols): Check to see if we really want to
7999 merge processor-specific flags and attributes. Exit early if
8000 an object is empty except for section names and the undefined symbol.
8001 (Target_arm::do_finalize_sections): Move check for ELF format to
8002 Arm_relobj::do_read_symbols. Merge processor specific flags and
8003 attributes from a regular object only when we have determined that
8004 it is aapropriate. Do not create an .ARM.attributes section in
8005 output if there is no regular input object.
8006 (Target_arm::merge_processor_specific_flags): Check
8007 --warn-mismatch before printing any error.
8008 (Target_arm::merge_object_attributes): Ditto.
8009 * gold.cc (queue_middle_tasks): Handle the case in which there is
8010 no regular object in input.
8011 * options.cc (General_options::parse_EB): New method.
8012 (General_options::parse_EL): Same.
8013 (General_options::General_options): Initialize endianness_.
8014 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8016 (General_options::Endianness): New enum.
8017 (General_options::endianness): New method.
8018 (General_options::endianness_): New data member.
8019 * parameters.cc (Parameters::set_options): Check target endianness.
8020 (Parameters::set_target_once): Ditto.
8021 (Parameters::check_target_endianness): New method.
8022 (parameters_force_valid_target): If either -EL or -EB is specified,
8023 use it to define endianness of default target.
8024 * parameters.h (Parameters::check_target_endianness): New method
8026 * target.h (class Target): Change "endianity" to "endianness"
8029 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8031 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8032 * configure: Regenerate.
8033 * Makefile.in: Regenerate.
8034 * testsuite/Makefile.in: Regenerate.
8036 2010-04-06 Cary Coutant <ccoutant@google.com>
8039 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8040 prevailing definitions of common symbols.
8041 * testsuite/plugin_test_6.sh: New test case.
8042 * testsuite/plugin_common_test_1.c: New test case.
8043 * testsuite/plugin_common_test_2.c: New test case.
8044 * testsuite/Makefile.am (plugin_test_6): New test case.
8045 * testsuite/Makefile.in: Regenerate.
8047 2010-04-06 Nick Clifton <nickc@redhat.com>
8049 * po/vi.po: New Vietnamese translation.
8051 2010-03-30 Doug Kwan <dougkwan@google.com>
8053 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8055 2010-03-25 Doug Kwan <dougkwan@google.com>
8057 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8058 to avoid a conversion warning on a 32-bit host.
8060 2010-03-24 Ian Lance Taylor <iant@google.com>
8062 * testsuite/script_test_3.t: Add a TLS segment.
8063 * testsuite/Makefile.am (check_PROGRAMS): Add
8064 tls_phdrs_script_test.
8065 (tls_phdrs_script_test_SOURCES): Define.
8066 (tls_phdrs_script_test_DEPENDENCIES): Define.
8067 (tls_phdrs_script_test_LDFLAGS): Define.
8068 (tls_phdrs_script_test_LDADD): Define.
8069 * testsuite/Makefile.in: Rebuild.
8071 2010-03-23 Cary Coutant <ccoutant@google.com>
8073 * fileread.cc (find_or_make_view): Fix comment.
8075 2010-03-23 Ian Lance Taylor <iant@google.com>
8077 * script-sections.cc (class Orphan_section_placement): Define
8078 PLACE_TLS and PLACE_TLS_BSS.
8079 (Orphan_section_placement::Orphan_section_placement): Initialize
8081 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8082 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8083 (tls_script_test_SOURCES): Define.
8084 (tls_script_test_DEPENDENCIES): Define.
8085 (tls_script_test_LDFLAGS): Define.
8086 (tls_script_test_LDADD): Define.
8087 * testsuite/Makefile.in: Rebuild.
8089 2010-03-22 Doug Kwan <dougkwan@google.com>
8091 * arm.cc (Arm_relocate_functions::abs8,
8092 Arm_relocate_functions::abs16): Use correct check for overflow
8093 specified in the ARM ELF specs.
8094 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8095 target of a BLX instruction specially.
8096 (Reloc_stub::stub_type_for_reloc): Ditto.
8097 (Relocate::relocate): Use symbolic names instead of numeric relocation
8098 codes to report error.
8099 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8101 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8102 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8103 thumb2_blx_out_of_range.stdout
8104 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8105 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8106 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8107 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8108 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8109 thumb2_blx_in_range, thumb2_blx_in_range.o,
8110 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8111 thumb2_blx_out_of_range.o): New rules.
8112 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
8113 thumb2_blx_in_range and thumb2_blx_out_of_range.
8114 * testsuite/Makefile.in: Regenerate.
8115 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8116 * testsuite/thumb_blx_in_range.s: New file.
8117 * testsuite/thumb_blx_out_of_range.s: New file.
8119 2010-03-22 Rafael Espindola <espindola@google.com>
8121 * archive.cc (Should_include): Move to archive.h.
8122 (should_include_member): Make it a member of Archive.
8124 (Add_lib_group_symbols): New.
8125 * archive.h: Include options.h.
8126 (Archive_member): Moved from Archive.
8127 (Should_include): Moved from archive.cc.
8129 (Add_lib_group_symbols): New.
8130 * dynobj.cc (do_should_include_member): New.
8131 * dynobj.h (do_should_include_member): New.
8132 * gold.cc (queue_initial_tasks): Update call to queue.
8133 * main.cc (main): Print lib group stats.
8134 * object.cc (do_should_include_member): New.
8135 * object.h: Include archive.h.
8136 (Object::should_include_member): New.
8137 (Object::do_should_include_member): New.
8138 (Sized_relobj::do_should_include_member): New.
8139 * options.cc (General_options::parse_start_lib): New.
8140 (General_options::parse_end_lib): New.
8141 (Input_arguments::add_file): Handle lib groups.
8142 (Input_arguments::start_group): Check we are not in a lib.
8143 (Input_arguments::start_lib): New.
8144 (Input_arguments::end_lib): New.
8145 * options.h (General_options): Add start_lib and end_lib.
8146 (Input_argument::lib_): New.
8147 (Input_argument::lib): New.
8148 (Input_argument::is_lib): New.
8149 (Input_file_lib): New.
8150 (Input_arguments::in_lib_): New.
8151 (Input_arguments::in_lib): New.
8152 (Input_arguments::start_lib): New.
8153 (Input_arguments::end_lib_): New.
8154 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8155 in unused members as preempted.
8156 (Sized_pluginobj::do_should_include_member): New.
8157 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8158 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8160 (Read_symbols::do_whole_lib_group): New.
8161 (Read_symbols::do_lib_group): New.
8162 (Read_symbols::do_read_symbols): Handle lib groups.
8163 (Read_symbols::get_name): Handle lib groups.
8164 * readsyms.h (Read_symbols): Add an archive member pointer.
8165 (Read_symbols::do_whole_lib_group): New.
8166 (Read_symbols::do_lib_group): New.
8167 (Read_symbols::member_): New.
8168 * script.cc (read_input_script): Update call to queue_soon.
8170 2010-03-19 Doug Kwan <dougkwan@google.com>
8172 * arm.cc (Stub_table::Stub_table): Initialize new data members
8173 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8174 (Stub_table::add_reloc_stub): Assign stub offset and update
8175 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8176 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
8178 (Stub_table::update_data_size_and_addralign): Use
8179 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
8180 instead of going over all reloc stubs.
8181 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
8182 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8183 Stringpool_template::offset_ to size of Stringpool_char.
8184 (Stringpool_template::new_key_offset): Remove code to initialize
8185 Stringpool_template::offset_.
8186 * stringpool.h (Stringpool_template::set_no_zero_null): Set
8187 Stringpool_template::offset_ to zero.
8189 2010-03-15 Doug Kwan <dougkwan@google.com>
8191 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8193 (Stringpool_template::new_key_offset): New method.
8194 (Stringpool_template::add_string): Assign offsets when adding new
8196 (Stringpool_template::set_string_offsets): Do not set string offsets
8197 when not optimizing.
8198 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
8200 (Chunked_vector::clear): Clear size_.
8201 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
8202 (Chunked_vector::size): Return size_.
8203 (Chunked_vector::push_back): Use size_ to find insert position.
8204 (Chunked_vector::size_): New data member.
8205 (Stringpool_template::set_no_zero_null): Assert string set is empty.
8206 (Stringpool_template::new_key_offset): New method declaration.
8207 (Stringpool_template::offset_): New data member.
8209 2010-03-15 Rafael Espindola <espindola@google.com>
8211 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
8212 Add_symbols' constructor.
8213 * readsyms.h (Add_symbols): Remove the input_group member.
8215 2010-03-10 Ian Lance Taylor <iant@google.com>
8217 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
8218 target to ask whether a reference to a symbol requires a stack
8220 * target.h (Target::is_call_to_non_split): New function.
8221 (Target::do_is_call_to_non_split): Declare virtual function.
8222 * target.cc: Include "symtab.h".
8223 (Target::do_is_call_to_non_split): New function.
8224 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
8226 2010-03-10 Cary Coutant <ccoutant@google.com>
8228 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
8229 (File_read::open[1]): Remove initial mapping of whole_file_view_.
8230 (File_read::open[2]): Add whole_file_view_ to list of views.
8231 (File_read::make_view): Remove test of whole_file_view_.
8232 (File_read::find_or_make_view): Create whole_file_view_ if
8234 (File_read::clear_views): Replace bool parameter with enum;
8235 adjust all callers. Don't delete views with permanent data;
8236 do delete cached views and views from archives if
8237 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
8238 if clearing the corresponding view.
8239 * fileread.h (File_read::Clear_views_mode): New enum.
8240 (File_read::View::is_permanent_view): New method.
8241 (File_read::clear_views): Replace bool parameter
8242 with enum; adjust all callers.
8243 * options.h (General_options): Change keep_files_mapped option;
8244 add map_whole_files.
8245 * readsyms.cc (Add_symbols::run): Delete sd_ object before
8247 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
8250 2010-03-10 David S. Miller <davem@davemloft.net>
8252 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
8254 2010-03-09 Sriraman Tallam <tmsriram@google.com>
8256 * icf.cc (get_section_contents): Add '@' marker after processing the
8259 2010-03-08 Doug Kwan <dougkwan@google.com>
8261 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
8262 due to a conversion warning.
8263 (Arm_relobj::update_output_local_symbol_count): Check for local
8264 symbol with unset output index.
8266 2010-03-05 Ian Lance Taylor <iant@google.com>
8268 * options.h (class General_options): Add --spare-dynamic-tags.
8269 * output.cc (Output_data_dynamic::set_final_data_size): Implement
8270 --spare-dynamic-tags.
8272 2010-03-05 Ian Lance Taylor <iant@google.com>
8274 * incremental.cc: Include "libiberty.h".
8276 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
8278 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
8279 function, is_info_ member.
8280 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
8281 (Versions::Versions): Update caller.
8282 (Versions::define_base_version): Likewise.
8283 (Versions::add_def): Likewise.
8285 2010-03-03 Sriraman Tallam <tmsriram@google.com>
8287 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
8288 (Scan::possible_function_pointer_reloc): New function.
8289 (Scan::local_reloc_may_be_function_pointer): Change to call
8290 possible_function_pointer_reloc.
8291 (Scan::global_reloc_may_be_function_pointer): Ditto.
8292 * icf.h (Icf::check_section_for_function_pointers): Change to reject
8293 relocations in ".data.rel.ro._ZTV" section.
8294 * testsuite/icf_safe_so_test.sh: Change to pass i386.
8295 * testsuite/icf_safe_so_test.cc: Ditto.
8296 * testsuite/icf_safe_test.cc: Ditto.
8297 * testsuite/icf_safe_test.sh: Ditto.
8299 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8300 Ian Lance Taylor <iant@google.com>
8302 * target-reloc.h (relocate_section): Check the symbol table index
8303 for -1U before setting the local symbol index.
8304 (scan_relocatable_relocs): If copying the relocation, record that
8305 the local symbol is required.
8306 * object.h (Symbol_value::is_output_symtab_index_set): New
8308 (Symbol_value::may_be_discarded_from_output_symtab): New
8310 (Symbol_value::has_output_symtab_entry): New function.
8311 (Symbol_value::needs_output_symtab_entry): Remove.
8312 (Symbol_value::output_symtab_index): Make sure the symbol index is
8314 (Symbol_value::set_output_symtab_index): Make sure the symbol
8315 index is not set. Make sure the new index is valid.
8316 (Symbol_value::set_must_have_output_symtab_entry): New function.
8317 (Symbol_value::has_output_dynsym_entry): New function.
8318 (Symbol_value::set_output_dynsym_index): Make sure the new index
8320 (Sized_relobj::set_must_have_output_symtab_entry): New function.
8321 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
8322 local symbol if permitted.
8323 (Sized_relobj::do_finalize_local_symbols): Call
8324 is_output_symtab_index_set rather than needs_output_symtab_entry.
8325 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
8326 rather than needs_output_symtab_entry. Call
8327 has_output_dynsym_entry rather than needs_output_dynsym_entry.
8328 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
8329 is_output_symtab_index_set rather than needs_output_symtab_entry.
8330 * testsuite/discard_locals_relocatable_test.c: New file.
8331 * testsuite/discard_locals_test.sh: Test -r.
8332 * testsuite/Makefile.am (check_DATA): Add
8333 discard_locals_relocatable_test1.syms,
8334 discard_local_relocatable_test2.syms.
8335 (MOSTLYCLEANFILES): Likewise. Also add
8336 discard_locals_relocatable_test1.lout and
8337 discard_locals_relocatable_test2.out.
8338 (discard_locals_relocatable_test1.syms): New target.
8339 (discard_locals_relocatable_test.o): New target.
8340 (discard_locals_relocatable_test1.out): New target.
8341 (discard_locals_relocatable_test2.syms): New target.
8342 (discard_locals_relocatable_test2.out): New target.
8343 (various): Add missing ../ld-new dependencies.
8344 * testsuite/Makefile.in: Rebuild.
8346 2010-03-03 Nick Clifton <nickc@redhat.com>
8348 * po/fi.po: New Finnish translation.
8350 2010-03-01 Doug Kwan <dougkwan@google.com>
8352 * layout.cc (Layout::Layout): Force section types of .init_array*,
8353 .preinit_array* and .fini_array* sections.
8354 * output.cc (Output_section::Input_section_sort_entry::has_priority):
8355 Fix check of return value of std::string::find.().
8356 (Output_section::Input_section_sort_compare::operator()): Remove
8357 comment about .init_array.
8358 (Output_section::Input_section_sort_init_fini_compare::operator()):
8360 (Output_section::sort_attached_input_sections): Handle .init_array
8361 and .fini_array specially.
8362 * output.h (Output_section::Inut_section_sort_compare): Update
8364 (Output_section::Input_section_sort_init_fini_compare): New struct.
8366 2010-02-26 Doug Kwan <dougkwan@google.com>
8368 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
8369 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
8370 * testsuite/debug_msg.sh: Avoid matching source line number for
8371 use of global variable undef_int.
8373 2010-02-26 Doug Kwan <dougkwan@google.com>
8375 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
8376 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
8377 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
8378 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
8379 * options.cc (General_options::General_options): Initialize member
8381 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
8382 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
8383 and rm_no_fix_v4bx.stdout
8384 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
8385 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
8386 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
8387 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
8388 and arm_no_fix_v4bx.
8389 * Makefile.in: Regenerate.
8390 * testsuite/arm_fix_v4bx.s: New file.
8391 * testsuite/arm_fix_v4bx.sh: Ditto.
8393 2010-02-24 Doug Kwan <dougkwan@google.com>
8395 * arm.cc (Target_arm::got_section): Make the .got section the first
8396 non RELRO section in the data segment.
8397 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
8398 suffixes of section names.
8400 2010-02-24 Doug Kwan <dougkwan@google.com>
8402 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
8403 flags and attributes merging if an input file is a binary file.
8404 * fileread.cc (Input_file::open): Record format of original file.
8405 * fileread.h (Input_file::Format): New enum type.
8406 (Input_file::Input_file): Initialize data member format_.
8407 (Input_file::format): New method definition.
8408 (Input_file::format_):: New data member.
8410 2010-02-24 Doug Kwan <dougkwan@google.com>
8412 * arm.cc (Arm_output_data_got): New class.
8413 (ARM_TCB_SIZE): New constant
8414 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
8415 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
8416 If user uses a script with a SECTIONS clause, issue only a warning
8417 for a misplaced EXIDX input section. Otherwise, issue an error.
8418 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
8420 (Target_arm::got_mode_index_entry): Handle static linking.
8421 (Target_arm::Scan::local): Ditto.
8422 (Target_arm::Scan::global): Ditto.
8423 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
8424 all incorrectly implemented relocations.
8425 (Target_arm::fix_exidx_coverage): Pass layout to
8426 Arm_output_section::fix_exidx_coverage.
8427 * layout.cc (Layout::section_name_mapping): Remove trailing dots
8428 from ".ARM.exidx." and ".ARM.extab.".
8430 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8432 * arm.cc (Target_arm::do_finalize_sections): Create attribute
8433 section if it does not already exist.
8434 * attributes.cc (Attributes_section_data::Attributes_section_data):
8435 Don't crash if size is zero.
8437 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8438 Ian Lance Taylor <iant@google.com>
8440 * gold.cc (queue_middle_tasks): If no input files were opened,
8442 * workqueue.h (Task_function::Task_function): Assert that there is
8445 2010-02-22 Doug Kwan <dougkwan@google.com>
8447 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
8448 * icf.cc (get_section_contents): Cast snprintf arguments to long long
8449 types to avoid warnings due to different uint64_t implementations
8452 2010-02-21 Doug Kwan <dougkwan@google.com>
8454 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
8455 handling of the maximum backward branch offset.
8456 (Arm_relocate_functions::thumb_branch_common): Ditto.
8457 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
8458 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
8459 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
8460 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
8461 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
8462 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
8463 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
8464 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
8465 thumb_bl_out_of_range thumb_bl_out_of_range.o,
8466 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
8467 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
8468 thumb2_bl_out_of_range.o): New rules.
8469 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
8470 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
8471 thumb2_bl_out_of_range
8472 * testsuite/Makefile.in: Regenerate.
8473 * testsuite/arm_bl_in_range.s: New file.
8474 * testsuite/arm_bl_out_of_range.s: Ditto.
8475 * testsuite/arm_branch_in_range.sh: Ditto.
8476 * testsuite/arm_branch_range.t: Ditto.
8477 * testsuite/thumb2_branch_range.t: Ditto.
8478 * testsuite/thumb_bl_in_range.s: Ditto.
8479 * testsuite/thumb_bl_out_of_range.s: Ditto.
8480 * testsuite/thumb_branch_range.t: Ditto.
8482 2010-02-20 Sriraman Tallam <tmsriram@google.com>
8484 * gc.h (gc_process_relocs): Change vectors to point to the new list.
8485 Add reloc offset information.
8486 * icf.cc (get_section_contents): Change iterators to point to the new
8487 vectors. Add reloc offset information to the contents.
8488 * icf.h (Icf::Sections_reachable_info): New typedef.
8489 (Icf::Sections_reachable_list): New typedef.
8490 (Icf::Offset_info): New typedef.
8491 (Icf::Reloc_info): New struct typedef.
8492 (Icf::Reloc_info_list): New typedef.
8493 (Icf::symbol_reloc_list): Delete method.
8494 (Icf::addend_reloc_list): Delete method.
8495 (Icf::section_reloc_list): Delete method.
8496 (Icf::reloc_info_list): New method.
8497 (Icf::reloc_info_list_): New member.
8499 2010-02-19 Doug Kwan <dougkwan@google.com>
8501 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
8502 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
8503 * arm.cc (Arm_relocation_functions): New forward declaration.
8504 (Target_arm::Target_arm): Initialize new data members
8505 got_mod_index_offset_ and tls_base_symbol_defined_.
8506 (Target_arm::Relocate::relocate_tls): New method.
8507 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
8508 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
8510 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
8511 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
8512 (Target_arm::got_mod_index_offset_,
8513 Target_arm::tls_base_symbol_defined_): New data members.
8514 (Target_arm::Scan::local, Target::Scan::global,
8515 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
8518 2010-02-18 Doug Kwan <dougkwan@google.com>
8520 * arm.cc (Arm_relobj::find_linked_text_section): New method.
8521 (Arm_relobj::make_exidx_input_section): Pass section index of linked
8522 text section as a parameter becuase some broken tools may not set
8523 the link in section header.
8524 (Target_arm::has_got_section): New method.
8525 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
8526 without any mapping symbol as data only. Remove warning.
8527 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
8528 link in its section header, try to discover the link by inspecting the
8529 REL31 relocation at the beginning of the section.
8530 (Target_arm::Scan::check_non_pic): Report name of offending relocation
8532 (Target_arm::Scan::global): Treat any reference to the symbol
8533 _GLOBAL_OFFSET_TABLE_ as a GOT access.
8535 2010-02-12 Sriraman Tallam <tmsriram@google.com>
8537 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
8538 (Scan::global_reloc_may_be_function_pointer): New function.
8539 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8540 (Scan::global_reloc_may_be_function_pointer): New function.
8541 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8542 (Scan::global_reloc_may_be_function_pointer): New function.
8543 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
8544 (Scan::global_reloc_may_be_function_pointer): New function.
8545 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
8546 (Scan::global_reloc_may_be_function_pointer): New function.
8547 (Scan::possible_function_pointer_reloc): New function.
8548 (Target_x86_64::can_check_for_function_pointers): New function.
8549 * gc.h (gc_process_relocs): Scan relocation types to determine if
8550 function pointers were taken for targets that support it.
8551 * icf.cc (Icf::find_identical_sections): Include functions for
8552 folding in safe ICF whose pointer is not taken.
8553 * icf.h (Secn_fptr_taken_set): New typedef.
8554 (fptr_section_id_): New member.
8555 (section_has_function_pointers): New function.
8556 (set_section_has_function_pointers): New function.
8557 (check_section_for_function_pointers): New function.
8558 * options.h: Fix comment for safe ICF option.
8559 * target.h (can_check_for_function_pointers): New function.
8560 * testsuite/Makefile.am: Add icf_safe_so_test test case.
8561 Modify icf_safe_test for X86-64.
8562 * testsuite/Makefile.in: Regenerate.
8563 * testsuite/icf_safe_so_test.cc: New file.
8564 * testsuite/icf_safe_so_test.sh: New file.
8565 * testsuite/icf_safe_test.cc (kept_func_3): New function.
8566 (main): Change to take pointer to function kept_func_3.
8567 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
8568 folding is done correctly for X86-64.
8570 2010-02-12 David S. Miller <davem@davemloft.net>
8572 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
8573 is_symbolless parameter.
8574 (Output_reloc<SHT_REL>::is_symbolless): New.
8575 (Output_reloc<SHT_REL>::is_symbolless_): New.
8576 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
8577 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
8578 (Output_reloc<SHT_RELA>::is_symbolless): New.
8579 (Output_data_reloc::add_global): Handle is_symbolless.
8580 (Output_data_reloc::add_global_relative): Likewise.
8581 (Output_data_reloc::add_local): Likewise.
8582 (Output_data_reloc::add_local_relative): Likewise.
8583 (Output_data_reloc::add_symbolless_global_addend): New.
8584 (Output_data_reloc::add_symbolless_local_addend): New.
8585 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
8587 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
8588 instead of ->is_relative_
8589 (Output_reloc::write): Likewise.
8590 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
8591 (Output_reloc::write_rel): Simplify.
8593 * sparc.cc (Target_sparc::Scan::local): Use
8594 ->add_symbolless_local_addend as needed.
8595 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
8596 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
8597 based upon relocation offset.
8599 2010-02-11 Doug Kwan <dougkwan@google.com>
8601 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
8602 (Target_arm::Scan::global): Ditto. Also remove a comment before the
8603 beginning of function.
8604 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
8605 and MOVT_ABS relocations. Those are non issued in scanning. Fix
8606 parameter is_32bit in calls to should_apply_static_reloc.
8607 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
8608 (check_DATA): Add arm_abs_global.stdout.
8609 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
8610 arm_abs_global.stdout): New rules.
8611 (MOSTLLYCLEANFILES): Add arm_abs_global
8612 * Makefile.in: Regenerate.
8613 * testsuite/arm_abs_global.s: New file.
8614 * testsuite/arm_abs_global.sh: Ditto.
8615 * testsuite/arm_abs_lib.s: Ditto.
8617 2010-02-11 Ian Lance Taylor <iant@google.com>
8619 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
8621 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
8622 Allocate_commons_task first.
8623 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
8624 task, rather than symtab_lock_.
8625 (Gc_process_relocs::~Gc_process_relocs): New function.
8626 (Gc_process_relocs::is_runnable): Check this_blocker_.
8627 (Gc_process_relocs::locks): Use next_blocker_ rather than
8629 (Scan_relocs::~Scan_relocs): New function.
8630 (Scan_relocs::is_runnable): Check this_blocker_ rather than
8632 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
8634 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
8635 fields. Add this_blocker_ and next_blocker_ fields. Adjust
8636 constructor accordingly.
8637 (class Gc_process_relocs): Likewise.
8638 (class Scan_relocs): Likewise.
8639 * common.h (class Allocate_commons_task): Remove symtab_lock_
8640 field, and corresponding constructor parameter.
8641 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
8643 (Allocate_commons_task::locks): Likewise.
8645 2010-02-11 Ian Lance Taylor <iant@google.com>
8647 * gold-threads.h (class Once): Define.
8648 (class Initialize_lock): Rewrite as child of Once.
8649 * gold-threads.cc (class Once_initialize): Define.
8650 (once_pointer_control): New static variable.
8651 (once_pointer, once_arg): New static variables.
8652 (c_run_once): New static function.
8653 (Once::Once, Once::run_once, Once::internal_run): New functions.
8654 (class Initialize_lock_once): Remove.
8655 (initialize_lock_control): Remove.
8656 (initialize_lock_pointer): Remove.
8657 (initialize_lock_once): Remove.
8658 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
8659 (Initialize_lock::initialize): Rewrite.
8660 (Initialize_lock::do_run_once): New function.
8661 * archive.cc (Archive::interpret_header): Only clear name if it is
8663 * fileread.cc: Include "gold-threads.h"
8664 (file_counts_lock): New static variable.
8665 (file_counts_initialize_lock): Likewise.
8666 (File_read::release): Only increment counts when using --stats.
8667 Use a lock around the increment.
8668 * parameters.cc (class Set_parameters_target_once): Define.
8669 (set_parameters_target_once): New static variable.
8670 (Parameters::Parameters): Move here from parameters.h.
8671 (Parameters::set_target): Rewrite.
8672 (Parameters::set_target_once): New function.
8673 (Parameters::clear_target): Move here and rewrite.
8674 * parameters.h (class Parameters): Update declarations. Add
8675 set_parameters_target_once_ field.
8676 (Parameters::Parameters): Move to parameters.cc.
8677 (Parameters::clear_target): Likewise.
8678 * readsyms.cc (Read_symbols::do_group): Create a Start_group
8680 (Start_group::~Start_group): New function.
8681 (Start_group::is_runnable): New function.
8682 (Start_group::locks, Start_group::run): New functions.
8683 (Finish_group::run): Change saw_undefined to size_t.
8684 * readsyms.h (class Start_group): Define.
8685 (class Finish_group): Change saw_undefined_ field to size_t.
8686 (Finish_group::Finish_group): Remove saw_undefined and
8687 this_blocker parameters. Change all callers.
8688 (Finish_group::set_saw_undefined): New function.
8689 (Finish_group::set_blocker): New function.
8690 * symtab.h (class Symbol_table): Change saw_undefined to return
8691 size_t. Change saw_undefined_ field to size_t.
8692 * target-select.cc (Set_target_once::do_run_once): New function.
8693 (Target_selector::Target_selector): Initialize set_target_once_
8694 field. Don't initialize lock_ and initialize_lock_ fields.
8695 (Target_selector::instantiate_target): Rewrite.
8696 (Target_selector::set_target): New function.
8697 * target-select.h (class Set_target_once): Define.
8698 (class Target_selector): Update declarations. Make
8699 Set_target_once a friend. Remove lock_ and initialize_lock_
8700 fields. Add set_target_once_ field.
8702 2010-02-10 Ian Lance Taylor <iant@google.com>
8704 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
8706 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
8707 (queue_middle_tasks): Add all blockers before queueing any tasks.
8708 (queue_final_tasks): Likewise.
8709 * token.h (Task_token::add_blockers): New function.
8710 * object.h (Input_objects::number_of_relobjs): New function.
8712 2010-02-10 Ian Lance Taylor <iant@google.com>
8714 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
8715 shared, not if not position independent.
8716 * x86_64.cc (Relocate::relocate_tls): Likewise.
8717 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
8718 (tls_pie_pic_test): New target.
8719 * testsuite/Makefile.in: Rebuild.
8721 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
8722 (tls_test_main_pie.o, tls_test_pie.o): New targets.
8723 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
8724 * testsuite/Makefile.in: Rebuild.
8726 2010-02-09 David S. Miller <davem@davemloft.net>
8728 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
8729 R_SPARC_RELATIVE using ->add_local_relative().
8730 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
8732 * output.h (Output_data_dynamic::add_section_size): New method
8733 that takes two Output_data objects.
8734 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
8735 entry param. Handle it in initializers.
8736 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
8737 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
8738 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
8740 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
8741 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
8742 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
8743 for dynrel_includes_plt.
8744 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8745 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8746 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
8748 (Target_sparc::do_finalize_sections): Update to pass true for
8749 dynrel_includes_plt.
8750 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
8751 output before .rela.plt
8752 (Target_powerpc::do_finalize_sections): Update to pass true for
8753 dynrel_includes_plt when 32-bit.
8755 2010-02-08 Doug Kwan <dougkwan@google.com>
8757 * arm.cc (Arm_relobj::simple_input_section_output_address): New
8759 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
8760 Arm_relobj::scan_section_for_cortex_a8_stubs,
8761 Arm_relobj::do_relocation_section): Instead of calling
8762 Output_section::output_address, use faster
8763 Arm_relobj::simple_input_section_output_address.
8765 2010-02-08 David S. Miller <davem@davemloft.net>
8767 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
8768 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
8769 relocation helper function.
8771 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
8772 just like R_SPARC_GOT{10,13,22}.
8773 (Target_sparc::Scan::local): Likewise.
8774 (Target_sparc::Relocate:relocate): Likewise.
8776 2010-02-06 Ian Lance Taylor <iant@google.com>
8778 * configure.ac: Rewrite targetobjs duplicate removal code to use
8779 only shell constructs.
8780 * configure: Rebuild.
8782 2010-02-05 Doug Kwan <dougkwan@google.com>
8785 * arm.cc (Arm_relobj::section_is_scannable): New method.
8786 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
8787 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
8789 2010-02-04 Doug Kwan <dougkwan@google.com>
8792 * arm-reloc-property.cc (cstdio): Include.
8793 * configure.ac (targetobjs): Remove duplicates.
8794 * configure: Regenerate.
8795 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
8796 big and little endian version for a given address size.
8798 2010-02-03 Doug Kwan <dougkwan@google.com>
8800 * arm-reloc-property.cc
8801 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8803 * arm-reloc-property.h
8804 (Arm_reloc_property_table::get_implemented_static_reloc_property):
8805 New method definition.
8806 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8808 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
8810 (GOT_PREL): Change implemented to Y.
8811 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
8812 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
8813 (Arm_relocate_functions::movw_abs_nc): Remove method.
8814 (Arm_relocate_functions::movt_abs): Ditto.
8815 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
8816 (Arm_relocate_functions::thm_movt_abs): Ditto.
8817 (Arm_relocate_functions::movw_rel_nc): Ditto.
8818 (Arm_relocate_functions::movw_rel): Ditto.
8819 (Arm_relocate_functions::movt_rel): Ditto.
8820 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
8821 (Arm_relocate_functions:thm_movw_rel): Ditto.
8822 (Arm_relocate_functions:thm_movt_rel): Ditto.
8823 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
8824 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
8825 New method definitions.
8826 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
8827 (Arm_relocation_functions::arm_grp_ldr): Ditto.
8828 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
8829 (Arm_relocation_functions::arm_grp_ldc): Ditto.
8830 (Target_arm::Relocate::relocate): Check for non-static or
8831 unimplemented relocation code and exit early. Change calls to
8832 Target_arm::reloc_uses_thumb_bit and
8833 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
8834 instead. Refactor code to handle similar relocations to increase
8835 code sharing. Remove check for unsupported relocation code in switch
8837 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
8838 relocation property table to find out size. Change error message to
8839 print out the name of a relocation code instead of the numeric value.
8840 (Target_arm::scan_reloc_for_stub): Use relocation property table
8841 instead of calling Target_arm::reloc_uses_thumb_bit().
8843 2010-02-02 Doug Kwan <dougkwan@google.com>
8845 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
8846 types of relaxed input section.
8848 2010-02-02 Doug Kwan <dougkwan@google.com>
8850 * Makefile.am (HFILES): Add arm-reloc-property.h.
8852 (TARGETSOURCES): Add arm-reloc-property.cc
8853 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
8854 (libgold_a_SOURCES): $(DEFFILES)
8855 * Makefile.in: Regenerate.
8856 * arm-reloc-property.cc: New file.
8857 * arm-reloc-property.h: New file.
8858 * arm-reloc.def: New file.
8859 * arm.cc: Update comments.
8860 (arm-reloc-property.h): New included header.
8861 (arm_reloc_property_table): New global variable.
8862 (Target_arm::do_select_as_default_target): New method definition.
8863 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
8864 arm-reloc-property to targ_extra_obj.
8865 * parameters.cc (set_parameters_target): Call
8866 Target::select_as_default_target().
8867 * target.h (Target::select_as_default_target): New method definition.
8868 (Target::do_select_as_default_target): Same.
8870 2010-02-01 Doug Kwan <dougkwan@google.com>
8872 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
8873 first_output_text_section_.
8874 (Arm_exidx_fixup::first_output_text_section): New method definition.
8875 (Arm_exidx_fixup::first_output_text_section_): New data member.
8876 (Arm_exidx_fixup::process_exidx_section): Record the first text
8877 output section seen.
8878 (Arm_output_section::fix_exidx_coverage): Set correct linked section
8879 and entsize in output section header.
8881 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8883 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
8884 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
8885 (Arm_relocate_functions::thm_alu11): New Method.
8886 (Arm_relocate_functions::thm_pc8): New Method.
8887 (Arm_relocate_functions::thm_pc12): New Method.
8888 (Target_arm::Scan::local): Handle the relocations.
8889 (Target_arm::Scan::global): Likewise.
8890 (Target_arm::Relocate::relocate): Likewise.
8891 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8893 2010-01-29 Doug Kwan <dougkwan@google.com>
8895 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
8896 of relocation types as ld.
8898 2010-01-29 Doug Kwan <dougkwan@google.com>
8900 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
8902 (Arm_relocate_functions::thumb_branch_common): Ditto.
8903 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
8904 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
8905 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
8906 Arm_relocate_functions::jump24): Remove.
8907 (Target_arm::Relocate::relocate): Adjust code to call
8908 Arm_relocation_functions::arm_branch_common and
8909 Arm_relocation_functions::thumb_branch_common instead of their removed
8910 wrappers. Merge switch-cases together to reduce source code size.
8912 2010-01-29 Doug Kwan <dougkwan@google.com>
8914 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
8915 output_local_symbol_count_needs_update_.
8916 (Arm_relobj::output_local_symbol_count_needs_update,
8917 Arm_relobj::set_output_local_symbol_count_needs_update,
8918 Arm_relobj::update_output_local_symbol_count): New methods.
8919 (Arm_relobj::output_local_symbol_count_needs_update_): New data
8921 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
8922 of pointed function as in a R_ARM_PREL31 relocation.
8923 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
8924 for output local symbol count updating.
8925 (Target_arm::do_relax): Update output local symbol counts in objects
8927 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
8929 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8931 * arm.cc: Added support for the ARM relocations:
8932 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
8933 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
8934 (Arm_relocate_functions::movw_rel_nc): Renamed (was
8936 (Arm_relocate_functions::movw_rel): New method.
8937 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
8938 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
8940 (Arm_relocate_functions::thm_movw_rel): New method.
8941 (Arm_relocate_functions::thm_movt_rel): Renamed (was
8943 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
8945 (Target_arm::Scan::global): Likewise.
8946 (Target_arm::Relocate::relocate): Likewise.
8947 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8950 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8952 * arm.cc: Added support for ARM group relocations.
8953 (Target_arm::reloc_needs_sym_origin): New method.
8954 (Arm_relocate_functions::calc_grp_kn): New method.
8955 (Arm_relocate_functions::calc_grp_residual): New method.
8956 (Arm_relocate_functions::calc_grp_gn): New method.
8957 (Arm_relocate_functions::arm_grp_alu): New Method.
8958 (Arm_relocate_functions::arm_grp_ldr): New Method.
8959 (Arm_relocate_functions::arm_grp_ldrs): New Method.
8960 (Arm_relocate_functions::arm_grp_ldc): New Method.
8961 (Target_arm::Scan::local): Handle the ARM group relocations.
8962 (Target_arm::Scan::global): Likewise.
8963 (Target_arm::Relocate::relocate): Likewise.
8964 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8967 2010-01-26 Doug Kwan <dougkwan@google.com>
8969 * arm.cc (set): Include.
8970 (class Arm_exidx_fixup): Change type of last_input_section_ to const
8972 (Arm_output_section::Text_section_list): New type.
8973 (Arm_output_section::append_text_sections_to_list): New method.
8974 (Arm_output_section::fix_exidx_coverage): Ditto.
8975 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
8976 (Arm_relobj::convert_input_section_to_relaxed_section): Use
8977 Relobj::set_section_offset() instead of
8978 Sized_relobj::invalidate_section_offset().
8979 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
8980 parameter for section headers. Ignore relocation sections for
8981 unallocated sections and EXIDX sections.
8982 (Target_arm::fix_exidx_coverage): New method.
8983 (Target_arm::output_section_address_less_than): New type.
8984 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
8985 linked text section instead of the EXIDX section.
8986 (Arm_output_section::create_stub_group): Add an assertion to check
8987 that this is not an EXIDX output section.
8988 (Arm_output_section::append_text_sections_to_list): New method.
8989 (Arm_output_section::fix_exidx_coverage): Ditto.
8990 (Arm_relobj::scan_sections_for_stubs): Adjust call to
8991 Arm_relobj::section_needs_reloc_stub_scanning.
8992 (Target_arm::do_relax): Fix EXIDX output section coverage in the
8994 (Target_arm::fix_exidx_coverage): New method.
8995 * object.h (Relobj::set_output_section): New method.
8996 (Sized_relobj::invalidate_section_offset): Remove method.
8997 (Sized_relobj::do_invalidate_section_offset): Remove method.
8998 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9000 2010-01-25 Doug Kwan <dougkwan@google.com>
9002 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9003 Fix warning due to signed and unsigned comparison on a 32-bit host.
9005 2010-01-22 Doug Kwan <dougkwan@google.com>
9007 * arm.cc (Target_arm::do_relax): Record an output section for section
9008 offset adjustment it contains any stub table that has changed.
9009 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9010 offsets in an output section if necessary.
9011 * output.cc (Output_section::Output_section): Initialize
9012 section_offsets_need_adjustments_.
9013 (Output_section::add_input_section_for_script): Renamed to
9014 Output_section::add_simple_input_section.
9015 (Output_section::save_states): Add a comment.
9016 (Output_section::discard_states): New method defintion.
9017 (Output_section::adjust_section_offsets): Same.
9018 * output.h (Output_section::add_input_section_for_script): Renamed to
9019 Output_section::add_simple_input_section.
9020 (Output_section::discard_states): New method declaration.
9021 (Output_section::adjust_section_offsets): Same.
9022 (Output_section::section_offsets_need_adjustment,
9023 Output_section::set_section_offsets_need_adjustment): New method
9025 (Output_section::section_offsets_need_adjustment_): New data member.
9026 * script-sections.cc
9027 (Output_section_element_input::set_section_address): Adjust code for
9028 renaming of Output_section::add_input_section_for_script.
9029 (Orphan_output_section::set_section_address): Same.
9031 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9033 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9034 Fix_v4bx enum values .
9035 * gold/options.h (General_options): New option definitions.
9036 (General_options::fix_v4bx): New method.
9037 (General_options::Fix_v4bx): New enum.
9038 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9039 (General_options::parse_fix_v4bx_interworking): New method.
9041 2010-01-22 Doug Kwan <dougkwan@google.com>
9043 * arm.cc (Arm_exidx_fixup): New class.
9045 2010-01-21 Doug Kwan <dougkwan@google.com>
9047 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9049 (Arm_exidx_section_offset_map): New type.
9051 2010-01-21 Doug Kwan <dougkwan@google.com>
9053 * arm.cc (Arm_exidx_input_section): New class.
9054 (Arm_relobj::exidx_input_section_by_link,
9055 Arm_relobj::exidx_input_section_by_shndx,
9056 Arm_relobj::make_exidx_input_section): New methods.
9057 (read_arm_attributes_section): Remove.
9058 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9059 information about them.
9060 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9063 2010-01-20 Doug Kwan <dougkwan@google.com>
9065 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9066 Input_section_specifier to Section_id.
9067 (Target_arm::new_arm_input_section: Adjust code for change of key
9069 (Target_arm::find_arm_input_section): Ditto.
9070 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9071 (Section_id): Remove.
9072 (Garbage_collection::Section_id_hash): Remove.
9073 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9074 (Section_id): Remove.
9075 (Icf::Section_id_hash): Remove.
9076 * object.h (Section_id, Const_section_id, Section_id_hash,
9077 Const_section_id_hash): New type definitions.
9078 * output.cc (Output_section::add_relaxed_input_section): Change to
9079 use Const_section_id instead of Input_section_specifier as key type.
9080 (Output_section::add_merge_input_section): Ditto.
9081 (Output_section::build_relaxation_map): Change to use Section_id
9082 instead of Input_section_specifier as key type.
9083 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9085 (Output_section::convert_input_sections_to_relaxed_sections): Change
9086 to use Const_section_id instead of Input_section_specifier as key type.
9087 (Output_section::find_merge_section): Ditto.
9088 (Output_section::find_relaxed_input_section): Ditto.
9089 * output.h (Input_section_specifier): Remove class.
9090 (Output_section::Output_section_data_by_input_section_map): Change
9091 key type to Const_section_id.
9092 (Output_section::Output_relaxed_input_section_by_input_section_map):
9094 (Output_section::Relaxation_map): Change key type to Section_id.
9096 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9098 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9099 (class Arm_v4bx_stub): New class.
9100 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9101 (Stub_factory::make_arm_v4bx_stub): New method.
9102 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9103 (Stub_table::empty): Handle v4bx stubs.
9104 (Stub_table::add_arm_v4bx_stub): New method.
9105 (Stub_table::find_arm_v4bx_stub): New method.
9106 (Arm_relocate_functions::v4bx): New method.
9107 (Target_arm::fix_v4bx): New method.
9108 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9109 (Stub_table::relocate_stubs): Likewise.
9110 (Stub_table::do_write): Likewise.
9111 (Stub_table::update_data_size_and_addralign): Likewise.
9112 (Stub_table::finalize_stubs): Likewise.
9113 (Target_arm::Scan::local): Likewise.
9114 (Target_arm::Scan::global): Likewise.
9115 (Target_arm::do_finalize_sections): Likewise.
9116 (Target_arm::Relocate::relocate): Likewise.
9117 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9119 (Target_arm::scan_reloc_for_stub): Likewise.
9120 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9122 2010-01-19 Ian Lance Taylor <iant@google.com>
9124 * output.cc (Output_section_headers::do_sized_write): Write large
9125 segment count to sh_info field.
9126 (Output_file_header::do_sized_write): For large segment count,
9127 write PN_XNUM to e_phnum field.
9129 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9131 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9132 (Arm_relocate_functions::thm_jump8): New function.
9133 (Arm_relocate_functions::thm_jump11): New function.
9134 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
9136 (Target_arm::Scan::global): Likewise.
9137 (Target_arm::Relocate::relocate): Likewise.
9138 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9141 2010-01-14 Doug Kwan <dougkwan@google.com>
9143 * arm.cc (map, utility): Include headers.
9144 (Target_arm::apply_cortex_a8_workaround): New method.
9145 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9146 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9147 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9148 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9149 the --[no-]fix-cortex-a8 command line options.
9150 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9151 (Target_arm::relocate_stub): Use addend in instruction template.
9152 * options.h (DEFINE_bool): Set the user-set flag.
9153 (General_options): Add --[no-]-fix-cortex options.
9154 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
9155 : Update fast look-up map after conversion.
9157 2010-01-14 Sriraman Tallam <tmsriram@google.com>
9159 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9160 in the first pass of do_layout.
9162 2010-01-13 Doug Kwan <dougkwan@google.com>
9164 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9165 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9166 apparent compiler problem of not folding static constant integral
9167 data members of elfcpp::Elf_sizes<32>.
9169 2010-01-13 Doug Kwan <dougkwan@google.com>
9171 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9172 Arm_relobj::section_needs_cortex_a8_stub_scanning,
9173 Arm_relobj::scan_section_for_cortex_a8_erratum,
9174 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
9175 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
9176 sections to scan for relocation stubs into a new method
9177 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
9178 relocation and Cortex-A8 stub scanning.
9179 (Target_arm::do_relax): Force stubs to be after stubbed sections
9180 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
9181 the beginning of a new relaxation pass. Update a comment.
9182 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
9184 2010-01-12 Ian Lance Taylor <iant@google.com>
9186 * target-reloc.h (visibility_error): New inline function.
9187 (relocate_section): Call visibility_error.
9188 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
9189 (MOSTLYCLEANFILES): Likewise.
9190 (protected_4_pic.o, protected_3.err): New targets.
9191 * testsuite/protected_4.cc: New file.
9193 2010-01-12 Doug Kwan <dougkwan@google.com>
9195 * arm.cc (Cortex_a8_reloc): New class.
9196 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
9197 and cortex_a8_relocs_info_.
9198 (Target_arm::fix_cortex_a8): New method definition.
9199 (Target_arm::Cortex_a8_relocs_info): New type.
9200 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
9201 New data member declarations.
9202 (Target_arm::scan_reloc_for_stub): Record information about
9203 relocations for THUMB branches that might be exempted from the
9204 Cortex-A8 workaround.
9205 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
9206 at the beginning of a relaxation pass.
9208 2010-01-12 Doug Kwan <dougkwan@google.com>
9210 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
9211 (Arm_relobj::Mapping_symbol_position,
9212 Arm_reloj::Mapping_symbol_position_less,
9213 Arm_relobj::Mapping_symbols_info): New types.
9214 (Target_arm::is_mapping_symbol_name): New method definition.
9215 (Arm_relobj::do_count_local_symbols): Save information about mapping
9218 2010-01-11 Doug Kwan <dougkwan@google.com>
9220 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
9221 Arm_relocate_functions::thumb32_branch_upper,
9222 Arm_relocate_functions::thumb32_branch_lower,
9223 Arm_relocate_functions::thumb32_cond_branch_offset,
9224 Arm_relocate_functions::thumb32_cond_branch_upper,
9225 Arm_relocate_functions::thumb32_cond_branch_lower,
9226 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
9227 branch offset encoding.
9228 (Arm_relocate_functions::thumb_branch_common): Use new branch
9229 offset encoding methods to avoid code duplication.
9230 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
9231 (Stub_addend_reader::operator()): Use new branch encoding method
9232 to avoid code duplication.
9234 2010-01-11 Doug Kwan <dougkwan@google.com>
9236 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
9237 (Target_arm::do_finalize_sections): Define special EXIDX section
9238 symbols only if referenced.
9239 * gc.h (Garbage_collection::add_reference): New method.
9240 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
9243 2010-01-11 Ian Lance Taylor <iant@google.com>
9245 * script.cc (Version_script_info::build_expression_list_lookup):
9246 Change complaing about duplicate wildcard match from error to
9249 * script.cc (class Lazy_demangler): Recreate--revert part of patch
9251 (Version_script_info::Version_script_info): Initialize globs_,
9252 default_version_, default_is_global_, and exact_. Don't
9253 initialize globals_ or locals_.
9254 (Version_script_info::build_lookup_tables): Build local symbols
9256 (Version_script_info::unquote): New function.
9257 (Version_script_info::add_exact_match): New function.
9258 (Version_script_info::build_expression_list_lookup): Remove lookup
9259 parameter. Add is_global parameter. Change all callers. Handle
9260 wildcard pattern specially. Unquote pattern. Call
9262 (Version_script_info::get_name_to_match): New function.
9263 (Version_script_info::get_symbol_version): New function.
9264 (Version_script_info::get_symbol_version_helper): Remove.
9265 (Version_script_info::check_unmatched_names): Call unquote.
9266 * script.h (class Version_script_info): Change get_symbol_version
9267 to be non-inline and add is_global parameter; change all callers.
9268 Rewrite symbol_is_local. Update declarations. Define struct
9269 Version_tree_match, Exact, Globs. Don't define struct Lookup.
9270 Remove globals_ and locals_ members. Add exact_, globs_,
9271 default_version_, is_global_.
9272 (Version_script_info::Glob): Remove pattern, add expression and
9273 is_global. Update constructor. Change all callers.
9274 * dynobj.cc (Versions::finalize): Mark the version symbol as the
9276 (Versions::symbol_section_contents): If a symbol is undefined, or
9277 defined in a dynamic object, set the version index to
9279 * symtab.cc (Symbol_table::add_from_relobj): Don't call
9281 (Symbol_table::add_from_pluginobj): Likewise.
9282 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
9284 2010-01-11 Doug Kwan <dougkwan@google.com>
9286 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
9287 (incremental_dump_LDADD): Add linking option for libintl.
9288 * Makefile.in: Regenerate.
9290 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
9293 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
9295 * testsuite/Makefile.in: Regenerated.
9297 2010-01-10 Doug Kwan <dougkwan@google.com>
9299 * options.h (DEFINE_var): Use parentheses around argument varname__
9300 in macro body to avoid any unintended subsequent substitutions.
9302 2010-01-10 Ian Lance Taylor <iant@google.com>
9304 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
9305 candidates before doing symbol resolution.
9307 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
9308 ODR candidates if only one is weak.
9310 2010-01-08 Ian Lance Taylor <iant@google.com>
9312 * script.cc (Version_script_info::build_expression_list_lookup):
9313 Don't warn about ambiguous version, just record the ambiguity.
9314 (Version_script_info::get_symbol_version_helper): Give error if
9315 version is ambiguous.
9317 2010-01-08 Doug Kwan <dougkwan@google.com>
9319 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
9320 prev_data_size_ and prev_addralign_. Remove initializer for
9321 deleted data member has_been_changed_.
9322 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
9323 to determine if the table is empty.
9324 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
9326 (Stub_table::add_reloc_stub): Define method in class definition
9327 instead of just declaring it there.
9328 (Stub_table::add_cortex_a8_stub): New method definition.
9329 (Stub_table::update_data_size_and_addralign): Ditto.
9330 (Stub_table::finalize_stubs): Ditto.
9331 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
9332 (Stub_table::do_addralign_): Return address alignment in the
9333 (Stub_table::do_reset_address_and_file_offset): Define method in
9334 class definition instead of declaring it there. Set current data
9335 size to be the data size of the previous pass.
9336 (Stub_table::set_final_data_size): Use current data size as the
9338 (Stub_table::relocate_stub): Change parameter type of stub from
9339 Reloc_stub pointer to Stub pointer.
9340 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
9341 (Stub_table::Cortex_a8_stub_list): New typedef.
9342 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
9343 Stub_table::prev_addralign_): New data member.
9344 (Arm_relobj::Arm_relobj): Initialize data member
9345 section_has_cortex_a8_workaround_.
9346 (Arm_relobj::section_has_cortex_a8_workaround,
9347 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
9349 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
9351 (Target_arm::relocate_stub): Change parameter type of stub from
9352 Reloc_stub pointer to Stub pointer.
9353 (Insn_template::size, Insn_template::alignment): Handle
9354 THUMB16_SPECIAL_TYPE.
9355 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
9356 Stub_table::update_data_size_and_addralign,
9357 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
9359 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
9360 (Stub_table::do_write): Ditto.
9361 (Target_arm::do_relax): Adjust code for changes in Stub_table.
9363 2010-01-08 Ian Lance Taylor <iant@google.com>
9366 * symtab.h (class Symbol): Remove fields is_target_special_ and
9367 has_plt_offset_. Add field is_defined_in_discarded_section_.
9368 (Symbol::is_defined_in_discarded_section): New function.
9369 (Symbol::set_is_defined_in_discarded_section): New function.
9370 (Symbol::has_plt_offset): Rewrite.
9371 (Symbol::set_plt_offset): Verify that new offset is not -1U.
9372 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
9373 Don't initialize is_target_special_ or has_plt_offset_.
9374 Initialize is_defined_in_discarded_section_.
9375 (Symbol_table::add_from_relobj): If appropriate, set
9376 is_defined_in_discarded_section.
9377 * resolve.cc (Symbol::override_base_with_special): Don't test
9378 is_target_special_. Change has_plt_offset_ to has_plt_offset().
9379 * target-reloc.h (relocate_section): Do special handling for
9380 symbols defined in discarded sections for global symbols as well
9383 2010-01-08 Ian Lance Taylor <iant@google.com>
9385 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
9386 the SHT_SYMTAB case.
9388 2010-01-08 Ian Lance Taylor <iant@google.com>
9390 * object.cc (Sized_relobj::do_layout): Don't get confused if
9391 layout_eh_frame returns NULL.
9393 2010-01-08 Ian Lance Taylor <iant@google.com>
9396 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
9397 dynamic symbol table, use the normal symbol table.
9398 (Sized_dynobj::do_read_symbols): Remove assertion about type of
9401 2010-01-08 Ian Lance Taylor <iant@google.com>
9404 * layout.cc (Layout::include_section): Remove .gnu_debuglink
9407 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
9409 * version.cc (print_version): Change to "Copyright 2010".
9411 2010-01-08 Ian Lance Taylor <iant@google.com>
9415 * i386.cc (class Target_i386): Change return type of plt_section
9417 (class Output_data_plt_i386): Add tls_desc_rel_ field.
9418 (Output_data_plt_i386::Output_data_plt_i386): Initialize
9419 tls_desc_rel_ field.
9420 (Output_data_plt_i386::rel_tls_desc): New function.
9421 (Target_i386::rel_tls_desc_section): New function.
9422 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
9423 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
9424 R_386_TLS_DESC reloc in rel_tls_desc_section.
9425 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
9426 Define struct Tlsdesc_info.
9427 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
9428 (Target_x86_64::do_reloc_symbol_index): New function.
9429 (Target_x86_64::add_tlsdesc_info): New function.
9430 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
9431 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
9433 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
9435 (Output_data_plt_x86_64::rela_tlsdesc): New function.
9436 (Target_x86_64::rela_tlsdesc_section): New function.
9437 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
9439 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
9440 (Target_x86_64::do_reloc_addend): New function.
9441 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
9442 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
9443 declarations. Define TARGET_CODE. Add arg field to u1_ union.
9444 (Output_reloc::type): New function.
9445 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
9446 (Output_reloc::is_target_specific): New function.
9447 (Output_reloc::target_arg): New function.
9448 (class Output_reloc) [SHT_RELA]: Add four new constructors for
9449 absolute relocs and target specific relocs.
9450 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
9451 add_target_specific.
9452 (class Output_data_reloc) [SHT_RELA]: Likewise.
9453 * output.cc (Output_reloc::Output_reloc): Add four new versions
9454 for absolute relocs and target specific relocs.
9455 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
9456 (Output_reloc::get_symbol_index): Likewise.
9457 (Output_reloc::local_section_offset): Check that local_sym_index_
9458 is not TARGET_CODE or 0.
9459 (Output_reloc::symbol_value): Likewise.
9460 (Output_reloc::write) [SHT_RELA]: Call target for target specific
9462 * target.h (class Target): Add reloc_symbol_index and reloc_addend
9463 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
9465 * layout.cc (add_target_dynamic_tags): Use output section for
9466 DT_PLTRELSZ and DT_JMPREL.
9468 2010-01-07 Ian Lance Taylor <iant@google.com>
9471 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
9473 (class Output_data_reloc_generic): Define.
9474 (class Output_data_reloc_base): Change base class to
9475 Output_data_reloc_generic. Change add() method to call
9476 bump_relative_reloc_count for a relative reloc. Remove
9478 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
9480 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
9481 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
9483 * layout.h (class Layout): Update declaration.
9485 2010-01-07 Ian Lance Taylor <iant@google.com>
9487 * output.h (class Output_data): Add const version of
9488 output_section and do_output_section.
9489 (class Output_section_data): Add const version of
9491 (class Output_section): Likewise.
9492 * layout.cc (Layout::add_target_dynamic_tags): New function.
9493 * layout.h (class Layout): Update declarations.
9494 * arm.cc (Target_arm::do_finalize_sections): Use
9495 add_target_dynamic_tags.
9496 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9497 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9498 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9499 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9501 2010-01-07 Ian Lance Taylor <iant@google.com>
9504 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
9507 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
9508 Ian Lance Taylor <iant@google.com>
9511 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
9512 Xindex::read_symtab_xindex.
9514 2010-01-07 Doug Kwan <dougkwan@google.com>
9516 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
9517 (Insn_template::thumb16_bcond_insn): New method declaration.
9518 (Insn_template): Fix spelling.
9519 (Stub::thumb16_special): New method declaration.
9520 (Stub::do_write): Define virtual method which was previously pure
9522 (Stub::do_thumb16_special): New method declaration.
9523 (Stub::do_fixed_endian_write): New template member.
9524 (Reloc_stub::do_write): Remove.
9525 (Reloc_stub::do_fixed_endian_write): Remove.
9526 (Cortex_a8_stub): New class definition.
9527 (Stub_factory::make_cortex_a8_stub): New method definition.
9528 (Stub_factory::Stub_factory): Add missing static storage class
9529 qualifier for elf32_arm_stub_a8_veneer_blx.
9531 2010-01-07 Ian Lance Taylor <iant@google.com>
9534 * options.h (class General_options): Add --warn-unresolved-symbols
9535 and --error-unresolved-symbols.
9536 * errors.cc (Errors::undefined_symbol): Implement
9537 --warn-unresolved-symbols.
9539 * options.h (class General_options): Add -z text and -z textoff.
9540 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
9542 2010-01-06 Sriraman Tallam <tmsriram@google.com>
9544 * gc.h (Garbage_collection::Cident_section_map): New typedef.
9545 (Garbage_collection::cident_sections): New function.
9546 (Garbage_collection::add_cident_section): New function.
9547 (Garbage_collection::cident_sections_): New member.
9548 (gc_process_relocs): Add references to sections whose names are C
9550 * gold.h (cident_section_start_prefix): New constant.
9551 (cident_section_stop_prefix): New constant.
9552 (is_cident): New function.
9553 * layout.cc (Layout::define_section_symbols): Replace string constants
9554 with the newly defined constants.
9555 * object.cc (Sized_relobj::do_layout): Track sections whose names are
9557 * testsuite/Makefile.am: Add gc_orphan_section_test.
9558 * testsuite/Makefile.in: Regenerate.
9559 * testsuite/gc_orphan_section_test.cc: New file.
9560 * testsuite/gc_orphan_section_test.sh: New file.
9562 2010-01-06 Ian Lance Taylor <iant@google.com>
9565 * options.h (class General_options): Add --warn-shared-textrel.
9566 * layout.cc (Layout::finish_dynamic_section): Implement
9567 --warn-shared-textrel.
9570 * options.h (class General_options): Add --warn-multiple-gp.
9572 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9574 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
9575 $(THREADSLIB) and $(LIBDL).
9576 * Makefile.in: Rebuild.
9578 2010-01-06 Ian Lance Taylor <iant@google.com>
9581 * options.cc (General_options::parse_section_start): New function.
9582 (General_options::section_start): New function.
9583 (General_options::General_options): Initialize all members.
9584 * options.h: Include <map>
9585 (class General_options): Add --section-start. Add section_starts_
9587 * layout.cc (Layout::attach_allocated_section_to_segment): If
9588 --section-start was used, set the address of the segment. Remove
9589 local sort_sections.
9590 (Layout::relaxation_loop_body): If the address of the load segment
9591 has been set by --section-start, don't use it.
9592 * output.h (Output_segment::update_flags_for_output_section): New
9594 * output.cc (Output_segment::add_output_section): Call
9595 update_flags_for_output_section.
9597 2010-01-05 Ian Lance Taylor <iant@google.com>
9600 * options.h (class General_options): Add --undefined-version.
9601 * script.cc (struct Version_expression): Add was_matched_by_symbol
9603 (Version_script_info::matched_symbol): New function.
9604 (Version_script_info::get_symbol_version_helper): Call
9606 (Version_script_info::check_unmatched_names): New function.
9607 * script.h (class Version_script_info): Update declarations.
9608 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
9610 * options.h (class General_options): Use DEFINE_bool_alias for
9611 allow_multiple_definition.
9612 * resolve.cc (Symbol_table::should_override): Don't test
9613 allow_multiple_definition.
9616 * options.h (class General_options): Add --cref.
9617 * main.cc (main): Print cref table if --cref. Don't close mapfile
9618 until after printing cref table.
9619 * cref.cc: Include "symtab.h".
9620 (class Cref_inputs): Define Cref_table_compare and Cref_table.
9621 (Cref_table_compare::operator()): New function.
9622 (Cref_inputs::gather_cref): New function.
9623 (filecol): New static const.
9624 (Cref_inputs::print_cref): New function.
9625 (Cref::print_cref): New function.
9626 * cref.h: Include <cstdio>.
9627 (class Cref): Update declarations.
9628 * mapfile.h (Mapfile::file): New function.
9629 * object.h (class Object): Define Symbols. Declare virtual
9630 do_get_global_symbols.
9631 (Object::get_global_symbols): New function.
9632 * object.cc (Input_objects::add_object): Pass object to cref_ if
9634 (Input_objects::archive_start): Likewise.
9635 (Input_objects::archive_stop): Likewise.
9636 (Input_objects::print_cref): New function.
9637 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
9638 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
9640 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
9642 * plugin.h (class Sized_pluginobj): Update declarations.
9644 2010-01-05 Ian Lance Taylor <iant@google.com>
9646 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
9647 to is_default_version. Rename insdef to insdefault.
9648 (Symbol_table::add_from_relobj): Rename def to is_default_version
9649 and local to is_forced_local.
9650 (Symbol_table::add_from_pluginobj): Likewise.
9651 (Symbol_table::add_from_dynobj): Likewise.
9652 (Symbol_table::define_special_symbol): Rename insdef to
9655 2010-01-04 Ian Lance Taylor <iant@google.com>
9658 * options.h (class General_options): Add
9659 --allow-multiple-definition and -z muldefs.
9660 * resolve.cc (Symbol_table::should_override): Don't warn about a
9661 multiple symbol definition if --allow-multiple-definition or -z
9665 * options.h (class General_options): Add --add-needed and
9666 --copy-dt-needed-entries. Tweak --as-needed help entry.
9667 * object.cc (Input_objects::check_dynamic_dependencies): Give an
9668 error if --copy-dt-needed-entries aka --add-needed is used and
9669 would cause a change in behaviour.
9672 * options.h (class General_options): Add -G as a short version of
9673 --shared. Add no-op options -assert, -g, and -i.
9675 2010-01-04 Sriraman Tallam <tmsriram@google.com>
9677 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
9678 check for .text or .gnu.linkonce.t sections.
9679 * icf.cc (Icf::find_identical_sections): Ditto.
9680 Change the detection for mangled function name within the section
9682 * icf.h (is_section_foldable_candidate): New function.
9684 2009-12-30 Ian Lance Taylor <iant@google.com>
9687 * options.h (class General_options): Permit two dashes with
9688 --retain-symbols-file.
9690 2009-12-30 Ian Lance Taylor <iant@google.com>
9693 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
9694 don't put the file header and segment headers in the text
9698 * common.cc (Sort_commons::operator()): Stabilize sort when both
9700 (Symbol_table::do_allocate_commons_list): When allocating common
9701 symbols, skip a symbol which is no longer common.
9702 * symtab.h (Symbol::is_common): Test whether the symbol comes from
9703 an object before checking its type.
9704 * testsuite/common_test_2.c: New file.
9705 * testsuite/common_test_3.c: New file.
9706 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
9707 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
9708 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
9709 (common_test_2_pic.o, common_test_2.so): New targets.
9710 (common_test_3_pic.o, common_test_3.so): New targets.
9711 * testsuite/Makefile.in: Rebuild.
9714 * script.cc (read_input_script): If we see a new SECTIONS clause,
9715 and we have added an input section, give an error.
9716 * layout.h (class Layout): Add have_added_input_section function.
9717 Add have_added_input_section_ field.
9718 * layout.cc (Layout::Layout): Initialize
9719 have_added_input_section_.
9720 (Layout::layout): Set have_added_input_section_.
9721 (Layout::layout_eh_frame): Likewise.
9723 2009-12-30 Ian Lance Taylor <iant@google.com>
9726 * options.h (class General_options): Add --sort-common option.
9727 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
9728 * common.cc (Sort_common): Add sort_order parameter to
9729 constructor. Add sort_order_ field.
9730 (Sort_commons::operator): Check sort_order_.
9731 (Symbol_table::allocate_commons): Determine the sort order.
9732 (Symbol_table::do_allocate_commons): Add sort_order parameter.
9734 (Symbol_table::do_allocate_commons_list): Likewise.
9736 2009-12-30 Ian Lance Taylor <iant@google.com>
9739 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
9740 symbols from this object, don't change the visibility of an
9742 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
9744 2009-12-30 Ian Lance Taylor <iant@google.com>
9747 * script.h (class Version_script_info): Define Language enum.
9748 Update declarations. Define Glob, Exact, and Lookup types. Add
9749 new fields globals_, locals_, and is_finalized_.
9750 * script.cc: Various formatting fixes.
9751 (class Parser_closure): Change language_stack_ from a vector of
9752 std::string to one of Version_script_info::Language. Adjust all
9754 (class Lazy_demangler): Remove.
9755 (struct Version_expression): Change language from std::string to
9756 Version_script_info::Language.
9757 (Version_script_info::Version_script_info): New function.
9758 (Version_script_info::~Version_script_info): Don't call clear.
9759 (Version_script_info::finalize): New function.
9760 (Version_script_info::build_lookup_tables): New function.
9761 (Version_script_info::build_expression_list_lookup): New
9763 (Version_script_info::get_symbol_version_helper): Rewrite to use
9765 (Version_script_info::print_expression_list): Adjust to use
9766 Version_script_info::Language.
9767 (script_push_lex_into_version_mode): Check that the version script
9768 has not been finalized.
9769 (version_script_push_lang): Change language string to
9770 Version_script_info::Language.
9771 * options.cc (Command_line::version_script): New function.
9772 * options.h (class General_options): Add finalize_dynamic_list
9773 function. Change version_script from declaration to definition.
9774 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
9775 * testsuite/version_script.map: Remove duplicate def of foo.
9776 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
9778 * testsuite/Makefile.in: Rebuild.
9780 2009-12-30 Ian Lance Taylor <iant@google.com>
9783 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
9784 if the input symbol index is 0, make the output symbol index 0.
9786 2009-12-30 Ian Lance Taylor <iant@google.com>
9789 * options.h (class General_options): Add -x/--discard-all.
9790 * object.cc (Sized_relobj::do_count_local_symbols): Handle
9791 --discard-all. If the local symbol needs a dynamic entry, check
9792 that before handling --discard-locals.
9794 2009-12-30 Ian Lance Taylor <iant@google.com>
9797 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
9799 (Output_segment::add_output_section): Don't change the flags if
9803 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
9804 GNU hash table if they need a dynamic value. Otherwise, don't add
9805 them if they are defined in a dynamic object or are forced local.
9807 2009-12-29 Ian Lance Taylor <iant@google.com>
9810 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
9811 .gnu.hash table for a 32-bit target.
9814 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
9815 regular and a dynamic object only needs a dynamic symbol table
9816 entry if it is externally visible.
9819 * i386.cc (class Target_i386): Initialize global_offset_table_ in
9820 constructor. Add global_offset_table_ field.
9821 (Target_i386::got_section): Set global_offset_table_.
9822 (Target_i386::do_finalize_sections): Set global_offset_table_
9824 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
9825 in constructor. Add global_offset_table_ field.
9826 (Target_x86_64::got_section): Set global_offset_table_.
9827 (Target_x86_64::do_finalize_sections): Set global_offset_table_
9830 * layout.cc (Layout::Layout): Initialize increase_relro_.
9831 (Layout::get_output_section): Add is_relro, is_last_relro, and
9832 is_first_non_relro parameters. Change all callers.
9833 (Layout::choose_output_section): Likewise.
9834 (Layout::add_output_section_data): Likewise.
9835 (Layout::make_output_section): Likewise.
9836 (Layout::set_segment_offsets): Clear increase_relro when using a
9838 * layout.h (class Layout): Add increase_relro method. Add
9839 increase_relro_ field. Update declarations.
9840 * output.cc (Output_section::Output_section): Initialize
9841 is_last_relro_ and is_first_non_relro_.
9842 (Output_segment::add_output_section): Group relro sections is
9843 do_sort is true. Handle is_last_relro and is_first_non_relro.
9844 (Output_segment::maximum_alignment): Remove relro handling.
9845 (Output_segment::set_section_addresses): Add increase_relro
9846 parameter. Change all callers. Add initial alignment to align
9847 relro sections on separate page. Remove old relro handling.
9848 (Output_segment::set_section_list_addresses): Remove in_relro
9849 parameter. Change all callers.
9850 (Output_segment::set_offset): Add increase parameter. Change all
9851 callers. Remove old relro handling.
9852 * output.h (class Output_section): Add new methods: is_last_relro,
9853 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
9854 Add is_last_relro_ and is_first_non_relro_ fields.
9855 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
9856 Create separate .got.plt section. Call increase_relro.
9857 * x86_64.cc (Target_x86_64::got_section): Likewise.
9858 * testsuite/relro_script_test.t: Add .got.plt.
9861 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
9862 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
9863 (Layout::finalize): Call set_dynamic_symbol_size.
9864 (Layout::set_dynamic_symbol_size): New function.
9865 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
9866 set_dynamic_symbol_size.
9869 * output.h (class Output_section): Add is_entsize_zero_ field.
9870 * output.cc (Output_section::Output_section): Initialize
9872 (Output_section::set_entsize): If two different entsizes are
9873 requested, force it to zero.
9874 (Output_section::add_input_section): Set flags for .debug_str
9875 before updating section flags. Set entsize.
9876 (Output_section::update_flags_for_input_section): Set SHF_MERGE
9877 and SHF_STRING if all input sections have those flags.
9879 2009-12-29 Rafael Espindola <espindola@google.com>
9881 * main.cc (main): Fix the sys time reporting.
9882 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
9885 2009-12-29 Sriraman Tallam <tmsriram@google.com>
9887 * options.cc (General_options::parse_version): Allow -v to exit
9888 without an error if there is nothing to link.
9890 2009-12-29 Ian Lance Taylor <iant@google.com>
9892 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
9893 using a version of gcc before 4.1.
9894 * configure: Rebuild.
9896 2009-12-28 Chris Demetriou <cgd@google.com>
9898 * attributes.cc (Output_attributes_section_data::do_write): Use
9899 std::vector::front rather than std::vector::data.
9901 2009-12-28 Ian Lance Taylor <iant@google.com>
9903 * symtab.h (class Symbol_table): Add enum Defined.
9904 * resolve.cc (Symbol_table::should_override): Add defined
9905 parameter. Change all callers. Test whether object is NULL
9906 before calling a method on it.
9907 (Symbol_table::report_resolve_problem): Add defined parameter.
9909 (Symbol_table::should_override_with_special): Likewise.
9910 * symtab.cc (Symbol_table::define_in_output_data): Add defined
9911 parameter. Change all callers.
9912 (Symbol_table::do_define_in_output_data): Likewise.
9913 (Symbol_table::define_in_output_segment): Likewise.
9914 (Symbol_table::do_define_in_output_segment): Likewise.
9915 (Symbol_table::define_as_constant): Likewise.
9916 (Symbol_table::do_define_as_constant): Likewise.
9917 * script.h (class Symbol_assignment): Add is_defsym parameter to
9918 constructor; change all callers.
9919 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
9920 parameter. Change all callers. Add is_defsym_ field.
9921 (class Parser_closure): Add parsing_defsym parameter to
9922 constructor; change all callers. Add parsing_defsym accessor
9923 function. Add parsing_defsym_ field.
9925 2009-12-28 Ian Lance Taylor <iant@google.com>
9927 * gold.cc (queue_middle_tasks): Fix formatting.
9928 * object.cc (Relobj::is_section_name_included): Likewise.
9930 2009-12-23 Ian Lance Taylor <iant@google.com>
9932 * i386.cc (Target_i386::do_calls_non_split): Recognize
9933 -fsplit-stack prologue for a function with a static chain.
9934 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
9935 -fsplit-stack prologue when using %r11.
9937 2009-12-21 Sriraman Tallam <tmsriram@google.com>
9939 * options.cc (General_options::parse_version): Make -v continue and do
9940 the link like GNU ld does.
9942 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
9944 * Makefile.am (CCFILES): Add timer.cc.
9945 (HFILES): Add timer.h.
9946 * configure.ac: Check for sysconf and times.
9947 * main.cc: include timer.h.
9948 (main): Use Timer instead of get_run_time.
9951 * workqueue.cc: include timer.h.
9952 (Workqueue::find_and_run_task):
9953 Report user, sys and wall time.
9954 * Makefile.in: Regenerate.
9955 * config.in: Regenerate.
9956 * configure: Regenerate.
9958 2009-12-16 Doug Kwan <dougkwan@google.com>
9960 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
9962 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
9963 relaxed input sections.
9964 * output.cc (Output_section::find_relaxed_input_section): Change
9965 return type to Output_relaxed_input_section pointer. Adjust code
9966 for new type of relaxed_input_section_map_.
9967 * output.h (Output_section::find_relaxed_input_section): Change
9968 return type to Output_relaxed_input_section pointer.
9969 (Output_section::Output_relaxed_input_section_by_input_section_map):
9971 (Output_section::relaxed_input_section_map_): Change type to
9972 Output_section::Output_relaxed_input_section_by_input_section_map.
9973 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
9976 2009-12-15 Ian Lance Taylor <iant@google.com>
9978 * layout.cc (Layout::create_shstrtab): Only write out after input
9979 sections if we are compressing debug sections.
9981 2009-12-15 Ian Lance Taylor <iant@google.com>
9983 * archive.cc (Archive::add_symbols): Only look up a symbol without
9984 a version if there is, in fact, a version.
9986 2009-12-14 Ian Lance Taylor <iant@google.com>
9988 Revert -Wshadow changes, all changes from:
9989 2009-12-11 Doug Kwan <dougkwan@google.com>
9990 2009-12-11 Nick Clifton <nickc@redhat.com>
9991 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
9993 2009-12-11 Doug Kwan <dougkwan@google.com>
9995 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
9997 * attributes.cc (Object_attribute::size): Ditto.
9998 (Attributes_section_data::size): Ditto.
9999 (Attributes_section_data::Attributes_section_data): Ditto.
10000 (Output_attributes_section_data::do_write): Ditto.
10001 * attributes.h (Object_attribute::set_type): Ditto.
10002 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10004 2009-12-11 Nick Clifton <nickc@redhat.com>
10006 * archive.cc: Fix shadowed variable warnings.
10007 * arm.cc: Likewise.
10008 * compressed_output.cc: Likewise.
10009 * compressed_output.h: Likewise.
10010 * configure: Likewise.
10011 * dwarf_reader.cc: Likewise.
10012 * dynobj.cc: Likewise.
10013 * dynobj.h: Likewise.
10014 * ehframe.cc: Likewise.
10015 * ehframe.h: Likewise.
10016 * errors.cc: Likewise.
10017 * expression.cc: Likewise.
10018 * fileread.cc: Likewise.
10019 * fileread.h: Likewise.
10020 * freebsd.h: Likewise.
10021 * i386.cc: Likewise.
10022 * icf.cc: Likewise.
10023 * incremental.h: Likewise.
10024 * layout.cc: Likewise.
10025 * layout.h: Likewise.
10026 * mapfile.cc: Likewise.
10027 * merge.cc: Likewise.
10028 * merge.h: Likewise.
10029 * object.cc: Likewise.
10030 * object.h: Likewise.
10031 * options.h: Likewise.
10032 * output.cc: Likewise.
10033 * output.h: Likewise.
10034 * parameters.cc: Likewise.
10035 * plugin.cc: Likewise.
10036 * powerpc.cc: Likewise.
10037 * reduced_debug_output.cc: Likewise.
10038 * reduced_debug_output.h: Likewise.
10039 * reloc.cc: Likewise.
10040 * reloc.h: Likewise.
10041 * resolve.cc: Likewise.
10042 * script-sections.cc: Likewise.
10043 * script.cc: Likewise.
10044 * script.h: Likewise.
10045 * sparc.cc: Likewise.
10046 * symtab.cc: Likewise.
10047 * symtab.h: Likewise.
10048 * target-select.cc: Likewise.
10049 * target-select.h: Likewise.
10050 * token.h: Likewise.
10051 * workqueue.cc: Likewise.
10052 * workqueue.h: Likewise.
10053 * x86_64.cc: Likewise.
10055 2009-12-10 Doug Kwan <dougkwan@google.com>
10057 * arm.cc (attributes.h): New include.
10058 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10059 (Arm_relobj::~Arm_relobj): Delete object pointed by
10060 attributes_section_data_.
10061 (Arm_relobj::attributes_section_data): New method definition.
10062 (Arm_relobj::attributes_section_data_): New data member declaration.
10063 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10064 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10065 attributes_section_data_.
10066 (Arm_dynobj::attributes_section_data): New method definition.
10067 (Arm_dynobj::attributes_section_data_): New data member declaration.
10068 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10069 initialization value of may_use_blx_ to false.
10070 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
10071 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10072 object attributes to compute results instead of hard-coding.
10073 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10074 Target_arm::get_secondary_compatible_arch,
10075 Target_arm::set_secondary_compatible_arch
10076 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10077 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10078 New method declarations.
10079 (Target_arm::get_aeabi_object_attribute): New method definition.
10080 (Target_arm::attributes_section_data_): New data member declaration.
10081 (read_arm_attributes_section): New template definition.
10082 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10083 (Arm_dynobj::do_read_symbols): Ditto.
10084 (Target_arm::do_finalize_sections): Merge attributes sections from
10085 input. Check for BLX use after attributes section merging.
10086 Fix __exidx_start and __exidx_end visibility. Create an
10087 .ARM.attributes section if necessary.
10088 (Target_arm::get_secondary_compatible_arch,
10089 Target_arm::set_secondary_compatible_arch,
10090 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10091 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
10092 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
10093 New method definitions.
10095 2009-12-09 Ian Lance Taylor <iant@google.com>
10097 * plugin.cc (Plugin::load): Don't cast from void* to a function
10100 2009-12-09 Ian Lance Taylor <iant@google.com>
10102 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10103 information fields.
10105 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10107 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10108 Replace two_file_shared_1.so with two_file_shared_2.so.
10109 * testsuite/Makefile.in: Regenerated.
10111 2009-12-08 Doug Kwan <dougkwan@google.com>
10113 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10114 (HFILES): Add attributes.h and int_encoding.h.
10115 * Makefile.in: Regenerate.
10116 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10117 function definitions to int_encoding.cc
10118 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10119 prototypes to int_encoding.h
10120 * reduced_debug_output.cc (int_encoding.h): New include.
10121 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10122 function definitions to int_encoding.cc
10123 (insert_into_vector, read_from_pointer): Move template definitions to
10125 * attributes.cc: New file.
10126 * attributes.h: New file.
10127 * int_encoding.cc: New file.
10128 * int_encoding.h: New file.
10130 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
10133 * incremental-dump.cc (dump_incremental_inputs): New.
10134 (main): Use dump_incremental_inputs.
10136 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
10139 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
10140 checking elfcpp::STT_FUNC.
10141 (Target_i386::Relocate::relocate): Likewise.
10142 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
10144 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10145 symbols from shared libraries into normal FUNC symbols.
10147 * symtab.h (Symbol): Add is_func and use it.
10149 2009-12-05 Doug Kwan <dougkwan@google.com>
10151 * arm.cc (Target_arm::arm_info): Initialize new fields
10152 attributes_section and attributes_vendor.
10153 * i386.cc (Target_i386::i386_info): Same.
10154 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10155 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10156 fields attributes_section and attributes_vendor.
10157 * sparc.cc (Target_sparc::sparc_info): Same.
10158 * target.h (Target::attributes_section, Target::attributes_vendor,
10159 Target::is_attributes_section, Target::attribute_arg_type,
10160 Target::attributes_order): New method definitions.
10161 (Target::Target_info::attributes_section,
10162 Target::Target_info::attributes_vendor): New fields.
10163 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10164 virtual method definitions.
10165 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10166 attributes_section and attributes_vendor.
10167 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10169 2009-12-05 Doug Kwan <dougkwan@google.com>
10171 * arm.cc: Update comments about interworking and stub generation.
10172 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
10173 considered as non-PIC.
10174 (Arm_relocate_functions::base_abs): Fix formatting.
10175 (Arm_relocate_functions::got_prel): Fix comment. Change interface
10176 of function to use GOT entry address instead of offset.
10177 (Target_arm::Scan::global): Issue an error if a symbol would need a
10178 PLT does not get one because it is untyped. Remove code to create
10179 dynamic symbols for relative branches.
10180 (Target_arm::Relocate::relocate: Use 0 instead of false since function
10181 takes unsigned integer instead of boolean.
10183 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
10185 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
10186 (two_file_test_LDADD): Likewise.
10187 (common_test_1_LDADD): Likewise.
10188 (exception_test_LDADD) Likewise.
10189 (weak_test_LDADD): Likewise.
10190 (many_sections_test_LDADD): Likewise.
10191 (initpri1_LDADD): Likewise.
10192 (script_test_1_LDADD): Likewise.
10193 (script_test_2_LDADD): Likewise.
10194 (justsyms_LDADD): Likewise.
10195 (binary_test_LDADD): Likewise.
10196 (large_LDADD): Likewise.
10197 * testsuite/Makefile.in: Regenerated.
10199 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
10201 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
10202 (Symbol_table::override_with_special): Likewise.
10203 (Symbol_table::add_from_object): Likewise.
10205 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
10207 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10208 Don't set the data_offset twice.
10210 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
10212 * testsuite/Makefile.in: Regenerate.
10214 2009-12-03 Doug Kwan <dougkwan@google.com>
10216 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
10217 (Target_arm::do_finalize_sections): Add parameter for symbol table
10218 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
10219 * i386.cc (Target_i386::do_finalize_sections): Add an additional
10220 parameter for symbol table pointer.
10221 * layout.cc (Layout::finalize): Call Target::finalize_sections with
10222 an additional parameter for a pointer to symbol table.
10223 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
10224 parameter for a symbol table pointer.
10225 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
10226 * target.h (Target::finalize_sections, Target::do_finalize_sections):
10228 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
10229 parameter for a symbol table pointer.
10231 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
10233 * incremental.cc (Incremental_inputs_header)
10234 (Incremental_inputs_header_write, Incremental_inputs_entry)
10235 (Incremental_inputs_entry_write): Move ...
10236 * incremental.h (Incremental_inputs_header)
10237 (Incremental_inputs_header_write, Incremental_inputs_entry)
10238 (Incremental_inputs_entry_write): here.
10240 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10242 * incremental.cc (make_sized_incremental_binary): Set the target.
10243 Error if it is incompatible.
10244 * output.h (Output_file): Add filename method.
10246 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10248 * incremental.cc (Incremental_inputs_entry): Remove unused argument
10249 from the get_* methods.
10251 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10253 * incremental-dump.cc (main): Check that the offeset of a script is 0.
10254 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10255 Write 0 for the data_offset of scripts.
10257 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10259 * testsuite/Makefile.am: Add the incremental_test.sh test.
10260 * testsuite/incremental_test.sh: New.
10261 * testsuite/incremental_test_1.c: New.
10262 * testsuite/incremental_test_2.c: New.
10264 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
10266 * incremental-dump.cc (main): Fix typos.
10268 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
10271 * incremental-dump.cc (main): Use llu to print 64 bit values.
10273 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
10274 H.J. Lu <hongjiu.lu@intel.com>
10276 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
10278 (incremental_dump_LDADD): Likewise.
10279 * Makefile.in: Regenerated.
10281 2009-11-25 Doug Kwan <dougkwan@google.com>
10285 2009-11-25 Doug Kwan <dougkwan@google.com>
10287 * arm.cc (Target_arm::Target_arm): Move method definition
10288 outside of class definition. Add code to handle
10289 --target1-rel, --target1-abs and --target2= options.
10290 (Target_arm::get_reloc_reloc_type): Change method to be
10291 non-static and const.
10292 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
10293 New data member declaration.
10294 (Target_arm::Scan::local, Target_arm::Scan::global,
10295 Target_arm::Relocate::relocate,
10296 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10297 Adjust call to Target_arm::get_real_reloc_type.
10298 (Target_arm::get_real_reloc_type): Use command line options
10299 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10300 * options.h (--target1-rel, --target1-abs, --target2): New
10303 2009-11-25 Doug Kwan <dougkwan@google.com>
10305 * arm.cc (Target_arm::Target_arm): Move method definition outside of
10306 class definition. Add code to handle --target1-rel, --target1-abs
10307 and --target2= options.
10308 (Target_arm::get_reloc_reloc_type): Change method to be non-static
10310 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
10311 member declaration.
10312 (Target_arm::Scan::local, Target_arm::Scan::global,
10313 Target_arm::Relocate::relocate,
10314 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
10315 call to Target_arm::get_real_reloc_type.
10316 (Target_arm::get_real_reloc_type): Use command line options to
10317 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10318 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
10321 2009-11-25 Doug Kwan <dougkwan@google.com>
10323 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
10324 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
10325 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
10327 (Arm_relocate_functions::thm_call): Replace body with a call to
10328 Arm_relocate_functions::thumb_branch_common.
10329 (Arm_relocate_functions::thm_jump24,
10330 Arm_relocate_functions::thm_xpc22): New method definitions.
10331 (Arm_relocate_functions::thumb_branch_common): New method definition.
10332 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
10334 (Target_arm::Relocate::relocate): Adjust call to thm_call.
10335 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
10337 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10339 * Makefile.am: Build incremental-dump
10340 * Makefile.in: Regenerate.
10341 * incremental-dump.cc: New.
10342 * incremental.cc (Incremental_inputs_header_data,
10343 Incremental_inputs_entry_data): Move to incremental.h
10344 * incremental.h: (Incremental_inputs_header_data,
10345 Incremental_inputs_entry_data): Move from incremental.cc
10347 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10349 * incremental.cc (Incremental_inputs_header,
10350 Incremental_inputs_header_write, Incremental_inputs_entry,
10351 Incremental_inputs_entry_write): Add a typedef with the data type.
10353 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
10355 * incremental.cc (Incremental_inputs_header,
10356 Incremental_inputs_header_write, Incremental_inputs_entry,
10357 Incremental_inputs_entry_write): Update comment about which
10358 type has the filed descriptions.
10360 2009-11-15 Doug Kwan <dougkwan@google.com>
10362 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
10363 (Arm_relocate_functions::arm_branch_common): Change method defintion
10364 in class definition to a method declaration and update list of formal
10366 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
10367 Arm_relocation_functions::jump24): Adjust call to
10368 Arm_relocate_functions::arm_branch_common. Update list of formal
10370 (Arm_relocate_functions::xpc25): New method definition.
10371 (Arm_relocate_functions::arm_branch_common): Move method defintion
10372 out from class definition. Use stubs for mode-switching and extending
10374 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
10375 specially. Change code to enable use of stubs in ARM branches.
10377 2009-11-10 Doug Kwan <dougkwan@google.com>
10379 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
10380 in method declaration.
10381 (Target_arm::relocate_stub): New method declaration.
10382 (Target_arm::default_target): Change to return a pointer instead of
10384 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
10385 Target_arm::default_target.
10386 (Arm_Relobj::do_relocate_sections): Remove options paramater in
10388 (Target_arm::relocate_section): Adjust view.
10389 (Target_arm::relocate_stub): New method definition.
10391 2009-11-10 Doug Kwan <dougkwan@google.com>
10393 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
10395 * incremental.cc (open_incremental_binary): Initialized local
10396 variables to avoid warnings.
10397 * object.cc (make_elf_object): Ditto.
10398 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
10401 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
10404 * testsuite/plugin_test.c: Include "config.h".
10406 2009-11-09 Doug Kwan <dougkwan@google.com>
10408 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
10409 (arm_symbol_value): Remove.
10410 (Arm_relocate_functions::arm_branch_common,
10411 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
10412 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
10413 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
10414 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
10415 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
10416 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
10417 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
10418 Arm_relocate_functions::thm_mobw_abs_nc,
10419 Arm_relocate_functions::thm_mov_abs,
10420 Arm_relocate_functions::movw_prel_nc,
10421 Arm_relocate_functions::thm_movt_abs,
10422 Arm_relocate_functions::movt_prel,
10423 Arm_relocate_functions::thm_movw_prel_nc,
10424 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
10425 (Target_arm::Relocate::relocate): Only decompose address into two
10426 parts if relocation type uses the thumb-bit and pass the actual
10427 bit instead of a flag indicating that the thumb-bit is used. Adjust
10428 calls to methods in Arm_relocate_functions for this change.
10430 2009-11-08 Ian Lance Taylor <iant@google.com>
10433 * reloc.cc: Instantiate
10434 Sized_relobj::initialize_input_to_output_maps and
10435 Sized_relobj:free_input_to_output_maps.
10437 2009-11-06 Ian Lance Taylor <iant@google.com>
10440 * defstd.cc (in_segment): Set only_if_ref true for "end".
10442 2009-11-06 Doug Kwan <dougkwan@google.com>
10444 * arm.cc (class Reloc_stub): Correct a comment.
10445 (Target_arm::Target_arm): Initialize arm_input_section_map_.
10446 (Target_arm::scan_section_for_stubs): New method declaration.
10447 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
10448 Change methods from private to protected.
10449 (Target_arm::do_may_relax): New method definition.
10450 (Target_arm::do_relax, Target_arm::group_sections,
10451 Target_arm::scan_reloc_for_stub,
10452 Target_arm::scan_reloc_section_for_stubs): New method declarations.
10453 (Target_arm::arm_input_section_map_): New data member declaration.
10454 (Target_arm::scan_reloc_for_stub,
10455 Target_arm::scan_reloc_section_for_stubs,
10456 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
10457 Target_arm::do_relax): New method definitions.
10459 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
10461 * configure.ac: Check for (struct stat)::st_mtim
10462 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
10463 * config.in: Regenerate.
10464 * configure: Regenerate.
10466 2009-11-05 Ian Lance Taylor <iant@google.com>
10469 * output.cc (Output_segment::add_output_section): Add missing
10472 2009-11-04 Ian Lance Taylor <iant@google.com>
10475 * object.h (class Object): Add is_needed and set_is_needed
10476 methods. Add is_needed_ field. Make bool fields into bitfields.
10477 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
10478 defined in a dynamic object and referenced by a regular object,
10479 set is_needed for the dynamic object.
10480 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
10481 if the file is marked with as_needed and it is not needed.
10483 2009-11-04 Ian Lance Taylor <iant@google.com>
10486 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
10487 tags if data is discarded by linker script.
10488 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10489 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10490 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10491 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10493 2009-11-04 Ian Lance Taylor <iant@google.com>
10495 * layout.cc (Layout::get_output_section): Add is_interp and
10496 is_dynamic_linker_section parameters. Change all callers.
10497 (Layout::choose_output_section): Likewise.
10498 (Layout::make_output_section): Likewise.
10499 (Layout::add_output_section_data): Add is_dynamic_linker_section
10500 parameter. Change all callers.
10501 * layout.h (class Layout): Update declarations.
10502 * output.h (class Output_section): Add is_interp, set_is_interp,
10503 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
10504 Add is_interp_, is_dynamic_linker_section_ fields. Change
10505 generate_code_fills_at_write_ to a bitfield.
10506 * output.cc (Output_section::Output_sections): Initialize new
10508 (Output_segment::add_output_section): Add do_sort parameter.
10509 Change all callers.
10511 2009-11-03 Ian Lance Taylor <iant@google.com>
10514 * options.h (class General_options): Add --warn-common.
10515 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
10516 merging two common symbols.
10517 (Symbol_table::should_override): Handle --warn-common when merging
10518 a common symbol with a defined symbol. Use report_resolve_problem
10519 for multiple definitions.
10520 (Symbol_table::report_resolve_problem): New function.
10521 * symtab.h (class Symbol_table): Declare report_resolve_problem.
10523 2009-11-03 Doug Kwan <dougkwan@google.com>
10525 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
10527 (Target_arm::stub_factory): New method definition.
10528 (Target_arm::new_arm_input_section,
10529 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
10530 Target_arm::reloc_uses_thumb_bit): New method declarations.
10531 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
10532 New type definitions.
10533 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
10534 member declarations.
10535 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
10536 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
10537 New method definitions.
10539 2009-11-03 Ian Lance Taylor <iant@google.com>
10541 * options.h (class General_options): Add --warn_constructors.
10543 2009-11-03 Ian Lance Taylor <iant@google.com>
10546 * defstd.cc (in_section): Add entries for __rel_iplt_start,
10547 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
10549 2009-11-03 Ian Lance Taylor <iant@google.com>
10552 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
10553 --msgid-bugs-address.
10554 (install-pdf): New target.
10555 (install-data_yes): Look up one directory to find mkinstalldirs.
10557 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
10559 * po/Make-in (.po.gmo): Don't generate .gmo files in source
10562 2009-10-30 Doug Kwan <dougkwan@google.com>
10564 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
10566 2009-10-30 Doug Kwan <dougkwan@google.com>
10568 * arm.cc (Stub_addend_reader): New struct template definition
10569 and partial specializations.
10570 (Stub_addend_reader::operator()): New method definition for a
10571 partially specialized template.
10573 2009-10-30 Doug Kwan <dougkwan@google.com>
10575 * arm.cc (Arm_relobj::processor_specific_flags): New method
10577 (Arm_relobj::do_read_symbols): New method declaration.
10578 (Arm_relobj::processor_specific_flags_): New data member declaration.
10579 (Arm_dynobj): New class definition.
10580 (Target_arm::do_finalize_sections): Add input_objects parameter.
10581 (Target_arm::do_adjust_elf_header): New method declaration.
10582 (Target_arm::are_eabi_versions_compatible,
10583 (Target_arm::merge_processor_specific_flags): New method declaration.
10584 (Target_arm::do_make_elf_object): New overloaded method definitions
10586 (Arm_relobj::do_read_symbols): New method definition.
10587 (Arm_dynobj::do_read_symbols): Ditto.
10588 (Target_arm::do_finalize_sections): Add input_objects parameters.
10589 Merge processor-specific flags from all input objects.
10590 (Target_arm::are_eabi_versions_compatible,
10591 Target_arm::merge_processor_specific_flags,
10592 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
10593 New method definitions.
10594 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
10595 Input_objects pointer type parameter.
10596 * layout.cc (Layout::finalize): Pass input objects to target's.
10597 finalize_sections function.
10598 * output.cc (Output_file_header::do_sized_write): Set ELF file
10599 header's processor-specific flags.
10600 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
10601 Input_objects pointer type parameter.
10602 * sparc.cc (Target_sparc::do_finalize_sections): Same.
10603 * target.h (Input_objects): New forward class declaration.
10604 (Target::processor_specific_flags,
10605 Target::are_processor_specific_flags_sect): New method definitions.
10606 (Target::finalize_sections): Add input_objects parameter.
10607 (Target::Target): Initialize processor_specific_flags_ and
10608 are_processor_specific_flags_set_.
10609 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
10611 (Target::set_processor_specific_flags): New method definition.
10612 (Target::processor_specific_flags_,
10613 Target::are_processor_specific_flags_set_): New data member
10615 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
10616 Input_objects pointer type parameter.
10618 2009-10-30 Doug Kwan <dougkwan@google.com>
10620 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
10622 2009-10-28 Ian Lance Taylor <iant@google.com>
10624 * object.h (class Relobj): Drop options parameter from
10625 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
10626 do_scan_relocs, do_relocate. Change all callers.
10627 (class Sized_relobj): Drop options parameters from
10628 do_gc_process_relocs, do_scan_relocs, do_relocate,
10629 do_relocate_sections, relocate_sections, emit_relocs_scan,
10630 emit_relocs_scan_reltype. Change all callers.
10631 (struct Relocate_info): Remove options field and all references to
10633 * reloc.h (class Read_relocs): Remove options constructor
10634 parameter and options_ field. Change all callers.
10635 (class Gc_process_relocs, class Scan_relocs): Likewise.
10636 (class Relocate_task): Likewise.
10637 * target-reloc.h (scan_relocs): Remove options parameter. Change
10639 (scan_relocatable_relocs): Likewise.
10640 * target.h (class Sized_target): Remove options parameter from
10641 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
10643 * gc.h (gc_process_relocs): Remove options parameter. Change all
10645 * arm.cc: Update functions to remove options parameters.
10646 * i386.cc: Likewise.
10647 * powerpc.cc: Likewise.
10648 * sparc.cc: Likewise.
10649 * x86_64.cc: Likewise.
10650 * testsuite/testfile.cc: Likewise.
10652 2009-10-28 Doug Kwan <dougkwan@google.com>
10654 * arm.cc (Arm_relobj): New class definition.
10655 (Arm_relobj::scan_sections_for_stubs,
10656 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
10657 New method definitions.
10659 2009-10-28 Cary Coutant <ccoutant@google.com>
10661 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
10662 (Plugin::cleanup_done_): New member.
10663 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
10664 (Plugin_manager::cleanup_done_): Remove.
10665 (Plugin_manager::add_input_file): Edit error message.
10666 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
10667 (Plugin_manager::cleanup): Remove use of cleanup_done_.
10669 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
10671 * fileread.cc: (File_read::View::~View): Use the new
10672 data_ownership_ filed.
10673 (File_read::~File_read): Dispose the new whole_file_view_.
10674 (File_read::open): Mmap the whole file if needed.
10675 (File_read::open): Use whole_file_view_ instead of contents_.
10676 (File_read::find_view): Use whole_file_view_ if applicable.
10677 (File_read::do_read): Use whole_file_view_ instead of contents_.
10678 (File_read::make_view): Use whole_file_view_ instead of contents_,
10679 update File_read::View::View call.
10680 (File_read::find_or_make_view): Update File_read::View::View
10682 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
10684 (File_read::View::Data_ownership): New enum.
10685 (File_read::View::View): Replace bool mapped_ with Data_ownership
10687 (File_read::View::mapped_): Remove (replaced by data_ownership_).
10688 (File_read::View::data_ownership_): New field.
10689 (File_read::contents_): Remove (replaced by whole_file_view_).
10690 (File_read::whole_file_view_): New field.
10691 * options.h (class General_options): Add --keep-files-mapped.
10693 2009-10-27 Cary Coutant <ccoutant@google.com>
10695 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
10696 * testsuite/Makefile.am (plugin_test_5): New test case.
10697 * testsuite/Makefile.in: Regenerate.
10699 2009-10-25 Doug Kwan <dougkwan@google.com>
10701 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
10702 from private to protected to allow access by child class.
10703 (Sized_relobj::do_relocate_sections): New method declaration.
10704 (Sized_relobj::relocate_sections): Virtualize.
10705 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
10706 Sized_relobj::relocate_sections. Instantiate template explicitly
10707 for different target sizes and endianity.
10709 2009-10-24 Doug Kwan <dougkwan@google.com>
10711 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
10712 (Arm_input_section::as_arm_input_section): New method.
10713 (Arm_output_section): New class definition.
10714 (Arm_output_section::create_stub_group,
10715 Arm_output_section::group_sections): New method definitions.
10717 2009-10-22 Doug Kwan <dougkwan@google.com>
10719 * arm.cc (Arm_input_section): New class definition.
10720 (Arm_input_section::init, Arm_input_section:do_write,
10721 Arm_input_section::set_final_data_size,
10722 Arm_input_section::do_reset_address_and_file_offset): New method
10725 2009-10-21 Doug Kwan <dougkwan@google.com>
10727 * arm.cc (Stub_table, Arm_input_section): New forward class
10729 (Stub_table): New class defintion.
10730 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
10731 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
10732 New method definition.
10734 2009-10-21 Doug Kwan <dougkwan@google.com>
10736 * arm.cc: Update copyright comments.
10737 (Target_arm): New forward class template declaration.
10738 (Arm_address): New type.
10739 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
10740 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
10741 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
10743 (Insn_template): Same.
10744 (DEF_STUBS): New macro.
10745 (Stub_type): New enum type.
10746 (Stub_template): New class definition.
10748 (Reloc_stub): Same.
10749 (Stub_factory): Same.
10750 (Target_arm::Target_arm): Initialize may_use_blx_ and
10751 should_force_pic_veneer_.
10752 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
10753 Target_arm::should_force_pic_veneer,
10754 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
10755 Target_arm::using_thumb_only, Target_arm:;default_target): New
10757 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
10758 New data member declarations.
10759 (Insn_template::size, Insn_template::alignment): New method defintions.
10760 (Stub_template::Stub_template): New method definition.
10761 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
10762 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
10763 (Stub_factory::Stub_factory): New method definition.
10764 * gold.h (string_hash): New template.
10765 * output.h (Input_section_specifier::hash_value): Use
10767 (Input_section_specifier::string_hash): Remove.
10768 * stringpool.cc (Stringpool_template::string_hash): Use
10771 2009-10-20 Doug Kwan <dougkwan@google.com>
10773 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
10774 symbols of relaxed input sections.
10775 * output.h (Output_section::find_relaxed_input_section): Make
10778 2009-10-16 Doug Kwan <dougkwan@google.com>
10780 * dynobj.cc (Versions::Versions): Initialize version_script_.
10781 Only insert base version symbol definition for a shared object
10782 if version script defines any version versions.
10783 (Versions::define_base_version): New method definition.
10784 (Versions::add_def): Check that base version is not needed.
10785 (Versions::add_need): Define base version lazily.
10786 * dynobj.h (Versions::define_base_version): New method declaration.
10787 (Versions::needs_base_version_): New data member declaration.
10788 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
10789 (check_DATA): Add no_version_test.stdout.
10790 (libno_version_test.so, no_version_test.o no_version_test.stdout):
10792 * testsuite/Makefile.in: Regenerate.
10793 * testsuite/no_version_test.c: New file.
10794 * testsuite/no_version_test.sh: Ditto.
10796 2009-10-16 Doug Kwan <dougkwan@google.com>
10798 * expression.cc (class Segment_start_expression): New class definition.
10799 (Segment_start_expression::value): New method definition.
10800 (script_exp_function_segment_start): Return a new
10801 Segment_start_expression.
10802 * gold/script-c.h (script_saw_segment_start_expression): New function
10804 * script-sections.cc (Script_sections::Script_sections): Initialize
10805 SAW_SEGMENT_START_EXPRESSION_ to false.
10806 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
10807 and -Tbbs options to specify section addresses if given in
10808 command line and no SEGMENT_START expression is seen in a script.
10809 * script-sections.h (Script_sections::saw_segment_start_expression,
10810 Script_sections::set_saw_segment_start_expression): New method
10812 (Script_sections::saw_segment_start_expression_): New data member
10814 * script.cc (script_saw_segment_start_expression): New function.
10815 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
10816 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
10817 script_test_7.sh and script_test_8.sh.
10818 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
10819 script_test_8.stdout.
10820 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
10821 (script_test_6, script_test_6.stdout, script_test_7,
10822 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
10823 * Makefile.in: Regenerate.
10824 * testsuite/script_test_6.sh: New file.
10825 * testsuite/script_test_6.t: Same.
10826 * testsuite/script_test_7.sh: Same.
10827 * testsuite/script_test_7.t: Same.
10828 * testsuite/script_test_8.sh: Same.
10830 2009-10-16 Doug Kwan <dougkwan@google.com>
10832 * output.cc (Output_segment::set_section_list_address): Cast
10833 expressions to unsigned long long type to avoid format warnings.
10835 2009-10-15 Ian Lance Taylor <iant@google.com>
10837 * script.cc (Script_options::add_symbol_assignment): Always add a
10838 dot assignment to script_sections_.
10839 * script-sections.cc (Script_sections::add_dot_assignment):
10840 Initialize if necessary.
10842 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
10843 program headers with no load segment if there is a linker script.
10845 * layout.cc (Layout::set_segment_offsets): Align the file offset
10846 to the segment aligment for -N or -n with no load segment.
10847 * output.cc (Output_segment::add_output_section): Don't crash if
10848 the first section is a TLS section.
10849 (Output_segment::set_section_list_addresses): Print an error
10850 message if the address moves backward in a linker script.
10851 * script-sections.cc
10852 (Output_section_element_input::set_section_addresses): Don't
10853 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
10854 (Orphan_output_section::set_section_addresses): Likewise.
10856 2009-10-15 Doug Kwan <dougkwan@google.com>
10858 * layout.cc (Layout::finish_dynamic_section): Generate tags
10859 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
10860 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
10861 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
10863 2009-10-14 Ian Lance Taylor <iant@google.com>
10865 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
10867 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
10868 data_shdr fields of relinfo.
10869 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
10870 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
10871 R_386_TLS_LDO_32, adjust based on section flags.
10872 (Target_i386::Relocate::fix_up_ldo): Remove.
10874 2009-10-13 Ian Lance Taylor <iant@google.com>
10876 Add support for -pie.
10877 * options.h (class General_options): Add -pie and
10879 (General_options::output_is_position_independent): Test -pie.
10880 (General_options::output_is_executable): Return true if not shared
10881 and not relocatable.
10882 (General_options::output_is_pie): Remove.
10883 * options.cc (General_options::finalize): Reject incompatible uses
10885 * gold.cc (queue_middle_tasks): A -pie link is not static.
10886 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
10887 * symtab.cc (Symbol::final_value_is_known): Return false if
10888 output_is_position_independent.
10889 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
10890 output_is_position_independent.
10891 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
10892 output_is_position_independent.
10893 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
10894 output_is_position_independent.
10895 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
10897 (basic_pie_test.o, basic_pie_test): New targets.
10898 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
10899 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
10900 (two_file_pie_test): New target.
10901 * testsuite/Makefile.in: Rebuild.
10902 * README: Remove note saying that -pie is not supported.
10904 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
10906 * options.h (class General_options): Add -init and -fini.
10907 * layout.cc (Layout::finish_dynamic_section): Emit
10908 given init and fini functions.
10910 2009-10-13 Sriraman Tallam <tmsriram@google.com>
10912 * gc.h (gc_process_relocs): Check if icf is enabled using new
10914 * gold.cc (queue_initial_tasks): Likewise.
10915 (queue_middle_tasks): Likewise.
10916 * object.cc (do_layout): Likewise.
10917 * symtab.cc (is_section_folded): Likewise.
10918 * main.cc (main): Likewise.
10919 * reloc.cc (Read_relocs::run): Likewise.
10920 (Sized_relobj::do_scan_relocs): Likewise.
10921 * icf.cc (is_function_ctor_or_dtor): New function.
10922 (Icf::find_identical_sections): Check if function is ctor or dtor when
10923 safe icf is chosen.
10924 * options.h (General_options::icf): Change option to be an enum.
10925 (Icf_status): New enum.
10926 (icf_enabled): New method.
10927 (icf_safe_folding): New method.
10928 (set_icf_status): New method.
10929 (icf_status_): New variable.
10930 * (options.cc) (General_options::finalize): Set icf_status_.
10931 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
10932 icf_test and icf_keep_unique_test to use the --icf enum flag.
10933 * testsuite/icf_safe_test.sh: New file.
10934 * testsuite/icf_safe_test.cc: New file.
10936 2009-10-12 Sriraman Tallam <tmsriram@google.com>
10938 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
10939 includes to gc.h and icf.h.
10940 * arm.cc: Include gc.h.
10941 * gold.cc: Likewise.
10942 * i386.cc: Likewise.
10943 * powerpc.cc: Likewise.
10944 * sparc.cc: Likewise.
10945 * x86_64.cc: Likewise.
10946 * gc.h: Include icf.h.
10948 2009-10-11 Ian Lance Taylor <iant@google.com>
10950 * plugin.cc: Include "gold.h" before other header files.
10952 2009-10-10 Chris Demetriou <cgd@google.com>
10954 * options.h (Input_file_argument::Input_file_type): New enum.
10955 (Input_file_argument::is_lib_): Replace with...
10956 (Input_file_argument::type_): New member.
10957 (Input_file_argument::Input_file_argument): Take Input_file_type
10958 'type' rather than boolean 'is_lib' as second argument.
10959 (Input_file_argument::is_lib): Use type_.
10960 (Input_file_argument::is_searched_file): New function.
10961 (Input_file_argument::may_need_search): Handle is_searched_file.
10962 * options.cc (General_options::parse_library): Support -l:filename.
10963 (General_options::parse_just_symbols): Update for Input_file_argument
10965 (Command_line::process): Likewise.
10966 * archive.cc (Archive::get_file_and_offset): Likewise.
10967 * plugin.cc (Plugin_manager::release_input_file): Likewise.
10968 * script.cc (read_script_file, script_add_file): Likewise.
10969 * fileread.cc (Input_file::Input_file): Likewise.
10970 (Input_file::will_search_for): Handle is_searched_file.
10971 (Input_file::open): Likewise.
10972 * readsyms.cc (Read_symbols::get_name): Likewise.
10973 * testsuite/Makefile.am (searched_file_test): New test.
10974 * testsuite/Makefile.in: Regenerate.
10975 * testsuite/searched_file_test.cc: New file.
10976 * testsuite/searched_file_test_lib.cc: New file.
10978 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10979 Ian Lance Taylor <iant@google.com>
10981 * descriptor.cc: Include <cstdio> and "binary-io.h".
10982 (Descriptors::open): Open the files in binary mode always.
10983 * script.cc (Lex::get_token): Treat \r as whitespace.
10985 2009-10-09 Ian Lance Taylor <iant@google.com>
10987 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
10989 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10990 Ian Lance Taylor <iant@google.com>
10992 * configure.ac: Check for readv function also.
10993 * fileread.cc (readv): Define if not HAVE_READV.
10994 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
10996 * config.in: Regenerate.
10997 * configure: Regenerate.
10999 2009-10-09 Doug Kwan <dougkwan@google.com>
11001 * layout.cc (Layout::make_output_section): Call target hook to make
11002 ordinary output section.
11003 (Layout::finalize): Adjust parameter list of call the
11004 Target::may_relax().
11005 * layout.h (class Layout::section_list): New method.
11006 * merge.h (Output_merge_base::entsize): Change visibility to public.
11007 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11009 (Output_merge_string::do_is_string): New method.
11010 * object.cc (Sized_relobj::do_setup): renamed from
11011 Sized_relobj::set_up.
11012 * object.h (Sized_relobj::adjust_shndx,
11013 Sized_relobj::initializ_input_to_output_maps,
11014 Sized_relobj::free_input_to_output_maps): Change visibilities to
11016 (Sized_relobj::setup): Virtualize.
11017 (Sized_relobj::do_setup): New method declaration.
11018 (Sized_relobj::invalidate_section_offset,
11019 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11020 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11021 * options.cc (parse_int): New function.
11022 * options.h (parse_int): New declaration.
11023 (DEFINE_int): New macro.
11024 (stub_group_size): New option.
11025 * output.cc (Output_section::Output_section): Initialize memebers
11026 merge_section_map_, merge_section_by_properties_map_,
11027 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11028 (Output_section::add_input_section): Handled deferred code-fill
11029 generation and remove an old comment.
11030 (Output_section::add_relaxed_input_section): New method definition.
11031 (Output_section::add_merge_input_section): Use merge section by
11032 properties map to speed to search. Update merge section maps
11034 (Output_section::build_relaxation_map): New method definition.
11035 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11037 (Output_section::relax_input_section): Renamed to
11038 Output_section::convert_input_sections_to_relaxed_sections and change
11039 interface to take a vector of pointers to relaxed sections.
11040 (Output_section::find_merge_section,
11041 Output_section::find_relaxed_input_section): New method definitions.
11042 (Output_section::is_input_address_mapped,
11043 Output_section::output_offset, Output_section::output_address):
11044 Use output section data maps to speed up searching.
11045 (Output_section::find_starting_output_address): Add comments.
11046 (Output_section::do_write,
11047 Output_section::write_to_postprocessing_buffer): Do code-fill
11048 generation as appropriate.
11049 (Output_section::get_input_sections): Invalidate relaxed input section
11051 (Output_section::restore_states): Adjust type of checkpoint .
11052 Invalidate relaxed input section map.
11053 * output.h (Output_merge_base): New class declaration.
11054 (Input_section_specifier): New class defintion.
11055 (class Output_relaxed_input_section) Change base class to
11056 Output_section_data_build.
11057 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11058 base class initializer.
11059 (Output_section::add_relaxed_input_section): New method declaration.
11060 (Output_section::Input_section): Change visibility to protected.
11061 (Output_section::Input_section::relobj,
11062 Output_section::Input_section::shndx): Handle relaxed input sections.
11063 Output_section::input_sections) Change visibility to protected. Also
11064 define overload to return a non-const pointer.
11065 (Output_section::Merge_section_properties): New class defintion.
11066 (Output_section::Merge_section_by_properties_map,
11067 Output_section::Output_section_data_by_input_section_map,
11068 Output_section::Relaxation_map): New types.
11069 (Output_section::relax_input_section): Rename method to
11070 Output_section::convert_input_sections_to_relaxed_sections and change
11071 interface to take a vector of relaxed section pointers.
11072 (Output_section::find_merge_section,
11073 Output_section::find_relaxed_input_section,
11074 Output_section::build_relaxation_map,
11075 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11076 New method declarations.
11077 (Output_section::merge_section_map_
11078 Output_section::merge_section_by_properties_map_,
11079 Output_section::relaxed_input_section_map_,
11080 Output_section::is_relaxed_input_section_map_valid_,
11081 Output_section::generate_code_fills_at_write_): New data members.
11082 * script-sections.cc
11083 (Output_section_element_input::set_section_addresses): Call
11084 current_data_size and addralign methods of relaxed input sections.
11085 (Orphan_output_section::set_section_addresses): Call current_data_size
11086 and addralign methods of relaxed input sections.
11087 * symtab.cc (Symbol_table::compute_final_value): Extract template
11088 from the body of Symbol_table::sized_finalize_symbol.
11089 (Symbol_table::sized_finalized_symbol): Call
11090 Symbol_table::compute_final_value.
11091 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11092 (Symbol_table::compute_final_value): New templated method declaration.
11093 * target.cc (Target::do_make_output_section): New method defintion.
11094 * target.h (Target::make_output_section): New method declaration.
11095 (Target::relax): Add more parameters for input objects, symbol table
11096 and layout. Adjust call to do_relax.
11097 (Target::do_make_output_section): New method declaration.
11098 (Target::do_relax): Add parameters for input objects, symbol table
11101 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11103 * pread.c: Include stdio.h.
11105 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11107 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11110 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11112 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11113 Change read_shndx type to unsigned int.
11114 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11116 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11117 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11118 Change read_shndx type to unsigned int.
11119 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11121 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11122 * layout.cc (Layout::create_symtab_sections): Cast the result of
11123 local_symcount * symsize to off_t in the gold_assert.
11125 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11127 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11128 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11130 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11131 (Arm_relocate_functions::thm_abs5): New function.
11132 (Arm_relocate_functions::abs12): New function.
11133 (Arm_relocate_functions::abs16): New function.
11134 (Arm_relocate_functions::base_abs): New function.
11135 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
11136 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
11137 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
11139 (Scan::global): Likewise.
11140 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
11141 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
11142 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
11143 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11146 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11148 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11149 (Arm_relocate_functions::movt_prel): New function.
11150 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11151 (Arm_relocate_functions::thm_movt_prel): New function.
11152 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11153 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11154 (Scan::global, Relocate::relocate): Likewise.
11155 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11157 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11159 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11160 Incremental_checker.
11161 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11163 (class Incremental_inputs_header): New class.
11164 (Incremental_inputs_header_writer): Edit comment.
11165 (Incremental_inputs_entry): New class.
11166 (Incremental_inputs_entry_writer): Edit comment.
11167 (Sized_incremental_binary::do_find_incremental_inputs_section):
11168 Add *strtab_shndx parameter, fill it.
11169 (Sized_incremental_binary::do_check_inputs): New method.
11170 (Incremental_checker::can_incrementally_link_output_file): Use
11171 Sized_incremental_binary::check_inputs.
11172 (Incremental_inputs::report_command_line): Save command line in
11175 (Incremental_binary::find_incremental_inputs_section): New
11177 (Incremental_binary::do_find_incremental_inputs_section): Add
11178 strtab_shndx parameter.
11179 (Incremental_binary::do_check_inputs): New pure virtual method.
11180 (Sized_incremental_binary::do_check_inputs): Declare.
11181 (Incremental_checker::Incremental_checker): Add incremental_inputs
11182 parameter, use it to initialize incremental_inputs_.
11183 (Incremental_checker::incremental_inputs_): New field.
11184 (Incremental_checker::command_line): New method.
11185 (Incremental_checker::inputs): New method.
11186 (Incremental_checker::command_line_): New field.
11188 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11190 * incremental.cc: Include <cstdarg> and "target-select.h".
11191 (vexplain_no_incremental): New function.
11192 (explain_no_incremental): New function.
11193 (Incremental_binary::error): New method.
11194 (Sized_incremental_binary::do_find_incremental_inputs_section): New
11196 (make_sized_incremental_binary): New function.
11197 (open_incremental_binary): New function.
11198 (can_incrementally_link_file): Add checks if output is ELF and has
11200 * incremental.h: Include "elfcpp_file.h" and "output.h".
11201 (Incremental_binary): New class.
11202 (Sized_incremental_binary): New class.
11203 (open_incremental_binary): Declare.
11204 * object.cc (is_elf_object): Use
11205 elfcpp::Elf_recognizer::is_elf_file.
11206 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
11207 * output.h (Output_file::filesize): New method.
11209 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11211 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
11213 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
11214 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
11216 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
11218 (Arm_relocate_functions::movw_abs_nc): New function.
11219 (Arm_relocate_functions::movt_abs): New function.
11220 (Arm_relocate_functions::thm_movw_abs_nc): New function.
11221 (Arm_relocate_functions::thm_movt_abs): New function.
11222 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
11223 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
11224 (Scan::global): Likewise.
11225 (Relocate::relocate): Likewise.
11226 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11228 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11230 * arm.cc (Arm_relocate_functions::got_prel) New function.
11231 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
11232 (Relocate::relocate): Likewise.
11233 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11235 2009-10-06 Ian Lance Taylor <iant@google.com>
11237 * options.h (class General_options): Define
11238 split_stack_adjust_size parameter.
11239 * object.h (class Object): Add uses_split_stack_ and
11240 has_no_split_stack_ fields. Add uses_split_stack and
11241 has_no_split_stack accessor functions. Declare
11242 handle_split_stack_section.
11243 (class Reloc_symbol_changes): Define.
11244 (class Sized_relobj): Define Function_offsets. Declare
11245 split_stack_adjust, split_stack_adjust_reltype, and
11247 * object.cc (Object::handle_split_stack_section): New function.
11248 (Sized_relobj::do_layout): Call handle_split_stack_section.
11249 * dynobj.cc (Sized_dynobj::do_layout): Call
11250 handle_split_stack_section.
11251 * reloc.cc (Sized_relobj::relocate_sections): Call
11252 split_stack_adjust for executable sections in split_stack
11253 objects. Pass reloc_map to relocate_section.
11254 (Sized_relobj::split_stack_adjust): New function.
11255 (Sized_relobj::split_stack_adjust_reltype): New function.
11256 (Sized_relobj::find_functions): New function.
11257 * target-reloc.h: Include "object.h".
11258 (relocate_section): Add reloc_symbol_changes parameter. Change
11260 * target.h (class Target): Add calls_non_split method. Declare
11261 do_calls_non_split virtual method. Declare match_view and
11263 * target.cc: Include "elfcpp.h".
11264 (Target::do_calls_non_split): New function.
11265 (Target::match_view): New function.
11266 (Target::set_view_to_nop): New function.
11267 * gold.cc (queue_middle_tasks): Give an error if mixing
11268 split-stack and non-split-stack objects with -r.
11269 * i386.cc (Target_i386::relocate_section): Add
11270 reloc_symbol_changes parameter.
11271 (Target_i386::do_calls_non_split): New function.
11272 * x86_64.cc (Target_x86_64::relocate_section): Add
11273 reloc_symbol_changes parameter.
11274 (Target_x86_64::do_calls_non_split): New function.
11275 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
11277 * powerpc.cc (Target_powerpc::relocate_section): Add
11278 reloc_symbol_changes parameter.
11279 * sparc.cc (Target_sparc::relocate_section): Add
11280 reloc_symbol_changes parameter.
11281 * configure.ac: Call AM_CONDITIONAL for the default target.
11282 * configure: Rebuild.
11283 * testsuite/Makefile.am (TEST_AS): New variable.
11284 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
11285 (check_DATA): Add split_i386 and split_x86_64 files.
11286 (SPLIT_DEFSYMS): Define.
11287 (split_i386_[1234n].o): New targets.
11288 (split_i386_[124]): New targets.
11289 (split_i386_[1234r].stdout): New targets.
11290 (split_x86_64_[1234n].o): New targets.
11291 (split_x86_64_[124]): New targets.
11292 (split_x86_64_[1234r].stdout): New targets.
11293 (MOSTLYCLEANFILES): Add new executables.
11294 * testsuite/split_i386.sh: New file.
11295 * testsuite/split_x86_64.sh: New file.
11296 * testsuite/split_i386_1.s: New file.
11297 * testsuite/split_i386_2.s: New file.
11298 * testsuite/split_i386_3.s: New file.
11299 * testsuite/split_i386_4.s: New file.
11300 * testsuite/split_i386_n.s: New file.
11301 * testsuite/split_x86_64_1.s: New file.
11302 * testsuite/split_x86_64_2.s: New file.
11303 * testsuite/split_x86_64_3.s: New file.
11304 * testsuite/split_x86_64_4.s: New file.
11305 * testsuite/split_x86_64_n.s: New file.
11306 * testsuite/testfile.cc (Target_test): Update relocation_section
11308 * testsuite/Makefile.in: Rebuild.
11310 2009-10-06 Ian Lance Taylor <iant@google.com>
11312 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
11313 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
11314 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
11315 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
11316 the address on ldo_addrs_.
11317 (Target_i386::Relocate::fix_up_ldo): New function.
11319 2009-10-06 Rafael Espindola <espindola@google.com>
11321 * plugin.cc (add_input_library): New.
11322 (Plugin::load): Add add_input_library to tv.
11323 (Plugin_manager::add_input_file): Add the is_lib argument.
11324 (add_input_file): Update call to Plugin_manager::add_input_file.
11325 (add_input_library): New.
11326 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
11328 2009-09-30 Doug Kwan <dougkwan@google.com>
11330 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
11331 symbol and call Symbol::may_need_copy_reloc to determine if
11332 a copy reloc is needed.
11333 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
11334 nocopyreloc is given in command line.
11335 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
11336 given in command line.
11337 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
11338 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
11339 of the removed Target_i386::may_need_copy_reloc.
11340 * options.h (copyreloc): New option with default value false.
11341 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11342 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
11343 instead of the removed Target_powerpc::may_need_copy_reloc.
11344 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11345 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
11346 instead of the removed Target_sparc::may_need_copy_reloc.
11347 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
11348 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
11349 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
11350 instead of the removed Target_x86_64::may_need_copy_reloc.
11352 2009-09-30 Ian Lance Taylor <iant@google.com>
11354 * object.h (class Object): Remove target_ field, and target,
11355 sized_target, and set_target methods.
11356 (Object::sized_target): Remove.
11357 (class Sized_relobj): Update declarations. Remove sized_target.
11358 * object.cc (Sized_relobj::setup): Remove target parameter.
11359 Change all callers.
11360 (Input_objects::add_object): Don't do anything with the target.
11361 (make_elf_sized_object): Add punconfigured parameter. Change all
11362 callers. Set or test parameter target.
11363 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
11364 Change all callers.
11365 * parameters.cc (Parameters::set_target): Change parameter type to
11367 (Parameters::default_target): Remove.
11368 (set_parameters_target): Change parameter type to be non-const.
11369 (parameters_force_valid_target): New function.
11370 (parameters_clear_target): New function.
11371 * parameters.h (class Parameters): Update declarations. Remove
11372 default_target method. Add sized_target and clear_target
11373 methods. Change target_ to be non-const.
11374 (set_parameters_target): Update declaration.
11375 (parameters_force_valid_target): Declare.
11376 (parameters_clear_target): Declare.
11377 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
11378 as NULL if we aren't searching.
11379 (Add_symbols::run): Don't check for compatible target.
11380 * fileread.cc (Input_file::open_binary): Call
11381 parameters_force_valid_target.
11382 * gold.cc (queue_middle_tasks): Likewise.
11383 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
11384 set_target on object.
11385 * dynobj.h (class Sized_dynobj): Update declarations.
11386 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
11387 make_elf_object returns NULL.
11388 (Archive::include_member): Don't check whether object target is
11390 * output.cc (Output_section::add_input_section): Get target from
11392 (Output_section::relax_input_section): Likewise.
11393 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
11395 (Sized_relobj::do_scan_relocs): Likewise.
11396 (Sized_relobj::relocate_sections): Likewise.
11397 * resolve.cc (Symbol_table::resolve): Likewise.
11398 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
11399 parameter. Change all callers.
11400 (Symbol_table::add_from_object): Get target from parameters.
11401 (Symbol_table::add_from_relobj): Don't check object target.
11402 (Symbol_table::add_from_dynobj): Likewise.
11403 (Symbol_table::define_special_symbol): Get target from
11405 * symtab.h (class Symbol_table): Update declaration.
11406 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
11407 parameter. Change all callers. Clear parameter target.
11408 (Binary_test): Test target here.
11409 * testsuite/object_unittest.cc (gold_testsuite): Remove
11410 target_test_pointer parameter. Change all callers.
11411 (Object_test): Test target here.
11413 2009-09-26 Ian Lance Taylor <iant@google.com>
11415 * testsuite/initpri1.c: Don't try to use constructor priorities if
11416 compiling with gcc before 4.3.
11418 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
11420 * testsuite/retain_symbols_file_test.sh (check_present): Change
11421 output file name to retain_symbols_file_test.stdout.
11422 (check_absent): Likewise.
11424 2009-09-18 Craig Silverstein <csilvers@google.com>
11426 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
11427 * options.cc: Include <cerrno> and <fstream>.
11428 (General_options::finalize): Parse -retain-symbols-file tag.
11429 * options.h: New flag.
11430 (General_options): New method should_retain_symbol, new
11431 variable symbols_to_retain.
11432 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
11433 should_retain_symbol map.
11434 * testsuite/Makefile.am (retain_symbols_file_test): New test.
11435 * testsuite/Makefile.in: Regenerate.
11436 * testsuite/retain_symbols_file_test.sh: New file.
11438 2009-09-18 Nick Clifton <nickc@redhat.com>
11440 * po/es.po: Updated Spanish translation.
11442 2009-09-17 Doug Kwan <dougkwan@google.com>
11444 * debug.h (DEBUG_RELAXATION): New constant.
11445 (DEBUG_ALL): Add DEBUG_RELAXATION.
11446 (debug_string_to_enum): Add relaxation debug option.
11448 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
11449 Layout::Relaxation_debug_check::read_sections,
11450 Layout::Relaxation_debug_check::read_sections): New method definitions.
11451 (Layout::Layout): Initialize data members
11452 record_output_section_data_from_scrips_,
11453 script_output_section_data_list_ and relaxation_debug_check_.
11454 (Layout::save_segments, Layout::restore_segments,
11455 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11456 Layout::relaxation_loop_body): New method definitions.
11457 (Layout::finalize): Support relaxation. Move section layout code to
11458 Layout::relaxation_loop_body.
11459 (Layout::set_asection_address_from_script): Move code for orphan
11460 section placement out.
11461 (Layout::place_orphan_sections_in_script): New method definition.
11462 * layout.h (Output_segment_headers, Output_file_header):
11463 New forward class declarations.
11464 (Layout::~Layout): Define.
11465 (Layout::new_output_section_data_from_script): New method definition.
11466 (Layout::place_orphan_sections_in_script): New method declaration.
11467 (Layout::Segment_states): New type declaration.
11468 (Layout::save_segments, Layout::restore_segments,
11469 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11470 Layout::relaxation_loop_body): New method declarations.
11471 (Layout::Output_section_data_list): New type declaration.
11472 (Layout::Relaxation_debug_check): New class definition.
11473 (Layout::record_output_section_data_from_script_,
11474 Layout::script_output_section_data_list_, Layout::segment_states_,
11475 Layout::relaxation_debug_check_): New data members.
11476 * output.cc: (Output_section_headers::do_size): New method definition.
11477 (Output_section_headers::Output_section_headers): Move size
11478 computation to Output_section_headers::do_size.
11479 (Output_segment_headers::do_size): New method definition.
11480 (Output_file_header::Output_file_header): Move size computation to
11481 Output_file_header::do_size and call it.
11482 (Output_file_header::do_size): New method definition.
11483 (Output_data_group::Output_data_group): Adjust call to
11484 Output_section_data.
11485 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
11486 (Output_symtab_xindex::do_write): Add array bound check.
11487 (Output_section::Input_section::print_to_mapfile): Handle
11488 RELAXED_INPUT_SECTION_CODE.
11489 (Output_section::Output_section): Initialize data member checkpoint_.
11490 (Output_section::~Output_section): Delete checkpoint object pointed
11492 (Output_section::add_input_section): Always add an Input_section if
11494 (Output_section::add_merge_input_section): Add assert.
11495 (Output_section::relax_input_section): New method definition.
11496 (Output_section::set_final_data_size): Set load address to zero for
11497 an unallocated section.
11498 (Output_section::do_address_and_file_offset_have_reset_values):
11499 New method definition.
11500 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
11501 Handle relaxed input section.
11502 (Output_section::sort_attached_input_sections): Checkpoint input
11503 section list lazily.
11504 (Output_section::get_input_sections): Change type of input_sections to
11505 list of Simple_input_section pointers. Checkpoint input section list
11506 lazily. Also handle relaxed input sections.
11507 (Output_section::add_input_section_for_script): Take a reference to
11508 a Simple_input_section object instead of Relobj pointer and section
11509 index as parameter. Handle relaxed input sections.
11510 (Output_section::save_states, Output_section::restore_states): New
11511 method definitions.
11512 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
11513 (Output_data::is_data_size_fixed): New method definition.
11514 (Output_data::reset_addresss_and_file_offset): Do not reset data size
11516 (Output_data::address_and_file_offset_have_reset_values): New method
11518 (Output_data::do_address_and_file_offset_have_reset_values): New method
11520 (Output_data::set_data_size): Check that data size is not fixed.
11521 (Output_data::fix_data_size): New method definition.
11522 (Output_data::is_data_size_fixed_): New data member.
11523 (Output_section_headers::set_final_data_size): New method definition.
11524 (Output_section_headers::do_size): New method declaration.
11525 (Output_segment_headers::set_final_data_size): New method definition.
11526 (Output_segment_headers::do_size): New method declaration.
11527 (Output_file_header::set_final_data_size)::New method definition.
11528 (Output_file_header::do_size)::New method declaration.
11529 (Output_section_data::Output_section_data): Add new parameter
11530 is_data_size_fixed and use it to fix data size.
11531 (Output_data_const::Output_data_const): Adjust call to base class
11532 constructor and fix data size.
11533 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
11534 base class constructor and fix data size.
11535 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
11536 base class constructor and fix data size.
11537 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
11538 class constructor and fix data size.
11539 (Output_data_group::set_final_data_size): New method definition.
11540 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
11541 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
11542 class constructor and fix data size.
11543 (Output_relaxed_input_section): New class definition.
11544 (Output_section::Simple_input_section): New class definition.
11545 (Output_section::get_input_sections): Adjust parameter list.
11546 (Output_section::add_input_section_for_script): Same.
11547 (Output_section::save_states, Output_section::restore_states,
11548 Output_section::do_address_and_file_offset_have_reset_values,
11549 (Output_section::Input_section::Input_section): Handle
11550 RELAXED_INPUT_SECTION_CODE. Add new overload for
11551 Output_relaxed_input_section.
11552 (Output_section::Input_section::is_input_section,
11553 Output_section::Input_section::set_output_section): Handle relaxed
11555 (Output_section::Input_section::is_relaxed_input_section,
11556 Output_section::Input_section::output_section_data,
11557 Output_section::Input_section::relaxed_input_section): New method
11559 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
11561 (Output_section::Input_section::u1_): Update comments.
11562 (Output_section::Input_section::u2_): Add new union member poris.
11563 (Output_section::Checkpoint_output_section): New classs definition.
11564 (Output_section::relax_input_section): New method declaration.
11565 (Output_section::checkpoint_): New data member.
11566 (Output_segment): Update comments.
11567 (Output_segment::Output_segment): Un-privatize copy constructor.
11568 (Output_segment::operator=): Un-privatize.
11569 * script-sections.cc (Output_section_element::Input_section_list):
11570 Change element type to Output_section::Simple_input_section.
11571 (Output_section_element_dot_assignment::set_section_addresses):
11572 Register output section data for relaxation clean up.
11573 (Output_data_exression::Output_data_expression): Adjust call to base
11574 constructor to fix data size.
11575 (Output_section_element_data::set_section_addresses): Register
11576 Output_data_expression object for relaxation clean up.
11577 (struct Input_section_info): Replace Relobj pointer and section index
11578 pair with Output_section::Simple_input_section and Convert struct to a
11580 (Input_section_sorter::operator()): Adjust access to
11581 Input_section_info data member to use accessors.
11582 (Output_section_element_input::set_section_addresses): Use layout
11583 parameter. Adjust code to use Output_section::Simple_input_section
11584 and Input_secction_info classes. Register filler for relaxation
11586 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
11587 and section index pair with Output_section::Simple_input_section
11588 class. Adjust code accordingly.
11589 (Phdrs_element::release_segment): New method definition.
11590 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
11592 (Script_sections::release_segments): New method definition.
11593 * gold/script-sections.h (Script_sections::release_segments): New
11594 method declaration.
11595 * gold/target.h (Target::may_relax, Target::relax,
11596 Target::do_may_relax, Target::do_relax): New method definitions.
11598 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11600 * arm.cc (has_signed_unsigned_overflow): New function.
11601 (Arm_relocate_functions::abs8): New function.
11602 (Target_arm::Scan::local): Handle R_ARM_ABS8.
11603 (Target_arm::Scan::global): Likewise.
11604 (Target_arm::relocate::relocate): Likewise.
11605 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11608 2009-09-16 Cary Coutant <ccoutant@google.com>
11610 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
11611 * testsuite/Makefile.in: Regenerate.
11613 2009-09-11 Nick Clifton <nickc@redhat.com>
11615 * po/gold.pot: Updated by the Translation project.
11617 2009-09-08 Cary Coutant <ccoutant@google.com>
11619 * output.cc (Output_file::open): Add execute permission to empty file.
11620 * testsuite/Makefile.am (permission_test): New test.
11621 * testsuite/Makefile.in: Regenerate.
11623 2009-09-02 Ian Lance Taylor <iant@google.com>
11625 * output.cc (Output_file::resize): Call map_no_anonymous rather
11628 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
11630 * gold.cc: Include "incremental.h".
11631 (queue_initial_tasks): Call Incremental_checker methods.
11632 * incremental.cc: Include "output.h".
11633 (Incremental_checker::can_incrementally_link_output_file): New
11635 * incremental.h (Incremental_checker): New class.
11637 * output.cc (Output_file::open_for_modification): New method.
11638 (Output_file::map_anonymous): Changed return type to bool. Record
11639 map in base_ field.
11640 (Output_file::map_no_anonymous): New method, broken out of map.
11641 (Output_file::map): Use map_no_anonymous and map_anonymous.
11642 * output.h (class Output_file): Update declarations.
11644 2009-08-24 Cary Coutant <ccoutant@google.com>
11646 * options.h (Command_line::Pre_options): New class.
11647 (Command_line::pre_options): New member.
11648 * options.cc (gold::options::ready_to_register): New variable.
11649 (One_option::register_option): Do nothing if not registering options.
11650 Assert if same short option registered twice.
11651 (General_options::General_options): Turn off option registration when
11653 (Command_line::Pre_options::Pre_options): New constructor.
11655 2009-08-24 Cary Coutant <ccoutant@google.com>
11657 * options.h (General_options::no_keep_memory): Remove incorrect
11660 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11662 * Makefile.am (am__skiplex, am__skipyacc): New.
11663 * Makefile.in: Regenerate.
11665 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11667 * Makefile.am (AM_CPPFLAGS): Renamed from ...
11668 (INCLUDES): ... this.
11669 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
11670 (AM_CPPFLAGS): Renamed from ...
11671 (INCLUDE): ... this.
11672 * Makefile.in, testsuite/Makefile.in: Regenerate.
11674 * Makefile.in: Regenerate.
11675 * aclocal.m4: Likewise.
11676 * config.in: Likewise.
11677 * configure: Likewise.
11678 * testsuite/Makefile.in: Likewise.
11680 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11681 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11682 * Makefile.in: Regenerate.
11683 * testsuite/Makefile.in: Regenerate.
11685 2009-08-19 Cary Coutant <ccoutant@google.com>
11687 * resolve.cc (Symbol_table::resolve): Don't complain about defined
11688 symbols in shared libraries overridden by hidden or internal symbols
11689 in the main program.
11691 2009-08-19 Chris Demetriou <cgd@google.com>
11693 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
11694 checking source file names in error messages.
11696 2009-08-18 Doug Kwan <dougkwan@google.com>
11698 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
11699 an elcpp::Ehdr as parameter. Adjust call to set_target.
11700 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
11701 an elfcpp::Ehdr as parameter.
11702 * object.cc (Object::set_target): Remove the version that looks up
11703 a target and sets it.
11704 (Sized_relobj::setup): Take a Target object instead of
11705 an elfcpp::Ehdr as parameter. Adjust call to set_target.
11706 (make_elf_sized_object): Find target and ask target to
11707 make an ELF object.
11708 * object.h: (Object::set_target): Remove the version that looks up
11709 a target and sets it.
11710 (Sized_relobj::setup): Take a Target object instead of
11711 an elfcpp:Ehdr as parameter.
11712 * target.cc: Include dynobj.h.
11713 (Target::do_make_elf_object_implementation): New.
11714 (Target::do_make_elf_object): New.
11715 * target.h (Target::make_elf_object): New template declaration.
11716 (Target::do_make_elf_object): New method declarations.
11717 (Target::do_make_elf_object_implementation): New template declaration.
11719 2009-08-14 Ian Lance Taylor <iant@google.com>
11721 * gold.h (FUNCTION_NAME): Define.
11722 (gold_unreachable): Use FUNCTION_NAME.
11724 2009-08-12 Sriraman Tallam <tmsriram@google.com>
11726 * icf.cc (Icf::find_identical_sections): Issue a warning when a
11727 symbol in the --keep-unique list is not found.
11729 2009-08-12 Sriraman Tallam <tmsriram@google.com>
11731 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
11732 been maked as --keep-unique.
11733 (Icf::unfold_section): New function.
11734 * icf.h (Icf::unfold_section): New function.
11735 * options.h (General_options::keep_unique): New option.
11736 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
11737 * testsuite/Makefile.in: Regenerate.
11738 * testsuite/icf_keep_unique_test.sh: New file.
11739 * testsuite/icf_keep_unique_test.cc: New file.
11741 2009-08-12 Cary Coutant <ccoutant@google.com>
11744 * resolve.cc (Symbol_table::resolve): Check for references from
11745 dynamic objects to hidden and internal symbols.
11746 * testsuite/Makefile.am (hidden_test.sh): New test.
11747 * testsuite/Makefile.in: Regenerate.
11748 * testsuite/hidden_test.sh: New script.
11749 * testsuite/hidden_test_1.c: New test source.
11750 * testsuite/hidden_test_main.c: New test source.
11752 2009-08-11 Doug Kwan <dougkwan@google.com>
11754 * arm.cc: Update comments.
11755 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
11756 segment to locate the .ARM.exidx section if present.
11758 2009-08-09 Doug Kwan <dougkwan@google.com>
11760 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
11763 2009-08-07 Sriraman Tallam <tmsriram@google.com>
11764 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
11767 2009-08-06 Sriraman Tallam <tmsriram@google.com>
11769 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
11770 valid tls_segment only for non-debug-section relocations.
11771 * testsuite/Makefile.am: Add gc_tls_test.
11772 * testsuite/Makefile.in: Regenerate.
11773 * testsuite/gc_tls_test.cc: New file.
11774 * testsuite/gc_tls_test.sh: New file.
11776 2009-08-05 Sriraman Tallam <tmsriram@google.com>
11778 * icf.cc: New file.
11780 * Makefile.am (CCFILES): Add icf.cc.
11781 (HFILES): Add icf.h
11782 * Makefile.in: Regenerate.
11783 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
11784 * gc.h (gc_process_relocs): Populate lists used by icf to contain
11785 section, symbol and addend information for the relocs.
11786 * gold.cc (queue_middle_tasks): Call identical code folding.
11787 * gold.h: Add defines for multimap.
11788 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
11789 to the call of finalize_local_symbols.
11790 * main.cc (main): Create object of class Icf.
11791 * object.cc (Sized_relobj::do_layout): Allow this function to be
11792 called twice during icf.
11793 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
11794 to sections marked as identical by icf.
11795 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
11797 (Sized_relobj::do_section_entsize): New function.
11798 * object.h (Object::section_entsize): New function.
11799 (Object::do_section_entsize): New pure virtual function.
11800 (Relobj::finalize_local_symbols): Add new parameter.
11801 (Relobj::do_section_entsize): New function.
11802 * options.h (General_options::icf): New option.
11803 (General_options::icf_iterations): New option.
11804 (General_options::print_icf_sections): New option.
11805 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
11806 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
11807 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
11809 * symtab.cc (Symbol_table::is_section_folded): New function.
11810 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
11811 to sections marked as identical by icf.
11812 * symtab.h (Symbol_table::set_icf): New function.
11813 (Symbol_table::icf): New function.
11814 (Symbol_table::is_section_folded): New function.
11815 (Symbol_table::icf_): New data member.
11816 * target-reloc.h (relocate_section): Ignore sections folded by icf.
11817 * testsuite/Makefile.am: Add commands to build icf_test.
11818 * testsuite/Makefile.in: Regenerate.
11819 * testsuite/icf_test.sh: New file.
11820 * testsuite/icf_test.cc: New file.
11822 2009-07-24 Chris Demetriou <cgd@google.com>
11824 * layout.cc (is_compressible_debug_section): Fix incorrect
11825 comment about compressed section names.
11827 2009-07-20 Ian Lance Taylor <ian@airs.com>
11830 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
11832 2009-07-16 Ian Lance Taylor <iant@google.com>
11835 * layout.h: #include <map>.
11836 (class Kept_section): Change from struct to class. Add accessors
11837 and setters. Add section size to Comdat_group mapping. Change
11838 Comdat_group to std::map. Add is_comdat_ field. Add
11839 linkonce_size field in union.
11840 (class Layout): Update declaration of find_or_add_kept_section.
11841 Don't declare find_kept_object.
11842 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
11843 parameter. Add object, shndx, is_comdat, and is_group_name
11844 parameters. Change all callers. Adjust for new Kept_section.
11845 (Layout::find_kept_object): Remove.
11846 * object.cc (Sized_relobj::include_section_group): Update use of
11847 Kept_section. Rename secnum to shndx. Only record
11848 Kept_comdat_section if sections are the same size.
11849 (Sized_relobj::include_linkonce_section): Update use of
11850 Kept_section. Only record Kept_comdat_section if sections are the
11851 same size. Set size of linkonce section.
11852 (Sized_relobj::map_to_kept_section): Update call to
11853 get_kept_comdat_section.
11854 * object.h (class Sized_relobj): Rename fields in
11855 Kept_comdat_section to drop trailing underscores; change object
11856 field to Relobj*. Change Kept_comdat_section_table to store
11857 struct rather than pointer.
11858 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
11859 Add kept_object and kept_shndx parameters. Change all callers.
11860 (Sized_relobj::get_kept_comdat_section): Change return type to
11861 bool. Add kept_object and kept_shndx parameters. Change all
11863 * plugin.cc (Pluginobj::include_comdat_group): Update call to
11864 Layout::find_or_add_kept_section.
11866 2009-07-09 Ian Lance Taylor <iant@google.com>
11868 * merge.cc (Object_merge_map::initialize_input_to_output_map):
11869 Reserve space in the hash table.
11871 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
11873 * fileread.cc (File_read::get_mtime): New method.
11874 * fileread.h (Timespec): New structure.
11875 (File_read::get_mtime): New method.
11876 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
11877 Renamed from timestamp_nsec.
11878 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
11880 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
11882 (Incremental_inputs::report_archive): Save mtime; style fix.
11883 (Incremental_inputs::report_obejct): Save mtime; style fix.
11884 (Incremental_inputs::report_script): Save mtime; style fix.
11885 (Incremental_inputs::finalize_inputs): Style fix.
11886 (Incremental_inputs::finalize): Style fix.
11887 (Incremental_inputs::create_input_section_data): Store inputs
11889 * incremental.h (Incremental_inputs::report_script): Add mtime
11891 (Incremental_inputs::Input_info::Input_info): Intialize only one
11893 (Incremental_inputs::Input_info::archive): Move to nameless
11895 (Incremental_inputs::Input_info::obejct): Move to nameless union.
11896 (Incremental_inputs::Input_info::script): Move to nameless union.
11897 (Incremental_inputs::mtime): New field.
11898 * script.cc (read_input_script): Pass file mtime to
11900 * script.h (Script_info::inputs): Style fix.
11902 2009-07-01 Ian Lance Taylor <ian@airs.com>
11904 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
11907 2009-06-24 Ian Lance Taylor <iant@google.com>
11910 * layout.cc (Layout::choose_output_section): If we find an
11911 existing section, update the flags.
11912 (Layout::create_notes): New function, broken out of
11914 (Layout::finalize): Don't create note sections.
11915 (Layout::create_note): Don't crash if linker script discards
11917 (Layout::create_gold_note): Likewise.
11918 (Layout::create_build_id): Likewise. Don't set
11919 after_input_sections on the section.
11920 (Layout::create_executable_stack_info): Remove target parameter.
11922 * layout.h (class Layout): Declare create_notes. Update
11923 declaration of create_executable_stack_info.
11924 * gold.cc (queue_middle_tasks): Call create_notes.
11925 * output.cc (Output_section::update_flags_for_input_section): Move
11926 here from output.h. If SHF_ALLOC flag is newly set, mark address
11928 * output.h (Output_data::mark_address_invalid): New function.
11929 (class Output_section): Only declare, not define,
11930 update_flags_for_input_section. Remove set_flags.
11932 2009-06-24 Ian Lance Taylor <iant@google.com>
11934 * script-sections.cc (Output_section_definition::
11935 set_section_addresses): Rename shadowing local load_address to
11938 2009-06-24 Ian Lance Taylor <iant@google.com>
11941 * reloc.cc (relocate_sections): Skip empty relocation sections.
11943 2009-06-23 Ian Lance Taylor <iant@google.com>
11946 * layout.cc (Layout::create_note): Use choose_output_section
11947 rather than make_output_section.
11949 2009-06-23 Ian Lance Taylor <iant@google.com>
11952 * options.cc (General_options::parse_V): Set printed_version_.
11953 (General_options::General_options): Initialize printed_version_.
11954 * options.h (class General_options): Add printed_version_ field.
11955 * gold.cc (queue_initial_tasks): If there are no input files,
11956 don't give a fatal error if we printed the version information.
11957 (queue_middle_tasks): If using -r with a shared object, give a
11958 fatal error rather than an ordinary error.
11960 2009-06-23 Ian Lance Taylor <iant@google.com>
11963 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
11964 (Layout::make_output_section): Set have_stabstr_section_ if we see
11965 a .stab*str section.
11966 (Layout::finalize): Call link_stabs_sections.
11967 (Layout::link_stabs_sections): New file.
11968 * layout.h (class Layout): Add have_stabstr_section_ field.
11969 Declare link_stabs_sections.
11971 2009-06-23 Doug Kwan <dougkwan@google.com>
11973 * Makefile.am (libgold_a_LIBADD): New.
11974 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
11975 * Makefile.in: Regenerate.
11976 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
11977 * configure: Regenerate.
11978 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
11979 * fileread.cc: Include sys/state.h
11980 * gold.h: Declare memmem and strndup if found missing.
11981 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
11983 2009-06-23 Ian Lance Taylor <iant@google.com>
11985 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
11986 * configure: Rebuild.
11988 2009-06-23 Ian Lance Taylor <iant@google.com>
11991 * object.cc (Object::section_contents): Don't try to get a view if
11992 the section has length zero.
11993 (Object::handle_gnu_warning_section): If the section is empty, use
11994 the name of the section as the warning.
11996 2009-06-23 Ian Lance Taylor <iant@google.com>
11999 * stringpool.h (class Stringpool_template): Add optimize_ field.
12000 (Stringpool_template::set_optimize): New function.
12001 * stringpool.cc (Stringpool_template::Stringpool_template):
12002 Initialize optimize_ field.
12003 (Stringpool_template::set_string_offsets): Test local optimize
12004 fild rather than parameter.
12005 * layout.cc (Layout::Layout): Call set_optimize on the section
12008 2009-06-22 Ian Lance Taylor <iant@google.com>
12011 * yyscript.y: Parse TARGET.
12012 * script.cc (script_set_target): New function.
12013 * script-c.h (script_set_target): Declare.
12014 * options.cc (General_options::string_to_object_format): Rename
12015 from string_to_object_format in anonymous namespace. Change
12017 * options.h (class General_options): Declare
12018 string_to_object_format.
12020 2009-06-22 Ian Lance Taylor <iant@google.com>
12022 * script-sections.cc (Script_sections::create_segments): Don't put
12023 program headers in a PT_LOAD segment if -n or -N.
12025 2009-06-22 Ian Lance Taylor <iant@google.com>
12028 * options.h (class General_options): Add -z lazy and -z now. Sort
12029 -z options into alphabetical order.
12030 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12032 2009-06-21 Ian Lance Taylor <iant@google.com>
12034 * layout.cc (Layout::make_output_section): Call
12035 Target::new_output_section.
12036 (Layout::attach_allocated_section_to_segment): Put large section
12037 sections in a separate load segment with the large segment flag
12039 (Layout::segment_precedes): Sort large data segments after other
12041 (align_file_offset): New static function.
12042 (Layout::set_segment_offsets): Use align_file_offset.
12043 * output.h (class Output_section): Add is_small_section_ and
12044 is_large_section_ fields.
12045 (Output_section::is_small_section): New function.
12046 (Output_section::set_is_small_section): New function.
12047 (Output_section::is_large_section): New function.
12048 (Output_section::set_is_large_section): New function.
12049 (Output_section::is_large_data_section): New function.
12050 (class Output_segment): Add is_large_data_segment_ field.
12051 (Output_segment::is_large_data_segment): New function.
12052 (Output_segment::set_is_large_data_segment): New function.
12053 * output.cc (Output_section::Output_section): Initialize new
12055 (Output_segment::Output_segment): Likewise.
12056 (Output_segment::add_output_section): Add assertion that large
12057 data sections always go in large data segments. Force small data
12058 sections to the end of the list of data sections. Force small BSS
12059 sections to the start of the list of BSS sections. For large BSS
12060 sections to the end of the list of BSS sections.
12061 * symtab.h (class Symbol): Declare is_common_shndx.
12062 (Symbol::is_defined): Check Symbol::is_common_shndx.
12063 (Symbol::is_common): Likewise.
12064 (class Symbol_table): Define enum Commons_section_type. Update
12065 declarations. Add small_commons_ and large_commons_ fields.
12066 * symtab.cc (Symbol::is_common_shndx): New function.
12067 (Symbol_table::Symbol_table): Initialize new fields.
12068 (Symbol_table::add_from_object): Put small and large common
12069 symbols in the right list.
12070 (Symbol_table::sized_finalized_symbol): Check
12071 Symbol::is_common_shndx.
12072 (Symbol_table::sized_write_globals): Likewise.
12073 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12074 common symbol lists. Don't call do_allocate_commons_list if the
12076 (Symbol_table::do_allocate_commons_list): Remove is_tls
12077 parameter. Add comons_section_type parameter. Change all
12078 callers. Handle small and large common symbols.
12079 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12080 Symbol::is_common_shndx.
12081 * resolve.cc (symbol_to_bits): Likewise.
12082 * target.h (Target::small_common_shndx): New function.
12083 (Target::small_common_section_flags): New function.
12084 (Target::large_common_shndx): New function.
12085 (Target::large_common_section_flags): New function.
12086 (Target::new_output_section): New function.
12087 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12088 small_common_section_flags, and large_common_section_flags
12090 (Target::do_new_output_section): New virtual function.
12091 * arm.cc (Target_arm::arm_info): Initialize new fields.
12092 * i386.cc (Target_i386::i386_info): Likewise.
12093 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12095 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12096 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12097 (Target_x86_64::do_new_output_section): New function.
12098 * configure.ac: Define conditional MCMODEL_MEDIUM.
12099 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12100 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12101 (large_LDFLAGS): Define.
12102 * testsuite/large.c: New file.
12103 * testsuite/testfile.cc (Target_test::test_target_info):
12104 Initialize new fields.
12105 * configure, testsuite/Makefile.in: Rebuild.
12107 2009-06-05 Doug Kwan <dougkwan@google.com>
12109 * Makefile.am (CCFILES): Add target.cc.
12110 * Makefile.in: Regenerate.
12111 * i386.cc (class Target_i386): Define new virtual method to
12112 override do_is_local_label_name in parent.
12113 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12114 local symbols if --discard-locals or -X is given.
12115 * options.h (class General_options): Declare new options
12116 '--discard-locals' and '-X' for discarding locals.
12117 * target.h (class Target): Define new methods is_local_label_name.
12118 Declare new virtual method do_is_local_label_name.
12119 * target.cc: New file.
12120 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12121 (check_SCRIPTS): Add discard_locals_test.sh.
12122 (check_DATA): Add discard_local_tests.syms.
12123 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12124 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12125 * testsuite/Makefile.in: Regenerate.
12126 * testsuite/discard_locals_test.c: New file.
12127 * testsuite/discard_locals_test.sh: Same.
12129 2009-06-05 Doug Kwan <dougkwan@google.com>
12131 * object.cc (Sized_relobj::Sized_relobj): Initialize
12132 discarded_eh_frame_shndx_ to -1U.
12133 (Sized_relobj::do_layout): Record index of a discard .eh_frame
12135 (Sized_relobj::do_count_local_symbols): Skip local symbols in
12136 a discarded .eh_frame section.
12137 (Sized_relobj::do_finalize_local_symbols): Ditto.
12138 * object.h (class Sized_relobj): Declare new member
12139 discarded_eh_frame_shndx_.
12140 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
12141 (local_labels_test.o, local_labels_test): New rules.
12142 * testsuite/Makefile.in: Regenerate.
12144 2009-06-04 Doug Kwan <dougkwan@google.com>
12146 * layout.cc (Layout::section_name_mapping): Add mapping for
12147 special ARM sections.
12149 2009-06-03 Doug Kwan <dougkwan@google.com>
12151 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12152 (utils::has_overflow): Same.
12154 2009-06-03 Ian Lance Taylor <iant@google.com>
12156 * layout.cc (Layout::section_name_mapping): New array, replacing
12157 Layout::linkonce_mapping.
12158 (Layout::section_name_mapping_count): New variable, replacing
12159 Layout::linkonce_mapping_count.
12160 (Layout::linkonce_output_name): Remove.
12161 (Layout::output_section_name): Rewrite.
12162 * layout.h (class Layout): Rename Linkonce_mapping to
12163 Section_name_mapping, linkonce_mapping to section_name_mapping,
12164 linkonce_mapping_count to section_name_mapping_count. Don't
12165 declare linkonce_output_name.
12167 2009-06-03 Doug Kwan <dougkwan@google.com>
12169 * gold/arm.cc (namespace utils): New.
12170 (Target_arm::reloc_is_non_pic): Define new method.
12171 (class Arm_relocate_functions): New.
12172 (Target_arm::Relocate::relocate): Handle relocation types used by
12175 2009-06-03 Ian Lance Taylor <iant@google.com>
12177 * arm.cc (Target_arm::scan::global): Use || instead of |.
12179 2009-06-02 Doug Kwan <dougkwan@google.com>
12181 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
12182 issued_non_pic_error_.
12183 (class Target_arm::Scan): Declare new method check_non_pic.
12184 Define new method symbol_needs_plt_entry.
12185 Declare new data member issued_non_pic_error_.
12186 (class Target_arm::Relocate): Declare new method
12187 should_apply_static_reloc.
12188 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
12189 (Target_arm::Scan::check_non_pic): Define new method.
12190 (Target_arm::Scan::local): Handle a small subset of reloc types used
12192 (Target_arm::Scan::local): Same.
12193 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
12195 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
12197 * incremental.cc (Incremental_inputs::report_command_line): Filter
12198 out --incremental-* options.
12200 2009-05-29 Doug Kwan <dougkwan@google.com>
12202 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
12204 (class Target_arm): Update comment.
12205 (Target_arm::Target_arm): Initialize new data members GOT_,
12206 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
12207 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
12208 and Target_arm::rel_dyn_section.
12209 Declare new_enum Target_arm::Got_type.
12210 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
12212 Update commments for member do_dynsym_value.
12213 (Target_arm::got_size, Target_arm::plt_section,
12214 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
12215 new methods inside class defintion.
12216 (Target_arm::got_section): Define new method.
12217 (Target_arm::rel_dyn_section): Same.
12218 (Output_data_plt_arm): New template class.
12219 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
12220 (Output_data_plt_arm:do_adjust_output_section): Define new method.
12221 (Output_data_plt_arm::add_entry): Same.
12222 (Output_data_plt_arm::first_plt_entry): Define new
12223 static data member for PLT instruction template.
12224 (Output_data_plt_arm::plt_entry): Same.
12225 (Output_data_plt_arm::do_write): Define new method.
12226 (Target_arm::make_plt_entry): Same.
12227 (Target_arm::do_finalize_sections): Same.
12228 (Target_arm::do_dynsym_value): Same.
12230 2009-05-28 Doug Kwan <dougkwan@google.com>
12232 * Makefile.am (TARGETSOURCES): Add arm.cc.
12233 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
12234 * Makefile.in: Regenerate.
12235 * arm.cc: New file.
12236 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
12238 2009-05-26 Doug Kwan <dougkwan@google.com>
12240 * options.cc (General_options::parse_exclude_libs). Fix a comment.
12241 (General_options::check_excluded_libs): Strip off directories in
12242 archive name before matching like GNU ld does.
12243 * testsuite/Makefile.am (MOSTLYCLEANFILES,
12244 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
12245 (exclude_libs_test_LDFLAGS): Add linker option
12246 -Wl,--exclude-libs,libexclude_libs_test_3
12247 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
12248 an explicit archive without using -l.
12249 (alt/libexclude_libs_test_3.a): New make rule.
12250 * testsuite/Makefile.in: Regenerate.
12251 * testsuite/exclude_libs_test.c : Declare lib3_default().
12253 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
12254 * exclude_libs_test_3.c: New file.
12256 2009-05-26 Nick Clifton <nickc@redhat.com>
12258 * po/id.po: New Indonesian translation.
12259 * po/gold.pot: Updated template file.
12261 2009-05-22 Sriraman Tallam <tmsriram@google.com>
12263 * testsuite/Makefile.am: Add -ffunction-sections to compile
12264 gc_comdat_test files. Add -Wl,--gc-sections to build
12266 * testsuite/Makefile.in: Regenerate.
12267 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
12269 2009-05-21 Sriraman Tallam <tmsriram@google.com>
12271 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
12272 kept comdat section was garbage collected.
12273 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
12274 * testsuite/Makefile.in: Regenerate.
12275 * testsuite/gc_comdat_test.sh: New file.
12276 * testsuite/gc_comdat_test_1.cc: New file.
12277 * testsuite/gc_comdat_test_2.cc: New file.
12279 2009-05-19 Doug Kwan <dougkwan@google.com>
12281 * archive.cc (Archive::Archive): Move constructor from archive.h
12282 to here. Initialize no_export_.
12283 (Archive::get_elf_object_for_member): Set no_export flag of object.
12284 * archive.h (Archive::Archive): Move constructor body to
12286 (Archive::no_export): New method.
12287 (Archive::no_export_): New field.
12288 * object.h (Object::Object): Initialize no_export_ to false.
12289 (Object::no_export, Object::set_no_export): New methods.
12290 (Object::no_export_): New field.
12291 * options.cc (General_options::parse_exclude_libs): New method.
12292 (General_options::check_excluded_libs) Same.
12293 * options.h (exclude_libs): New option.
12294 (General_options::check_excluded_libs): New method declaration.
12295 (General_options::excluded_libs_): New field.
12296 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
12297 default or protected visibility if an object has no-export flag set.
12298 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
12299 (check_SCRIPTS): Add exclude_libs_test.sh.
12300 (check_DATA): Add exclude_libs_test.syms.
12301 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
12302 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
12303 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
12304 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
12305 (exclude_libs_test.syms, libexclude_libs_test_1.a,
12306 libexclude_libs_test_2.a): New rules.
12307 * testsuite/Makefile.in: Regenerate.
12308 * testsuite/exclude_libs_test.c: New file.
12309 * testsuite/exclude_libs_test.sh: Ditto.
12310 * testsuite/exclude_libs_test_1.c: Ditto.
12311 * testsuite/exclude_libs_test_2.c: Ditto.
12313 2009-05-15 Ian Lance Taylor <iant@google.com>
12315 * configure.ac: Check for declarations for cases where libiberty.h
12316 checks HAVE_DECL_xxx.
12317 * configure, config.in: Rebuild.
12319 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
12321 * gold.h (Incremental_argument_list): Remove (invalid) forward
12323 * incremental.cc (Incremental_inputs::report_achive): New method.
12324 (Incremental_inputs::report_object): New method.
12325 (Incremental_inputs::report_script): New method.
12326 (Incremental_inputs::finalize_inputs): New method.
12327 (Incremental_inputs::finalize): Call finalize_inputs().
12328 (Incremental_inputs::sized_create_incremental_inputs_section_data):
12329 Create inputs entries.
12330 * incremental.h (Incremental_input_type): New enum.
12331 (Incremental_inputs::Incremental_input): Initialize new fields.
12332 (Incremental_inputs::report_inputs): New method.
12333 (Incremental_inputs::report_achive): New method.
12334 (Incremental_inputs::report_object): New method.
12335 (Incremental_inputs::report_script): New method.
12336 (Incremental_inputs::finalize_inputs): New method.
12337 (Incremental_inputs::Input_info): New struct.
12338 (Incremental_inputs::Input_info_map): New typedef.
12339 (Incremental_inputs::lock_): New field.
12340 (Incremental_inputs::Inputs_): New field.
12341 (Incremental_inputs::Inputs_map): New field.
12342 * main.cc (main): Call Incremental_input::report_inputs.
12343 * options.h (Input_argument_list): Typedef moved from
12345 (Input_file_group::Files): Remove, use ::Input_argument_list.
12346 (Input_file_group::Input_argument_list): Remove, use
12347 ::Input_argument_list.
12348 * plugin.cc (Plugin_manager::add_input_file): Add error in
12350 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
12352 * script.cc (read_input_script): Call
12353 Incremental_input::report_script.
12354 * script.h (Script_info): New class.
12356 2009-04-27 Ian Lance Taylor <iant@google.com>
12358 * x86_64.cc (do_adjust_output_section): Set entsize to
12361 2009-04-23 Elliott Hughes <enh@google.com>
12363 * output.cc (Output_file::close): After short writes, continue
12364 writing from the correct offset in the buffer being written.
12366 2009-04-23 Chris Demetriou <cgd@google.com>
12368 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
12369 * configure: Regenerate.
12370 * config.in: Regenerate.
12371 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
12372 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
12374 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
12376 * incremental.cc (Incremental_inputs_header_data): Renamed from
12377 Incremental_input_header_data.
12378 (Incremental_inputs_header_data::data_size): New field.
12379 (Incremental_inputs_header_data::put_input_file_count): Renamed
12380 from input_file_count.
12381 (Incremental_inputs_header_data::put_command_line_offset): Renamed
12382 from command_line_offset.
12383 (Incremental_inputs_header_data::put_reserved): Renamed from
12385 (Incremental_inputs_entry_data): Renamed from
12386 Incremental_input_entry_data.
12387 (Incremental_inputs_entry_data::data_size): New field.
12388 (Incremental_inputs::report_command_line): New method.
12389 (Incremental_inputs::finalize): New method.
12390 (Incremental_inputs::create_incremental_inputs_data): New method.
12391 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
12392 * incremental.h: New file.
12393 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
12394 (Layout::finalize): Create incremental inputs section in
12395 incremental builds.
12396 (Layout::create_incremental_info_sections): New method.
12397 * layout.h (Layout::incremental_inputs): New method.
12398 (Layout::create_incremental_info_sections): New method.
12399 (Layout::incremental_inputs_): New field.
12400 * main.cc (main): Notify Incremental_input of the command line.
12402 2009-04-01 Ian Lance Taylor <iant@google.com>
12403 Mikolaj Zalewski <mikolajz@google.com>
12405 * gold.h (reserve_unordered_map): Define, three versions, one for
12406 each version of Unordered_map.
12407 * layout.cc (Layout::Layout): Remove options parameter. Add
12408 number_of_input_files parameter. Don't initialize options_.
12409 Initialize number_of_input_files_ and resized_signatures_. Move
12410 sections_are_attached_.
12411 (Layout::layout_group): Reserve space for group_signatures_.
12412 (Layout::find_or_add_kept_section): Change name parameter to be a
12413 reference. Resize signatures_ map when it gets large enough.
12414 (Layout::layout_eh_frame): Use parameters->options() instead of
12416 (Layout::make_output_section): Likewise.
12417 (Layout::attach_allocated_section_to_segment): Likewise.
12418 (Layout::finalize, Layout::create_executable_stack): Likewise.
12419 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
12420 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
12421 * layout.h (class Layout): Update declarations. Remove options_
12422 field. Add number_of_input_files_ and resized_signatures_
12423 fields. Move sections_are_attached_ field.
12424 * main.cc (main): Pass number of input files to Layout
12425 constructor. Don't pass options.
12427 2009-03-30 Ian Lance Taylor <iant@google.com>
12429 * ffsll.c (ffsll): Correct implementation.
12431 2009-03-27 Ian Lance Taylor <iant@google.com>
12433 * ffsll.c: New file.
12434 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
12435 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
12436 * ftruncate.c (ftruncate): Declare before definition.
12437 * mremap.c (mremap): Likewise.
12438 * pread.c (pread): Likewise.
12439 * configure, Makefile.in, config.in: Rebuild.
12441 * mremap.c: New file.
12442 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
12443 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
12444 (mremap): Declare if HAVE_MREMAP is not defined.
12445 * configure, Makefile.in, config.in: Rebuild.
12447 2009-03-27 Cary Coutant <ccoutant@google.com>
12449 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
12450 position independent.
12451 * sparc.cc (Target_sparc::check_non_pic): Likewise.
12452 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
12454 2009-03-24 Cary Coutant <ccoutant@google.com>
12456 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
12458 (needs_dynamic_reloc): Likewise.
12460 2009-03-24 Ian Lance Taylor <iant@google.com>
12462 * yyscript.y (file_cmd): Recognize EXTERN.
12463 (extern_name_list, extern_name_list_body): New nonterminals.
12464 * script.cc (script_add_extern): Define.
12465 * script-c.h (script_add_extern): Declare.
12467 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
12469 * object.cc (is_elf_object): Define.
12470 * object.h (is_elf_object): Declare.
12471 * archive.cc (Archive::get_elf_object_for_member): Call
12473 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
12475 2009-03-24 Elliott Hughes <enh@google.com>
12477 * output.cc (Output_file::map_anonymous): Define.
12478 (Output_file::map): Use map_anonymous. If the regular mmap fails,
12479 try an anonymous one. Report the size if the mmap fails.
12480 * output.h (class Output_file): Declare map_anonymous.
12482 2009-03-24 Ian Lance Taylor <iant@google.com>
12484 * target-select.cc (instantiate_target): Don't acquire the lock if
12485 the instantiated_target_ field has already been set.
12487 2009-03-23 Ian Lance Taylor <iant@google.com>
12489 * gold-threads.h (class Initialize_lock): Define.
12490 * gold-threads.cc (class Initialize_lock_once): Define.
12491 (initialize_lock_control): New static variable.
12492 (initialize_lock_pointer): New static variable.
12493 (initialize_lock_once): New static function.
12494 (Initialize_lock::Initialize_lock): Define.
12495 (Initialize_lock::initialize): Define.
12496 * target-select.h: Include "gold-threads.h".
12497 (class Target_selector): Add lock_ and initialize_lock_ fields.
12498 Don't define instantiate_target, just declare it.
12499 * target-select.cc (Target_selector::Target_selector): Initialize
12501 (Target_selector::instantiate_target): Define.
12502 * descriptors.h: Include "gold-threads.h".
12503 (class Descriptors): Add initialize_lock_ field.
12504 * descriptors.cc (Descriptors::Descriptors): Initialize new
12506 (Descriptors::open): Use initialize_lock_ field
12507 * errors.h (class Errors): Add initialize_lock_ field.
12508 * errors.cc (Errors::Errors): Initialize new field.
12509 (Errors::initialize_lock): Use initialize_lock_ field.
12510 * powerpc.cc (class Target_selector_powerpc): Remove
12511 instantiated_target_ field. In do_recognize call
12512 instantiate_target rather than do_instantiate_target. In
12513 do_instantiate_target just allocate a new target.
12514 * sparc.cc (class Target_selector_sparc): Likewise.
12516 * freebsd.h: New file.
12517 * i386.cc: Include "freebsd.h".
12518 (Target_i386): Derive from Target_freebsd rather than
12520 (Target_selector_i386): Derive from Target_selector_freebsd rather
12521 than Target_selector.
12522 * x86_64.cc: Include "freebsd.h".
12523 (Target_x86_64): Derive from Target_freebsd rather than
12525 (Target_selector_x86_64): Derive from Target_selector_freebsd
12526 rather than Target_selector.
12527 * target.h (class Target): Add adjust_elf_header and
12528 do_adjust_elf_header.
12529 * output.cc (Output_file_header:: do_sized_write): Call target
12530 adjust_elf_header routine.
12531 * configure.tgt: Set targ_osabi.
12532 * configure.ac: Define GOLD_DEFAULT_OSABI.
12533 * parameters.cc (Parameters::default_target): Pass
12534 GOLD_DEFAULT_OSABI to select_target.
12535 * target-select.h (class Target_selector): Make instantiate_target
12536 protected rather than private.
12537 * Makefile.am (HFILES): Add freebsd.h.
12538 * configure, Makefile.in, config.in: Rebuild.
12540 * merge.cc (do_add_input_section): Correct pend value. Change
12541 message about last entry not being null terminated from error to
12544 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
12546 * incremental.cc: New file.
12547 * Makefile.am (CCFILES): Add incremental.cc.
12548 * Makefile.in: Rebuild.
12550 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
12552 * layout.cc (Layout::output_section_name): Preserve names
12553 of '.note.' sections.
12555 2009-03-19 Ian Lance Taylor <iant@google.com>
12557 * descriptors.cc (Descriptors::open): Check that the options are
12558 valid before using them.
12560 2009-03-18 Ian Lance Taylor <iant@google.com>
12562 * script-sections.h: Include <list>.
12563 (class Script_sections): Change Sections_elements from std::vector
12564 to std::list. Typedef public Elements_iterator. Add
12565 orphan_section_placement_, data_segment_align_start_, and
12566 saw_data_segment_align_ fields. Remove data_segment_align_index_
12568 * script-sections.cc (class Orphan_section_placement): New class.
12569 (class Sections_element): Add virtual functions is_relro and
12570 orphan_section_init. Remove virtual function place_orphan_here.
12571 (class Output_section_definition): Add is_relro and
12572 orphan_section_init. Remove place_orphan_here.
12573 (class Orphan_output_section): Likewise.
12574 (Script_sections::Script_sections): Update for field changes.
12575 (Script_sections::data_segment_align): Set saw_data_segment_align_
12576 and data_segment_align_start_, not data_segment_align_index.
12577 (Script_sections::data_segment_relro_end): Check
12578 saw_data_segment_align_. Use data_segment_align_start_ rather
12579 than data_segment_align_index_.
12580 (Script_sections::place_orphan): Rewrite to use
12581 Orphan_section_placement.
12583 2009-03-17 Ian Lance Taylor <iant@google.com>
12585 * archive.cc (Archive::add_symbols): Check for a version attached
12586 to the symbol name in the archive map.
12587 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
12588 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
12589 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
12590 (ver_test_11.a): New target.
12591 * testsuite/Makefile.in: Rebuild.
12593 * configure.ac: Check for chsize and posix_fallocate. Replace
12595 * ftruncate.c: New file, from gnulib.
12596 * output.cc (posix_fallocate): Define dummy version if not
12597 HAVE_POSIX_FALLOCATE.
12598 (Output_file::map): Call posix_fallocate rather than lseek and
12600 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
12601 * configure, Makefile.in, config.in: Rebuild.
12603 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
12605 * layout.h (Layout::create_note): Add section_name parameter.
12606 * layout.cc (Layout::create_note): Likewise.
12607 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
12609 2009-03-17 Ian Lance Taylor <iant@google.com>
12611 * descriptors.cc: Include "options.h".
12612 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
12613 (Descriptors::open): Always use O_CLOEXEC when opening a new
12614 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
12615 then set FD_CLOEXEC.
12617 * sparc.cc (class Target_sparc): Add has_got_section.
12618 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
12619 make sure we have a GOT section.
12621 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
12622 (Target_sparc::Scan::local): Likewise.
12623 (Target_sparc::Scan::global): Likewise.
12624 (Target_sparc::Relocate::relocate): Likewise.
12625 (Target_sparc::Relocate::relocate_tls): Likewise.
12627 * symtab.cc (Symbol_table::define_default_version): New function,
12628 broken out of add_from_object.
12629 (Symbol_table::add_from_object): Call define_default_version.
12630 (Symbol_table::define_special_symbol): Add resolve_oldsym
12631 parameter. Change all callers. If the version for a symbol comes
12632 from a version script, resolve it with the symbol with the same
12633 name with no version. Also add the symbol without a version if
12635 (do_define_in_output_data): If resolving with oldsym, don't delete
12637 (do_define_in_output_segment): Likewise.
12638 (do_define_as_constant): Likewise.
12639 * symtab.h (class Symbol_table): Update declarations.
12641 2009-03-13 Ian Lance Taylor <iant@google.com>
12643 * readsyms.cc (Read_symbols::incompatible_warning): New function.
12644 (Read_symbols::requeue): New function.
12645 (Read_symbols::do_read_symbols): If make_elf_object fails because
12646 the target type is not configured, and the file was searched for,
12647 issue a warning and retry with the next directory.
12648 (Add_symbols::run): If the file has an incompatible format, and
12649 it was searched for, requeue the Read_symbols task. On error,
12650 release the object.
12651 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
12652 dirindex parameter to constructor. Change all callers. Declare
12653 incompatible_warning and requeue.
12654 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
12655 input_argument_ and input_group_ fields. Add them to
12656 constructor. Change all callers.
12657 (class Read_script): Add dirindex_ field. Add it to constructor.
12658 Change all callers.
12659 * archive.cc (Archive::setup): Remove input_objects parameter.
12660 Change all callers.
12661 (Archive::get_file_and_offset): Likewise.
12662 (Archive::read_all_symbols): Likewise.
12663 (Archive::read_symbols): Likewise.
12664 (Archive::get_elf_object_for_member): Remove input_objects
12665 parameter. Add punconfigured parameter. Change all callers.
12666 (Archive::add_symbols): Change return type to bool. Check return
12667 value of include_member.
12668 (Archive::include_all_members): Likewise.
12669 (Archive::include_member): Change return type to bool. Return
12670 false if first included object has incompatible target. Set
12671 included_member_ field.
12672 (Add_archive_symbols::run): If add_symbols returns false, requeue
12674 * archive.h (class Archive): Add included_member_ field.
12675 Initialize it in constructor. Add input_file and searched_for
12676 methods. Update declarations.
12677 (class Add_archive_symbols): Add dirpath_, dirindex_, and
12678 input_argument_ fields. Add them to constructor. Change all
12680 * script.cc: Include "target-select.h".
12681 (class Parser_closure): Add skip_on_incompatible_target_ and
12682 found_incompatible_target_ fields. Add
12683 skip_on_incompatible_target parameter to constructor. Change all
12684 callers. Add methods skip_on_incompatible_target,
12685 clear_skip_on_incompatible_target, found_incompatible_target, and
12686 set_found_incompatible_target.
12687 (read_input_script): Add dirindex parameter. Change all callers.
12688 If parser finds an incompatible target, requeue Read_symbols
12690 (script_set_symbol): Clear skip_on_incompatible_target in
12692 (script_add_assertion, script_parse_option): Likewise.
12693 (script_start_sections, script_add_phdr): Likewise.
12694 (script_check_output_format): New function.
12695 * script.h (read_input_script): Update declaration.
12696 * script-c.h (script_check_output_format): Declare.
12697 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
12698 (ignore_cmd): Remove OUTPUT_FORMAT.
12699 * fileread.cc (Input_file::Input_file): Add explicit this.
12700 (Input_file::will_search_for): New function.
12701 (Input_file::open): Add pindex parameter. Change all callers.
12702 * fileread.h (class Input_file): Add input_file_argument method.
12703 Declare will_search_for. Update declarations.
12704 * object.cc (make_elf_object): Add punconfigured parameter.
12705 Change all callers.
12706 * object.h (class Object): Make input_file public. Add
12707 searched_for method.
12708 (make_elf_object): Update declaration.
12709 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
12711 * dirsearch.h (class Dirsearch): Update declaration.
12712 * options.h (class General_options): Add --warn-search-mismatch.
12713 * parameters.cc (Parameters::is_compatible_target): New function.
12714 * parameters.h (class Parameters): Declare is_compatible_target.
12715 * workqueue.cc (Workqueue::add_blocker): New function.
12716 * workqueue.h (class Workqueue): Declare add_blocker.
12718 * fileread.cc (Input_file::open): Remove options parameter.
12719 Change all callers.
12720 (Input_file::open_binary): Likewise.
12721 * script.cc (read_input_script): Likewise.
12722 * readsyms.h (class Read_symbols): Remove options_ field. Remove
12723 options parameter from constructor. Change all callers.
12724 (class Read_script): Likewise.
12725 * fileread.h (class Input_file): Update declarations.
12726 * script.h (read_input_script): Update declaration.
12728 2009-03-10 Nick Clifton <nickc@redhat.com>
12730 * po/es.po: New Spanish translation.
12732 2009-03-06 Cary Coutant <ccoutant@google.com>
12734 * options.cc (parse_short_option): Keep dash_z from registering itself.
12736 2009-03-03 Ian Lance Taylor <iant@google.com>
12739 * target-reloc.h (relocate_section): Pass output_section to
12741 * i386.cc (Target_i386::should_apply_static_reloc): Add
12742 output_section parameter. Change all callers.
12743 (Target_i386::Relocate::relocate): Add output_section parameter.
12744 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12745 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
12746 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
12747 * testsuite/two_file_shared.sh: New script.
12748 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
12749 (check_DATA): Add two_file_shared.dbg.
12750 (two_file_shared.dbg): New target.
12751 * testsuite/Makefile.in: Rebuild.
12753 2009-03-01 Ian Lance Taylor <iant@google.com>
12755 * configure.ac: Check for byteswap.h.
12756 * configure: Rebuild.
12757 * config.in: Rebuild.
12759 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
12761 * layout.cc (Layout::find_or_add_kept_section): New function.
12762 (Layout::add_comdat): Removed.
12763 * layout.h (struct Kept_section): Move out of class Layout.
12764 Remove trailing underscores from field names. Add group_sections
12765 field. Rename group_ field to is_group. Change all uses.
12766 (class Layout): Declare find_or_add_kept_section, not add_comdat.
12767 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
12768 comdat_groups_ field.
12769 (Sized_relobj::include_section_group): Use
12770 find_or_add_kept_section and Kept_section::group_sections.
12771 (Sized_relobj::include_linkonce_section): Likewise.
12772 * object.cc (class Sized_relobj): Don't define Comdat_group or
12773 Comdat_group_table. Remove find_comdat_group and
12774 add_comdat_group. Remove comdat_groups_ field.
12775 * plugin.cc (include_comdat_group): Use
12776 Layout::find_or_add_kept_section.
12778 2009-02-28 Ian Lance Taylor <iant@google.com>
12780 * README: --gc-sections and map files are now supported. Document
12781 some build requirements.
12784 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
12785 relocatable link set the value of the section symbol to zero.
12786 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
12787 relocatable link don't include the section address in the local
12790 2009-02-27 Ian Lance Taylor <iant@google.com>
12793 * options.h (class Search_directory): Add is_system_directory.
12794 (class General_options): Declare is_in_system_directory.
12795 * options.cc (get_relative_sysroot): Make static.
12796 (get_default_sysroot): Make static.
12797 (General_optoins::is_in_system_directory): New function.
12798 * fileread.cc (Input_file::is_in_system_directory): New function.
12799 * fileread.h (class Input_file): Declare is_in_system_directory.
12800 * object.h (class Object): Add is_in_system_directory.
12801 (class Input_objects): Remove system_library_directory_ field.
12802 * object.cc (Input_objects::add_object): Don't set
12803 system_library_directory_.
12804 (input_objects::found_in_system_library_directory): Remove.
12805 * symtab.cc (Symbol_table::write_globals): Remove input_objects
12806 parameter. Change all callers.
12807 (Symbol_table::sized_write_globals): Likewise.
12808 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
12809 Call Object::is_in_system_directory.
12810 * symtab.h (class Symbol_table): Update declarations.
12813 * descriptors.h (Open_descriptor): Add is_on_stack field.
12814 * descriptors.cc (Descriptors::open): If the descriptor is on the
12815 top of the stack, remove it. Initialize is_on_stack field.
12816 (Descriptors::release): Only add pod to stack if it is not on the
12818 (Descriptors::close_some_descriptor): Clear stack_next and
12819 is_on_stack fields.
12822 * output.cc (Output_section::find_starting_output_address): Rename
12823 from starting_output_address; add PADDR parameter; change return
12825 * output.h (class Output_section): Declare
12826 find_starting_output_address instead of starting_output_address.
12827 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
12828 section symbol for which we can't find a merge section.
12831 * symtab.cc (Symbol_table::add_from_object): If the visibility is
12832 hidden or internal, force the symbol to be local.
12833 * resolve.cc (Symbol::override_visibility): Define.
12834 (Symbol::override_base): Use override_visibility.
12835 (Symbol_table::resolve): Likewise.
12836 (Symbol::override_base_with_special): Likewise.
12837 (Symbol_table::override_with_special): If the visibility is hidden
12838 or internal, force the symbol to be local.
12839 * symtab.h (class Symbol): Add set_visibility and
12840 override_visibility.
12841 * testsuite/ver_test_1.sh: New file.
12842 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
12843 (check_DATA): Add ver_test_1.syms.
12844 (ver_test_1.syms): New target.
12845 * testsuite/Makefile.in: Rebuild.
12847 2009-02-25 Cary Coutant <ccoutant@google.com>
12849 * layout.cc (Layout::choose_output_section): Don't rename sections
12850 when using a linker script that has a SECTIONS clause.
12851 * Makefile.in: Regenerate.
12853 * testsuite/Makefile.am (script_test_5.sh): New test case.
12854 * testsuite/Makefile.in: Regenerate.
12855 * testsuite/script_test_5.cc: New file.
12856 * testsuite/script_test_5.sh: New file.
12857 * testsuite/script_test_5.t: New file.
12859 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
12861 * archive.cc (Archive::include_member): Update calls to add_symbols.
12862 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
12863 the Layout argument.
12864 * dynobj.h (do_add_symbols): Add the Layout argument.
12865 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
12867 * object.h (Object::add_symbols): Add the Layout argument.
12868 (Object::do_add_symbols): Add the Layout argument.
12869 (Sized_relobj::do_add_symbols): Add the Layout argument.
12870 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
12871 Unify the two versions.
12872 (Add_plugin_symbols): Remove.
12873 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
12874 (Sized_pluginobj::do_add_symbols): Unify the two versions.
12875 (Add_plugin_symbols): Remove.
12876 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
12877 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
12878 (Add_symbols::run): Make it work with Pulginobj.
12880 2009-02-06 Ian Lance Taylor <iant@google.com>
12882 * object.cc (Sized_relobj::do_layout): Make info message start
12883 with lower case letter.
12885 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
12887 * binary.cc: Fix file comment.
12889 * options.h (enum Incremental_disposition): Define.
12890 (class General_options): Add new options: --incremental,
12891 --incremental_changed, --incremental_unchanged,
12892 --incremental_unknown. Add incremental_disposition_ and
12893 implicit_incremental_ fields.
12894 (General_options::incremental_disposition): New function.
12895 (class Position_dependent_options): Add incremental_disposition
12897 (Position_dependent_options::copy_from_options): Set incremental
12899 * options.cc (General_options::parse_incremental_changed): New
12901 (General_options::parse_incremental_unchanged): New function.
12902 (General_options::parse_incremental_unknown): New function.
12903 (General_options::General_options): Initialize new fields
12904 incremental_disposition_ and implicit_incremental_.
12905 (General_options::finalize): Check for uasge of --incremental-*
12906 without --incremental.
12908 2009-02-06 Chris Demetriou <cgd@google.com>
12910 * gold.h (gold_undefined_symbol): Change to take only a Symbol
12911 pointer and to report location as the file name associated with
12913 (gold_undefined_symbol_at_location): New function to replace the
12914 old gold_undefined_symbol functionality.
12915 * target-reloc.h (relocate_section): Update to use
12916 gold_undefined_symbol_at_location.
12917 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12918 Call gold_undefined_symbol function rather than gold_error.
12919 * errors.h (Errors::undefined_symbol): Take location as a
12920 string, rather than calculating it from a relocation.
12921 * errors.cc (Errors::fatal): Print "fatal error:" before the
12923 (Errors::error, Errors::error_at_location): Print "error: "
12924 before the formatted message.
12925 (Errors::undefined_symbol): Take location as a string, rather
12926 than calculating it from a relocation.
12927 (gold_undefined_symbol_at_location): New function akin to
12928 old gold_undefined_symbol, calculates location from relocation.
12929 (gold_undefined_symbol): Change to take only a Symbol pointer
12930 and to report location as the file name associated with the symbol.
12931 * testsuite/debug_msg.sh: Update for changed error messages.
12932 * testsuite/undef_symbol.sh: Likewise.
12934 2009-02-04 Duncan Sands <baldrick@free.fr>
12937 * reduced_debug_output.h
12938 (Output_reduced_debug_abbrev_section::failed): Use format for
12940 (Output_reduced_debug_info_section::faild): Likewise.
12942 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
12944 * script.cc (Lazy_demangler): New class.
12945 (Version_script_info::get_symbol_version_helper): Demangle a
12948 2009-01-29 Cary Coutant <ccoutant@google.com>
12950 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
12952 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12954 2009-01-28 Ian Lance Taylor <iant@google.com>
12956 * version.cc (version_string): Bump to 1.9.
12958 * gold.h: Include <cstring> and <stdint.h>.
12959 * version.cc: Include <cstdio>.
12960 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
12962 * reduced_debug_output.cc (insert_into_vector): Rename from
12963 Insert_into_vector; change all callers. Use Swap_unaligned to
12964 avoid aliasing issue; remove union since it is unnecessary.
12966 2009-01-27 Sriraman Tallam <tmsriram@google.com>
12968 * Makefile.am (CCFILES): Add gc.cc.
12969 (HFILES): Add gc.h.
12970 * Makefile.in: Regenerate.
12971 * gold.cc (Gc_runner): New class.
12972 (queue_initial_tasks): Call garbage collection related tasks
12973 when corresponding options are invoked.
12974 (queue_middle_gc_tasks): New function.
12975 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
12976 processed early before laying out sections during garbage collection.
12977 * gold.h (queue_middle_gc_tasks): New function.
12978 (is_prefix_of): Move from "layout.cc".
12979 * i386.cc (Target_i386::gc_process_relocs): New function.
12980 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
12981 * main.cc (main): Create object of class "Garbage_collection".
12982 * object.cc (Relobj::copy_symbols_data): New function.
12983 (Relobj::is_section_name_included): New function.
12984 (Sized_relobj::do_layout): Allow this function to be called twice
12985 during garbage collection and defer layout of section during the
12987 * object.h (Relobj::get_symbols_data): New function.
12988 (Relobj::is_section_name_included): New function.
12989 (Relobj::copy_symbols_data): New function.
12990 (Relobj::set_symbols_data): New function.
12991 (Relobj::get_relocs_data): New function.
12992 (Relobj::set_relocs_data): New function.
12993 (Relobj::is_output_section_offset_invalid): New pure virtual function.
12994 (Relobj::gc_process_relocs): New function.
12995 (Relobj::do_gc_process_relocs): New pure virtual function.
12996 (Relobj::sd_): New data member.
12997 (Sized_relobj::is_output_section_offset_invalid): New function.
12998 (Sized_relobj::do_gc_process_relocs): New function.
12999 * options.h (General_options::gc_sections): Modify to not be a no-op.
13000 (General_options::print_gc_sections): New option.
13001 * plugin.cc (Plugin_finish::run): Remove function call to
13002 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13003 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13004 * reloc.cc (Read_relocs::run): Add task to process relocs and
13005 determine unreferenced sections when doing garbage collection.
13006 (Gc_process_relocs): New class.
13007 (Sized_relobj::do_gc_process_relocs): New function.
13008 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13009 sections that are garbage collected.
13010 * reloc.h (Gc_process_relocs): New class.
13011 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13012 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13013 symbols whose corresponding sections are garbage collected.
13014 (Symbol_table::Symbol_table): Add new parameter for the garbage
13016 (Symbol_table::gc_mark_undef_symbols): New function.
13017 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13018 (Symbol_table::gc_mark_dyn_syms): New function.
13019 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13021 (Symbol_table::add_from_object): Likewise.
13022 (Symbol_table::add_from_relobj): When building shared objects, do not
13023 treat externally visible symbols as garbage.
13024 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13025 table information for static and relocatable links.
13026 * symtab.h (Symbol_table::set_gc): New function.
13027 (Symbol_table::gc): New function.
13028 (Symbol_table::gc_mark_undef_symbols): New function.
13029 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13030 (Symbol_table::gc_mark_dyn_syms): New function.
13031 (Symbol_table::gc_): New data member.
13032 * target.h (Sized_target::gc_process_relocs): New pure virtual
13034 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13035 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13037 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13039 * options.h (General_options::gc_sections): Define as a no-op for now.
13040 (General_options::no_keep_memory): Ditto.
13041 (General_options::Bshareable): Define.
13042 * options.cc (General_options::finalize): Honor -Bshareable.
13044 2009-01-20 Andreas Schwab <schwab@suse.de>
13046 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13047 read the value in the contents, since we don't use it. Use the
13048 template endianness when writing.
13049 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13051 2009-01-19 Andreas Schwab <schwab@suse.de>
13053 * configure.tgt (powerpc64-*): Fix targ_obj.
13055 2009-01-15 Ian Lance Taylor <iant@google.com>
13057 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13058 local symbols when stripping all symbols.
13060 2009-01-14 Cary Coutant <ccoutant@google.com>
13062 * output.cc (Output_reloc): Add explicit instantiations.
13064 2009-01-14 Cary Coutant <ccoutant@google.com>
13066 * archive.cc (Archive::get_elf_object_for_member): Remove call
13067 to File_read::claim_for_plugin.
13068 * descriptors.cc (Descriptors::open): Remove reference to
13070 (Descriptors::claim_for_plugin): Remove.
13071 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13072 (Descriptors::is_claimed): Remove.
13073 (claim_descriptor_for_plugin): Remove.
13074 * fileread.cc (File_read::claim_for_plugin): Remove.
13075 * fileread.h (File_read::claim_for_plugin): Remove.
13076 (File_read::descriptor): Reopen descriptor if necessary.
13077 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13078 (Plugin_manager::all_symbols_read): Add task parameter. Change
13080 (Plugin_manager::get_input_file): New function.
13081 (Plugin_manager::release_input_file): New function.
13082 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13083 corresponding data member.
13084 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13085 and pass to base constructor. Change all callers.
13086 (get_input_file, release_input_file): New functions.
13087 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13088 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13089 (Plugin_manager::all_symbols_read): Add task parameter.
13090 (Plugin_manager::get_input_file): New function.
13091 (Plugin_manager::release_input_file): New function.
13092 (Plugin_manager::task_): New data member.
13093 (Pluginobj::Pluginobj): Add filesize parameter.
13094 (Pluginobj::filename): New function.
13095 (Pluginobj::descriptor): New function.
13096 (Pluginobj::filesize): New function.
13097 (Pluginobj::filesize_): New data member.
13098 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13099 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13100 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13102 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13103 with archive libraries.
13104 * testsuite/Makefile.in: Regenerate.
13105 * testsuite/plugin_test.c (struct sym_info): New type.
13106 (get_input_file, release_input_file): New static variables.
13107 (onload): Capture new transfer vector entries.
13108 (claim_file_hook): Stop reading at end of file according to filesize.
13109 Factor out parsing of readelf output into separate function.
13110 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13111 APIs and get the source file name from the symbol table. Convert
13112 source file name to corresponding object file name. Print info
13113 message when adding new input files.
13114 (parse_readelf_line): New function.
13115 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13116 * testsuite/plugin_test_2.sh: Likewise.
13117 * testsuite/plugin_test_3.sh: Likewise.
13118 * testsuite/plugin_test_4.sh: New test case.
13120 2009-01-07 Ian Lance Taylor <iant@google.com>
13122 * version.cc (version_string): Bump to 1.8.
13124 2008-12-23 Cary Coutant <ccoutant@google.com>
13126 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13127 * plugin.cc (Plugin_manager::finish): Rename as
13128 layout_deferred_objects. Move cleanup to separate function.
13129 (Plugin_manager::cleanup): New function.
13130 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13132 * plugin.h (Plugin_manager::finish): Rename as
13133 layout_deferred_objects.
13134 (Plugin_manager::cleanup): New function.
13135 (Plugin_manager::cleanup_done): New field.
13137 2008-12-23 Cary Coutant <ccoutant@google.com>
13139 * plugin.cc (is_visible_from_outside): New function.
13140 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
13141 so we don't return "IR only" status for exported symbols or -r links.
13143 * testsuite/Makefile.am (plugin_test_3): New test case.
13144 * testsuite/Makefile.in: Regenerate.
13145 * testsuite/plugin_test_3.sh: New file.
13147 2008-12-22 Cary Coutant <ccoutant@google.com>
13149 * object.cc (Sized_relobj::layout_section): New function.
13150 (Sized_relobj::do_layout): Defer layout of input sections until after
13151 plugin has provided replacement files.
13152 (Sized_relobj::do_layout_deferred_sections): New function.
13153 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13154 (Relobj::layout_deferred_sections): New function.
13155 (Relobj::do_layout_deferred_sections): New function.
13156 (Sized_relobj::do_layout_deferred_sections): New function.
13157 (Sized_relobj::layout_section): New function.
13158 (Sized_relobj::Deferred_layout): New structure.
13159 (Sized_relobj::deferred_layout_): New field.
13160 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13161 Change all callers. Layout deferred sections.
13162 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13164 (Plugin_hook::run): Move code from do_plugin_hook inline.
13165 (Plugin_hook::do_plugin_hook): Remove.
13166 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13167 (Plugin_manager::finish): Renamed, was cleanup.
13168 (Plugin_manager::should_defer_layout): New function.
13169 (Plugin_manager::add_deferred_layout_object): New function.
13170 (Plugin_manager::Deferred_layout_list): New type.
13171 (Plugin_manager::deferred_layout_objects_): New field.
13172 (Plugin_hook::do_plugin_hook): Remove.
13174 2008-12-17 Ian Lance Taylor <iant@google.com>
13176 * options.h (class General_options): Add --no case for
13179 2008-12-16 Cary Coutant <ccoutant@google.com>
13181 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
13183 (Plugin_manager::claim_file): Create plugin object even if
13184 plugin did not call the add_symbols callback.
13185 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
13186 asking for more symbols than were added.
13187 * testsuite/Makefile.am (plugin_test_1): Add test case with
13189 (empty.syms): New target.
13190 * testsuite/Makefile.in: Regenerate.
13191 * testsuite/plugin_test.c (claim_file_hook): Add new debug
13192 message. Don't call add_symbols if no globals.
13193 (all_symbols_read_hook): Don't provide replacement for empty
13196 2008-12-12 Ian Lance Taylor <iant@google.com>
13198 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
13199 r_type == 0 for a local symbol with r_sym == 0.
13200 (scan_relocatable_relocs): Pass r_sym to
13201 local_non_section_strategy.
13202 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
13205 * configure.ac: Update test for TLS descriptors: they are
13206 supported as of glibc 2.9.
13207 * configure: Rebuild.
13209 2008-12-11 Ian Lance Taylor <iant@google.com>
13212 * target-reloc.h (Default_scan_relocatable_relocs): For each
13213 function, map r_type == 0 to RELOC_DISCARD.
13215 2008-12-10 Cary Coutant <ccoutant@google.com>
13217 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
13218 object to override a kept COMDAT group from a plugin object.
13220 2008-12-09 Ian Lance Taylor <iant@google.com>
13223 * yyscript.y (file_cmd): Handle INPUT.
13225 * testsuite/initpri1.c: Change all declarations to be full
13226 prototypes by adding void, to avoid compiler warnings.
13228 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
13230 * options.cc (General_options::parse_plugin_opt): New.
13231 (General_options::add_plugin): The argument now is just the filename.
13232 (General_options::add_plugin_option): New.
13233 * options.h (plugin_opt): New.
13234 (add_plugin): Change argument name.
13235 (add_plugin_option): New.
13236 * plugin.cc (Plugin::load): Don't parse the plugin option.
13237 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
13238 (Plugin::add_option): New.
13239 (Plugin::args_): Change type.
13240 (Plugin::filename_): New.
13241 (Plugin_manager::add_plugin_option): New.
13242 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
13243 * testsuite/Makefile.in: Regenerate.
13245 2008-12-05 Cary Coutant <ccoutant@google.com>
13247 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
13248 Handle --strip-lto-sections option.
13249 * options.h (strip_lto_sections): New option.
13251 2008-12-01 Cary Coutant <ccoutant@google.com>
13253 * plugin.cc (ld_plugin_message): Change format parameter to const.
13254 Fix mismatch between new[] and delete.
13256 2008-11-14 Cary Coutant <ccoutant@google.com>
13258 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
13261 2008-11-05 Craig Silverstein <csilvers@google.com>
13263 * options.cc (General_options::parse_dynamic_list): New function.
13264 * options.h (General_options): New flags dynamic_list,
13265 dynamic_list_data, dynamic_list_cpp_new, and
13266 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
13267 (General_options::in_dynamic_list): New function.
13268 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
13269 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
13270 (Lex::can_continue_name): Likewise.
13272 (read_script_file): New parameter script_options.
13273 (read_dynamic_list): New function.
13274 (Script_options::define_dynamic_list): New function.
13275 (dynamic_list_keyword_parsecodes): New variable.
13276 (dynamic_list_keywords): New variable.
13277 * script.h (Script_options::define_dynamic_list): New function
13279 (read_dynamic_list): New function prototype.
13280 * symtab.cc (strprefix): New macro.
13281 (Symbol::should_add_dynsym_entry): Support dynamic_list,
13282 dynamic_list_data, dynamic_list_cpp_new, and
13283 dynamic_list_cpp_typeinfo.
13284 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
13285 (dynamic_list_expr): New rule.
13286 (dynamic_list_nodes): Likewise.
13287 (dynamic_list_node): Likewise.
13288 * testsuite/Makefile.am (dynamic_list): New test.
13289 * testsuite/Makefile.in: Regenerated.
13290 * testsuite/dynamic_list.t: New file.
13291 * testsuite/dynamic_list.sh: New file.
13293 2008-11-05 Craig Silverstein <csilvers@google.com>
13295 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
13296 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
13297 (t11_last): Likewise.
13298 * testsuite/ver_test_6.c (main): Likewise.
13300 2008-10-07 Cary Coutant <ccoutant@google.com>
13302 * options.c (General_options::finalize): Add check for -static and
13304 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
13307 2008-10-02 Cary Coutant <ccoutant@google.com>
13309 * plugin.cc (make_sized_plugin_object): Fix conditional
13310 compilation to work when not all targets are enabled.
13312 2008-09-29 Cary Coutant <ccoutant@google.com>
13314 * archive.cc (Archive::get_file_and_offset): Use filename instead
13315 of name to get library path.
13316 (Archive::include_member): Unlock external member of a thin archive.
13318 * testsuite/Makefile.am (TEST_AR): New variable.
13319 (thin_archive_test_1): New test.
13320 (thin_archive_test_2): New test.
13321 * testsuite/Makefile.in: Regenerate.
13322 * testsuite/thin_archive_main.cc: New file.
13323 * testsuite/thin_archive_test_1.cc: New file.
13324 * testsuite/thin_archive_test_2.cc: New file.
13325 * testsuite/thin_archive_test_3.cc: New file.
13326 * testsuite/thin_archive_test_4.cc: New file.
13328 2008-09-29 Cary Coutant <ccoutant@google.com>
13330 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
13331 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
13333 (Sized_relobj::do_finalize_local_symbols): Likewise.
13334 (Sized_relobj::map_to_kept_section): Likewise.
13335 * object.h (Sized_relobj::invalid_address): New constant.
13336 (Sized_relobj::do_output_section_offset): Check for invalid_address
13338 * output.cc (Output_reloc::local_section_offset): Use constant
13339 invalid_address instead of -1U.
13340 (Output_reloc::get_address): Likewise.
13341 (Output_section::output_address): Change -1U to -1ULL.
13342 * output.h (Output_reloc::invalid_address): New constant.
13343 * reloc.cc (Sized_relobj::write_sections): Use constant
13344 invalid_address instead of -1U.
13345 (Sized_relobj::relocate_sections): Likewise.
13346 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
13347 values for merge sections.
13348 * target-reloc.h (relocate_for_relocatable): Use constant
13349 invalid_address instead of -1U.
13351 2008-09-19 Cary Coutant <ccoutant@google.com>
13353 Add plugin functionality for link-time optimization (LTO).
13354 * configure.ac (plugins): Add --enable-plugins option.
13355 * configure: Regenerate.
13356 * config.in: Regenerate.
13357 * Makefile.am (LIBDL): New variable.
13358 (CCFILES): Add plugin.cc.
13359 (HFILES): Add plugin.h.
13360 (ldadd_var): Add LIBDL.
13361 * Makefile.in: Regenerate.
13363 * archive.cc: Include "plugin.h".
13364 (Archive::setup): Don't preread archive symbols when using a plugin.
13365 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
13366 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
13368 (Archive::include_member): Add symbols from plugin objects.
13369 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
13370 * descriptors.cc (Descriptors::open): Check for file descriptors
13371 abandoned by plugins.
13372 (Descriptors::claim_for_plugin): New function.
13373 * descriptors.h (Descriptors::claim_for_plugin): New function.
13374 (Open_descriptor::is_claimed): New field.
13375 (claim_descriptor_for_plugin): New function.
13376 * fileread.cc (File_read::claim_for_plugin): New function.
13377 * fileread.h (File_read::claim_for_plugin): New function.
13378 (File_read::descriptor): New function.
13379 * gold.cc: Include "plugin.h".
13380 (queue_initial_tasks): Add task to call plugin hooks for generating
13382 * main.cc: Include "plugin.h".
13383 (main): Load plugin libraries.
13384 * object.h (Pluginobj): Declare.
13385 (Object::pluginobj): New function.
13386 (Object::do_pluginobj): New function.
13387 (Object::set_target): New function.
13388 * options.cc: Include "plugin.h".
13389 (General_options::parse_plugin): New function.
13390 (General_options::General_options): Initialize plugins_ field.
13391 (General_options::add_plugin): New function.
13392 * options.h (Plugin_manager): Declare.
13393 (General_options): Add --plugin option.
13394 (General_options::has_plugins): New function.
13395 (General_options::plugins): New function.
13396 (General_options::add_plugin): New function.
13397 (General_options::plugins_): New field.
13398 * plugin.cc: New file.
13399 * plugin.h: New file.
13400 * readsyms.cc: Include "plugin.h".
13401 (Read_symbols::do_read_symbols): Check for archive before checking
13402 for ELF file. Call plugin hooks to claim files.
13403 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
13404 from a real object file; force override when processing replacement
13406 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
13407 (Symbol::init_base_object): Likewise.
13408 (Symbol::init_base_output_data): Likewise.
13409 (Symbol::init_base_output_segment): Likewise.
13410 (Symbol::init_base_constant): Likewise.
13411 (Symbol::init_base_undefined): Likewise.
13412 (Symbol::output_section): Assert that object is not a plugin.
13413 (Symbol_table::add_from_pluginobj): New function.
13414 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
13416 (Symbol_table::sized_write_globals): Likewise.
13417 (Symbol_table::add_from_pluginobj): Instantiate template.
13418 * symtab.h (Sized_pluginobj): Declare.
13419 (Symbol::in_real_elf): New function.
13420 (Symbol::set_in_real_elf): New function.
13421 (Symbol::in_real_elf_): New field.
13422 (Symbol_table::add_from_pluginobj): New function.
13424 * testsuite/Makefile.am (AM_CFLAGS): New variable.
13425 (LIBDL): New variable.
13426 (LDADD): Add LIBDL.
13427 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
13428 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
13429 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
13430 (MOSTLYCLEANFILES): Likewise.
13431 * testsuite/Makefile.in: Regenerate.
13432 * testsuite/plugin_test.c: New file.
13433 * testsuite/plugin_test_1.sh: New file.
13434 * testsuite/plugin_test_2.sh: New file.
13436 2008-09-16 Ian Lance Taylor <iant@google.com>
13438 * target-reloc.h (relocate_section): Check whether a symbol is
13439 defined by the ABI before reporting an undefined symbol error.
13440 * target.h (Target::is_defined_by_abi): Make parameter const.
13441 (Target::do_is_defined_by_abi): Likewise.
13442 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
13443 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
13444 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
13445 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
13446 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
13447 * testsuite/Makefile.in: Rebuild.
13449 * fileread.cc (make_view): Add casts to avoid warning.
13451 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
13453 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
13454 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13456 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
13458 * options.h (General_options::output_is_executable): New.
13459 (General_options::output_is_pie): New.
13460 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
13461 for shared libraries.
13462 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13464 2008-09-11 Chris Demetriou <cgd@google.com>
13466 * options.h (origin): New -z option.
13467 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
13468 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
13471 2008-09-05 Cary Coutant <ccoutant@google.com>
13473 * fileread.cc (File_read::make_view): Add check for attempt to map
13474 beyond end of file.
13476 2008-09-05 Cary Coutant <ccoutant@google.com>
13478 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
13479 explicit instantiations.
13481 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
13484 * options.cc (General_options::finalize): Allow undefined symbols
13485 in shlibs if linking -shared.
13488 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
13489 symbols as not needing a dynsym entry.
13491 2008-08-20 Craig Silverstein <csilvers@google.com>
13493 * fileread.cc (File_read::open): Do not lock the file unless it
13494 was successfully opened.
13496 2008-08-14 Cary Coutant <ccoutant@google.com>
13498 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
13499 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
13500 * testsuite/tls_test.cc (struct int128): 128-bit struct
13501 for testing TLS relocs with non-zero addend.
13502 (v12): New TLS variable.
13504 (t_last): Add check for v12.
13505 * testsuite/tls_test.h (t12): New function.
13506 * testsuite/tls_test_main.cc (thread_routine): Call new test.
13508 2008-08-13 Ian Lance Taylor <iant@google.com>
13510 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
13511 set tls_segment_ or relro_segment_.
13512 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
13514 * output.h (Output_section::clear_is_relro): New function.
13515 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
13516 sections specially even when output_data_ is empty.
13517 (Output_segment::maximum_alignment): When first section is relro,
13518 only force alignment for PT_LOAD segments.
13519 * script.cc (script_data_segment_align): New function.
13520 (script_data_segment_relro_end): New function.
13521 * script-c.h (script_data_segment_align): Declare.
13522 (script_data_segment_relro_end): Declare.
13523 * script-sections.h (class Script_sections): Declare
13524 data_segment_align and data_segment_relro_end. Add fields
13525 segment_align_index_ and saw_relro_end_.
13526 * script-sections.cc (class Sections_element): Add set_is_relro
13527 virtual function. Add new bool* parameter to place_orphan_here.
13528 Add get_output_section virtual function.
13529 (class Output_section_definition): Add set_is_relro. Add new
13530 bool* parameter to place_orphan_here. Add get_output_section.
13531 Add is_relro_ field.
13532 (Output_section_definition::Output_section_definition): Initialize
13533 evaluated_address_, evaluated_load_address, evaluated_addralign_,
13534 and is_relro_ fields.
13535 (Output_section_definition::place_orphan_here): Add is_relro
13537 (Output_section_definition::set_section_addresses): Set relro for
13539 (Output_section_definition::alternate_constraint): Likewise.
13540 (class Orphan_output_section): Add new bool* parameter to
13541 place_orphan_here. Add get_output_section.
13542 (Orphan_output_section::place_orphan_here): Add is_relro
13544 (Script_sections::Script_sections): Initialize
13545 data_segment_align_index_ and saw_relro_end_.
13546 (Script_sections::data_segment_align): New function.
13547 (Script_sections::data_segment_relro_end): New function.
13548 (Script_sections::place_orphan): Set or clear is_relro.
13549 (Script_sections::set_section_addresses): Force alignment of first
13551 * yyscript.y (exp): Call script_data_segment_align and
13552 script_data_segment_relro_end.
13553 * testsuite/relro_script_test.t: New file.
13554 * testsuite/relro_test.cc (using_script): Declare.
13555 (t1, t2): Test using_script.
13556 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
13557 (relro_script_test_SOURCES): Define.
13558 (relro_script_test_DEPENDENCIES): Define.
13559 (relro_script_test_LDFLAGS): Define.
13560 (relro_script_test_LDADD): Define.
13561 (relro_script_test.so): New target.
13562 * testsuite/Makefile.in: Rebuild.
13564 2008-08-06 Cary Coutant <ccoutant@google.com>
13566 * archive.cc (Archive::total_archives, Archive::total_members)
13567 (Archive::total_members_loaded): New variables.
13568 (Archive::setup): Add parameter. Add option to preread
13570 (Archive::read_armap): Add counter.
13571 (Archive::get_file_and_offset): New function.
13572 (Archive::get_elf_object_for_member): New function.
13573 (Archive::read_all_symbols): New function.
13574 (Archive::read_symbols): New function.
13575 (Archive::add_symbols): Add counters.
13576 (Archive::include_all_members): Use armap to find members if it's
13578 (Archive::include_member): Skip reading symbols if already read.
13579 Factored code into Archive::get_file_and_offset and
13580 Archive::get_elf_object_for_member. Changed call to
13581 Mapfile::report_include_archive_member.
13582 (Archive::print_stats): New function.
13583 * archive.h: Declare Object and Read_symbols_data classes.
13584 (Archive::Archive): Add initializers for new members.
13585 (Archive::setup): Add parameter.
13586 (Archive::print_stats): New function.
13587 (Archive::total_archives, Archive::total_members)
13588 (Archive::total_members_loaded): New variables.
13589 (Archive::get_file_and_offset): New function.
13590 (Archive::get_elf_object_for_member): New function.
13591 (Archive::read_all_symbols): New function.
13592 (Archive::read_symbols): New function.
13593 (Archive::Archive_member): New class.
13594 (Archive::members_): New member.
13595 (Archive::num_members_): New member.
13596 * main.cc: Include archive.h.
13597 (main): Call Archive::print_stats.
13598 * mapfile.cc (Mapfile::report_include_archive_member): Delete
13599 archive parameter; member_name is now the fully-decorated name.
13600 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
13601 * options.h: (General_options): Add --preread-archive-symbols option.
13602 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
13605 2008-08-04 Ian Lance Taylor <iant@google.com>
13607 * symtab.h (Symbol::use_plt_offset): New function.
13608 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
13609 * powerpc.cc (Relocate::relocate): Likewise.
13610 * sparc.cc (Relocate::relocate): Likewise.
13611 * x86_64.cc (Relocate::relocate): Likewise.
13612 * testsuite/weak_plt.sh: New test.
13613 * testsuite/weak_plt_main.cc: New test.
13614 * testsuite/weak_plt_shared.cc: New test.
13615 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
13616 (check_PROGRAMS): Add weak_plt.
13617 (check_DATA): Add weak_plt_shared.so.
13618 (weak_plt_main_pic.o, weak_plt): New targets.
13619 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
13620 * testsuite/Makefile.in: Rebuild.
13622 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
13624 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
13625 * testsuite/Makefile.in: Rebuild.
13627 2008-08-04 Alan Modra <amodra@bigpond.net.au>
13629 * Makefile.am (POTFILES.in): Set LC_ALL=C.
13630 * Makefile.in: Regenerate.
13631 * po/POTFILES.in: Regenerate.
13633 2008-07-29 Ian Lance Taylor <iant@google.com>
13635 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
13636 symbols before other symbols.
13637 * testsuite/script_test_2.cc (test_addr): Declare.
13638 (test_addr_alias): Declare.
13639 (main): Check that test_addr and test_addr_alias have the right
13641 * testsuite/script_test_2.t: Define test_addr_alias and
13644 2008-07-24 Ian Lance Taylor <iant@google.com>
13647 * descriptors.cc: New file.
13648 * descriptors.h: New file.
13649 * gold-threads.h (class Hold_optional_lock): New class.
13650 * fileread.cc: Include "descriptors.h".
13651 (File_read::~File_read): Release descriptor rather than closing
13653 (File_read::open) [file]: Call open_descriptor rather than open.
13654 Set is_descriptor_opened_.
13655 (File_read::open) [memory]: Assert that descriptor is not open.
13656 (File_read::reopen_descriptor): New function.
13657 (File_read::release): Release descriptor.
13658 (File_read::do_read): Make non-const. Reopen descriptor.
13659 (File_read::read): Make non-const.
13660 (File_read::make_view): Reopen descriptor.
13661 (File_read::do_readv): Likewise.
13662 * fileread.h (class File_read): Add is_descriptor_opened_ field.
13663 Update declarations.
13664 * layout.cc: Include "descriptors.h".
13665 (Layout::create_build_id): Use open_descriptor rather than open.
13666 * output.cc: Include "descriptors.h".
13667 (Output_file::open): Use open_descriptor rather than open.
13668 * archive.cc (Archive::const_iterator): Change Archive to be
13670 (Archive::begin, Archive::end): Make non-const.
13671 (Archive::count_members): Likewise.
13672 * archive.h (class Archive): Update declarations.
13673 * object.h (Object::read): Make non-const.
13674 * Makefile.am (CCFILES): Add descriptors.cc.
13675 (HFILES): Add descriptors.h.
13676 * Makefile.in: Rebuild.
13679 * gold.h: Always include <clocale>. Add Solaris workarounds
13680 following code in binutils/sysdep.h.
13683 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
13684 this->eh_frame_hdr_ is NULL before using it.
13686 * dynobj.cc (Versions::Versions): Update comment.
13688 * dynobj.cc (Versions::Versions): If there is an soname, use it as
13689 the base version name.
13691 * stringpool.cc (Stringpool_template::add_with_length): Set key to
13692 array size plus one.
13693 (Stringpool_template::set_string_offsets): Subtract one from key
13694 before using it as an array index.
13695 (Stringpool_template::get_offset_with_length): Likewise.
13696 (Stringpool_template::write_to_buffer): Likewise.
13697 * stringpool.h (Stringpool_template::get_offset_from_key):
13700 2008-07-23 Ian Lance Taylor <iant@google.com>
13703 * object.h (Merged_symbol_value::value): Do our best to handle a
13707 * script.cc (Version_script_info::get_versions): Don't add empty
13708 version tag to return value.
13709 (Version_script_info::get_symbol_version_helper): Change return
13710 type to bool. Add pversion parameter. Change all callers.
13711 (script_register_vers_node): Don't require a non-NULL tag.
13712 * script.h (class Version_script_info): Update declarations.
13713 (Version_script_info::get_symbol_version): Change return type to
13714 bool. Add version parameter. Change all callers.
13715 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
13716 handling. Handle an empty version from a version script.
13717 (Symbol_table::define_special_symbol): Likewise.
13718 * testsuite/ver_test_10.script: New file.
13719 * testsuite/ver_test_10.sh: New file.
13720 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
13721 (check_DATA): Add ver_test_10.syms.
13722 (ver_test_10.syms, ver_test_10.so): New target.
13723 * testsuite/Makefile.in: Rebuild.
13725 2008-07-23 Simon Baldwin <simonb@google.com>
13727 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
13728 to zero for undefined symbols from dynamic libraries.
13730 2008-07-23 Ian Lance Taylor <iant@google.com>
13732 * symtab.cc (Symbol_table::resolve): Remove version parameter.
13733 Change all callers.
13734 * symtab.h (class Symbol_table): Update declaration.
13735 * testsuite/ver_test_9.cc: New file.
13736 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
13737 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
13738 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
13739 (ver_test_9.so, ver_test_9.o): New targets.
13740 * testsuite/Makefile.in: Rebuild.
13742 2008-07-22 Ian Lance Taylor <iant@google.com>
13744 * options.h (class General_options): Define --check-sections.
13745 * layout.cc (Layout::set_segment_offsets): Handle
13748 * options.h (class General_options): Define -n/--nmagic and
13750 * options.cc (General_options::finalize): For -n/--nmagic or
13751 -N/--omagic, set -static.
13752 * layout.cc (Layout::attach_allocated_section_to_segment): If
13753 -N/--omagic, don't put read-only and read-write sections in
13754 different segments.
13755 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
13756 finding a read-only segment.
13757 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
13758 don't set the minimum segment alignment to the common page size,
13759 and don't set the file offset to the address modulo the page size.
13760 * script-sections.cc (Script_sections::create_segments): If
13761 -n/--omagic, don't put read-only and read-write sections in
13762 different segments.
13764 * cref.cc: New file.
13765 * cref.h: New file.
13766 * options.h (class General_options): Add --print-symbol-counts.
13767 * main.cc (main): Issue defined symbol report if requested.
13768 * archive.cc (Archive::interpret_header): Make into a const member
13770 (Archive::add_symbols): Call Input_objects::archive_start and
13772 (Archive::const_iterator): Define new class.
13773 (Archive::begin, Archive::end): New functions.
13774 (Archive::include_all_members): Rewrite to use iterator.
13775 (Archive::count_members): New function.
13776 * archive.h (class Archive): Update declarations.
13777 (Archive::filename): New function.
13778 * object.cc: Include "cref.h".
13779 (Sized_relobj::Sized_relobj): Initialize defined_count_.
13780 (Sized_relobj::do_get_global_symbol_counts): New function.
13781 (Input_objects::add_object): Add object to cross-referencer.
13782 (Input_objects::archive_start): New function.
13783 (Input_objects::archive_stop): New function.
13784 (Input_objects::print_symbol_counts): New function.
13785 * object.h: Declare Cref and Archive.
13786 (Object::get_global_symbol_counts): New function.
13787 (Object::do_get_global_symbol_counts): New pure virtual function.
13788 (class Sized_relobj): Add defined_count_ field. Update
13790 (class Input_objects): Add cref_ field. Update constructor.
13791 Update declarations.
13792 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
13794 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
13796 (Sized_dynobj::do_get_global_symbol_counts): New function.
13797 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
13798 defined_count_. Update declarations. Define Symbols typedef.
13799 * symtab.cc (Symbol_table::add_from_relobj): Add defined
13800 parameter. Change all callers.
13801 (Symbol_table::add_from_dynobj): Add sympointers and defined
13802 parameters. Change all callers.
13803 * symtab.h (class Symbol_table): Update declarations.
13804 * Makefile.am (CCFILES): Add cref.cc.
13805 (HFILES): Add cref.h.
13806 * Makefile.in: Rebuild.
13808 2008-07-22 Simon Baldwin <simonb@google.com>
13810 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
13811 to zero when writing undefined symbols.
13813 2008-07-22 Ian Lance Taylor <iant@google.com>
13815 * output.cc (Output_section::add_input_section): Don't try to
13816 merge empty merge sections.
13818 2008-07-21 Craig Silverstein <csilvers@google.com>
13820 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13821 Include symbol version in error message.
13823 2008-07-20 Chris Demetriou <cgd@google.com>
13825 * configure.ac (gold_cv_c_random_seed): New configured variable.
13826 (RANDOM_SEED_CFLAGS): New substituted variable.
13827 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
13828 * configure: Rebuild.
13829 * Makefile.in: Likewise.
13830 * testsuite/Makefile.in: Likewise.
13832 2008-07-18 Ian Lance Taylor <iant@google.com>
13834 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
13835 where we see NAME/NULL and NAME/VERSION as separate symbols.
13836 * testsuite/ver_test_main.cc (main): Call t4.
13837 (t4, t4_2a): Define.
13838 * testsuite/ver_test_2.cc (t4_2): Define.
13839 * testsuite/ver_test_2.script: Put t4_2a in VER2.
13840 * testsuite/ver_test_4.cc (t4_2a): Define.
13841 * testsuite/ver_test_4.script: Put t4_2a in VER2.
13842 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
13844 2008-07-17 Ian Lance Taylor <iant@google.com>
13846 * dynobj.cc (Versions::add_def): If we give an error about a
13847 missing version, go ahead and create the version anyhow.
13849 2008-07-10 Ian Lance Taylor <iant@google.com>
13851 Handle output sections with more than 0x7fffffff bytes.
13852 * object.h (class Relobj): Change map_to_output_ to
13853 output_sections_, and just keep a section pointer. Change all
13854 uses. Move comdat group support to Sized_relobj.
13855 (Relobj::is_section_specially_mapped): Remove.
13856 (Relobj::output_section): Remove poff parameter. Change all
13858 (Relobj::output_section_offset): New function.
13859 (Relobj::set_section_offset): Rewrite.
13860 (Relobj::map_to_output): Remove.
13861 (Relobj::output_sections): New function.
13862 (Relobj::do_output_section_offset): New pure virtual function.
13863 (Relobj::do_set_section_offset): Likewise.
13864 (class Sized_relobj): Add section_offsets_ field. Add comdat
13865 group support from Relobj. Update declarations.
13866 (Sized_relobj::get_output_section_offset): New function.
13867 (Sized_relobj::do_output_section_offset): New function.
13868 (Sized_relobj::do_set_section_offset): New function.
13869 * object.cc (Relobj::output_section_address): Remove.
13870 (Sized_relobj::Sized_relobj): Initialize new fields.
13871 (Sized_relobj::include_section_group): Cast find_kept_object to
13873 (Sized_relobj::include_linkonce_section): Likewise.
13874 (Sized_relobj::do_layout): Use separate arrays for output section
13876 (Sized_relobj::do_count_local_symbols): Change map_to_output to
13878 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
13879 output_sections and section_offsets.
13880 (Sized_relobj::write_local_symbols): Likewise.
13881 (map_to_kept_section): Compute output address directly.
13882 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
13883 output_sections and section_offsets.
13884 (Sized_relobj::write_sections): Likewise.
13885 (Sized_relobj::relocate_sections): Likewise.
13886 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
13887 * output.h (class Output_reloc): Update declarations. Change
13888 u2_.relobj to Sized_relobj*.
13889 (class Output_data_reloc): Change add functions to use
13891 * output.cc (Output_reloc::Output_reloc): Change relobj to
13893 (Output_reloc::local_section_offset): Change return type to
13894 Elf_Addr. Use get_output_section_offset.
13895 (Output_reloc::get_address): Likewise.
13896 (Output_section::is_input_address_mapped): Don't call
13897 is_section_specially_mapped.
13898 (Output_section::output_offset): Likewise.
13899 (Output_section::output_address): Likewise.
13900 (Output_section::starting_output_address): Likewise.
13901 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
13902 parameter to Sized_relobj*.
13903 (Copy_relocs::need_copy_reloc): Likewise.
13904 (Copy_relocs::save): Likewise.
13905 * copy-relocs.h (class Copy_relocs): Update declarations.
13906 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
13907 Sized_relobj*. Change relobj_ field to Sized_relobj*.
13908 * target-reloc.h (relocate_for_relocatable): Change
13909 offset_in_output_section type to Elf_Addr. Change code that uses
13911 * layout.cc (Layout::layout): Always set *off.
13912 * mapfile.cc (Mapfile::print_input_section): Use
13913 output_section_offset.
13914 * i386.cc (Target_i386::copy_reloc): Change object parameter to
13916 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
13917 * sparc.cc (Target_sparc::copy_reloc): Likewise.
13918 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
13920 2008-07-03 Ian Lance Taylor <iant@google.com>
13922 * layout.cc (Layout::include_section): Do not discard unrecognized
13923 SHT_STRTAB sections.
13925 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
13927 * script.cc (Lex::can_continue_name): Make '?' allowable in
13928 version-script names.
13929 * testsuite/version_script.map: Change glob pattern to use '?'
13931 2008-06-30 Manish Singh <yosh@gimp.org>
13934 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
13937 2008-06-30 Ian Lance Taylor <iant@google.com>
13941 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
13942 versions]: Don't try to read the value in the contents, since we
13943 don't use it. Use the template endianness when writing.
13945 2008-06-25 Cary Coutant <ccoutant@google.com>
13947 * fileread.cc (File_read::make_view): Assert on zero-length view.
13948 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
13949 symbol table when there are no symbols to read.
13951 2008-06-23 Craig Silverstein <csilvers@google.com>
13953 * version.cc (version_string): Bump to 1.7
13955 2008-06-18 Craig Silverstein <csilvers@google.com>
13957 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
13958 constant 0xFFFF to type Valtype.
13959 (Powerpc_relocate_functions::rel16_ha): Likewise.
13961 2008-06-17 Ian Lance Taylor <iant@google.com>
13963 * output.h (Output_section::Input_section): Initialize p2align_ to
13964 zero for Output_section_data constructors.
13965 (Output_section::Input_section::addralign): If not an input
13966 section, return the alignment of the Output_section_data.
13967 * testsuite/copy_test.cc: New file.
13968 * testsuite/copy_test_1.cc: New file.
13969 * testsuite/copy_test_2.cc: New file.
13970 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
13971 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
13972 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
13973 (copy_test_1_pic.o, copy_test_1.so): New targets.
13974 (copy_test_2_pic.o, copy_test_2.so): New targets.
13975 * testsuite/Makefile.in: Rebuild.
13977 * script-sections.cc (Script_sections::place_orphan): Initialize
13978 local variable exact.
13980 2008-06-13 David Edelsohn <edelsohn@gnu.org>
13982 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
13984 2008-06-12 David Edelsohn <edelsohn@gnu.org>
13985 David S. Miller <davem@davemloft.net>
13987 * powerpc.cc: New file.
13988 * Makefile.am (TARGETSOURCES): Add powerpc.cc
13989 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
13990 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
13991 * Makefile.in: Rebuild.
13993 2008-06-09 Ian Lance Taylor <iant@google.com>
13995 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
13997 (throwing, orig_terminate): New static variables.
13998 (terminate_handler): New static function.
13999 (t2): Set terminate handler.
14001 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14004 * binary.cc (Binary_to_elf::sized_convert): Fix .data
14007 2008-05-30 Cary Coutant <ccoutant@google.com>
14009 * archive.cc (Archive::include_all_members) Correct to step
14010 over symbol table and extended name table in thin archives.
14012 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14015 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14018 2008-05-28 Caleb Howe <cshowe@google.com>
14020 * reduced_debug_output.cc: New file.
14021 * reduced_debug_output.h: New file.
14022 * options.h (class General_options): Add --strip-debug-non-line.
14023 * options.cc (General_options::finalize): Add strip_debug_non_line
14024 to the strip heirarchy.
14025 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14027 * layout.cc: Include "reduced_debug_output.h".
14028 (Layout::Layout): Initialize new fields.
14029 (line_only_debug_sections): New static array.
14030 (is_lines_only_debug_sections): New static inline function.
14031 (Layout::include_section): Handle --strip-debug-non-line.
14032 (Layout::make_output_section): If --strip-debug-non-line, build
14033 new output sections for .debug_abbrev and .debug_info.
14034 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14035 gold. Warn about possible overflow.
14036 (read_signed_LEB_128): Likewise.
14037 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14038 (read_signed_LEB_128): Declare.
14039 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14040 (HFILES): Add reduced_debug_output.h.
14041 * Makefile.in: Rebuild.
14043 2008-05-21 Ian Lance Taylor <iant@google.com>
14045 * mapfile.cc: New file.
14046 * mapfile.h: New file.
14047 * options.h (class General_options): Add -M/--print-map and -Map.
14048 * options.cc (General_options::finalize): Make -M equivalent to
14050 * main.cc: Include <cstdio> and "mapfile.h".
14051 (main): Open mapfile if requested.
14052 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14053 constructor. Change caller.
14054 (queue_initial_tasks): Add mapfile parameter. Change caller.
14055 (queue_middle_tasks): Likewise.
14056 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14058 * archive.cc: Include "mapfile.h".
14059 (Archive::add_symbols): Add mapfile parameter. Change all
14060 callers. Pass mapfile, symbol, and reason to include_member.
14061 (Archive::include_all_members): Add mapfile parameter. Change all
14063 (Archive::include_member): Add mapfile, sym, and why parameters.
14064 Change all callers. Report inclusion to map file.
14065 * archive.h: Include "fileread.h".
14066 (class Archive): Update declarations.
14067 (Archive::file): New const method.
14068 (class Add_archive_symbols): Add mapfile_ field. Update
14069 constructor. Change all callers.
14070 * readsyms.h (class Read_symbols): Likewise.
14071 (class Finish_group): Likewise.
14072 (class Read_script): Likewise.
14073 * common.cc: Include "mapfile.h".
14074 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14076 (Symbol_table::do_allocate_commons): Likewise.
14077 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14078 symbol allocation to mapfile.
14079 * common.h (class Allocate_commons_task): Add mapfile_ field.
14080 Update constructor. Change all callers.
14081 * symtab.h (class Symbol_table): Update declarations.
14082 * layout.cc: Include "mapfile.h".
14083 (Layout_task_runner::run): Print information to mapfile.
14084 (Layout::create_gold_note): Change Output_data_fixed_space to
14085 Output_data_zero_fill.
14086 (Layout::create_build_id): Likewise.
14087 (Layout::print_to_mapfile): New function.
14088 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14089 constructor. Change caller.
14090 (class Layout): Declare print_to_mapfile.
14091 * output.cc (Output_section::Input_section::print_to_mapfile): New
14093 (Output_section::add_input_section): If producing a map, always
14094 add to input_sections_ list.
14095 (Output_section::do_print_to_mapfile): New function.
14096 (Output_segment::print_sections_to_mapfile): New function.
14097 (Output_segment::print_section_list_to_mapfile): New function.
14098 * output.h: Include "mapfile.h".
14099 (Output_data::print_to_mapfile): New function.
14100 (Output_data::do_print_to_mapfile): New virtual function.
14101 (Output_segment_headers::do_print_to_mapfile): New function.
14102 (Output_file_header::do_print_to_mapfile): New function.
14103 (Output_data_const::do_print_to_mapfile): New function.
14104 (class Output_data_const_buffer): Add map_name_ field. Update
14105 constructor. Change all callers. Add do_print_to_mapfile
14107 (class Output_data_fixed_space): Likewise.
14108 (class Output_data_space): Likewise.
14109 (class Output_data_zero_fill): New class.
14110 (Output_data_strtab::do_print_to_mapfile): New function.
14111 (Output_data_reloc_base::do_print_to_mapfile): New function.
14112 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14113 (Output_data_group::do_print_to_mapfile): New function.
14114 (Output_data_got::do_print_to_mapfile): New function.
14115 (Output_data_dynamic::do_print_to_mapfile): New function.
14116 (Output_symtab_xindex::do_print_to_mapfile): New function.
14117 (class Output_section): Declare do_print_to_mapflie. Declare
14118 print_to_mapfile in Input_section.
14119 (class Output_segment): Declare new functions.
14120 * object.h (Sized_relobj::symbol_count): New function.
14121 * script-sections.cc
14122 (Output_section_element_dot_assignment::set_section_addresses):
14123 Change Output_data_fixed_space to Output_data_zero_fill.
14124 (Output_data_expression::do_print_to_mapfile): New function.
14125 * script.cc (read_input_script): Add mapfile parameter. Change
14127 * script.h (read_input_script): Update declaration.
14128 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14129 (Eh_frame::do_print_to_mapfile): New function.
14130 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14131 (Output_merge_string::do_print_to_mapfile): New function.
14132 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
14134 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
14136 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
14138 * Makefile.am (CCFILES): Add mapfile.cc.
14139 (HFILES): Add mapfile.h.
14140 * Makefile.in: Rebuild.
14142 2008-05-19 Ian Lance Taylor <iant@google.com>
14144 * options.h (class General_options): Add -z relro.
14145 * layout.cc (Layout::Layout): Initialize relro_segment_.
14146 (Layout::add_output_section_data): Return the output section.
14147 (Layout::make_output_section): Rcognize relro sections and mark
14148 them appropriately.
14149 (Layout::attach_allocated_section_to_segment): Put relro sections
14150 in a PT_GNU_RELRO segment.
14151 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14153 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14155 (Layout::linkonce_mapping): Map d.rel.ro.local to
14156 .data.rel.ro.local.
14157 (Layout::output_section_name): Us .data.rel.ro.local for any
14158 section which begins with that.
14159 * layout.h (class Layout): Update add_output_section_data
14160 declaration. Add relro_segment_ field.
14161 * output.cc (Output_section::Output_section): Initialize is_relro_
14162 and is_relro_local_ fields.
14163 (Output_segment::add_output_section): Group relro sections.
14164 (Output_segment::is_first_section_relro): New function.
14165 (Output_segment::maximum_alignment): If there is a relro section,
14166 align the segment to the common page size.
14167 (Output_segment::set_section_addresses): Track whether we are
14168 looking at relro sections. If the last section is a relro
14169 section, align to the common page size.
14170 (Output_segment::set_section_list_addresses): Add in_relro
14171 parameter. Change all callers. Align to the page size when
14172 moving from relro to non-relro section.
14173 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
14175 * output.h (class Output_section): Add is_relro_ and
14176 is_relro_local_ fields.
14177 (Output_section::is_relro): New function.
14178 (Output_section::set_is_relro): New function.
14179 (Output_section::is_relro_local): New function.
14180 (Output_section::set_is_relro_local): New function.
14181 (class Output_segment): Update declarations.
14182 * i386.cc (Target_i386::got_section): Mark .got section as relro.
14183 * sparc.cc (Target_sparc::got_section): Likewise.
14184 * x86_64.cc (Target_x86_64::got_section): Likewise.
14185 * testsuite/relro_test_main.cc: New file.
14186 * testsuite/relro_test.cc: New file.
14187 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
14188 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
14189 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
14190 (relro_test.so, relro_test_pic.o): New targets.
14191 * testsuite/Makefile.in: Rebuild.
14193 2008-05-16 Ian Lance Taylor <iant@google.com>
14195 * output.cc (Output_segment::add_output_section): Remove front
14197 * output.h (class Output_segment): Remove
14198 add_initial_output_section and overloaded add_output_section.
14199 Update declaration of remaining add_output_section.
14200 * layout.cc (Layout::create_interp): Call add_output_section
14201 rather than add_initial_output_section.
14202 (Layout::finish_dynamic_section): Likewise.
14204 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
14205 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
14206 know the dynamic type.
14207 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
14208 field. Initialize it in constructor.
14209 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
14210 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
14211 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
14214 * output.cc (Output_reloc::get_address): Change return type to
14216 * output.h (class Output_reloc): Update get_address declaration.
14217 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
14218 for section addresses.
14220 2008-05-09 Ian Lance Taylor <iant@google.com>
14223 * gold.cc (gold_nomem): Use return value of write.
14225 2008-05-08 Ian Lance Taylor <iant@google.com>
14227 * symtab.c (Symbol::init_base_output_data): Add version
14228 parameter. Change all callers.
14229 (Symbol::init_base_output_segment): Likewise.
14230 (Symbol::init_base_constant): Likewise.
14231 (Symbol::init_base_undefined): Likewise.
14232 (Sized_symbol::init_output_data): Likewise.
14233 (Sized_symbol::init_output_segment): Likewise.
14234 (Sized_symbol::init_constant): Likewise.
14235 (Sized_symbol::init_undefined): Likewise.
14236 (Symbol_table::do_define_in_output_data): If the new symbol has a
14237 version, mark it as the default.
14238 (Symbol_table::do_define_in_output_segment): Likewise.
14239 (Symbol_table::do_define_as_constant): Likewise.
14240 * symtab.h (class Symbol): Update declarations.
14241 (class Sized_symbol): Likewise.
14242 * resolve.cc (Symbol::override_version): New function.
14243 (Symbol::override_base): Call override_version.
14244 (Symbol::override_base_with_special): Likewise.
14245 * testsuite/ver_script_8.script: New file.
14246 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
14247 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
14248 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
14249 (ver_test_8_1.so, ver_test_8_2.so): New targets.
14251 2008-05-06 Ian Lance Taylor <iant@google.com>
14254 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
14256 (class General_options): Remove existing --undefined, and add
14257 --no-undefined instead. Add new --undefined as synonym for -u.
14258 * archive.cc (Archive::add_symbols): Check whether symbol was
14260 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
14261 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
14262 all uses. Add IS_UNDEFINED. Update declarations to split
14263 different versions of init_base. Declare init_base_undefined.
14264 (Symbol::is_defined): Handle IS_UNDEFINED.
14265 (Symbol::is_undefined): Likewise.
14266 (Symbol::is_weak_undefined): Call is_undefined.
14267 (Symbol::is_absolute): Handle IS_CONSTANT.
14268 (class Sized_symbol): Update declarations to split different
14269 versions of init. Declare init_undefined.
14270 (class Symbol_table): Declare new functions.
14271 * symtab.cc (Symbol::init_base_object): Rename from init_base.
14272 Change all callers.
14273 (Symbol::init_base_output_data): Likewise.
14274 (Symbol::init_base_output_segment): Likewise.
14275 (Symbol::init_base_constant): Likewise.
14276 (Symbol::init_base_undefined): New function.
14277 (Sized_symbol::init_object): Rename from init. Change all
14279 (Sized_symbol::init_output_data): Likewise.
14280 (Sized_symbol::init_output_segment): Likewise.
14281 (Sized_symbol::init_constant): Likewise.
14282 (Sized_symbol::init_undefined): New function.
14283 (Symbol_table::add_undefined_symbols_from_command_line): New
14285 (Symbol_table::do_add_undefined_symbols_from_command_line): New
14287 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
14288 (Symbol::output_section): Likewise.
14289 (Symbol::set_output_section): Likewise.
14290 (Symbol_table::sized_finalize_symbol): Likewise.
14291 (Symbol_table::sized_write_globals): Likewise.
14292 * resolve.cc (Symbol_table::should_override): Likewise.
14293 (Symbol::override_base_with_special): Likewise.
14295 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
14296 symbol, change it to have default visibility.
14297 * testsuite/protected_1.cc: New file.
14298 * testsuite/protected_2.cc: New file.
14299 * testsuite/protected_3.cc: New file.
14300 * testsuite/protected_main_1.cc: New file.
14301 * testsuite/protected_main_2.cc: New file.
14302 * testsuite/protected_main_3.cc: New file.
14303 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
14304 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
14305 (protected_1_LDFLAGS, protected_1_LDADD): Define.
14306 (protected_1.so): New target.
14307 (protected_1_pic.o, protected_2_pic.o): New targets.
14308 (protected_3_pic.o): New target.
14309 (check_PROGRAMS): Add protected_2.
14310 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
14311 (protected_2_LDFLAGS, protected_2_LDADD): Define.
14312 * testsuite/Makefile.in: Rebuild.
14314 * options.h (DEFINE_var): Add set_user_set_##varname__.
14315 (DEFINE_bool_alias): New macro.
14316 (class General_options): Define -Bstatic using DEFINE_bool_alias
14317 rather than DEFINE_special. Add --undefined as an alias for -z
14319 * options.cc (General_options::parse_Bstatic): Remove.
14321 * options.h (class General_options): Add --fatal-warnings.
14322 * main.cc (main): Implement --fatal-warnings.
14323 * errors.h (Errors::warning_count): New function.
14325 * options.h (class General_options): Add -Bsymbolic-functions.
14326 * symtab.h (Symbol::is_preemptible): Check for
14327 -Bsymbolic-functions.
14329 2008-05-05 Ian Lance Taylor <iant@google.com>
14331 * options.h (DEFINE_bool): For DASH_Z, create the negative option
14332 as noVARNAME rather than no-VARNAME.
14333 (class General_options): Add option -z combreloc.
14334 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
14336 (Output_reloc::sort_before) [SHT_REL]: New function.
14337 (Output_reloc::sort_before) [SHT_RELA]: New function.
14338 (class Output_data_reloc_base): Add sort_relocs_ field. Define
14339 Sort_relocs_comparison.
14340 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
14341 parameter. Change all callers.
14342 (Output_data_reloc::Output_data_reloc) [both versions]: Add
14343 sort_relocs parameter. Change all callers.
14344 * output.cc (Output_reloc::get_address): New function, broken out
14346 (Output_reloc::write_rel): Call it.
14347 (Output_reloc::compare): New function.
14348 (Output_data_reloc_base::do_write): Optionally sort relocs.
14350 * configure.ac: If targ_extra_obj is set, link it in.
14351 * configure.tgt: Initialize all variables.
14352 (x86_64*): Set targ_extra_obj and targ_extra_size.
14353 * configure: Rebuild.
14355 * object.cc (Sized_relobj::include_section_group): Adjust section
14356 indexes read from group data. Build vector to pass to
14358 * layout.cc (Layout::layout_group): Add flags and shndxes
14359 parameters. Remove contents parameter. Change caller. Update
14360 explicit instantiations.
14361 * layout.h (class Layout): Update layout_group declaration.
14362 * output.cc (Output_data_group::Output_data_group): Add flags and
14363 input_shndxes parameters. Remove contents parameter. Change
14365 (Output_data_group::do_write): Change input_sections_ to
14367 * output.h (class Output_data_group): Update constructor
14368 declaration. Rename input_sections_ to input_shndxes_.
14369 * testsuite/many_sections_test.cc: Add template.
14371 2008-04-30 Cary Coutant <ccoutant@google.com>
14373 * target-reloc.h (relocate_section): Fix dead-pointer bug.
14375 * layout.cc (Layout::include_section): Refactored check for debug
14377 (Layout::add_comdat): Add new parameters. Change type
14378 of signature parameter. Add object and shndx to signatures table.
14379 (Layout::find_kept_object): New function.
14380 * layout.h: Include <cstring>.
14381 (Layout::is_debug_info_section): New function.
14382 (Layout::add_comdat): Add new parameters.
14383 (Layout::find_kept_object): New function.
14384 (Layout::Kept_section): New struct.
14385 (Layout::Signatures): Change type of map range.
14386 * object.cc (Relobj::output_section_address): New function.
14387 (Sized_relobj::include_section_group): Add new parameters. Change
14388 calls to Layout::add_comdat. Change to build table of kept comdat
14389 groups and table mapping discarded sections to kept sections.
14390 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
14391 (Sized_relobj::do_layout): Change calls to include_section_group and
14392 include_linkonce_section.
14393 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
14394 value to zero when section is discarded.
14395 (Sized_relobj::map_to_kept_section): New function.
14396 * object.h (Relobj::output_section_address): New function.
14397 (Relobj::Comdat_group): New type.
14398 (Relobj::find_comdat_group): New function.
14399 (Relobj::Comdat_group_table): New type.
14400 (Relobj::Kept_comdat_section): New type.
14401 (Relobj::Kept_comdat_section_table): New type.
14402 (Relobj::add_comdat_group): New function.
14403 (Relobj::set_kept_comdat_section): New function.
14404 (Relobj::get_kept_comdat_section): New function.
14405 (Relobj::comdat_groups_): New field.
14406 (Relobj::kept_comdat_sections_): New field.
14407 (Symbol_value::input_value): Update comment.
14408 (Sized_relobj::map_to_kept_section) New function.
14409 (Sized_relobj::include_linkonce_section): Add new parameter.
14410 * target-reloc.h (Comdat_behavior): New type.
14411 (get_comdat_behavior): New function.
14412 (relocate_section): Add code to map a discarded section to the
14413 corresponding kept section when applying a relocation.
14415 2008-04-30 Craig Silverstein <csilvers@google.com>
14417 * dwarf_reader.cc (next_generation_count): New static var.
14418 (Addr2line_cache_entry): New struct.
14419 (addr2line_cache): New static var.
14420 (Dwarf_line_info::one_addr2line): Added caching.
14421 (Dwarf_line_info::clear_addr2line_cache): New function.
14422 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
14423 cache-size parameter.
14424 (Dwarf_line_info::one_addr2line_cache): New function.
14425 * symtab.cc (Symbol_table::detect_odr_violations): Pass
14426 new cache-size argument to one_addr2line(), and clear cache.
14428 2008-04-28 Cary Coutant <ccoutant@google.com>
14430 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
14431 R_386_PC8 relocations.
14433 2008-04-23 Ian Lance Taylor <iant@google.com>
14435 * object.cc (Sized_relobj::include_section_group): Check for
14436 invalid section group.
14438 * object.cc (make_elf_object): Correct test for 64-bit ELF file
14441 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
14442 than read for file header.
14443 * archive.cc (Archive::include_member): Likewise.
14445 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
14447 * aclocal.m4: Regenerate.
14448 * configure: Regenerate.
14450 2008-04-19 Ian Lance Taylor <iant@google.com>
14452 * version.cc (version_string): Bump to 1.6.
14454 * testsuite/Makefile.am (many_sections_r_test): New target.
14455 (many_sections_r_test_SOURCES): Remove.
14456 (many_sections_r_test_DEPENDENCIES): Remove.
14457 (many_sections_r_test_LDFLAGS): Remove.
14458 (many_sections_r_test_LDADD): Remove.
14460 * object.cc (Sized_relobj::do_add_symbols): Always pass
14461 local_symbol_count_ to add_from_relobj.
14463 * testsuite/Makefile.am (many_sections_check.h): Only check one in
14464 every thousand variables.
14465 * testsuite/Makefile.in: Rebuild.
14467 * object.cc (Xindex::initialize_symtab_xindex): New function.
14468 (Xindex::read_symtab_xindex): New function.
14469 (Xindex::sym_xindex_to_shndx): New function.
14470 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
14472 (Sized_relobj::do_initialize_xindex): New function.
14473 (Sized_relobj::do_read_symbols): Adjust section links.
14474 (Sized_relobj::symbol_section_and_value): Add is_ordinary
14475 parameter. Change all callers.
14476 (Sized_relobj::include_section_group): Adjust section links and
14477 symbol section indexes.
14478 (Sized_relobj::do_layout): Adjust section links.
14479 (Sized_relobj::do_count_local_symbols): Adjust section links and
14480 symbol section indexes.
14481 (Sized_relobj::do_finalize_local_symbols): Distinguish between
14482 ordinary and special symbols.
14483 (Sized_relobj::write_local_symbols): Add symtab_xindex and
14484 dynsym_xindex parameters. Change all callers. Adjust section
14485 links. Use SHN_XINDEX when needed.
14486 (Sized_relobj::get_symbol_location_info): Adjust section links.
14487 Don't get fooled by special symbols.
14488 * object.h (class Xindex): Define.
14489 (class Object): Add xindex_ parameter. Declare virtual functoin
14490 do_initialize_xindex.
14491 (Object::adjust_sym_shndx): New function.
14492 (Object::set_xindex): New protected function.
14493 (class Symbol_value): Add is_ordinary_shndx_ field.
14494 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
14495 (Symbol_value::value): Assert ordinary section.
14496 (Symbol_value::initialize_input_to_output_map): Likewise.
14497 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
14498 Change all callers.
14499 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
14501 (class Sized_relobj): Update declarations.
14502 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
14503 parameter. Change all callers.
14504 (Sized_relobj::adjust_shndx): New function.
14505 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
14507 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
14508 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
14509 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
14510 (Sized_dynobj::read_dynsym_section): Adjust section links.
14511 (Sized_dynobj::read_dynamic): Likewise.
14512 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
14514 (Sized_dynobj::do_initialize_xindex): New function.
14515 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
14516 do_initialize_xindex.
14517 (Sized_dynobj::adjust_shndx): New function.
14518 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
14519 dynsym_xindex_ fields.
14520 (Layout::finalize): Add a call to set_section_indexes before
14521 creating the symtab sections.
14522 (Layout::set_section_indexes): Don't do anything if the section
14523 already has a section index.
14524 (Layout::create_symtab_sections): Add shnum parameter. Change
14525 caller. Create .symtab_shndx section if needed.
14526 (Layout::create_shdrs): Add shstrtab_section parameter. Change
14528 (Layout::allocated_output_section_count): New function.
14529 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
14531 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
14532 fields. Update declarations.
14533 (Layout::symtab_xindex): New function.
14534 (Layout::dynsym_xindex): New function.
14535 (class Write_symbols_task): Add layout_ field.
14536 (Write_symbols_task::Write_symbols_task): Add layout parameter.
14538 * output.cc (Output_section_headers::Output_section_headers): Add
14539 shstrtab_section parameter. Change all callers.
14540 (Output_section_headers::do_sized_write): Store overflow values
14541 for section count and section string table section index in
14542 section header zero.
14543 (Output_file_header::do_sized_write): Check for overflow of
14544 section count and section string table section index.
14545 (Output_symtab_xindex::do_write): New function.
14546 (Output_symtab_xindex::endian_do_write): New function.
14547 * output.h (class Output_section_headers): Add shstrtab_section_.
14548 Update declarations.
14549 (class Output_symtab_xindex): Define.
14550 (Output_section::has_out_shndx): New function.
14551 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
14553 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
14554 Change all callers.
14555 (Sized_symbol::init): Likewise.
14556 (Symbol::output_section): Check for ordinary symbol.
14557 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
14558 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
14560 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
14561 Change all callers. Simplify handling of symbols from sections
14562 not included in the link.
14563 (Symbol_table::add_from_dynobj): Handle ordinary symbol
14565 (Weak_alias_sorter::operator()): Assert that symbols are
14567 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
14569 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
14570 parameters. Change all callers.
14571 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
14572 symbol distinction. Use SHN_XINDEX when needed.
14573 (Symbol_table::write_section_symbol): Add symtab_xindex
14574 parameter. Change all callers.
14575 (Symbol_table::sized_write_section_symbol): Likewise. Use
14576 SHN_XINDEX when needed.
14577 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
14579 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
14580 (Symbol::is_defined): Check is_ordinary.
14581 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
14582 (Symbol::is_absolute, Symbol::is_common): Likewise.
14583 (class Sized_symbol): Update declarations.
14584 (class Symbol_table): Update declarations.
14585 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
14586 parameters. Change all callers.
14587 (Sized_symbol::override): Likewise.
14588 (Symbol_table::override): Likewise.
14589 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
14590 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
14591 is_ordinary, and orig_st_shndx parameters. Change all callers.
14592 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
14593 to be in an ordinary section.
14594 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
14595 object and is_ordinary parameters. Change all callers.
14596 (Sized_dwarf_line_info::read_relocs): Add object parameter.
14597 Change all callers. Don't add undefined or non-ordinary symbols
14599 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
14600 Change all callers.
14601 * dwarf_reader.h (class Sized_dwarf_line_info): Update
14603 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
14604 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
14605 (Sized_relobj::relocate_sections): Likewise.
14606 * target-reloc.h (scan_relocs): Adjust section symbol index.
14607 (scan_relocatable_relocs): Likewise.
14608 * i386.cc (Scan::local): Check for ordinary symbols.
14609 * sparc.cc (Scan::local): Likewise.
14610 * x86_64.cc (Scan::local): Likewise.
14611 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
14612 to symbol_section_and_value.
14613 * testsuite/many_sections_test.cc: New file.
14614 * testsuite/Makefile.am (BUILT_SOURCES): Define.
14615 (check_PROGRAMS): Add many_sections_test.
14616 (many_sections_test_SOURCES): Define.
14617 (many_sections_test_DEPENDENCIES): Define.
14618 (many_sections_test_LDFLAGS): Define.
14619 (BUILT_SOURCES): Add many_sections_define.h.
14620 (many_sections_define.h): New target.
14621 (BUILT_SOURCES): Add many_sections_check.h.
14622 (many_sections_check.h): New target.
14623 (check_PROGRAMS): Add many_sections_r_test.
14624 (many_sections_r_test_SOURCES): Define.
14625 (many_sections_r_test_DEPENDENCIES): Define.
14626 (many_sections_r_test_LDFLAGS): Define.
14627 (many_sections_r_test_LDADD): Define.
14628 (many_sections_r_test.o): New target.
14629 * testsuite/Makefile.in: Rebuild.
14631 2008-04-17 Cary Coutant <ccoutant@google.com>
14633 * errors.cc (Errors::info): New function.
14634 (gold_info): New function.
14635 * errors.h (Errors::info): New function.
14636 * gold.h (gold_info): New function.
14637 * object.cc (Input_objects::add_object): Print trace output.
14638 * options.cc (options::parse_set): New function.
14639 (General_options::parse_wrap): Deleted.
14640 (General_options::General_options): Deleted initializer.
14641 * options.h (options::String_set): New typedef.
14642 (options::parse_set): New function.
14643 (DEFINE_set): New macro.
14644 (General_options::wrap): Changed to use DEFINE_set. Changed
14645 callers of any_wrap_symbols and is_wrap_symbol.
14646 (General_options::trace, General_options::trace_symbol):
14648 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
14649 (General_options::wrap_symbols_): Deleted.
14650 * symtab.cc (Symbol_table::add_from_object): Print trace output.
14652 2008-04-17 David S. Miller <davem@davemloft.net>
14654 * options.cc (General_options::parse_V): New function.
14655 * options.h: Add entries for -V and -Qy.
14657 2008-04-17 Ian Lance Taylor <iant@google.com>
14659 * common.cc (Symbol_table::allocate_commons): Remove options
14660 parameter. Change caller.
14661 (Symbol_table::do_allocate_commons): Remove options parameter.
14662 Change caller. Just call do_allocate_commons_list twice.
14663 (Symbol_table::do_allocate_commons_list): New function, broken out
14664 of do_allocate_commons.
14665 * common.h (class Allocate_commons_task): Remove options_ field.
14666 Update constructor.
14667 * symtab.cc (Symbol_table::Symbol_table): Initialize
14669 (Symbol_table::add_from_object): Put TLS common symbols on
14671 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
14672 which are IN_OUTPUT_DATA.
14673 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
14674 allocate_commons and do_allocate_commons declarations. Declare
14675 do_allocate_commons_list.
14676 * gold.cc (queue_middle_tasks): Update creation of
14677 Allocate_commons_task to not pass options.
14678 * testsuite/Makefile.am (INCLUDES): Add -I.. .
14679 (TLS_TEST_C_FLAGS): New variable.
14680 (tls_test_c_pic.o): New target.
14681 (tls_test_shared.so): Link in tls_test_c_pic.o.
14682 (tls_test_c_pic_ie.o): New target.
14683 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
14684 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
14685 (tls_test_c.o): New target.
14686 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
14687 (tls_pic_test_LDADD): Likewise.
14688 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
14689 (tls_shared_gd_to_ie_test_LDADD): Likewise.
14690 (tls_test_c_gnu2.o): New target.
14691 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
14693 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
14694 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
14695 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
14696 * testsuite/tls_test.cc: Include "config.h".
14697 (t_last): Call t11_last.
14698 * testsuite/tls_test.h (t11, t11_last): Declare.
14699 * testsuite/tls_test_c.c: New file.
14700 * testsuite/tls_test_main.cc (thread_routine): Call t11.
14701 * configure.ac: Check for OpenMP support.
14702 * configure, config.in, Makefile.in: Rebuild.
14703 * testsuite/Makefile.in: Rebuild.
14705 2008-04-16 Cary Coutant <ccoutant@google.com>
14707 * i386.cc (Target_i386::define_tls_base_symbol): New function.
14708 (Target_i386::tls_base_symbol_defined_): New field.
14709 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14710 (Target_i386::Scan::global): Likewise.
14711 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
14712 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
14713 (Target_x86_64::tls_base_symbol_defined_): New field.
14714 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14715 (Target_x86_64::Scan::global): Likewise.
14717 2008-04-16 Cary Coutant <ccoutant@google.com>
14719 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
14720 (Symbol::needs_plt_entry): Allow weak undefined symbols.
14721 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
14722 building shared libraries.
14723 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
14724 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
14725 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
14726 * testsuite/Makefile.in: Rebuild.
14727 * testsuite/weak_undef.h: New file.
14728 * testsuite/weak_undef_file1.cc: Add extra test cases.
14729 * testsuite/weak_undef_file2.cc: Likewise.
14730 * testsuite/weak_undef_test.cc: Likewise.
14732 2008-04-16 David S. Miller <davem@davemloft.net>
14734 * sparc.cc (Target_sparc::Scan): Change from struct to class.
14735 Add issued_non_pic_error_ field. Declare check_non_pic.
14736 (Target_sparc::Scan::check_non_pic): New function.
14737 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
14738 (Target_sparc::Scan::global): Likewise.
14740 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
14741 * configure: Rebuild.
14743 * options.h (DEFINE_enable): New macro.
14744 (new_dtags): New enable option.
14745 (initfirst, interpose, loadfltr, nodefaultlib,
14746 nodelete, nodlopen, nodump): New -z options.
14747 * layout.cc (Layout:finish_dynamic_section): If new
14748 dtags enabled, emit DT_RUNPATH. Also, emit a
14749 DT_FLAGS_1 containing any specified -z flags.
14751 2008-04-16 Ian Lance Taylor <iant@google.com>
14753 * copy-relocs.cc: New file.
14754 * copy-relocs.h: New file.
14755 * reloc.cc: Remove Copy_relocs code.
14756 * reloc.h: Likewise.
14757 * reloc-types.h (struct Reloc_types) [both versions]: Add
14758 get_reloc_addend_noerror.
14759 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
14760 variants of add_global which take an addend which must be zero.
14761 * i386.cc: Include "copy-relocs.h".
14762 (class Target_i386): Change type of copy_relocs_ to variable,
14763 update initializer.
14764 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
14765 Change all callers.
14766 (Target_i386::do_finalize_sections): Change handling of
14768 * sparc.cc: Include "copy-relocs.h".
14769 (class Target_sparc): Change type of copy_relocs_ to variable,
14770 update initializer.
14771 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
14772 Change all callers.
14773 (Target_sparc::do_finalize_sections): Change handling of
14775 * x86_64.cc: Include "copy-relocs.h".
14776 (class Target_x86_64): Change type of copy_relocs_ to variable,
14777 update initializer.
14778 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
14779 class. Change all callers.
14780 (Target_x86_64::do_finalize_sections): Change handling of
14782 * Makefile.am (CCFILES): Add copy-relocs.cc.
14783 (HFILES): Add copy-relocs.h.
14785 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
14787 * testsuite/script_test_4.sh: Permit leading zeroes.
14789 2008-04-15 Ian Lance Taylor <iant@google.com>
14791 * script-sections.cc (Script_sections::create_segments): Use
14792 header_size_adjustment even when there is enough room for the
14794 * testsuite/script_test_4.sh: New file.
14795 * testsuite/script_test_4.t: New file.
14796 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
14797 (check_DATA): Add script_test_4.stdout.
14798 (MOSTLYCLEANFILES): Likewise.
14799 (script_test_4): New target.
14800 (script_test_4.stdout): New target.
14801 * testsuite/Makefile.in: Rebuild.
14803 * sparc.cc: Add definitions for Output_data_plt_sparc class
14806 2008-04-14 David S. Miller <davem@davemloft.net>
14808 * sparc.cc: New file.
14809 * Makefile.am (TARGETSOURCES): Add sparc.cc
14810 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
14811 * configure.tgt: Document targ_extra_size and
14812 targ_extra_big_endian. Add entries for sparc-* and
14814 * configure.ac: Handle targ_extra_size and
14815 targ_extra_big_endian.
14816 * Makefile.in: Rebuild.
14817 * configure: Likewise.
14818 * po/POTFILES.in: Likewise.
14819 * po/gold.pot: Likewise.
14821 2008-04-14 Ian Lance Taylor <iant@google.com>
14823 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
14824 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
14825 in the name/type/flags to section mapping. Don't call
14826 allocate_output_section.
14827 (Layout::choose_output_section): Change parameter from adjust_name
14828 to is_input_section. Don't permit input sections after sections
14829 are attached to segments. Don't call allocate_output_section.
14830 (Layout::layout_eh_frame): Call update_flags_for_input_section,
14831 not write_enable_output_section.
14832 (Layout::make_output_section): Don't push to
14833 unattached_section_list_ nor call attach_to_segment. Call
14834 attach_section_to_segment if sections are attached.
14835 (Layout::attach_sections_to_segments): New function.
14836 (Layout::attach_section_to_segment): New function.
14837 (Layout::attach_allocated_section_to_segment): Rename from
14838 attach_to_segment. Remove flags parameter.
14839 (Layout::allocate_output_section): Remove function.
14840 (Layout::write_enable_output_section): Remove function.
14841 * layout.h (class Layout): Update for above changes. Add new
14842 field sections_are_attached_.
14843 * output.h (Output_section::update_flags_for_input_section): New
14845 * output.cc (Output_section::add_input_section): Call
14846 update_flags_for_input_section.
14847 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
14849 2008-04-11 Cary Coutant <ccoutant@google.com>
14851 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
14852 thought unnecessary.
14853 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
14855 2008-04-11 Ian Lance Taylor <iant@google.com>
14857 * output.h (class Output_section_data): Remove inline definition
14859 * output.cc (Output_section_data::set_addralign): New function.
14861 2008-04-11 Cary Coutant <ccoutant@google.com>
14863 Add support for TLS descriptors for i386 and x86_64.
14864 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
14865 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
14866 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
14868 (Target_i386::got_mod_index_entry): Remove unnecessary code.
14869 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
14870 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
14872 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
14873 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
14874 Fix problem with initial-exec relocations.
14875 (Target_i386::Relocate::relocate_tls): Likewise.
14876 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
14878 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
14879 support for section-plus-offset dynamic table entries.
14880 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
14881 (Output_data_dynamic::Dynamic_entry): Add support for
14882 section-plus-offset dynamic table entries.
14883 (Output_data_dynamic::Classification): Likewise.
14884 (Output_data_dynamic::classification_): Renamed offset_.
14885 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
14886 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
14887 (Target_x86_64::make_plt_section): New function.
14888 (Target_x86_64::reserve_tlsdesc_entries): New function.
14889 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
14890 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
14891 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
14892 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
14893 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
14894 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
14895 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
14896 add extra PLT entry for TLS descriptors.
14897 (Output_data_plt_x86_64::got_): New field.
14898 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
14899 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
14901 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
14903 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
14904 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
14905 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
14906 R_386_TLS_DESC_CALL relocations.
14907 (Target_x86_64::Scan::global): Likewise.
14908 (Target_x86_64::do_finalize_sections): Add dynamic table entries
14909 for TLS descriptors.
14910 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
14911 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
14912 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
14913 GD-to-IE relaxation.
14914 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
14915 and TLS_DESCRIPTORS.
14916 * Makefile.in: Rebuild.
14917 * configure: Rebuild.
14918 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
14919 (tls_test_shared2.so): New target.
14920 (tls_shared_gd_to_ie_test_SOURCES): New variable.
14921 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
14922 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
14923 (tls_shared_gd_to_ie_test_LDADD): New variable.
14924 (tls_shared_gnu2_gd_to_ie_test): New target.
14925 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
14927 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
14928 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
14929 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
14930 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
14931 (tls_shared_gnu2_test): New target.
14932 (tls_test_gnu2_shared.so): New target.
14933 (tls_shared_gnu2_test_SOURCES): New variable.
14934 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
14935 (tls_shared_gnu2_test_LDFLAGS): New variable.
14936 (tls_shared_gnu2_test_LDADD): New variable.
14937 * testsuite/Makefile.in: Rebuild.
14938 * testsuite/Makefile.
14940 2008-04-11 Ian Lance Taylor <iant@google.com>
14942 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
14944 * testsuite/Makefile.in: Rebuild.
14946 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
14948 * testsuite/script_test_2.cc (main): Adjust test.
14950 2008-04-11 David S. Miller <davem@davemloft.net>
14951 Ian Lance Taylor <iant@google.com>
14953 * options.h (General_options): Add entries for '-Y' and
14955 * options.cc (General_options:finalize): If -Y was used, add those
14956 entries to the library path instead of the default "/lib" and
14959 2008-04-11 David S. Miller <davem@davemloft.net>
14961 * testsuite/justsyms.t: Start at 0x100.
14962 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
14963 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
14965 * testsuite/script_test_2.cc: Adjust string and section length
14968 2008-04-09 Ian Lance Taylor <iant@google.com>
14971 * script-sections.cc (Sections_element::allocate_to_segment): Add
14973 (Output_section_definition::allocate_to_segment): Likewise.
14974 (Orphan_output_section::allocate_to_segment): Likewise.
14975 (Script_sections::attach_sections_using_phdrs_clause): Don't
14976 propagate non-PT_LOAD segments to orphan sections.
14977 * testsuite/Makefile.am (script_test_3.stdout): Generate using
14978 readelf rather than objdump.
14979 * testsuite/script_test_3.sh: Adjust accordingly. Test that
14980 .interp section and PT_INTERP segment are the same size.
14981 * testsuite/Makefile.in: Rebuild.
14983 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
14984 aliases for symbols defined in the same object.
14985 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
14986 (weak_alias_test_SOURCES): New variable.
14987 (weak_alias_test_DEPENDENCIES): New variable.
14988 (weak_alias_test_LDFLAGS): New variable.
14989 (weak_alias_test_LDADD): New variable.
14990 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
14991 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
14992 (weak_alias_test_3.o): New target.
14993 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
14994 * testsuite/weak_alias_test_main.cc: New file.
14995 * testsuite/weak_alias_test_1.cc: New file.
14996 * testsuite/weak_alias_test_2.cc: New file.
14997 * testsuite/weak_alias_test_3.cc: New file.
14999 2008-04-08 Ian Lance Taylor <iant@google.com>
15001 * options.h (class General_options): Add --noinhibit-exec option.
15002 * main.cc (main): Check --noinhibit-exec.
15004 * options.h (class General_options): Define --wrap as a special
15005 option. Add wrap_symbols_ field.
15006 (General_options::any_wrap_symbols): New function.
15007 (General_options::is_wrap_symbol): New function.
15008 * options.cc (General_options::parse_wrap): New function.
15009 (General_options::General_options): Initialize wrap_symbols_.
15010 * symtab.cc (Symbol_table::wrap_symbol): New function.
15011 (Symbol_table::add_from_object): Handle --wrap.
15012 * symtab.h (class Symbol_table): Declare wrap_symbol.
15013 * target.h (Target::wrap_char): New function.
15014 (Target::Target_info): Add wrap_char field.
15015 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15016 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15017 * testsuite/testfile.cc (Target_test::test_target_info):
15020 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15023 * layout.h (class Layout): Add added_eh_frame_data_ field.
15024 * layout.cc (Layout::Layout): Initialize new field.
15025 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15026 output section until we find a section we merged successfully.
15027 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15028 that the size be non-zero.
15030 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15033 2008-04-08 Craig Silverstein <csilvers@google.com>
15035 * configure.ac: Export new conditional variable HAVE_ZLIB.
15036 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15038 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15039 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15041 2008-04-07 Ian Lance Taylor <iant@google.com>
15043 * version.cc (version_string): Set to "1.5".
15045 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15046 Add issued_non_pic_error_ field. Declare check_non_pic.
15047 (Target_x86_64::Scan::check_non_pic): New function.
15048 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15049 (Target_x86_64::Scan::global): Likewise.
15051 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15052 addend parameter. Change caller. Handle merge sections.
15053 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15054 Address to Addend. Don't add in the result of
15055 local_section_offset, pass down the addend and use the returned
15057 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15058 Update declarations of local_section_offset and symbol_value.
15059 * testsuite/two_file_test_1.cc (t18): New function.
15060 * testsuite/two_file_test_2.cc (f18): New function.
15061 * testsuite/two_file_test_main.cc (main): Call t18.
15062 * testsuite/two_file_test.h (t18, f18): Declare.
15064 * configure.ac: Don't test for objdump, c++filt, or readelf.
15065 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15067 (TEST_READELF): New variable.
15068 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15069 (check_PROGRAMS): Add two_file_strip_test.
15070 (two_file_strip_test): New target.
15071 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15072 (two_file_same_shared_strip_test_SOURCES): New variable.
15073 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15074 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15075 (two_file_same_shared_strip_test_LDADD): New variable.
15076 (two_file_shared_strip.so): New target.
15077 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15078 (ver_test_5.syms, ver_test_7.syms): Likewise.
15079 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15080 (strip_test_3.stdout): Use TEST_OBJDUMP.
15081 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15083 2008-04-04 Cary Coutant <ccoutant@google.com>
15085 * symtab.h (Symbol::is_weak_undefined): New function.
15086 (Symbol::is_strong_undefined): New function.
15087 (Symbol::is_absolute): New function.
15088 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15089 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15091 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15092 (weak_undef_test): New target.
15093 * testsuite/Makefile.in: Rebuild.
15094 * testsuite/weak_undef_file1.cc: New file.
15095 * testsuite/weak_undef_file2.cc: New file.
15096 * testsuite/weak_undef_test.cc: New file.
15098 2008-04-03 Craig Silverstein <csilvers@google.com>
15100 * compressed_output.h (class Output_compressed_section): Use
15102 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15104 (zlib_compressed_suffix): Removed.
15105 (Output_compressed_section::set_final_data_size): Use unsigned
15107 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15108 Fix linker invocation.
15109 (flagstest_o_specialfile_and_compress_debug_sections):
15111 * testsuite/Makefile.in: Regenerated.
15113 2008-04-02 David S. Miller <davem@davemloft.net>
15115 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15116 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15118 2008-04-02 Craig Silverstein <csilvers@google.com>
15122 2008-04-02 Ian Lance Taylor <iant@google.com>
15124 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15125 parameters. Update for new key type to views_. Change all
15127 (File_read::read): Adjust for byteshift in returned view.
15128 (File_read::add_view): New function, broken out of
15129 find_and_make_view.
15130 (File_read::make_view): New function, broken out of
15131 find_and_make_view.
15132 (File_read::find_or_make_view): Add offset and aligned
15133 parameters. Rewrite accordingly. Change all callers.
15134 (File_read::get_view): Add offset and aligned parameters. Adjust
15135 for byteshift in return value.
15136 (File_read::get_lasting_view): Likewise.
15137 * fileread.h (class File_read): Update declarations.
15138 (class File_read::View): Add byteshift_ field. Add byteshift to
15139 constructor. Add byteshift method.
15140 * archive.h (Archive::clear_uncached_views): New function.
15141 (Archive::get_view): Add aligned parameter. Change all callers.
15142 * object.h (Object::get_view): Add aligned parameter. Change all
15144 (Object::get_lasting_view): Likewise.
15146 * fileread.cc (File_read::release): Don't call clear_views if
15147 there are multiple objects.
15148 * fileread.h (File_read::clear_uncached_views): New function.
15149 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15152 2008-03-31 Cary Coutant <ccoutant@google.com>
15154 Add thin archive support.
15155 * archive.cc (Archive::armagt): New const.
15156 (Archive::setup): Remove task parameter and calls to unlock.
15157 (Archive::unlock_nested_archives): New function.
15158 (Archive::read_header): Add nested_off parameter. Change
15160 (Archive::interpret_header): Likewise.
15161 (Archive::include_all_members): Change to handle thin
15163 (Archive::include_member): Likewise.
15164 * archive.h (Archive::Archive): Add new parameters and
15166 (Archive::armagt): New const.
15167 (Archive::setup): Remove task parameter.
15168 (Archive::unlock_nested_archives): New function.
15169 (Archive::read_header): Add nested_off parameter.
15170 (Archive::interpret_header): Likewise.
15171 (Archive::Nested_archive_table): New typedef.
15172 (Archive::is_thin_archive_): New field.
15173 (Archive::nested_archives_): New field.
15174 (Archive::options_): New field.
15175 (Archive::dirpath_): New field.
15176 (Archive::task_): New field.
15177 * readsyms.cc (Read_symbols::do_read_symbols): Add check
15178 for thin archives. Pass additional parameters to
15179 Archive::Archive. Unlock the archive file after calling
15182 2008-03-29 Ian Lance Taylor <iant@google.com>
15184 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
15185 version symbol to be local.
15186 * testsuite/ver_test_4.sh: New file.
15187 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
15188 (check_DATA): Add ver_test_4.syms.
15189 (ver_test_4.syms): New target.
15190 * testsuite/Makefile.in: Rebuild.
15193 (Output_section::Input_section_sort_entry::has_priority): New
15195 (Output_section::Input_section_sort_entry::match_file_name): New
15197 (Output_section::Input_section_sort_entry::match_section_name):
15199 (Output_section::Input_section_sort_entry::match_section_name_prefix):
15201 (Output_section::Input_section_sort_entry::match_section_file):
15203 (Output_section::Input_section_sort_compare::operator()): Rewrite
15204 using new Input_section_sort_entry functions. Sort crtbegin and
15205 crtend first. Sort sections with no priority before sections with
15207 * testsuite/initpri1.c (d3): Check j != 4.
15208 (cd5): New constructor/destructor function.
15209 (main): Check j != 2.
15211 * symtab.cc (Symbol_table::add_from_object): If we don't use the
15212 new symbol when resolving, don't call set_is_default.
15213 * testsuite/ver_test_7.cc: New file.
15214 * testsuite/ver_test_7.sh: New file.
15215 * testsuite/Makefile.am (ver_test_7.so): New target.
15216 (ver_test_7.o): New target.
15217 (check_SCRIPTS): Add ver_test_7.sh.
15218 (check_DATA): Add ver_test_7.syms.
15219 (ver_test_7.syms): New target.
15221 2008-03-28 Ian Lance Taylor <iant@google.com>
15223 * layout.cc (Layout::layout): If we see an input section with a
15224 name that needs sorting, set the must_sort flag for the output
15226 (Layout::make_output_section): If the name of the output section
15227 indicates that it might require sorting, set the may_sort flag.
15228 * output.h (Output_section::may_sort_attached_input_sections): New
15230 (Output_section::set_may_sort_attached_input_sections): New
15232 (Output_section::must_sort_attached_input_sections): New
15234 (Output_section::set_must_sort_attached_input_sections): New
15236 (class Output_section): Declare Input_section_sort_entry. Define
15237 Input_section_sort_compare. Declare
15238 sort_attached_input_sections. Add new fields:
15239 may_sort_attached_input_sections_,
15240 must_sort_attached_input_sections_,
15241 attached_input_sections_are_sorted_.
15242 * output.cc (Output_section::Output_section): Initialize new
15244 (Output_section::add_input_section): Add an entry to
15245 input_sections_ if may_sort or must_sort are true.
15246 (Output_section::set_final_data_size): Call
15247 sort_attached_input_sections if necessary.
15248 (Output_section::Input_section_sort_entry): Define new class.
15249 (Output_section::Input_section_sort_compare::operator()): New
15251 (Output_section::sort_attached_input_sections): New function.
15252 * configure.ac: Check whether the compiler supports constructor
15253 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
15254 * testsuite/initpri1.c: New file.
15255 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
15256 CONSTRUCTOR_PRIORITY.
15257 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
15258 (initpri1_LDFLAGS): New variable.
15259 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15261 2008-03-27 Ian Lance Taylor <iant@google.com>
15263 * common.cc (Sort_commons::operator): Correct sorting algorithm.
15264 * testsuite/common_test_1.c: New file.
15265 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
15266 (common_test_1_SOURCES): New variable.
15267 (common_test_1_DEPENDENCIES): New variable.
15268 (common_test_1_LDFLAGS): New variable.
15270 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
15271 and commons_ correctly when NAME/VERSION does not override
15273 * testsuite/ver_test_6.c: New file.
15274 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
15275 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
15276 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
15278 2008-03-26 Ian Lance Taylor <iant@google.com>
15280 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
15281 of an undefined symbol from a version script.
15282 * testsuite/Makefile.am (ver_test_5.so): New target.
15283 (ver_test_5.o): New target.
15284 (check_SCRIPTS): Add ver_test_5.sh.
15285 (check_DATA): Add ver_test_5.syms.
15286 (ver_test_5.syms): New target.
15287 * testsuite/ver_test_5.cc: New file.
15288 * testsuite/ver_test_5.script: New file.
15289 * testsuite/ver_test_5.sh: New file.
15290 * Makefile.in, testsuite/Makefile.in: Rebuild.
15293 Fix problems building gold with gcc 4.3.0.
15294 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
15295 (gold_error_at_location, gold_warning_at_location): Use it.
15296 * configure.ac: Check whether we can compile and use a template
15297 function with a printf attribute.
15298 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
15299 when jumping over bytes.
15300 * object.cc: Instantiate Object::read_section_data.
15301 * debug.h: Include <cstring>
15302 * dwarf_reader.cc: Include <algorithm>
15303 * main.cc: Include <cstring>.
15304 * options.cc: Include <cstring>.
15305 * output.cc: Include <cstring>.
15306 * script.cc: Include <cstring>.
15307 * script.h: Include <string>.
15308 * symtab.cc: Include <cstring> and <algorithm>.
15309 * target-select.cc: Include <cstring>.
15310 * version.cc: Include <string>.
15311 * testsuite/testmain.cc: Include <cstdlib>.
15312 * configure, config.in: Rebuild.
15314 2008-03-25 Ian Lance Taylor <iant@google.com>
15316 * options.cc: Include "../bfd/bfdver.h".
15317 (options::help): Print bug reporting address.
15319 * version.cc (print_version): Adjust output for current value of
15320 BFD_VERSION_STRING.
15324 * options.cc (options::help): Print list of supported targets.
15325 * target-select.h: Include <vector>.
15326 (class Target_selector): Make machine_, size_, and is_big_endian_
15327 fields const. Add bfd_name_ and instantiated_target_ fields.
15328 (Target_selector::Target_selector): Add bfd_name parameter.
15329 (Target_selector::recognize): Make non-virtual, call
15331 (Target_selector::recognize_by_name): Make non-virtual, call
15332 do_recognize_by_name.
15333 (Target_selector::supported_names): New function.
15334 (Target_selector::bfd_name): New function.
15335 (Target_selector::do_instantiate_target): New pure virtual
15337 (Target_selector::do_recognize): New virtual function.
15338 (Target_selector::do_recognize_by_name): New virtual function.
15339 (Target_selector::instantiate_target): New private function.
15340 (supported_target_names): Declare.
15341 * target-select.cc (Target_selector::Target_selector): Update for
15342 new parameter and fields.
15343 (select_target_by_name): Check that the name matches before
15344 calling recognize_by_name.
15345 (supported_target_names): New function.
15346 * i386.cc (class Target_selector_i386): Update Target_selector
15347 constructor call. Remove recognize and recognize_by_name. Add
15348 do_instantiate_target.
15349 * x86_64.cc (class Target_selector_x86_64): Likewise.
15350 * testsuite/testfile.cc (class Target_selector_test): Update for
15351 changes to Target_selector.
15353 * README: Rewrite, with some notes on unsupported features.
15355 2008-03-24 Cary Coutant <ccoutant@google.com>
15357 * i386.cc (Target_i386::Got_type): New enum declaration.
15358 (Target_i386::Scan::local): Updated callers of Output_data_got
15360 (Target_i386::Scan::global): Likewise.
15361 (Target_i386::Relocate::relocate): Likewise.
15362 (Target_i386::Relocate::relocate_tls): Likewise.
15363 * object.h (Got_offset_list): New class.
15364 (Sized_relobj::local_has_got_offset): Added got_type parameter.
15365 (Sized_relobj::local_got_offset): Likewise.
15366 (Sized_relobj::set_local_got_offset): Likewise.
15367 (Sized_relobj::local_has_tls_got_offset): Removed.
15368 (Sized_relobj::local_tls_got_offset): Removed.
15369 (Sized_relobj::set_local_tls_got_offset): Removed.
15370 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
15371 * output.cc (Output_data_got::add_global): Added got_type parameter.
15372 (Output_data_got::add_global_with_rel): Likewise.
15373 (Output_data_got::add_global_with_rela): Likewise.
15374 (Output_data_got::add_global_pair_with_rel): New function.
15375 (Output_data_got::add_global_pair_with_rela): New function.
15376 (Output_data_got::add_local): Added got_type parameter.
15377 (Output_data_got::add_local_with_rel): Likewise.
15378 (Output_data_got::add_local_with_rela): Likewise.
15379 (Output_data_got::add_local_pair_with_rel): New function.
15380 (Output_data_got::add_local_pair_with_rela): New function.
15381 (Output_data_got::add_global_tls): Removed.
15382 (Output_data_got::add_global_tls_with_rel): Removed.
15383 (Output_data_got::add_global_tls_with_rela): Removed.
15384 (Output_data_got::add_local_tls): Removed.
15385 (Output_data_got::add_local_tls_with_rel): Removed.
15386 (Output_data_got::add_local_tls_with_rela): Removed.
15387 * output.h (Output_data_got::add_global): Added got_type parameter.
15388 (Output_data_got::add_global_with_rel): Likewise.
15389 (Output_data_got::add_global_with_rela): Likewise.
15390 (Output_data_got::add_global_pair_with_rel): New function.
15391 (Output_data_got::add_global_pair_with_rela): New function.
15392 (Output_data_got::add_local): Added got_type parameter.
15393 (Output_data_got::add_local_with_rel): Likewise.
15394 (Output_data_got::add_local_with_rela): Likewise.
15395 (Output_data_got::add_local_pair_with_rel): New function.
15396 (Output_data_got::add_local_pair_with_rela): New function.
15397 (Output_data_got::add_global_tls): Removed.
15398 (Output_data_got::add_global_tls_with_rel): Removed.
15399 (Output_data_got::add_global_tls_with_rela): Removed.
15400 (Output_data_got::add_local_tls): Removed.
15401 (Output_data_got::add_local_tls_with_rel): Removed.
15402 (Output_data_got::add_local_tls_with_rela): Removed.
15403 * resolve.cc (Symbol::override_base_with_special): Removed
15404 reference to has_got_offset_ field.
15405 * symtab.cc (Symbol::init_fields): Replaced initialization
15406 of got_offset_ with got_offsets_. Removed initialization
15408 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
15409 (Symbol::got_offset): Likewise.
15410 (Symbol::set_got_offset): Likewise.
15411 (Symbol::has_tls_got_offset): Removed.
15412 (Symbol::tls_got_offset): Removed.
15413 (Symbol::set_tls_got_offset): Removed.
15414 (Symbol::got_offset_): Removed.
15415 (Symbol::tls_mod_got_offset_): Removed.
15416 (Symbol::tls_pair_got_offset_): Removed.
15417 (Symbol::got_offsets_): New field.
15418 (Symbol::has_got_offset): Removed.
15419 (Symbol::has_tls_mod_got_offset): Removed.
15420 (Symbol::has_tls_pair_got_offset): Removed.
15421 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
15422 (Target_x86_64::Scan::local): Updated callers of Output_data_got
15424 (Target_x86_64::Scan::global): Likewise.
15425 (Target_x86_64::Relocate::relocate): Likewise.
15426 (Target_x86_64::Relocate::relocate_tls): Likewise.
15428 2008-03-25 Ben Elliston <bje@au.ibm.com>
15430 * yyscript.y: Fix spelling error in comment.
15432 2008-03-24 Ian Lance Taylor <iant@google.com>
15434 * options.h (class General_options): Define build_id option.
15435 * layout.h (class Layout): Declare write_build_id, create_note,
15436 create_build_id. Add build_id_note_ member.
15437 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
15438 "libiberty.h", "md5.h", "sha1.h".
15439 (Layout::Layout): Initialize eh_frame_data_,
15440 eh_frame_hdr_section_, and build_id_note_.
15441 (Layout::finalize): Call create_build_id.
15442 (Layout::create_note): New function, broken out of
15443 Layout::create_gold_note.
15444 (Layout::create_gold_note): Call create_note.
15445 (Layout::create_build_id): New function.
15446 (Layout::write_build_id): New function.
15447 (Close_task_runner::run): Call write_build_id.
15449 * x86_64.cc: Correct license to GPLv3.
15451 2008-03-23 Ian Lance Taylor <iant@google.com>
15453 * options.cc: Include "demangle.h".
15454 (parse_optional_string): New function.
15455 (parse_long_option): Handle takes_optional_argument.
15456 (parse_short_option): Update dash_z initializer. Handle
15457 takes_optional_argument.
15458 (General_options::General_options): Initialize do_demangle_.
15459 (General_options::finalize): Set do_demangle_. Handle demangling
15461 * options.h (parse_optional_string): Declare.
15462 (struct One_option): Add optional_arg field. Update constructor.
15463 Update call constructor calls. Add takes_optional_argument
15465 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
15466 (DEFINE_optional_string): Define.
15467 (General_options::demangle): Change from DEFINE_bool to
15468 DEFINE_optional_string.
15469 (General_options::no_demangle): New function.
15470 (General_options::do_demangle): New function.
15471 (General_options::set_do_demangle): New function.
15472 (General_options::execstack_status_): Move definition to end of
15474 (General_options::static_): Likewise.
15475 (General_options::do_demangle_): New field.
15476 * object.cc (big_endian>::get_symbol_location_info): Call
15477 Options::do_demangle, not Options::demangle.
15478 * symtab.cc (demangle): Likewise.
15480 2008-03-22 Ian Lance Taylor <iant@google.com>
15482 * gold.h: Include <cstddef> and <sys/types.h>
15483 * options.h: Include <cstring>.
15485 2008-03-21 Ian Lance Taylor <iant@google.com>
15487 * Added source code to GNU binutils.
15489 Copyright (C) 2008-2013 Free Software Foundation, Inc.
15491 Copying and distribution of this file, with or without modification,
15492 are permitted in any medium without royalty provided the copyright
15493 notice and this notice are preserved.
15499 version-control: never