1 2015-02-09 Alan Modra <amodra@gmail.com>
3 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
4 plugin_test_thin.a and defsym_test.
5 * testsuite/Makefile.in: Regenerate.
7 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
9 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
12 2015-02-04 Peter Collingbourne <pcc@google.com>
14 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
15 forwarding symbols when computing symbol resolution info for plugins.
16 * plugin.h (Plugin_manager::symtab): New method.
17 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
19 2015-02-03 Cary Coutant <ccoutant@google.com>
20 Peter Collingbourne <pcc@google.com>
23 * archive.cc (Thin_archive_object_unlocker): New class.
24 (Archive::include_member): Unlock external members of thin archives.
25 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
26 (plugin_test_2): Likewise.
27 (plugin_test_3): Likewise.
28 (plugin_test_4): Likewise.
29 (plugin_test_5): Likewise.
30 (plugin_test_6): Likewise.
31 (plugin_test_7): Likewise.
32 (plugin_test_8): Likewise.
33 (plugin_test_9): Likewise.
34 (plugin_test_10): Likewise.
35 (plugin_test_11): New test case.
36 * testsuite/Makefile.in: Regenerate.
37 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
38 file to decide whether to claim file.
39 (all_symbols_read_hook): Likewise.
40 * testsuite/plugin_test_1.sh: Adjust expected output.
41 * testsuite/plugin_test_2.sh: Likewise.
42 * testsuite/plugin_test_3.sh: Likewise.
43 * testsuite/plugin_test_6.sh: Likewise.
44 * testsuite/plugin_test_tls.sh: Likewise.
45 * testsuite/plugin_test_11.sh: New testcase.
47 2015-02-03 Cary Coutant <ccoutant@google.com>
49 * descriptors.cc (Descriptors::open): Set artificially-low limit for
50 file descriptors when debugging enabled. Add debug output.
51 (Descriptors::release): Add debug output.
52 (Descriptors::close_some_descriptor): Likewise.
53 (Descriptors::close_all): Likewise.
54 * fileread.cc (File_read::lock): Likewise.
55 (File_read::unlock): Likewise.
57 2015-02-02 Cary Coutant <ccoutant@google.com>
59 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
60 executable output file.
62 2015-01-22 Han Shen <shenhan@google.com>
64 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
65 (Target_arm::do_plt_address_for_global): New method.
66 (Target_arm::do_plt_address_for_local): New method.
67 (Target_arm::rel_irelative_section): New method.
68 (Target_arm::make_data_plt): Add more parameters for plt ctor.
69 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
70 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
71 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
72 (Target_arm::Scan::check_non_pic): Add ifunc support.
73 (Target_arm::Scan::local): Add ifunc support.
74 (Target_arm::Scan::global): Add ifunc support.
75 (Target_arm::make_plt_section): New method.
76 (Target_arm::make_plt_entry): Change to call to make_plt_section.
77 (Target_arm::make_local_ifunc_plt_entry): New method.
78 (Target_arm::got_irelative_): New member.
79 (Target_arm::rel_irelative_): New member.
80 (Target_arm::got_section): Add creation for got_irelative_.
81 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
82 (Target_arm::Relocate::relocate): Properly set local ifunc address.
83 (Target_arm::do_dynsym_value): Properly set global ifunc address.
84 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
85 (Output_data_plt_arm::IRelative_data): New type.
86 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
87 (Output_data_plt_arm::add_entry): Add more parameters.
88 (Output_data_plt_arm::add_relocation): New method.
89 (Output_data_plt_arm::add_local_ifunc_entry): New method.
90 (Output_data_plt_arm::rel_irelative): New method.
91 (Output_data_plt_arm::entry_count): Modified.
92 (Output_data_plt_arm::address_for_global): New method.
93 (Output_data_plt_arm::address_for_local): New method.
95 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
96 (Output_data_plt_arm::insert_irelative_data): New method.
97 (Output_data_plt_arm::irelative_rel_): New member.
98 (Output_data_plt_arm::got_): New member.
99 (Output_data_plt_arm::got_irelative_): New member.
100 (Output_data_plt_arm::irelative_count_): New member.
101 (Output_data_plt_arm::IRelative_data_vec): New typedef.
102 (Output_data_plt_arm::irelative_data_vec_): New member.
103 (Output_data_plt_arm::do_write): Write out irelative entries.
104 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
105 more parameters to ctor.
106 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
107 more parameters to ctor.
108 * output.h (Output_data_reloc::add_local_relative): New method.
109 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
111 2015-01-29 Alan Modra <amodra@gmail.com>
113 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
114 and GOT_TLSGD to LE optimization.
116 2015-01-28 Cary Coutant <ccoutant@google.com>
118 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
119 for undef TLS symbols.
120 (Target_x86_64::Relocate::relocate_tls): Likewise.
121 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
123 2015-01-25 Cary Coutant <ccoutant@google.com>
125 * output.cc (Output_segment::set_section_addresses): Fix calculation
126 of size of relro segment.
128 2015-01-22 Alan Modra <amodra@gmail.com>
130 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
131 condition for need of ifunc plt entry.
132 (Target_powerpc::Scan::global <got relocs>): Likewise.
134 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
136 * mips.cc (reloc_high): Add r_sym.
137 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
138 reloc_high constructor.
139 (Mips_relocate_functions::relgot16_local): Likewise.
140 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
141 r_type to decide whether LO16 matches HI16.
142 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
143 rello16 and relgot16_local.
145 2015-01-09 Cary Coutant <ccoutant@google.com>
147 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
148 unless alignment is larger than page size.
150 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
151 Cary Coutant <ccoutant@google.com>
154 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
155 (DEFAULT_TARGET_X32): Set for x32.
156 * x86_64.cc (cmp_insn_32): New.
157 (lea_r10_insn_32): Likewise.
158 (lea_r11_insn_32): Likewise.
159 (cmp_insn_64): Likewise.
160 (lea_r10_insn_64): Likewise.
161 (lea_r11_insn_64): Likewise.
162 (Target_x86_64<size>::do_calls_non_split): Handle x32.
163 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
164 (check_DATA): Add split_x32 files.
165 (split_x32_[1234n].o): New targets.
166 (split_x32_[124]): New targets.
167 (split_x32_[1234r].stdout): New targets.
168 * testsuite/split_x32.sh: New file.
169 * testsuite/split_x32_1.s: Likewise.
170 * testsuite/split_x32_2.s: Likewise.
171 * testsuite/split_x32_3.s: Likewise.
172 * testsuite/split_x32_4.s: Likewise.
173 * testsuite/split_x32_n.s: Likewise.
174 * configure: Regenerated.
175 * testsuite/Makefile.in: Likewise.
177 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
180 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
183 2015-01-02 Alan Modra <amodra@gmail.com>
185 * version.cc (print_version): Just print current year.
186 * dwp.cc (print_version): Likewise.
188 2015-01-01 Alan Modra <amodra@gmail.com>
190 Update year range in copyright notice of all files.
192 2014-12-25 Alan Modra <amodra@gmail.com>
194 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
196 (Target_arm::merge_object_attributes, ): Likewise.
198 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
200 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
201 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
202 AEABI_VFP_args_vfp to check that.
203 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
204 value and replace hardcoded values by enum values.
206 2014-12-22 Cary Coutant <ccoutant@google.com>
208 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
210 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
213 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
214 to "return i * i * 3;".
216 2014-12-16 Cary Coutant <ccoutant@google.com>
218 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
219 (Mapfile::print_output_data): Use current_data_size() to avoid
220 assert for sections requiring postprocessing; if address is not valid,
222 (Mapfile::print_output_section): Use current_data_size(); print note
223 that addresses and sizes are before compression.
225 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
227 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
228 Cast current_group_size to unsigned long when reporting error.
230 2014-12-10 Jing Yu <jingyu@google.com>
232 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
233 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
234 Update error message.
235 (Target_aarch64::do_relax): Use absolute value of option
236 stub_group_size. Replace local variable with class member
239 2014-12-04 Alan Modra <amodra@gmail.com>
241 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
242 addend of PLTREL24 reloc when not generating a plt stub. Make
243 max_branch_offset an "Address".
244 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
245 (Target_powerpc::Relocate::relocate): Likewise.
247 2014-12-04 Alan Modra <amodra@gmail.com>
250 * symtab.cc (Symbol::set_undefined): Remove assertion.
251 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
252 on symbols defined in discarded sections, instead return false.
253 Rearrange params, update all callers.
254 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
255 branches to syms in discarded sections.
256 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
257 undefined and flag as discarded.
258 (Target_powerpc::Relocate::relocate): Localize variable.
260 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
263 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
264 * testsuite/Makefile.in: Regenerated.
266 2014-12-03 Alan Modra <amodra@gmail.com>
269 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
270 when adding dynamic relocations against section symbols.
272 2014-12-01 Dimitry Ivanov <dimitry@google.com>
274 * layout.cc (Layout::finish_dynamic_section): When '-z global'
275 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
276 * options.h (General_options): New -z option (global).
278 2014-12-01 Cary Coutant <ccoutant@google.com>
281 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
283 (Layout::create_executable_stack_info): Warn when -z noexecstack is
284 given but some inputs require executable stack.
286 2014-11-26 Cary Coutant <ccoutant@google.com>
288 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
289 .debug_str_offsets; strip .debug_gnu_pubnames and
291 (lines_only_debug_sections): Strip all four new sections.
293 2014-11-26 Jing Yu <jingyu@google.com>
295 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
296 register to be x0 when to relax TLSDESC_LD64_LO12.
298 2014-11-26 Alan Modra <amodra@gmail.com>
300 * powerpc.cc (struct Stub_table_owner): New.
301 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
302 unsigned int vector. Update all references.
303 (powerpc_relobj::set_stub_table): Take an unsigned int param
304 rather than a Stub_table. Update callers.
305 (Powerpc_relobj::clear_stub_table): New function.
306 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
307 stub_group_size_ vars.
308 (Target_powerpc::new_stub_table): Delete.
309 (max_branch_delta): New function, extracted from..
310 (Target_powerpc::Relocate::relocate): ..here..
311 (Target_powerpc::Branch_info::make_stub): ..and here. Return
312 status on whether stub created successfully.
313 (Stub_control::Stub_control): Add "no_size_errors" param. Move
315 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
316 reduce on relax failure.
317 (Target_powerpc::group_sections): Add "no_size_errors" param.
318 Use stub_group_size_. Set up group info in a temp vector,
319 before building Stub_table vector. Account for input sections
320 possibly already converted to relaxed sections.
321 (Stub_table::init): Delete. Merge into..
322 (Stub_table::Stub_table): ..here.
323 (Stub_table::can_reach_stub): New function.
324 (Stub_table::add_plt_call_entry): Add "from" parameter and
325 return true iff stub could be reached.
326 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
328 (Stub_table::clear_stubs): Add "all" param.
330 2014-11-26 Alan Modra <amodra@gmail.com>
332 * powerpc.cc (Stub_control::set_output_and_owner): New function.
333 (Target_powerpc::group_sections): Use it.
335 2014-11-25 Cary Coutant <ccoutant@google.com>
337 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
338 (Binary_to_elf::write_symbol): Add st_size parameter.
339 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
341 2014-11-25 Cary Coutant <ccoutant@google.com>
344 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
345 (Sized_relobj_file::do_layout): Handle deferred sections properly
346 during GC pass 1. Don't add reloc sections to deferred list twice.
347 * object.h (Sized_relobj_file::is_deferred_layout): New function.
348 (Sized_relobj_file::is_deferred_layout_): New data member.
350 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
353 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
354 Check PC-relative offset overflow in PLT entry.
356 2014-11-21 Alan Modra <amodra@gmail.com>
358 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
361 2014-11-20 Alan Modra <amodra@gmail.com>
363 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
364 from --stub-group-size parameter divided by 1024.
365 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
366 template parameter. Update all uses.
367 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
368 has_stub_value. Set for long branches. Don't report overflow for
369 branch to undefined weak symbols. Print info message on
370 overflowing branch to stub.
372 2014-11-20 Alan Modra <amodra@gmail.com>
374 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
376 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
378 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
379 entry for R_X86_64_GOTPLT64.
380 (Target_x86_64<size>::Relocate::relocate): Update comments for
383 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
385 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
386 * plugin.h: add lock definition
388 2014-10-29 Han Shen <shenhan@google.com>
389 Jing Yu <jingyu@google.com>
391 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
392 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
393 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
395 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
397 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
398 (Target_aarch64::tls_ld_to_le): New method.
399 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
401 (Output_data_plt_aarch64::irelative_rel_): New data member.
402 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
403 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
404 (Output_data_plt_aarch64::add_relocation): New method.
405 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
406 offset. Add got_irelative size to got size.
407 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
408 type string with the new typename.
409 (AArch64_relocate_functions::update_adr): Replace parameter x with
411 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
412 (AArch64_relocate_functions::reloc_common): New method.
413 (AArch64_relocate_funcsions::rela_general): Extract common part out
414 into reloc_common method.
415 (AArch64_relocate_functions::rela_general): Likewise.
416 (AArch64_relocate_functions::pcrela_general): Likewise.
417 (AArch64_relocate_functions::adr): New method.
418 (AArch64_relocate_functions::adrp): Calculate immed before calling
420 (AArch64_relocate_functions::adrp): Likewise.
421 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
422 comparing x to 0. Calculate immed from ~x when x < 0.
423 (Target_aarch64::optimize_tls_reloc): Add new cases for
424 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
425 TLSLD_MOVW_DTPREL_G0_NC.
426 (Target_aarch64::possible_function_pointer_reloc): Implement this
428 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
430 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
431 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
432 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
433 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
434 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
435 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
436 (Target_aarch64::make_plt_entry): Call add_entry with two more
438 (Target_aarch64::make_local_ifunc_plt_entry): New method.
439 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
440 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
441 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
442 (Target_aarch64::Relocate::relocate_tls): Add cases for
443 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
444 TLSLD_MOVW_DTPREL_G0_NC.
445 * testsuite/icf_safe_so_test.cc: Correct test comment.
446 * testsuite/icf_safe_test.sh: Add AArch64 arch.
448 2014-10-22 Alan Modra <amodra@gmail.com>
450 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
453 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
455 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
457 2014-10-17 Cary Coutant <ccoutant@google.com>
459 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
460 Add "typename" keyword.
462 2014-10-15 Han Shen <shenhan@google.com>
463 Jing Yu <jingyu@google.com>
465 Patch for gold aarch64 backend to support relaxation.
466 * aarch64-reloc.def: Change format.
467 * aarch64.cc (class Reloc_stub): New class.
468 (class Stub_table): New class.
469 (class AArch64_relobj): New class.
470 (class AArch64_input_section): New class.
471 (class AArch64_output_section): New class.
472 (Target_aarch64::new_stub_table): New method.
473 (Target_aarch64::new_aarch64_input_section): New method.
474 (Target_aarch64::find_aarch64_input_section): New method.
475 (Target_aarch64::scan_section_for_stubs): New method.
476 (Target_aarch64::scan_reloc_section_for_stubs): New method.
477 (Target_aarch64::relocate_stub): New method.
478 (Target_aarch64::current_target): New method.
479 (Target_aarch64::do_make_elf_object): New method.
480 (Target_aarch64::do_may_relax): New method.
481 (Target_aarch64::do_relax): New method.
482 (Target_aarch64::group_sections): New method.
483 (Target_aarch64::scan_reloc_for_stub): New method.
484 (Target_aarch64::do_make_output_section): New method.
485 (Target_aarch64::stub_tables_): New data member.
486 (Target_aarch64::aarch64_input_section_map_): New data member.
487 (AArch64_relocate_functions::maybe_apply_stub): New method.
489 2014-09-30 Cary Coutant <ccoutant@google.com>
492 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
494 2014-09-30 Kito Cheng <kito@0xlab.org>
497 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
498 hash table before sysv-style hash table.
500 2014-09-29 Sriraman Tallam <tmsriram@google.com>
502 * options.h (--pic-executable): Add negative to alias to -no-pie.
504 2014-09-26 Cary Coutant <ccoutant@google.com>
507 * object.cc (Sized_relobj_file): Compute value of section symbols
508 for TLS sections the same as TLS symbols.
510 2014-09-25 Cary Coutant <ccoutant@google.com>
513 * resolve.cc (Symbol_table::resolve): Override common placeholder
514 symbols, but adjust sizes.
515 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
516 symbols to common lists.
518 2014-09-24 Alan Modra <amodra@gmail.com>
520 * po/POTFILES.in: Regenerate.
522 2014-09-23 Taiju Tsuiki <tzik@google.com>
523 Cary Coutant <ccoutant@google.com>
526 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
527 on input_sections_blocker.
528 * layout.cc (Write_sections_task::locks): Unblock
529 input_sections_blocker_.
530 * layout.h (Write_sections_task::Write_sections_task): Add
531 input_sections_blocker.
532 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
534 * testsuite/Makefile.in: Regenerate.
536 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
538 * testsuite/Makefile.am (plugin_test_10): New test.
539 * testsuite/Makefile.in: Regenerate
540 * testsuite/plugin_common_test_2.c (c1): Align to 8.
541 * testsuite/plugin_test_10.sh: New file.
543 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
545 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
546 * resolve.cc (Symbol_table::resolve): Don't override common symbols
547 during the replacement phase.
549 2014-09-17 Han Shen <shenhan@google.com>
550 Jing Yu <jingyu@google.com>
552 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
553 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
554 * aarch64.cc (Target_aarch64): Add data members
555 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
556 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
558 (Target_aarch64::do_reloc_symbol_index): New method.
559 (Target_aarch64::do_reloc_addend): New method.
560 (Target_aarch64::add_tlsdesc_info): New method.
561 (Target_aarch64::do_dynsym_value): New method.
562 (Target_aarch64::do_make_data_plt): Add new parameters: got,
563 got_irelative. Pass them to Output_data_plt_aarch64_standard.
564 (Target_aarch64::make_data_plt): Add new parameters: got,
565 got_irelative. Pass them to do_make_data_plt.
566 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
567 (Target_aarch64::Relocate:tls_gd_to_le): New method.
568 (Target_aarch64::Relocate:tls_ie_to_le): New method.
569 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
570 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
571 (Target_aarch64::got_tlsdesc_section): New method.
572 (Target_aarch64::make_local_ifunc_plt_entry): New method.
573 (Target_aarch64::define_tls_base_symbol): New method.
574 (Target_aarch64::reserve_tlsdesc_entries): New method.
575 (Target_aarch64::got_mod_index_entry): New method.
576 (Target_aarch64::rela_tlsdesc_section): New method.
577 (Target_aarch64::rela_irelative_section): New method.
578 (Target_aarch64::Tlsdesc_info): New struct.
579 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
580 relocations and tlsdesc relocations.
581 (Target_aarch64::optimize_tls_reloc): Implement method.
582 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
583 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
585 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
586 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
587 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
588 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
589 (Output_data_plt_aarch64::rela_tlsdesc): New method.
590 (Output_data_plt_aarch64::rela_irelative): New method.
591 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
592 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
593 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
594 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
595 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
596 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
597 (Output_data_plt_aarch64_standard): New member variables:
598 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
599 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
600 New parameter: got, got_irelative.
601 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
602 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
603 (Output_data_plt_aarch64::do_write): Replace got_address with
604 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
605 (AArch64_relocate_functions::update_movnz): New method.
606 (AArch64_relocate_functions): Correct format.
607 (AArch64_relocate_functions::movnz): New method.
608 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
609 before the switch. Add new cases to switch.
610 Check ie_to_le relaxation on tlsie relocations. Add code handling
612 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
613 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
614 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
615 Call reloc_name_in_error_message to print unsupported reloc.
616 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
618 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
619 relocs. Fill in some more dynamic tags.
620 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
621 Skip call tls_get_addr when tlsgd is relaxed.
622 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
623 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
624 tlsdesc->ie relaxation.
626 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
628 * mips.cc (Target_mips_nacl): New class.
629 (Target_selector_mips_nacl): New class.
630 (target_selector_mips32): Rename from target_selector_mips32be and use
631 Target_selector_mips_nacl instead of Target_selector_mips.
632 (target_selector_mips32el): Rename from target_selector_mips32 and use
633 Target_selector_mips_nacl instead of Target_selector_mips.
634 (target_selector_mips64): Rename from target_selector_mips64be and use
635 Target_selector_mips_nacl instead of Target_selector_mips.
636 (target_selector_mips64el): Rename from target_selector_mips64 and use
637 Target_selector_mips_nacl instead of Target_selector_mips.
638 (Target_mips::mips_info): Add const attribute.
640 2014-09-02 Cary Coutant <ccoutant@google.com>
642 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
643 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
644 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
645 (Sized_incr_dynobj::do_section_name): Likewise.
646 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
647 (Sized_incr_dynobj::do_section_name): Likewise.
648 * object.h (Object::section_name): Likewise.
649 (Object::do_section_name): Likewise.
650 (Sized_relobj_file::do_section_name): Likewise.
651 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
652 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
654 2014-09-02 Cary Coutant <ccoutant@google.com>
657 * ehframe.cc (Fde::write): Add output_offset parameter.
658 (Cie::write): Likewise.
659 (Eh_frame::set_final_data_size): Account for offset within output
661 (Eh_frame::do_sized_write): Likewise.
662 * ehframe.h (Fde::write): Add output_offset parameter.
663 (Cie::write): Likewise.
664 * output.cc (Output_section::Input_section_sort_entry): Remove
665 section_has_name_; add output_section_name parameter. Use
666 output section name for non-input sections.
667 (Output_section::Input_section_sort_entry::section_has_name): Remove.
668 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
669 (Output_section::Input_section_sort_compare): Remove logic for
670 sections without names.
671 (Output_section::Input_section_sort_init_fini_compare): Likewise.
672 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
674 (Output_section::Input_section_sort_section_name_compare): Likewise.
676 2014-08-29 Han Shen <shenhan@google.com>
677 Jing Yu <jingyu@google.com>
679 * aarch64-reloc-property.cc
680 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
681 reference reloc property in the table.
682 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
684 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
685 2 new overloaded methods.
686 (Output_data_got_aarch64::do_write): Add code to write out
688 (class Output_data_got_aarch64::Static_reloc): New class to wrap
690 (Output_data_got_aarch64::static_relocs): New vector to
692 (Target_aarch64::TCB_SIZE): New const static memeber.
693 (Target_aarch64::tcb_size): New method.
694 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
695 (Target_aarch64::Relocate::relocate_tls): New method.
696 (Target_aarch64::Scan::local): Add code handling new reloc types.
697 (Target_aarch64::Scan::global): Add code handling new reloc types.
699 2014-08-13 Sriraman Tallam <tmsriram@google.com>
701 * options.h (-no-pie): Add option.
703 2014-08-08 Jing Yu <jingyu@google.com>
704 Han Shen <shenhan@google.com>
706 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
707 (DEFFILES): add aarch64-reloc.def.
708 (TARGETSOURCES): Add aarch64-reloc-property.cc.
709 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
710 * Makefile.in: Regenerate.
711 * aarch64-reloc-property.cc: New file.
712 * aarch64-reloc-property.h: New file.
713 * aarch64-reloc.def: New file.
714 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
715 with tab to make the format consistent.
716 (Output_data_got_aarch64::symbol_table_): New method.
717 (Target_aarch64::do_plt_address_for_global): New method.
718 (Target_aarch64::do_plt_address_for_local): New method.
719 (Target_aarch64::do_select_as_default_target): New method.
720 (Target_aarch64::do_make_data_plt): New method.
721 (Target_aarch64::make_data_plt): New method.
722 (Output_data_plt_aarch64::has_irelative_section): New method.
723 (Output_data_plt_aarch64::address_for_global): New method.
724 (Output_data_plt_aarch64::address_for_local): New method.
725 (Output_data_plt_aarch64::irelative_rel_): New parameter.
726 (Output_data_plt_aarch64::add_entry): Implement contents.
727 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
728 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
729 the got_pov entry to plt0.
730 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
732 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
733 (AArch64_howto): New struct.
734 (aarch64_howto[]): New static const array.
735 (AArch64_relocate_functions): New class.
736 (Target_aarch64::Scan::get_reference_flags): Remove method.
737 (Target_aarch64::Scan::local): Implement to support a few relocations.
738 (Target_aarch64::Scan::global): Implement to support a few relocations.
739 (Target_aarch64::make_plt_section): Implement contents.
740 (Target_aarch64::make_plt_entry): Implement contents.
741 (Target_aarch64::do_finalize_sections): Implement contents.
742 (Target_aarch64::Relocate::relocate): Implement a few relocations.
743 (Target_aarch64::relocate_section): Implement contents.
745 2014-08-06 Alan Modra <amodra@gmail.com>
747 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
749 2014-08-06 Alan Modra <amodra@gmail.com>
752 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
754 2014-07-21 Sriraman Tallam <tmsriram@google.com>
756 * object.cc (Relobj::is_section_name_included): Add
757 ".rodata.nptl_version" to not garbage collect this section.
759 2014-07-08 Cary Coutant <ccoutant@google.com>
761 * expression.cc (struct Expression::Expression_eval_info): Add
762 new fields type_pointer, vis_pointer, and nonvis_pointer.
763 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
764 nonvis_pointer parameters. Adjust all calls.
765 (Symbol_expression::value): Update type, visibility, and nonvis bits
767 * script.cc (Symbol_assignment::sized_finalize): Update type,
768 visibility, and remaining st_other bits for new symbol.
769 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
770 vis_pointer, and nonvis_pointer parameters.
771 * symtab.h (Symbol::set_type): New method.
773 * testsuite/Makefile.am (defsym_test): New test.
774 * testsuite/Makefile.in: Regenerate.
775 * testsuite/defsym_test.c: New file.
776 * testsuite/defsym_test.sh: New file.
778 2014-07-08 Cary Coutant <ccoutant@google.com>
781 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
782 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
783 (Sized_dynobj::base_read_symbols): ...new method.
784 * object.h (Sized_relobj_file::base_read_symbols): New method.
785 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
786 (Sized_relobj_file::base_read_symbols): ...new method.
787 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
788 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
789 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
791 2014-07-04 Alan Modra <amodra@gmail.com>
793 * po/POTFILES.in: Regenerate.
795 2014-07-02 Jing Yu <jingyu@google.com>
797 * aarch64.cc: New file
798 * Makefile.am (TARGETSOURCES): Add aarch64.cc
799 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
800 * Makefile.in: Regenerate.
801 * configure.tgt: Add entries for aarch64*.
802 * configure.ac: Likewise.
803 * configure: Likewise.
805 2014-06-27 Alan Modra <amodra@gmail.com>
807 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
809 2014-06-24 Cary Coutant <ccoutant@google.com>
811 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
813 (Dwo_file::sized_read_unit_index): Likewise.
815 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
818 * Makefile.am (TARGETSOURCES): Add mips.cc
819 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
820 * configure.tgt: Add entries for mips*.
821 * configure.ac: Likewise.
822 * Makefile.in: Regenerate.
823 * configure: Likewise.
825 2014-06-09 Cary Coutant <ccoutant@google.com>
827 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
828 unit_length is within section bounds.
830 2014-06-09 Cary Coutant <ccoutant@google.com>
833 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
836 2014-06-07 Alan Modra <amodra@gmail.com>
838 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
840 2014-06-06 Cary Coutant <ccoutant@google.com>
842 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
843 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
844 (Dwarf_pubnames_table::read_header): Likewise.
845 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
848 2014-06-05 Joel Brobecker <brobecker@adacore.com>
850 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
851 * Makefile.in, configure: Regenerate.
853 2014-06-03 Alan Modra <amodra@gmail.com>
855 * powerpc.cc (addis_12_2): Define.
856 (Stub_table::do_write): Support fusion on ELFv2 stubs.
858 2014-06-03 Alan Modra <amodra@gmail.com>
860 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
863 2014-06-02 Alan Modra <amodra@gmail.com>
865 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
866 Only ignore relocs on ELFv1.
867 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
869 2014-05-30 Cary Coutant <ccoutant@google.com>
871 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
872 * testsuite/Makefile.in: Regenerate.
873 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
875 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
878 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
879 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
881 2014-05-15 Alan Modra <amodra@gmail.com>
883 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
884 Compare FDE contents with DW_CFA_nop rather than 0.
886 2014-05-13 Sriraman Tallam <tmsriram@google.com>
888 * symtab.h (may_need_copy_reloc): Remove check for position independent
890 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
891 position independence before pc absolute may_need_copy_reloc call.
892 Add check for executable output befor pc relative may_need_copy_reloc
898 * powerpc.cc: Add check for no position independence before
899 may_need_copy_reloc calls.
900 * testsuite/pie_copyrelocs_test.cc: New file.
901 * testsuite/pie_copyrelocs_shared_test.cc: New file.
902 * Makefile.am (pie_copyrelocs_test): New test.
903 * Makefile.in: Regenerate.
905 2014-05-08 Martin Liška <mliska@suse.cz>
907 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
909 2014-05-06 Cary Coutant <ccoutant@google.com>
912 * i386.cc (Output_data_got_plt_i386): New class.
913 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
914 parameter. Change all callers.
915 (Output_data_plt_i386::layout_): Remove.
916 (Output_data_plt_i386::got_plt_): Change type.
917 (Target_i386::got_plt_): Change type. Change all references.
918 (Target_i386::got_section): Create instance of new class.
919 (Output_data_got_plt_i386::do_write): New function.
920 * x86_64.cc (Output_data_got_plt_x86_64): New class.
921 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
922 parameter. Change all callers.
923 (Output_data_plt_x86_64::layout_): Remove.
924 (Output_data_plt_x86_64::got_plt_): Change type.
925 (Target_x86_64::got_plt_): Change type. Change all references.
926 (Target_x86_64::got_section): Create instance of new class.
927 (Output_data_got_plt_x86_64::do_write): New function.
928 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
929 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
932 2014-05-05 Cary Coutant <ccoutant@google.com>
934 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
935 if we have pubnames/pubtypes.
937 2014-05-02 Cary Coutant <ccoutant@google.com>
939 * defstd.cc (in_segment): Define __ehdr_start here...
940 * layout.cc (Layout::finalize): ...Instead of here. Set the
941 output segment when known.
942 * resolve.cc (Symbol::override_base_with_special): Remember
943 the original binding.
944 * symtab.cc (Symbol::set_output_segment): New function.
945 (Symbol::set_undefined): New function.
946 * symtab.h (Symbol::is_weak_undefined): Check original undef
948 (Symbol::is_strong_undefined): New function.
949 (Symbol::set_output_segment): New function.
950 (Symbol::set_undefined): New function.
951 * target-reloc.h (is_strong_undefined): Remove.
952 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
953 Check for hidden undefs.
954 (relocate_section): Call Symbol::is_strong_undefined.
956 * testsuite/Makefile.am (ehdr_start_test_1)
957 (ehdr_start_test_2, ehdr_start_test_3)
958 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
959 * testsuite/Makefile.in: Regenerate.
960 * testsuite/ehdr_start_def.cc: New source file.
961 * testsuite/ehdr_start_test.cc: New source file.
962 * testsuite/ehdr_start_test.t: New linker script.
963 * testsuite/ehdr_start_test_4.sh: New shell script.
965 2014-04-23 Cary Coutant <ccoutant@google.com>
968 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
970 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
972 * layout.cc (Layout::include_section): Allow a target to decide
973 whether to include a section.
974 * target.h (Target::should_include_section): New function.
975 (Target::do_should_include_section): New function.
977 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
979 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
981 (Copy_relocs::emit): ... here.
982 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
983 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
984 (Copy_reloc_entry::entries_): Change from private to protected.
986 2014-04-02 Sriraman Tallam <tmsriram@google.com>
988 * icf.cc (get_section_contents): Replace copies of reloc
989 vectors with const references.
991 2014-04-02 Cary Coutant <ccoutant@google.com>
993 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
994 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
995 * configure: Regenerate.
996 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
997 -fno-use-linker-plugin.
998 (LINK1, CXXLINK1): Add it to the link command.
999 * testsuite/Makefile.in: Regenerate.
1001 2014-03-12 Alan Modra <amodra@gmail.com>
1003 * Makefile.in: Regenerate.
1005 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1007 * symtab.h (Symbol::set_nonvis): New function.
1009 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1011 * symtab.cc (Sized_symbol<32>::init_output_data):
1012 Instantiate the template.
1013 (Sized_symbol<64>::init_output_data): Likewise.
1015 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1017 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1018 adjust dynamic symbol value.
1019 * target.h (Target::adjust_dyn_symbol): New function.
1020 (Target::do_adjust_dyn_symbol): New function.
1022 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1024 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1025 Get the value of DYNAMIC_CUSTOM dynamic entry.
1026 * output.h (Output_data_dynamic::add_custom): New function.
1027 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1029 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1030 * target.h (Target::dynamic_tag_custom_value): New function.
1031 (Target::do_dynamic_tag_custom_value): New function.
1033 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1035 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1037 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1038 (Target::do_has_custom_set_dynsym_indexes): New function.
1039 (Target::set_dynsym_indexes): New function.
1040 (Target::do_set_dynsym_indexes): New function.
1042 2014-03-07 Alan Modra <amodra@gmail.com>
1044 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1045 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1046 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1047 (Powerpc_relocate_functions::has_overflow_bitfield,
1048 overflowed): Use the above.
1049 (Target_powerpc::Relocate::relocate): Correct overflow checking
1050 for a number of relocations. Modify overflow test for 16-bit
1051 fields in instructions to signed/unsigned according to whether
1052 the field takes a signed or unsigned value.
1054 2014-03-05 Alan Modra <amodra@gmail.com>
1056 Update copyright years.
1058 2014-03-05 Alan Modra <amodra@gmail.com>
1060 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1061 R_PPC64_ADDR64_LOCAL.
1062 (Target_powerpc::Relocate::relocate): Likewise.
1064 2014-03-03 Alan Modra <amodra@gmail.com>
1066 * dwp.cc (print_version): Update copyright year to current.
1068 2014-02-10 Alan Modra <amodra@gmail.com>
1070 * po/gold.pot: Regenerate.
1072 2014-02-06 Cary Coutant <ccoutant@google.com>
1074 Fix problem where -u is ignored when a weak undef is seen.
1076 * archive.cc (Library_base::should_include_member): Reorder
1077 code to check for -u option if a weak undef has already been seen.
1078 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1079 * testsuite/Makefile.in: Regenerate.
1080 * testsuite/weak_undef_file3.cc: New file.
1081 * testsuite/weak_undef_file4.cc: New file.
1082 * testsuite/weak_undef_test_2.cc: New file.
1084 2014-02-05 Cary Coutant <ccoutant@google.com>
1086 Fix issues with gold undefined symbol diagnostics.
1089 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1091 * target-reloc.h (is_strong_undefined): New function.
1092 (relocate_section): Move undef vtable symbol check from here.
1093 Check for is_strong_undefined.
1095 2014-02-05 Cary Coutant <ccoutant@google.com>
1097 Fix problems with the --dynamic-list option.
1100 * options.cc (General_options::parse_dynamic_list):
1101 Set have_dynamic_list_.
1102 (General_options::General_options): Initialize have_dynamic_list_.
1103 (General_options::finalize): Turn off -Bsymbolic and
1104 -Bsymbolic-functions if --dynamic-list provided.
1105 * options.h (General_options::have_dynamic_list): New function.
1106 (General_options::have_dynamic_list_): New data member.
1107 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1111 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1112 in --dynamic-list, mark it.
1114 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1115 (dynamic_list_2): New test case.
1116 * testsuite/Makefile.in: Regenerate.
1117 * testsuite/dynamic_list_2.cc: New file.
1118 * testsuite/dynamic_list_2.t: New file.
1119 * testsuite/dynamic_list_lib1.cc: New file.
1120 * testsuite/dynamic_list_lib2.cc: New file.
1121 * testsuite/gc_dynamic_list_test.c: New file.
1122 * testsuite/gc_dynamic_list_test.sh: New file.
1123 * testsuite/gc_dynamic_list_test.t: New file.
1125 2014-01-28 Cary Coutant <ccoutant@google.com>
1127 Add .gdb_index version 7 support.
1129 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1130 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1132 (Dwarf_ranges_table::read_ranges_table): Likewise.
1133 (Dwarf_pubnames_table::read_section): Check for GNU-style
1134 sections, and for compressed debug sections.
1135 (Dwarf_pubnames_table::read_header): Compute end address of table.
1136 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1137 for end of list by offset, not by offset == 0.
1138 (Dwarf_info_reader::do_read_string_table): Check for compressed
1140 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1141 Initialize new data members.
1142 (Dwarf_pubnames_table::next_name): return flag_byte.
1143 (Dwarf_pubnames_table::end_of_table_): New data member.
1144 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1145 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1146 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1147 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1148 read skeleton type unit DIEs.
1149 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1150 (Gdb_index::do_write): Write flag_byte.
1151 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1152 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1153 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1154 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1156 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1158 * version.cc (print_version): Update copyright year to 2014.
1160 2013-12-19 Dimitry Andric <dimitry@andric.com>
1162 * stringpool.cc (Stringpool_template::reserve): Add
1163 HAVE_UNORDERED_MAP case.
1164 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1166 2013-12-18 Cary Coutant <ccoutant@google.com>
1168 * configure.ac: Check for <unordered_set> and <unordered_map>.
1169 * config.in: Regenerate.
1170 * configure: Regenerate.
1171 * system.h: Use <unordered_set> and <unordered_map> if available.
1173 2013-12-10 Roland McGrath <mcgrathr@google.com>
1175 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1176 with $(INSTALL_PROGRAM_ENV).
1177 * Makefile.in: Regenerate.
1179 2013-11-22 Cary Coutant <ccoutant@google.com>
1181 * configure.ac: Add check for which library is needed for
1183 * configure: Regenerate.
1185 2013-11-22 Cary Coutant <ccoutant@google.com>
1187 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1189 * testsuite/Makefile.in: Regenerate.
1191 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1193 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1194 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1195 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1196 (Target_x86_64<size>::Scan::local): Likewise.
1197 (Target_x86_64<size>::Scan::global): Likewise.
1198 (Target_x86_64<size>::Relocate::relocate): Likewise.
1199 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1201 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1204 * testsuite/Makefile.am (check_PROGRAMS): Add
1205 exception_x86_64_bnd_test.
1206 (exception_x86_64_bnd_test_SOURCES): New macro.
1207 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1208 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1209 (exception_x86_64_bnd_test_LDADD): Likewise.
1210 (exception_x86_64_bnd_1.o): New rule.
1211 (exception_x86_64_bnd_2.o): Likewise.
1212 * testsuite/Makefile.in: Regenerated.
1214 2013-11-15 Alan Modra <amodra@gmail.com>
1216 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1218 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1219 Only call ppc64_local_entry_offset for 64-bit. Restrict
1220 symval_for_branch lookup to ELFv1.
1221 (Stub_table::add_plt_call_entry): Use unsigned int off.
1222 (Output_data_glink::Address, invalid_address): New.
1223 (Output_data_glink::add_eh_frame): Move out of line. Add
1225 (Output_data_glink::add_global_entry, find_global_entry,
1226 global_entry_address): New functions.
1227 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1228 ge_size): New variables.
1229 (Output_data_glink::set_final_data_size): Add global entry
1231 (Output_data_glink::do_write): Write global entry stubs.
1232 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1233 parameter. Return true for ELFv2. Adjust callers.
1234 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1235 ELFv1. Similarly for ifunc and dynamic relocation processing
1236 specific to ELFv1. Recognize that symbols are defined on
1237 their plt entries for ELFv2.
1238 (Target_powerpc::symval_for_branch): Assert if called for
1240 (Target_powerpc::Relocate::relocate): Use global entry plt
1241 stub for symbol value if such exists on ELFv2.
1242 (Target_powerpc::Relocate::relocate): Don't call
1243 symval_for_branch when ELFv2. Do adjust for local entry
1245 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1247 (Target_powerpc::do_plt_address_for_global): Similarly.
1249 2013-11-14 Cary Coutant <ccoutant@google.com>
1251 Revert patch -- this did not fix the problem, and there is
1254 2013-11-14 Cary Coutant <ccoutant@google.com>
1257 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1258 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1259 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1260 updating fde_offsets_.
1261 (Eh_frame_hdr::lock_): New data member.
1263 2013-11-14 Cary Coutant <ccoutant@google.com>
1265 * dwp.cc (Dwo_file_entry): New type.
1266 (File_list): Use Dwo_file_entry.
1267 (Dwo_file::verify): New function.
1268 (Dwo_file::verify_dwo_list): New function.
1269 (Dwo_file::sized_verify_dwo_list): New function.
1270 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1272 (Dwp_options): New enum type.
1273 (dwp_options): Add --verify-only.
1276 * dwp.h (gold_info): Add declaration.
1278 2013-11-14 Cary Coutant <ccoutant@google.com>
1281 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1282 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1283 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1284 updating fde_offsets_.
1285 (Eh_frame_hdr::lock_): New data member.
1287 2013-11-06 Cary Coutant <ccoutant@google.com>
1290 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1291 before reloc sections.
1293 2013-11-04 Alan Modra <amodra@gmail.com>
1295 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1296 (Symbol::needs_dynamic_reloc): Test new flag.
1297 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1298 (Target_powerpc::Scan::get_reference_flags): Add target param.
1299 Return FUNC_DESC_ABI for 64-bit ELFv1.
1300 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1302 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1303 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1305 2013-10-31 Cary Coutant <ccoutant@google.com>
1307 Restore support for dwp v2 DWARF package file format.
1309 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1310 tu_length parameter. Adjust all callers.
1311 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1312 * dwp.cc: Include dwarf.h.
1313 (Section_bounds): New struct type.
1314 (Unit_set): New struct type.
1315 (Dwo_file::Dwo_file): Initialize new data member.
1316 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1317 Combine and rename to...
1318 (Dwo_file::read_unit_index): ...this.
1319 (Dwo_file::sized_read_compunit_index)
1320 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1321 (Dwo_file::sized_read_unit_index): ...this.
1322 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1323 parameters; add section_id parameter.
1324 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1325 (Dwo_file::add_unit_set): ...this.
1326 (Dwo_file::shndx_map_): Remove.
1327 (Dwo_file::sect_offsets_): New data member.
1328 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1329 (Dwp_output_file::add_section): Rename to...
1330 (Dwp_output_file::add_contribution): ...this.
1331 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1332 (Dwp_output_file::add_tu_set): Likewise.
1333 (Dwp_output_file::Contribution): New type.
1334 (Dwp_output_file::Section::contributions): New data member.
1335 (Dwp_output_file::Cu_or_tu_set): Remove.
1336 (Dwp_output_file::Section::Section): New ctor.
1337 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1338 (Dwp_output_file::Dwp_index::Section_table): New type.
1339 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1340 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1342 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1343 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1344 (Dwp_output_file::Dwp_index::section_table): New member function.
1345 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1346 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1347 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1348 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1349 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1350 (Dwp_output_file::Dwp_index::section_table_): New data member.
1351 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1352 (Dwp_output_file::add_output_section): New member function.
1353 (Dwp_output_file::write_new_section): New member function.
1354 (Dwp_output_file::write_contributions): New member function.
1355 (Dwp_output_file::section_id_map_): New data member.
1356 (class Dwo_id_info_reader): Remove.
1357 (class Unit_reader): New class.
1358 (get_dwarf_section_name): New function.
1359 (Dwo_file::read_executable): Adjust initializations of class data.
1360 (Dwo_file::read): Add support for v2 package file format.
1361 (Dwo_file::read_unit_index): Likewise.
1362 (Dwo_file::sized_read_unit_index): Likewise.
1363 (Dwo_file::copy_section): Likewise.
1364 (Dwo_file::add_unit_set): Likewise.
1365 (Dwp_output_file::add_output_section): Likewise.
1366 (Dwp_output_file::add_contribution): Likewise.
1367 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1369 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1371 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1373 (Dwp_output_file::initialize): Remove unused function.
1374 (Dwp_output_file::finalize): Add support for v2 package file format.
1375 (Dwp_output_file::write_index): Likewise.
1376 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1379 2013-10-31 Cary Coutant <ccoutant@google.com>
1381 * configure.ac: Fix check for -fmerge-constants.
1382 * configure.ac: Regenerate.
1384 2013-10-30 Roland McGrath <mcgrathr@google.com>
1386 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1387 Correct 9-byte nop sequence to match what the assembler generates.
1389 2013-10-30 Alan Modra <amodra@gmail.com>
1391 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1392 ppc64_local_entry_offset, ppc64_local_entry_offset,
1393 do_read_symbols): New functions.
1394 (Powerpc_relobj::e_flags_, st_other_): New vars.
1395 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1396 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1397 (Powerpc_relobj::e_flags_): New var.
1398 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1399 and adjust for ELFv2.
1400 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1401 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1402 (Powerpc_dynobj::do_find_special_sections): Likewise.
1403 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1404 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1405 to ELFv2 local entry.
1406 (Target_powerpc::do_relax): No thread safe barriers needed for
1408 (Output_data_plt_powerpc::initial_plt_entry_size_,
1409 plt_entry_size): Delete. Replace all uses with
1410 first_plt_entry_offset() and plt_entry_size().
1411 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1412 reserved_size parm. Update callers.
1413 (Output_data_plt_powerpc::entry_count): Update.
1414 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1415 and use Target_powerpc::first_plt_entry_offset().
1416 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1417 rename to plt_entry_size.
1418 (Output_data_plt_powerpc::add_ifunc_entry,
1419 add_local_ifunc_entry): Adjust reloc for ELFv2.
1420 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1421 (glink_eh_frame_fde_64v2): New.
1422 (Stub_table::plt_call_size): Support ELFv2 sizing.
1423 (Output_data_glink::add_eh_frame): Use the new FDE.
1424 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1425 (Stub_table::do_write): Write ELFv2 stubs and glink.
1426 (Target_powerpc::Relocate::relocate): Replaces nop after call
1427 with ld 2,24(1) and adjust local offset destination for ELFv2.
1429 2013-10-30 Alan Modra <amodra@gmail.com>
1431 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1432 (Target_powerpc::Scan::global, local): Likewise.
1433 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1434 on all ppc64 @h and @ha relocs.
1436 2013-10-14 Alan Modra <amodra@gmail.com>
1438 * output.h (Output_data_got::add_constant): Tidy.
1439 (Output_data_got::add_constant_pair): New function.
1440 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1441 methods used so as to first call reserve_ent().
1443 2013-10-11 Roland McGrath <mcgrathr@google.com>
1445 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1446 add_got_entry and add_got_entry_pair.
1448 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1449 (HAVE_PUBNAMES): Likewise.
1450 * configure: Regenerate.
1452 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1453 * testsuite/Makefile.in: Regenerate.
1455 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1456 Remove const from declaration.
1457 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1458 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1459 * output.h (Output_file_header): Remove const from member target_
1460 and corresponding constructor argument.
1461 * output.cc (Output_file_header::Output_file_header): Update prototype.
1462 (Output_file_header::do_sized_write): Use this->target_ in place
1463 of parameters()->target().
1465 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1467 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1468 * configure: Regenerate.
1469 * Makefile.in: Regenerate.
1470 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1471 * testsuite/merge_string_literals_2.c: Likewise.
1472 * testsuite/Makefile.am
1473 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1474 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1475 literal -fmerge-constants.
1476 * testsuite/Makefile.in: Regenerate.
1478 * i386.cc (Target_i386): Remove unused member dynbss_.
1479 * arm.cc (Target_arm): Likewise.
1480 * powerpc.cc (Target_powerpc): Likewise.
1481 * sparc.cc (Target_sparc): Likewise.
1482 * tilegx.cc (Target_tilegx): Likewise.
1483 * x86_64.cc (Target_x86_64): Likewise.
1484 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1485 type_signature_, type_offset_.
1486 * plugin.h (Plugin_hook): Remove unused member layout_.
1487 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1489 (Read_member): Remove unused members input_objects_, symtab_,
1491 (Check_library): Remove unused member symtab_.
1492 * archive.h (Lib_group): Remove unused member lib_.
1493 * archive.cc (Lib_group::Lib_group): Update initializer.
1494 * incremental.h (Incremental_binary): Remove unused member target_.
1495 (Incremental_script_entry): Removed unused member script_.
1496 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1497 * icf.h (Icf): Remove unused member num_tracked_relocs.
1499 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1500 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1502 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1504 * archive.h: Use struct rather than class for forward declaration
1505 of Read_symbols_data.
1507 2013-10-07 Cary Coutant <ccoutant@google.com>
1510 * testsuite/Makefile.am (icf_test): Fix dependencies.
1511 (icf_safe_test): Likewise.
1512 (icf_safe_so_test): Likewise.
1513 (large_symbol_alignment): Add empty _LDADD rule.
1514 * testsuite/Makefile.in: Regenerate.
1516 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1519 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1520 relocation for R_X86_64_32 on x32.
1522 2013-08-27 Roland McGrath <mcgrathr@google.com>
1524 * output.cc (Output_segment::set_section_addresses): Take new
1525 Target* argument. If target->isolate_execinstr() and the segment
1526 is executable and starts at a target->abi_pagesize() boundary,
1527 pad its end out to a target->abi_pagesize() boundary with code fill.
1528 * output.h (Output_segment::set_section_addresses): Update decl.
1529 * layout.h (Layout::check_output_data_for_reset_values): Take new
1530 argument RELAX_OUTPUTS.
1531 (Layout): New member relax_output_list_.
1532 (Layout::add_relax_output): New method.
1533 * layout.cc (Layout::Layout): Update constructor.
1534 (Layout::reset_relax_output): New method.
1535 (Layout::clean_up_after_relaxation): Call it.
1536 (Layout::prepare_for_relaxation): Update caller.
1537 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1538 Call reset_relax_output before re-processing segments for
1539 isolate_execinstr case.
1540 (Layout::write_data): Handle relax_output_list_.
1541 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1542 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1544 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1547 * object.h: Fix typos.
1549 2013-08-16 Roland McGrath <mcgrathr@google.com>
1551 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1552 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1554 2013-08-07 Cary Coutant <ccoutant@google.com>
1556 Revert support for v2 DWP files:
1558 2013-03-01 Cary Coutant <ccoutant@google.com>
1560 Add dwp support for v2 DWARF package file format.
1561 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1562 tu_length parameter. Adjust all callers.
1563 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1564 * dwp.cc: Include dwarf.h.
1565 (Section_bounds): New struct type.
1566 (Unit_set): New struct type.
1567 (Dwo_file::Dwo_file): Initialize new data member.
1568 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1569 Combine and rename to...
1570 (Dwo_file::read_unit_index): ...this.
1571 (Dwo_file::sized_read_compunit_index)
1572 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1573 (Dwo_file::sized_read_unit_index): ...this.
1574 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1575 parameters; add section_id parameter.
1576 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1577 (Dwo_file::add_unit_set): ...this.
1578 (Dwo_file::shndx_map_): Remove.
1579 (Dwo_file::sect_offsets_): New data member.
1580 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1581 (Dwp_output_file::add_section): Rename to...
1582 (Dwp_output_file::add_contribution): ...this.
1583 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1584 (Dwp_output_file::add_tu_set): Likewise.
1585 (Dwp_output_file::Contribution): New type.
1586 (Dwp_output_file::Section::contributions): New data member.
1587 (Dwp_output_file::Cu_or_tu_set): Remove.
1588 (Dwp_output_file::Section::Section): New ctor.
1589 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1590 (Dwp_output_file::Dwp_index::Section_table): New type.
1591 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1592 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1594 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1595 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1596 (Dwp_output_file::Dwp_index::section_table): New member function.
1597 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1598 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1599 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1600 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1601 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1602 (Dwp_output_file::Dwp_index::section_table_): New data member.
1603 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1604 (Dwp_output_file::add_output_section): New member function.
1605 (Dwp_output_file::write_new_section): New member function.
1606 (Dwp_output_file::write_contributions): New member function.
1607 (Dwp_output_file::section_id_map_): New data member.
1608 (class Dwo_id_info_reader): Remove.
1609 (class Unit_reader): New class.
1610 (get_dwarf_section_name): New function.
1611 (Dwo_file::read_executable): Adjust initializations of class data.
1612 (Dwo_file::read): Add support for v2 package file format.
1613 (Dwo_file::read_unit_index): Likewise.
1614 (Dwo_file::sized_read_unit_index): Likewise.
1615 (Dwo_file::copy_section): Likewise.
1616 (Dwo_file::add_unit_set): Likewise.
1617 (Dwp_output_file::add_output_section): Likewise.
1618 (Dwp_output_file::add_contribution): Likewise.
1619 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1621 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1623 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1625 (Dwp_output_file::initialize): Remove unused function.
1626 (Dwp_output_file::finalize): Add support for v2 package file format.
1627 (Dwp_output_file::write_index): Likewise.
1628 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1631 2013-07-31 Cary Coutant <ccoutant@google.com>
1633 * object.cc (Sized_relobj::do_output_section_address): New function.
1634 (Sized_relobj): Instantiate explicitly.
1635 * object.h (Object::output_section_address): New function.
1636 (Object::do_output_section_address): New function.
1637 (Sized_relobj::do_output_section_address): New function.
1638 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1640 2013-07-30 Cary Coutant <ccoutant@google.com>
1641 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1643 * parameters.cc (Parameters::entry): Return target-specific entry
1645 * target.h (Target::entry_symbol_name): New function.
1646 (Target_info::entry_symbol_name): New data member.
1648 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1649 * i386.cc (Target_i386::i386_info): Likewise.
1650 (Target_i386_nacl::i386_nacl_info): Likewise.
1651 * sparc.cc (Target_sparc::sparc_info): Likewise.
1652 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1653 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1654 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1655 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1657 2013-07-22 Sterling Augustine <saugustine@google.com>
1659 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1660 Convert parameter shndx to local variable. Add parameters symtab
1661 and symtab_size. Scan over section names. Find relocation
1662 section corresponding to current section. Create and initialize
1663 reloc_mapper_ and reloc_type_.
1664 (Dwarf_pubnames_table::read_header): Add assertion. Change
1665 unit_length to off_t. Initialize member unit_length_. Fill in field
1667 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1668 Initialize new fields unit_length_ and cu_offset_.
1669 (Dwarf_pubnames_table::read_section): Update prototype.
1670 (Dwarf_pubnames_table::cu_offset): New member function.
1671 (Dwarf_pubnames_table::subsection_size): Likewise.
1672 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1674 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1675 member functions public.
1676 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1677 Update comment. Rework logic. Move repeated parts to...
1678 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1679 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1680 pubtypes_table_, and stmt_list_offset.
1681 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1682 Gdb_index::find_pubtype_offset,
1683 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1684 (Gdb_index::pubnames_read): Update prototype and rework logic.
1685 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1687 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1688 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1689 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1690 Gdb_index::map_pubtable_to_dies):
1692 (Gdb_index::pubnames_read): Update declaration.
1693 (Gdb_index::Pubname_offset_map): New type.
1694 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1695 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1696 Gdb_index::stmt_list_offset): Declare.
1697 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1698 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1699 Gdb_index::pubtypes_offset_): Remove.
1701 2013-07-19 Roland McGrath <mcgrathr@google.com>
1703 * options.h (General_options): Add -Trodata-segment option.
1704 * parameters.cc (Parameters::check_rodata_segment): New function.
1705 (Parameters::set_target_once): Call it.
1706 * parameters.h (Parameters): Declare it (private member function).
1707 * layout.cc (load_seg_unusable_for_headers): New function, broken
1708 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1709 then validate rodata segment rather than text segment.
1710 (relaxation_loop_body): Call that.
1711 (is_text_segment): New function. Don't admit a non-executable
1712 segment if TARGET->isolate_execinstr().
1713 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1715 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
1718 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1719 * nacl.h (Sniff_file::View::View): Request aligned view.
1721 2013-07-11 Cary Coutant <ccoutant@google.com>
1723 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1724 correct BRLT entry size.
1726 2013-07-03 Alan Modra <amodra@gmail.com>
1728 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1731 2013-07-01 Cary Coutant <ccoutant@google.com>
1733 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1735 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1736 (Dwarf_ranges_table::lookup_reloc): New function.
1737 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1739 (Dwarf_ranges_table::lookup_reloc): New function.
1740 (Dwarf_ranges_table::reloc_type_): New data member.
1742 2013-06-27 Jing Yu <jingyu@google.com>
1745 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1747 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1748 (Target_powerpc::do_relax): Call the above.
1750 2013-06-27 Cary Coutant <ccoutant@google.com>
1752 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1753 on garbage collected .opd section.
1755 2013-06-27 Alan Modra <amodra@gmail.com>
1757 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1759 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1760 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1762 2013-06-14 Cary Coutant <ccoutant@google.com>
1764 * resolve.cc (Symbol::override_base): Don't override st_type
1765 from plugin placeholder symbols.
1766 (Symbol_table::resolve): Likewise.
1767 (Symbol_table::should_override): Don't complain about TLS mismatch
1768 if the TO symbol is a plugin placeholder.
1769 * testsuite/Makefile.am (plugin_test_tls): New test.
1770 * testsuite/Makefile.in: Regenerate.
1771 * testsuite/plugin_test_tls.sh: New test script.
1772 * testsuite/two_file_test_2_tls.cc: New test source.
1773 * testsuite/two_file_test_tls.cc: New test source.
1775 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1777 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1778 the maximum segment alignment is larger than the page size.
1779 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1780 correctly aligns the symbols with large alignemnt.
1781 * testsuite/Makefile.in: Regenerate.
1782 * testsuite/large_symbol_alignment.cc: New file.
1784 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1785 Sriraman Tallam <tmsriram@google.com>
1787 * options.h (sort_section): New option.
1788 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1789 Rename from Input_section_sort_section_name_special_ordering_compare.
1790 (Input_section_sort_section_name_compare): New struct.
1791 * output.cc (Output_section::Input_section_sort_section_name_compare::
1792 operator()): New function.
1793 (Output_section::sort_attached_input_sections): Use new sort function
1794 for .text if --sort-section=name is specified.
1795 * layout.cc (Layout::make_output_section):
1796 Add sorting by name when --sort-section=name is specified.
1797 * testsuite/Makefile.am (text_section_grouping): Test option
1798 --sort-section=name.
1799 * testsuite/Makefile.in: Regenerate.
1800 * testsuite/section_sorting_name.cc: New file.
1801 * testsuite/section_sorting_name.sh: New file.
1803 2013-05-21 Cary Coutant <ccoutant@google.com>
1805 * symtab.h (Symbol::is_cxx_vtable): New function.
1806 * target-reloc.h (relocate_section): Check for vtable symbol.
1807 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1808 * testsuite/Makefile.in: Regenerate.
1809 * testsuite/missing_key_func.cc: New test source.
1810 * testsuite/missing_key_func.sh: New test script.
1812 2013-05-21 Cary Coutant <ccoutant@google.com>
1814 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1815 type of enclosing symbol.
1816 (Relocate_info::location): Check symbol type when describing symbol.
1817 * object.h (Symbol_location_info): Remove unused line_number;
1818 add enclosing_symbol_type.
1819 * testsuite/debug_msg.sh: Adjust expected output.
1821 2013-05-13 Cary Coutant <ccoutant@google.com>
1823 * configure.ac: Export DEFAULT_TARGET.
1824 * configure: Regenerate.
1825 * Makefile.in: Regenerate.
1826 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1827 * testsuite/Makefile.in: Regenerate.
1828 * testsuite/debug_msg.sh: Delete duplicate tests.
1829 Don't check undef_int error message match for powerpc where the
1830 source file and line number aren't available.
1832 2013-05-10 Roland McGrath <mcgrathr@google.com>
1834 * options.h (General_options): Add --rosegment-gap option.
1835 * options.cc (finalize): --rosegment-gap implies --rosegment.
1836 * layout.cc (set_segment_offsets): Let user option override
1837 target->rosegment_gap().
1839 2013-05-10 Roland McGrath <mcgrathr@google.com>
1841 * options.h (General_options): Remove leading space from help
1842 messages for -nostdlib and --rosegment.
1844 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1847 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1849 2013-05-03 Alan Modra <amodra@gmail.com>
1851 * merge.cc (Output_merge_string::do_add_input_section): Correct
1852 scan for number of strings. Rename vars to avoid shadowing.
1853 Include missing terminator in input_size_.
1855 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1857 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1858 Restore empty string handling.
1860 2013-05-01 Cary Coutant <ccoutant@google.com>
1862 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1863 uninitialized warning.
1865 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1867 * output.cc (Output_section::add_merge_input_section): Allow
1868 to merge sections if the alignment is more than character size.
1869 * merge.h (Output_merge_string::Output_merge_string): Remove
1871 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1872 only not-null strings. Check the alignment of strings.
1874 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1875 alignment as the argument.
1876 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1877 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1878 Align non-zero length strings according to the addralign_.
1879 (Stringpool_template<Stringpool_char>::set_string_offsets):
1880 Updating offsets according to the given alignment.
1881 * testsuite/Makefile.am (text_section_grouping): Test if string
1882 literals are getting merged.
1883 * testsuite/Makefile.in: Regenerate.
1884 * testsuite/merge_string_literals_1.c: New file.
1885 * testsuite/merge_string_literals_2.c: Ditto.
1886 * testsuite/merge_string_literals.sh: Ditto.
1888 2013-04-26 Ian Lance Taylor <iant@google.com>
1890 * target-reloc.h (relocate_section): If the reloc offset is out of
1891 range, pass VIEW as NULL to relocate.relocate.
1892 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1893 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1894 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1895 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1896 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1897 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1899 2013-04-26 Geoff Pike <gpike@chromium.org>
1901 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1902 * layout.cc (Hash_task): New class.
1903 (Layout::queue_build_id_tasks): New function.
1904 (Layout::write_build_id): Handle single-thread portion of build ID
1905 computation. (In some cases, all of it is single-threaded.) Replace
1906 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1907 functionality in fewer lines of code.
1908 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1909 * options.h (General_options): make "--build-id" default to tree
1910 rather than sha1. Add two new options related to --build-id=tree:
1911 --build-id-chunk-size-for-treehash and
1912 --build-id-min-file-size-for-treehash.
1913 * Makefile.am: add testing of --build-id=tree and related new options
1914 (these tests will be invoked by "make check").
1915 * Makefile.in: Regenerate.
1917 2013-04-25 Alan Modra <amodra@gmail.com>
1919 * configure.tgt: Add powerpcle and powerpc64le.
1921 2013-04-22 Alan Modra <amodra@gmail.com>
1924 * layout.cc (Layout::segment_precedes): Allow more than one
1925 segment with the same type and flags.
1927 2013-04-15 Cary Coutant <ccoutant@google.com>
1929 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1930 allocate space in file for BSS sections.
1932 2013-04-15 Cary Coutant <ccoutant@google.com>
1934 * script-sections.cc (Orphan_output_section): Reset address
1935 to zero after each orphaned section for relocatable links.
1937 2013-04-15 Cary Coutant <ccoutant@google.com>
1939 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1940 section starting address for relocatable link.
1941 * testsuite/Makefile.am (script_test_11): New test.
1942 * testsuite/Makefile.in: Regenerate.
1943 * testsuite/script_test_11.c: New source file.
1944 * testsuite/script_test_11.t: New linker script.
1946 2013-04-13 Alan Modra <amodra@gmail.com>
1948 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1949 owner when sections are not adjacent and exceed group size.
1950 (Target_powerpc::group_sections): Handle corner case.
1951 (Target_powerpc::Branch_info::make_stub): Handle case where
1952 stub table doesn't exist due to branches in non-exec sections.
1953 (Target_powerpc::Relocate::relocate): Likewise.
1955 2013-04-11 Alan Modra <amodra@gmail.com>
1958 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1959 .branch_lt to match bfd ld. Adjust comments throughout file.
1961 2013-04-04 Ian Lance Taylor <iant@google.com>
1964 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1965 sections before checking whether they are included in the link.
1967 2013-03-29 Sriraman Tallam <tmsriram@google.com>
1969 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1970 object before calling the plugin claim_file handler. Pass the elf
1971 object of the archive to the plugin. Delete the elf object if the
1972 plugin claims the file.
1974 2013-03-21 Alan Modra <amodra@gmail.com>
1976 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1977 segment when omagic.
1979 2013-03-21 Alan Modra <amodra@gmail.com>
1981 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1983 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1984 uninitialized" warning.
1986 2013-03-20 Alan Modra <amodra@gmail.com>
1988 * symtab.h (Symbol::clear_version): New function.
1989 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1990 is_needed by weak references. Clear version for symbols defined
1991 in as-needed objects that are not needed.
1993 2013-03-15 Alan Modra <amodra@gmail.com>
1995 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1996 static and public. Add report_err param. Return false for data refs.
1997 (Target_powerpc::rela_dyn_section): New overloaded function.
1998 (Target_powerpc::plt_, iplt_): Elucidate.
1999 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2000 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2001 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2002 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2003 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2004 push_branch and make_plt_entry for ifunc syms when
2005 reloc_needs_plt_for_ifunc.
2006 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2007 for ifunc unless reloc_needs_plt_for_ifunc.
2009 2013-03-15 Alan Modra <amodra@gmail.com>
2011 * gc.h (gc_process_relocs): Don't look through function descriptors.
2012 * icf.cc (get_section_contents): Do so here instead.
2014 2013-03-13 Alan Modra <amodra@gmail.com>
2016 * powerpc.cc (is_branch_reloc): Forward declare.
2017 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2018 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2019 false for 64-bit, true for 32-bit non-branch relocs.
2020 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2021 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2023 (icf_safe_test): Generate linker map file as well as nm output.
2024 (icf_safe_so_test): Likewise.
2025 * testsuite/Makefile.in: Regenerate.
2026 * testsuite/icf_test.sh: Parse linker map file to determine
2028 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2029 * testsuite/icf_safe_so_test.sh: Likewise.
2030 (X86_32_or_ARM_specific_safe_fold): Merge into..
2031 (arch_specific_safe_fold): ..this.
2032 (X86_64_specific_safe_fold): Delete unused function.
2034 2013-03-12 Alan Modra <amodra@gmail.com>
2036 * gc.h (gc_process_relocs): Look through function descriptors
2037 to determine shndx, symvalue and addend used by ICF. Tidy
2038 variable duplication.
2040 2013-03-11 Alan Modra <amodra@gmail.com>
2042 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2043 * layout.cc (Layout_task_runner::run): ..to here.
2044 * symtab.h (struct Symbol_location): Extract from..
2045 (class Symbol_table): ..here.
2046 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2047 * target.h (class Target): Add function_location and
2048 do_function_location functions.
2049 (class Sized_target): Add do_function_location.
2050 * object.h (class Sized_relobj_file): Move find_shdr..
2051 (class Object): ..to here.
2052 * object.cc: Likewise. Update to suit. Instantiate.
2053 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2054 * powerpc.cc (class Powerpc_dynobj): New.
2055 (Target_powerpc::do_function_location): New function.
2056 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2057 (Powerpc_dynobj::do_read_symbols): New function.
2058 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2060 2013-03-08 Ian Lance Taylor <iant@google.com>
2062 * options.cc (General_options::string_to_object_format): Accept
2065 2013-03-08 Alan Modra <amodra@gmail.com>
2067 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2068 pointer to Post_fde.
2069 (struct Post_fde): Move definition to here..
2070 * ehframe.cc (struct Post_fde): ..from here.
2071 (Cie::write): Don't alloc Post_fde.
2072 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2074 2013-03-07 Alan Modra <amodra@gmail.com>
2076 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2077 relocation referencing .LC0.
2078 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2080 2013-03-07 Alan Modra <amodra@gmail.com>
2082 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2083 always_inline. Add assembly for powerpc to avoid GOT.
2085 2013-03-07 Alan Modra <amodra@gmail.com>
2087 * testsuite/script_test_10.sh: Don't test .bss section
2090 2013-03-06 Alan Modra <amodra@gmail.com>
2092 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2093 (Target_powerpc::symval_for_branch): Add symtab param. Update
2094 all callers. Handle folded sections.
2095 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2097 (Global_symbol_visitor_opd::operator()): Likewise.
2099 2013-03-04 Alan Modra <amodra@gmail.com>
2101 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2102 * testsuite/Makefile.in: Regenerate.
2104 2013-03-01 Cary Coutant <ccoutant@google.com>
2106 Add dwp support for v2 DWARF package file format.
2107 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2108 tu_length parameter. Adjust all callers.
2109 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2110 * dwp.cc: Include dwarf.h.
2111 (Section_bounds): New struct type.
2112 (Unit_set): New struct type.
2113 (Dwo_file::Dwo_file): Initialize new data member.
2114 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2115 Combine and rename to...
2116 (Dwo_file::read_unit_index): ...this.
2117 (Dwo_file::sized_read_compunit_index)
2118 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2119 (Dwo_file::sized_read_unit_index): ...this.
2120 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2121 parameters; add section_id parameter.
2122 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2123 (Dwo_file::add_unit_set): ...this.
2124 (Dwo_file::shndx_map_): Remove.
2125 (Dwo_file::sect_offsets_): New data member.
2126 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2127 (Dwp_output_file::add_section): Rename to...
2128 (Dwp_output_file::add_contribution): ...this.
2129 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2130 (Dwp_output_file::add_tu_set): Likewise.
2131 (Dwp_output_file::Contribution): New type.
2132 (Dwp_output_file::Section::contributions): New data member.
2133 (Dwp_output_file::Cu_or_tu_set): Remove.
2134 (Dwp_output_file::Section::Section): New ctor.
2135 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2136 (Dwp_output_file::Dwp_index::Section_table): New type.
2137 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2138 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2140 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2141 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2142 (Dwp_output_file::Dwp_index::section_table): New member function.
2143 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2144 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2145 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2146 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2147 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2148 (Dwp_output_file::Dwp_index::section_table_): New data member.
2149 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2150 (Dwp_output_file::add_output_section): New member function.
2151 (Dwp_output_file::write_new_section): New member function.
2152 (Dwp_output_file::write_contributions): New member function.
2153 (Dwp_output_file::section_id_map_): New data member.
2154 (class Dwo_id_info_reader): Remove.
2155 (class Unit_reader): New class.
2156 (get_dwarf_section_name): New function.
2157 (Dwo_file::read_executable): Adjust initializations of class data.
2158 (Dwo_file::read): Add support for v2 package file format.
2159 (Dwo_file::read_unit_index): Likewise.
2160 (Dwo_file::sized_read_unit_index): Likewise.
2161 (Dwo_file::copy_section): Likewise.
2162 (Dwo_file::add_unit_set): Likewise.
2163 (Dwp_output_file::add_output_section): Likewise.
2164 (Dwp_output_file::add_contribution): Likewise.
2165 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2167 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2169 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2171 (Dwp_output_file::initialize): Remove unused function.
2172 (Dwp_output_file::finalize): Add support for v2 package file format.
2173 (Dwp_output_file::write_index): Likewise.
2174 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2177 2013-03-01 Cary Coutant <ccoutant@google.com>
2179 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2180 function into class definition in header file.
2181 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2182 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2184 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2186 2013-02-28 Alan Modra <amodra@gmail.com>
2188 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2189 * target.cc (Target::do_plt_fde_location): New function.
2190 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2191 accessor function, and constructor param.
2192 (struct Post_fde, Post_fdes): Declare.
2193 (Cie::write): Add post_fdes param.
2194 * ehframe.cc (Fde::write): Use plt_fde_location.
2195 (struct Post_fde): Define.
2196 (Cie::write): Stash FDEs added post merge mapping.
2197 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2198 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2199 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2201 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2202 (Target_powerpc::has_glink): New function.
2203 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2204 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2205 glink_eh_frame_fde_32, default_fde): New data.
2206 (Stub_table::eh_frame_added_): New var.
2207 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2209 (Stub_table::add_eh_frame): New function.
2210 (Output_data_glink::add_eh_frame): New function.
2211 (Target_powerpc::make_glink_section): Call add_eh_frame.
2213 2013-02-15 Ian Lance Taylor <iant@google.com>
2215 * options.h (DEFINE_uint64_alias): Define.
2216 (class General_options): Add -Ttext-segment as an alias for
2219 2013-02-15 Alan Modra <amodra@gmail.com>
2221 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2222 (Stub_table::do_write): ..here, two places.
2223 (Stub_table::plt_call_size): Use it here too.
2225 2013-02-11 Ian Lance Taylor <iant@google.com>
2227 * descriptors.cc (Descriptors::close_all): New function.
2228 * descriptors.h (class Descriptors): Declare close_all.
2229 (close_all_descriptors): New inline function.
2230 * plugin.cc: Include "descriptors.h".
2231 (Plugin_manager::cleanup): Call close_all_descriptors.
2233 2013-02-06 Alan Modra <amodra@gmail.com>
2235 * README: Update coding style link.
2237 2013-01-28 Cary Coutant <ccoutant@google.com>
2239 * dwp.cc (File_list): New typedef.
2240 (Dwo_name_info_reader): New class.
2241 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2242 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2243 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2244 (Dwo_file::read_executable): New function.
2245 (Dwo_file::read): Move common setup code to ...
2246 (Dwo_file::make_object): ... here.
2247 (dwp_options): Add --exec/-e.
2251 2013-01-24 Sriraman Tallam <tmsriram@google.com>
2253 * layout.cc (Layout::layout): Check for option text_reorder.
2254 (Layout::make_output_section): Ditto.
2255 * options.h (text_reorder): New option.
2256 * output.cc (Input_section_sort_compare): Remove special ordering
2259 Input_section_sort_section_name_special_ordering_compare::
2260 operator()): New function.
2261 (Output_section::sort_attached_input_sections): Use new sort function
2263 * output.h (Input_section_sort_section_name_special_ordering_compare):
2265 * testsuite/Makefile.am (text_section_grouping): Test option
2267 * testsuite/Makefile.in: Regenerate.
2268 * testsuite/text_section_grouping.sh: Check order of functions without
2269 default text reordering.
2271 2013-01-18 Mike Frysinger <vapier@gentoo.org>
2273 * options.h (General_options): Change default to true for new_dtags.
2275 2013-01-18 Mike Frysinger <vapier@gentoo.org>
2277 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2278 when enable_new_dtags is false. Only add DT_RUNPATH when
2279 enable_new_dtags is true.
2281 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2283 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2284 used in declaration and definition consistent.
2285 (Target_powerpc::symval_for_branch): Ditto.
2287 2013-01-16 Sriraman Tallam <tmsriram@google.com>
2289 * testsuite/plugin_final_layout.cc: Fix comment.
2291 2013-01-16 Sriraman Tallam <tmsriram@google.com>
2293 * layout.cc (Layout::layout): Do not do default sorting for
2294 text sections when section ordering is specified.
2295 (make_output_section): Ditto.
2296 * testsuite/plugin_final_layout.cc: Name the function sections
2297 to catch reordering issues.
2299 2013-01-15 Alan Modra <amodra@gmail.com>
2301 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2304 2013-01-15 Alan Modra <amodra@gmail.com>
2306 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2307 * testsuite/Makefile.in: Regenerate.
2309 2013-01-14 Alan Modra <amodra@gmail.com>
2311 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2312 * testsuite/Makefile.in: Regenerate.
2314 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2317 Fix mingw gold build with plugins enabled
2318 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2319 * configure.ac: Export DLOPEN_LIBS and add headers check.
2320 * plugin.cc: Handle non-dlfcn case.
2321 * Makefile.in: Regenerate.
2322 * config.in: Regenerate.
2323 * configure: Regenerate.
2324 * testsuite/Makefile.in: Regenerate.
2326 2013-01-09 Sriraman Tallam <tmsriram@google.com>
2328 * output.h (sort_attached_input_sections): Change to be public.
2329 * script-sections.cc
2330 (Output_section_definition::set_section_addresses): Sort
2331 attached input sections according to section order before linker
2332 script assigns section addresses.
2333 (Orphan_output_section::set_section_addresses): Sort
2334 attached input sections according to section order before linker
2335 script assigns section addresses.
2336 * Makefile.am (final_layout.sh): Use a simple linker script to
2337 check if section ordering still works.
2338 * Makefile.in: Regenerate.
2340 2013-01-09 Ben Cheng <bccheng@google.com>
2342 * arm.cc (Target_arm::attributes_accept_div): New function.
2343 (Target_arm::attributes_forbid_div): New function.
2344 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2345 attribute using the same new functions as what bfd/elf32_arm.c
2348 2013-01-07 Cary Coutant <ccoutant@google.com>
2351 * output.cc (Output_section::add_input_section): For incremental
2352 updates, don't track input sections that are allocated from patch
2355 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2356 Ian Lance Taylor <iant@google.com>
2359 * configure.ac (--enable-ld): Removed.
2360 (install_as_default): Set to yes only for --enable-gold=default
2362 * configure: Regenerated.
2364 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2366 * options.h (General_options): Add -fuse-ld= for GCC linker
2367 option compatibility.
2369 2013-01-04 Cary Coutant <ccoutant@google.com>
2371 * configure.ac: Fix typo restoring CXXFLAGS.
2372 * configure: Regenerate.
2374 2013-01-04 Cary Coutant <ccoutant@google.com>
2376 * testsuite/Makefile.am (CXXLINK_S): New macro.
2377 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2378 * testsuite/Makefile.in: Regenerate.
2380 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2382 * version.cc (print_version): Update copyright year to 2013.
2384 2012-12-20 Ian Lance Taylor <iant@google.com>
2386 * layout.cc (Layout::special_ordering_of_input_section): New
2388 (Layout::layout): If input section requires special ordering, must
2389 sort input sections.
2390 (Layout::make_output_section): May sort .text input sections.
2391 (Layout::is_section_name_prefix_grouped): Remove.
2392 * layout.h (class Layout): Declare
2393 special_ordering_of_input_section. Don't declare
2394 is_section_name_prefix_grouped.
2395 * output.cc (Output_section::add_input_section): Revert last
2397 (Output_section::Input_section_sort::match_file_name): Don't crash
2398 if called on output section data.
2399 (Output_section::Input_section_sort_compare): Sort based on
2401 (Output_section::Input_section_sort_section_order_index_compare):
2403 (Output_section::sort_attached_input_sections): Likewise.
2405 2012-12-18 Sriraman Tallam <tmsriram@google.com>
2407 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
2408 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2409 * output.cc (Output_section::add_input_section): Check if section
2410 name contains special prefix. Keep input sections to sort such
2412 (Output_section::Input_section_sort_section_order_index_compare
2413 ::operator()): Group sections according to prefixes.
2414 (Output_section::sort_attached_input_sections): Add condition to
2415 Input_section_entry constructor call.
2416 * testsuite/Makefile.am (text_section_grouping): New test.
2417 * testsuite/Makefile.in: Regenerate.
2418 * testsuite/text_section_grouping.cc: New file.
2419 * testsuite/text_section_grouping.sh: New file.
2421 2012-12-17 Nick Clifton <nickc@redhat.com>
2423 * Makefile.am: Add copyright notice.
2426 * configure.ac: Likewise.
2427 * ftruncate.c: Likewise.
2428 * Makefile.in: Regenerate.
2430 2012-12-14 Cary Coutant <ccoutant@google.com>
2432 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2433 --no-as-needed flag.
2434 (exception_separate_shared_12_test): Likewise.
2435 (incremental_copy_test): Likewise.
2436 * testsuite/Makefile.in: Regenerate.
2438 2012-12-14 Cary Coutant <ccoutant@google.com>
2440 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2441 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2443 2012-12-12 Alan Modra <amodra@gmail.com>
2445 * powerpc.cc (class Track_tls): New.
2446 (class Relocate, class Scan): Inherit Track_tls.
2447 (Target_powerpc::Scan::local, global): Track tls optimization
2448 and avoid creating plt entry for __tls_get_addr if all uses
2450 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2452 2012-12-12 Alan Modra <amodra@gmail.com>
2454 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2455 Replace no_toc_optimize with toc_optimize.
2456 * output.h (Output_section::input_sections): Provide non-const variant.
2457 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2458 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2460 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2461 (class Sort_toc_sections): New.
2462 (Target_powerpc::do_finalize_sections): Sort toc sections.
2463 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2465 2012-12-10 Roland McGrath <mcgrathr@google.com>
2467 * testsuite/binary_unittest.cc (read_all): New function.
2468 (Sized_binary_test): Use it instead of ::read.
2469 * fileread.cc (do_read): Don't assume pread always reads the whole
2470 amount in a single call.
2472 2012-12-10 Alan Modra <amodra@gmail.com>
2474 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2475 Set EM_PPC64 or EM_PPC here.
2476 (Target_selector_powerpc::do_recognize): Delete.
2478 2012-12-10 Alan Modra <amodra@gmail.com>
2480 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2482 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2484 2012-12-07 Roland McGrath <mcgrathr@google.com>
2486 * testsuite/binary_unittest.cc (Sized_binary_test):
2487 Use open_descriptor rather than ::open.
2489 2012-12-07 Alan Modra <amodra@gmail.com>
2491 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2492 typedef and invalid_address constant.
2493 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2494 instantiate constants.
2496 2012-12-06 Roland McGrath <mcgrathr@google.com>
2498 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2499 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2500 * aclocal.m4: Regenerate.
2501 * configure: Regenerate.
2502 * Makefile.in: Regenerate.
2503 * testsuite/Makefile.in: Regenerate.
2505 2012-12-07 Alan Modra <amodra@gmail.com>
2507 * options.h (General_options): Add no_toc_optimize.
2508 * powerpc.cc (ok_lo_toc_insn): New function.
2509 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2511 2012-12-06 Alan Modra <amodra@gmail.com>
2513 * options.h (General_options): Add plt_align, plt_static_chain,
2514 plt_thread_safe. Update stub_group_size help text.
2515 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2516 for new plt_thread_safe_ var.
2517 (use_plt_offset): Correct comments.
2518 (Target_powerpc::do_relax): Look for thread creation symbols to
2519 determine default plt_thread_safe value. Clear plt call stubs
2520 as well as branch stubs each iteration.
2521 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2523 (l, hi, ha, write_insn): Move earlier.
2524 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2525 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2527 (Stub_table::update_size): Adjust.
2528 (Stub_table::prev_size, set_prev_size): Delete.
2529 (Stub_table::stub_align): Let --plt-align affect result.
2530 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2531 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2532 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2533 (Stub_table::do_write): Support more stub variants.
2535 2012-12-04 Alan Modra <amodra@gmail.com>
2537 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2538 (Target_powerpc::do_define_standard_symbols): New function.
2540 2012-12-03 Alan Modra <amodra@gmail.com>
2542 * output.h: Formatting, whitespace.
2544 2012-12-03 Alan Modra <amodra@gmail.com>
2546 * layout.h (Layout::get_executable_sections): Declare.
2547 * layout.cc (Layout::get_executable_sections): New function.
2548 * arm.cc (Target_arm::group_sections): Use it.
2549 (Arm_output_section::group_sections): Delete now redundant test.
2550 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2551 param to handle relative relocs.
2552 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2553 (Output_data_reloc::add_absolute): Adjust.
2554 (Output_data_reloc::add_relative): New function.
2555 (Output_data::reset_data_size): New function.
2556 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2557 (Output_section::set_addralign): New function.
2558 (Output_section::checkpoint_set_addralign): New function.
2559 (Output_section::clear_section_offsets_need_adjustment): New function.
2560 (Output_section::input_sections): Make public.
2561 * powerpc.cc (class Output_data_brlt_powerpc): New.
2562 (class Stub_table, class Stub_control): New.
2563 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2564 stub_table_, set_stub_table, stub_table): New vectors and accessor
2566 (Target_powerpc::do_may_relax, do_relax, push_branch,
2567 new_stub_table, stub_tables, brlt_section, group_sections,
2568 add_branch_lookup_table, find_branch_lookup_table,
2569 write_branch_lookup_table, make_brlt_section): New functions.
2570 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2571 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2572 branch_info_): New vars.
2573 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2574 make call stubs here.
2575 (Output_data_glink): Remove all call stub handling from this class.
2576 (Target_powerpc::Scan::local, global): Save interesting branch
2577 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2578 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2579 functions on final link.
2580 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2581 Handle long branch destinations too.
2582 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2583 do_plt_address_for_local): Adjust lookup of plt call stubs.
2585 2012-11-30 Alan Modra <amodra@gmail.com>
2587 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2588 relocs against protected symbols when building 32-bit shared libs.
2590 2012-11-30 Alan Modra <amodra@gmail.com>
2592 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2593 param. Call got_section() to make .got. Update all callers
2594 and their callers and so on.
2596 2012-11-30 Alan Modra <amodra@gmail.com>
2598 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2599 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2600 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2601 value if it already exists.
2603 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2606 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2608 2012-11-14 Roland McGrath <mcgrathr@google.com>
2610 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2611 than bfc instruction for data sandboxing.
2613 2012-11-08 Alan Modra <amodra@gmail.com>
2615 * po/POTFILES.in: Regenerate.
2617 2012-11-05 Alan Modra <amodra@gmail.com>
2619 * configure.ac: Apply 2012-09-10 change to config.in here.
2620 * configure: Regenerate.
2622 2012-11-05 Alan Modra <amodra@gmail.com>
2624 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2625 (struct Opd_ent): Use "Address" rather than "Offset".
2626 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2627 (Target_powerpc::got_section): Make public.
2628 (Target_powerpc::scan_relocs): Move code setting symbols..
2629 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2630 Create _SDA_BASE_ only when referenced.
2632 2012-11-02 Roland McGrath <mcgrathr@google.com>
2634 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2637 2012-11-01 Roland McGrath <mcgrathr@google.com>
2639 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2640 for offset_in_output_section parameter.
2641 (Sized_target::relocate_special_relocatable): Likewise.
2642 * arm.cc (Target_arm::relocate_relocs): Likewise.
2643 (Target_arm::relocate_special_relocatable): Likewise.
2644 * i386.cc (Target_i386::relocate_relocs): Likewise.
2645 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2646 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2647 * target-reloc.h (relocate_relocs): Likewise.
2648 * testsuite/testfile.cc (Target_test): Likewise.
2649 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2650 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2652 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2653 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2655 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2656 parameter, which is unused in the [!F_SETFD] case.
2658 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2659 SYMNDX to off_t before comparing it to this->data_size().
2660 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2661 * incremental.cc (Output_section_incremental_inputs::do_write):
2662 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2664 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2666 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2668 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2669 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2672 2012-10-29 Cary Coutant <ccoutant@google.com>
2674 * dwp.cc (usage): Add file and exit status parameters;
2675 add --help and --version options.
2676 (print_version): New function.
2677 (main): Add --help and --version options.
2679 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2681 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2682 final_layout_sequence.txt.
2683 * testsuite/Makefile.in: Regenerated.
2685 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2687 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2688 COMPILE generated by automake.
2690 (CXXCOMPILE1): Likewise.
2691 (CXXLINK1): Likewise.
2692 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2694 (CXXCOMPILE): Likewise.
2695 (CXXLINK): Likewise.
2696 * testsuite/Makefile.in: Regenerated.
2698 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2700 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2701 on bad fwrite return.
2703 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2705 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2708 2012-10-23 Cary Coutant <ccoutant@google.com>
2710 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2711 * testsuite/Makefile.in: Regenerate.
2712 * testsuite/dwp_test.h: New source file.
2713 * testsuite/dwp_test_1.cc: New source file.
2714 * testsuite/dwp_test_1.s: New source file.
2715 * testsuite/dwp_test_1.sh: New source file.
2716 * testsuite/dwp_test_1b.cc: New source file.
2717 * testsuite/dwp_test_1b.s: New source file.
2718 * testsuite/dwp_test_2.cc: New source file.
2719 * testsuite/dwp_test_2.s: New source file.
2720 * testsuite/dwp_test_2.sh: New source file.
2721 * testsuite/dwp_test_main.cc: New source file.
2722 * testsuite/dwp_test_main.s: New source file.
2724 2012-10-23 Cary Coutant <ccoutant@google.com>
2726 * dwp.h: New header file.
2727 * dwp.cc: New source file.
2728 * gold.h: Move shared declarations to system.h.
2729 * system.h: New header file.
2730 * Makefile.am: Add dwp.
2731 * Makefile.in: Regenerate.
2733 2012-10-23 Cary Coutant <ccoutant@google.com>
2735 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2736 Dwarf_info_reader::read_from_pointer.
2737 (Dwarf_pubnames_table::read_header): Likewise.
2738 (Dwarf_pubnames_table::next_name): Likewise.
2739 (Dwarf_die::read_attributes): Likewise.
2740 (Dwarf_die::skip_attributes): Likewise.
2741 (Dwarf_info_reader::read_from_pointer): New function template.
2742 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2743 (Dwarf_pubnames_table): Likewise.
2744 (Dwarf_info_reader::read_from_pointer): New function template.
2745 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2746 Dwarf_pubnames_table ctor.
2748 2012-10-23 Cary Coutant <ccoutant@google.com>
2750 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2752 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2754 (Dwarf_info_reader::set_abbrev_shndx): New method.
2755 (Dwarf_info_reader::abbrev_shndx_): New data member.
2757 2012-10-23 Cary Coutant <ccoutant@google.com>
2759 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2760 from object, not parameters.
2761 (Dwarf_info_reader::parse): Likewise.
2762 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2763 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2764 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2767 2012-10-23 Cary Coutant <ccoutant@google.com>
2769 * fileread.cc (Input_file::Input_file): New constructor.
2770 * fileread.h (class Input_file): Add new constructor.
2772 2012-10-18 Alan Modra <amodra@gmail.com>
2775 * object.cc (Relobj::is_section_name_included): Also match
2776 .sdata personality section.
2778 2012-10-18 Alan Modra <amodra@gmail.com>
2780 * target-reloc.h (class Default_comdat_behavior): New, package up..
2781 (get_comdat_behaviour): ..this.
2782 (relocate_section): Add Relocate_comdat_behavior template arg,
2783 adjust code to suit.
2784 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2785 (Target_arm::scan_reloc_section): Likewise.
2786 * i386.cc (Target_i386::relocate_section): Likewise.
2787 * sparc.cc (Target_sparc::relocate_section): Likewise.
2788 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2789 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2790 * powerpc.cc (class Relocate_comdat_behavior): New.
2791 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2792 gold::relocate_section with new template arg.
2794 2012-10-18 Alan Modra <amodra@gmail.com>
2796 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2797 dynamic relocs for GOT_TPREL got entries, without symbol if
2799 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2800 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2801 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2803 2012-10-17 Alan Modra <amodra@gmail.com>
2806 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2808 2012-10-16 Sriraman Tallam <tmsriram@google.com>
2810 * layout.cc (Layout::include_section): Keep sections marked
2811 SHF_EXCLUDE when doing relocatable links.
2813 2012-10-16 Alan Modra <amodra@gmail.com>
2815 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2816 (Target_powerpc::do_finalize_sections): Call it.
2817 (Output_data_save_res): New class and supporting functions.
2818 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2819 normal symbols defined in object files.
2821 2012-10-12 Alan Modra <amodra@gmail.com>
2823 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2824 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2825 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2826 section if scan_opd_relocs not yet called.
2827 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2829 2012-10-12 Alan Modra <amodra@gmail.com>
2831 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2832 add_local_ifunc_entry): Revert last change.
2833 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2835 2012-10-05 Alan Modra <amodra@gmail.com>
2837 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2838 do_plt_address_for_global): New functions.
2839 (Output_data_got_powerpc::do_write): Don't segfault when linking
2841 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2842 add_local_ifunc_entry): Return true on adding entry..
2843 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2844 glink->add_entry call. Remove unused symtab param. Adjust calls.
2845 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2846 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2847 set up symbols here.
2848 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2849 syms here. Do so even when no .iplt. Don't segfault when linking
2851 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2852 new variants without reloc param.
2853 (Glink_sym_ent::Glink_sym_ent): Likewise.
2854 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2855 reloc when refs will resolve to plt call stub.
2856 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2857 R_PPC_PLTREL24 to resolve locally.
2858 (Target_powerpc::Scan::global): Correct ifunc handling.
2859 (Target_powerpc::Relocate::relocate): Correct local sym glink
2860 lookup. Don't destroy "value" when we have a plt call stub,
2861 and when checking plt call validity.
2862 (Target_powerpc::do_dynsym_value): Simplify.
2864 2012-10-05 Alan Modra <amodra@gmail.com>
2866 * i386.cc (Output_data_plt_i386::address_for_global,
2867 address_for_local): Add plt offset to returned value. Adjust uses.
2868 * sparc.cc (Output_data_plt_sparc::address_for_global,
2869 address_for_local): Likewise.
2870 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2871 address_for_local): Likewise.
2872 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2873 address_for_local): Likewise.
2874 * target.h (Target::plt_address_for_global, plt_address_for_local):
2876 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2877 (Output_data_got::Got_entry::write): Nor here.
2878 * output.h: Comment fix.
2880 2012-10-02 Jiong Wang <jiwang@tilera.com>
2882 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2883 global_offset_table_ value for larget got.
2884 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2886 2012-09-29 Alan Modra <amodra@gmail.com>
2888 * powerpc.cc (Target_powerpc::iplt_): New output section.
2889 (Target_powerpc::iplt_section, make_iplt_section,
2890 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2891 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2892 Target_powerpc::plt_entry_count): Count iplt entries too.
2893 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2894 reloc section in constructor. New params.
2895 (Target_powerpc::make_plt_section): Create reloc section here instead.
2896 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2898 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2899 (Output_data_glink::add_entry, find_entry): New functions to
2900 deal with local syms.
2901 (Glink_sym_ent): Add support for local syms.
2902 (Output_data_glink::do_write): Handle ifunc plt entries.
2903 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2904 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2905 (Target_powerpc::Relocate::relocate): Likewise.
2906 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2908 2012-09-25 Alan Modra <amodra@gmail.com>
2910 * object.h (Sized_relobj_file::adjust_local_symbol,
2911 do_adjust_local_symbol): New functions.
2912 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2913 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2914 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2915 and irregular opd entry spacing.
2916 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2917 (Global_symbol_visitor_opd): New functor.
2918 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2919 on deleted opd entries.
2921 2012-09-15 Jiong Wang <jiwang@tilera.com>
2923 * tilegx.cc: New file.
2924 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2925 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2926 * configure.tgt: Add entries for tilegx*.
2927 * configure.ac: Likewise.
2928 * Makefile.in: Rebuild.
2929 * configure: Likewise.
2930 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2933 2012-09-13 Alan Modra <amodra@gmail.com>
2935 * target-reloc.h (scan_relocs): Call scan.local for relocs
2936 against symbols in discarded sections. Pass is_discarded
2938 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2939 Add is_discarded param.
2940 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2941 is_discarded to flag opd entry as discarded. Don't emit dyn
2942 relocs on such entries.
2943 (Target_powerpc::Scan::global): Similarly detect and handle
2945 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2946 opd_ent_. Update all uses.
2947 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2948 (Target_powerpc::relocate_section): Zero out discarded opd
2951 2012-09-12 Ian Lance Taylor <iant@google.com>
2954 * output.cc: Rename Output_data_got template parameter from size
2955 to got_size for all functions. Compile all variants of
2957 (Output_data_got::Got_entry::write): Correct use of size for
2958 symbol value. Use local_is_tls rather than casting to
2960 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2961 (class Sized_relobj_file): Add do_local_is_tls.
2962 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2964 2012-09-11 Alan Modra <amodra@gmail.com>
2967 * layout.cc (Layout::set_segment_offsets): When using
2968 common-page-size alignment, ensure we are on a new max-page-size
2970 * output.cc (Output_segment::set_section_addresses): Use
2971 abi_pagesize, not common_pagesize for relro boundary.
2972 (Output_segment::set_offset): Likewise.
2974 2012-09-11 Alan Modra <amodra@gmail.com>
2976 * output.h (Output_data_got::add_global_tls, add_local_tls,
2977 add_local_tls_pair): New functions.
2978 (Output_data_got::add_local_pair_with_rel): Remove second
2979 reloc param. Expand comment.
2980 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2981 use_plt_or_tls_offset_, similarly for constructor param.
2982 (Output_data_got::Got_entry::write): Add got_index param.
2983 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2984 add_local_tls_pair): New functions.
2985 (Output_data_got::Got_entry::write): Handle tls symbols
2986 with use_plt_or_tls_offset_ set specially.
2987 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2988 (Output_data_got::do_write): Replace iterator with index, pass
2989 index to entry write function.
2990 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2991 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2992 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2994 * i386.cc (Target_i386::Scan::local): Likewise.
2995 * sparc.cc (Target_sparc::Scan::local): Likewise.
2996 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2997 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2998 do_tls_offset_for_global): New functions.
2999 (Target_powerpc::Scan::local): Correct TLS relocations and got
3001 (Target_powerpc::Scan::global): Don't emit unnecessary
3002 dynamic relocations on TLS GOT entries.
3004 2012-09-10 Matthias Klose <doko@ubuntu.com>
3006 * config.in: Disable sanity check for kfreebsd.
3008 2012-09-10 Sterling Augustine <saugustine@google.com>
3010 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3011 (Gdb_index::pubtypes_read): New parameter.
3012 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3014 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3017 2012-09-09 Alan Modra <amodra@gmail.com>
3019 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3020 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3021 * gc.h (gc_process_relocs): Call target gc_add_reference.
3022 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3023 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3024 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3026 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3027 to cater for when we don't need code offset. Update use.
3028 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3029 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3030 set_opd_valid): New functions.
3031 (Target_powerpc::do_gc_add_reference): New function.
3032 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3034 (Target_powerpc::do_gc_mark_symbol): New function.
3036 2012-09-06 Cary Coutant <ccoutant@google.com>
3038 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3039 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3040 (Dwarf_die::skip_attributes): Likewise.
3041 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3042 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3044 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3046 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3048 * testsuite/script_test_3.t: Add .got.plt output section
3050 * testsuite/script_test_4.t: Likewise.
3052 2012-09-05 Alan Modra <amodra@gmail.com>
3054 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3055 update all uses and lose "enum" when using type.
3057 2012-09-05 Alan Modra <amodra@gmail.com>
3059 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3060 * configure: Regenerate.
3061 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3062 (plugin_final_layout.stdout): Likewise.
3063 (memory_test): Set page sizes to 0x1000.
3064 * testsuite/Makefile.in: Regenerate.
3065 * testsuite/discard_locals_test.sh: Add FIXME comment.
3066 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3067 * testsuite/pr14265.t: Add .got output section statement.
3068 * testsuite/script_test_2.t: Likewise.
3069 * testsuite/script_test_3.t: Likewise.
3070 * testsuite/script_test_4.t: Likewise.
3071 * testsuite/script_test_5.t: Likewise.
3072 * testsuite/script_test_6.t: Likewise.
3073 * testsuite/script_test_7.t: Likewise.
3074 * testsuite/script_test_9.t: Likewise.
3076 2012-09-05 Alan Modra <amodra@gmail.com>
3078 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3079 (Powerpc_relocate_functions::Status): New typedef.
3080 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3081 (Target_powerpc::Scan::local): Handle REL64.
3082 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3083 for REL32 and REL64.
3084 (Target_powerpc::symval_for_branch): New function, extracted from..
3085 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3086 checks. Report overflow errors.
3088 2012-09-05 Alan Modra <amodra@gmail.com>
3090 * object.h (Sized_relobj_file::emit_relocs): Delete.
3091 (Sized_relobj_file::emit_relocs_reltype): Delete.
3092 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3093 relocate_relocs for --emit-relocs.
3094 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3095 * output.h: Update comment.
3096 (Output_segment::first_section): New function.
3097 (Output_segment::first_section_load_address): Use first_section.
3098 * output.cc (Output_segment::first_section): New function extracted..
3099 (Output_segment::first_section_load_address): ..from here. Delete.
3100 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3101 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3102 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3103 adjust call to target.h function.
3104 * i386.cc (Target_i386): Likewise.
3105 * sparc.cc (Target_sparc): Likewise.
3106 * x86_64.cc (Target_x86_64): Likewise.
3107 * powerpc.cc (Target_powerpc): Likewise.
3108 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3109 first tls section has section symbol for optimised local dynamic
3111 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3112 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3114 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3115 Rename to relocate_relocs. Update error message.
3117 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3119 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3122 2012-08-31 Alan Modra <amodra@gmail.com>
3124 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3125 (Powerpc_relobj::toc_base_offset): New stub function.
3126 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3127 got_mod_index_offset to tlsld_got_offset. Update all refs.
3128 (Target_powerpc::Relocate::enum skip_tls): New.
3129 (Target_powerpc::call_tls_get_addr_): New var.
3130 (Target_powerpc::is_branch_reloc): Move to file scope.
3131 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3132 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3134 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3135 (powerpc_info): Correct common_pagesize for ppc64.
3136 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3137 (Powerpc_relocate_functions): Add overflow check enums and functions.
3138 Add non-shift version of rela, rela_ua. Delete all rel public
3139 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3140 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3141 addr16_ha3, addr14 functions.
3142 (Output_data_got_powerpc::add_constant_pair): New function.
3143 (Output_data_got_powerpc::got_base_offset): Likewise.
3144 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3145 (instruction constants): Sort, add some more.
3146 (Output_data_glink::do_write): Add and use Address typedef. Use
3147 object->toc_base_offset() stub for 64-bit.
3148 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3149 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3150 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3151 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3152 Always treat .opd relocs as against locally defined symbol.
3153 Correct condition for RELATIVE relocs.
3154 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3155 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3156 for 32-bit syms with a plt entry. Correct ppc64 toc base
3157 calculations. Handle TLS relocs, and more. Add overflow
3158 checking and adjust for Powerpc_relocate_functions changes.
3159 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3160 Reinstate --emit-relocs code with FIXME.
3162 2012-08-30 Alan Modra <amodra@gmail.com>
3164 * layout.cc (Layout::set_segment_offsets): Set p_align to
3165 abi_pagesize, not common_pagesize.
3166 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3167 to determine whether file header can go in segment.
3169 2012-08-30 Alan Modra <amodra@gmail.com>
3171 * output.h (Output_reloc::Output_reloc <output section>): Add
3172 is_relative param. Adjust calls.
3173 (Output_reloc::add_output_section_relative): New functions.
3174 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3176 (Output_reloc::symbol_value): Handle SECTION_CODE.
3178 2012-08-24 Sriraman Tallam <tmsriram@google.com>
3180 * gold.cc (queue_middle_tasks): Call layout again when unique
3181 segments for sections is desired.
3182 * layout.cc (Layout::Layout): Initialize new members.
3183 (Layout::get_output_section_flags): New function.
3184 (Layout::choose_output_section): Call get_output_section_flags.
3185 (Layout::layout): Make output section for mapping to a unique segment.
3186 (Layout::insert_section_segment_map): New function.
3187 (Layout::attach_allocated_section_to_segment): Make unique segment for
3188 output sections marked so.
3189 (Layout::segment_precedes): Check for unique segments when sorting.
3190 * layout.h (Layout::Unique_segment_info): New struct.
3191 (Layout::Section_segment_map): New typedef.
3192 (Layout::insert_section_segment_map): New function.
3193 (Layout::get_output_section_flags): New function.
3194 (Layout::is_unique_segment_for_sections_specified): New function.
3195 (Layout::set_unique_segment_for_sections_specified): New function.
3196 (Layout::unique_segment_for_sections_specified_): New member.
3197 (Layout::section_segment_map_): New member.
3198 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3199 Rename is_gc_pass_one to is_pass_one.
3200 Rename is_gc_pass_two to is_pass_two.
3201 Rename is_gc_or_icf to is_two_pass.
3202 Check for which pass based on whether symbols data is present.
3203 Make it two pass when unique segments for sections is desired.
3204 * output.cc (Output_section::Output_section): Initialize new
3206 * output.h (Output_section::is_unique_segment): New function.
3207 (Output_section::set_is_unique_segment): New function.
3208 (Output_section::is_unique_segment_): New member.
3209 (Output_section::extra_segment_flags): New function.
3210 (Output_section::set_extra_segment_flags): New function.
3211 (Output_section::extra_segment_flags_): New member.
3212 (Output_section::segment_alignment): New function.
3213 (Output_section::set_segment_alignment): New function.
3214 (Output_section::segment_alignment_): New member.
3215 (Output_segment::Output_segment): Initialize is_unique_segment_.
3216 (Output_segment::is_unique_segment): New function.
3217 (Output_segment::set_is_unique_segment): New function.
3218 (Output_segment::is_unique_segment_): New member.
3219 * plugin.cc (allow_unique_segment_for_sections): New function.
3220 (unique_segment_for_sections): New function.
3221 (Plugin::load): Add new functions to transfer vector.
3222 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3223 * Makefile.in: Regenerate.
3224 * testsuite/plugin_final_layout.sh: Check if unique segment
3225 functionality works.
3226 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3228 (allow_unique_segment_for_sections): New global.
3229 (unique_segment_for_sections): New global.
3230 (claim_file_hook): Call allow_unique_segment_for_sections.
3231 (all_symbols_read_hook): Call unique_segment_for_sections.
3233 2012-08-22 Cary Coutant <ccoutant@google.com>
3235 * layout.cc (Layout::include_section): Don't assert on GROUP
3236 sections with --emit-relocs.
3238 2012-08-21 Cary Coutant <ccoutant@google.com>
3240 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3241 if --export-dynamic-symbol names an undef symbol.
3243 2012-08-18 Alan Modra <amodra@gmail.com>
3245 * powerpc.cc: Formatting and white space.
3246 (Powerpc_relobj): Rename got2_section_ to special_.
3247 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3248 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3249 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3250 (Target_powerpc): Add Address typedef and invalid_address. Use
3252 (Target_powerpc::is_branch_reloc): New function.
3253 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3254 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3255 for dst_mask, value and addend.
3256 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3257 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3258 (Output_data_glink::do_write): Correct toc base. Don't try to use
3259 uint16_t for 24-bit offset. Use get_output_section_offset and
3261 (Target_powerpc::Scan::local): Handle more relocs.
3262 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3263 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3264 Plug in toc restoring insn after plt calls. Translate branches
3265 to function descriptor symbols to corresponding entry point.
3266 (Target_powerpc::relocate_for_relocatable): Check return from
3267 get_output_section_offset.
3268 * symtab.h: Comment typo.
3270 2012-08-14 Ian Lance Taylor <iant@google.com>
3272 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3273 unsupported_relocal_local to call unsupported_reloc_global.
3275 2012-08-14 Nick Clifton <nickc@redhat.com>
3278 * script-sections.cc (Sections_element::output_section_name): Add
3279 keep return parameter.
3280 (Output_section_element::match_name): Add keep return parameter.
3281 Return the value of the keep_ member.
3282 * script-sections.h (class Output_section): Update
3283 output_section_name prototype.
3284 * layout.cc (Layout::keep_input_section): New public member
3286 (Layout::choose_output_section): Pass keep parameter to
3287 output_section_name.
3288 * layout.h (class Layout): Add keep_input_section.
3289 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3291 * testsuite/Makefile.am: Add a test.
3292 * testsuite/Makefile.in: Regenerate.
3293 * testsuite/pr14265.c: Source file for the test.
3294 * testsuite/pr14265.t: Linker script for the test.
3295 * testsuite/pr14265.sh: Shell script for the test.
3297 2012-08-14 Alan Modra <amodra@gmail.com>
3299 * target.h (Target::output_section_name): New function.
3300 (Target::do_output_section_name): New function.
3301 * layout.cc (Layout::choose_output_section): Call the above.
3302 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3304 2012-08-14 Alan Modra <amodra@gmail.com>
3306 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3307 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3308 for replace_constant call.
3309 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3310 (Output_data_glink::do_print_to_mapfile): New function.
3311 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3312 (Target_powerpc::Relocate::relocate): Likewise.
3314 2012-08-14 Alan Modra <amodra@gmail.com>
3316 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3317 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3318 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3319 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3320 all references to shndx_. Handle special case for R_PPC_PLTREL24
3322 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3323 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3324 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3326 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3327 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3329 2012-08-12 Alan Modra <amodra@gmail.com>
3331 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3332 (glink insn constants): Use uint32_t.
3333 (Output_data_glink::add_entry): Use insert, not [] operator.
3335 2012-08-11 Alan Modra <amodra@gmail.com>
3337 * object.h (Sized_relobj_file::find_shdr): New function.
3338 (Sized_relobj_file::find_special_sections): New function.
3339 * object.cc (Sized_relobj_file::find_shdr): New function.
3340 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3341 (Sized_relobj_file::find_special_sections): New function, split out..
3342 (Sized_relobj_file::do_read_symbols): ..from here.
3343 * output.h (Output_data_got::replace_constant): New function.
3344 (Output_data_got::num_entries): New function.
3345 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3346 (Output_data_got::got_offset): Protected rather than private.
3347 (Output_data_got::replace_got_entry): New function.
3348 * output.cc (Output_data_got::replace_got_entry): New function.
3349 * powerpc.cc (class Powerpc_relobj): New.
3350 (class Powerpc_relocate_functions): Delete all psymval variants or
3351 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3352 Implement _ha functions using corresponding _hi function.
3353 (Powerpc_relobj::find_special_sections): New function.
3354 (Target_powerpc::do_make_elf_object): New function.
3355 (class Output_data_got_powerpc): New.
3356 (class Output_data_glink): New.
3357 (class Powerpc_scan_relocatable_reloc): New.
3358 Many more changes througout file.
3360 2012-08-09 Nick Clifton <nickc@redhat.com>
3362 * po/vi.po: Updated Vietnamese translation.
3364 2012-08-07 Ian Lance Taylor <iant@google.com>
3366 * layout.cc (Layout::add_target_dynamic_tags): If
3367 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3370 2012-07-30 Nick Clifton <nickc@redhat.com>
3372 * po/gold.pot: Updated template.
3373 * po/es.po: Updated Spanish translation.
3375 2012-07-18 Cary Coutant <ccoutant@google.com>
3378 * configure.ac: Add check for -gpubnames support.
3379 * configure: Regenerate.
3380 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3381 support; force -gno-pubnames.
3382 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3384 (gdb_index_test_4): New test.
3385 * testsuite/Makefile.in: Regenerate.
3386 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3387 * testsuite/gdb_index_test_2.sh: Likewise.
3388 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3389 * testsuite/gdb_index_test_4.sh: New script.
3390 * testsuite/gdb_index_test_comm.sh: New script with common code;
3391 don't look for space after colon.
3393 2012-07-16 Sriraman Tallam <tmsriram@google.com>
3395 * gold.cc (queue_middle_tasks): Update function order only after
3396 deferred objects due to plugins are processed.
3398 2012-07-11 Ian Lance Taylor <iant@google.com>
3400 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3401 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3402 (Target_arm::scan_reloc_for_stub): Likewise.
3403 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3404 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3405 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3406 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3407 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3409 2012-07-10 Dodji Seketeli <dodji@redhat.com>
3410 Ian Lance Taylor <iant@google.com>
3413 * configure.ac: Test whether std::tr1::hash<off_t> works.
3414 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3416 * output.h (class Output_fill): Add virtual destructor.
3417 * configure, config.in: Rebuild.
3419 2012-06-22 Roland McGrath <mcgrathr@google.com>
3421 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3423 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3425 * plugin.cc (Plugin::load): Handle position independent executables.
3427 2012-06-06 Cary Coutant <ccoutant@google.com>
3429 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3431 (lines_only_debug_sections): Likewise.
3432 (gdb_fast_lookup_sections): New static array.
3433 (is_gdb_debug_section): Rename formal parameter.
3434 (is_lines_only_debug_section): Likewise.
3435 (is_gdb_fast_lookup_section): New function.
3436 (Layout::include_section): Check for ".zdebug_" prefix; pass
3437 section name suffix to is_gdb_debug_section, et al.; check for
3438 fast-lookup sections when building .gdb_index.
3439 * options.h (--strip-debug-gdb): Update GDB version number.
3441 2012-06-06 Cary Coutant <ccoutant@google.com>
3443 * configure.ac: Add check for fallocate.
3444 * configure: Regenerate.
3445 * config.in: Regenerate.
3447 * options.h (class General_options): Add --mmap-output-file and
3448 --posix-fallocate options.
3449 * output.cc: (posix_fallocate): Remove; replace with...
3450 (gold_fallocate): New function.
3451 (Output_file::map_no_anonymous): Call gold_fallocate.
3452 (Output_file::map): Check --mmap-output-file option.
3454 2012-06-05 Jing Yu <jingyu@google.com>
3456 * gold.h (textdomain): Add do {} to empty while(0).
3457 (bindtextdomain): Likewise.
3459 2012-06-04 Cary Coutant <ccoutant@google.com>
3461 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3464 2012-05-25 Sriraman Tallam <tmsriram@google.com>
3466 * symtab.cc (Symbol_table::define_special_symbol):
3467 Initialize *poldsym to prevent uninitialized variable errors.
3469 2012-05-23 Cary Coutant <ccoutant@google.com>
3471 * layout.cc (Layout::section_name_mapping): Add rules to handle
3472 exact match on .data.rel.ro.local or .data.rel.ro.
3473 (Layout::output_section_name): Check for exact matches.
3475 2012-05-23 Cary Coutant <ccoutant@google.com>
3477 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3480 2012-05-22 Cary Coutant <ccoutant@google.com>
3482 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3483 object before exporting symbol.
3485 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3487 * testsuite/tls_test.cc: Include "config.h" first.
3488 * testsuite/tls_test_c.c: Likewise.
3490 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
3491 Nick Clifton <nickc@redhat.com>
3494 * configure.in: Add check that sysdep.h has been included before
3495 any system header files.
3496 * configure: Regenerate.
3497 * config.in: Regenerate.
3499 2012-05-14 Cary Coutant <ccoutant@google.com>
3501 * layout.cc (Layout::make_output_section): Mark .tdata section
3503 * testsuite/relro_test.cc: Add a TLS variable.
3505 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3508 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3509 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3512 2012-05-08 Cary Coutant <ccoutant@google.com>
3514 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3515 (lines_only_debug_sections): Likewise.
3517 2012-05-02 Roland McGrath <mcgrathr@google.com>
3519 * nacl.cc: New file.
3521 * Makefile.am (CCFILES, HFILES): Add them.
3522 * Makefile.in: Regenerate.
3523 * i386.cc (Output_data_plt_i386_nacl): New class.
3524 (Output_data_plt_i386_nacl_exec): New class.
3525 (Output_data_plt_i386_nacl_dyn): New class.
3526 (Target_i386_nacl): New class.
3527 (Target_selector_i386_nacl): New class.
3528 (target_selector_i386): Use it instead of Target_selector_i386.
3529 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3530 (Target_x86_64_nacl): New class.
3531 (Target_selector_x86_64_nacl): New class.
3532 (target_selector_x86_64, target_selector_x32): Use it instead of
3533 Target_selector_x86_64.
3534 * arm.cc (Output_data_plt_arm_nacl): New class.
3535 (Target_arm_nacl): New class.
3536 (Target_selector_arm_nacl): New class.
3537 (target_selector_arm, target_selector_armbe): Use it instead of
3538 Target_selector_arm.
3540 * target-select.cc (select_target): Take new Input_file* and off_t
3541 arguments, pass them on to recognize method of selector.
3542 * object.cc (make_elf_sized_object): Update caller.
3543 * parameters.cc (parameters_force_valid_target): Likewise.
3544 * incremental.cc (make_sized_incremental_binary): Likewise.
3545 * target-select.h: Update decl.
3546 (Target_selector::recognize): Take new Input_file* argument,
3547 pass it on to do_recognize.
3548 (Target_selector::do_recognize): Take new Input_file* argument.
3549 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3550 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3551 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3552 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3554 * target.h (Target::Target_info): New members isolate_execinstr
3556 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3557 * arm.cc (Target_arm::arm_info): Update initializer.
3558 * i386.cc (Target_i386::i386_info): Likewise.
3559 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3560 * sparc.cc (Target_sparc::sparc_info): Likewise.
3561 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3562 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3563 * layout.cc (Layout::attach_allocated_section_to_segment):
3564 Take new const Target* argument. If target->isolate_execinstr(), act
3566 (Layout::find_first_load_seg): Take new const Target* argument;
3567 if target->isolate_execinstr(), reject PF_X segments.
3568 (Layout::relaxation_loop_body): Update caller.
3569 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3570 reset file offset to zero when we hit LOAD_SEG, and then do a second
3571 loop over the segments before LOAD_SEG to reassign offsets after
3572 addresses have been determined. Handle target->rosegment_gap().
3573 (Layout::attach_section_to_segment): Take new const Target* argument;
3574 pass it to attach_allocated_section_to_segment.
3575 (Layout::make_output_section): Update caller.
3576 (Layout::attach_sections_to_segments): Take new const Target* argument;
3577 pass it to attach_section_to_segment.
3578 * gold.cc (queue_middle_tasks): Update caller.
3579 * layout.h (Layout): Update method decls with new arguments.
3581 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3582 Target_info pointer to use.
3583 (Target_arm::do_make_data_plt): New virtual method.
3584 (Target_arm::make_data_plt): New method that calls it.
3585 (Target_arm::make_plt_entry): Use it.
3586 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3587 for the section alignment.
3588 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3590 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3591 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3593 (Output_data_plt_arm::get_plt_entry_size): Call it.
3594 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3595 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3596 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3598 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3599 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3600 method instead of sizeof(plt_entry).
3601 (Output_data_plt_arm::add_entry): Likewise.
3602 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3603 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3605 (Target_arm::plt_entry_size): Likewise.
3606 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3608 (Output_data_plt_arm_standard): ... here, new class.
3609 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3610 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3611 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3613 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3614 Take additional argument for the PLT entry size.
3615 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3616 Use get_plt_entry_size method rather than plt_entry_size variable.
3617 (Output_data_plt_x86_64::reserve_slot): Likewise.
3618 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3619 (Output_data_plt_x86_64::add_entry): Likewise.
3620 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3621 (Output_data_plt_x86_64::address_for_global): Likewise.
3622 (Output_data_plt_x86_64::address_for_local): Likewise.
3623 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3624 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3625 Make method non-static.
3626 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3628 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3629 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3630 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3631 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3633 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3634 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3636 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3637 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3639 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3640 (Output_data_plt_x86_64::plt_entry_size)
3641 (Output_data_plt_x86_64::first_plt_entry)
3642 (Output_data_plt_x86_64::plt_entry)
3643 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3644 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3645 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3646 (Output_data_plt_x86_64_standard): ... here, new class.
3647 (Target_x86_64::Target_x86_64): Take optional argument for the
3648 Target_info pointer to use.
3649 (Target_x86_64::do_make_data_plt): New virtual method.
3650 (Target_x86_64::make_data_plt): New method to call it.
3651 (Target_x86_64::init_got_plt_for_update): Use that.
3652 Call this->plt_->add_eh_frame method here.
3653 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3654 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3655 rather than static method.
3656 (Target_x86_64::plt_entry_size): Likewise.
3657 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3658 rather than plt_entry_size variable. Move guts of PLT filling to...
3659 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3660 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3661 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3663 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3664 additional argument for the section alignment.
3665 Don't do add_eh_frame_for_plt here.
3666 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3667 non-static. Use get_plt_entry_size method rather than plt_entry_size
3669 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3671 (Output_data_plt_i386::get_plt_entry_size): Call it.
3672 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3673 (Output_data_plt_i386::add_eh_frame): New method to call it.
3674 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3676 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3677 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3679 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3680 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3681 method instead of plt_entry_size.
3682 (Output_data_plt_i386::plt_entry_size)
3683 (Output_data_plt_i386::plt_eh_frame_fde_size)
3684 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3685 (Output_data_plt_i386_standard): ... here, new class.
3686 (Output_data_plt_i386_exec): New class.
3687 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3688 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3689 (Output_data_plt_i386::exec_plt_entry): Move to ...
3690 (Output_data_plt_i386_exec::plt_entry): ... here.
3691 (Output_data_plt_i386_dyn): New class.
3692 (Output_data_plt_i386::first_plt_entry): Move to ...
3693 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3694 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3695 (Output_data_plt_i386_dyn::plt_entry): ... here.
3696 (Target_i386::Target_i386): Take optional argument for the Target_info
3698 (Target_i386::do_make_data_plt): New virtual method.
3699 (Target_i386::make_data_plt): New method to call it.
3700 (Target_i386::make_plt_section): Use that.
3701 Call this->plt_->add_eh_frame method here.
3702 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3703 rather than plt_entry_size variable.
3704 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3705 (Output_data_plt_i386::address_for_local): Likewise.
3706 (Output_data_plt_i386::do_write): Likewise.
3707 Move guts of PLT filling to...
3708 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3709 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3710 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3711 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3713 2012-05-01 Cary Coutant <ccoutant@google.com>
3715 * dwarf_reader.cc (Dwarf_die::read_attributes)
3716 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3717 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3718 * reduced_debug_output.cc
3719 (Output_reduced_debug_info_section::get_die_end): Remove
3720 DW_FORM_GNU_ref_index. Add default case.
3722 2012-04-26 Mark Wielaard <mjw@redhat.com>
3724 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3725 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3726 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3727 DW_AT_high_pc as offset from DW_AT_low_pc.
3729 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3730 * testsuite/Makefile.in: Regenerate.
3731 * testsuite/gdb_index_test_3.c: New test source file.
3732 * testsuite/gdb_index_test_3.sh: New test source file.
3734 2012-04-25 Ian Lance Taylor <iant@google.com>
3736 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3738 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3739 as a class, not a struct.
3740 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3741 (Target_arm::apply_cortex_a8_workaround): Likewise.
3742 * gc.h: Declare Reloc_types as a struct, not a class.
3743 * object.h: Declare Symbols_data as a struct.
3744 * reloc.h: Declare Read_relocs_data as a struct.
3745 * target.h: Declare Relocate_info as a struct.
3747 2012-04-24 David S. Miller <davem@davemloft.net>
3749 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3750 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3753 2012-04-24 Cary Coutant <ccoutant@google.com>
3755 * incremental-dump.cc (find_input_containing_global): Replace
3756 magic number with symbolic constant.
3757 (dump_incremental_inputs): Update version number.
3758 * incremental.cc (Output_section_incremental_inputs): Update version
3759 number; import symbolic constants from Incremental_inputs_reader.
3760 (Incremental_inputs::create_data_sections): Align relocations
3761 section correctly for 64-bit targets.
3762 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3763 constants; add padding.
3764 (Output_section_incremental_inputs::write_header): Add assert for
3766 (Output_section_incremental_inputs::write_input_files): Add assert
3767 for input_entry_size.
3768 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3769 add assert for object_info_size, input_section_entry_size,
3770 global_sym_entry_size.
3771 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3772 for data structure sizes; use them.
3773 (Incremental_input_entry_reader): Import symbolic constants from
3774 Incremental_inputs_reader; use them.
3776 2012-04-23 David S. Miller <davem@davemloft.net>
3778 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3780 (Target_sparc::Target_sparc): Initialize new fields.
3781 (Target_sparc::do_make_elf_object): New function.
3782 (Target_sparc::do_adjust_elf_header): New function.
3784 2012-04-23 Cary Coutant <ccoutant@google.com>
3786 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3787 CU range table of gdb index.
3789 2012-04-20 David S. Miller <davem@davemloft.net>
3791 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3794 2012-04-16 David S. Miller <davem@davemloft.net>
3796 * sparc.cc (Target_sparc::got_address): New function.
3797 (Sparc_relocate_functions::gdop_hix22): New function.
3798 (Sparc_relocate_functions::gdop_lox10): New function.
3799 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3801 (Target_sparc::Scan::local): Likewise if the global symbol is not
3802 preemptible and is not IFUNC.
3803 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3804 transformations for local and non-preemptible non-IFUNC global
3807 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3808 writing out 64-bit part of ranges.
3810 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3811 -fpic and -fpie respectively.
3812 * Makefile.in: Regenerate.
3814 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3815 (Target_sparc::Target_sparc): Initialize new field.
3816 (Target_sparc::do_plt_section_for_global): New function.
3817 (Target_sparc::do_plt_section_for_local): New function.
3818 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3819 (Target_sparc::make_plt_section): New function, broken out of
3820 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3821 (Target_sparc::make_plt_entry): Call make_plt_section.
3822 (Target_sparc::make_local_ifunc_plt_entry): New function.
3823 (Target_sparc::rela_ifunc_section): New function.
3824 (Target_sparc::plt_section): Remove const.
3825 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3826 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3827 and ifunc_count_ fields.
3828 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3829 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3830 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3831 (Output_data_plt_sparc::rela_ifunc): New function.
3832 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3833 (Output_data_plt_sparc::has_ifunc_section): New function.
3834 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3835 (Output_data_plt_sparc::address_for_global): New function.
3836 (Output_data_plt_sparc::address_for_local): New function.
3837 (Output_data_plt_sparc::plt_index_to_offset): New function.
3838 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3840 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3842 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3843 R_SPARC_JMP_IREL to switch.
3844 (Target_sparc::Scan::check_non_pic): Likewise.
3845 (Target_sparc::Scan::local): Handle IFUNC symbols.
3846 (Target_sparc::Scan::local): Likewise.
3847 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3848 and plt_address_for_local.
3849 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3850 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3852 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3853 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3854 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3855 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3857 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3858 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3860 * sparc.cc (Target_sparc::Scan::global): Likewise.
3861 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3863 2012-04-16 Cary Coutant <ccoutant@google.com>
3865 * archive.cc (Library_base::should_include_member): Check for
3866 --export-dynamic-symbol.
3867 * options.h (class General_options): Add --export-dynamic-symbol.
3868 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3869 --export-dynamic-symbol.
3870 (Symbol_table::gc_mark_undef_symbols): Likewise.
3871 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3873 2012-04-12 David S. Miller <davem@davemloft.net>
3875 * sparc.cc (Reloc::wdisp10): New relocation method.
3876 (Reloc::h34): Likewise.
3877 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3878 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3880 (Target_sparc::Scan::local): Likewise.
3881 (Target_sparc::Scan::global): Likewise.
3882 (Target_sparc::Relocate::relocate): Likewise.
3884 2012-04-09 Cary Coutant <ccoutant@google.com>
3886 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3889 2012-04-06 Ian Lance Taylor <iant@google.com>
3891 * timer.cc: #include <unistd.h>.
3893 2012-04-06 Roland McGrath <mcgrathr@google.com>
3895 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3896 * config.in: Regenerate.
3897 * configure: Regenerate.
3899 2012-04-05 Nick Clifton <nickc@redhat.com>
3901 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3902 (AM_LC_MESSAGES): Add.
3903 * aclocal.m4: Regenerate.
3904 * config.in: Regenerate.
3905 * configure: Regenerate.
3907 2012-03-21 Cary Coutant <ccoutant@google.com>
3909 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3910 * Makefile.in: Regenerate.
3911 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3912 (Sized_elf_reloc_mapper::symbol_section): New function.
3913 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3914 (make_elf_reloc_mapper): New function.
3915 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3916 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3917 (Dwarf_abbrev_table::do_get_abbrev): New function.
3918 (Dwarf_ranges_table::read_ranges_table): New function.
3919 (Dwarf_ranges_table::read_range_list): New function.
3920 (Dwarf_pubnames_table::read_section): New function.
3921 (Dwarf_pubnames_table::read_header): New function.
3922 (Dwarf_pubnames_table::next_name): New function.
3923 (Dwarf_die::Dwarf_die): New function.
3924 (Dwarf_die::read_attributes): New function.
3925 (Dwarf_die::skip_attributes): New function.
3926 (Dwarf_die::set_name): New function.
3927 (Dwarf_die::set_linkage_name): New function.
3928 (Dwarf_die::attribute): New function.
3929 (Dwarf_die::string_attribute): New function.
3930 (Dwarf_die::int_attribute): New function.
3931 (Dwarf_die::uint_attribute): New function.
3932 (Dwarf_die::ref_attribute): New function.
3933 (Dwarf_die::child_offset): New function.
3934 (Dwarf_die::sibling_offset): New function.
3935 (Dwarf_info_reader::check_buffer): New function.
3936 (Dwarf_info_reader::parse): New function.
3937 (Dwarf_info_reader::do_parse): New function.
3938 (Dwarf_info_reader::do_read_string_table): New function.
3939 (Dwarf_info_reader::lookup_reloc): New function.
3940 (Dwarf_info_reader::get_string): New function.
3941 (Dwarf_info_reader::visit_compilation_unit): New function.
3942 (Dwarf_info_reader::visit_type_unit): New function.
3943 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3944 Sized_elf_reloc_mapper.
3945 (Sized_dwarf_line_info::symbol_section): Remove function.
3946 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3947 (Sized_dwarf_line_info::read_line_mappings): Remove object
3948 parameter, adjust callers.
3949 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3950 * dwarf_reader.h: Include <sys/types.h>.
3951 (class Track_relocs): Remove forward declaration.
3952 (class Elf_reloc_mapper): New class.
3953 (class Sized_elf_reloc_mapper): New class.
3954 (class Dwarf_abbrev_table): New class.
3955 (class Dwarf_range_list): New class.
3956 (class Dwarf_ranges_table): New class.
3957 (class Dwarf_pubnames_table): New class.
3958 (class Dwarf_die): New class.
3959 (class Dwarf_info_reader): New class.
3960 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3961 (Sized_dwarf_line_info::symbol_section): Remove member function.
3962 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3964 * gdb-index.cc: New source file.
3965 * gdb-index.h: New source file.
3966 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3967 and .debug_types sections, call Layout::add_to_gdb_index.
3968 (Sized_relobj_incr::do_section_name): Implement.
3969 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3970 return type; Implement.
3971 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3973 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3974 parameter list and return type.
3975 (Sized_incr_dynobj::do_section_contents): Likewise.
3976 * layout.cc: Include gdb-index.h.
3977 (Layout::Layout): Initialize gdb_index_data_.
3978 (Layout::init_fixed_output_section): Check for .gdb_index section.
3979 (Layout::add_to_gdb_index): New function. Instantiate.
3980 * layout.h: Add forward declaration for class Gdb_index.
3981 (Layout::add_to_gdb_index): New member function.
3982 (Layout::gdb_index_data_): New data member.
3983 * main.cc: Include gdb-index.h.
3984 (main): Print statistics for gdb index.
3985 * object.cc (Object::section_contents): Move code into
3986 do_section_contents.
3987 (need_decompressed_section): Check for sections needed when building
3989 (build_compressed_section_map): Likewise.
3990 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3992 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3993 sections; call Layout::add_to_gdb_index.
3994 (Sized_relobj_file::do_decompressed_section_contents): Call
3995 do_section_contents directly.
3996 * object.h (Object::do_section_contents): Adjust parameter list and
3998 (Object::do_decompressed_section_contents): Call do_section_contents
4000 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4002 * options.h (class General_options): Add --gdb-index option.
4003 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4004 list and return type.
4005 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4006 * reloc.h (Track_relocs::checkpoint): New function.
4007 (Track_relocs::reset): New function.
4009 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4011 * testsuite/Makefile.in: Regenerate.
4012 * testsuite/gdb_index_test.cc: New test source file.
4013 * testsuite/gdb_index_test_1.sh: New test source file.
4014 * testsuite/gdb_index_test_2.sh: New test source file.
4016 2012-03-19 Doug Kwan <dougkwan@google.com>
4018 * arm.cc (Target_arm::do_define_standard_symbols): New method.
4019 (Target_arm::do_finalize_sections): Remove code which defines
4020 __exidx_start and __exidx_end. Make symbol table parameter
4021 anonymous as it is not used.
4022 * gold.cc (queue_middle_tasks): Call target hook to define any
4023 target-specific symbols.
4024 * target.h (Target::define_standard_symbols): New method.
4025 (Target::do_define_standard_symbols): Same.
4026 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4027 * testsuite/Makefile.in: Regenerate.
4028 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4030 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4031 relocations are generated for __exidx_start and __exidx_end.
4033 2012-03-16 Doug Kwan <dougkwan@google.com>
4035 * testsuite/Makefile.am: Disable test initpri3b.
4036 * testsuite/Makefile.in: Regenerate.
4038 2012-03-15 Doug Kwan <dougkwan@google.com>
4040 * arm.cc (Target_arm::got_section): Make .got section read-only
4043 2012-03-15 Ian Lance Taylor <iant@google.com>
4046 * layout.cc (Layout::make_output_section): Correctly mark
4047 SHT_INIT_ARRAY, et. al., as relro.
4049 2012-03-14 Doug Kwan <dougkwan@google.com>
4051 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4052 dynamic relocations for protected symbols in shared objects.
4054 2012-03-13 Ian Lance Taylor <iant@google.com>
4056 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4057 keep the larger alignment.
4059 2012-03-12 Cary Coutant <ccoutant@google.com>
4061 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4062 handling of DW_LNE_define_file.
4064 2012-03-12 Cary Coutant <ccoutant@google.com>
4066 * reduced_debug_output.cc
4067 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4070 2012-02-29 Cary Coutant <ccoutant@google.com>
4072 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4074 2012-02-29 Cary Coutant <ccoutant@google.com>
4076 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4077 Call Object::decompressed_section_contents.
4078 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4080 (Sized_dwarf_line_info::buffer_start_): New data member.
4081 * merge.cc (Output_merge_data::do_add_input_section): Call
4082 Object::decompressed_section_contents.
4083 (Output_merge_string::do_add_input_section): Likewise.
4084 * object.cc (need_decompressed_section): New function.
4085 (build_compressed_section_map): Decompress sections needed later.
4086 (Sized_relobj_file::do_decompressed_section_contents): New function.
4087 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4088 * object.h (Object::decompressed_section_contents): New function.
4089 (Object::discard_decompressed_sections): New function.
4090 (Object::do_decompressed_section_contents): New function.
4091 (Object::do_discard_decompressed_sections): New function.
4092 (Compressed_section_info): New type.
4093 (Compressed_section_map): Include decompressed section contents.
4094 (Sized_relobj_file::do_decompressed_section_contents): New function.
4095 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4097 2012-02-16 Cary Coutant <ccoutant@google.com>
4099 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4100 * testsuite/Makefile.in: Regenerate.
4102 2012-02-14 Cary Coutant <ccoutant@google.com>
4104 * options.cc (General_options::finalize): Disallow -pie and -static.
4106 2012-02-03 Doug Kwan <dougkwan@google.com>
4108 * arm.cc (Arm_relocate_functions::abs8,
4109 Arm_relocate_functions::abs16): Use
4110 Bits::has_signed_unsigned_overflow32.
4111 (Arm_relocate_functions::thm_abs8): Correct range of
4113 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4116 2012-02-02 Doug Kwan <dougkwan@google.com>
4118 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4119 position independent outputs, not just shared objects.
4121 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4123 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4124 * configure: Regenerated.
4126 2012-01-27 Ian Lance Taylor <iant@google.com>
4128 * reloc.h (Bits): New class with static functions, copied from
4129 namespace utils in arm.cc.
4130 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4133 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4135 * incremental.cc (write_info_blocks): Correct relocation offset.
4137 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4139 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4140 (Relocate::tls_gd_to_le): Likewise.
4142 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4144 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4146 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4148 * configure.ac: Check if -mcmodel=medium works.
4149 * configure: Regenerated.
4151 2012-01-24 Cary Coutant <ccoutant@google.com>
4153 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4155 (read_unsigned_LEB_128_x): ... this new function.
4156 (read_signed_LEB_128): Replaced with inline definition and ...
4157 (read_signed_LEB_128_x): ... this new function.
4158 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4159 (read_unsigned_LEB_128): Add inline definition.
4160 (read_signed_LEB_128_x): New function.
4161 (read_signed_LEB_128): Add inline definition.
4162 * testsuite/Makefile.am (leb128_unittest): New unit test.
4163 * testsuite/Makefile.in: Regenerate.
4164 * testsuite/leb128_unittest.cc: New unit test.
4166 2012-01-23 Ian Lance Taylor <iant@google.com>
4169 * i386.cc (Target_i386::do_code_fill): When using a jmp
4170 instruction, pad with nop instructions.
4171 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4173 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4175 * x86_64.cc (gc_process_relocs): Add typename on types used in
4177 (scan_relocs): Likewise.
4178 (relocate_section): Likewise.
4179 (apply_relocation): Likewise.
4181 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4183 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4184 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4187 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4189 * x86_64.cc: Initial support for x32.
4191 2012-01-03 Cary Coutant <ccoutant@google.com>
4193 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4194 Use abstract base class for GOT.
4195 * gold/output.h (class Output_data_got_base): New abstract base class.
4196 (class Output_data_got): Derive from new base class, adjust ctors.
4197 (Output_data_got::reserve_slot): Make virtual; rename to
4198 do_reserve_slot; Adjust callers.
4199 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4200 pointer to abstract base class.
4201 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4203 2011-12-18 Ian Lance Taylor <iant@google.com>
4205 * object.h (Relobj::local_symbol_value): New function.
4206 (Relobj::local_plt_offset): New function.
4207 (Relobj::local_has_got_offset): New function.
4208 (Relobj::local_got_offset): New function.
4209 (Relobj::set_local_got_offset): New function.
4210 (Relobj::do_local_symbol_value): New pure virtual function.
4211 (Relobj::do_local_plt_offset): Likewise.
4212 (Relobj::do_local_has_got_offset): Likewise.
4213 (Relobj::do_local_got_offset): Likewise.
4214 (Relobj::do_set_local_got_offset): Likewise.
4215 (Sized_relobj::do_local_has_got_offset): Rename from
4216 local_has_got_offset.
4217 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4218 (Sized_relobj::do_set_local_got_offset): Rename from
4219 set_local_got_offset.
4220 (Sized_relobj_file::do_local_plt_offset): Rename from
4222 (Sized_relobj_file::do_local_symbol_value): New function.
4223 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4225 * output.cc (Output_data_got::Got_entry::write): Change object to
4226 Relobj. Use local_symbol_value.
4227 (Output_data_got::add_global_with_rel): Change rel_dyn to
4228 Output_data_reloc_generic*. Use add_global_generic.
4229 (Output_data_got::add_global_with_rela): Remove. Change all
4230 callers to use add_global_with_rel.
4231 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4232 Output_data_reloc_generic*. Use add_global_generic.
4233 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4234 callers to use add_global_pair_with_rel.
4235 (Output_data_got::add_local): Change object to Relobj*.
4236 (Output_data_got::add_local_plt): Likewise.
4237 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4238 change rel_dyn to Output_data_reloc_generic*. Use
4240 (Output_data_got::add_local_with_rela): Remove. Change all
4241 callers to use all_local_with_rel.
4242 (Output_data_got::add_local_pair_with_rel): Change object to
4243 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4244 add_output_section_generic.
4245 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4246 callers to use add_local_pair_with_rel.
4247 (Output_data_got::reserve_local): Change object to Relobj*.
4248 * output.h: (class Output_data_reloc_generic): Add pure virtual
4249 declarations for add_global_generic, add_local_generic,
4250 add_output_section_generic.
4251 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4252 functions for Output_data_reloc_generic. Update declarations for
4253 changes listed in output.cc.
4254 (class Output_data_got): Change template parameter to got_size.
4255 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4256 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4258 (Sized_relobj_incr::do_local_plt_offset): New function.
4259 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4262 2011-12-17 Cary Coutant <ccoutant@google.com>
4264 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4265 * resolve.cc (Symbol_table::resolve): Likewise.
4266 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4268 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4270 2011-12-16 Ian Lance Taylor <iant@google.com>
4272 * output.h (Output_data_reloc_generic::add): Only call
4273 add_dynamic_reloc if this is a dynamic reloc section.
4275 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4278 * target-reloc.h (apply_relocation): Replace <64, false> with
4281 2011-11-25 Nick Clifton <nickc@redhat.com>
4283 * po/it.po: New Italian translation.
4285 2011-11-17 Sterling Augustine <saugustine@google.com>
4287 * script.cc (script_include_directive): Implement.
4288 (read_script_file): New local variables name and search_path. Update
4289 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4290 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4291 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4293 2011-11-11 Sterling Augustine <saugustine@google.com>
4295 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4296 (file_or_sections_cmd): Likewise.
4298 2011-11-11 Doug Kwan <dougkwan@google.com>
4300 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4301 if --just-symbols is given.
4303 2011-11-10 Doug Kwan <dougkwan@google.com>
4306 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4307 when processing data relocs.
4308 * reloc.h (Relocate_functions::rel_unaligned): New method.
4309 (Relocate_functions::pcrel_unaligned): Ditto.
4310 (Relocate_functions::rel32_unaligned): Ditto.
4311 (Relocate_functions::pcrel32_unaligned): Ditto.
4313 2011-11-09 Doug Kwan <dougkwan@google.com>
4316 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4317 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4318 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4319 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4320 (Relocate_functions::rel_unaligned): New.
4321 (Relocate_functions::rel32_unaligned): New.
4322 * target-reloc.h (relocate_for_relocatable): Add code to handle
4323 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4324 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4325 arm_unaligned_reloc_r): New targets.
4326 * testsuite/Makefile.in: Regenerate.
4327 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4330 2011-11-02 Ian Lance Taylor <iant@google.com>
4332 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4334 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4335 * options.cc (General_options::finalize): Use library search path
4336 from configure script if specified. If not native and no sysroot,
4337 only search TOOLLIBDIR.
4338 * options.h (Search_directory::Search_directory): Change name to
4340 (General_options::add_to_library_path_with_sysroot): Change arg to
4342 * configure, Makefile.in, config.in: Rebuild.
4344 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4346 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4347 we are working around the ARM1176 Erratum.
4348 * options.h (General_options::fix_arm1176): Add option.
4349 * testsuite/Makefile.am: Add testcases, and keep current ones
4351 * testsuite/Makefile.in: Regenerate.
4352 * testsuite/arm_fix_1176.s: New file.
4353 * testsuite/arm_fix_1176.sh: Likewise.
4355 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4357 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4359 (Target_arm::may_use_blx): Remove method.
4360 (Target_arm::set_may_use_blx): Likewise.
4361 (Target_arm::may_use_v4t_interworking): New method.
4362 (Target_arm::may_use_v5t_interworking): Likewise.
4363 (Target_arm::may_use_blx_): Remove member variable.
4364 (Arm_relocate_functions::arm_branch_common): Check for v5T
4366 (Arm_relocate_functions::thumb_branch_common): Likewise.
4367 (Reloc_stub::stub_type_for_reloc): Likewise.
4368 (Target_arm::do_finalize_sections): Correct interworking checks.
4369 * testsuite/Makefile.am: Add new tests.
4370 * testsuite/Makefile.in: Regenerate.
4371 * testsuite/arm_farcall_arm_arm.s: New test.
4372 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4373 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4374 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4375 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4376 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4377 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4378 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4380 2011-10-31 Cary Coutant <ccoutant@google.com>
4383 * expression.cc (Expression::eval_with_dot): Add
4384 is_section_dot_assignment parameter.
4385 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4386 absolute and assigning to dot within a section.
4387 * script-sections.cc
4388 (Output_section_element_assignment::set_section_addresses): Pass
4389 dot_section to set_if_absolute.
4390 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4391 as is_section_dot_assignment flag to eval_with_dot.
4392 (Output_section_element_dot_assignment::set_section_addresses):
4394 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4395 parameter. Also set value if relative to dot_section; set the
4396 symbol's output_section.
4397 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4398 parameter. Adjust all callers.
4399 (Expression::eval_maybe_dot): Likewise.
4400 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4402 * testsuite/script_test_2.t: Test assignment of an absolute value
4403 to dot within an output section element.
4405 2011-10-31 Cary Coutant <ccoutant@google.com>
4407 * options.h (class General_options): Add --[no-]gnu-unique options.
4408 * symtab.cc (Symbol_table::sized_write_globals): Convert
4409 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4411 2011-10-31 Cary Coutant <ccoutant@google.com>
4414 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4415 unnecessary assertion.
4416 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4418 2011-10-31 Sriraman Tallam <tmsriram@google.com>
4420 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4422 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4424 Change to just keep the section associated with symbol.
4425 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4426 they are externally visible and --export-dynamic is turned on.
4427 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4429 2011-10-19 Ian Lance Taylor <iant@google.com>
4432 * script-sections.cc
4433 (Output_section_element_dot_assignment::needs_output_section): New
4436 2011-10-19 Ian Lance Taylor <iant@google.com>
4439 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4440 --section-start option was seen.
4441 * options.h (General_options::any_section_start): New function.
4443 2011-10-18 David S. Miller <davem@davemloft.net>
4446 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4447 member to track relocation locations that have moved during TLS
4448 reloc optimizations.
4449 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4450 (Target_sparc::Relocate::relocate): Adjust view down by 4
4451 bytes if it matches reloc_adjust_addr_.
4452 (Target_sparc::Relocate::relocate_tls): Always move the
4453 __tls_get_addr call delay slot instruction forward 4 bytes when
4454 performing relaxation.
4456 2011-10-18 Cary Coutant <ccoutant@google.com>
4458 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4459 (Output_file::map_no_anonymous): Check for non-zero
4460 return code from posix_fallocate.
4462 2011-10-17 Cary Coutant <ccoutant@google.com>
4465 * plugin.cc (is_visible_from_outside): Check for symbols
4466 referenced from dynamic objects.
4467 * resolve.cc (Symbol_table::resolve): Don't count references
4468 from dynamic objects as references from real ELF files.
4469 * testsuite/plugin_test_2.sh: Adjust expected result.
4471 2011-10-17 Cary Coutant <ccoutant@google.com>
4473 * gold.cc: Include timer.h.
4474 (queue_middle_tasks): Stamp time.
4475 (queue_final_tasks): Likewise.
4476 * main.cc (main): Store timer in parameters. Print timers
4478 * parameters.cc (Parameters::Parameters): Initialize timer_.
4479 (Parameters::set_timer): New function.
4480 (set_parameters_timer): New function.
4481 * parameters.h (Parameters::set_timer): New function.
4482 (Parameters::timer): New function.
4483 (Parameters::timer_): New data member.
4484 (set_parameters_timer): New function.
4485 * timer.cc (Timer::stamp): New function.
4486 (Timer::get_pass_time): New function.
4487 * timer.h (Timer::stamp): New function.
4488 (Timer::get_pass_time): New function.
4489 (Timer::pass_times_): New data member.
4491 2011-10-17 Cary Coutant <ccoutant@google.com>
4493 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4494 task for members of lib groups.
4496 2011-10-17 Cary Coutant <ccoutant@google.com>
4499 * fileread.cc (File_read::find_view): Add assert.
4500 (File_read::make_view): Move bounds check (replace with assert)...
4501 (File_read::find_or_make_view): ... to here.
4503 2011-10-12 Cary Coutant <ccoutant@google.com>
4505 * output.cc (Output_file::open_base_file): Handle case where
4506 ::read returns less than requested size.
4508 2011-10-10 Cary Coutant <ccoutant@google.com>
4510 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
4511 Initialize defined_count_.
4512 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4513 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4514 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4515 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4516 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4517 * incremental.h (Sized_relobj_incr::defined_count_): New data
4519 (Sized_incr_dynobj::defined_count_): New data member.
4520 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
4521 Return zeroes instead of internal error.
4523 2011-10-10 Cary Coutant <ccoutant@google.com>
4526 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
4527 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4528 * output.h (class Output_reloc): Add use_plt_offset flag.
4529 (Output_reloc::type_): Adjust size of bit field.
4530 (Output_reloc::use_plt_offset_): New bit field.
4531 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4532 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4533 flag. Adjust all callers.
4534 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
4535 creating RELATIVE relocations.
4537 2011-10-10 Nick Clifton <nickc@redhat.com>
4539 * po/es.po: Updated Spanish translation.
4540 * po/fi.po: Updated Finnish translation.
4542 2011-10-03 Diego Novillo <dnovillo@google.com>
4544 * options.cc (parse_uint): Fix dereference of RETVAL.
4546 2011-09-29 Sriraman Tallam <tmsriram@google.com>
4548 * layout.h (section_order_map_): New member.
4549 (get_section_order_map): New member function.
4550 * output.cc (Output_section::add_input_section): Check for patterns
4551 only when --section-ordering-file is specified.
4552 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4553 output_sections have been formed.
4554 * layout.cc (Layout_Layout): Initialize section_order_map_.
4555 * plugin.cc (update_section_order): Store order in order_map. Do not
4557 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4558 * testsuite/Makefile.in: Regenerate.
4559 * testsuite/plugin_section_order.c: New file.
4560 * testsuite/plugin_final_layout.cc: New file.
4561 * testsuite/plugin_final_layout.sh: New file.
4563 2011-09-29 Cary Coutant <ccoutant@google.com>
4565 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4567 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
4568 symbols during incremental update.
4569 (Symbol_table::add_from_dynobj): Likewise.
4571 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4572 Ian Lance Taylor <iant@google.com>
4574 * symtab.cc (Symbol_table::define_special_symbol): Always
4575 canonicalize version string.
4577 2011-09-26 Cary Coutant <ccoutant@google.com>
4579 * gold.cc (queue_initial_tasks): Move option checks ...
4580 * options.cc (General_options::finalize): ... to here. Disable
4581 some options; make others fatal.
4583 2011-09-26 Cary Coutant <ccoutant@google.com>
4586 * plugin.cc (get_symbols_v2): New function.
4587 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4588 (is_referenced_from_outside): New function.
4589 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4590 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4591 (get_symbols): Pass version parameter.
4592 (get_symbols_v2): New function.
4593 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4595 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4596 (onload): Add LDPT_GET_SYMBOLS_V2.
4597 (all_symbols_read_hook): Use get_symbols_v2; check for
4598 LDPR_PREVAILING_DEF_IRONLY_EXP.
4599 * testsuite/plugin_test_3.sh: Update expected results.
4601 2011-09-23 Simon Baldwin <simonb@google.com>
4603 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4604 configuration options.
4605 * configure: Regenerate.
4606 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4607 * Makefile.in: Regenerate.
4608 * testsuite/Makefile.in: Regenerate.
4610 2011-09-19 Sriraman Tallam <tmsriram@google.com>
4612 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4614 2011-09-19 Cary Coutant <ccoutant@google.com>
4616 * incremental.cc (can_incremental_update): Fix typo in comment.
4617 * incremental.h (can_incremental_update): Likewise.
4619 2011-09-18 Cary Coutant <ccoutant@google.com>
4621 * incremental.cc (can_incremental_update): New function.
4622 * incremental.h (can_incremental_update): New function.
4623 * layout.cc (Layout::init_fixed_output_section): Call it.
4624 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4625 * object.cc (Sized_relobj_file::do_layout): Call
4626 can_incremental_update.
4628 2011-09-13 Cary Coutant <ccoutant@google.com>
4630 * configure.ac: Check for glibc support for gnu_indirect_function
4631 support with static linking, setting automake conditional
4633 * Makefile.in: Regenerate.
4634 * configure: Regenerate.
4636 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4637 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4639 * testsuite/Makefile.in: Regenerate.
4641 2011-09-13 Cary Coutant <ccoutant@google.com>
4643 * incremental.cc (Sized_relobj_incr::do_layout): Call
4644 report_comdat_group for kept comdat sections.
4645 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4646 * testsuite/Makefile.in: Regenerate.
4647 * testsuite/incr_comdat_test_1.cc: New source file.
4648 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4649 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4650 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4652 2011-09-13 Ian Lance Taylor <iant@google.com>
4654 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4655 variable external_symbols_offset.
4657 2011-09-12 Ian Lance Taylor <iant@google.com>
4659 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4660 triggered if object has no symbols.
4662 2011-09-09 David S. Miller <davem@davemloft.net>
4664 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4665 (Output_fill_debug_line::do_write): Likewise.
4667 2011-08-29 Cary Coutant <ccoutant@google.com>
4669 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4670 casts to match formatting specs.
4671 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4673 2011-08-26 Cary Coutant <ccoutant@google.com>
4675 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4676 remaining hole size when allocating.
4677 (Layout::make_output_section): Set fill methods for debug sections.
4678 * layout.h (Free_list::Free_list_node): Move from private to
4680 (Free_list::set_min_hole_size): New function.
4681 (Free_list::begin, Free_list::end): New functions.
4682 (Free_list::min_hole_): New data member.
4683 * output.cc: Include dwarf.h.
4684 (Output_fill_debug_info::do_minimum_hole_size): New function.
4685 (Output_fill_debug_info::do_write): New function.
4686 (Output_fill_debug_line::do_minimum_hole_size): New function.
4687 (Output_fill_debug_line::do_write): New function.
4688 (Output_section::Output_section): Initialize new data member.
4689 (Output_section::set_final_data_size): Ensure patch space is larger
4690 than minimum hole size.
4691 (Output_section::do_write): Fill holes in debug sections.
4692 * output.h (Output_fill): New class.
4693 (Output_fill_debug_info): New class.
4694 (Output_fill_debug_line): New class.
4695 (Output_section::set_free_space_fill): New function.
4696 (Output_section::free_space_fill_): New data member.
4697 * testsuite/Makefile.am (incremental_test_3): Add
4698 --incremental-patch option.
4699 (incremental_test_4): Likewise.
4700 (incremental_test_5): Likewise.
4701 (incremental_test_6): Likewise.
4702 (incremental_copy_test): Likewise.
4703 (incremental_common_test_1): Likewise.
4704 * testsuite/Makefile.in: Regenerate.
4706 2011-08-26 Nick Clifton <nickc@redhat.com>
4708 * po/es.po: Updated Spanish translation.
4710 2011-08-01 Cary Coutant <ccoutant@google.com>
4712 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4713 * gold/testsuite/Makefile.in: Regenerate.
4714 * gold/testsuite/justsyms_exec.c: New source file.
4715 * gold/testsuite/justsyms_lib.c: New source file.
4717 2011-08-01 Cary Coutant <ccoutant@google.com>
4719 * layout.cc (Layout::set_segment_offsets): Don't realign text
4720 segment if -Ttext was specified.
4721 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4723 * object.h (Sized_relobj_file::e_type): New function.
4724 (Sized_relobj_file::e_type_): New data member.
4725 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4726 base address for ET_EXEC files.
4727 * target.cc (Target::do_make_elf_object_implementation): Allow
4728 ET_EXEC files with --just-symbols option.
4730 2011-07-28 Cary Coutant <ccoutant@google.com>
4732 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4733 Add thread_number parameter.
4734 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4735 * workqueue-threads.cc
4736 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4737 current thread if its thread number is greater than desired thread
4739 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4740 Add thread_number parameter.
4741 (Workqueue::should_cancel_thread): Likewise.
4742 (Workqueue::find_runnable_or_wait): Pass thread_number to
4743 should_cancel_thread.
4744 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4747 2011-07-22 Sriraman Tallam <tmsriram@google.com>
4749 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4750 only after checking if it cannot be forced local.
4751 * symtab.h (is_externally_visible): Check if the symbol is not forced
4754 2011-07-15 Ian Lance Taylor <iant@google.com>
4756 * options.h (class General_options): Add --print-output-format.
4757 Move -EL next to -EB, for better --help output.
4758 * target-select.cc: Include <cstdio>, "options.h", and
4760 (Target_selector::do_target_bfd_name): New function.
4761 (print_output_format): New function.
4762 * target-select.h (class Target_selector): Update declarations.
4763 (Target_selector::target_bfd_name): New function.
4764 (print_output_format): Declare.
4765 * main.cc: Include "target-select.h".
4766 (main): Handle --print-output-format.
4767 * gold.cc: Include "target-select.h".
4768 (queue_initial_tasks): Handle --print-output-format when there are
4770 * parameters.cc (parameters_force_valid_target): Give a better
4771 error message if -EB/-EL does not match target.
4772 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4775 2011-07-15 Ian Lance Taylor <iant@google.com>
4777 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4778 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4779 (Output_data_plt_i386::do_write): Write address of .dynamic
4780 section to first entry in .got.plt section.
4781 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4782 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4784 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4785 section to first entry in .got.plt section.
4786 * layout.h (Layout::dynamic_section): New function.
4788 2011-07-13 Sriraman Tallam <tmsriram@google.com>
4790 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4792 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4793 input_section_position_, and input_section_glob_.
4794 (read_layout_from_file): Call function section_ordering_specified.
4795 * layout.h (is_section_ordering_specified): New function.
4796 (section_ordering_specified): New function.
4797 (section_ordering_specified_): New boolean member.
4798 * main.cc(main): Call load_plugins after layout object is defined.
4799 * output.cc (Output_section::add_input_section): Use
4800 function section_ordering_specified to check if section ordering is
4802 * output.cc (Output_section::add_relaxed_input_section): Use
4803 function section_ordering_specified to check if section ordering is
4805 (Output_section::update_section_layout): New function.
4806 (Output_section::sort_attached_input_sections): Check if input section
4808 * output.h (Output_section::update_section_layout): New function.
4809 * plugin.cc (get_section_count): New function.
4810 (get_section_type): New function.
4811 (get_section_name): New function.
4812 (get_section_contents): New function.
4813 (update_section_order): New function.
4814 (allow_section_ordering): New function.
4815 (Plugin::load): Add the new interfaces to the transfer vector.
4816 (Plugin_manager::load_plugins): New parameter.
4817 (Plugin_manager::all_symbols_read): New parameter.
4818 (Plugin_manager::claim_file): New parameter. Save the elf object for
4820 (Plugin_manager::get_elf_object): New function.
4821 (Plugin_manager::get_view): Change to directly use the bool to check
4822 if get_view is called from claim_file_hook.
4823 * plugin.h (input_objects): New function
4824 (Plugin__manager::load_plugins): New parameter.
4825 (Plugin_manager::claim_file): New parameter.
4826 (Plugin_manager::get_elf_object): New function.
4827 (Plugin_manager::in_claim_file_handler): New function.
4828 (Plugin_manager::in_claim_file_handler_): New member.
4829 (layout): New function.
4830 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4831 handler with an extra parameter. Make the elf object before calling
4833 * testsuite/plugin_test.c (get_section_count): New function pointer.
4834 (get_section_type): New function pointer.
4835 (get_section_name): New function pointer.
4836 (get_section_contents): New function pointer.
4837 (update_section_order): New function pointer.
4838 (allow_section_ordering): New function pointer.
4839 (onload): Check if the new interfaces exist.
4841 2011-07-13 Ian Lance Taylor <iant@google.com>
4843 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4845 * x86_64.cc (Target_x86_64::got_section): Likewise.
4846 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4847 (relro_now_test_SOURCES): New variable.
4848 (relro_now_test_DEPENDENCIES): New variable.
4849 (relro_now_test_LDFLAGS): New variable.
4850 (relro_now_test_LDADD): New variable.
4851 (relro_now_test.so): New target.
4852 * testsuite/Makefile.in: Rebuild.
4854 2011-07-12 Ian Lance Taylor <iant@google.com>
4857 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4858 GLOB_DAT relocation rather than a RELATIVE relocation for a
4859 protected symbol when creating a shared library.
4860 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4861 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4862 * testsuite/protected_main_1.cc (main): Test that protected
4863 function has same address.
4865 2011-07-11 Ian Lance Taylor <iant@google.com>
4868 * options.h (class General_options): Add -Bgroup.
4869 * options.cc (General_options::finalize): If -Bgroup is set,
4870 default to --unresolved-symbols=report-all.
4871 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4872 * target-reloc.h (issue_undefined_symbol_error): Handle
4873 --unresolved-symbols=report-all.
4875 2011-07-08 Ian Lance Taylor <iant@google.com>
4878 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4879 if linker script discards key sections.
4880 (Layout::create_dynamic_symtab): Likewise.
4881 (Layout::assign_local_dynsym_offsets): Likewise.
4882 (Layout::sized_create_version_sections): Likewise.
4883 (Layout::create_interp): Likewise.
4884 (Layout::finish_dynamic_section): Likewise.
4885 (Layout::set_dynamic_symbol_size): Likewise.
4887 2011-07-08 Ian Lance Taylor <iant@google.com>
4890 * options.h (class General_options): Add --unresolved-symbols.
4891 * target-reloc.h (issue_undefined_symbol_error): Check
4892 --unresolved-symbols. Add comments.
4894 2011-07-08 Ian Lance Taylor <iant@google.com>
4896 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4897 expression more complex.
4899 2011-07-08 Ian Lance Taylor <iant@google.com>
4902 * target-reloc.h (issue_undefined_symbol_error): New inline
4903 function, broken out of relocate_section.
4904 (relocate_section): Call issue_undefined_symbol_error.
4905 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4906 there is no TLS segment if we are about to issue an undefined
4908 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4910 2011-07-08 Ian Lance Taylor <iant@google.com>
4913 * resolve.cc (Symbol_table::should_override): Add fromtype
4914 parameter. Change all callers. Give error when linking together
4915 TLS and non-TLS symbol.
4916 (Symbol_table::should_override_with_special): Add fromtype
4917 parameter. Change all callers.
4918 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4919 there is no TLS segment if we have reported some errors.
4920 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4922 2011-07-08 Ian Lance Taylor <iant@google.com>
4925 * target.h (Target::plt_address_for_global): New function.
4926 (Target::plt_address_for_local): New function.
4927 (Target::plt_section_for_global): Remove.
4928 (Target::plt_section_for_local): Remove.
4929 (Target::do_plt_address_for_global): New virtual function.
4930 (Target::do_plt_address_for_local): New virtual function.
4931 (Target::do_plt_section_for_global): Remove.
4932 (Target::do_plt_section_for_local): Remove.
4933 (Target::register_global_plt_entry): Add Symbol_table and Layout
4935 * output.cc (Output_data_got::Got_entry::write): Use
4936 plt_address_for_global and plt_address_for_local.
4937 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4938 address of output section.
4939 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4940 got_irelative_, and irelative_count_ fields. Update
4942 (Output_data_plt_i386::has_irelative_section): New function.
4943 (Output_data_plt_i386::entry_count): Add irelative_count_.
4944 (Output_data_plt_i386::set_final_data_size): Likewise.
4945 (class Target_i386): Add got_irelative_ and rel_irelative_
4946 fields. Update declarations.
4947 (Target_i386::Target_i386): Initialize new fields.
4948 (Target_i386::do_plt_address_for_global): New function replacing
4949 do_plt_section_for_global.
4950 (Target_i386::do_plt_address_for_local): New function replacing
4951 do_plt_section_for_local.
4952 (Target_i386::got_section): Create got_irelative_.
4953 (Target_i386::rel_irelative_section): New function.
4954 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4955 fields. Don't define __rel_iplt_{start,end}.
4956 (Output_data_plt_i386::add_entry): Add symtab and layout
4957 parameters. Change all callers. Use different PLT and GOT for
4959 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4960 layout parameters. Change all callers. Use different PLT and
4962 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4963 (Output_data_plt_i386::rel_irelative): New function.
4964 (Output_data_plt_i386::address_for_global): New function.
4965 (Output_data_plt_i386::address_for_local): New function.
4966 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4967 IRELATIVE GOT when changing IFUNC GOT entries.
4968 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4970 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4971 if we didn't create an IRELATIVE GOT.
4972 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4973 plt_address_for_local.
4974 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4975 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4976 got_irelative_, and irelative_count_ fields. Update
4978 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4979 Initialize new fields. Remove symtab parameter. Change all
4981 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4983 (Output_data_plt_x86_64::has_irelative_section): New function.
4984 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4985 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4986 fields. Update declarations.
4987 (Target_x86_64::Target_x86_64): Initialize new fields.
4988 (Target_x86_64::do_plt_address_for_global): New function replacing
4989 do_plt_section_for_global.
4990 (Target_x86_64::do_plt_address_for_local): New function replacing
4991 do_plt_section_for_local.
4992 (Target_x86_64::got_section): Create got_irelative_.
4993 (Target_x86_64::rela_irelative_section): New function.
4994 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4995 all callers. Don't create __rel_iplt_{start,end}.
4996 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4997 parameters. Change all callers. Use different PLT and GOT for
4999 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5000 layout parameters. Change all callers. Use different PLT and
5002 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5003 parameters. Change all callers. Use different PLT and GOT for
5005 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5006 (Output_data_plt_x86_64::rela_irelative): New function.
5007 (Output_data_plt_x86_64::address_for_global): New function.
5008 (Output_data_plt_x86_64::address_for_local): New function.
5009 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5010 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5011 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5012 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5014 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5016 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5017 symbols if we didn't create an IRELATIVE GOT.
5018 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5019 plt_address_for_local.
5020 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5021 * testsuite/ifuncvar1.c: New test file.
5022 * testsuite/ifuncvar2.c: New test file.
5023 * testsuite/ifuncvar3.c: New test file.
5024 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5025 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5026 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5027 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5028 * testsuite/Makefile.in: Rebuild.
5030 2011-07-07 Cary Coutant <ccoutant@google.com>
5032 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5033 (two_file_test_1_ndebug.o): Likewise.
5034 (two_file_test_1b_ndebug.o): Likewise.
5035 (two_file_test_2_ndebug.o): Likewise.
5036 (two_file_test_main_ndebug.o): Likewise.
5037 (incremental_test_2): Link with no-debug versions.
5039 2011-07-06 Cary Coutant <ccoutant@google.com>
5041 * gold/incremental.cc
5042 (Output_section_incremental_inputs::write_info_blocks): Check for
5043 hidden and internal symbols.
5045 2011-07-06 Cary Coutant <ccoutant@google.com>
5047 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5048 Check disposition for startup file.
5049 (Incremental_inputs::report_command_line): Ignore
5050 --incremental-startup-unchanged option.
5051 * options.cc (General_options::parse_incremental_startup_unchanged):
5053 (General_options::General_options): Initialize new data member.
5054 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5055 (General_options): Add --incremental-startup-unchanged option.
5056 (General_options::incremental_startup_disposition): New function.
5057 (General_options::incremental_startup_disposition_): New data member.
5059 2011-07-06 Cary Coutant <ccoutant@google.com>
5061 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5062 input file index to Script_info ctor.
5063 (Sized_incremental_binary::do_file_has_changed): Find the
5064 command-line argument for files named in scripts.
5065 * incremental.h (Script_info::Script_info): New ctor
5066 with input file index.
5067 (Script_info::input_file_index): New function.
5068 (Script_info::input_file_index_): New data member.
5069 (Incremental_binary::get_library): Add const.
5070 (Incremental_binary::get_script_info): Add const.
5071 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5072 * testsuite/Makefile.am (incremental_test_5): New test case.
5073 (incremental_test_6): New test case.
5074 * testsuite/Makefile.in: Regenerate.
5076 2011-07-06 Cary Coutant <ccoutant@google.com>
5078 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5079 debug output when command lines differ.
5081 2011-07-06 Cary Coutant <ccoutant@google.com>
5083 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5084 --incremental-patch option.
5085 * layout.cc (Free_list::allocate): Extend allocation beyond original
5087 (Layout::make_output_section): Mark sections that should get
5089 * options.cc (parse_percent): New function.
5090 * options.h (parse_percent): New function.
5091 (DEFINE_percent): New macro.
5092 (General_options): Add --incremental-patch option.
5093 * output.cc (Output_section::Output_section): Initialize new data
5095 (Output_section::add_input_section): Print section name when out
5097 (Output_section::add_output_section_data): Likewise.
5098 (Output_section::set_final_data_size): Add patch space when
5099 doing --incremental-full.
5100 (Output_section::do_reset_address_and_file_offset): Remove patch
5102 (Output_segment::set_section_list_addresses): Print debug output
5103 only if --incremental-update.
5104 * output.h (Output_section::set_is_patch_space_allowed): New function.
5105 (Output_section::is_patch_space_allowed_): New data member.
5106 (Output_section::patch_space_): New data member.
5107 * parameters.cc (Parameters::incremental_full): New function.
5108 * parameters.h (Parameters::incremental_full): New function
5109 * testsuite/Makefile.am (incremental_test_2): Add test for
5110 --incremental-patch option.
5111 * testsuite/Makefile.in: Regenerate.
5112 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5113 (t18): Remove function body.
5115 2011-07-05 Doug Kwan <dougkwan@google.com>
5118 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5119 Arm_Address type for relocation result.
5120 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5122 (Arm_relocate_functions::abs32): Use unaligned access.
5123 (Arm_relocate_functions::rel32): Ditto.
5124 (Arm_relocate_functions::prel31): Ditto.
5125 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5126 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5127 static data relocations.
5128 * testsuite/Makefile.in: Regnerate.
5129 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5131 2011-07-05 Ian Lance Taylor <iant@google.com>
5134 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5135 symbols if necessary.
5136 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5138 2011-07-05 Ian Lance Taylor <iant@google.com>
5141 * resolve.cc (Symbol::override_base_with_special): Simply override
5142 version with special symbol version, ignoring previous version.
5144 2011-07-05 Ian Lance Taylor <iant@google.com>
5146 * object.cc (Sized_relobj_file::include_section_group): Add
5147 information to comment about signature location.
5149 2011-07-02 Ian Lance Taylor <iant@google.com>
5152 * options.h (class General_options): Add -f and -F.
5153 * options.cc (General_options::finalize): Fatal error if -f/-F
5154 are used without -shared.
5155 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5157 2011-07-02 Ian Lance Taylor <iant@google.com>
5159 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5161 2011-07-01 Ian Lance Taylor <iant@google.com>
5165 * resolve.cc (Symbol::override_base_with_special): Don't override
5166 the version if the overriding symbol has a different name.
5167 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5168 all callers. If we give an error about an undefined version,
5169 define the base version if necessary.
5170 * dynobj.h (class Versions): Update declaration.
5171 * testsuite/weak_alias_test_5.cc: New file.
5172 * testsuite/weak_alias_test.script: New file.
5173 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5174 and versioned_alias have the right value, and call t2.
5175 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5176 weak_alias_test_5.so.
5177 (weak_alias_test_LDADD): Likewise.
5178 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5179 * testsuite/Makefile.in: Rebuild.
5181 2011-07-01 Ian Lance Taylor <iant@google.com>
5184 * options.h (class General_options): Support -z notext.
5185 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5187 (two_file_shared_nonpic.so): Likewise.
5188 (two_file_shared_mixed.so): Likewise.
5189 (two_file_shared_mixed_1.so): Likewise.
5190 (weak_undef_lib_nonpic.so): Likewise.
5191 (alt/weak_undef_lib_nonpic.so): Likewise.
5192 (tls_test_shared_nonpic.so): Likewise.
5193 * testsuite/Makefile.in: Rebuild.
5195 2011-07-01 Ian Lance Taylor <iant@google.com>
5198 * configure.ac: Test whether static linking works, setting
5199 the automake conditional HAVE_STATIC.
5200 * testsuite/Makefile.am: Disable tests using -static if
5201 HAVE_STATIC is not true.
5202 * configure, testsuite/Makefile.in: Rebuild.
5204 2011-07-01 Ian Lance Taylor <iant@google.com>
5207 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5208 Assert if we see DW_EH_PE_indirect.
5209 * target.h (Target::ehframe_datarel_base): New function.
5210 (Target::do_ehframe_datarel_base): New target function.
5211 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5212 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5215 2011-07-01 Ian Lance Taylor <iant@google.com>
5218 * options.h (class General_options): Add
5219 --ld-generated-unwind-info.
5220 * ehframe.cc (Fde::write): Add address parameter. Change all
5221 callers. If associated with PLT, fill in address and size.
5222 (Cie::set_output_offset): Only add merge mapping if there is an
5224 (Cie::write): Add address parameter. Change all callers.
5225 (Eh_frame::add_ehframe_for_plt): New function.
5226 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5227 input_offset_ fields into union u_, with new plt field.
5228 (Fde::Fde): Adjust for new union field.
5229 (Fde::Fde) [Output_data version]: New constructor.
5230 (Fde::add_mapping): Only add merge mapping if there is an object.
5231 (class Cie): Update declarations.
5232 (class Eh_frame): Declare add_ehframe_for_plt.
5233 * layout.cc (Layout::layout_eh_frame): Break out code into
5234 make_eh_frame_section, and call it.
5235 (Layout::make_eh_frame_section): New function.
5236 (Layout::add_eh_frame_for_plt): New function.
5237 * layout.h (class Layout): Update declarations.
5238 * merge.cc (Merge_map::add_mapping): Add assertion.
5239 * i386.cc: Include "dwarf.h".
5240 (class Output_data_plt_i386): Make first_plt_entry,
5241 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5242 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5243 and plt_eh_frame_fde.
5244 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5245 boundary. Call add_eh_frame_for_plt if appropriate.
5246 * x86_64.cc: Include "dwarf.h".
5247 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5248 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5249 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5250 and plt_eh_frame_fde.
5251 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5254 2011-06-29 Ian Lance Taylor <iant@google.com>
5257 * object.cc (Sized_relobj_file::layout_section): Change shdr
5258 parameter to be const.
5259 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5261 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5262 appropriate. Call layout_eh_frame_section.
5263 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5265 * object.h (class Sized_relobj_file): Update declarations.
5267 2011-06-29 Ian Lance Taylor <iant@google.com>
5270 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5272 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5274 2011-06-29 Ian Lance Taylor <iant@google.com>
5277 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5279 * layout.cc (Layout::layout_eh_frame): Likewise.
5281 2011-06-29 Ian Lance Taylor <iant@google.com>
5284 * layout.cc (Layout::symtab_section_shndx): New function.
5285 * layout.h (class Layout): Declare symtab_section_shndx.
5286 * output.cc (Output_section::write_header): Call it.
5288 2011-06-29 Ian Lance Taylor <iant@google.com>
5291 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5292 symbols which are not used in a relocation.
5294 2011-06-28 Ian Lance Taylor <iant@google.com>
5297 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5298 script create indistinguishable segments.
5299 (Layout::set_segment_offsets): Use stable_sort when sorting
5300 segments. Pass this to Compare_segments constructor.
5301 * layout.h (class Layout): Make segment_precedes non-static.
5302 (class Compare_segments): Change from struct to class. Add
5303 layout_ field. Add constructor.
5304 * script-sections.cc
5305 (Script_sections::attach_sections_using_phdrs_clause): Rename
5306 local orphan to is_orphan. Don't report failure to put empty
5307 section in segment. On attachment failure, report name of
5308 section, and attach to first PT_LOAD segment.
5310 2011-06-28 Ian Lance Taylor <iant@google.com>
5313 * target-select.cc (Target_selector::Target_selector): Add
5314 emulation parameter. Change all callers.
5315 (select_target_by_bfd_name): Rename from select_target_by_name.
5317 (select_target_by_emulation): New function.
5318 (supported_emulation_names): New function.
5319 * target-select.h (class Target_selector): Add emulation_ field.
5320 Update declarations.
5321 (Target_selector::recognize_by_bfd_name): Rename from
5322 recognize_by_name. Change all callers.
5323 (Target_selector::supported_bfd_names): Rename from
5324 supported_names. Change all callers.
5325 (Target_selector::recognize_by_emulation): New function.
5326 (Target_selector::supported_emulations): New function.
5327 (Target_selector::emulation): New function.
5328 (Target_selector::do_recognize_by_bfd_name): Rename from
5329 do_recognize_by_name. Change all callers.
5330 (Target_selector::do_supported_bfd_names): Rename from
5331 do_supported_names. Change all callers.
5332 (Target_selector::do_recognize_by_emulation): New function.
5333 (Target_selector::do_supported_emulations): New function.
5334 (select_target_by_bfd_name): Change name in declaration.
5335 (select_target_by_emulation): Declare.
5336 (supported_emulation_names): Declare.
5337 * parameters.cc (parameters_force_valid_target): Try to find
5338 target based on emulation from -m option.
5339 * options.h (class General_options): Change doc string for -m.
5340 * options.cc (help): Print emulations.
5341 (General_options::parse_V): Likewise.
5342 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5343 Add emulation parameter. Change all callers.
5345 2011-06-28 Ian Lance Taylor <iant@google.com>
5347 * target.h (class Target): Add osabi_ field.
5348 (Target::osabi): New function.
5349 (Target::set_osabi): New function.
5350 (Target::Target): Initialize osabi_.
5351 (Target::do_adjust_elf_header): Make pure virtual.
5352 (Sized_target::do_adjust_elf_header): Declare.
5353 * target.cc (Sized_target::do_adjust_elf_header): New function.
5354 (class Sized_target): Instantiate all versions.
5355 * freebsd.h (class Target_freebsd): Remove.
5356 (Target_selector_freebsd::do_recognize): Call set_osabi on
5358 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5359 (Target_selector_freebsd::set_osabi): Remove.
5360 * i386.cc (class Target_i386): Inherit from Sized_target rather
5361 than Target_freebsd.
5362 * x86_64.cc (class Target_x86_64): Likewise.
5364 2011-06-28 Ian Lance Taylor <iant@google.com>
5366 * target.h (Target::can_check_for_function_pointers): Rewrite.
5368 (Target::can_icf_inline_merge_sections): Likewise.
5369 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5370 (Target::Target_info): Add can_icf_inline_merge_sections field.
5371 (Target::do_can_check_for_function_pointers): New virtual
5373 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5374 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5375 from can_check_for_function_pointers, move in file.
5376 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5377 section_may_have_icf_unsafe_poineters, move in file.
5378 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5379 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5380 Rename from can_check_for_function_pointers, move in file.
5381 (Target_i386::can_icf_inline_merge_sections): Remove.
5382 (Target_i386::i386_info): Initialize
5383 can_icf_inline_merge_sections.
5384 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5385 Initialize can_icf_inline_merge_sections.
5386 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5387 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5388 Rename from can_check_for_function_pointers, move in file.
5389 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5390 (Target_x86_64::x86_64_info): Initialize
5391 can_icf_inline_merge_sections.
5392 * testsuite/testfile.cc (Target_test::test_target_info):
5394 * icf.cc (get_section_contents): Correct formatting.
5396 2011-06-27 Ian Lance Taylor <iant@google.com>
5398 * symtab.cc (Symbol::versioned_name): New function.
5399 (Symbol_table::add_to_final_symtab): Use versioned_name when
5401 (Symbol_table::sized_write_symbol): Likewise.
5402 * symtab.h (class Symbol): Declare versioned_name.
5403 * stringpool.h (class Stringpool_template): Add variant of add
5404 which takes a std::basic_string.
5405 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5406 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5407 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5408 (ver_test_12.o): New target.
5409 * testsuite/Makefile.in: Rebuild.
5411 2011-06-27 Doug Kwan <dougkwan@google.com>
5413 * arm.cc (Arm_relocate_functions::thm_jump8,
5414 Arm_relocate_functions::thm_jump11): Use a wider signed
5415 type to compute offset.
5416 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5418 * testsuite/Makefile.in: Regenerate.
5419 * testsuite/arm_branch_in_range.sh: Check test results of
5420 arm_thm_jump11 and arm_thm_jump8.
5421 * testsuite/arm_thm_jump11.s: New test source file.
5422 * testsuite/arm_thm_jump11.t: New linker script.
5423 * testsuite/arm_thm_jump8.s: New test source file.
5424 * testsuite/arm_thm_jump8.t: New linker script.
5426 2011-06-24 Ian Lance Taylor <iant@google.com>
5428 * layout.cc: Include "object.h".
5429 (ctors_sections_in_init_array): New static variable.
5430 (Layout::is_ctors_in_init_array): New function.
5431 (Layout::layout): Add entry to ctors_sections_in_init_array if
5433 * layout.h (class Layout): Declare is_ctors_in_init_array.
5434 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5435 is_ctors_reverse_view is set.
5436 (Sized_relobj_file::write_sections): Add layout parameter. Change
5437 all callers. Set is_ctors_reverse_view field of View_size.
5438 (Sized_relobj_file::reverse_words): New function.
5439 * object.h (Sized_relobj_file::View_size): Add
5440 is_ctors_reverse_view field.
5441 (class Sized_relobj_file): Update declarations.
5442 * testsuite/initpri3.c: New test.
5443 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5445 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5446 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5447 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5448 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5449 * testsuite/Makefile.in: Rebuild.
5451 2011-06-24 Cary Coutant <ccoutant@google.com>
5453 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5454 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5455 (debug_msg_cdebug.err): New targets.
5456 * testsuite/Makefile.in: Regenerate.
5457 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5458 Fix checks for link with shared library.
5460 2011-06-24 Doug Kwan <dougkwan@google.com>
5462 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5463 skip empty text sections.
5464 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5466 2011-06-22 Ian Lance Taylor <iant@google.com>
5469 * options.h (class General_options): Add --ctors-in-init-array.
5470 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5471 friends as SHT_PROGBITS for merging sections.
5472 (Layout::layout): Remove special handling of .init_array and
5473 friends. Don't sort if doing relocatable link. Sort for .ctors
5474 and .dtors if ctors_in_init_array.
5475 (Layout::make_output_section): Force correct section types for
5476 .init_array and friends. Don't sort if doing relocatable link,
5477 Don't sort .ctors and .dtors if ctors_in_init_array.
5478 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5479 (Layout::output_section_name): Add relobj parameter. Change all
5480 callers. Handle .ctors. and .dtors. in code rather than table.
5481 Handle .ctors and .dtors if ctors_in_init_array.
5482 (Layout::match_file_name): New function, moved from output.cc.
5483 * layout.h (class Layout): Update declarations.
5484 * output.cc: Include "layout.h".
5485 (Input_section_sort_entry::get_priority): New function.
5486 (Input_section_sort_entry::match_file_name): Just call
5487 Layout::match_file_name.
5488 (Output_section::Input_section_sort_init_fini_compare::operator()):
5489 Handle .ctors and .dtors. Sort by explicit priority rather than
5491 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5492 * testsuite/initpri2.c: New test.
5493 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5494 (check_PROGRAMS): Add initpri2.
5495 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5496 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5497 * configure, testsuite/Makefile.in: Rebuild.
5499 2011-06-19 Ian Lance Taylor <iant@google.com>
5502 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5503 .interp section to a PT_INTERP segment even if we have seen a
5504 --dynamic-linker option. Don't do it if we have seen a PHDRS
5505 clause in a linker script.
5506 (Layout::finalize): Don't create a .interp section if we've
5507 already create a PT_INTERP segment.
5508 (Layout::create_interp): Always call choose_output_section (revert
5509 patch of 2011-06-17). Don't create PT_INTERP segment.
5510 * script-sections.cc
5511 (Script_sections::create_note_and_tls_segments): Add a .interp
5512 section to a PT_INTERP segment even if we have seen a
5513 --dynamic-linker option.
5515 2011-06-18 Ian Lance Taylor <iant@google.com>
5517 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5518 merely because a non-PT_LOAD segment has a dynamic reloc.
5520 2011-06-18 Ian Lance Taylor <iant@google.com>
5522 * layout.cc (Layout::finish_dynamic_section): Don't create
5523 DT_FLAGS entry if not needed.
5525 2011-06-18 Ian Lance Taylor <iant@google.com>
5528 * layout.cc (Layout::layout_eh_frame): Correct handling of
5529 writable .eh_frame section.
5531 2011-06-17 Ian Lance Taylor <iant@google.com>
5534 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5535 symbol is redefined with the exact same object and value.
5537 2011-06-17 Ian Lance Taylor <iant@google.com>
5540 * layout.h (class Layout): Add interp_segment_ field.
5541 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5542 (Layout::attach_allocated_section_to_segment): If making shared
5543 library, put .interp section in PT_INTERP segment.
5544 (Layout::finalize): Also call create_interp if -dynamic-linker
5546 (Layout::create_interp): Assert that there is no PT_INTERP
5547 segment. If not using a SECTIONS clause, use make_output_section.
5548 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5549 * script-sections.cc
5550 (Script_sections::create_note_and_tls_segments): If making shared
5551 library, put .interp section in PT_INTERP segment.
5553 2011-06-17 Ian Lance Taylor <iant@google.com>
5555 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5556 when making a shared library.
5558 2011-06-17 Ian Lance Taylor <iant@google.com>
5560 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5561 parameter. Change all callers. Don't issue warning about PC32
5562 against locally defined symbol.
5564 2011-06-16 Ian Lance Taylor <iant@google.com>
5566 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5567 occurs in same object.
5569 2011-06-14 Alan Modra <amodra@gmail.com>
5571 * po/POTFILES.in: Regenerate.
5573 2011-06-09 Ian Lance Taylor <iant@google.com>
5575 * script-sections.cc
5576 (Orphan_output_section::set_section_addresses): For a relocatable
5577 link set address to 0.
5579 2011-06-09 Cary Coutant <ccoutant@google.com>
5582 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5583 used with --compress-debug-sections.
5584 * gold/object.cc (Sized_relobj_file::do_layout): Report
5585 uncompressed size of compressed input sections.
5587 2011-06-08 Cary Coutant <ccoutant@google.com>
5590 * testsuite/two_file_test_2_v1.cc: Change initialization of
5591 v2 to keep it in .data.
5593 2011-06-07 Cary Coutant <ccoutant@google.com>
5595 * common.cc (Symbol_table::do_allocate_commons_list): Call
5597 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5598 (Errors::fallback): New function.
5599 (gold_fallback): New function.
5600 * errors.h (Errors::fallback): New function.
5601 * gold.cc (gold_exit): Change status parameter to enum; adjust
5603 (queue_initial_tasks): Call gold_fallback.
5604 * gold.h: Include cstdlib.
5605 (Exit_status): New enum type.
5606 (gold_exit): Change status parameter to enum.
5607 (gold_fallback): New function.
5608 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5609 (Layout::create_symtab_sections): Likewise.
5610 (Layout::create_shdrs): Likewise.
5611 * main.cc (main): Adjust call to gold_exit.
5612 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5613 (Output_data_got::add_got_entry_pair): Likewise.
5614 (Output_section::add_input_section): Likewise.
5615 (Output_section::add_output_section_data): Likewise.
5616 (Output_segment::set_section_list_addresses): Likewise.
5617 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5619 2011-06-07 Cary Coutant <ccoutant@google.com>
5621 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5622 for incremental links.
5623 * output.cc (Output_segment::set_section_list_addresses): Remove
5624 FIXME and test for TLS or BSS.
5626 2011-06-07 Cary Coutant <ccoutant@google.com>
5628 * testsuite/Makefile.am: Add incremental_copy_test,
5629 incremental_common_test_1.
5630 * testsuite/Makefile.in: Regenerate.
5631 * testsuite/common_test_1_v1.c: New source file.
5632 * testsuite/common_test_1_v2.c: New source file.
5633 * testsuite/copy_test_v1.cc: New source file.
5635 2011-06-07 Cary Coutant <ccoutant@google.com>
5637 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5638 update, allocate common from bss section's free list.
5639 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5640 linker-defined symbols.
5641 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5642 Skip GOT and PLT entries that are no longer referenced.
5643 (Output_section_incremental_inputs::write_info_blocks): Mark
5644 linker-defined symbols.
5645 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5646 * output.cc (Output_section::allocate): New function.
5647 * output.h (Output_section::allocate): New function.
5648 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5649 linker-defined symbols.
5650 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5651 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5652 (Symbol::init_base_output_data): Likewise.
5653 (Symbol::init_base_output_segment): Likewise.
5654 (Symbol::init_base_constant): Likewise.
5655 (Sized_symbol::init_output_data): Likewise.
5656 (Sized_symbol::init_output_segment): Likewise.
5657 (Sized_symbol::init_constant): Likewise.
5658 (Symbol_table::do_define_in_output_data): Likewise.
5659 (Symbol_table::do_define_in_output_segment): Likewise.
5660 (Symbol_table::do_define_as_constant): Likewise.
5661 * symtab.h (Symbol::is_predefined): New function.
5662 (Symbol::init_base_output_data): Add is_predefined parameter.
5663 (Symbol::init_base_output_segment): Likewise.
5664 (Symbol::init_base_constant): Likewise.
5665 (Symbol::is_predefined_): New data member.
5666 (Sized_symbol::init_output_data): Add is_predefined parameter.
5667 (Sized_symbol::init_output_segment): Likewise.
5668 (Sized_symbol::init_constant): Likewise.
5669 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5671 2011-06-07 Cary Coutant <ccoutant@google.com>
5673 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5674 instead of emit_copy_reloc.
5675 (Copy_relocs::emit_copy_reloc): Refactor.
5676 (Copy_relocs::make_copy_reloc): New function.
5677 (Copy_relocs::add_copy_reloc): Remove.
5678 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5680 (Copy_relocs::make_copy_reloc): New function.
5681 (Copy_relocs::add_copy_reloc): Remove.
5682 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5683 unchanged input files.
5684 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5685 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5686 Reserve BSS space for COPY relocations.
5687 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5688 (Output_section_incremental_inputs::write_info_blocks): Record
5689 whether a symbol is copied from a shared object.
5690 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5691 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5692 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5693 (Incremental_input_entry_reader::get_output_symbol_index): Add
5695 (Incremental_binary::emit_copy_relocs): New function.
5696 (Incremental_binary::do_emit_copy_relocs): New function.
5697 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5699 (Sized_incremental_binary::add_copy_reloc): New function.
5700 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5701 (Sized_incremental_binary::Copy_reloc): New struct.
5702 (Sized_incremental_binary::Copy_relocs): New typedef.
5703 (Sized_incremental_binary::copy_relocs_): New data member.
5704 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5705 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5706 * target.h (Sized_target::emit_copy_reloc): New function.
5707 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5709 2011-06-02 Cary Coutant <ccoutant@google.com>
5712 * gold/archive.cc (Archive::Archive): Initialize new data member.
5713 (Archive::include_all_members): Return if archive has already been
5715 * gold/archive.h (Archive::include_all_members_): New data member.
5717 2011-06-02 Nick Clifton <nickc@redhat.com>
5719 * dynobj.h: Fix spelling mistake in comment.
5720 * output.cc: Likewise.
5722 2011-05-31 Doug Kwan <dougkwan@google.com>
5726 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
5727 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5728 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5729 redundant arm_exidx_test.so.
5730 * testsuite/Makefile.in: Regenerate.
5731 (check_SCRIPTS): Add pr12826.sh
5732 (check_DATA): Add pr12826.stdout
5733 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5734 * testsuite/pr12826.sh: New file.
5735 * testsuite/pr12826_1.s: Ditto.
5736 * testsuite/pr12826_1.s: Ditto.
5738 2011-05-30 Ian Lance Taylor <iant@google.com>
5740 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5743 2011-05-29 Ian Lance Taylor <iant@google.com>
5746 * testsuite/Makefile.am: Use different file name for two_file_test
5747 temporary file for each incremental test.
5748 * testsuite/Makefile.in: Rebuild.
5750 2011-05-29 Ian Lance Taylor <iant@google.com>
5752 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5753 binary input file is empty.
5755 2011-05-27 Ian Lance Taylor <iant@google.com>
5757 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5758 (ver_test_9.so): Likewise.
5759 * testsuite/Makefile.in: Rebuild.
5761 2011-05-26 Cary Coutant <ccoutant@google.com>
5763 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5764 * incremental.cc (Incremental_inputs::report_input_section): Fix
5765 comment, indentation.
5766 (Incremental_inputs::report_comdat_group): New function.
5767 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5768 of data for incremental input file entry.
5769 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5770 group count, COMDAT group signatures.
5771 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5772 an unchanged input file.
5773 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5774 Initialize new data member.
5775 (Incremental_object_entry::add_comdat_group): New function.
5776 (Incremental_object_entry::get_comdat_group_count): New function.
5777 (Incremental_object_entry::get_comdat_signature_key): New function.
5778 (Incremental_object_entry::groups_): New data member.
5779 (Incremental_inputs::report_comdat_group): New function.
5780 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5781 data for incremental input file entry.
5782 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5783 (Incremental_input_entry_reader::get_input_section): Adjust size of
5784 data for incremental input file entry.
5785 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5786 (Incremental_input_entry_reader::get_comdat_group_signature): New
5788 * object.cc (Sized_relobj::include_section_group): Report kept
5789 COMDAT groups for incremental links.
5791 2011-05-24 David Meyer <pdox@google.com>
5793 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5794 with name parameter. Add found_name parameter.
5795 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5796 * dirsearch.h (class Dirsearch): Update declaration.
5798 2011-05-24 Ian Lance Taylor <iant@google.com>
5800 * archive.cc (Library_base::should_include_member): Pull in object
5801 from archive if it defines the entry symbol.
5802 * parameters.cc (Parameters::entry): New function.
5803 * parameters.h (class Parameters): Declare entry.
5804 * output.h (class Output_file_header): Remove entry_ field.
5805 * output.cc (Output_file_header::Output_file_header): Remove entry
5806 parameter. Change all callers.
5807 (Output_file_header::entry): Use parameters->entry.
5808 * gold.cc (queue_middle_tasks): Likewise.
5809 * plugin.cc (Plugin_hook::run): Likewise.
5811 2011-05-24 Cary Coutant <ccoutant@google.com>
5813 * gold.cc (queue_initial_tasks): Pass incremental base filename
5814 to Output_file::open_base_file; don't print error message.
5815 * incremental-dump.cc (main): Adjust call to
5816 Output_file::open_for_modification.
5817 * incremental-dump.cc (main): Likewise.
5818 * incremental.cc (Incremental_inputs::report_command_line):
5819 Ignore --incremental-base option when comparing command lines.
5820 Ignore parameter when given as separate argument.
5821 * options.h (class General_options): Add --incremental-base.
5822 * output.cc (Output_file::Output_file):
5823 (Output_file::open_base_file): Add base_name and writable parameters;
5824 read base file into new file; print error message here.
5825 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5827 * output.h (Output_file::open_for_modification): Rename to...
5828 (Output_file::open_base_file): ...this; add base_name and
5829 writable parameters; adjust all callers.
5830 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5832 * testsuite/Makefile.am (incremental_test_4): Test
5834 * testsuite/Makefile.in: Regenerate.
5836 2011-05-24 Cary Coutant <ccoutant@google.com>
5838 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5840 * testsuite/Makefile.in: Regenerate.
5841 * testsuite/two_file_test_1_v1.cc: New test source file.
5842 * testsuite/two_file_test_1b_v1.cc: New test source file.
5843 * testsuite/two_file_test_2_v1.cc: New test source file.
5845 2011-05-24 Cary Coutant <ccoutant@google.com>
5847 * dynobj.h (Dynobj::do_dynobj): New function.
5848 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5849 flag and soname for shared objects.
5850 * incremental.cc (Incremental_inputs::report_object): Make
5851 either Incremental_object_entry or Incremental_dynobj_entry; add
5852 soname to string table.
5853 (Incremental_inputs::report_input_section): Add assertion.
5854 (Output_section_incremental_inputs::set_final_data_size): Adjust
5855 type of input file entry for shared libraries; adjust size of
5856 shared library info entry.
5857 (Output_section_incremental_inputs::write_input_files): Write
5858 as_needed flag for shared libraries.
5859 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5860 of input file entry for shared libraries; write soname.
5861 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5862 soname from incremental info.
5863 * incremental.h (enum Incremental_input_flags): Add
5864 INCREMENTAL_INPUT_AS_NEEDED.
5865 (Incremental_input_entry::Incremental_input_entry): Initialize new
5867 (Incremental_input_entry::set_as_needed): New function.
5868 (Incremental_input_entry::as_needed): New function.
5869 (Incremental_input_entry::do_dynobj_entry): New function.
5870 (Incremental_input_entry::as_needed_): New data member.
5871 (Incremental_object_entry::Incremental_object_entry): Don't check
5873 (Incremental_object_entry::do_type): Likewise.
5874 (class Incremental_dynobj_entry): New class.
5875 (Incremental_input_entry_reader::as_needed): New function.
5876 (Incremental_input_entry_reader::get_soname): New function.
5877 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5878 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5879 size of shared library info entry.
5880 * layout.cc (Layout::finish_dynamic_section): Don't test for
5881 incremental link when adding DT_NEEDED entries.
5882 * object.h (Object::Object): Initialize new data member.
5883 (Object::dynobj): New function.
5884 (Object::set_as_needed): New function.
5885 (Object::as_needed): New function.
5886 (Object::do_dynobj): New function.
5887 (Object::as_needed_): New data member.
5889 2011-05-24 Cary Coutant <ccoutant@google.com>
5891 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5892 info; adjust display of GOT entries.
5893 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5894 vector of input objects; remove file_status_.
5895 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5896 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5897 got_plt reader; call target hooks to reserve GOT entries.
5898 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5899 of input file info header and GOT info entry.
5900 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5902 (Got_plt_view_info::got_descriptor): Remove.
5903 (Got_plt_view_info::sym_index): New data member.
5904 (Got_plt_view_info::input_index): New data member.
5905 (Local_got_offset_visitor::visit): Write input file index.
5906 (Global_got_offset_visitor::visit): Write 0 for input file index.
5907 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5908 with sym_index and input_index.
5909 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5910 incremental info GOT entry; replace got_descriptor with input_index.
5911 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5912 map from input file index to object.
5913 (Sized_relobj_incr::do_layout): Replace direct data member reference
5914 with accessor function.
5915 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5916 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5917 Adjust size of input file info header.
5918 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5919 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5920 (Incremental_input_entry_reader::get_input_section): Adjust size of
5921 input file info header.
5922 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5923 of incremental info GOT entry.
5924 (Incremental_got_plt_reader::get_got_desc): Remove.
5925 (Incremental_got_plt_reader::get_got_symndx): New function.
5926 (Incremental_got_plt_reader::get_got_input_index): New function.
5927 (Sized_incremental_binary::Sized_incremental_binary): Remove
5928 file_status_; add input_objects_.
5929 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5930 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5931 (Sized_incremental_binary::file_is_unchanged): Remove.
5932 (Sized_incremental_binary::set_input_object): New function.
5933 (Sized_incremental_binary::input_object): New function.
5934 (Sized_incremental_binary::file_status_): Remove.
5935 (Sized_incremental_binary::input_objects_): New data member.
5936 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5938 (Sized_relobj_incr::invalid_address): Move to base class.
5939 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5941 (Sized_relobj_incr::do_output_section_offset): Likewise.
5942 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5943 (Sized_relobj_incr::section_offsets_): Likewise.
5944 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5946 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5947 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5948 with accessor function.
5949 (Sized_relobj_file::do_layout): Likewise.
5950 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5951 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5952 (Sized_relobj_file::compute_final_local_value): Replace refs to
5953 section_offsets_ with accessor function.
5954 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5955 * object.h (Relobj::Relobj): Initialize new data members.
5956 (Relobj::add_dyn_reloc): New function.
5957 (Relobj::first_dyn_reloc): New function.
5958 (Relobj::dyn_reloc_count): New function.
5959 (Relobj::first_dyn_reloc_): New data member.
5960 (Relobj::dyn_reloc_count_): New data member.
5961 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5963 (Sized_relobj::Address): New typedef.
5964 (Sized_relobj::invalid_address): Move here from child class.
5965 (Sized_relobj::Sized_relobj): Initialize new data members.
5966 (Sized_relobj::sized_relobj): New function.
5967 (Sized_relobj::is_output_section_offset_invalid): Move here from
5969 (Sized_relobj::get_output_section_offset): Likewise.
5970 (Sized_relobj::local_has_got_offset): Likewise.
5971 (Sized_relobj::local_got_offset): Likewise.
5972 (Sized_relobj::set_local_got_offset): Likewise.
5973 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5974 (Sized_relobj::clear_got_offsets): New function.
5975 (Sized_relobj::section_offsets): Move here from child class.
5976 (Sized_relobj::do_output_section_offset): Likewise.
5977 (Sized_relobj::do_set_section_offset): Likewise.
5978 (Sized_relobj::Local_got_offsets): Likewise.
5979 (Sized_relobj::local_got_offsets_): Likewise.
5980 (Sized_relobj::section_offsets_): Likewise.
5981 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5983 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5985 (Sized_relobj_file::sized_relobj): New function
5986 (Sized_relobj_file::local_has_got_offset): Move to base class.
5987 (Sized_relobj_file::local_got_offset): Likewise.
5988 (Sized_relobj_file::set_local_got_offset): Likewise.
5989 (Sized_relobj_file::get_output_section_offset): Likewise.
5990 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5991 (Sized_relobj_file::do_output_section_offset): Likewise.
5992 (Sized_relobj_file::do_set_section_offset): Likewise.
5993 (Sized_relobj_file::Local_got_offsets): Likewise.
5994 (Sized_relobj_file::local_got_offsets_): Likewise.
5995 (Sized_relobj_file::section_offsets_): Likewise.
5996 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5998 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5999 (Output_reloc::get_symbol_index): Likewise.
6000 (Output_reloc::local_section_offset): Likewise.
6001 (Output_reloc::get_address): Likewise.
6002 (Output_reloc::symbol_value): Likewise.
6003 (Output_data_got::reserve_slot): Move to class definition.
6004 (Output_data_got::reserve_local): New function.
6005 (Output_data_got::reserve_slot_for_global): Remove.
6006 (Output_data_got::reserve_global): New function.
6007 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6008 (all constructors, two instantiations).
6009 (Output_reloc::get_relobj): New function (two instantiations).
6010 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6011 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6012 (Output_data_reloc::add_global): Adjust type of relobj.
6013 (Output_data_reloc::add_global_relative): Likewise.
6014 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6015 (Output_data_reloc::add_local): Likewise.
6016 (Output_data_reloc::add_local_relative): Likewise.
6017 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6018 (Output_data_reloc::add_local_section): Likewise.
6019 (Output_data_reloc::add_output_section): Likewise.
6020 (Output_data_reloc::add_absolute): Likewise.
6021 (Output_data_reloc::add_target_specific): Likewise.
6022 (Output_data_got::reserve_slot): Move definition here.
6023 (Output_data_got::reserve_local): New function.
6024 (Output_data_got::reserve_global): New function.
6025 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6026 section_offsets_ with accessor function.
6027 (Sized_relobj_file::write_sections): Likewise.
6028 (Sized_relobj_file::do_relocate_sections): Likewise.
6029 * target.h (Sized_target::reserve_local_got_entry): New function.
6030 (Sized_target::reserve_global_got_entry): New function.
6031 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6032 (Target_x86_64::reserve_global_got_entry): New function.
6033 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6035 2011-05-23 Cary Coutant <ccoutant@google.com>
6037 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6038 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6039 bit when checking got_type.
6040 * incremental.cc (Sized_incremental_binary::setup_readers):
6041 Store symbol table and string table locations; initialize bit vector
6042 of file status flags.
6043 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6045 (Sized_incremental_binary::do_process_got_plt): New function.
6046 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6047 (Output_section_incremental_inputs::set_final_data_size): Record
6048 file index for each input file.
6049 (Output_section_incremental_inputs::write_got_plt): Store file index
6050 instead of input entry offset for each GOT entry.
6052 (Incremental_input_entry::Incremental_input_entry): Initialize new
6054 (Incremental_input_entry::set_offset): Store file index.
6055 (Incremental_input_entry::get_file_index): New function.
6056 (Incremental_input_entry::file_index_): New data member.
6057 (Incremental_binary::process_got_plt): New function.
6058 (Incremental_binary::do_process_got_plt): New function.
6059 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6061 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6062 (Sized_incremental_binary::set_file_is_unchanged): New function.
6063 (Sized_incremental_binary::file_is_unchanged): New function.
6064 (Sized_incremental_binary::do_process_got_plt): New function.
6065 (Sized_incremental_binary::file_status_): New data member.
6066 (Sized_incremental_binary::main_symtab_loc_): New data member.
6067 (Sized_incremental_binary::main_strtab_loc_): New data member.
6068 * output.cc (Output_data_got::Got_entry::write): Add case
6070 (Output_data_got::add_global): Call add_got_entry.
6071 (Output_data_got::add_global_plt): Likewise.
6072 (Output_data_got::add_global_with_rel): Likewise.
6073 (Output_data_got::add_global_with_rela): Likewise.
6074 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6075 (Output_data_got::add_global_pair_with_rela): Likewise.
6076 (Output_data_got::add_local): Call add_got_entry.
6077 (Output_data_got::add_local_plt): Likewise.
6078 (Output_data_got::add_local_with_rel): Likewise.
6079 (Output_data_got::add_local_with_rela): Likewise.
6080 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6081 (Output_data_got::add_local_pair_with_rela): Likewise.
6082 (Output_data_got::reserve_slot): New function.
6083 (Output_data_got::reserve_slot_for_global): New function.
6084 (Output_data_got::add_got_entry): New function.
6085 (Output_data_got::add_got_entry_pair): New function.
6086 (Output_section::add_output_section_data): Edit FIXME.
6088 (Output_section_data_build::Output_section_data_build): New
6089 constructor with size parameter.
6090 (Output_data_space::Output_data_space): Likewise.
6091 (Output_data_got::Output_data_got): Initialize new data member; new
6092 constructor with size parameter.
6093 (Output_data_got::add_constant): Call add_got_entry.
6094 (Output_data_got::reserve_slot): New function.
6095 (Output_data_got::reserve_slot_for_global): New function.
6096 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6097 (Output_data_got::add_got_entry): New function.
6098 (Output_data_got::add_got_entry_pair): New function.
6099 (Output_data_got::free_list_): New data member.
6100 * target.h (Sized_target::init_got_plt_for_update): New function.
6101 (Sized_target::register_global_plt_entry): New function.
6102 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6103 Initialize new data member; call init; add constructor with PLT count.
6104 (Output_data_plt_x86_64::init): New function.
6105 (Output_data_plt_x86_64::add_relocation): New function.
6106 (Output_data_plt_x86_64::reserve_slot): New function.
6107 (Output_data_plt_x86_64::free_list_): New data member.
6108 (Target_x86_64::init_got_plt_for_update): New function.
6109 (Target_x86_64::register_global_plt_entry): New function.
6110 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6111 incremental updates.
6112 (Output_data_plt_x86_64::add_relocation): New function.
6113 * testsuite/object_unittest.cc (Object_test): Set default options.
6115 2011-05-16 Ian Lance Taylor <iant@google.com>
6117 * options.h (class General_options): Make -i a synonym for -r.
6119 2011-05-16 Ian Lance Taylor <iant@google.com>
6121 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6123 2011-05-10 Cary Coutant <ccoutant@google.com>
6125 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6128 2011-05-06 Ian Lance Taylor <iant@google.com>
6130 * layout.cc (Layout::layout): If the output section flags change,
6131 update the ordering.
6133 2011-04-25 Cary Coutant <ccoutant@google.com>
6135 * incremental-dump.cc (dump_incremental_inputs): Print local
6136 symbol info for each input file.
6138 (Output_section_incremental_inputs::set_final_data_size): Add local
6139 symbol info to input file entries in incremental info.
6140 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6141 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6142 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6143 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6145 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6146 (Sized_incr_relobj::do_relocate): Write the local symbols.
6147 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6148 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6149 Adjust size of input file header.
6150 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6151 (Incremental_inputs_reader::get_local_symbol_count): New function.
6152 (Incremental_inputs_reader::get_input_section): Adjust size of input
6154 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6155 (Sized_incr_relobj::This): New typedef.
6156 (Sized_incr_relobj::sym_size): New const data member.
6157 (Sized_incr_relobj::Local_symbol): New struct.
6158 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6159 (Sized_incr_relobj::do_local_symbol_offset): New function.
6160 (Sized_incr_relobj::local_symbol_count_): New data member.
6161 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6162 (Sized_incr_relobj::local_symbol_index_): New data member.
6163 (Sized_incr_relobj::local_symbol_offset_): New data member.
6164 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6165 (Sized_incr_relobj::local_symbols_): New data member.
6166 * object.h (Relobj::output_local_symbol_count): New function.
6167 (Relobj::local_symbol_offset): New function.
6168 (Relobj::do_output_local_symbol_count): New function.
6169 (Relobj::do_local_symbol_offset): New function.
6170 (Sized_relobj::do_output_local_symbol_count): New function.
6171 (Sized_relobj::do_local_symbol_offset): New function.
6173 2011-04-22 Vladimir Simonov <sv@sw.ru>
6175 * descriptors.cc (set_close_on_exec): New function.
6176 (Descriptors::open): Use set_close_on_exec.
6177 * output.cc (S_ISLNK): Define if not defined.
6179 2011-04-22 Cary Coutant <ccoutant@google.com>
6181 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6183 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6184 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6185 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6187 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6188 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6189 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6191 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6193 (Incremental_binary::apply_incremental_relocs): New function.
6194 (Incremental_binary::do_apply_incremental_relocs): New function.
6195 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6197 (Sized_incremental_binary::add_global_symbol): New function.
6198 (Sized_incremental_binary::global_symbol): New function.
6199 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6200 (Sized_incremental_binary::symbol_map_): New data member.
6201 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6202 * target.h (Sized_target::apply_relocation): New function.
6203 * target-reloc.h (apply_relocation): New function.
6204 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6206 2011-04-22 Doug Kwan <dougkwan@google.com>
6208 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6209 flag of a SHT_ARM_EXIDX section.
6210 * testsuite/Makefile.am (arm_exidx_test): New test rules.
6211 * testsuite/Makefile.in: Regenerate.
6212 * testsuite/arm_exidx_test.s: New file.
6213 * testsuite/arm_exidx_test.sh: Same.
6215 2011-04-20 Cary Coutant <ccoutant@google.com>
6218 * archive.h (Incremental_archive_entry::Archive_member):
6219 Initialize arg_serial_ (second constructor).
6221 2011-04-17 Ian Lance Taylor <iant@google.com>
6223 * object.cc (Relocate_info::location): Simplify location string.
6224 * errors.cc (Errors::error_at_location): Don't print program
6226 (Errors::warning_at_location): Likewise.
6227 (Errors::undefined_symbol): Likewise.
6228 * testsuite/debug_msg.sh: Update accordingly.
6230 2011-04-14 Cary Coutant <ccoutant@google.com>
6232 * gold/layout.cc (Layout::symtab_section_offset): New function.
6233 * gold/layout.h (Layout::symtab_section_offset): New function.
6234 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6236 2011-04-12 Ian Lance Taylor <iant@google.com>
6238 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6239 with MREMAP_MAYMOVE.
6240 * output.h (class Output_file): Add map_is_allocated_ field.
6241 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6242 not available, provide stubs. If mremap is not available, #define
6244 (MREMAP_MAYMOVE): Define if not defined.
6245 (Output_file::Output_file): Initialize map_is_allocated_.
6246 (Output_file::resize): Check map_is_allocated_.
6247 (Output_file::map_anonymous): If mmap fails, use malloc.
6248 (Output_file::unmap): Don't do anything for an anonymous map.
6249 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6250 is not available, provide stubs.
6251 (File_read::View::~View): Use free rather than delete[].
6252 (File_read::make_view): Use malloc rather than new[]. If mmap
6254 (File_read::find_or_make_view): Use malloc rather than new[].
6255 * gold.h: Remove HAVE_REMAP code.
6256 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6257 exists. Rename mremap to gold_mremap. If mmap is not available
6259 * configure, config.in: Rebuild.
6261 2011-04-11 Ian Lance Taylor <iant@google.com>
6263 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6264 initialize local variable v.
6266 2011-04-11 Cary Coutant <ccoutant@google.com>
6268 * archive.cc (Archive::include_member): Adjust call to
6270 (Add_archive_symbols::run): Track argument serial numbers.
6271 (Lib_group::include_member): Likewise.
6272 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6273 * archive.h (Incremental_archive_entry::Archive_member):
6274 Initialize arg_serial_.
6275 (Archive_member::arg_serial_): New data member.
6276 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6277 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6279 (Sized_dynobj::do_for_all_local_got_entries): New function.
6280 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6282 * fileread.cc (get_mtime): New function.
6283 * fileread.h (get_mtime): New function.
6284 * gold.cc (queue_initial_tasks): Check for incremental update.
6285 (process_incremental_input): New function.
6286 (queue_middle_tasks): Don't force valid target for incremental
6288 * incremental-dump.cc (find_input_containing_global): Adjust
6289 size of symbol info entry.
6290 (dump_incremental_inputs): Dump argument serial number and
6291 in_system_directory flag; bias shndx by 1; print symbol names
6292 when dumping per-file symbol lists; use new symbol info readers.
6294 (Output_section_incremental_inputs:update_data_size): New function.
6295 (Sized_incremental_binary::setup_readers): Setup input readers
6296 for each input file; build maps for files added from libraries
6298 (Sized_incremental_binary::check_input_args): New function.
6299 (Sized_incremental_binary::do_check_inputs): Build map of argument
6300 serial numbers to input arguments.
6301 (Sized_incremental_binary::do_file_has_changed): Rename
6302 do_file_is_unchanged to this; compare file modification times.
6303 (Sized_incremental_binary::do_init_layout): New function.
6304 (Sized_incremental_binary::do_reserve_layout): New function.
6305 (Sized_incremental_binary::do_get_input_reader): Remove.
6306 (Sized_incremental_binary::get_symtab_view): New function.
6307 (Incremental_checker::can_incrementally_link_output_file): Remove.
6308 (Incremental_inputs::report_command_line): Exclude --debug options.
6309 (Incremental_inputs::report_archive_begin): Add parameter; track
6310 argument serial numbers; don't put input file entry for archive
6311 before archive members.
6312 (Incremental_inputs::report_archive_end): Put input file entry
6313 for archive after archive members.
6314 (Incremental_inputs::report_object): Add parameter; track argument
6315 serial numbers and in_system_directory flag.
6316 (Incremental_inputs::report_script): Add parameter; track argument
6318 (Output_section_incremental_inputs::set_final_data_size): Adjust
6319 size of symbol info entry; check for forwarding symbols.
6320 (Output_section_incremental_inputs::write_input_files): Write
6321 in_system_directory flag and argument serial number.
6322 (Output_section_incremental_inputs::write_info_blocks): Map section
6323 indices between incremental info and original input file; store
6324 input section index for each symbol.
6325 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6326 change operator() to visit().
6327 (class Global_got_offset_visitor): Likewise.
6328 (class Global_symbol_visitor_got_plt):
6329 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6331 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6332 (Sized_incr_relobj::do_read_symbols): New function.
6333 (Sized_incr_relobj::do_layout): New function.
6334 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6335 (Sized_incr_relobj::do_add_symbols): New function.
6336 (Sized_incr_relobj::do_should_include_member): New function.
6337 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6338 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6339 (Sized_incr_relobj::do_section_size): New function.
6340 (Sized_incr_relobj::do_section_name): New function.
6341 (Sized_incr_relobj::do_section_contents): New function.
6342 (Sized_incr_relobj::do_section_flags): New function.
6343 (Sized_incr_relobj::do_section_entsize): New function.
6344 (Sized_incr_relobj::do_section_address): New function.
6345 (Sized_incr_relobj::do_section_type): New function.
6346 (Sized_incr_relobj::do_section_link): New function.
6347 (Sized_incr_relobj::do_section_info): New function.
6348 (Sized_incr_relobj::do_section_addralign): New function.
6349 (Sized_incr_relobj::do_initialize_xindex): New function.
6350 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6351 (Sized_incr_relobj::do_read_relocs): New function.
6352 (Sized_incr_relobj::do_gc_process_relocs): New function.
6353 (Sized_incr_relobj::do_scan_relocs): New function.
6354 (Sized_incr_relobj::do_count_local_symbols): New function.
6355 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6356 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6357 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6358 (Sized_incr_relobj::do_relocate): New function.
6359 (Sized_incr_relobj::do_set_section_offset): New function.
6360 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6361 (Sized_incr_dynobj::do_read_symbols): New function.
6362 (Sized_incr_dynobj::do_layout): New function.
6363 (Sized_incr_dynobj::do_add_symbols): New function.
6364 (Sized_incr_dynobj::do_should_include_member): New function.
6365 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6366 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6367 (Sized_incr_dynobj::do_section_size): New function.
6368 (Sized_incr_dynobj::do_section_name): New function.
6369 (Sized_incr_dynobj::do_section_contents): New function.
6370 (Sized_incr_dynobj::do_section_flags): New function.
6371 (Sized_incr_dynobj::do_section_entsize): New function.
6372 (Sized_incr_dynobj::do_section_address): New function.
6373 (Sized_incr_dynobj::do_section_type): New function.
6374 (Sized_incr_dynobj::do_section_link): New function.
6375 (Sized_incr_dynobj::do_section_info): New function.
6376 (Sized_incr_dynobj::do_section_addralign): New function.
6377 (Sized_incr_dynobj::do_initialize_xindex): New function.
6378 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6379 (make_sized_incremental_object): New function.
6380 (Incremental_library::copy_unused_symbols): New function.
6381 (Incremental_library::do_for_all_unused_symbols): New function.
6382 * incremental.h (enum Incremental_input_flags): New type.
6383 (class Incremental_checker): Remove.
6384 (Incremental_input_entry::Incremental_input_entry): Add argument
6386 (Incremental_input_entry::arg_serial): New function.
6387 (Incremental_input_entry::set_is_in_system_directory): New function.
6388 (Incremental_input_entry::is_in_system_directory): New function.
6389 (Incremental_input_entry::arg_serial_): New data member.
6390 (Incremental_input_entry::is_in_system_directory_): New data member.
6391 (class Script_info): Move here from script.h.
6392 (Script_info::Script_info): Add filename parameter.
6393 (Script_info::filename): New function.
6394 (Script_info::filename_): New data member.
6395 (Incremental_script_entry::Incremental_script_entry): Add argument
6397 (Incremental_object_entry::Incremental_object_entry): Likewise.
6398 (Incremental_object_entry::add_input_section): Build list of input
6399 sections with map to original shndx.
6400 (Incremental_object_entry::get_input_section_index): New function.
6401 (Incremental_object_entry::shndx_): New data member.
6402 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6403 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6404 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6406 (Incremental_inputs::report_archive_begin): Likewise.
6407 (Incremental_inputs::report_object): Likewise.
6408 (Incremental_inputs::report_script): Likewise.
6409 (class Incremental_global_symbol_reader): New class.
6410 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6411 and store flags and input file type.
6412 (Incremental_input_entry_reader::arg_serial): New function.
6413 (Incremental_input_entry_reader::type): Extract type from flags.
6414 (Incremental_input_entry_reader::is_in_system_directory): New function.
6415 (Incremental_input_entry_reader::get_input_section_count): Call
6416 accessor function for type.
6417 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6418 function for type; adjust size of global symbol entry.
6419 (Incremental_input_entry_reader::get_global_symbol_count): Call
6420 accessor function for type.
6421 (Incremental_input_entry_reader::get_object_count): Likewise.
6422 (Incremental_input_entry_reader::get_object_offset): Likewise.
6423 (Incremental_input_entry_reader::get_member_count): Likewise.
6424 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6425 (Incremental_input_entry_reader::get_member_offset): Likewise.
6426 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6427 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6428 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6429 (Incremental_input_entry_reader::get_global_symbol_reader): New
6431 (Incremental_input_entry_reader::get_output_symbol_index): New
6433 (Incremental_input_entry_reader::type_): Remove.
6434 (Incremental_input_entry_reader::flags_): New data member.
6435 (Incremental_inputs_reader::input_file_offset): New function.
6436 (Incremental_inputs_reader::input_file_index): New function.
6437 (Incremental_inputs_reader::input_file): Call input_file_offset.
6438 (Incremental_inputs_reader::input_file_at_offset): New function.
6439 (Incremental_relocs_reader::get_r_type): Reformat.
6440 (Incremental_relocs_reader::get_r_shndx): Reformat.
6441 (Incremental_relocs_reader::get_r_offset): Reformat.
6442 (Incremental_relocs_reader::data): New function.
6443 (Incremental_binary::Incremental_binary): Initialize new data members.
6444 (Incremental_binary::check_inputs): Add cmdline parameter.
6445 (Incremental_binary::file_is_unchanged): Remove.
6446 (Input_reader::arg_serial): New function.
6447 (Input_reader::get_unused_symbol_count): New function.
6448 (Input_reader::get_unused_symbol): New function.
6449 (Input_reader::do_arg_serial): New function.
6450 (Input_reader::do_get_unused_symbol_count): New function.
6451 (Input_reader::do_get_unused_symbol): New function.
6452 (Incremental_binary::input_file_count): New function.
6453 (Incremental_binary::get_input_reader): Change signature to use
6454 index instead of filename.
6455 (Incremental_binary::file_has_changed): New function.
6456 (Incremental_binary::get_input_argument): New function.
6457 (Incremental_binary::get_library): New function.
6458 (Incremental_binary::get_script_info): New function.
6459 (Incremental_binary::init_layout): New function.
6460 (Incremental_binary::reserve_layout): New function.
6461 (Incremental_binary::output_file): New function.
6462 (Incremental_binary::do_check_inputs): New function.
6463 (Incremental_binary::do_file_is_unchanged): Remove.
6464 (Incremental_binary::do_file_has_changed): New function.
6465 (Incremental_binary::do_init_layout): New function.
6466 (Incremental_binary::do_reserve_layout): New function.
6467 (Incremental_binary::do_input_file_count): New function.
6468 (Incremental_binary::do_get_input_reader): Change signature.
6469 (Incremental_binary::input_args_map_): New data member.
6470 (Incremental_binary::library_map_): New data member.
6471 (Incremental_binary::script_map_): New data member.
6472 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6474 (Sized_incremental_binary::output_section): New function.
6475 (Sized_incremental_binary::inputs_reader): Add const.
6476 (Sized_incremental_binary::symtab_reader): Add const.
6477 (Sized_incremental_binary::relocs_reader): Add const.
6478 (Sized_incremental_binary::got_plt_reader): Add const.
6479 (Sized_incremental_binary::get_symtab_view): New function.
6480 (Sized_incremental_binary::Inputs_reader): New typedef.
6481 (Sized_incremental_binary::Input_entry_reader): New typedef.
6482 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6483 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6484 (Sized_incremental_binary::do_file_has_changed): New function.
6485 (Sized_incremental_binary::do_init_layout): New function.
6486 (Sized_incremental_binary::do_reserve_layout): New function.
6487 (Sized_input_reader::Inputs_reader): Remove.
6488 (Sized_input_reader::Input_entry_reader): Remove.
6489 (Sized_input_reader::do_arg_serial): New function.
6490 (Sized_input_reader::do_get_unused_symbol_count): New function.
6491 (Sized_input_reader::do_get_unused_symbol): New function.
6492 (Sized_incremental_binary::do_input_file_count): New function.
6493 (Sized_incremental_binary::do_get_input_reader): Change signature;
6494 use index instead of filename.
6495 (Sized_incremental_binary::section_map_): New data member.
6496 (Sized_incremental_binary::input_entry_readers_): New data member.
6497 (class Sized_incr_relobj): New class.
6498 (class Sized_incr_dynobj): New class.
6499 (make_sized_incremental_object): New function.
6500 (class Incremental_library): New class.
6501 * layout.cc (Free_list::num_lists): New static data member.
6502 (Free_list::num_nodes): New static data member.
6503 (Free_list::num_removes): New static data member.
6504 (Free_list::num_remove_visits): New static data member.
6505 (Free_list::num_allocates): New static data member.
6506 (Free_list::num_allocate_visits): New static data member.
6507 (Free_list::init): New function.
6508 (Free_list::remove): New function.
6509 (Free_list::allocate): New function.
6510 (Free_list::dump): New function.
6511 (Free_list::print_stats): New function.
6512 (Layout_task_runner::run): Resize output file for incremental updates.
6513 (Layout::Layout): Initialize new data members.
6514 (Layout::set_incremental_base): New function.
6515 (Layout::init_fixed_output_section): New function.
6516 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6517 incremental updates.
6518 (Layout::create_gold_note): Do not create gold note section for
6519 incremental updates.
6520 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6521 for incremental updates.
6522 (Layout::set_section_offsets): For incremental updates, allocate space
6524 (Layout::create_symtab_sections): Layout with offsets relative to
6525 start of section; for incremental updates, allocate space from free
6527 (Layout::create_shdrs): For incremental updates, allocate space from
6529 (Layout::finish_dynamic_section): For incremental updates, do not
6530 check --as-needed (fixed in subsequent patch).
6531 * layout.h (class Free_list): New class.
6532 (Layout::set_incremental_base): New function.
6533 (Layout::incremental_base): New function.
6534 (Layout::init_fixed_output_section): New function.
6535 (Layout::allocate): New function.
6536 (Layout::incremental_base_): New data member.
6537 (Layout::free_list_): New data member.
6538 * main.cc (main): Print Free_list statistics.
6539 * object.cc (Relobj::finalize_incremental_relocs): Add
6540 clear_counts parameter; clear counts only when clear_counts is set.
6541 (Sized_relobj::Sized_relobj): Initialize new base class.
6542 (Sized_relobj::do_layout): Don't report special sections.
6543 (Sized_relobj::do_for_all_local_got_entries): New function.
6544 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6545 symtab_off to all symbol table offsets.
6546 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6547 * object.h (class Got_offset_list): Move to top of file.
6548 (Object::Object): Allow case where input_file == NULL.
6549 (Object::~Object): Likewise.
6550 (Object::input_file): Assert that input_file != NULL.
6551 (Object::lock): Allow case where input_file == NULL.
6552 (Object::unlock): Likewise.
6553 (Object::is_locked): Likewise.
6554 (Object::token): Likewise.
6555 (Object::release): Likewise.
6556 (Object::is_incremental): New function.
6557 (Object::get_mtime): New function.
6558 (Object::for_all_local_got_entries): New function.
6559 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6560 (Object::set_is_in_system_directory): New function.
6561 (Object::is_in_system_directory): New function.
6562 (Object::do_is_incremental): New function.
6563 (Object::do_get_mtime): New function.
6564 (Object::do_for_all_local_got_entries): New function.
6565 (Object::is_in_system_directory_): New data member.
6566 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6567 (class Sized_relobj_base): New class.
6568 (class Sized_relobj): Derive from Sized_relobj_base.
6569 (class Sized_relobj::Symbols): Redeclare from base class.
6570 (class Sized_relobj::local_got_offset_list): Remove.
6571 (class Sized_relobj::Output_sections): Redeclare from base class.
6572 (class Sized_relobj::do_for_all_local_got_entries): New function.
6573 (class Sized_relobj::write_local_symbols): Add offset parameter.
6574 (class Sized_relobj::local_symbol_offset_): Update comment.
6575 (class Sized_relobj::local_dynsym_offset_): Update comment.
6576 * options.cc (Input_arguments::add_file): Remove const.
6577 * options.h (Input_file_argument::Input_file_argument):
6578 Initialize arg_serial_ (all constructors).
6579 (Input_file_argument::set_arg_serial): New function.
6580 (Input_file_argument::arg_serial): New function.
6581 (Input_file_argument::arg_serial_): New data member.
6582 (Input_arguments::Input_arguments): Initialize file_count_.
6583 (Input_arguments::add_file): Remove const.
6584 (Input_arguments::number_of_input_files): New function.
6585 (Input_arguments::file_count_): New data member.
6586 (Command_line::number_of_input_files): Call
6587 Input_arguments::number_of_input_files.
6588 * output.cc (Output_segment_headers::Output_segment_headers):
6590 (Output_section::Input_section::current_data_size): New function.
6591 (Output_section::Output_section): Initialize new data members.
6592 (Output_section::add_input_section): Don't do merge sections for
6593 an incremental link; allocate space from free list for an
6595 (Output_section::add_output_section_data): Allocate space from
6596 free list for an incremental update.
6597 (Output_section::update_data_size): New function.
6598 (Output_section::set_fixed_layout): New function.
6599 (Output_section::reserve): New function.
6600 (Output_segment::set_section_addresses): Remove const.
6601 (Output_segment::set_section_list_addresses): Remove const; allocate
6602 space from free list for an incremental update.
6603 (Output_segment::set_offset): Adjust size of RELRO segment for an
6605 * output.h (Output_data::current_data_size): Move here from
6607 (Output_data::pre_finalize_data_size): New function.
6608 (Output_data::update_data_size): New function.
6609 (Output_section_headers::update_data_size): new function.
6610 (Output_section_data_build::current_data_size): Move to Output_data.
6611 (Output_data_strtab::update_data_size): New function.
6612 (Output_section::current_data_size): Move to Output_data.
6613 (Output_section::set_fixed_layout): New function.
6614 (Output_section::has_fixed_layout): New function.
6615 (Output_section::reserve): New function.
6616 (Output_section::update_data_size): New function.
6617 (Output_section::has_fixed_layout_): New data member.
6618 (Output_section::free_list_): New data member.
6619 (Output_segment::set_section_addresses): Remove const.
6620 (Output_segment::set_section_list_addresses): Remove const.
6621 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6623 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6625 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6626 parameter when calling Add_symbols constructor; store argument
6627 serial number for members of a lib group.
6628 (Add_symbols::locks): Allow case where token == NULL.
6629 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6630 (Read_member::~Read_member): New function.
6631 (Read_member::is_runnable): New function.
6632 (Read_member::locks): New function.
6633 (Read_member::run): New function.
6634 (Check_script::~Check_script): New function.
6635 (Check_script::is_runnable): New function.
6636 (Check_script::locks): New function.
6637 (Check_script::run): New function.
6638 (Check_library::~Check_library): New function.
6639 (Check_library::is_runnable): New function.
6640 (Check_library::locks): New function.
6641 (Check_library::run): New function.
6642 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6643 (Add_symbols::library_): New data member.
6644 (class Read_member): New class.
6645 (class Check_script): New class.
6646 (class Check_library): New class.
6647 * reloc.cc (Read_relocs::is_runnable): Allow case where
6649 (Read_relocs::locks): Likewise.
6650 (Scan_relocs::locks): Likewise.
6651 (Relocate_task::locks): Likewise.
6652 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6654 (Sized_relobj::incremental_relocs_scan): Fix comment.
6655 (Sized_relobj::do_relocate): Pass output file offset to
6656 write_local_symbols.
6657 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6658 from class declaration.
6659 * script.cc (read_input_script): Allocate Script_info; pass
6660 argument serial number to report_script.
6661 * script.h (class Script_info): Move to incremental.h.
6662 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6663 * symtab.h (Symbol_table::add_from_incrobj): New function.
6664 (Symbol_table::set_file_offset): New function.
6666 2011-04-05 Cary Coutant <ccoutant@google.com>
6668 * incremental-dump.cc (dump_incremental_inputs): Change signature
6669 to take a Sized_incremental_binary; change caller. Use readers
6670 in Sized_incremental_binary.
6672 (Sized_incremental_binary::find_incremental_inputs_sections):
6673 Rename do_find_incremental_inputs_sections to this.
6674 (Sized_incremental_binary::setup_readers): New function.
6675 (Sized_incremental_binary::do_check_inputs): Check
6676 has_incremental_info_ flag; move setup code to setup_readers;
6678 (Sized_incremental_binary::do_file_is_unchanged): New function.
6679 (Sized_incremental_binary::do_get_input_reader): New function.
6680 * incremental.h (class Incremental_binary): Move to end of file.
6681 (Incremental_binary::file_is_unchanged): New function.
6682 (Incremental_binary::do_file_is_unchanged): New function.
6683 (Incremental_binary::Input_reader): New class.
6684 (Incremental_binary::get_input_reader): New function.
6685 (class Sized_incremental_binary): Move to end of file.
6686 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6687 input section reader classes.
6688 (Sized_incremental_binary::has_incremental_info): New function.
6689 (Sized_incremental_binary::inputs_reader): New function.
6690 (Sized_incremental_binary::symtab_reader): New function.
6691 (Sized_incremental_binary::relocs_reader): New function.
6692 (Sized_incremental_binary::got_plt_reader): New function.
6693 (Sized_incremental_binary::do_file_is_unchanged): New function.
6694 (Sized_incremental_binary::Sized_input_reader): New class.
6695 (Sized_incremental_binary::get_input_reader): New function.
6696 (Sized_incremental_binary::find_incremental_inputs_sections):
6697 Rename do_find_incremental_inputs_sections to this.
6698 (Sized_incremental_binary::setup_readers): New function.
6699 (Sized_incremental_binary::has_incremental_info_): New data member.
6700 (Sized_incremental_binary::inputs_reader_): New data member.
6701 (Sized_incremental_binary::symtab_reader_): New data member.
6702 (Sized_incremental_binary::relocs_reader_): New data member.
6703 (Sized_incremental_binary::got_plt_reader_): New data member.
6704 (Sized_incremental_binary::current_input_file_): New data member.
6706 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6709 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6712 2011-03-30 Cary Coutant <ccoutant@google.com>
6714 * archive.cc (Archive::include_member): Adjust call to report_object.
6715 (Add_archive_symbols::run): Add script_info to call to
6716 report_archive_begin.
6717 (Lib_group::include_member): Adjust call to report_object.
6718 (Add_lib_group_symbols::run): Adjust call to report_object.
6719 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6720 blocks. Add object count for script input files.
6721 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6722 script_info parameter; change all callers.
6723 (Incremental_inputs::report_object): Add script_info parameter;
6725 (Incremental_inputs::report_script): Store backpointer to
6726 incremental info entry.
6727 (Output_section_incremental_inputs::set_final_data_size): Record
6728 additional information for scripts.
6729 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6730 * incremental.h (Incremental_script_entry::add_object): New function.
6731 (Incremental_script_entry::get_object_count): New function.
6732 (Incremental_script_entry::get_object): New function.
6733 (Incremental_script_entry::objects_): New data member; adjust
6735 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6736 (Incremental_inputs::report_object): Add script_info parameter.
6737 (Incremental_inputs_reader::get_object_count): New function.
6738 (Incremental_inputs_reader::get_object_offset): New function.
6739 * options.cc (Input_arguments::add_file): Return reference to
6741 * options.h (Input_argument::set_script_info): New function.
6742 (Input_argument::script_info): New function.
6743 (Input_argument::script_info_): New data member; adjust all
6745 (Input_file_group::add_file): Return reference to new input argument.
6746 (Input_file_lib::add_file): Likewise.
6747 (Input_arguments::add_file): Likewise.
6748 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6749 * script.cc (Parser_closure::Parser_closure): Add script_info
6750 parameter; adjust all callers.
6751 (Parser_closure::script_info): New function.
6752 (Parser_closure::script_info_): New data member.
6753 (read_input_script): Report scripts earlier to incremental info.
6754 (script_add_file): Set script_info in Input_argument.
6755 (script_add_library): Likewise.
6756 * script.h (Script_options::Script_info): Rewrite class.
6758 2011-03-29 Cary Coutant <ccoutant@google.com>
6760 * archive.cc (Library_base::should_include_member): Move
6761 method here from class Archive.
6762 (Archive::Archive): Initialize base class.
6763 (Archive::should_include_member): Move to base class.
6764 (Archive::do_for_all_unused_symbols): New function.
6765 (Add_archive_symbols::run): Remove redundant access to
6767 (Lib_group::Lib_group): Initialize base class.
6768 (Lib_group::do_filename): New function.
6769 (Lib_group::include_member): Pass pointer to Lib_group to
6771 (Lib_group::do_for_all_unused_symbols): New function.
6772 (Add_lib_group_symbols::run): Report archive information for
6774 * archive.h (class Library_base): New base class.
6775 (class Archive): Derive from Library_base.
6776 (Archive::filename): Move to base class.
6777 (Archive::set_incremental_info): Likewise.
6778 (Archive::incremental_info): Likewise.
6779 (Archive::Should_include): Likewise.
6780 (Archive::should_include_member): Likewise.
6781 (Archive::Armap_entry): Remove.
6782 (Archive::Unused_symbol_iterator): Remove.
6783 (Archive::unused_symbols_begin): Remove.
6784 (Archive::unused_symbols_end): Remove.
6785 (Archive::do_filename): New function.
6786 (Archive::do_get_mtime): New function.
6787 (Archive::do_for_all_unused_symbols): New function.
6788 (Archive::task_): Move to base class.
6789 (Archive::incremental_info_): Likewise.
6790 (class Lib_group): Derive from Library_base.
6791 (Lib_group::do_filename): New function.
6792 (Lib_group::do_get_mtime): New function.
6793 (Lib_group::do_for_all_unused_symbols): New function.
6794 (Lib_group::task_): Move to base class.
6795 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6797 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6799 * incremental.cc (Incremental_inputs::report_archive_begin):
6800 Use Library_base; call library's get_mtime; add incremental inputs
6801 entry before members.
6802 (class Unused_symbol_visitor): New class.
6803 (Incremental_inputs::report_archive_end): Use Library_base; use
6804 visitor class to record unused symbols; don't add incremental inputs
6805 entry after members.
6806 (Incremental_inputs::report_object): Use Library_base.
6808 (Incremental_archive_entry::Incremental_archive_entry): Remove
6809 unused Archive parameter.
6810 (Incremental_inputs::report_archive_begin): Use Library_base.
6811 (Incremental_inputs::report_archive_end): Likewise.
6812 (Incremental_inputs::report_object): Likewise.
6813 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6815 * object.h (Object::for_all_global_symbols): New function.
6816 (Object::do_for_all_global_symbols): New function.
6817 (Sized_relobj::do_for_all_global_symbols): New function.
6818 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6820 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6823 2011-03-27 Ian Lance Taylor <iant@google.com>
6825 * archive.cc (Archive::interpret_header): Return -1 if something
6826 goes wrong. Change callers accordingly.
6828 2011-03-25 Cary Coutant <ccoutant@google.com>
6830 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6831 * testsuite/Makefile.in: Regenerate.
6833 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
6835 * plugin.cc (get_view): New.
6836 (Plugin::load): Pass get_view to the plugin.
6837 (Plugin_manager::get_view): New.
6839 2011-03-21 Ian Lance Taylor <iant@google.com>
6841 * testsuite/final_layout.sh: Rewrite to not use dc.
6842 * testsuite/relro_test.sh: Fail if dc is not present.
6844 2011-03-21 Sriraman Tallam <tmsriram@google.com>
6846 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6848 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6849 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6851 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6852 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6854 2011-03-14 Ian Lance Taylor <iant@google.com>
6856 * script-sections.cc (Sort_output_sections::script_compare):
6857 Rename from is_before, change return type.
6858 (Sort_output_sections::operator()): Adjust accordingly.
6860 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6863 * testsuite/odr_violation2.cc: Add comment to make all error line
6864 numbers double digits.
6865 * testsuite/debug_msg.sh: Adjust expected errors.
6867 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6869 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6870 but mark earlier ones as non-canonical
6871 (offset_to_iterator): Update search target and example
6872 (do_addr2line): Return extra lines in a vector*
6873 (format_file_lineno): Extract from do_addr2line
6874 (one_addr2line): Add vector* out-param
6875 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6876 when a lineno entry appeared last for its instruction
6877 (Dwarf_line_info): Add vector* out-param
6878 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6879 * symtab.cc (Odr_violation_compare): Include the lineno in the
6881 (linenos_from_loc): New. Combine the canonical line for an
6882 address with its other lines.
6883 (True_if_intersect): New. Helper functor to make
6884 std::set_intersection a query.
6885 (detect_odr_violations): Compare sets of lines instead of just
6886 one line for each function. This became less deterministic, but
6887 has fewer false positives.
6888 * symtab.h: Declarations.
6889 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6890 mix an optimized and non-optimized object in the same binary
6891 (odr_violation2.so): Same.
6892 * testsuite/Makefile.in: Regenerate from Makefile.am.
6893 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6894 * testsuite/debug_msg.sh: Update line numbers and add
6896 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6897 non-optimized context.
6898 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6899 isn't inlined, and use OdrDerived in an optimized context.
6900 * testsuite/odr_header1.h: Defines OdrDerived, where
6901 optimization will change the
6902 first-instruction-in-the-destructor's file and line number.
6903 * testsuite/odr_header2.h: Defines OdrBase.
6905 2011-03-09 Ian Lance Taylor <iant@google.com>
6907 * fileread.cc (File_read::clear_views): Don't delete the whole
6910 2011-03-08 Ian Lance Taylor <iant@google.com>
6913 * fileread.cc: #include <climits>.
6914 (GOLD_IOV_MAX): Define.
6915 (File_read::read_multiple): Limit number of entries by iov_max.
6916 * fileread.h (class File_read): Always set max_readv_entries to
6919 2011-03-07 Ian Lance Taylor <iant@google.com>
6922 * options.h (class General_options): Add -dy and -dn.
6924 2011-03-02 Cary Coutant <ccoutant@google.com>
6926 * testsuite/script_test_9.t: Add TLS segment.
6928 2011-03-02 Simon Baldwin <simonb@google.com>
6930 * configure.ac: Add check for gnu_indirect_function support in
6931 the toolchain building binutils.
6932 * configure: Rebuild.
6934 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
6936 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6937 plugin only symbols.
6938 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6939 in plugin files as not needed in the symbol table.
6941 2011-02-11 Sriraman Tallam <tmsriram@google.com>
6943 * output.cc (Output_section::add_input_section): Delay fill
6944 generation for section ordering.
6946 2011-02-09 Ian Lance Taylor <iant@google.com>
6949 * object.h (class Sized_relobj): Remove clear_local_symbols.
6950 * reloc.cc (Sized_relobj::do_relocate): Don't call
6951 clear_local_symbols.
6953 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
6955 * plugin.cc (is_visible_from_outside): Return true for symbols
6958 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6960 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6963 2011-02-02 Sriraman Tallam <tmsriram@google.com>
6965 * icf.h (is_section_foldable_candidate): Change type of parameter
6967 * icf.cc (Icf::find_identical_sections): Change type of local variable
6968 section_name to be std::string.
6969 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6971 2011-01-25 Ian Lance Taylor <iant@google.com>
6973 * script.cc (script_add_extern): Rewrite to use
6974 add_symbol_reference.
6976 2011-01-25 Doug Kwan <dougkwan@google.com>
6978 * icf.cc (get_section_contents): Always lock section's object.
6980 2011-01-24 Ian Lance Taylor <iant@google.com>
6982 * options.h (class General_options): Accept
6983 --no-detect-odr-violations.
6985 2011-01-24 Ian Lance Taylor <iant@google.com>
6987 * version.cc (version_string): Bump to 1.11.
6989 2011-01-24 Ian Lance Taylor <iant@google.com>
6991 * plugin.cc (class Plugin_rescan): Define new class.
6992 (Plugin_manager::claim_file): Set any_claimed_.
6993 (Plugin_manager::save_archive): New function.
6994 (Plugin_manager::save_input_group): New function.
6995 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6997 (Plugin_manager::new_undefined_symbol): New function.
6998 (Plugin_manager::rescan): New function.
6999 (Plugin_manager::rescannable_defines): New function.
7000 (Plugin_manager::add_input_file): Set any_added_.
7001 * plugin.h (class Plugin_manager): define new fields rescannable_,
7002 undefined_symbols_, any_claimed_, and any_added_. Declare
7003 Plugin_rescan as friend. Declare new functions.
7004 (Plugin_manager::Rescannable): Define type.
7005 (Plugin_manager::Rescannable_list): Define type.
7006 (Plugin_manager::Undefined_symbol_list): Define type.
7007 (Plugin_manager::Plugin_manager): Initialize new fields.
7008 * archive.cc (Archive::defines_symbol): New function.
7009 (Add_archive_symbols::run): Pass archive to plugins if any.
7010 * archive.h (class Archive): Declare defines_symbol.
7011 * readsyms.cc (Input_group::~Input_group): New function.
7012 (Finish_group::run): Pass input_group to plugins if any.
7013 * readsyms.h (class Input_group): Declare destructor.
7014 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7017 2011-01-10 Ian Lance Taylor <iant@google.com>
7019 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7021 (Layout::set_segment_offsets): Reset increase_relro before calling
7022 set_section_addresses a second time.
7024 2011-01-04 Cary Coutant <ccoutant@google.com>
7026 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7027 sections before NOBITS sections.
7029 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7031 * version.cc (print_version): Update copyright to 2011.
7033 2010-12-23 Cary Coutant <ccoutant@google.com>
7035 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7036 of OS to this->add. Add OD parameter to second form of the function.
7038 2010-12-20 Ian Lance Taylor <iant@google.com>
7040 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7041 second of two consecutive entries with same offset.
7043 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7045 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7046 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7047 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7048 to avoid unneeded links against $(LDADD).
7049 * testsuite/Makefile.in: Regenerate.
7051 2010-12-15 Ian Lance Taylor <iant@google.com>
7054 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7055 for R_X86_64_32 and R_X86_64_PC32.
7056 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7057 ver_matching_def_pic.o.
7058 (ver_matching_def_pic.o): New target.
7060 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7062 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7063 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7064 Move definition before File_read::View member definitions.
7065 (File_read::View::~View): Initialize and hold lock before
7066 updating current_mapped_bytes.
7068 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7070 * dwarf_reader.cc: Remove outdated comment.
7071 * gold-threads.cc: Fix typo in error message.
7072 * archive.cc: Fix typos in comments.
7073 * archive.h: Likewise.
7074 * arm-reloc-property.cc: Likewise.
7075 * arm-reloc-property.h: Likewise.
7076 * arm-reloc.def: Likewise.
7078 * attributes.h: Likewise.
7079 * cref.cc: Likewise.
7080 * ehframe.cc: Likewise.
7081 * fileread.h: Likewise.
7083 * i386.cc: Likewise.
7085 * incremental.h: Likewise.
7086 * int_encoding.cc: Likewise.
7087 * layout.h: Likewise.
7088 * main.cc: Likewise.
7089 * merge.h: Likewise.
7090 * object.cc: Likewise.
7091 * object.h: Likewise.
7092 * options.cc: Likewise.
7093 * readsyms.cc: Likewise.
7094 * reduced_debug_output.cc: Likewise.
7095 * reloc.cc: Likewise.
7096 * script-sections.cc: Likewise.
7097 * sparc.cc: Likewise.
7098 * symtab.h: Likewise.
7099 * target-reloc.h: Likewise.
7100 * target.cc: Likewise.
7101 * target.h: Likewise.
7102 * timer.cc: Likewise.
7103 * timer.h: Likewise.
7104 * x86_64.cc: Likewise.
7106 2010-12-09 Cary Coutant <ccoutant@google.com>
7108 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7110 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7111 parameter; change all callers.
7112 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7113 * options.h (warn_execstack): New option.
7115 2010-12-07 Doug Kwan <dougkwan@google.com>
7117 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7118 like function call relocations.
7120 2010-12-07 Ian Lance Taylor <iant@google.com>
7122 * archive.cc (Archive::get_elf_object_for_member): Permit
7123 punconfigured to be NULL.
7124 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7125 (Archive::include_member): Pass NULL to get_elf_object_for_member
7126 if we searched for the archive and this is the first included
7129 2010-12-01 Ian Lance Taylor <iant@google.com>
7131 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7132 track_relocs_type_ field.
7133 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7134 Set track_relocs_type_.
7135 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7136 contents when using RELA relocs.
7137 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7139 * reloc.cc (Track_relocs::next_addend): New function.
7140 * reloc.h (class Track_relocs): Declare next_addend.
7142 2010-12-01 Ian Lance Taylor <iant@google.com>
7144 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7147 2010-12-01 Ian Lance Taylor <iant@google.com>
7149 * README: Update compilers known to work and fail.
7151 2010-11-23 Matthias Klose <doko@ubuntu.com>
7153 * configure.in: For --enable-gold, handle value `default' instead of
7154 `both*'. Always install ld as ld.bfd, install as ld if gold is
7156 * configure: Regenerate.
7158 2010-11-18 Doug Kwan <dougkwan@google.com>
7160 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7161 and right_alignment to be zero. Store result alignment only if it is
7162 greater than existing alignment.
7164 2010-11-16 Cary Coutant <ccoutant@google.com>
7167 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7168 Check for ".zdebug_line".
7170 2010-11-16 Doug Kwan <dougkwan@google.com>
7171 Cary Coutant <ccoutant@google.com>
7173 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7174 by reference; adjust all callers.
7175 * output.cc (Output_segment::set_section_addresses): Adjust references
7176 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7178 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7179 end at page boundary.
7181 2010-11-16 Cary Coutant <ccoutant@google.com>
7184 * layout.cc (Layout::choose_output_section): Transform names of
7185 compressed sections even when using a script with a SECTIONS clause.
7186 (Layout::output_section_name): Remove code to transform
7187 compressed debug section names.
7188 * output.cc (Output_section::add_input_section): Use uncompressed
7189 section size when tracking input sections.
7191 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7193 * symtab.h (Symbol::NON_PIC_REF): Remove.
7194 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7195 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7196 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7197 (Symbol::use_plt_offset): Take a flags argument and pass it
7198 directly to needs_dynamic_reloc. Restrict check for undefined
7199 weak symbols to function calls.
7200 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7201 (Target_arm::Scan::global): Use it.
7202 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7203 (Target_arm::Relocate::relocate): Likewise.
7204 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7205 parameter with an r_type parameter. Use get_reference_flags
7207 (Target_arm::Relocate::relocate): Update accordingly.
7208 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7209 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7210 (Target_i386::Scan::global): Likewise.
7211 (Target_i386::Relocate::relocate): Likewise.
7212 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7213 parameter with an r_type parameter. Use get_reference_flags
7215 (Target_i386::Relocate::relocate): Update accordingly.
7216 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7217 (Target_powerpc::Scan::global): Use it.
7218 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7219 (Target_powerpc::Relocate::relocate): Likewise.
7220 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7221 (Target_sparc::Scan::global): Use it.
7222 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7223 (Target_sparc::Relocate::relocate): Likewise.
7224 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7225 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7226 (Target_x86_64::Scan::global): Likewise.
7227 (Target_x86_64::Relocate::relocate): Likewise.
7229 2010-11-08 Doug Kwan <dougkwan@google.com>
7230 Cary Coutant <ccoutant@google.com>
7232 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7233 (Arm_exidx_merge_section::section_contents_): New data member.
7234 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7235 (Arm_input_section::~Arm_input_section): De-allocate memory.
7236 (Arm_input_section::original_contents_): New data member.
7237 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7238 in parameters instead of calling Object::section_contents without
7240 (Arm_output_section::group_section): New parameter TASK. Pass it
7241 to callees that need locking objects.
7242 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7243 to lock EXIDX input sections. Fix a formatting issue. Call
7244 Arm_exidx_merged_section::build_contents to create merged section
7246 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7247 to lock object of stub table owner.
7248 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7249 TEXT_SIZE to initialize data member TEXT_SIZE_.
7250 (Arm_exidx_input_section::addralign): Fix typo in comment.
7251 (Arm_exidx_input_section::text_size): New method.
7252 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7253 that require locking objects. Lock objects before scanning for stubs
7254 and updating local symbols.
7255 (Arm_input_section<big_endian>::init): Copy contents of original
7257 (Arm_input_section<big_endian>::do_write): Use saved contents of
7258 original input section instead of calling Object::section_contents
7260 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7261 size without calling Object::section_size().
7262 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7263 for size. Allocate a buffer for merged EXIDX entries.
7264 (Arm_exidx_merged_section::build_contents): New method.
7265 (Arm_exidx_merged_section::do_write): Move merge section contents
7266 building code to Arm_exidx_merged_section::build_contetns. Write
7267 out contetns in buffer instead of building it on the fly.
7268 (Arm_relobj::make_exidx_input_section): Also pass text section size
7269 to Arm_exidx_input_section constructor.
7270 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7271 (Arm_dynobj::do_read_symbols): Fix memory leak.
7272 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7273 * target.h: (class Task): Add forward declaration.
7274 (Target::relax): Add new parameter TASK and pass it to
7276 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7278 2010-11-05 Cary Coutant <ccoutant@google.com>
7281 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7282 object when reading from the file.
7283 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7285 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7286 when reading section contents.
7287 (get_section_contents): Likewise.
7288 (icf::find_identical_sections): Likewise.
7289 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7290 object when reading from the file.
7291 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7292 the object when doing deferred section layout.
7294 2010-11-03 Nick Clifton <nickc@redhat.com>
7297 * script.h (class Symbol_assignment: name): New member. Returns
7298 the name of the symbol.
7299 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7300 Returns true if the given symbol name is on the list of
7301 assignments wating to be processed.
7302 * archive.cc (should_incldue_member): If the symbol is undefined,
7303 check to see if it is on the list of symbols pending assignment.
7305 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7307 * script-sections.cc (Script_sections::find_memory_region): Check
7308 for a NULL output section pointer.
7310 2010-10-29 Doug Kwan <dougkwan@google.com>
7312 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7313 Output_section::add_relaxed_input_section.
7314 * output.cc (Output_section::add_relaxed_input_section): Add new
7315 arguments LAYOUT and NAME. Set section order index.
7316 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7317 Copy section order index.
7318 * output.h (Output_section::add_relaxed_input_section): Add new
7319 arguments LAYOUT and NAME.
7321 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7323 * testsuite/Makefile.am: Move gcctestdir/ld rule to
7324 NATIVE_OR_CROSS_LINKER.
7325 * testsuite/Makefile.in: Regenerate.
7327 2010-10-20 Doug Kwan <dougkwan@google.com>
7329 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7330 without SHF_LINK_ORDER flags.
7331 * layout.cc (Layout::choose_output_section): Do not filter
7332 SHF_LINK_ORDER flag in a relocatable link.
7334 2010-10-17 Cary Coutant <ccoutant@google.com>
7336 * output.h (Output_segment::set_section_addresses): Change function
7337 signature. Update all callers.
7338 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7340 (Output_segment::set_section_addresses): Align after last TLS
7341 section. Add padding before last relro section instead of after.
7343 2010-10-17 Doug Kwan <dougkwan@google.com>
7345 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7346 GOT output section to be writable.
7348 2010-10-14 Cary Coutant <ccoutant@google.com>
7350 * debug.h (DEBUG_INCREMENTAL): New flag.
7351 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7352 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7354 * incremental.cc (report_command_line): Ignore all forms of
7356 * layout.cc (Layout::Layout): Check parameters for incremental link
7358 * options.cc (General_options::parse_incremental): New function.
7359 (General_options::parse_no_incremental): New function.
7360 (General_options::parse_incremental_full): New function.
7361 (General_options::parse_incremental_update): New function.
7362 (General_options::incremental_mode_): New data member.
7363 (General_options::finalize): Check incremental_mode_.
7364 * options.h (General_options): Update help text for --incremental.
7365 Add --no-incremental, --incremental-full, --incremental-update.
7366 (General_options::Incremental_mode): New enum type.
7367 (General_options::incremental_mode): New function.
7368 (General_options::incremental_mode_): New data member.
7369 * parameters.cc (Parameters::incremental_mode_): New data member.
7370 (Parameters::set_options): Set incremental_mode_.
7371 (Parameters::set_incremental_full): New function.
7372 (Parameters::incremental): New function.
7373 (Parameters::incremental_update): New function.
7374 (set_parameters_incremental_full): New function.
7375 * parameters.h (Parameters::set_incremental_full): New function.
7376 (Parameters::incremental): New function.
7377 (Parameters::incremental_update): New function.
7378 (Parameters::incremental_mode_): New data member.
7379 (set_parameters_incremental_full): New function.
7380 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7381 incremental link mode.
7382 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7383 (Sized_relobj::do_relocate_sections): Likewise.
7384 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7386 * testsuite/Makefile.in: Regenerate.
7387 * testsuite/incremental_test.sh: Filter all forms of --incremental.
7389 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7391 * script-sections.h (class Script_sections): Make
7392 Sections_elements typedef public.
7393 * script-sections.cc (class Sort_output_sections): Add elements_
7394 field. Add constructor which sets it; change all callers.
7395 (Sort_output_sections::is_before): New function.
7396 (Sort_output_sections::operator()): Call is_before.
7397 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7399 * testsuite/script_test_10.sh: New test. Test script section
7401 * testsuite/script_test_10.t: Likewise.
7402 * testsuite/script_test_10.s: Likewise.
7403 * testsuite/Makefile.am: Wrap the cross linker tests and the
7404 common tests into NATIVE_OR_CROSS_LINKER.
7405 (check_SCRIPTS): Add script_test_10.sh.
7406 (check_DATA): Add script_test_10.stdout.
7407 (script_test_10.o, script_test_10): New targets.
7408 (script_test_10.stdout): New target.
7409 * configure, testsuite/Makefile.in: Regenerate.
7411 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7413 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7414 error for the deprecated relocations.
7415 (Target_arm::Scan::global): Likewise.
7416 (Target_arm::Relocate::relocate): Likewise.
7418 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7420 * fileread.cc (Input_file::find_file): Initialize *found_name
7421 and *namep when using the fallback search for case 4.
7423 2010-10-11 Cary Coutant <ccoutant@google.com>
7425 * options.h (class General_options): Redefine -z lazy as an alias for
7426 the negation of -z now.
7428 2010-10-11 Ian Lance Taylor <iant@google.com>
7430 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7433 2010-10-06 Nick Clifton <nickc@redhat.com>
7435 * script-sections.cc(class Memory_region): Remove
7436 current_lma_offset_ field. Rename current_vma_offset_ to
7437 current_offset_. Add last_section_ field.
7438 (Memory_region::get_current_vma_address): Rename to
7439 get_current_address.
7440 (Memory_region::get_current_lma_address): Delete.
7441 (Memory_region::increment_vma_offset): Rename to
7443 (Memory_region::increment_lma_offset): Delete.
7444 (Memory_region::attributes_compatible): New method. Returns
7445 true if the provided section is compatible with the region.
7446 (Memory_region::get_last_section): New method. Returns the last
7447 section to use the region.
7448 (Memory_region::set_last_section): New method. Stores the last
7449 section to use the region.
7450 (Script_sections::block_in_region): New method. Returns true if
7451 a block of memory is contained within a region.
7452 (Script_sections::find_memory_region): New method. Locates a
7453 memory region to be used to set a VMA or LMA address.
7454 (Output_section_definition::set_section_addresses): Add code to
7455 check for addresses set by memory regions.
7456 (Output_segment::set_section_addresses): Remove memory region
7458 (Script_sections::create_segment): Add a warning if a header
7459 segment is created outside of any region.
7460 * script-sections.h (class Script_sections): Add prototypes for
7461 find_memory_region and block_in_region methods.
7462 * testsuite/memory_test.s: Use .long instead of .word.
7463 * testsuite/memory_test.t: Add some more output sections.
7464 * testsuite/memory_test.sh: Update expected output.
7466 2010-10-02 Doug Kwan <dougkwan@google.com>
7468 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7469 defintion to symtab.h
7470 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7471 declaration to defintion.
7473 2010-10-01 Nick Clifton <nickc@redhat.com>
7475 * expression.cc (eval): Replace dummy argument with NULL.
7476 (eval_maybe_dot): Check for a NULL result section pointer.
7477 (Symbol_expression::value): Likewise.
7478 (Dot_expression::value): Likewise.
7479 (BINARY_EXPRESSION): Likewise.
7480 (Max_expression::value): Likewise.
7481 (Min_expression::value): Likewise.
7482 (Absolute_expression::value): Likewise.
7483 (Addr_expression::value_from_output_section): Likewise.
7484 (Loaddddr_expression::value_from_output_section): Likewise.
7485 (Segment_start_expression::value): Likewise.
7486 * script-sections.cc
7487 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7489 (Sections_elememt_dot_assignment::set_section_addresses):
7491 (Output_data_expression::do_write_to_buffer): Likewise.
7492 (Output_section_definition::finalize_symbols): Likewise.
7493 (Output_section_definition::set_section_addresses): Likewise.
7495 2010-09-30 Doug Kwan <dougkwan@google.com>
7497 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7499 2010-09-28 Sriraman Tallam <tmsriram@google.com>
7501 * target.h (Target::can_icf_inline_merge_sections): New virtual
7503 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7505 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7507 * icf.cc (get_section_contents): Inline merge sections only when
7510 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7512 * configure: Regenerate.
7514 2010-09-17 Ian Lance Taylor <iant@google.com>
7516 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
7517 * testsuite/Makefile.am (memory_test.o): New target.
7518 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7520 * testsuite/Makefile.in: Rebuild.
7522 2010-09-17 Doug Kwan <dougkwan@google.com>
7524 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7525 defintion if relocation uses GOT entries of the symbol.
7526 * testsuite/icf_safe_test.sh: Fix test.
7527 * testsuite/icf_safe_so_test.sh: Fix test.
7529 2010-09-16 Cary Coutant <ccoutant@google.com>
7531 * script_sections.cc (class Memory_region): Remove "NULL" from
7532 vector initializations.
7534 2010-09-15 Cary Coutant <ccoutant@google.com>
7536 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7537 Resolve forwarding symbols.
7539 2010-09-15 Doug Kwan <dougkwan@google.com>
7541 * gold/testsuite/script_test_3.t: Add ARM special sections.
7542 * gold/testsuite/script_test_4.t: Same.
7543 * gold/testsuite/script_test_5.t: Same.
7544 * gold/testsuite/script_test_6.t: Same.
7545 * gold/testsuite/script_test_7.t: Same.
7546 * gold/testsuite/script_test_7.t: Same.
7547 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7549 2010-09-14 Cary Coutant <ccoutant@google.com>
7551 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7552 (Target_x86_64::Relocate::relocate_tls): Replace check for
7553 saw_tls_block_reloc_ with test for executable section.
7555 2010-09-12 Cary Coutant <ccoutant@google.com>
7557 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7558 position-independent executables to shared libraries need dynamic
7560 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7561 position-independent executables.
7562 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7563 * testsuite/Makefile.in: Regenerate.
7565 2010-09-10 Nick Clifton <nickc@redhat.com>
7568 * testsuite/memory_test.t: Discard any sections that are not
7571 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7574 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7575 "This::" to work around a bug in gcc 4.2.
7577 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7579 2010-09-09 Rafael Espindola <espindola@google.com>
7581 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7582 sections with different PF_X flags in the same segment.
7583 (Layout::find_first_load_seg): Search all segments to find the first
7585 * options.h (rosegment): New.
7587 2010-09-08 Rafael Espindola <espindola@google.com>
7589 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
7591 2010-09-08 Doug Kwan <dougkwan@google.com>
7593 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7594 (Arm_relobj::do_relocate_sections): Add new parameter for output
7595 file to match the parent.
7596 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7597 of local symbols instead of input values. Update code to track
7598 changes in gold::relocate_section.
7599 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7600 (Sized_relobj::compute_final_local_value_internal): New methods.
7601 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7602 body into private version of Sized_relobj::compute_final_local_value.
7603 Call the inline method.
7604 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7605 merged symbol value if there is one.
7606 (Symbol_value::has_output_value): New method defintiion.
7607 (Sized_relobj::Compute_final_local_value_status): New enum type.
7608 (Sized_relobj::compute_final_local_value): New methods.
7609 (Sized_relobj::compute_final_local_value_internal): New methods.
7610 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7611 and arm_cortex_a8.sh.
7612 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7613 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7615 * Makefile.in: Regenerate.
7616 * testsuite/arm_bl_out_of_range.s: Update test.
7617 * testsuite/thumb_bl_out_of_range.s: Ditto.
7618 * testsuite/thumb_blx_out_of_range.s: Ditto.
7619 * testsuite/arm_branch_out_of_range.sh: New file.
7620 * testsuite/arm_cortex_a8.sh: Ditto.
7621 * testsuite/arm_cortex_a8_b.s: Ditto.
7622 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7623 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7624 * testsuite/arm_cortex_a8_bl.s: Ditto.
7625 * testsuite/arm_cortex_a8_blx.s: Ditto.
7626 * testsuite/arm_cortex_a8_local.s: Ditto.
7627 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7628 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7630 2010-09-08 Rafael Espindola <espindola@google.com>
7632 * Makefile.am (memory_test.stdout): Run readelf with -W.
7633 * Makefile.in: Regenerate.
7634 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7637 2010-09-08 Rafael Espindola <espindola@google.com>
7639 * script-sections.cc (Script_sections::add_memory_region): Convert
7640 field precision to int.
7641 * script.cc (script_set_section_region, script_set_section_region):
7642 Convert field precision to int.
7644 2010-09-08 Rafael Espindola <espindola@google.com>
7646 * arm.cc (do_finalize_sections): Create the __exidx_start and
7647 __exdix_end symbols even when the section is missing.
7649 2010-09-08 Nick Clifton <nickc@redhat.com>
7651 * README: Remove claim that MEMORY is not supported.
7652 * expression.cc (script_exp_function_origin)
7653 (script_exp_function_length): Move from here to ...
7654 * script.cc: ... here.
7655 (script_set_section_region, script_add_memory)
7656 (script_parse_memory_attr, script_include_directive): New
7658 * script-sections.cc
7659 (class Memory_region): New class.
7660 (class Output_section_definition): Add set_memory_region,
7661 set_section_vma, set_section_lma and get_section_name methods.
7662 (class Script_Sections): Add add_memory_region,
7663 find_memory_region, find_memory_region_origin,
7664 find_memory_region_length and set_memory_region methods.
7665 Have set_section_addresses method walk the list of set memory
7667 Extend the print methos to display memory regions.
7668 * script-sections.h: Add prototypes for new methods.
7669 Add enum for MEMORY region attributes.
7670 * yyscript.y: Add support for parsing MEMORY regions.
7671 * script-c.h: Add prototypes for new functions.
7672 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7673 * testsuite/Makefile.in: Regenerate.
7674 * testsuite/memory_test.sh: New script.
7675 * testsuite/memory_test.s: New assembler source file.
7676 * testsuite/memory_test.t: New linker script.
7678 2010-08-27 Doug Kwan <dougkwan@google.com>
7680 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7681 reference override an existing dynamic weak reference.
7682 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7683 * testsuite/Makefile.in: Regenerate.
7684 * testsuite/dyn_weak_ref.sh: New file.
7685 * testsuite/dyn_weak_ref_1.c: Ditto.
7686 * testsuite/dyn_weak_ref_2.c: Ditto.
7688 2010-08-27 Ian Lance Taylor <iant@google.com>
7690 * incremental.h (class Incremental_input_entry): Add virtual
7693 2010-08-27 Ian Lance Taylor <iant@google.com>
7695 * testsuite/start_lib_test_3.c: Mark t3 as used.
7697 2010-08-27 Nick Clifton <nickc@redhat.com>
7699 * options.cc (version_script): Fix small typo in previous
7702 2010-08-25 Nick Clifton <nickc@redhat.com>
7704 * archive.cc: Formatting fixes: Remove whitespace between
7705 typename and following asterisk. Remove whitespace between
7706 function name and opening parenthesis.
7707 * archive.h: Likewise.
7709 * attributes.cc: Likewise.
7710 * attributes.h: Likewise.
7711 * common.cc: Likewise.
7712 * copy-relocs.cc: Likewise.
7713 * dirsearch.h: Likewise.
7714 * dynobj.cc: Likewise.
7715 * ehframe.cc: Likewise.
7716 * ehframe.h: Likewise.
7717 * expression.cc: Likewise.
7718 * fileread.cc: Likewise.
7719 * fileread.h: Likewise.
7721 * gold-threads.cc: Likewise.
7722 * gold.cc: Likewise.
7723 * i386.cc: Likewise.
7725 * incremental-dump.cc: Likewise.
7726 * incremental.cc: Likewise.
7727 * layout.cc: Likewise.
7728 * layout.h: Likewise.
7729 * main.cc: Likewise.
7730 * merge.cc: Likewise.
7731 * merge.h: Likewise.
7732 * object.cc: Likewise.
7733 * object.h: Likewise.
7734 * options.cc: Likewise.
7735 * options.h: Likewise.
7736 * output.cc: Likewise.
7737 * output.h: Likewise.
7738 * plugin.cc: Likewise.
7739 * plugin.h: Likewise.
7740 * powerpc.cc: Likewise.
7741 * reloc.cc: Likewise.
7742 * script-c.h: Likewise.
7743 * script-sections.cc: Likewise.
7744 * script.cc: Likewise.
7745 * stringpool.cc: Likewise.
7746 * symtab.cc: Likewise.
7747 * symtab.h: Likewise.
7748 * target.cc: Likewise.
7749 * timer.cc: Likewise.
7750 * timer.h: Likewise.
7751 * version.cc: Likewise.
7752 * x86_64.cc: Likewise.
7754 2010-08-24 Nick Clifton <nickc@redhat.com>
7757 * layout.cc (segment_precedes): Sort segments by their physical
7758 addresses, if they have been set.
7760 2010-08-23 Cary Coutant <ccoutant@google.com>
7762 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7764 (Lib_group::include_member): Unlock object after deleting its
7766 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7769 2010-08-19 Neil Vachharajani <nvachhar@google.com>
7770 Cary Coutant <ccoutant@google.com>
7772 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7773 constructor, and set_blocker.
7774 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7776 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7777 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7778 * testsuite/Makefile.am (start_lib_test): New test case.
7779 * testsuite/Makefile.in: Regenerate.
7780 * testsuite/start_lib_test_main.c: New file.
7781 * testsuite/start_lib_test_1.c: New file.
7782 * testsuite/start_lib_test_2.c: New file.
7783 * testsuite/start_lib_test_3.c: New file.
7785 2010-08-19 Ian Lance Taylor <iant@google.com>
7787 * Makefile.in: Rebuild with automake 1.11.1.
7788 * aclocal.m4: Likewise.
7789 * testsuite/Makefile.in: Likewise.
7791 2010-08-19 Ian Lance Taylor <iant@google.com>
7794 * i386.cc (class Output_data_plt_i386): Update declarations.
7795 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7796 local_ifuncs_ fields.
7797 (Target_i386::do_plt_section_for_global): New function.
7798 (Target_i386::do_plt_section_for_local): New function.
7799 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7800 parameter; change all callers. Initialize global_ifuncs_ and
7801 local_ifuncs_. If doing a static link define __rel_iplt_start and
7803 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7804 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7805 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7807 (Target_i386::make_plt_section): New function, broken out of
7808 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7809 (Target_i386::make_plt_entry): Call make_plt_section.
7810 (Target_i386::make_local_ifunc_plt_entry): New function.
7811 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7812 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7813 R_386_IRELATIVE to switch.
7814 (Target_i386::Scan::global): Likewise.
7815 (Target_i386::Relocate::relocate): Likewise.
7816 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7818 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7819 (Target_x86_64::do_plt_section_for_global): New function.
7820 (Target_x86_64::do_plt_section_for_local): New function.
7821 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7822 parameter; change all callers. If doing a static link define
7823 __rela_iplt_start and __rela_iplt_end.
7824 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7825 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7826 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7828 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7829 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7831 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7832 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7833 R_X86_64_IRELATIVE to switch.
7834 (Target_x86_64::Scan::global): Likewise.
7835 (Target_x86_64::Relocate::relocate): Likewise.
7836 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7838 * target.h (class Target): Add plt_section_for_global and
7839 plt_section_for_local functions. Add do_plt_section_for_global
7840 and do_plt_section_for_local virtual functions.
7841 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7842 clarifying comments.
7843 (Symbol::use_plt_offset): Handle IFUNC symbol.
7844 * object.cc (Sized_relobj::Sized_relobj): Initialize
7846 (Sized_relobj::local_has_plt_offset): New function.
7847 (Sized_relobj::local_plt_offset): New function.
7848 (Sized_relobj::set_local_plt_offset): New function.
7849 (Sized_relobj::do_count): Handle IFUNC symbol.
7850 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7851 a bit away from input_shndx_ field. Add set_is_func_symbol and
7852 is_ifunc_symbol functions.
7853 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7854 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7855 local_plt_offsets_ field.
7856 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7857 * output.h (class Output_section_data): Add non-const
7858 output_section function.
7859 (class Output_data_got): Update declarations.
7860 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7861 Add use_plt_offset parameter to global and local constructors.
7862 Change all callers. Change local_sym_index_ field to 31 bits.
7863 Change GSYM_CODE and CONSTANT_CODE accordingly.
7864 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7865 doing a static link don't set sh_link field.
7866 (Output_data_got::Got_entry::write): Use PLT offset if
7868 (Output_data_got::add_global_plt): New function.
7869 (Output_data_got::add_local_plt): New function.
7870 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7871 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7872 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7873 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7874 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7876 * testsuite/ifunc-sel.h: New file.
7877 * testsuite/ifuncmain1.c: New file.
7878 * testsuite/ifuncmain1vis.c: New file.
7879 * testsuite/ifuncmod1.c: New file.
7880 * testsuite/ifuncdep2.c: New file.
7881 * testsuite/ifuncmain2.c: New file.
7882 * testsuite/ifuncmain3.c: New file.
7883 * testsuite/ifuncmod3.c: New file.
7884 * testsuite/ifuncmain4.c: New file.
7885 * testsuite/ifuncmain5.c: New file.
7886 * testsuite/ifuncmod5.c: New file.
7887 * testsuite/ifuncmain6pie.c: New file.
7888 * testsuite/ifuncmod6.c: New file.
7889 * testsuite/ifuncmain7.c: New file.
7890 * configure, testsuite/Makefile.in: Rebuild.
7892 2010-08-18 Ian Lance Taylor <iant@google.com>
7895 (Output_section_incremental_inputs::write_input_files): Add cast
7896 to avoid signed/unsigned comparison warning.
7897 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7899 2010-08-12 Cary Coutant <ccoutant@google.com>
7901 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7903 2010-08-13 Ian Lance Taylor <iant@google.com>
7905 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7907 2010-08-12 Cary Coutant <ccoutant@google.com>
7908 Doug Kwan <dougkwan@google.com>
7910 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7911 defintion overrides non-weak undef, remember that the original undef
7913 * symtab.cc (Symbol_table::sized_write_global): For undef without
7914 an original weak binding, set binding to global in output.
7915 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7916 * testsuite/Makefile.in: Regenerate.
7917 * testsuite/strong_ref_weak_def.sh: New file.
7918 * testsuite/strong_ref_weak_def_1.c: Ditto.
7919 * testsuite/strong_ref_weak_def_2.c: Ditto.
7921 2010-08-12 Cary Coutant <ccoutant@google.com>
7923 * testsuite/incremental_test.sh: Rewrite.
7924 * testsuite/incremental_test_1.c: Rewrite.
7925 * testsuite/incremental_test_2.c: Rewrite.
7927 2010-08-12 Cary Coutant <ccoutant@google.com>
7929 * arm.cc (Target_arm::got_size): Add const.
7930 (Target_arm::got_entry_count): New function.
7931 (Target_arm::plt_entry_count): New function.
7932 (Target_arm::first_plt_entry_offset): New function.
7933 (Target_arm::plt_entry_size): New function.
7934 (Output_data_plt_arm::entry_count): New function.
7935 (Output_data_plt_arm::first_plt_entry_offset): New function.
7936 (Output_data_plt_arm::get_plt_entry_size): New function.
7937 * i386.cc (Target_i386::got_size): Add const.
7938 (Target_i386::got_entry_count): New function.
7939 (Target_i386::plt_entry_count): New function.
7940 (Target_i386::first_plt_entry_offset): New function.
7941 (Target_i386::plt_entry_size): New function.
7942 (Output_data_plt_i386::entry_count): New function.
7943 (Output_data_plt_i386::first_plt_entry_offset): New function.
7944 (Output_data_plt_i386::get_plt_entry_size): New function.
7945 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7946 find_incremental_inputs_sections. Dump incremental_got_plt section.
7947 * incremental.cc: Include target.h.
7948 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7949 parameter. Adjust all callers. Find incremental_got_plt section.
7950 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7952 (Output_section_incremental_inputs::set_final_data_size): Calculate
7953 size of incremental_got_plt section.
7954 (Output_section_incremental_inputs::do_write): Write the
7955 incremental_got_plt section.
7956 (Got_plt_view_info): New struct.
7957 (Local_got_offset_visitor): New class.
7958 (Global_got_offset_visitor): New class.
7959 (Global_symbol_visitor_got_plt): New class.
7960 (Output_section_incremental_inputs::write_got_plt): New function.
7961 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7962 Add parameter. Adjust all callers.
7963 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7964 (Incremental_inputs::got_plt_section): New function.
7965 (Incremental_inputs::got_plt_section_): New data member.
7966 (Incremental_got_plt_reader): New class.
7967 * layout.cc (Layout::create_incremental_info_sections): Add the
7968 incremental_got_plt section.
7969 * object.h (Got_offset_list::get_list): New function.
7970 (Got offset_list::for_all_got_offsets): New function.
7971 (Sized_relobj::local_got_offset_list): New function.
7972 * powerpc.cc (Target_powerpc::got_size): Add const.
7973 (Target_powerpc::got_entry_count): New function.
7974 (Target_powerpc::plt_entry_count): New function.
7975 (Target_powerpc::first_plt_entry_offset): New function.
7976 (Target_powerpc::plt_entry_size): New function.
7977 (Output_data_plt_powerpc::entry_count): New function.
7978 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7979 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7980 * sparc.cc (Target_sparc::got_size): Add const.
7981 (Target_sparc::got_entry_count): New function.
7982 (Target_sparc::plt_entry_count): New function.
7983 (Target_sparc::first_plt_entry_offset): New function.
7984 (Target_sparc::plt_entry_size): New function.
7985 (Output_data_plt_sparc::entry_count): New function.
7986 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7987 (Output_data_plt_sparc::get_plt_entry_size): New function.
7988 * symtab.h (Symbol::got_offset_list): New function.
7989 (Symbol_table::for_all_symbols): New function.
7990 * target.h (Sized_target::got_entry_count): New function.
7991 (Sized_target::plt_entry_count): New function.
7992 (Sized_target::plt_entry_size): New function.
7993 * x86_64.cc (Target_x86_64::got_size): Add const.
7994 (Target_x86_64::got_entry_count): New function.
7995 (Target_x86_64::plt_entry_count): New function.
7996 (Target_x86_64::first_plt_entry_offset): New function.
7997 (Target_x86_64::plt_entry_size): New function.
7998 (Output_data_plt_x86_64::entry_count): New function.
7999 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8000 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8002 2010-08-12 Cary Coutant <ccoutant@google.com>
8004 * archive.cc: Include incremental.h.
8005 (Archive::Archive): Initialize incremental_info_.
8006 (Archive::include_member): Record archive members in incremental info.
8007 (Add_archive_symbols::run): Record begin and end of an archive in
8009 (Lib_group::include_member): Record objects in incremental info.
8010 * archive.h (Incremental_archive_entry): Forward declaration.
8011 (Archive::set_incremental_info): New member function.
8012 (Archive::incremental_info): New member function.
8013 (Archive::Unused_symbol_iterator): New class.
8014 (Archive::unused_symbols_begin): New member function.
8015 (Archive::unused_symbols_end): New member function.
8016 (Archive::incremental_info_): New data member.
8017 * incremental-dump.cc (find_input_containing_global): New function.
8018 (dump_incremental_inputs): Dump new incremental info sections.
8019 * incremental.cc: Include symtab.h.
8020 (Output_section_incremental_inputs): New class.
8021 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8022 new incremental info sections.
8023 (Sized_incremental_binary::do_check_inputs): Likewise.
8024 (Incremental_inputs::report_archive): Remove.
8025 (Incremental_inputs::report_archive_begin): New function.
8026 (Incremental_inputs::report_archive_end): New function.
8027 (Incremental_inputs::report_object): New function.
8028 (Incremental_inputs::finalize_inputs): Remove.
8029 (Incremental_inputs::report_input_section): New function.
8030 (Incremental_inputs::report_script): Rewrite.
8031 (Incremental_inputs::finalize): Do nothing but finalize string table.
8032 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8033 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8034 (Incremental_inputs::create_data_sections): New function.
8035 (Incremental_inputs::relocs_entsize): New function.
8036 (Output_section_incremental_inputs::set_final_data_size): New function.
8037 (Output_section_incremental_inputs::do_write): New function.
8038 (Output_section_incremental_inputs::write_header): New function.
8039 (Output_section_incremental_inputs::write_input_files): New function.
8040 (Output_section_incremental_inputs::write_info_blocks): New function.
8041 (Output_section_incremental_inputs::write_symtab): New function.
8042 * incremental.h (Incremental_script_entry): Forward declaration.
8043 (Incremental_object_entry): Forward declaration.
8044 (Incremental_archive_entry): Forward declaration.
8045 (Incremental_inputs): Forward declaration.
8046 (Incremental_inputs_header_data): Remove.
8047 (Incremental_inputs_header): Remove.
8048 (Incremental_inputs_header_write): Remove.
8049 (Incremental_inputs_entry_data): Remove.
8050 (Incremental_inputs_entry): Remove.
8051 (Incremental_inputs_entry_write): Remove.
8052 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8053 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8054 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8055 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8057 (Incremental_input_entry): New class.
8058 (Incremental_script_entry): New class.
8059 (Incremental_object_entry): New class.
8060 (Incremental_archive_entry): New class.
8061 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8062 (Incremental_inputs::report_inputs): Remove.
8063 (Incremental_inputs::report_archive): Remove.
8064 (Incremental_inputs::report_archive_begin): New function.
8065 (Incremental_inputs::report_archive_end): New function.
8066 (Incremental_inputs::report_object): Change prototype.
8067 (Incremental_inputs::report_input_section): New function.
8068 (Incremental_inputs::report_script): Change prototype.
8069 (Incremental_inputs::get_reloc_count): New function.
8070 (Incremental_inputs::set_reloc_count): New function.
8071 (Incremental_inputs::create_data_sections): New function.
8072 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8073 (Incremental_inputs::inputs_section): New function.
8074 (Incremental_inputs::symtab_section): New function.
8075 (Incremental_inputs::relocs_section): New function.
8076 (Incremental_inputs::get_stringpool): Add const.
8077 (Incremental_inputs::command_line): Add const.
8078 (Incremental_inputs::inputs): Remove.
8079 (Incremental_inputs::command_line_key): New function.
8080 (Incremental_inputs::input_file_count): New function.
8081 (Incremental_inputs::input_files): New function.
8082 (Incremental_inputs::relocs_entsize): New function.
8083 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8084 (Incremental_inputs::finalize_inputs): Remove.
8085 (Incremental_inputs::Input_info): Remove.
8086 (Incremental_inputs::lock_): Remove.
8087 (Incremental_inputs::inputs_): Change type.
8088 (Incremental_inputs::inputs_map_): Remove.
8089 (Incremental_inputs::current_object_entry_): New data member.
8090 (Incremental_inputs::inputs_section_): New data member.
8091 (Incremental_inputs::symtab_section_): New data member.
8092 (Incremental_inputs::relocs_section_): New data member.
8093 (Incremental_inputs::reloc_count_): New data member.
8094 (Incremental_inputs_reader): New class.
8095 (Incremental_symtab_reader): New class.
8096 (Incremental_relocs_reader): New class.
8097 * layout.cc (Layout::finalize): Move finalization of incremental info
8098 and creation of incremental info sections to follow finalization of
8099 symbol table. Set offsets for postprocessing sections.
8100 (Layout::create_incremental_info_sections): Call
8101 Incremental_inputs::create_data_sections. Add incremental symtab
8102 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8103 sections to layout after input sections.
8104 * layout.h (struct Timespec): Forward declaration.
8105 (Layout::incremental_inputs): Add const.
8106 (Layout::create_incremental_info_sections): Add parameter.
8107 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8108 * object.cc: Include incremental.h.
8109 (Relobj::finalize_incremental_relocs): New function.
8110 (Sized_relobj::do_layout): Record input sections in incremental info.
8111 * object.h (Object::output_section): New function.
8112 (Object::output_section_offset): Moved from Relobj.
8113 (Object::get_incremental_reloc_base): New function.
8114 (Object::get_incremental_reloc_count): New function.
8115 (Object::do_output_section): New function.
8116 (Object::do_output_section_offset): Moved from Relobj.
8117 (Object::do_get_incremental_reloc_base): New function.
8118 (Object::do_get_incremental_reloc_count): New function.
8119 (Object::Object): Initialize new data members.
8120 (Relobj::output_section): Renamed do_output_section and moved to
8122 (Relobj::output_section_offset): Moved to Object.
8123 (Relobj::do_get_incremental_reloc_base): New function.
8124 (Relobj::do_get_incremental_reloc_count): New function.
8125 (Relobj::allocate_incremental_reloc_counts): New function.
8126 (Relobj::count_incremental_reloc): New function.
8127 (Relobj::finalize_incremental_relocs): New function.
8128 (Relobj::next_incremental_reloc_index): New function.
8129 (Relobj::reloc_counts_): New data member.
8130 (Relobj::reloc_bases_): New data member.
8131 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8132 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8133 (Sized_relobj::incremental_relocs_scan): New function.
8134 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8135 (Sized_relobj::incremental_relocs_write): New function.
8136 (Sized_relobj::incremental_relocs_write_reltype): New function.
8137 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8139 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8140 archives and object files elsewhere.
8141 (Add_symbols::run): Report object files here.
8142 (Finish_group::run): Report end of archive at end of group.
8143 * reloc.cc: Include layout.h, incremental.h.
8144 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8145 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8146 (Sized_relobj::incremental_relocs_scan): New function.
8147 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8148 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8149 (Sized_relobj::incremental_relocs_write): New function.
8150 (Sized_relobj::incremental_relocs_write_reltype): New function.
8151 * script.cc (read_input_script): Rewrite test for incremental link.
8152 Change call to Incremental_inputs::report_script.
8153 * symtab.h (Symbol_table::first_global_index): New function.
8154 (Symbol_table::output_count): New function.
8156 2010-08-12 Doug Kwan <dougkwan@google.com>
8158 * arm.cc (Target_arm::merge_object_attributes): Check command line
8159 options --no-wchar-size-warning and --no-enum-size-warning.
8160 * options.h (General_options): Add ld-compatible options
8161 --no-enum-size-warning and --no-wchar-size-warning.
8163 2010-08-04 Ian Lance Taylor <iant@google.com>
8165 * x86_64.cc (Target_x86_64::Scan::local): Use
8166 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8167 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8168 (Target_x86_64::Scan::global): Likewise.
8169 (Target_x86_64::Relocate::relocate): Likewise.
8170 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8173 2010-08-03 Cary Coutant <ccoutant@google.com>
8175 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8176 to reserve space in merged_strings vector. Keep total input size
8178 (Output_merge_string::do_print_merge_stats): Print total input size.
8179 * merge.h (Output_merge_string): Add input_size_ field.
8180 * stringpool.cc (Stringpool_template::string_length): Move
8181 implementations out of Stringpool_template class and place in
8183 * stringpool.h (string_length): Move out of Stringpool_template.
8185 2010-08-03 Ian Lance Taylor <iant@google.com>
8188 * layout.cc (relaxation_loop_body): If address of load segment is
8189 set, adjust address to include headers if possible.
8191 2010-08-03 Ian Lance Taylor <iant@google.com>
8193 * version.cc (version_string): Bump to 1.10.
8195 2010-08-03 Ian Lance Taylor <iant@google.com>
8198 * layout.h (enum Output_section_order): Define.
8199 (class Layout): Update declarations.
8200 * layout.cc (Layout::get_output_section): Add order parameter.
8201 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8202 is_first_non_relro parameters. Change all callers.
8203 (Layout::choose_output_section): Likewise.
8204 (Layout::add_output_section_data): Likewise.
8205 (Layout::make_output_section): Likewise. Set order.
8206 (Layout::default_section_order): New function.
8207 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8208 * output.cc (Output_section::Output_section): Initialize order_.
8209 Don't initialize deleted fields.
8210 (Output_segment::Output_segment): Don't initialize deleted
8212 (Output_segment::add_output_section_to_load): New function
8213 replacing add_output_section. Change all callers to call this or
8214 add_output_section_to_nonload.
8215 (Output_segment::add_output_section_to_nonload): New function.
8216 (Output_segment::remove_output_section): Rewrite.
8217 (Output_segment::add_initial_output_data): Likewise.
8218 (Output_segment::has_any_data_sections): Likewise.
8219 (Output_segment::is_first_section_relro): Likewise.
8220 (Output_segment::maximum_alignment): Likewise.
8221 (Output_segment::has_dynamic_reloc): New function replacing
8222 dynamic_reloc_count. Change all callers.
8223 (Output_segment::has_dynamic_reloc_list): New function replacing
8224 dynamic_reloc_count_list. Change all callers.
8225 (Output_segment::set_section_addresses): Rewrite.
8226 (Output_segment::set_offset): Rewrite.
8227 (Output_segment::find_first_and_last_list): Remove.
8228 (Output_segment::set_tls_offsets): Rewrite.
8229 (Output_segment::first_section_load_address): Likewise.
8230 (Output_segment::output_section_count): Likewise.
8231 (Output_segment::section_with_lowest_load_address): Likewise.
8232 (Output_segment::write_section_headers): Likewise.
8233 (Output_segment::print_sections_to_map): Likewise.
8234 * output.h (class Output_data): Remove dynamic_reloc_count_
8235 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8236 (Output_data::add_dynamic_reloc): Rewrite.
8237 (Output_data::has_dynamic_reloc): New function.
8238 (Output_data::dynamic_reloc_count): Remove.
8239 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8240 is_last_relro_, is_first_non_relro_, is_interp_,
8241 is_dynamic_linker_section_ fields. Add order and set_order
8242 functions. Remove is_relro_local, set_is_relro_local,
8243 is_last_relro, set_is_last_relro, is_first_non_relro,
8244 set_is_first_non_relro functions, is_interp, set_is_interp,
8245 is_dynamic_linker_section, and set_is_dynamic_linker_section
8247 (class Output_segment): Change Output_data_list from std::list to
8248 std:;vector. Add output_lists_ field. Remove output_data_ and
8249 output_bss_ fields. Update declarations.
8251 2010-08-02 Ian Lance Taylor <iant@google.com>
8253 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8254 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8255 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8257 2010-08-02 Ian Lance Taylor <iant@google.com>
8260 * script.cc (Script_options::Script_options): Initialize
8261 symbol_definitions_ and symbol_references_.
8262 (Script_options::add_symbol_assignment): Update
8263 symbol_definitions_ and symbol_references_.
8264 (Script_options::add_symbol_reference): New function.
8265 (script_symbol): New function.
8266 * script.h (class Script_options): Add symbol_definitions_ and
8267 symbol_references_ fields.
8268 (Script_options::referenced_const_iterator): New type.
8269 (Script_options::referenced_begin): New function.
8270 (Script_options::referenced_end): New function.
8271 (Script_options::is_referenced): New function.
8272 (Script_options::any_unreferenced): New function.
8273 * script-c.h (script_symbol): Declare.
8274 * yyscript.y (exp): Call script_symbol.
8275 * symtab.cc: Include "script.h".
8276 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8277 Change all callers. Check symbols referenced by scripts.
8278 (Symbol_table::add_undefined_symbols_from_command_line): Add
8279 layout parameter. Change all callers.
8280 (Symbol_table::do_add_undefined_symbols_from_command_line):
8281 Likewise. Break out loop body. Check symbols referenced by
8283 (Symbol_table::add_undefined_symbol_from_command_line): New
8284 function broken out of
8285 do_add_undefined_symbols_from_command_line.
8286 * symtab.h (class Symbol_table): Update declarations.
8287 * archive.cc: Include "layout.h".
8288 (Archive::should_include_member): Add layout parameter. Change
8289 all callers. Check for symbol mentioned in expression.
8290 * archive.h (class Archive): Update declaration.
8291 * object.cc (Sized_relobj::do_should_include_member): Add layout
8293 * object.h (Object::should_include_member): Add layout parameter.
8295 (Object::do_should_include_member): Add layout parameter.
8296 (class Sized_relobj): Update declaration.
8297 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8299 * dynobj.h (class Sized_dynobj): Update declaration.
8300 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8302 * plugin.h (class Sized_pluginobj): Update declaration.
8304 2010-08-02 Ian Lance Taylor <iant@google.com>
8307 * output.cc (Output_segment::set_offset): Search for the first and
8308 last sections rather than assuming that the list is in order.
8309 (Output_segment::find_first_and_last_list): New function.
8310 * output.h (class Output_segment): Update declarations.
8311 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8312 (relro_strip_test_SOURCES): New variable.
8313 (relro_strip_test_DEPENDENCIES): New variable.
8314 (relro_strip_test_LDFLAGS): New variable.
8315 (relro_strip_test_LDADD): New variable.
8316 (relro_strip_test.so): New target.
8318 2010-08-02 Ian Lance Taylor <iant@google.com>
8320 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8321 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8322 (Target_i386::got_tlsdesc_section): New function.
8323 (Target_i386::got_section): Create space for GOT entries for
8324 TLSDESC relocations.
8325 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8327 (Target_i386::Scan::global): Likewise.
8328 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8330 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8331 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8332 (Target_x86_64::got_tlsdesc_section): New function.
8333 (Target_x86_64::got_section): Create space for GOT entries for
8334 TLSDESC relocations.
8335 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8337 (Target_x86_64::Scan::global): Likewise.
8338 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8341 2010-08-02 Ian Lance Taylor <iant@google.com>
8343 * testsuite/final_layout.sh: Use dc to convert from hex to
8346 2010-07-29 Sriraman Tallam <tmsriram@google.com>
8348 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8349 paramter to the call to gold::gc_process_relocs.
8350 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8351 paramter to the call to gold::gc_process_relocs.
8352 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8353 parameter to the call to gold::gc_process_relocs.
8354 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8355 template parameter to the call to gold::gc_process_relocs.
8356 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8357 paramter to the call to gold::gc_process_relocs.
8358 * gc.h (get_embedded_addend_size): New function.
8359 (gc_process_relocs): Save the size of the reloc for use by ICF.
8360 * icf.cc (get_section_contents): Get the addend from the text section
8361 for SHT_REL relocation sections.
8362 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8363 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8364 * int_encoding.h (read_from_pointer): New overloaded function.
8365 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8366 * testsuite/icf_sht_rel_addend_test.sh: New file.
8367 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8368 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8370 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8372 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8373 * Makefile.in: Regenerate.
8374 * testsuite/Makefile.in: Regenerate.
8376 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8378 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8379 * gold/testsuite/debug_msg.cc: Likewise.
8380 * gold/testsuite/odr_violation1.cc
8381 * gold/testsuite/odr_violation2.cc
8383 2010-07-21 Cary Coutant <ccoutant@google.com>
8385 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8386 string, and length fields.
8387 (Output_merge_string::Merged_strings_list): New type.
8388 (Output_merge_string::Merged_strings_lists): New typedef.
8389 (Output_merge_string): Replace merged_strings_ with
8390 merged_strings_lists_.
8391 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8392 Merged_strings_list per input object and section. Don't store pointer
8393 to the string. Don't store length with each merged string entry.
8394 (Output_merge_string::finalize_merged_data): Loop over list of merged
8395 strings lists. Recompute length of each merged string.
8397 2010-07-15 Cary Coutant <ccoutant@google.com>
8399 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8402 2010-07-14 Ian Lance Taylor <iant@google.com>
8404 * descriptors.cc (Descriptors::open): Report correct name in error
8407 2010-07-13 Doug Kwan <dougkwan@google.com>
8409 * arm.cc (Arm_input_section::Arm_input_section): For a
8410 SHT_ARM_EXIDX section, always keeps the input sections.
8411 (Arm_input_section::set_exidx_section_link): New method.
8412 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8413 has_errors_ to false.
8414 (Arm_exidx_input_section::has_errors,
8415 Arm_exidx_input_section::set_has_errors): New methods.
8416 (Arm_exidx_input_section::has_errors_): New data member.
8417 (Arm_relobj::get_exidx_shndx_list): New method.
8418 (Arm_output_section::append_text_sections_to_list): Do not skip
8419 section without SHF_EXECINSTR.
8420 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8422 (Arm_relobj::make_exidx_input_section): Add new parameter for text
8423 section header. Make error messages more verbose. Check for
8424 a non-executable section linked to an EXIDX section.
8425 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8426 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8427 check that there is no deferred EXIDX section if we exit early.
8428 Instead of not making an EXIDX section in case of an error, make one
8429 and set the has_errors flag of it.
8430 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8431 in a relocatable link.
8432 (Target_arm::do_relax): Look for the EXIDX output section instead of
8433 assuming that it is called .ARM.exidx.
8434 (Target_arm::fix_exidx_coverage): Add a new parameter for input
8435 section list. Do not check for SHF_EXECINSTR section flags but
8436 skip any input section with errors.
8437 * output.cc (Output_section::Output_section): Initialize
8438 always_keeps_input_sections_ to false.
8439 (Output_section::add_input_section): Check for
8440 always_keeps_input_sections_.
8441 * output.h (Output_section::always_keeps_input_sections,
8442 Output_section::set_always_keeps_input_sections): New methods.
8443 (Output_section::always_keeps_input_sections): New data member.
8445 2010-07-13 Rafael Espindola <espindola@google.com>
8447 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8448 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8450 2010-07-13 Philip Herron <herron.philip@googlemail.com>
8451 Ian Lance Taylor <iant@google.com>
8453 * output.h (Output_section_lookup_maps::add_merge_section):
8454 Correct check of whether value was inserted.
8455 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8456 (Output_section_lookup_maps::add_relaxed_input_section):
8458 * arm.cc (Target_arm::got_section): Remove used local os.
8459 * i386.cc (Target_i386::got_section): Likewise.
8460 * x86_64.cc (Target_x86_64::got_section): Likewise.
8461 * sparc.cc (Target_sparc::got_section): Likewise.
8462 (Target_sparc::relocate): Remove unused local have_got_offset.
8463 * powerpc.cc (Target_powerpc::relocate): Likewise.
8465 2010-07-13 Ian Lance Taylor <iant@google.com>
8467 * compressed_output.cc (zlib_decompress): Fix signature in
8470 * archive.cc (Archive::include_member): Unlock an external member
8471 of a thin archive. Don't bother to delete an object we know is
8474 2010-07-12 Cary Coutant <ccoutant@google.com>
8476 * compressed_output.cc (zlib_decompress): New function.
8477 (get_uncompressed_size): New function.
8478 (decompress_input_section): New function.
8479 * compressed_output.h (get_uncompressed_size): New function.
8480 (decompress_input_section): New function.
8481 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8482 Handle compressed debug sections.
8483 * layout.cc (is_compressed_debug_section): New function.
8484 (Layout::output_section_name): Map compressed section names to
8486 * layout.h (is_compressed_debug_section): New function.
8487 (is_debug_info_section): Recognize compressed debug sections.
8488 * merge.cc: Include compressed_output.h.
8489 (Output_merge_data::do_add_input_section): Handle compressed
8491 (Output_merge_string::do_add_input_section): Handle compressed
8493 * object.cc: Include compressed_output.h.
8494 (Sized_relobj::Sized_relobj): Initialize new data members.
8495 (build_compressed_section_map): New function.
8496 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8497 * object.h (Object::section_is_compressed): New method.
8498 (Object::do_section_is_compressed): New method.
8499 (Sized_relobj::Compressed_section_map): New type.
8500 (Sized_relobj::do_section_is_compressed): New method.
8501 (Sized_relobj::compressed_sections_): New data member.
8502 * output.cc (Output_section::add_input_section): Handle compressed
8504 * reloc.cc: Include compressed_output.h.
8505 (Sized_relobj::write_sections): Handle compressed debug sections.
8507 2010-07-08 Cary Coutant <ccoutant@google.com>
8509 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8510 weak when resolving to a dynamic def.
8511 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8512 for weak undef/dynamic def cases. Adjust callers.
8513 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8514 undef_binding_weak_.
8515 (Symbol_table::sized_write_globals): Adjust symbol binding.
8516 (Symbol_table::sized_write_symbol): Add binding parameter.
8517 * symtab.h (Symbol::set_undef_binding): New method.
8518 (Symbol::is_undef_binding_weak): New method.
8519 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8520 (Symbol_table::should_override): Add new parameter.
8521 (Symbol_table::sized_write_symbol): Add new parameter.
8523 * testsuite/weak_undef_file1.cc: Add new test case.
8524 * testsuite/weak_undef_file2.cc: Fix header comment.
8525 * testsuite/weak_undef_test.cc: Add new test case.
8527 2010-06-29 Doug Kwan <dougkwan@google.com>
8529 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8530 Initialize USE_SYMBOL_.
8531 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8533 (Arm_reloc_property::uses_symbol_): New data member declaration.
8534 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8535 uses symbol value and symbol is undefined but not weakly undefined.
8537 2010-06-28 Rafael Espindola <espindola@google.com>
8539 * plugin.cc (Plugin::load): Use dlerror.
8541 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8543 * symtab.cc (detect_odr_violations): When reporting an ODR
8544 violation, report an object where the symbol is defined.
8546 2010-06-25 Doug Kwan <dougkwan@google.com>
8548 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8549 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8551 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8552 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8553 target hook to detect function points.
8554 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8555 * icf.h (Icf::check_section_for_function_pointers): Change type of
8556 parameter SECTION_NAME to const reference to std::string. Use
8557 target hook to determine if section may have unsafe pointers.
8558 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8561 2010-06-21 Rafael Espindola <espindola@google.com>
8563 * fileread.cc (Input_file::find_fie): New
8564 (Input_file::open): Use Input_file::find_fie.
8565 * fileread.h (Input_file::find_fie): New
8566 * plugin.cc (set_extra_library_path): New.
8567 (Plugin::load): Add set_extra_library_path to the transfer vector.
8568 (Plugin_manager::set_extra_library_path): New.
8569 (Plugin_manager::add_input_file): Use the extra search path if set.
8570 (set_extra_library_path(): New.
8571 * plugin.h (Plugin_manager): Add set_extra_library_path and
8574 2010-06-19 Cary Coutant <ccoutant@google.com>
8576 * layout.cc (gdb_sections): Add .debug_types.
8577 (lines_only_debug_sections): Likewise.
8579 2010-06-18 Rafael Espindola <espindola@google.com>
8581 * plugin.cc (add_input_file,add_input_library)
8582 (Plugin_manager::add_input_file): Make filename arguments const.
8583 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8586 2010-06-16 Doug Kwan <dougkwan@google.com>
8588 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8589 .ARM.attributes section if we have not merged any input
8590 attributes sections.
8592 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8594 * arm.cc: Allow combining objects with no EABI version
8597 2010-06-15 Rafael Espindola <espindola@google.com>
8599 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8601 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8603 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8604 (struct iovec): Correct !HAVE_READV definition.
8606 2010-06-10 Cary Coutant <ccoutant@google.com>
8608 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8609 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8611 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8614 * symtab.h (Symbol::is_placeholder): New member function.
8615 * target-reloc.h (relocate_section): Check for placeholder symbols.
8617 * testsuite/Makefile.am (plugin_test_8): New test.
8618 (plugin_test_9): New test.
8619 * testsuite/Makefile.in: Regenerate.
8621 2010-06-09 Nick Clifton <nickc@redhat.com>
8623 * yyscript.y (input_list_element): Allow strings prefixed with
8624 the '-' character. Treat these as libraries.
8625 * script.cc (script_add_library): New function. Adds a library
8626 specified by "-l<name>" found in an input script.
8627 * script-c.h: Add prototype for script_add_library.
8629 2010-06-07 Doug Kwan <dougkwan@google.com>
8631 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8632 Restrict stub-group size to be within long conditional branch
8633 range when working around cortex-A8 erratum.
8635 2010-06-07 Damien Diederen <dd@crosstwine.com>
8637 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8640 2010-06-03 Sriraman Tallam <tmsriram@google.com>
8644 (Output_section::Input_section_sort_entry::compare_section_ordering):
8645 Change to return non-zero correctly.
8646 (Output_section::Input_section_sort_section_order_index_compare
8647 ::operator()): Change to fix ambiguity in comparisons.
8649 2010-06-01 Sriraman Tallam <tmsriram@google.com>
8651 * gold.h (is_wildcard_string): New function.
8652 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8653 (Layout::layout_eh_frame): Ditto.
8654 (Layout::find_section_order_index): New method.
8655 (Layout::read_layout_from_file): New method.
8656 * layout.h (Layout::find_section_order_index): New method.
8657 (Layout::read_layout_from_file): New method.
8658 (Layout::input_section_position_): New private member.
8659 (Layout::input_section_glob_): New private member.
8660 * main.cc (main): Call read_layout_from_file here.
8661 * options.h (--section-ordering-file): New option.
8662 * output.cc (Output_section::input_section_order_specified_): New
8664 (Output_section::Output_section): Initialize new member.
8665 (Output_section::add_input_section): Add new parameter.
8666 Keep input sections when --section-ordering-file is used.
8667 (Output_section::set_final_data_size): Sort input sections when
8668 section ordering file is specified.
8669 (Output_section::Input_section_sort_entry): Add new parameter.
8671 (Output_section::Input_section_sort_entry::compare_section_ordering):
8673 (Output_section::Input_section_sort_compare::operator()): Change to
8674 consider section_order_index.
8675 (Output_section::Input_section_sort_init_fini_compare::operator()):
8676 Change to consider section_order_index.
8677 (Output_section::Input_section_sort_section_order_index_compare
8678 ::operator()): New method.
8679 (Output_section::sort_attached_input_sections): Change to sort
8680 according to section order when specified.
8681 (Output_section::add_input_section<32, true>): Add new parameter.
8682 (Output_section::add_input_section<64, true>): Add new parameter.
8683 (Output_section::add_input_section<32, false>): Add new parameter.
8684 (Output_section::add_input_section<64, false>): Add new parameter.
8685 * output.h (Output_section::add_input_section): Add new parameter.
8686 (Output_section::input_section_order_specified): New
8688 (Output_section::set_input_section_order_specified): New method.
8689 (Input_section::Input_section): Initialize section_order_index_.
8690 (Input_section::section_order_index): New method.
8691 (Input_section::set_section_order_index): New method.
8692 (Input_section::section_order_index_): New member.
8693 (Input_section::Input_section_sort_section_order_index_compare): New
8695 (Output_section::input_section_order_specified_): New member.
8696 * script-sections.cc (is_wildcard_string): Delete and move modified
8698 (Output_section_element_input::Output_section_element_input): Modify
8699 call to is_wildcard_string.
8700 (Output_section_element_input::Input_section_pattern
8701 ::Input_section_pattern): Ditto.
8702 (Output_section_element_input::Output_section_element_input): Ditto.
8703 * testsuite/Makefile.am (final_layout): New test case.
8704 * testsuite/Makefile.in: Regenerate.
8705 * testsuite/final_layout.cc: New file.
8706 * testsuite/final_layout.sh: New file.
8708 2010-06-01 Rafael Espindola <espindola@google.com>
8710 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8712 2010-06-01 Rafael Espindola <espindola@google.com>
8714 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8715 visibility of symbols.
8717 2010-05-27 Doug Kwan <dougkwan@google.com>
8719 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8720 from start of output section instead of address for a local symbol
8721 in a merged or relaxed section when doing a relocatable link.
8723 2010-05-26 Rafael Espindola <espindola@google.com>
8726 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8727 adding sections the garbage collector removed.
8728 * gold/testsuite/Makefile.am: Add test.
8729 * gold/testsuite/Makefile.in: Regenerate.
8730 * gold/testsuite/plugin_test_7.sh: New.
8731 * gold/testsuite/plugin_test_7_1.c: New.
8732 * gold/testsuite/plugin_test_7_2.c: New.
8734 2010-05-26 Rafael Espindola <espindola@google.com>
8736 * script-sections.cc (Output_section_definition::set_section_addresses):
8737 Check for --section-start.
8739 2010-05-26 Doug Kwan <dougkwan@google.com>
8741 * arm.cc (Arm_scan_relocatable_relocs): New class.
8742 (Target_arm::relocate_special_relocatable): New method.
8743 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8744 (Arm_relocate_functions::thumb_branch_common): Same.
8745 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8746 instead of Default_scan_relocatable_relocs.
8747 * target-reloc.h (relocate_for_relocatable): Let target handle
8748 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8749 * target.h (Sized_target::relocate_special_relocatable): New method.
8751 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8753 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8755 2010-05-23 Doug Kwan <dougkwan@google.com>
8757 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8759 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8760 with a direct branch, not a conditional branch, to a stub.
8761 * merge.cc (Output_merge_base::record_input_section): New method
8763 (Output_merge_data::do_add_input_section): Record input section if
8764 keeps-input-sections flag is set.
8765 (Output_merge_string::do_add_input_section): Ditto.
8766 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8767 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8769 (Output_merge_base::keeps_input_sections,
8770 Output_merge_base::set_keeps_input_sections,
8771 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8773 (Output_merge_base::Input_sections): New type declaration.
8774 (Output_merge_base::input_sections_begin,
8775 Output_merge_base::input_sections_end,
8776 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8777 (Output_merge_base::bool keeps_input_sections_,
8778 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8779 Output_merge_base::input_sections_): New data members.
8780 (Output_merge_data::do_set_keeps_input_sections): New method
8782 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8783 * output.cc (Output_section::Input_section::relobj): Move method
8784 defintion from class declaration to here and handle merge sections.
8785 (Output_section::Input_section::shndx): Ditto.
8786 (Output_section::Output_section): Remove initializations of removed
8787 data members and initialize new data member LOOKUP_MAPS_.
8788 (Output_section::add_input_section): Set keeps-input-sections flag
8789 for a newly created merge output section as appropriate. Adjust code
8790 to use Output_section_lookup_maps class.
8791 (Output_section::add_relaxed_input_section): Adjst code for lookup
8792 maps code refactoring.
8793 (Output_section::add_merge_input_section): Add a new parameter
8794 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8795 class. If adding input section to a newly created merge output
8796 section fails, remove the new merge section.
8797 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
8798 Adjust code for use of the Output_section_lookup_maps class.
8799 (Output_section::find_merge_section): Ditto.
8800 (Output_section::build_lookup_maps): New method defintion.
8801 (Output_section::find_relaxed_input_section): Adjust code to use
8802 Output_section_lookup_maps class.
8803 (Output_section::get_input_sections): Export merge sections. Adjust
8804 code to use Output_section_lookup_maps class.
8805 (Output_section:::add_script_input_section): Adjust code to use
8806 Output_section_lookup_maps class. Update lookup maps for merge
8808 (Output_section::discard_states): Use Output_section_lookup_maps.
8809 (Output_section::restore_states): Same.
8810 * output.h (Merge_section_properties): Move class defintion out of
8812 (Output_section_lookup_maps): New class.
8813 (Output_section::Input_section::is_merge_section): New method
8815 (Output_section::Input_section::relobj): Move defintion out of class
8816 defintion. Declare method only.
8817 (Output_section::Input_section::shndx): Ditto.
8818 (Output_section::Input_section::output_merge_base): New method defintion.
8819 (Output_section::Input_section::u2_.pomb): New union field.
8820 (Output_section::Merge_section_by_properties_map,
8821 Output_section::Output_section_data_by_input_section_map,
8822 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8824 (Output_section::add_merge_input_section): Add new parameter
8825 KEEPS_INPUT_SECTIONS.
8826 (Output_section::build_lookup_maps): New method declaration.
8827 (Output_section::merge_section_map_,
8828 Output_section::merge_section_by_properties_map_,
8829 Output_section::relaxed_input_section_map_,
8830 Output_section::is_relaxed_input_section_map_valid_): Remove data
8832 (Output_section::lookup_maps_): New data member.
8834 2010-05-21 Doug Kwan <dougkwan@google.com>
8837 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8838 avoid a compilation error.
8840 2010-05-19 Rafael Espindola <espindola@google.com>
8842 * script-sections.cc (Output_section_definition::allocate_to_segment):
8843 Update the phdrs_list even when the output section is NULL.
8844 * testsuite/Makefile.am: Add test.
8845 * testsuite/Makefile.in: Regenerate.
8846 * testsuite/script_test_9.cc: New.
8847 * testsuite/script_test_9.sh: New.
8848 * testsuite/script_test_9.t: New.
8850 2010-05-19 Doug Kwan <dougkwan@google.com>
8852 * arm.cc (Arm_input_section::original_size): New method.
8853 (Arm_input_section::do_addralign): Add a cast.
8854 (Arm_input_section::do_output_offset): Remove static cast.
8855 (Arm_input_section::original_addralign,
8856 Arm_input_section::original_size_): Change type to uint32_t.
8857 (Arm_input_section::init): Add safe casts for section alignment
8859 (Arm_input_section::set_final_data_size): Do not set address and
8860 offset of stub table.
8861 (Arm_output_section::fix_exidx_coverage): Change use of of
8862 Output_section::Simple_input_section to that of
8863 Output_section::Input_section.
8864 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8865 except for the first pass.
8866 * output.cc (Output_section::get_input_sections): Change type of
8867 input_sections to std::list<Input_section>.
8868 (Output_section::add_script_input_section): Rename from
8869 Output_section::add_simple_input_section. Change type of SIS
8870 parameter from Simple_input_section to Input_section.
8871 * output.h (Output_section::Simple_input_section): Remove class.
8872 (Output_section::Input_section): Change class visibility to public.
8873 (Output_section::Input_section::addralign): Use stored alignments
8874 for special input sections if set.
8875 (Output_section::Input_section::set_addralign): New method.
8876 (Output_section::get_input_sections): Change parameter type from
8877 list of Simple_input_section to list of Input_section.
8878 (Output_section::add_script_input_section): Rename from
8879 Output_section::add_simple_input_section. Change first parameter's
8880 type from Simple_input_section to Input_section and remove the
8881 second and third parameters.
8882 * script-sections.cc (Input_section::Input_section_list): Change
8883 type to list of Output_section::Input_section/
8884 (Input_section_info::Input_section_info): Change parameter type of
8885 INPUT_SECTION to Output_section::Input_section.
8886 (Input_section_info::input_section): Change return type.
8887 (Input_section_info::input_section_): Change type to
8888 Output_section::Input_section.
8889 (Output_section_element_input::set_section_addresses): Adjust code
8890 to use Output_section::Input_section instead of
8891 Output_section::Simple_input_section. Adjust code for renaming
8892 of Output_section::add_simple_input_section.
8893 (Orphan_output_section::set_section_addresses): Ditto.
8895 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8897 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8898 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8900 2010-05-18 Rafael Espindola <espindola@google.com>
8902 * options.cc (General_options::finalize): Handle -nostdlib.
8903 * options.h (nostdlib): New option.
8904 * script.cc (script_add_search_dir): Handle -nostdlib.
8906 2010-05-12 Doug Kwan <dougkwan@google.com>
8908 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8909 attributes section only if there no attributes section after merging.
8910 (Target_arm::merge_object_attributes): Move value of
8911 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
8912 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8913 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8914 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8915 and arm_attr_merge_7.stdout.
8916 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8917 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8918 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8919 arm_attr_merge_7b.o): New rules.
8920 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8922 * testsuite/Makefile.in: Regenerate.
8923 * testsuite/arm_attr_merge.sh: New file.
8924 * testsuite/arm_attr_merge_[67][ab].s: Same.
8926 2010-05-05 Nick Clifton <nickc@redhat.com>
8928 * po/es.po: Updated Spanish translation.
8930 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8932 * Makefile.am (install-exec-local): Properly install gold as
8933 default cross linker.
8934 * Makefile.in: Regenerated.
8936 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8937 Nick Clifton <nickc@redhat.com>
8939 * configure.ac (install_as_default): Define and set to false
8940 unless --enable-gold or --enable-gold=both/gold has been
8942 * configure: Regenerate.
8944 * Makefile.am (install-exec-local): Install the executable as
8945 'ld.gold'. If install_as_default is true then also install it as
8947 * Makefile.in: Regenerated.
8949 2010-04-24 Ian Lance Taylor <iant@google.com>
8951 * layout.cc (Layout::layout_reloc): In relocatable link don't
8952 combine reloc sections for grouped sections.
8954 2010-04-23 Sriraman Tallam <tmsriram@google.com>
8956 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8957 sections that are not ordinary to icf.
8958 * icf.cc (get_section_contents): Handle relocation pointing to section
8959 with no object or shndx information.
8960 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8961 * testsuite/Makefile.in: Regenerate.
8962 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8963 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8965 2010-04-22 Ian Lance Taylor <iant@google.com>
8967 * expression.cc (Expression::Expression_eval_info): Add
8968 result_alignment_pointer field.
8969 (Expression::eval_with_dot): Add result_alignment_pointer
8970 parameter. Change all callers.
8971 (Expression::eval_maybe_dot): Likewise.
8972 (class Binary_expression): Add alignment_pointer parameter to
8973 left_value and right_value. Change all callers.
8974 (BINARY_EXPRESSION): Set result alignment.
8975 (class Trinary_expression): Add alignment_pointer parameter to
8976 arg2_value and arg3_value. Change all callers.
8977 (Trinary_cond::value): Set result alignment.
8978 (Max_expression::value, Min_expression::value): Likewise.
8979 (Align_expression::value): Likewise.
8980 * script-sections.cc (class Sections_element): Add dot_alignment
8981 parameter to set_section_addresses virtual function. Update
8983 (class Output_section_element): Likewise.
8984 (Script_sections::create_segments): Add dot_alignment parameter.
8986 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8987 (Script_sections::set_phdrs_clause_addresses): Likewise.
8988 * script-sections.h: Update declarations.
8989 * script.h: Update declarations.
8990 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8992 * testsuite/script_test_3.t: Set large alignment.
8993 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8994 segment has expected alignment.
8996 2010-04-22 Nick Clifton <nickc@redhat.com>
8998 * po/gold.pot: Updated by the Translation project.
8999 * po/vi.po: Updated Vietnamese translation.
9001 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9003 * testsuite/Makefile.am (check_PROGRAMS): Add
9004 icf_virtual_function_folding_test.
9005 * testsuite/Makefile.in: Regenerated.
9007 2010-04-15 Andrew Haley <aph@redhat.com>
9009 * options.h (merge_exidx_entries): New option.
9010 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9011 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9012 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9013 (Target_arm::merge_exidx_entries): New function.
9014 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9015 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9016 to Arm_exidx_fixup constructor.
9017 Add new arg, merge_exidx_entries.
9018 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9019 Arm_output_section::fix_exidx_coverage.
9021 2010-04-18 Sriraman Tallam <tmsriram@google.com>
9023 * icf.cc (get_section_contents): Check for preemptible functions.
9024 Ignore addend when appropriate.
9025 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9027 (add_from_relobj): Check for section folded.
9028 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9029 * symtab.h (should_add_dynsym_entry): Add new parameter.
9030 * target-reloc.h (scan_relocs): Check for section folded.
9031 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9032 Check reloc types for function pointers in shared objects.
9033 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9035 (icf_preemptible_functions_test): New test case.
9036 (icf_string_merge_test): New test case.
9037 * testsuite.Makefile.in: Regenerate.
9038 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9039 bar_glob. Refactor code.
9040 * testsuite/icf_preemptible_functions_test.cc: New file.
9041 * testsuite/icf_preemptible_functions_test.sh: New file.
9042 * testsuite/icf_string_merge_test.cc: New file.
9043 * testsuite/icf_string_merge_test.sh: New file.
9044 * testsuite/icf_virtual_function_folding_test.cc: New file.
9045 * testsuite/icf_virtual_function_folding_test.sh: New file.
9047 2010-04-14 Doug Kwan <dougkwan@google.com>
9049 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9050 for local symbol recounting if we remove a section due to ICF.
9051 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9052 there are no regular objects in input.
9054 2010-04-13 Doug Kwan <dougkwan@google.com>
9056 * arm.cc (Arm_input_section::set_final_data_size): Compute
9057 accurate final data size instead of using current data size.
9059 2010-04-09 Doug Kwan <dougkwan@google.com>
9061 * layout.cc (Layout::choose_output_section): Handle script section
9063 (Layout::make_output_section_for_script): Add section type parameter.
9064 Handle script section types.
9065 * layout.h (Layout::make_output_section_for_script): Add section
9067 * output.cc (Output_section::Output_section): Initialize data member
9069 (Output_section::do_reset_address_and_file_offset): Do not set address
9070 to 0 if section is a NOLOAD section.
9071 * output.h (Output_section::is_noload): New method.
9072 (Output_section::set_is_noload): Ditto.
9073 (Output_section::is_noload_): New data member.
9074 * script-c.h (Script_section_type): New enum type.
9075 (struct Parser_output_section_header): Add new file section_type.
9076 * script-sections.cc (Sections_element::output_section_name): Add
9077 parameter for returning script section type.
9078 (Output_section_definition::output_section_name): Ditto.
9079 (Output_section_definition::section_type)P; New method.
9080 (Output_section_definiton::script_section_type_name): Ditto.
9081 (Output_section_definition::script_section_type_): New data member.
9082 (Output_section_definition::Output_section_definition): Initialize
9083 data member Output_section_definition::script_section_type_.
9084 (Output_section_definition::create_sections): Pass script section type
9085 to Layout::make_output_section_for_script.
9086 (Output_section_definition::output_section_name): Return script
9087 section type to caller.
9088 (Output_section_definition::set_section_address): Do not advance
9089 dot value and load address if section type is NOLOAD. Set address
9090 of NOLOAD sections regardless of section flags.
9091 (Output_section_definition::print): Print section type if it is
9092 not SCRIPT_SECTION_TYPE_NONE.
9093 (Output_section_definition::section_type): New method.
9094 (Output_section_definition::script_section_type_name): Ditto.
9095 (Script_sections::output_section_name): Add new parameter
9096 PSECTION_TYPE for returning script section type. Pass it to
9097 section elements. Handle discard sections.
9098 (Sort_output_sections::operator()): Handle NOLOAD sections.
9099 * script-sections.h (Script_sections::Section_type): New enum type.
9100 (Script_sections::output_section_name): Add a new parameter for
9101 returning script section type.
9102 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9104 * yyscript.y (union): Add new field SECTION_TYPE.
9105 (COPY, DSECT, INFO, NOLOAD): New tokens.
9106 (opt_address_and_section_type): Change type to output_section_header.
9107 (section_type): New non-terminal
9108 (section_header): Handle section type.
9109 (opt_address_and_section_type): Return section type value.
9111 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9113 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9114 * testsuite/plugin_common_test_2.c (foo): Likewise.
9116 2010-04-08 Doug Kwan <dougkwan@google.com>
9118 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9120 * output.cc (Output_section::add_merge_input_section): Simplify
9121 code and return status of Output_merge_base::add_input_section.
9122 Update merge section map only if Output_merge_base::add_input_section
9125 2010-04-07 Doug Kwan <dougkwan@google.com>
9127 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9128 if section is marked as containing instructions but has no mapping
9130 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9131 correct section index.
9132 (Arm_relobj::find_linked_text_section): Ditto.
9134 2010-04-07 Cary Coutant <ccoutant@google.com>
9136 * archive.cc (include_member): Destroy Read_symbols_data object before
9138 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9139 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9140 (Read_symbols_data::~Read_symbols_data) New destructor.
9141 (Section_relocs::Section_relocs) New constructor.
9142 (Section_relocs::~Section_relocs) New destructor.
9143 (Read_relocs_data::Read_relocs_data) New constructor.
9144 (Read_relocs_data::~Read_relocs_data) New destructor.
9145 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9146 pointers to NULL after deleting.
9148 2010-04-07 Doug Kwan <dougkwan@google.com>
9150 * arm.cc: Replace "endianity" with "endianness" in comments.
9151 (Arm_exidx_cantunwind): Ditto.
9152 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9153 (Arm_relobj::merge_flags_and_attributes): New method.
9154 (Arm_relobj::merge_flags_and_attributes_): New data member.
9155 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9156 (Arm_relobj::scan_sections_for_stubs): Ditto.
9157 (Arm_relobj::do_read_symbols): Check to see if we really want to
9158 merge processor-specific flags and attributes. Exit early if
9159 an object is empty except for section names and the undefined symbol.
9160 (Target_arm::do_finalize_sections): Move check for ELF format to
9161 Arm_relobj::do_read_symbols. Merge processor specific flags and
9162 attributes from a regular object only when we have determined that
9163 it is aapropriate. Do not create an .ARM.attributes section in
9164 output if there is no regular input object.
9165 (Target_arm::merge_processor_specific_flags): Check
9166 --warn-mismatch before printing any error.
9167 (Target_arm::merge_object_attributes): Ditto.
9168 * gold.cc (queue_middle_tasks): Handle the case in which there is
9169 no regular object in input.
9170 * options.cc (General_options::parse_EB): New method.
9171 (General_options::parse_EL): Same.
9172 (General_options::General_options): Initialize endianness_.
9173 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9175 (General_options::Endianness): New enum.
9176 (General_options::endianness): New method.
9177 (General_options::endianness_): New data member.
9178 * parameters.cc (Parameters::set_options): Check target endianness.
9179 (Parameters::set_target_once): Ditto.
9180 (Parameters::check_target_endianness): New method.
9181 (parameters_force_valid_target): If either -EL or -EB is specified,
9182 use it to define endianness of default target.
9183 * parameters.h (Parameters::check_target_endianness): New method
9185 * target.h (class Target): Change "endianity" to "endianness"
9188 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9190 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9191 * configure: Regenerate.
9192 * Makefile.in: Regenerate.
9193 * testsuite/Makefile.in: Regenerate.
9195 2010-04-06 Cary Coutant <ccoutant@google.com>
9198 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9199 prevailing definitions of common symbols.
9200 * testsuite/plugin_test_6.sh: New test case.
9201 * testsuite/plugin_common_test_1.c: New test case.
9202 * testsuite/plugin_common_test_2.c: New test case.
9203 * testsuite/Makefile.am (plugin_test_6): New test case.
9204 * testsuite/Makefile.in: Regenerate.
9206 2010-04-06 Nick Clifton <nickc@redhat.com>
9208 * po/vi.po: New Vietnamese translation.
9210 2010-03-30 Doug Kwan <dougkwan@google.com>
9212 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9214 2010-03-25 Doug Kwan <dougkwan@google.com>
9216 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9217 to avoid a conversion warning on a 32-bit host.
9219 2010-03-24 Ian Lance Taylor <iant@google.com>
9221 * testsuite/script_test_3.t: Add a TLS segment.
9222 * testsuite/Makefile.am (check_PROGRAMS): Add
9223 tls_phdrs_script_test.
9224 (tls_phdrs_script_test_SOURCES): Define.
9225 (tls_phdrs_script_test_DEPENDENCIES): Define.
9226 (tls_phdrs_script_test_LDFLAGS): Define.
9227 (tls_phdrs_script_test_LDADD): Define.
9228 * testsuite/Makefile.in: Rebuild.
9230 2010-03-23 Cary Coutant <ccoutant@google.com>
9232 * fileread.cc (find_or_make_view): Fix comment.
9234 2010-03-23 Ian Lance Taylor <iant@google.com>
9236 * script-sections.cc (class Orphan_section_placement): Define
9237 PLACE_TLS and PLACE_TLS_BSS.
9238 (Orphan_section_placement::Orphan_section_placement): Initialize
9240 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9241 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9242 (tls_script_test_SOURCES): Define.
9243 (tls_script_test_DEPENDENCIES): Define.
9244 (tls_script_test_LDFLAGS): Define.
9245 (tls_script_test_LDADD): Define.
9246 * testsuite/Makefile.in: Rebuild.
9248 2010-03-22 Doug Kwan <dougkwan@google.com>
9250 * arm.cc (Arm_relocate_functions::abs8,
9251 Arm_relocate_functions::abs16): Use correct check for overflow
9252 specified in the ARM ELF specs.
9253 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9254 target of a BLX instruction specially.
9255 (Reloc_stub::stub_type_for_reloc): Ditto.
9256 (Relocate::relocate): Use symbolic names instead of numeric relocation
9257 codes to report error.
9258 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9260 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9261 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9262 thumb2_blx_out_of_range.stdout
9263 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9264 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9265 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9266 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9267 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9268 thumb2_blx_in_range, thumb2_blx_in_range.o,
9269 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9270 thumb2_blx_out_of_range.o): New rules.
9271 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
9272 thumb2_blx_in_range and thumb2_blx_out_of_range.
9273 * testsuite/Makefile.in: Regenerate.
9274 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9275 * testsuite/thumb_blx_in_range.s: New file.
9276 * testsuite/thumb_blx_out_of_range.s: New file.
9278 2010-03-22 Rafael Espindola <espindola@google.com>
9280 * archive.cc (Should_include): Move to archive.h.
9281 (should_include_member): Make it a member of Archive.
9283 (Add_lib_group_symbols): New.
9284 * archive.h: Include options.h.
9285 (Archive_member): Moved from Archive.
9286 (Should_include): Moved from archive.cc.
9288 (Add_lib_group_symbols): New.
9289 * dynobj.cc (do_should_include_member): New.
9290 * dynobj.h (do_should_include_member): New.
9291 * gold.cc (queue_initial_tasks): Update call to queue.
9292 * main.cc (main): Print lib group stats.
9293 * object.cc (do_should_include_member): New.
9294 * object.h: Include archive.h.
9295 (Object::should_include_member): New.
9296 (Object::do_should_include_member): New.
9297 (Sized_relobj::do_should_include_member): New.
9298 * options.cc (General_options::parse_start_lib): New.
9299 (General_options::parse_end_lib): New.
9300 (Input_arguments::add_file): Handle lib groups.
9301 (Input_arguments::start_group): Check we are not in a lib.
9302 (Input_arguments::start_lib): New.
9303 (Input_arguments::end_lib): New.
9304 * options.h (General_options): Add start_lib and end_lib.
9305 (Input_argument::lib_): New.
9306 (Input_argument::lib): New.
9307 (Input_argument::is_lib): New.
9308 (Input_file_lib): New.
9309 (Input_arguments::in_lib_): New.
9310 (Input_arguments::in_lib): New.
9311 (Input_arguments::start_lib): New.
9312 (Input_arguments::end_lib_): New.
9313 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9314 in unused members as preempted.
9315 (Sized_pluginobj::do_should_include_member): New.
9316 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9317 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9319 (Read_symbols::do_whole_lib_group): New.
9320 (Read_symbols::do_lib_group): New.
9321 (Read_symbols::do_read_symbols): Handle lib groups.
9322 (Read_symbols::get_name): Handle lib groups.
9323 * readsyms.h (Read_symbols): Add an archive member pointer.
9324 (Read_symbols::do_whole_lib_group): New.
9325 (Read_symbols::do_lib_group): New.
9326 (Read_symbols::member_): New.
9327 * script.cc (read_input_script): Update call to queue_soon.
9329 2010-03-19 Doug Kwan <dougkwan@google.com>
9331 * arm.cc (Stub_table::Stub_table): Initialize new data members
9332 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9333 (Stub_table::add_reloc_stub): Assign stub offset and update
9334 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9335 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9337 (Stub_table::update_data_size_and_addralign): Use
9338 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9339 instead of going over all reloc stubs.
9340 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
9341 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9342 Stringpool_template::offset_ to size of Stringpool_char.
9343 (Stringpool_template::new_key_offset): Remove code to initialize
9344 Stringpool_template::offset_.
9345 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9346 Stringpool_template::offset_ to zero.
9348 2010-03-15 Doug Kwan <dougkwan@google.com>
9350 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9352 (Stringpool_template::new_key_offset): New method.
9353 (Stringpool_template::add_string): Assign offsets when adding new
9355 (Stringpool_template::set_string_offsets): Do not set string offsets
9356 when not optimizing.
9357 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9359 (Chunked_vector::clear): Clear size_.
9360 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9361 (Chunked_vector::size): Return size_.
9362 (Chunked_vector::push_back): Use size_ to find insert position.
9363 (Chunked_vector::size_): New data member.
9364 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9365 (Stringpool_template::new_key_offset): New method declaration.
9366 (Stringpool_template::offset_): New data member.
9368 2010-03-15 Rafael Espindola <espindola@google.com>
9370 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9371 Add_symbols' constructor.
9372 * readsyms.h (Add_symbols): Remove the input_group member.
9374 2010-03-10 Ian Lance Taylor <iant@google.com>
9376 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9377 target to ask whether a reference to a symbol requires a stack
9379 * target.h (Target::is_call_to_non_split): New function.
9380 (Target::do_is_call_to_non_split): Declare virtual function.
9381 * target.cc: Include "symtab.h".
9382 (Target::do_is_call_to_non_split): New function.
9383 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9385 2010-03-10 Cary Coutant <ccoutant@google.com>
9387 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9388 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9389 (File_read::open[2]): Add whole_file_view_ to list of views.
9390 (File_read::make_view): Remove test of whole_file_view_.
9391 (File_read::find_or_make_view): Create whole_file_view_ if
9393 (File_read::clear_views): Replace bool parameter with enum;
9394 adjust all callers. Don't delete views with permanent data;
9395 do delete cached views and views from archives if
9396 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9397 if clearing the corresponding view.
9398 * fileread.h (File_read::Clear_views_mode): New enum.
9399 (File_read::View::is_permanent_view): New method.
9400 (File_read::clear_views): Replace bool parameter
9401 with enum; adjust all callers.
9402 * options.h (General_options): Change keep_files_mapped option;
9403 add map_whole_files.
9404 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9406 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9409 2010-03-10 David S. Miller <davem@davemloft.net>
9411 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9413 2010-03-09 Sriraman Tallam <tmsriram@google.com>
9415 * icf.cc (get_section_contents): Add '@' marker after processing the
9418 2010-03-08 Doug Kwan <dougkwan@google.com>
9420 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9421 due to a conversion warning.
9422 (Arm_relobj::update_output_local_symbol_count): Check for local
9423 symbol with unset output index.
9425 2010-03-05 Ian Lance Taylor <iant@google.com>
9427 * options.h (class General_options): Add --spare-dynamic-tags.
9428 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9429 --spare-dynamic-tags.
9431 2010-03-05 Ian Lance Taylor <iant@google.com>
9433 * incremental.cc: Include "libiberty.h".
9435 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9437 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9438 function, is_info_ member.
9439 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9440 (Versions::Versions): Update caller.
9441 (Versions::define_base_version): Likewise.
9442 (Versions::add_def): Likewise.
9444 2010-03-03 Sriraman Tallam <tmsriram@google.com>
9446 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9447 (Scan::possible_function_pointer_reloc): New function.
9448 (Scan::local_reloc_may_be_function_pointer): Change to call
9449 possible_function_pointer_reloc.
9450 (Scan::global_reloc_may_be_function_pointer): Ditto.
9451 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9452 relocations in ".data.rel.ro._ZTV" section.
9453 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9454 * testsuite/icf_safe_so_test.cc: Ditto.
9455 * testsuite/icf_safe_test.cc: Ditto.
9456 * testsuite/icf_safe_test.sh: Ditto.
9458 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9459 Ian Lance Taylor <iant@google.com>
9461 * target-reloc.h (relocate_section): Check the symbol table index
9462 for -1U before setting the local symbol index.
9463 (scan_relocatable_relocs): If copying the relocation, record that
9464 the local symbol is required.
9465 * object.h (Symbol_value::is_output_symtab_index_set): New
9467 (Symbol_value::may_be_discarded_from_output_symtab): New
9469 (Symbol_value::has_output_symtab_entry): New function.
9470 (Symbol_value::needs_output_symtab_entry): Remove.
9471 (Symbol_value::output_symtab_index): Make sure the symbol index is
9473 (Symbol_value::set_output_symtab_index): Make sure the symbol
9474 index is not set. Make sure the new index is valid.
9475 (Symbol_value::set_must_have_output_symtab_entry): New function.
9476 (Symbol_value::has_output_dynsym_entry): New function.
9477 (Symbol_value::set_output_dynsym_index): Make sure the new index
9479 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9480 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9481 local symbol if permitted.
9482 (Sized_relobj::do_finalize_local_symbols): Call
9483 is_output_symtab_index_set rather than needs_output_symtab_entry.
9484 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9485 rather than needs_output_symtab_entry. Call
9486 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9487 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9488 is_output_symtab_index_set rather than needs_output_symtab_entry.
9489 * testsuite/discard_locals_relocatable_test.c: New file.
9490 * testsuite/discard_locals_test.sh: Test -r.
9491 * testsuite/Makefile.am (check_DATA): Add
9492 discard_locals_relocatable_test1.syms,
9493 discard_local_relocatable_test2.syms.
9494 (MOSTLYCLEANFILES): Likewise. Also add
9495 discard_locals_relocatable_test1.lout and
9496 discard_locals_relocatable_test2.out.
9497 (discard_locals_relocatable_test1.syms): New target.
9498 (discard_locals_relocatable_test.o): New target.
9499 (discard_locals_relocatable_test1.out): New target.
9500 (discard_locals_relocatable_test2.syms): New target.
9501 (discard_locals_relocatable_test2.out): New target.
9502 (various): Add missing ../ld-new dependencies.
9503 * testsuite/Makefile.in: Rebuild.
9505 2010-03-03 Nick Clifton <nickc@redhat.com>
9507 * po/fi.po: New Finnish translation.
9509 2010-03-01 Doug Kwan <dougkwan@google.com>
9511 * layout.cc (Layout::Layout): Force section types of .init_array*,
9512 .preinit_array* and .fini_array* sections.
9513 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9514 Fix check of return value of std::string::find.().
9515 (Output_section::Input_section_sort_compare::operator()): Remove
9516 comment about .init_array.
9517 (Output_section::Input_section_sort_init_fini_compare::operator()):
9519 (Output_section::sort_attached_input_sections): Handle .init_array
9520 and .fini_array specially.
9521 * output.h (Output_section::Inut_section_sort_compare): Update
9523 (Output_section::Input_section_sort_init_fini_compare): New struct.
9525 2010-02-26 Doug Kwan <dougkwan@google.com>
9527 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9528 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9529 * testsuite/debug_msg.sh: Avoid matching source line number for
9530 use of global variable undef_int.
9532 2010-02-26 Doug Kwan <dougkwan@google.com>
9534 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9535 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9536 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9537 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9538 * options.cc (General_options::General_options): Initialize member
9540 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9541 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9542 and rm_no_fix_v4bx.stdout
9543 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9544 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9545 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9546 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9547 and arm_no_fix_v4bx.
9548 * Makefile.in: Regenerate.
9549 * testsuite/arm_fix_v4bx.s: New file.
9550 * testsuite/arm_fix_v4bx.sh: Ditto.
9552 2010-02-24 Doug Kwan <dougkwan@google.com>
9554 * arm.cc (Target_arm::got_section): Make the .got section the first
9555 non RELRO section in the data segment.
9556 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9557 suffixes of section names.
9559 2010-02-24 Doug Kwan <dougkwan@google.com>
9561 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9562 flags and attributes merging if an input file is a binary file.
9563 * fileread.cc (Input_file::open): Record format of original file.
9564 * fileread.h (Input_file::Format): New enum type.
9565 (Input_file::Input_file): Initialize data member format_.
9566 (Input_file::format): New method definition.
9567 (Input_file::format_):: New data member.
9569 2010-02-24 Doug Kwan <dougkwan@google.com>
9571 * arm.cc (Arm_output_data_got): New class.
9572 (ARM_TCB_SIZE): New constant
9573 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9574 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9575 If user uses a script with a SECTIONS clause, issue only a warning
9576 for a misplaced EXIDX input section. Otherwise, issue an error.
9577 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
9579 (Target_arm::got_mode_index_entry): Handle static linking.
9580 (Target_arm::Scan::local): Ditto.
9581 (Target_arm::Scan::global): Ditto.
9582 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9583 all incorrectly implemented relocations.
9584 (Target_arm::fix_exidx_coverage): Pass layout to
9585 Arm_output_section::fix_exidx_coverage.
9586 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9587 from ".ARM.exidx." and ".ARM.extab.".
9589 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9591 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9592 section if it does not already exist.
9593 * attributes.cc (Attributes_section_data::Attributes_section_data):
9594 Don't crash if size is zero.
9596 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9597 Ian Lance Taylor <iant@google.com>
9599 * gold.cc (queue_middle_tasks): If no input files were opened,
9601 * workqueue.h (Task_function::Task_function): Assert that there is
9604 2010-02-22 Doug Kwan <dougkwan@google.com>
9606 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9607 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9608 types to avoid warnings due to different uint64_t implementations
9611 2010-02-21 Doug Kwan <dougkwan@google.com>
9613 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9614 handling of the maximum backward branch offset.
9615 (Arm_relocate_functions::thumb_branch_common): Ditto.
9616 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9617 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
9618 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
9619 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9620 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9621 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9622 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9623 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9624 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9625 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9626 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9627 thumb2_bl_out_of_range.o): New rules.
9628 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9629 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9630 thumb2_bl_out_of_range
9631 * testsuite/Makefile.in: Regenerate.
9632 * testsuite/arm_bl_in_range.s: New file.
9633 * testsuite/arm_bl_out_of_range.s: Ditto.
9634 * testsuite/arm_branch_in_range.sh: Ditto.
9635 * testsuite/arm_branch_range.t: Ditto.
9636 * testsuite/thumb2_branch_range.t: Ditto.
9637 * testsuite/thumb_bl_in_range.s: Ditto.
9638 * testsuite/thumb_bl_out_of_range.s: Ditto.
9639 * testsuite/thumb_branch_range.t: Ditto.
9641 2010-02-20 Sriraman Tallam <tmsriram@google.com>
9643 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9644 Add reloc offset information.
9645 * icf.cc (get_section_contents): Change iterators to point to the new
9646 vectors. Add reloc offset information to the contents.
9647 * icf.h (Icf::Sections_reachable_info): New typedef.
9648 (Icf::Sections_reachable_list): New typedef.
9649 (Icf::Offset_info): New typedef.
9650 (Icf::Reloc_info): New struct typedef.
9651 (Icf::Reloc_info_list): New typedef.
9652 (Icf::symbol_reloc_list): Delete method.
9653 (Icf::addend_reloc_list): Delete method.
9654 (Icf::section_reloc_list): Delete method.
9655 (Icf::reloc_info_list): New method.
9656 (Icf::reloc_info_list_): New member.
9658 2010-02-19 Doug Kwan <dougkwan@google.com>
9660 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9661 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9662 * arm.cc (Arm_relocation_functions): New forward declaration.
9663 (Target_arm::Target_arm): Initialize new data members
9664 got_mod_index_offset_ and tls_base_symbol_defined_.
9665 (Target_arm::Relocate::relocate_tls): New method.
9666 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9667 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9669 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
9670 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9671 (Target_arm::got_mod_index_offset_,
9672 Target_arm::tls_base_symbol_defined_): New data members.
9673 (Target_arm::Scan::local, Target::Scan::global,
9674 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9677 2010-02-18 Doug Kwan <dougkwan@google.com>
9679 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9680 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9681 text section as a parameter becuase some broken tools may not set
9682 the link in section header.
9683 (Target_arm::has_got_section): New method.
9684 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9685 without any mapping symbol as data only. Remove warning.
9686 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9687 link in its section header, try to discover the link by inspecting the
9688 REL31 relocation at the beginning of the section.
9689 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9691 (Target_arm::Scan::global): Treat any reference to the symbol
9692 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9694 2010-02-12 Sriraman Tallam <tmsriram@google.com>
9696 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9697 (Scan::global_reloc_may_be_function_pointer): New function.
9698 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9699 (Scan::global_reloc_may_be_function_pointer): New function.
9700 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9701 (Scan::global_reloc_may_be_function_pointer): New function.
9702 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9703 (Scan::global_reloc_may_be_function_pointer): New function.
9704 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9705 (Scan::global_reloc_may_be_function_pointer): New function.
9706 (Scan::possible_function_pointer_reloc): New function.
9707 (Target_x86_64::can_check_for_function_pointers): New function.
9708 * gc.h (gc_process_relocs): Scan relocation types to determine if
9709 function pointers were taken for targets that support it.
9710 * icf.cc (Icf::find_identical_sections): Include functions for
9711 folding in safe ICF whose pointer is not taken.
9712 * icf.h (Secn_fptr_taken_set): New typedef.
9713 (fptr_section_id_): New member.
9714 (section_has_function_pointers): New function.
9715 (set_section_has_function_pointers): New function.
9716 (check_section_for_function_pointers): New function.
9717 * options.h: Fix comment for safe ICF option.
9718 * target.h (can_check_for_function_pointers): New function.
9719 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9720 Modify icf_safe_test for X86-64.
9721 * testsuite/Makefile.in: Regenerate.
9722 * testsuite/icf_safe_so_test.cc: New file.
9723 * testsuite/icf_safe_so_test.sh: New file.
9724 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9725 (main): Change to take pointer to function kept_func_3.
9726 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9727 folding is done correctly for X86-64.
9729 2010-02-12 David S. Miller <davem@davemloft.net>
9731 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9732 is_symbolless parameter.
9733 (Output_reloc<SHT_REL>::is_symbolless): New.
9734 (Output_reloc<SHT_REL>::is_symbolless_): New.
9735 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9736 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9737 (Output_reloc<SHT_RELA>::is_symbolless): New.
9738 (Output_data_reloc::add_global): Handle is_symbolless.
9739 (Output_data_reloc::add_global_relative): Likewise.
9740 (Output_data_reloc::add_local): Likewise.
9741 (Output_data_reloc::add_local_relative): Likewise.
9742 (Output_data_reloc::add_symbolless_global_addend): New.
9743 (Output_data_reloc::add_symbolless_local_addend): New.
9744 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9746 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9747 instead of ->is_relative_
9748 (Output_reloc::write): Likewise.
9749 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9750 (Output_reloc::write_rel): Simplify.
9752 * sparc.cc (Target_sparc::Scan::local): Use
9753 ->add_symbolless_local_addend as needed.
9754 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9755 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9756 based upon relocation offset.
9758 2010-02-11 Doug Kwan <dougkwan@google.com>
9760 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9761 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9762 beginning of function.
9763 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9764 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9765 parameter is_32bit in calls to should_apply_static_reloc.
9766 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9767 (check_DATA): Add arm_abs_global.stdout.
9768 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9769 arm_abs_global.stdout): New rules.
9770 (MOSTLLYCLEANFILES): Add arm_abs_global
9771 * Makefile.in: Regenerate.
9772 * testsuite/arm_abs_global.s: New file.
9773 * testsuite/arm_abs_global.sh: Ditto.
9774 * testsuite/arm_abs_lib.s: Ditto.
9776 2010-02-11 Ian Lance Taylor <iant@google.com>
9778 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9780 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9781 Allocate_commons_task first.
9782 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9783 task, rather than symtab_lock_.
9784 (Gc_process_relocs::~Gc_process_relocs): New function.
9785 (Gc_process_relocs::is_runnable): Check this_blocker_.
9786 (Gc_process_relocs::locks): Use next_blocker_ rather than
9788 (Scan_relocs::~Scan_relocs): New function.
9789 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9791 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9793 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9794 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9795 constructor accordingly.
9796 (class Gc_process_relocs): Likewise.
9797 (class Scan_relocs): Likewise.
9798 * common.h (class Allocate_commons_task): Remove symtab_lock_
9799 field, and corresponding constructor parameter.
9800 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9802 (Allocate_commons_task::locks): Likewise.
9804 2010-02-11 Ian Lance Taylor <iant@google.com>
9806 * gold-threads.h (class Once): Define.
9807 (class Initialize_lock): Rewrite as child of Once.
9808 * gold-threads.cc (class Once_initialize): Define.
9809 (once_pointer_control): New static variable.
9810 (once_pointer, once_arg): New static variables.
9811 (c_run_once): New static function.
9812 (Once::Once, Once::run_once, Once::internal_run): New functions.
9813 (class Initialize_lock_once): Remove.
9814 (initialize_lock_control): Remove.
9815 (initialize_lock_pointer): Remove.
9816 (initialize_lock_once): Remove.
9817 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9818 (Initialize_lock::initialize): Rewrite.
9819 (Initialize_lock::do_run_once): New function.
9820 * archive.cc (Archive::interpret_header): Only clear name if it is
9822 * fileread.cc: Include "gold-threads.h"
9823 (file_counts_lock): New static variable.
9824 (file_counts_initialize_lock): Likewise.
9825 (File_read::release): Only increment counts when using --stats.
9826 Use a lock around the increment.
9827 * parameters.cc (class Set_parameters_target_once): Define.
9828 (set_parameters_target_once): New static variable.
9829 (Parameters::Parameters): Move here from parameters.h.
9830 (Parameters::set_target): Rewrite.
9831 (Parameters::set_target_once): New function.
9832 (Parameters::clear_target): Move here and rewrite.
9833 * parameters.h (class Parameters): Update declarations. Add
9834 set_parameters_target_once_ field.
9835 (Parameters::Parameters): Move to parameters.cc.
9836 (Parameters::clear_target): Likewise.
9837 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9839 (Start_group::~Start_group): New function.
9840 (Start_group::is_runnable): New function.
9841 (Start_group::locks, Start_group::run): New functions.
9842 (Finish_group::run): Change saw_undefined to size_t.
9843 * readsyms.h (class Start_group): Define.
9844 (class Finish_group): Change saw_undefined_ field to size_t.
9845 (Finish_group::Finish_group): Remove saw_undefined and
9846 this_blocker parameters. Change all callers.
9847 (Finish_group::set_saw_undefined): New function.
9848 (Finish_group::set_blocker): New function.
9849 * symtab.h (class Symbol_table): Change saw_undefined to return
9850 size_t. Change saw_undefined_ field to size_t.
9851 * target-select.cc (Set_target_once::do_run_once): New function.
9852 (Target_selector::Target_selector): Initialize set_target_once_
9853 field. Don't initialize lock_ and initialize_lock_ fields.
9854 (Target_selector::instantiate_target): Rewrite.
9855 (Target_selector::set_target): New function.
9856 * target-select.h (class Set_target_once): Define.
9857 (class Target_selector): Update declarations. Make
9858 Set_target_once a friend. Remove lock_ and initialize_lock_
9859 fields. Add set_target_once_ field.
9861 2010-02-10 Ian Lance Taylor <iant@google.com>
9863 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9865 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9866 (queue_middle_tasks): Add all blockers before queueing any tasks.
9867 (queue_final_tasks): Likewise.
9868 * token.h (Task_token::add_blockers): New function.
9869 * object.h (Input_objects::number_of_relobjs): New function.
9871 2010-02-10 Ian Lance Taylor <iant@google.com>
9873 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9874 shared, not if not position independent.
9875 * x86_64.cc (Relocate::relocate_tls): Likewise.
9876 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9877 (tls_pie_pic_test): New target.
9878 * testsuite/Makefile.in: Rebuild.
9880 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9881 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9882 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9883 * testsuite/Makefile.in: Rebuild.
9885 2010-02-09 David S. Miller <davem@davemloft.net>
9887 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9888 R_SPARC_RELATIVE using ->add_local_relative().
9889 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9891 * output.h (Output_data_dynamic::add_section_size): New method
9892 that takes two Output_data objects.
9893 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9894 entry param. Handle it in initializers.
9895 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9896 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9897 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9899 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9900 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9901 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9902 for dynrel_includes_plt.
9903 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9904 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9905 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9907 (Target_sparc::do_finalize_sections): Update to pass true for
9908 dynrel_includes_plt.
9909 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9910 output before .rela.plt
9911 (Target_powerpc::do_finalize_sections): Update to pass true for
9912 dynrel_includes_plt when 32-bit.
9914 2010-02-08 Doug Kwan <dougkwan@google.com>
9916 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9918 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9919 Arm_relobj::scan_section_for_cortex_a8_stubs,
9920 Arm_relobj::do_relocation_section): Instead of calling
9921 Output_section::output_address, use faster
9922 Arm_relobj::simple_input_section_output_address.
9924 2010-02-08 David S. Miller <davem@davemloft.net>
9926 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9927 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9928 relocation helper function.
9930 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9931 just like R_SPARC_GOT{10,13,22}.
9932 (Target_sparc::Scan::local): Likewise.
9933 (Target_sparc::Relocate:relocate): Likewise.
9935 2010-02-06 Ian Lance Taylor <iant@google.com>
9937 * configure.ac: Rewrite targetobjs duplicate removal code to use
9938 only shell constructs.
9939 * configure: Rebuild.
9941 2010-02-05 Doug Kwan <dougkwan@google.com>
9944 * arm.cc (Arm_relobj::section_is_scannable): New method.
9945 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9946 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9948 2010-02-04 Doug Kwan <dougkwan@google.com>
9951 * arm-reloc-property.cc (cstdio): Include.
9952 * configure.ac (targetobjs): Remove duplicates.
9953 * configure: Regenerate.
9954 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9955 big and little endian version for a given address size.
9957 2010-02-03 Doug Kwan <dougkwan@google.com>
9959 * arm-reloc-property.cc
9960 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9962 * arm-reloc-property.h
9963 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9964 New method definition.
9965 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9967 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9969 (GOT_PREL): Change implemented to Y.
9970 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9971 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9972 (Arm_relocate_functions::movw_abs_nc): Remove method.
9973 (Arm_relocate_functions::movt_abs): Ditto.
9974 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9975 (Arm_relocate_functions::thm_movt_abs): Ditto.
9976 (Arm_relocate_functions::movw_rel_nc): Ditto.
9977 (Arm_relocate_functions::movw_rel): Ditto.
9978 (Arm_relocate_functions::movt_rel): Ditto.
9979 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9980 (Arm_relocate_functions:thm_movw_rel): Ditto.
9981 (Arm_relocate_functions:thm_movt_rel): Ditto.
9982 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9983 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9984 New method definitions.
9985 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9986 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9987 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9988 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9989 (Target_arm::Relocate::relocate): Check for non-static or
9990 unimplemented relocation code and exit early. Change calls to
9991 Target_arm::reloc_uses_thumb_bit and
9992 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9993 instead. Refactor code to handle similar relocations to increase
9994 code sharing. Remove check for unsupported relocation code in switch
9996 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9997 relocation property table to find out size. Change error message to
9998 print out the name of a relocation code instead of the numeric value.
9999 (Target_arm::scan_reloc_for_stub): Use relocation property table
10000 instead of calling Target_arm::reloc_uses_thumb_bit().
10002 2010-02-02 Doug Kwan <dougkwan@google.com>
10004 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10005 types of relaxed input section.
10007 2010-02-02 Doug Kwan <dougkwan@google.com>
10009 * Makefile.am (HFILES): Add arm-reloc-property.h.
10011 (TARGETSOURCES): Add arm-reloc-property.cc
10012 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
10013 (libgold_a_SOURCES): $(DEFFILES)
10014 * Makefile.in: Regenerate.
10015 * arm-reloc-property.cc: New file.
10016 * arm-reloc-property.h: New file.
10017 * arm-reloc.def: New file.
10018 * arm.cc: Update comments.
10019 (arm-reloc-property.h): New included header.
10020 (arm_reloc_property_table): New global variable.
10021 (Target_arm::do_select_as_default_target): New method definition.
10022 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10023 arm-reloc-property to targ_extra_obj.
10024 * parameters.cc (set_parameters_target): Call
10025 Target::select_as_default_target().
10026 * target.h (Target::select_as_default_target): New method definition.
10027 (Target::do_select_as_default_target): Same.
10029 2010-02-01 Doug Kwan <dougkwan@google.com>
10031 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10032 first_output_text_section_.
10033 (Arm_exidx_fixup::first_output_text_section): New method definition.
10034 (Arm_exidx_fixup::first_output_text_section_): New data member.
10035 (Arm_exidx_fixup::process_exidx_section): Record the first text
10036 output section seen.
10037 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10038 and entsize in output section header.
10040 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10042 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10043 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10044 (Arm_relocate_functions::thm_alu11): New Method.
10045 (Arm_relocate_functions::thm_pc8): New Method.
10046 (Arm_relocate_functions::thm_pc12): New Method.
10047 (Target_arm::Scan::local): Handle the relocations.
10048 (Target_arm::Scan::global): Likewise.
10049 (Target_arm::Relocate::relocate): Likewise.
10050 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10052 2010-01-29 Doug Kwan <dougkwan@google.com>
10054 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10055 of relocation types as ld.
10057 2010-01-29 Doug Kwan <dougkwan@google.com>
10059 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10061 (Arm_relocate_functions::thumb_branch_common): Ditto.
10062 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10063 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10064 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10065 Arm_relocate_functions::jump24): Remove.
10066 (Target_arm::Relocate::relocate): Adjust code to call
10067 Arm_relocation_functions::arm_branch_common and
10068 Arm_relocation_functions::thumb_branch_common instead of their removed
10069 wrappers. Merge switch-cases together to reduce source code size.
10071 2010-01-29 Doug Kwan <dougkwan@google.com>
10073 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10074 output_local_symbol_count_needs_update_.
10075 (Arm_relobj::output_local_symbol_count_needs_update,
10076 Arm_relobj::set_output_local_symbol_count_needs_update,
10077 Arm_relobj::update_output_local_symbol_count): New methods.
10078 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10080 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10081 of pointed function as in a R_ARM_PREL31 relocation.
10082 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10083 for output local symbol count updating.
10084 (Target_arm::do_relax): Update output local symbol counts in objects
10086 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10088 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10090 * arm.cc: Added support for the ARM relocations:
10091 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10092 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10093 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10095 (Arm_relocate_functions::movw_rel): New method.
10096 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10097 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10099 (Arm_relocate_functions::thm_movw_rel): New method.
10100 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10102 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10104 (Target_arm::Scan::global): Likewise.
10105 (Target_arm::Relocate::relocate): Likewise.
10106 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10109 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10111 * arm.cc: Added support for ARM group relocations.
10112 (Target_arm::reloc_needs_sym_origin): New method.
10113 (Arm_relocate_functions::calc_grp_kn): New method.
10114 (Arm_relocate_functions::calc_grp_residual): New method.
10115 (Arm_relocate_functions::calc_grp_gn): New method.
10116 (Arm_relocate_functions::arm_grp_alu): New Method.
10117 (Arm_relocate_functions::arm_grp_ldr): New Method.
10118 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10119 (Arm_relocate_functions::arm_grp_ldc): New Method.
10120 (Target_arm::Scan::local): Handle the ARM group relocations.
10121 (Target_arm::Scan::global): Likewise.
10122 (Target_arm::Relocate::relocate): Likewise.
10123 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10126 2010-01-26 Doug Kwan <dougkwan@google.com>
10128 * arm.cc (set): Include.
10129 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10131 (Arm_output_section::Text_section_list): New type.
10132 (Arm_output_section::append_text_sections_to_list): New method.
10133 (Arm_output_section::fix_exidx_coverage): Ditto.
10134 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
10135 (Arm_relobj::convert_input_section_to_relaxed_section): Use
10136 Relobj::set_section_offset() instead of
10137 Sized_relobj::invalidate_section_offset().
10138 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
10139 parameter for section headers. Ignore relocation sections for
10140 unallocated sections and EXIDX sections.
10141 (Target_arm::fix_exidx_coverage): New method.
10142 (Target_arm::output_section_address_less_than): New type.
10143 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10144 linked text section instead of the EXIDX section.
10145 (Arm_output_section::create_stub_group): Add an assertion to check
10146 that this is not an EXIDX output section.
10147 (Arm_output_section::append_text_sections_to_list): New method.
10148 (Arm_output_section::fix_exidx_coverage): Ditto.
10149 (Arm_relobj::scan_sections_for_stubs): Adjust call to
10150 Arm_relobj::section_needs_reloc_stub_scanning.
10151 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10153 (Target_arm::fix_exidx_coverage): New method.
10154 * object.h (Relobj::set_output_section): New method.
10155 (Sized_relobj::invalidate_section_offset): Remove method.
10156 (Sized_relobj::do_invalidate_section_offset): Remove method.
10157 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10159 2010-01-25 Doug Kwan <dougkwan@google.com>
10161 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10162 Fix warning due to signed and unsigned comparison on a 32-bit host.
10164 2010-01-22 Doug Kwan <dougkwan@google.com>
10166 * arm.cc (Target_arm::do_relax): Record an output section for section
10167 offset adjustment it contains any stub table that has changed.
10168 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10169 offsets in an output section if necessary.
10170 * output.cc (Output_section::Output_section): Initialize
10171 section_offsets_need_adjustments_.
10172 (Output_section::add_input_section_for_script): Renamed to
10173 Output_section::add_simple_input_section.
10174 (Output_section::save_states): Add a comment.
10175 (Output_section::discard_states): New method defintion.
10176 (Output_section::adjust_section_offsets): Same.
10177 * output.h (Output_section::add_input_section_for_script): Renamed to
10178 Output_section::add_simple_input_section.
10179 (Output_section::discard_states): New method declaration.
10180 (Output_section::adjust_section_offsets): Same.
10181 (Output_section::section_offsets_need_adjustment,
10182 Output_section::set_section_offsets_need_adjustment): New method
10184 (Output_section::section_offsets_need_adjustment_): New data member.
10185 * script-sections.cc
10186 (Output_section_element_input::set_section_address): Adjust code for
10187 renaming of Output_section::add_input_section_for_script.
10188 (Orphan_output_section::set_section_address): Same.
10190 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10192 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10193 Fix_v4bx enum values .
10194 * gold/options.h (General_options): New option definitions.
10195 (General_options::fix_v4bx): New method.
10196 (General_options::Fix_v4bx): New enum.
10197 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10198 (General_options::parse_fix_v4bx_interworking): New method.
10200 2010-01-22 Doug Kwan <dougkwan@google.com>
10202 * arm.cc (Arm_exidx_fixup): New class.
10204 2010-01-21 Doug Kwan <dougkwan@google.com>
10206 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10208 (Arm_exidx_section_offset_map): New type.
10210 2010-01-21 Doug Kwan <dougkwan@google.com>
10212 * arm.cc (Arm_exidx_input_section): New class.
10213 (Arm_relobj::exidx_input_section_by_link,
10214 Arm_relobj::exidx_input_section_by_shndx,
10215 Arm_relobj::make_exidx_input_section): New methods.
10216 (read_arm_attributes_section): Remove.
10217 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10218 information about them.
10219 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10222 2010-01-20 Doug Kwan <dougkwan@google.com>
10224 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10225 Input_section_specifier to Section_id.
10226 (Target_arm::new_arm_input_section: Adjust code for change of key
10228 (Target_arm::find_arm_input_section): Ditto.
10229 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10230 (Section_id): Remove.
10231 (Garbage_collection::Section_id_hash): Remove.
10232 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10233 (Section_id): Remove.
10234 (Icf::Section_id_hash): Remove.
10235 * object.h (Section_id, Const_section_id, Section_id_hash,
10236 Const_section_id_hash): New type definitions.
10237 * output.cc (Output_section::add_relaxed_input_section): Change to
10238 use Const_section_id instead of Input_section_specifier as key type.
10239 (Output_section::add_merge_input_section): Ditto.
10240 (Output_section::build_relaxation_map): Change to use Section_id
10241 instead of Input_section_specifier as key type.
10242 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
10244 (Output_section::convert_input_sections_to_relaxed_sections): Change
10245 to use Const_section_id instead of Input_section_specifier as key type.
10246 (Output_section::find_merge_section): Ditto.
10247 (Output_section::find_relaxed_input_section): Ditto.
10248 * output.h (Input_section_specifier): Remove class.
10249 (Output_section::Output_section_data_by_input_section_map): Change
10250 key type to Const_section_id.
10251 (Output_section::Output_relaxed_input_section_by_input_section_map):
10253 (Output_section::Relaxation_map): Change key type to Section_id.
10255 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10257 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10258 (class Arm_v4bx_stub): New class.
10259 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10260 (Stub_factory::make_arm_v4bx_stub): New method.
10261 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10262 (Stub_table::empty): Handle v4bx stubs.
10263 (Stub_table::add_arm_v4bx_stub): New method.
10264 (Stub_table::find_arm_v4bx_stub): New method.
10265 (Arm_relocate_functions::v4bx): New method.
10266 (Target_arm::fix_v4bx): New method.
10267 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10268 (Stub_table::relocate_stubs): Likewise.
10269 (Stub_table::do_write): Likewise.
10270 (Stub_table::update_data_size_and_addralign): Likewise.
10271 (Stub_table::finalize_stubs): Likewise.
10272 (Target_arm::Scan::local): Likewise.
10273 (Target_arm::Scan::global): Likewise.
10274 (Target_arm::do_finalize_sections): Likewise.
10275 (Target_arm::Relocate::relocate): Likewise.
10276 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10278 (Target_arm::scan_reloc_for_stub): Likewise.
10279 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10281 2010-01-19 Ian Lance Taylor <iant@google.com>
10283 * output.cc (Output_section_headers::do_sized_write): Write large
10284 segment count to sh_info field.
10285 (Output_file_header::do_sized_write): For large segment count,
10286 write PN_XNUM to e_phnum field.
10288 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10290 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10291 (Arm_relocate_functions::thm_jump8): New function.
10292 (Arm_relocate_functions::thm_jump11): New function.
10293 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10295 (Target_arm::Scan::global): Likewise.
10296 (Target_arm::Relocate::relocate): Likewise.
10297 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10300 2010-01-14 Doug Kwan <dougkwan@google.com>
10302 * arm.cc (map, utility): Include headers.
10303 (Target_arm::apply_cortex_a8_workaround): New method.
10304 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10305 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10306 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10307 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10308 the --[no-]fix-cortex-a8 command line options.
10309 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10310 (Target_arm::relocate_stub): Use addend in instruction template.
10311 * options.h (DEFINE_bool): Set the user-set flag.
10312 (General_options): Add --[no-]-fix-cortex options.
10313 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
10314 : Update fast look-up map after conversion.
10316 2010-01-14 Sriraman Tallam <tmsriram@google.com>
10318 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10319 in the first pass of do_layout.
10321 2010-01-13 Doug Kwan <dougkwan@google.com>
10323 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10324 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10325 apparent compiler problem of not folding static constant integral
10326 data members of elfcpp::Elf_sizes<32>.
10328 2010-01-13 Doug Kwan <dougkwan@google.com>
10330 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10331 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10332 Arm_relobj::scan_section_for_cortex_a8_erratum,
10333 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10334 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10335 sections to scan for relocation stubs into a new method
10336 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10337 relocation and Cortex-A8 stub scanning.
10338 (Target_arm::do_relax): Force stubs to be after stubbed sections
10339 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
10340 the beginning of a new relaxation pass. Update a comment.
10341 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10343 2010-01-12 Ian Lance Taylor <iant@google.com>
10345 * target-reloc.h (visibility_error): New inline function.
10346 (relocate_section): Call visibility_error.
10347 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10348 (MOSTLYCLEANFILES): Likewise.
10349 (protected_4_pic.o, protected_3.err): New targets.
10350 * testsuite/protected_4.cc: New file.
10352 2010-01-12 Doug Kwan <dougkwan@google.com>
10354 * arm.cc (Cortex_a8_reloc): New class.
10355 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10356 and cortex_a8_relocs_info_.
10357 (Target_arm::fix_cortex_a8): New method definition.
10358 (Target_arm::Cortex_a8_relocs_info): New type.
10359 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10360 New data member declarations.
10361 (Target_arm::scan_reloc_for_stub): Record information about
10362 relocations for THUMB branches that might be exempted from the
10363 Cortex-A8 workaround.
10364 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10365 at the beginning of a relaxation pass.
10367 2010-01-12 Doug Kwan <dougkwan@google.com>
10369 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10370 (Arm_relobj::Mapping_symbol_position,
10371 Arm_reloj::Mapping_symbol_position_less,
10372 Arm_relobj::Mapping_symbols_info): New types.
10373 (Target_arm::is_mapping_symbol_name): New method definition.
10374 (Arm_relobj::do_count_local_symbols): Save information about mapping
10377 2010-01-11 Doug Kwan <dougkwan@google.com>
10379 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10380 Arm_relocate_functions::thumb32_branch_upper,
10381 Arm_relocate_functions::thumb32_branch_lower,
10382 Arm_relocate_functions::thumb32_cond_branch_offset,
10383 Arm_relocate_functions::thumb32_cond_branch_upper,
10384 Arm_relocate_functions::thumb32_cond_branch_lower,
10385 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10386 branch offset encoding.
10387 (Arm_relocate_functions::thumb_branch_common): Use new branch
10388 offset encoding methods to avoid code duplication.
10389 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10390 (Stub_addend_reader::operator()): Use new branch encoding method
10391 to avoid code duplication.
10393 2010-01-11 Doug Kwan <dougkwan@google.com>
10395 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10396 (Target_arm::do_finalize_sections): Define special EXIDX section
10397 symbols only if referenced.
10398 * gc.h (Garbage_collection::add_reference): New method.
10399 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10402 2010-01-11 Ian Lance Taylor <iant@google.com>
10404 * script.cc (Version_script_info::build_expression_list_lookup):
10405 Change complaing about duplicate wildcard match from error to
10408 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10410 (Version_script_info::Version_script_info): Initialize globs_,
10411 default_version_, default_is_global_, and exact_. Don't
10412 initialize globals_ or locals_.
10413 (Version_script_info::build_lookup_tables): Build local symbols
10415 (Version_script_info::unquote): New function.
10416 (Version_script_info::add_exact_match): New function.
10417 (Version_script_info::build_expression_list_lookup): Remove lookup
10418 parameter. Add is_global parameter. Change all callers. Handle
10419 wildcard pattern specially. Unquote pattern. Call
10421 (Version_script_info::get_name_to_match): New function.
10422 (Version_script_info::get_symbol_version): New function.
10423 (Version_script_info::get_symbol_version_helper): Remove.
10424 (Version_script_info::check_unmatched_names): Call unquote.
10425 * script.h (class Version_script_info): Change get_symbol_version
10426 to be non-inline and add is_global parameter; change all callers.
10427 Rewrite symbol_is_local. Update declarations. Define struct
10428 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10429 Remove globals_ and locals_ members. Add exact_, globs_,
10430 default_version_, is_global_.
10431 (Version_script_info::Glob): Remove pattern, add expression and
10432 is_global. Update constructor. Change all callers.
10433 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10435 (Versions::symbol_section_contents): If a symbol is undefined, or
10436 defined in a dynamic object, set the version index to
10438 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10440 (Symbol_table::add_from_pluginobj): Likewise.
10441 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10443 2010-01-11 Doug Kwan <dougkwan@google.com>
10445 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10446 (incremental_dump_LDADD): Add linking option for libintl.
10447 * Makefile.in: Regenerate.
10449 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10452 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10454 * testsuite/Makefile.in: Regenerated.
10456 2010-01-10 Doug Kwan <dougkwan@google.com>
10458 * options.h (DEFINE_var): Use parentheses around argument varname__
10459 in macro body to avoid any unintended subsequent substitutions.
10461 2010-01-10 Ian Lance Taylor <iant@google.com>
10463 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10464 candidates before doing symbol resolution.
10466 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10467 ODR candidates if only one is weak.
10469 2010-01-08 Ian Lance Taylor <iant@google.com>
10471 * script.cc (Version_script_info::build_expression_list_lookup):
10472 Don't warn about ambiguous version, just record the ambiguity.
10473 (Version_script_info::get_symbol_version_helper): Give error if
10474 version is ambiguous.
10476 2010-01-08 Doug Kwan <dougkwan@google.com>
10478 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
10479 prev_data_size_ and prev_addralign_. Remove initializer for
10480 deleted data member has_been_changed_.
10481 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10482 to determine if the table is empty.
10483 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10485 (Stub_table::add_reloc_stub): Define method in class definition
10486 instead of just declaring it there.
10487 (Stub_table::add_cortex_a8_stub): New method definition.
10488 (Stub_table::update_data_size_and_addralign): Ditto.
10489 (Stub_table::finalize_stubs): Ditto.
10490 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10491 (Stub_table::do_addralign_): Return address alignment in the
10492 (Stub_table::do_reset_address_and_file_offset): Define method in
10493 class definition instead of declaring it there. Set current data
10494 size to be the data size of the previous pass.
10495 (Stub_table::set_final_data_size): Use current data size as the
10497 (Stub_table::relocate_stub): Change parameter type of stub from
10498 Reloc_stub pointer to Stub pointer.
10499 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10500 (Stub_table::Cortex_a8_stub_list): New typedef.
10501 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10502 Stub_table::prev_addralign_): New data member.
10503 (Arm_relobj::Arm_relobj): Initialize data member
10504 section_has_cortex_a8_workaround_.
10505 (Arm_relobj::section_has_cortex_a8_workaround,
10506 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10508 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10510 (Target_arm::relocate_stub): Change parameter type of stub from
10511 Reloc_stub pointer to Stub pointer.
10512 (Insn_template::size, Insn_template::alignment): Handle
10513 THUMB16_SPECIAL_TYPE.
10514 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10515 Stub_table::update_data_size_and_addralign,
10516 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10518 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10519 (Stub_table::do_write): Ditto.
10520 (Target_arm::do_relax): Adjust code for changes in Stub_table.
10522 2010-01-08 Ian Lance Taylor <iant@google.com>
10525 * symtab.h (class Symbol): Remove fields is_target_special_ and
10526 has_plt_offset_. Add field is_defined_in_discarded_section_.
10527 (Symbol::is_defined_in_discarded_section): New function.
10528 (Symbol::set_is_defined_in_discarded_section): New function.
10529 (Symbol::has_plt_offset): Rewrite.
10530 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10531 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10532 Don't initialize is_target_special_ or has_plt_offset_.
10533 Initialize is_defined_in_discarded_section_.
10534 (Symbol_table::add_from_relobj): If appropriate, set
10535 is_defined_in_discarded_section.
10536 * resolve.cc (Symbol::override_base_with_special): Don't test
10537 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10538 * target-reloc.h (relocate_section): Do special handling for
10539 symbols defined in discarded sections for global symbols as well
10542 2010-01-08 Ian Lance Taylor <iant@google.com>
10544 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10545 the SHT_SYMTAB case.
10547 2010-01-08 Ian Lance Taylor <iant@google.com>
10549 * object.cc (Sized_relobj::do_layout): Don't get confused if
10550 layout_eh_frame returns NULL.
10552 2010-01-08 Ian Lance Taylor <iant@google.com>
10555 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10556 dynamic symbol table, use the normal symbol table.
10557 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10560 2010-01-08 Ian Lance Taylor <iant@google.com>
10563 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10566 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10568 * version.cc (print_version): Change to "Copyright 2010".
10570 2010-01-08 Ian Lance Taylor <iant@google.com>
10574 * i386.cc (class Target_i386): Change return type of plt_section
10576 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10577 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10578 tls_desc_rel_ field.
10579 (Output_data_plt_i386::rel_tls_desc): New function.
10580 (Target_i386::rel_tls_desc_section): New function.
10581 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10582 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10583 R_386_TLS_DESC reloc in rel_tls_desc_section.
10584 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10585 Define struct Tlsdesc_info.
10586 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10587 (Target_x86_64::do_reloc_symbol_index): New function.
10588 (Target_x86_64::add_tlsdesc_info): New function.
10589 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10590 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10591 tlsdesc_rel_ field.
10592 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10594 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10595 (Target_x86_64::rela_tlsdesc_section): New function.
10596 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10598 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10599 (Target_x86_64::do_reloc_addend): New function.
10600 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10601 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10602 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10603 (Output_reloc::type): New function.
10604 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10605 (Output_reloc::is_target_specific): New function.
10606 (Output_reloc::target_arg): New function.
10607 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10608 absolute relocs and target specific relocs.
10609 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10610 add_target_specific.
10611 (class Output_data_reloc) [SHT_RELA]: Likewise.
10612 * output.cc (Output_reloc::Output_reloc): Add four new versions
10613 for absolute relocs and target specific relocs.
10614 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10615 (Output_reloc::get_symbol_index): Likewise.
10616 (Output_reloc::local_section_offset): Check that local_sym_index_
10617 is not TARGET_CODE or 0.
10618 (Output_reloc::symbol_value): Likewise.
10619 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10621 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10622 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10624 * layout.cc (add_target_dynamic_tags): Use output section for
10625 DT_PLTRELSZ and DT_JMPREL.
10627 2010-01-07 Ian Lance Taylor <iant@google.com>
10630 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10632 (class Output_data_reloc_generic): Define.
10633 (class Output_data_reloc_base): Change base class to
10634 Output_data_reloc_generic. Change add() method to call
10635 bump_relative_reloc_count for a relative reloc. Remove
10636 sort_relocs_ field.
10637 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10639 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10640 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10642 * layout.h (class Layout): Update declaration.
10644 2010-01-07 Ian Lance Taylor <iant@google.com>
10646 * output.h (class Output_data): Add const version of
10647 output_section and do_output_section.
10648 (class Output_section_data): Add const version of
10650 (class Output_section): Likewise.
10651 * layout.cc (Layout::add_target_dynamic_tags): New function.
10652 * layout.h (class Layout): Update declarations.
10653 * arm.cc (Target_arm::do_finalize_sections): Use
10654 add_target_dynamic_tags.
10655 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10656 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10657 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10658 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10660 2010-01-07 Ian Lance Taylor <iant@google.com>
10663 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10666 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10667 Ian Lance Taylor <iant@google.com>
10670 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10671 Xindex::read_symtab_xindex.
10673 2010-01-07 Doug Kwan <dougkwan@google.com>
10675 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10676 (Insn_template::thumb16_bcond_insn): New method declaration.
10677 (Insn_template): Fix spelling.
10678 (Stub::thumb16_special): New method declaration.
10679 (Stub::do_write): Define virtual method which was previously pure
10681 (Stub::do_thumb16_special): New method declaration.
10682 (Stub::do_fixed_endian_write): New template member.
10683 (Reloc_stub::do_write): Remove.
10684 (Reloc_stub::do_fixed_endian_write): Remove.
10685 (Cortex_a8_stub): New class definition.
10686 (Stub_factory::make_cortex_a8_stub): New method definition.
10687 (Stub_factory::Stub_factory): Add missing static storage class
10688 qualifier for elf32_arm_stub_a8_veneer_blx.
10690 2010-01-07 Ian Lance Taylor <iant@google.com>
10693 * options.h (class General_options): Add --warn-unresolved-symbols
10694 and --error-unresolved-symbols.
10695 * errors.cc (Errors::undefined_symbol): Implement
10696 --warn-unresolved-symbols.
10698 * options.h (class General_options): Add -z text and -z textoff.
10699 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10701 2010-01-06 Sriraman Tallam <tmsriram@google.com>
10703 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10704 (Garbage_collection::cident_sections): New function.
10705 (Garbage_collection::add_cident_section): New function.
10706 (Garbage_collection::cident_sections_): New member.
10707 (gc_process_relocs): Add references to sections whose names are C
10709 * gold.h (cident_section_start_prefix): New constant.
10710 (cident_section_stop_prefix): New constant.
10711 (is_cident): New function.
10712 * layout.cc (Layout::define_section_symbols): Replace string constants
10713 with the newly defined constants.
10714 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10716 * testsuite/Makefile.am: Add gc_orphan_section_test.
10717 * testsuite/Makefile.in: Regenerate.
10718 * testsuite/gc_orphan_section_test.cc: New file.
10719 * testsuite/gc_orphan_section_test.sh: New file.
10721 2010-01-06 Ian Lance Taylor <iant@google.com>
10724 * options.h (class General_options): Add --warn-shared-textrel.
10725 * layout.cc (Layout::finish_dynamic_section): Implement
10726 --warn-shared-textrel.
10729 * options.h (class General_options): Add --warn-multiple-gp.
10731 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10733 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10734 $(THREADSLIB) and $(LIBDL).
10735 * Makefile.in: Rebuild.
10737 2010-01-06 Ian Lance Taylor <iant@google.com>
10740 * options.cc (General_options::parse_section_start): New function.
10741 (General_options::section_start): New function.
10742 (General_options::General_options): Initialize all members.
10743 * options.h: Include <map>
10744 (class General_options): Add --section-start. Add section_starts_
10746 * layout.cc (Layout::attach_allocated_section_to_segment): If
10747 --section-start was used, set the address of the segment. Remove
10748 local sort_sections.
10749 (Layout::relaxation_loop_body): If the address of the load segment
10750 has been set by --section-start, don't use it.
10751 * output.h (Output_segment::update_flags_for_output_section): New
10753 * output.cc (Output_segment::add_output_section): Call
10754 update_flags_for_output_section.
10756 2010-01-05 Ian Lance Taylor <iant@google.com>
10759 * options.h (class General_options): Add --undefined-version.
10760 * script.cc (struct Version_expression): Add was_matched_by_symbol
10762 (Version_script_info::matched_symbol): New function.
10763 (Version_script_info::get_symbol_version_helper): Call
10765 (Version_script_info::check_unmatched_names): New function.
10766 * script.h (class Version_script_info): Update declarations.
10767 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10769 * options.h (class General_options): Use DEFINE_bool_alias for
10770 allow_multiple_definition.
10771 * resolve.cc (Symbol_table::should_override): Don't test
10772 allow_multiple_definition.
10775 * options.h (class General_options): Add --cref.
10776 * main.cc (main): Print cref table if --cref. Don't close mapfile
10777 until after printing cref table.
10778 * cref.cc: Include "symtab.h".
10779 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10780 (Cref_table_compare::operator()): New function.
10781 (Cref_inputs::gather_cref): New function.
10782 (filecol): New static const.
10783 (Cref_inputs::print_cref): New function.
10784 (Cref::print_cref): New function.
10785 * cref.h: Include <cstdio>.
10786 (class Cref): Update declarations.
10787 * mapfile.h (Mapfile::file): New function.
10788 * object.h (class Object): Define Symbols. Declare virtual
10789 do_get_global_symbols.
10790 (Object::get_global_symbols): New function.
10791 * object.cc (Input_objects::add_object): Pass object to cref_ if
10793 (Input_objects::archive_start): Likewise.
10794 (Input_objects::archive_stop): Likewise.
10795 (Input_objects::print_cref): New function.
10796 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10797 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10799 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10801 * plugin.h (class Sized_pluginobj): Update declarations.
10803 2010-01-05 Ian Lance Taylor <iant@google.com>
10805 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10806 to is_default_version. Rename insdef to insdefault.
10807 (Symbol_table::add_from_relobj): Rename def to is_default_version
10808 and local to is_forced_local.
10809 (Symbol_table::add_from_pluginobj): Likewise.
10810 (Symbol_table::add_from_dynobj): Likewise.
10811 (Symbol_table::define_special_symbol): Rename insdef to
10814 2010-01-04 Ian Lance Taylor <iant@google.com>
10817 * options.h (class General_options): Add
10818 --allow-multiple-definition and -z muldefs.
10819 * resolve.cc (Symbol_table::should_override): Don't warn about a
10820 multiple symbol definition if --allow-multiple-definition or -z
10824 * options.h (class General_options): Add --add-needed and
10825 --copy-dt-needed-entries. Tweak --as-needed help entry.
10826 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10827 error if --copy-dt-needed-entries aka --add-needed is used and
10828 would cause a change in behaviour.
10831 * options.h (class General_options): Add -G as a short version of
10832 --shared. Add no-op options -assert, -g, and -i.
10834 2010-01-04 Sriraman Tallam <tmsriram@google.com>
10836 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10837 check for .text or .gnu.linkonce.t sections.
10838 * icf.cc (Icf::find_identical_sections): Ditto.
10839 Change the detection for mangled function name within the section
10841 * icf.h (is_section_foldable_candidate): New function.
10843 2009-12-30 Ian Lance Taylor <iant@google.com>
10846 * options.h (class General_options): Permit two dashes with
10847 --retain-symbols-file.
10849 2009-12-30 Ian Lance Taylor <iant@google.com>
10852 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10853 don't put the file header and segment headers in the text
10857 * common.cc (Sort_commons::operator()): Stabilize sort when both
10859 (Symbol_table::do_allocate_commons_list): When allocating common
10860 symbols, skip a symbol which is no longer common.
10861 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10862 an object before checking its type.
10863 * testsuite/common_test_2.c: New file.
10864 * testsuite/common_test_3.c: New file.
10865 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10866 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10867 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10868 (common_test_2_pic.o, common_test_2.so): New targets.
10869 (common_test_3_pic.o, common_test_3.so): New targets.
10870 * testsuite/Makefile.in: Rebuild.
10873 * script.cc (read_input_script): If we see a new SECTIONS clause,
10874 and we have added an input section, give an error.
10875 * layout.h (class Layout): Add have_added_input_section function.
10876 Add have_added_input_section_ field.
10877 * layout.cc (Layout::Layout): Initialize
10878 have_added_input_section_.
10879 (Layout::layout): Set have_added_input_section_.
10880 (Layout::layout_eh_frame): Likewise.
10882 2009-12-30 Ian Lance Taylor <iant@google.com>
10885 * options.h (class General_options): Add --sort-common option.
10886 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10887 * common.cc (Sort_common): Add sort_order parameter to
10888 constructor. Add sort_order_ field.
10889 (Sort_commons::operator): Check sort_order_.
10890 (Symbol_table::allocate_commons): Determine the sort order.
10891 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10892 Change all callers.
10893 (Symbol_table::do_allocate_commons_list): Likewise.
10895 2009-12-30 Ian Lance Taylor <iant@google.com>
10898 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10899 symbols from this object, don't change the visibility of an
10901 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10903 2009-12-30 Ian Lance Taylor <iant@google.com>
10906 * script.h (class Version_script_info): Define Language enum.
10907 Update declarations. Define Glob, Exact, and Lookup types. Add
10908 new fields globals_, locals_, and is_finalized_.
10909 * script.cc: Various formatting fixes.
10910 (class Parser_closure): Change language_stack_ from a vector of
10911 std::string to one of Version_script_info::Language. Adjust all
10913 (class Lazy_demangler): Remove.
10914 (struct Version_expression): Change language from std::string to
10915 Version_script_info::Language.
10916 (Version_script_info::Version_script_info): New function.
10917 (Version_script_info::~Version_script_info): Don't call clear.
10918 (Version_script_info::finalize): New function.
10919 (Version_script_info::build_lookup_tables): New function.
10920 (Version_script_info::build_expression_list_lookup): New
10922 (Version_script_info::get_symbol_version_helper): Rewrite to use
10924 (Version_script_info::print_expression_list): Adjust to use
10925 Version_script_info::Language.
10926 (script_push_lex_into_version_mode): Check that the version script
10927 has not been finalized.
10928 (version_script_push_lang): Change language string to
10929 Version_script_info::Language.
10930 * options.cc (Command_line::version_script): New function.
10931 * options.h (class General_options): Add finalize_dynamic_list
10932 function. Change version_script from declaration to definition.
10933 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10934 * testsuite/version_script.map: Remove duplicate def of foo.
10935 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10936 version_script.map.
10937 * testsuite/Makefile.in: Rebuild.
10939 2009-12-30 Ian Lance Taylor <iant@google.com>
10942 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10943 if the input symbol index is 0, make the output symbol index 0.
10945 2009-12-30 Ian Lance Taylor <iant@google.com>
10948 * options.h (class General_options): Add -x/--discard-all.
10949 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10950 --discard-all. If the local symbol needs a dynamic entry, check
10951 that before handling --discard-locals.
10953 2009-12-30 Ian Lance Taylor <iant@google.com>
10956 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10958 (Output_segment::add_output_section): Don't change the flags if
10959 the type is PT_TLS.
10962 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10963 GNU hash table if they need a dynamic value. Otherwise, don't add
10964 them if they are defined in a dynamic object or are forced local.
10966 2009-12-29 Ian Lance Taylor <iant@google.com>
10969 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10970 .gnu.hash table for a 32-bit target.
10973 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10974 regular and a dynamic object only needs a dynamic symbol table
10975 entry if it is externally visible.
10978 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10979 constructor. Add global_offset_table_ field.
10980 (Target_i386::got_section): Set global_offset_table_.
10981 (Target_i386::do_finalize_sections): Set global_offset_table_
10983 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10984 in constructor. Add global_offset_table_ field.
10985 (Target_x86_64::got_section): Set global_offset_table_.
10986 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10989 * layout.cc (Layout::Layout): Initialize increase_relro_.
10990 (Layout::get_output_section): Add is_relro, is_last_relro, and
10991 is_first_non_relro parameters. Change all callers.
10992 (Layout::choose_output_section): Likewise.
10993 (Layout::add_output_section_data): Likewise.
10994 (Layout::make_output_section): Likewise.
10995 (Layout::set_segment_offsets): Clear increase_relro when using a
10997 * layout.h (class Layout): Add increase_relro method. Add
10998 increase_relro_ field. Update declarations.
10999 * output.cc (Output_section::Output_section): Initialize
11000 is_last_relro_ and is_first_non_relro_.
11001 (Output_segment::add_output_section): Group relro sections is
11002 do_sort is true. Handle is_last_relro and is_first_non_relro.
11003 (Output_segment::maximum_alignment): Remove relro handling.
11004 (Output_segment::set_section_addresses): Add increase_relro
11005 parameter. Change all callers. Add initial alignment to align
11006 relro sections on separate page. Remove old relro handling.
11007 (Output_segment::set_section_list_addresses): Remove in_relro
11008 parameter. Change all callers.
11009 (Output_segment::set_offset): Add increase parameter. Change all
11010 callers. Remove old relro handling.
11011 * output.h (class Output_section): Add new methods: is_last_relro,
11012 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11013 Add is_last_relro_ and is_first_non_relro_ fields.
11014 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11015 Create separate .got.plt section. Call increase_relro.
11016 * x86_64.cc (Target_x86_64::got_section): Likewise.
11017 * testsuite/relro_script_test.t: Add .got.plt.
11020 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11021 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11022 (Layout::finalize): Call set_dynamic_symbol_size.
11023 (Layout::set_dynamic_symbol_size): New function.
11024 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11025 set_dynamic_symbol_size.
11028 * output.h (class Output_section): Add is_entsize_zero_ field.
11029 * output.cc (Output_section::Output_section): Initialize
11031 (Output_section::set_entsize): If two different entsizes are
11032 requested, force it to zero.
11033 (Output_section::add_input_section): Set flags for .debug_str
11034 before updating section flags. Set entsize.
11035 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11036 and SHF_STRING if all input sections have those flags.
11038 2009-12-29 Rafael Espindola <espindola@google.com>
11040 * main.cc (main): Fix the sys time reporting.
11041 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11044 2009-12-29 Sriraman Tallam <tmsriram@google.com>
11046 * options.cc (General_options::parse_version): Allow -v to exit
11047 without an error if there is nothing to link.
11049 2009-12-29 Ian Lance Taylor <iant@google.com>
11051 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11052 using a version of gcc before 4.1.
11053 * configure: Rebuild.
11055 2009-12-28 Chris Demetriou <cgd@google.com>
11057 * attributes.cc (Output_attributes_section_data::do_write): Use
11058 std::vector::front rather than std::vector::data.
11060 2009-12-28 Ian Lance Taylor <iant@google.com>
11062 * symtab.h (class Symbol_table): Add enum Defined.
11063 * resolve.cc (Symbol_table::should_override): Add defined
11064 parameter. Change all callers. Test whether object is NULL
11065 before calling a method on it.
11066 (Symbol_table::report_resolve_problem): Add defined parameter.
11067 Change all callers.
11068 (Symbol_table::should_override_with_special): Likewise.
11069 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11070 parameter. Change all callers.
11071 (Symbol_table::do_define_in_output_data): Likewise.
11072 (Symbol_table::define_in_output_segment): Likewise.
11073 (Symbol_table::do_define_in_output_segment): Likewise.
11074 (Symbol_table::define_as_constant): Likewise.
11075 (Symbol_table::do_define_as_constant): Likewise.
11076 * script.h (class Symbol_assignment): Add is_defsym parameter to
11077 constructor; change all callers.
11078 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11079 parameter. Change all callers. Add is_defsym_ field.
11080 (class Parser_closure): Add parsing_defsym parameter to
11081 constructor; change all callers. Add parsing_defsym accessor
11082 function. Add parsing_defsym_ field.
11084 2009-12-28 Ian Lance Taylor <iant@google.com>
11086 * gold.cc (queue_middle_tasks): Fix formatting.
11087 * object.cc (Relobj::is_section_name_included): Likewise.
11089 2009-12-23 Ian Lance Taylor <iant@google.com>
11091 * i386.cc (Target_i386::do_calls_non_split): Recognize
11092 -fsplit-stack prologue for a function with a static chain.
11093 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11094 -fsplit-stack prologue when using %r11.
11096 2009-12-21 Sriraman Tallam <tmsriram@google.com>
11098 * options.cc (General_options::parse_version): Make -v continue and do
11099 the link like GNU ld does.
11101 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
11103 * Makefile.am (CCFILES): Add timer.cc.
11104 (HFILES): Add timer.h.
11105 * configure.ac: Check for sysconf and times.
11106 * main.cc: include timer.h.
11107 (main): Use Timer instead of get_run_time.
11110 * workqueue.cc: include timer.h.
11111 (Workqueue::find_and_run_task):
11112 Report user, sys and wall time.
11113 * Makefile.in: Regenerate.
11114 * config.in: Regenerate.
11115 * configure: Regenerate.
11117 2009-12-16 Doug Kwan <dougkwan@google.com>
11119 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11121 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11122 relaxed input sections.
11123 * output.cc (Output_section::find_relaxed_input_section): Change
11124 return type to Output_relaxed_input_section pointer. Adjust code
11125 for new type of relaxed_input_section_map_.
11126 * output.h (Output_section::find_relaxed_input_section): Change
11127 return type to Output_relaxed_input_section pointer.
11128 (Output_section::Output_relaxed_input_section_by_input_section_map):
11130 (Output_section::relaxed_input_section_map_): Change type to
11131 Output_section::Output_relaxed_input_section_by_input_section_map.
11132 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11135 2009-12-15 Ian Lance Taylor <iant@google.com>
11137 * layout.cc (Layout::create_shstrtab): Only write out after input
11138 sections if we are compressing debug sections.
11140 2009-12-15 Ian Lance Taylor <iant@google.com>
11142 * archive.cc (Archive::add_symbols): Only look up a symbol without
11143 a version if there is, in fact, a version.
11145 2009-12-14 Ian Lance Taylor <iant@google.com>
11147 Revert -Wshadow changes, all changes from:
11148 2009-12-11 Doug Kwan <dougkwan@google.com>
11149 2009-12-11 Nick Clifton <nickc@redhat.com>
11150 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11152 2009-12-11 Doug Kwan <dougkwan@google.com>
11154 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11156 * attributes.cc (Object_attribute::size): Ditto.
11157 (Attributes_section_data::size): Ditto.
11158 (Attributes_section_data::Attributes_section_data): Ditto.
11159 (Output_attributes_section_data::do_write): Ditto.
11160 * attributes.h (Object_attribute::set_type): Ditto.
11161 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11163 2009-12-11 Nick Clifton <nickc@redhat.com>
11165 * archive.cc: Fix shadowed variable warnings.
11166 * arm.cc: Likewise.
11167 * compressed_output.cc: Likewise.
11168 * compressed_output.h: Likewise.
11169 * configure: Likewise.
11170 * dwarf_reader.cc: Likewise.
11171 * dynobj.cc: Likewise.
11172 * dynobj.h: Likewise.
11173 * ehframe.cc: Likewise.
11174 * ehframe.h: Likewise.
11175 * errors.cc: Likewise.
11176 * expression.cc: Likewise.
11177 * fileread.cc: Likewise.
11178 * fileread.h: Likewise.
11179 * freebsd.h: Likewise.
11180 * i386.cc: Likewise.
11181 * icf.cc: Likewise.
11182 * incremental.h: Likewise.
11183 * layout.cc: Likewise.
11184 * layout.h: Likewise.
11185 * mapfile.cc: Likewise.
11186 * merge.cc: Likewise.
11187 * merge.h: Likewise.
11188 * object.cc: Likewise.
11189 * object.h: Likewise.
11190 * options.h: Likewise.
11191 * output.cc: Likewise.
11192 * output.h: Likewise.
11193 * parameters.cc: Likewise.
11194 * plugin.cc: Likewise.
11195 * powerpc.cc: Likewise.
11196 * reduced_debug_output.cc: Likewise.
11197 * reduced_debug_output.h: Likewise.
11198 * reloc.cc: Likewise.
11199 * reloc.h: Likewise.
11200 * resolve.cc: Likewise.
11201 * script-sections.cc: Likewise.
11202 * script.cc: Likewise.
11203 * script.h: Likewise.
11204 * sparc.cc: Likewise.
11205 * symtab.cc: Likewise.
11206 * symtab.h: Likewise.
11207 * target-select.cc: Likewise.
11208 * target-select.h: Likewise.
11209 * token.h: Likewise.
11210 * workqueue.cc: Likewise.
11211 * workqueue.h: Likewise.
11212 * x86_64.cc: Likewise.
11214 2009-12-10 Doug Kwan <dougkwan@google.com>
11216 * arm.cc (attributes.h): New include.
11217 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11218 (Arm_relobj::~Arm_relobj): Delete object pointed by
11219 attributes_section_data_.
11220 (Arm_relobj::attributes_section_data): New method definition.
11221 (Arm_relobj::attributes_section_data_): New data member declaration.
11222 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11223 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11224 attributes_section_data_.
11225 (Arm_dynobj::attributes_section_data): New method definition.
11226 (Arm_dynobj::attributes_section_data_): New data member declaration.
11227 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11228 initialization value of may_use_blx_ to false.
11229 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
11230 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11231 object attributes to compute results instead of hard-coding.
11232 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11233 Target_arm::get_secondary_compatible_arch,
11234 Target_arm::set_secondary_compatible_arch
11235 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11236 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11237 New method declarations.
11238 (Target_arm::get_aeabi_object_attribute): New method definition.
11239 (Target_arm::attributes_section_data_): New data member declaration.
11240 (read_arm_attributes_section): New template definition.
11241 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11242 (Arm_dynobj::do_read_symbols): Ditto.
11243 (Target_arm::do_finalize_sections): Merge attributes sections from
11244 input. Check for BLX use after attributes section merging.
11245 Fix __exidx_start and __exidx_end visibility. Create an
11246 .ARM.attributes section if necessary.
11247 (Target_arm::get_secondary_compatible_arch,
11248 Target_arm::set_secondary_compatible_arch,
11249 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11250 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
11251 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
11252 New method definitions.
11254 2009-12-09 Ian Lance Taylor <iant@google.com>
11256 * plugin.cc (Plugin::load): Don't cast from void* to a function
11259 2009-12-09 Ian Lance Taylor <iant@google.com>
11261 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11262 information fields.
11264 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11266 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11267 Replace two_file_shared_1.so with two_file_shared_2.so.
11268 * testsuite/Makefile.in: Regenerated.
11270 2009-12-08 Doug Kwan <dougkwan@google.com>
11272 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11273 (HFILES): Add attributes.h and int_encoding.h.
11274 * Makefile.in: Regenerate.
11275 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11276 function definitions to int_encoding.cc
11277 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11278 prototypes to int_encoding.h
11279 * reduced_debug_output.cc (int_encoding.h): New include.
11280 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11281 function definitions to int_encoding.cc
11282 (insert_into_vector, read_from_pointer): Move template definitions to
11284 * attributes.cc: New file.
11285 * attributes.h: New file.
11286 * int_encoding.cc: New file.
11287 * int_encoding.h: New file.
11289 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
11292 * incremental-dump.cc (dump_incremental_inputs): New.
11293 (main): Use dump_incremental_inputs.
11295 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11298 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11299 checking elfcpp::STT_FUNC.
11300 (Target_i386::Relocate::relocate): Likewise.
11301 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11303 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11304 symbols from shared libraries into normal FUNC symbols.
11306 * symtab.h (Symbol): Add is_func and use it.
11308 2009-12-05 Doug Kwan <dougkwan@google.com>
11310 * arm.cc (Target_arm::arm_info): Initialize new fields
11311 attributes_section and attributes_vendor.
11312 * i386.cc (Target_i386::i386_info): Same.
11313 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11314 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11315 fields attributes_section and attributes_vendor.
11316 * sparc.cc (Target_sparc::sparc_info): Same.
11317 * target.h (Target::attributes_section, Target::attributes_vendor,
11318 Target::is_attributes_section, Target::attribute_arg_type,
11319 Target::attributes_order): New method definitions.
11320 (Target::Target_info::attributes_section,
11321 Target::Target_info::attributes_vendor): New fields.
11322 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11323 virtual method definitions.
11324 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11325 attributes_section and attributes_vendor.
11326 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11328 2009-12-05 Doug Kwan <dougkwan@google.com>
11330 * arm.cc: Update comments about interworking and stub generation.
11331 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11332 considered as non-PIC.
11333 (Arm_relocate_functions::base_abs): Fix formatting.
11334 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11335 of function to use GOT entry address instead of offset.
11336 (Target_arm::Scan::global): Issue an error if a symbol would need a
11337 PLT does not get one because it is untyped. Remove code to create
11338 dynamic symbols for relative branches.
11339 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11340 takes unsigned integer instead of boolean.
11342 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11344 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11345 (two_file_test_LDADD): Likewise.
11346 (common_test_1_LDADD): Likewise.
11347 (exception_test_LDADD) Likewise.
11348 (weak_test_LDADD): Likewise.
11349 (many_sections_test_LDADD): Likewise.
11350 (initpri1_LDADD): Likewise.
11351 (script_test_1_LDADD): Likewise.
11352 (script_test_2_LDADD): Likewise.
11353 (justsyms_LDADD): Likewise.
11354 (binary_test_LDADD): Likewise.
11355 (large_LDADD): Likewise.
11356 * testsuite/Makefile.in: Regenerated.
11358 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
11360 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11361 (Symbol_table::override_with_special): Likewise.
11362 (Symbol_table::add_from_object): Likewise.
11364 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
11366 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11367 Don't set the data_offset twice.
11369 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
11371 * testsuite/Makefile.in: Regenerate.
11373 2009-12-03 Doug Kwan <dougkwan@google.com>
11375 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11376 (Target_arm::do_finalize_sections): Add parameter for symbol table
11377 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11378 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11379 parameter for symbol table pointer.
11380 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11381 an additional parameter for a pointer to symbol table.
11382 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11383 parameter for a symbol table pointer.
11384 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11385 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11387 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11388 parameter for a symbol table pointer.
11390 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
11392 * incremental.cc (Incremental_inputs_header)
11393 (Incremental_inputs_header_write, Incremental_inputs_entry)
11394 (Incremental_inputs_entry_write): Move ...
11395 * incremental.h (Incremental_inputs_header)
11396 (Incremental_inputs_header_write, Incremental_inputs_entry)
11397 (Incremental_inputs_entry_write): here.
11399 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11401 * incremental.cc (make_sized_incremental_binary): Set the target.
11402 Error if it is incompatible.
11403 * output.h (Output_file): Add filename method.
11405 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11407 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11408 from the get_* methods.
11410 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11412 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11413 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11414 Write 0 for the data_offset of scripts.
11416 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11418 * testsuite/Makefile.am: Add the incremental_test.sh test.
11419 * testsuite/incremental_test.sh: New.
11420 * testsuite/incremental_test_1.c: New.
11421 * testsuite/incremental_test_2.c: New.
11423 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
11425 * incremental-dump.cc (main): Fix typos.
11427 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
11430 * incremental-dump.cc (main): Use llu to print 64 bit values.
11432 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11433 H.J. Lu <hongjiu.lu@intel.com>
11435 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11437 (incremental_dump_LDADD): Likewise.
11438 * Makefile.in: Regenerated.
11440 2009-11-25 Doug Kwan <dougkwan@google.com>
11444 2009-11-25 Doug Kwan <dougkwan@google.com>
11446 * arm.cc (Target_arm::Target_arm): Move method definition
11447 outside of class definition. Add code to handle
11448 --target1-rel, --target1-abs and --target2= options.
11449 (Target_arm::get_reloc_reloc_type): Change method to be
11450 non-static and const.
11451 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11452 New data member declaration.
11453 (Target_arm::Scan::local, Target_arm::Scan::global,
11454 Target_arm::Relocate::relocate,
11455 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11456 Adjust call to Target_arm::get_real_reloc_type.
11457 (Target_arm::get_real_reloc_type): Use command line options
11458 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11459 * options.h (--target1-rel, --target1-abs, --target2): New
11462 2009-11-25 Doug Kwan <dougkwan@google.com>
11464 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11465 class definition. Add code to handle --target1-rel, --target1-abs
11466 and --target2= options.
11467 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11469 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11470 member declaration.
11471 (Target_arm::Scan::local, Target_arm::Scan::global,
11472 Target_arm::Relocate::relocate,
11473 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11474 call to Target_arm::get_real_reloc_type.
11475 (Target_arm::get_real_reloc_type): Use command line options to
11476 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11477 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11480 2009-11-25 Doug Kwan <dougkwan@google.com>
11482 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11483 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11484 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11486 (Arm_relocate_functions::thm_call): Replace body with a call to
11487 Arm_relocate_functions::thumb_branch_common.
11488 (Arm_relocate_functions::thm_jump24,
11489 Arm_relocate_functions::thm_xpc22): New method definitions.
11490 (Arm_relocate_functions::thumb_branch_common): New method definition.
11491 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11493 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11494 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11496 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11498 * Makefile.am: Build incremental-dump
11499 * Makefile.in: Regenerate.
11500 * incremental-dump.cc: New.
11501 * incremental.cc (Incremental_inputs_header_data,
11502 Incremental_inputs_entry_data): Move to incremental.h
11503 * incremental.h: (Incremental_inputs_header_data,
11504 Incremental_inputs_entry_data): Move from incremental.cc
11506 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11508 * incremental.cc (Incremental_inputs_header,
11509 Incremental_inputs_header_write, Incremental_inputs_entry,
11510 Incremental_inputs_entry_write): Add a typedef with the data type.
11512 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11514 * incremental.cc (Incremental_inputs_header,
11515 Incremental_inputs_header_write, Incremental_inputs_entry,
11516 Incremental_inputs_entry_write): Update comment about which
11517 type has the filed descriptions.
11519 2009-11-15 Doug Kwan <dougkwan@google.com>
11521 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11522 (Arm_relocate_functions::arm_branch_common): Change method defintion
11523 in class definition to a method declaration and update list of formal
11525 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11526 Arm_relocation_functions::jump24): Adjust call to
11527 Arm_relocate_functions::arm_branch_common. Update list of formal
11529 (Arm_relocate_functions::xpc25): New method definition.
11530 (Arm_relocate_functions::arm_branch_common): Move method defintion
11531 out from class definition. Use stubs for mode-switching and extending
11533 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11534 specially. Change code to enable use of stubs in ARM branches.
11536 2009-11-10 Doug Kwan <dougkwan@google.com>
11538 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11539 in method declaration.
11540 (Target_arm::relocate_stub): New method declaration.
11541 (Target_arm::default_target): Change to return a pointer instead of
11543 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11544 Target_arm::default_target.
11545 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11547 (Target_arm::relocate_section): Adjust view.
11548 (Target_arm::relocate_stub): New method definition.
11550 2009-11-10 Doug Kwan <dougkwan@google.com>
11552 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11554 * incremental.cc (open_incremental_binary): Initialized local
11555 variables to avoid warnings.
11556 * object.cc (make_elf_object): Ditto.
11557 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11560 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11563 * testsuite/plugin_test.c: Include "config.h".
11565 2009-11-09 Doug Kwan <dougkwan@google.com>
11567 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11568 (arm_symbol_value): Remove.
11569 (Arm_relocate_functions::arm_branch_common,
11570 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11571 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11572 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11573 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11574 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11575 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11576 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11577 Arm_relocate_functions::thm_mobw_abs_nc,
11578 Arm_relocate_functions::thm_mov_abs,
11579 Arm_relocate_functions::movw_prel_nc,
11580 Arm_relocate_functions::thm_movt_abs,
11581 Arm_relocate_functions::movt_prel,
11582 Arm_relocate_functions::thm_movw_prel_nc,
11583 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11584 (Target_arm::Relocate::relocate): Only decompose address into two
11585 parts if relocation type uses the thumb-bit and pass the actual
11586 bit instead of a flag indicating that the thumb-bit is used. Adjust
11587 calls to methods in Arm_relocate_functions for this change.
11589 2009-11-08 Ian Lance Taylor <iant@google.com>
11592 * reloc.cc: Instantiate
11593 Sized_relobj::initialize_input_to_output_maps and
11594 Sized_relobj:free_input_to_output_maps.
11596 2009-11-06 Ian Lance Taylor <iant@google.com>
11599 * defstd.cc (in_segment): Set only_if_ref true for "end".
11601 2009-11-06 Doug Kwan <dougkwan@google.com>
11603 * arm.cc (class Reloc_stub): Correct a comment.
11604 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11605 (Target_arm::scan_section_for_stubs): New method declaration.
11606 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11607 Change methods from private to protected.
11608 (Target_arm::do_may_relax): New method definition.
11609 (Target_arm::do_relax, Target_arm::group_sections,
11610 Target_arm::scan_reloc_for_stub,
11611 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11612 (Target_arm::arm_input_section_map_): New data member declaration.
11613 (Target_arm::scan_reloc_for_stub,
11614 Target_arm::scan_reloc_section_for_stubs,
11615 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11616 Target_arm::do_relax): New method definitions.
11618 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11620 * configure.ac: Check for (struct stat)::st_mtim
11621 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11622 * config.in: Regenerate.
11623 * configure: Regenerate.
11625 2009-11-05 Ian Lance Taylor <iant@google.com>
11628 * output.cc (Output_segment::add_output_section): Add missing
11631 2009-11-04 Ian Lance Taylor <iant@google.com>
11634 * object.h (class Object): Add is_needed and set_is_needed
11635 methods. Add is_needed_ field. Make bool fields into bitfields.
11636 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11637 defined in a dynamic object and referenced by a regular object,
11638 set is_needed for the dynamic object.
11639 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11640 if the file is marked with as_needed and it is not needed.
11642 2009-11-04 Ian Lance Taylor <iant@google.com>
11645 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11646 tags if data is discarded by linker script.
11647 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11648 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11649 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11650 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11652 2009-11-04 Ian Lance Taylor <iant@google.com>
11654 * layout.cc (Layout::get_output_section): Add is_interp and
11655 is_dynamic_linker_section parameters. Change all callers.
11656 (Layout::choose_output_section): Likewise.
11657 (Layout::make_output_section): Likewise.
11658 (Layout::add_output_section_data): Add is_dynamic_linker_section
11659 parameter. Change all callers.
11660 * layout.h (class Layout): Update declarations.
11661 * output.h (class Output_section): Add is_interp, set_is_interp,
11662 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11663 Add is_interp_, is_dynamic_linker_section_ fields. Change
11664 generate_code_fills_at_write_ to a bitfield.
11665 * output.cc (Output_section::Output_sections): Initialize new
11667 (Output_segment::add_output_section): Add do_sort parameter.
11668 Change all callers.
11670 2009-11-03 Ian Lance Taylor <iant@google.com>
11673 * options.h (class General_options): Add --warn-common.
11674 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11675 merging two common symbols.
11676 (Symbol_table::should_override): Handle --warn-common when merging
11677 a common symbol with a defined symbol. Use report_resolve_problem
11678 for multiple definitions.
11679 (Symbol_table::report_resolve_problem): New function.
11680 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11682 2009-11-03 Doug Kwan <dougkwan@google.com>
11684 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11686 (Target_arm::stub_factory): New method definition.
11687 (Target_arm::new_arm_input_section,
11688 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11689 Target_arm::reloc_uses_thumb_bit): New method declarations.
11690 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
11691 New type definitions.
11692 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11693 member declarations.
11694 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11695 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11696 New method definitions.
11698 2009-11-03 Ian Lance Taylor <iant@google.com>
11700 * options.h (class General_options): Add --warn_constructors.
11702 2009-11-03 Ian Lance Taylor <iant@google.com>
11705 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11706 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11708 2009-11-03 Ian Lance Taylor <iant@google.com>
11711 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11712 --msgid-bugs-address.
11713 (install-pdf): New target.
11714 (install-data_yes): Look up one directory to find mkinstalldirs.
11716 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11718 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11721 2009-10-30 Doug Kwan <dougkwan@google.com>
11723 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11725 2009-10-30 Doug Kwan <dougkwan@google.com>
11727 * arm.cc (Stub_addend_reader): New struct template definition
11728 and partial specializations.
11729 (Stub_addend_reader::operator()): New method definition for a
11730 partially specialized template.
11732 2009-10-30 Doug Kwan <dougkwan@google.com>
11734 * arm.cc (Arm_relobj::processor_specific_flags): New method
11736 (Arm_relobj::do_read_symbols): New method declaration.
11737 (Arm_relobj::processor_specific_flags_): New data member declaration.
11738 (Arm_dynobj): New class definition.
11739 (Target_arm::do_finalize_sections): Add input_objects parameter.
11740 (Target_arm::do_adjust_elf_header): New method declaration.
11741 (Target_arm::are_eabi_versions_compatible,
11742 (Target_arm::merge_processor_specific_flags): New method declaration.
11743 (Target_arm::do_make_elf_object): New overloaded method definitions
11745 (Arm_relobj::do_read_symbols): New method definition.
11746 (Arm_dynobj::do_read_symbols): Ditto.
11747 (Target_arm::do_finalize_sections): Add input_objects parameters.
11748 Merge processor-specific flags from all input objects.
11749 (Target_arm::are_eabi_versions_compatible,
11750 Target_arm::merge_processor_specific_flags,
11751 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11752 New method definitions.
11753 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11754 Input_objects pointer type parameter.
11755 * layout.cc (Layout::finalize): Pass input objects to target's.
11756 finalize_sections function.
11757 * output.cc (Output_file_header::do_sized_write): Set ELF file
11758 header's processor-specific flags.
11759 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11760 Input_objects pointer type parameter.
11761 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11762 * target.h (Input_objects): New forward class declaration.
11763 (Target::processor_specific_flags,
11764 Target::are_processor_specific_flags_sect): New method definitions.
11765 (Target::finalize_sections): Add input_objects parameter.
11766 (Target::Target): Initialize processor_specific_flags_ and
11767 are_processor_specific_flags_set_.
11768 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11770 (Target::set_processor_specific_flags): New method definition.
11771 (Target::processor_specific_flags_,
11772 Target::are_processor_specific_flags_set_): New data member
11774 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11775 Input_objects pointer type parameter.
11777 2009-10-30 Doug Kwan <dougkwan@google.com>
11779 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11781 2009-10-28 Ian Lance Taylor <iant@google.com>
11783 * object.h (class Relobj): Drop options parameter from
11784 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11785 do_scan_relocs, do_relocate. Change all callers.
11786 (class Sized_relobj): Drop options parameters from
11787 do_gc_process_relocs, do_scan_relocs, do_relocate,
11788 do_relocate_sections, relocate_sections, emit_relocs_scan,
11789 emit_relocs_scan_reltype. Change all callers.
11790 (struct Relocate_info): Remove options field and all references to
11792 * reloc.h (class Read_relocs): Remove options constructor
11793 parameter and options_ field. Change all callers.
11794 (class Gc_process_relocs, class Scan_relocs): Likewise.
11795 (class Relocate_task): Likewise.
11796 * target-reloc.h (scan_relocs): Remove options parameter. Change
11798 (scan_relocatable_relocs): Likewise.
11799 * target.h (class Sized_target): Remove options parameter from
11800 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11802 * gc.h (gc_process_relocs): Remove options parameter. Change all
11804 * arm.cc: Update functions to remove options parameters.
11805 * i386.cc: Likewise.
11806 * powerpc.cc: Likewise.
11807 * sparc.cc: Likewise.
11808 * x86_64.cc: Likewise.
11809 * testsuite/testfile.cc: Likewise.
11811 2009-10-28 Doug Kwan <dougkwan@google.com>
11813 * arm.cc (Arm_relobj): New class definition.
11814 (Arm_relobj::scan_sections_for_stubs,
11815 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11816 New method definitions.
11818 2009-10-28 Cary Coutant <ccoutant@google.com>
11820 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11821 (Plugin::cleanup_done_): New member.
11822 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11823 (Plugin_manager::cleanup_done_): Remove.
11824 (Plugin_manager::add_input_file): Edit error message.
11825 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11826 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11828 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11830 * fileread.cc: (File_read::View::~View): Use the new
11831 data_ownership_ filed.
11832 (File_read::~File_read): Dispose the new whole_file_view_.
11833 (File_read::open): Mmap the whole file if needed.
11834 (File_read::open): Use whole_file_view_ instead of contents_.
11835 (File_read::find_view): Use whole_file_view_ if applicable.
11836 (File_read::do_read): Use whole_file_view_ instead of contents_.
11837 (File_read::make_view): Use whole_file_view_ instead of contents_,
11838 update File_read::View::View call.
11839 (File_read::find_or_make_view): Update File_read::View::View
11841 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11843 (File_read::View::Data_ownership): New enum.
11844 (File_read::View::View): Replace bool mapped_ with Data_ownership
11846 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11847 (File_read::View::data_ownership_): New field.
11848 (File_read::contents_): Remove (replaced by whole_file_view_).
11849 (File_read::whole_file_view_): New field.
11850 * options.h (class General_options): Add --keep-files-mapped.
11852 2009-10-27 Cary Coutant <ccoutant@google.com>
11854 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11855 * testsuite/Makefile.am (plugin_test_5): New test case.
11856 * testsuite/Makefile.in: Regenerate.
11858 2009-10-25 Doug Kwan <dougkwan@google.com>
11860 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11861 from private to protected to allow access by child class.
11862 (Sized_relobj::do_relocate_sections): New method declaration.
11863 (Sized_relobj::relocate_sections): Virtualize.
11864 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
11865 Sized_relobj::relocate_sections. Instantiate template explicitly
11866 for different target sizes and endianity.
11868 2009-10-24 Doug Kwan <dougkwan@google.com>
11870 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11871 (Arm_input_section::as_arm_input_section): New method.
11872 (Arm_output_section): New class definition.
11873 (Arm_output_section::create_stub_group,
11874 Arm_output_section::group_sections): New method definitions.
11876 2009-10-22 Doug Kwan <dougkwan@google.com>
11878 * arm.cc (Arm_input_section): New class definition.
11879 (Arm_input_section::init, Arm_input_section:do_write,
11880 Arm_input_section::set_final_data_size,
11881 Arm_input_section::do_reset_address_and_file_offset): New method
11884 2009-10-21 Doug Kwan <dougkwan@google.com>
11886 * arm.cc (Stub_table, Arm_input_section): New forward class
11888 (Stub_table): New class defintion.
11889 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11890 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11891 New method definition.
11893 2009-10-21 Doug Kwan <dougkwan@google.com>
11895 * arm.cc: Update copyright comments.
11896 (Target_arm): New forward class template declaration.
11897 (Arm_address): New type.
11898 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11899 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11900 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11902 (Insn_template): Same.
11903 (DEF_STUBS): New macro.
11904 (Stub_type): New enum type.
11905 (Stub_template): New class definition.
11907 (Reloc_stub): Same.
11908 (Stub_factory): Same.
11909 (Target_arm::Target_arm): Initialize may_use_blx_ and
11910 should_force_pic_veneer_.
11911 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11912 Target_arm::should_force_pic_veneer,
11913 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11914 Target_arm::using_thumb_only, Target_arm:;default_target): New
11916 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11917 New data member declarations.
11918 (Insn_template::size, Insn_template::alignment): New method defintions.
11919 (Stub_template::Stub_template): New method definition.
11920 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11921 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11922 (Stub_factory::Stub_factory): New method definition.
11923 * gold.h (string_hash): New template.
11924 * output.h (Input_section_specifier::hash_value): Use
11926 (Input_section_specifier::string_hash): Remove.
11927 * stringpool.cc (Stringpool_template::string_hash): Use
11930 2009-10-20 Doug Kwan <dougkwan@google.com>
11932 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11933 symbols of relaxed input sections.
11934 * output.h (Output_section::find_relaxed_input_section): Make
11937 2009-10-16 Doug Kwan <dougkwan@google.com>
11939 * dynobj.cc (Versions::Versions): Initialize version_script_.
11940 Only insert base version symbol definition for a shared object
11941 if version script defines any version versions.
11942 (Versions::define_base_version): New method definition.
11943 (Versions::add_def): Check that base version is not needed.
11944 (Versions::add_need): Define base version lazily.
11945 * dynobj.h (Versions::define_base_version): New method declaration.
11946 (Versions::needs_base_version_): New data member declaration.
11947 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11948 (check_DATA): Add no_version_test.stdout.
11949 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11951 * testsuite/Makefile.in: Regenerate.
11952 * testsuite/no_version_test.c: New file.
11953 * testsuite/no_version_test.sh: Ditto.
11955 2009-10-16 Doug Kwan <dougkwan@google.com>
11957 * expression.cc (class Segment_start_expression): New class definition.
11958 (Segment_start_expression::value): New method definition.
11959 (script_exp_function_segment_start): Return a new
11960 Segment_start_expression.
11961 * gold/script-c.h (script_saw_segment_start_expression): New function
11963 * script-sections.cc (Script_sections::Script_sections): Initialize
11964 SAW_SEGMENT_START_EXPRESSION_ to false.
11965 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11966 and -Tbbs options to specify section addresses if given in
11967 command line and no SEGMENT_START expression is seen in a script.
11968 * script-sections.h (Script_sections::saw_segment_start_expression,
11969 Script_sections::set_saw_segment_start_expression): New method
11971 (Script_sections::saw_segment_start_expression_): New data member
11973 * script.cc (script_saw_segment_start_expression): New function.
11974 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11975 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11976 script_test_7.sh and script_test_8.sh.
11977 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11978 script_test_8.stdout.
11979 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11980 (script_test_6, script_test_6.stdout, script_test_7,
11981 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11982 * Makefile.in: Regenerate.
11983 * testsuite/script_test_6.sh: New file.
11984 * testsuite/script_test_6.t: Same.
11985 * testsuite/script_test_7.sh: Same.
11986 * testsuite/script_test_7.t: Same.
11987 * testsuite/script_test_8.sh: Same.
11989 2009-10-16 Doug Kwan <dougkwan@google.com>
11991 * output.cc (Output_segment::set_section_list_address): Cast
11992 expressions to unsigned long long type to avoid format warnings.
11994 2009-10-15 Ian Lance Taylor <iant@google.com>
11996 * script.cc (Script_options::add_symbol_assignment): Always add a
11997 dot assignment to script_sections_.
11998 * script-sections.cc (Script_sections::add_dot_assignment):
11999 Initialize if necessary.
12001 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12002 program headers with no load segment if there is a linker script.
12004 * layout.cc (Layout::set_segment_offsets): Align the file offset
12005 to the segment aligment for -N or -n with no load segment.
12006 * output.cc (Output_segment::add_output_section): Don't crash if
12007 the first section is a TLS section.
12008 (Output_segment::set_section_list_addresses): Print an error
12009 message if the address moves backward in a linker script.
12010 * script-sections.cc
12011 (Output_section_element_input::set_section_addresses): Don't
12012 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12013 (Orphan_output_section::set_section_addresses): Likewise.
12015 2009-10-15 Doug Kwan <dougkwan@google.com>
12017 * layout.cc (Layout::finish_dynamic_section): Generate tags
12018 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12019 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12020 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12022 2009-10-14 Ian Lance Taylor <iant@google.com>
12024 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12026 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12027 data_shdr fields of relinfo.
12028 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12029 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12030 R_386_TLS_LDO_32, adjust based on section flags.
12031 (Target_i386::Relocate::fix_up_ldo): Remove.
12033 2009-10-13 Ian Lance Taylor <iant@google.com>
12035 Add support for -pie.
12036 * options.h (class General_options): Add -pie and
12038 (General_options::output_is_position_independent): Test -pie.
12039 (General_options::output_is_executable): Return true if not shared
12040 and not relocatable.
12041 (General_options::output_is_pie): Remove.
12042 * options.cc (General_options::finalize): Reject incompatible uses
12044 * gold.cc (queue_middle_tasks): A -pie link is not static.
12045 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12046 * symtab.cc (Symbol::final_value_is_known): Return false if
12047 output_is_position_independent.
12048 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12049 output_is_position_independent.
12050 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12051 output_is_position_independent.
12052 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12053 output_is_position_independent.
12054 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12056 (basic_pie_test.o, basic_pie_test): New targets.
12057 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12058 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12059 (two_file_pie_test): New target.
12060 * testsuite/Makefile.in: Rebuild.
12061 * README: Remove note saying that -pie is not supported.
12063 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12065 * options.h (class General_options): Add -init and -fini.
12066 * layout.cc (Layout::finish_dynamic_section): Emit
12067 given init and fini functions.
12069 2009-10-13 Sriraman Tallam <tmsriram@google.com>
12071 * gc.h (gc_process_relocs): Check if icf is enabled using new
12073 * gold.cc (queue_initial_tasks): Likewise.
12074 (queue_middle_tasks): Likewise.
12075 * object.cc (do_layout): Likewise.
12076 * symtab.cc (is_section_folded): Likewise.
12077 * main.cc (main): Likewise.
12078 * reloc.cc (Read_relocs::run): Likewise.
12079 (Sized_relobj::do_scan_relocs): Likewise.
12080 * icf.cc (is_function_ctor_or_dtor): New function.
12081 (Icf::find_identical_sections): Check if function is ctor or dtor when
12082 safe icf is chosen.
12083 * options.h (General_options::icf): Change option to be an enum.
12084 (Icf_status): New enum.
12085 (icf_enabled): New method.
12086 (icf_safe_folding): New method.
12087 (set_icf_status): New method.
12088 (icf_status_): New variable.
12089 * (options.cc) (General_options::finalize): Set icf_status_.
12090 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12091 icf_test and icf_keep_unique_test to use the --icf enum flag.
12092 * testsuite/icf_safe_test.sh: New file.
12093 * testsuite/icf_safe_test.cc: New file.
12095 2009-10-12 Sriraman Tallam <tmsriram@google.com>
12097 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12098 includes to gc.h and icf.h.
12099 * arm.cc: Include gc.h.
12100 * gold.cc: Likewise.
12101 * i386.cc: Likewise.
12102 * powerpc.cc: Likewise.
12103 * sparc.cc: Likewise.
12104 * x86_64.cc: Likewise.
12105 * gc.h: Include icf.h.
12107 2009-10-11 Ian Lance Taylor <iant@google.com>
12109 * plugin.cc: Include "gold.h" before other header files.
12111 2009-10-10 Chris Demetriou <cgd@google.com>
12113 * options.h (Input_file_argument::Input_file_type): New enum.
12114 (Input_file_argument::is_lib_): Replace with...
12115 (Input_file_argument::type_): New member.
12116 (Input_file_argument::Input_file_argument): Take Input_file_type
12117 'type' rather than boolean 'is_lib' as second argument.
12118 (Input_file_argument::is_lib): Use type_.
12119 (Input_file_argument::is_searched_file): New function.
12120 (Input_file_argument::may_need_search): Handle is_searched_file.
12121 * options.cc (General_options::parse_library): Support -l:filename.
12122 (General_options::parse_just_symbols): Update for Input_file_argument
12124 (Command_line::process): Likewise.
12125 * archive.cc (Archive::get_file_and_offset): Likewise.
12126 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12127 * script.cc (read_script_file, script_add_file): Likewise.
12128 * fileread.cc (Input_file::Input_file): Likewise.
12129 (Input_file::will_search_for): Handle is_searched_file.
12130 (Input_file::open): Likewise.
12131 * readsyms.cc (Read_symbols::get_name): Likewise.
12132 * testsuite/Makefile.am (searched_file_test): New test.
12133 * testsuite/Makefile.in: Regenerate.
12134 * testsuite/searched_file_test.cc: New file.
12135 * testsuite/searched_file_test_lib.cc: New file.
12137 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12138 Ian Lance Taylor <iant@google.com>
12140 * descriptor.cc: Include <cstdio> and "binary-io.h".
12141 (Descriptors::open): Open the files in binary mode always.
12142 * script.cc (Lex::get_token): Treat \r as whitespace.
12144 2009-10-09 Ian Lance Taylor <iant@google.com>
12146 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12148 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12149 Ian Lance Taylor <iant@google.com>
12151 * configure.ac: Check for readv function also.
12152 * fileread.cc (readv): Define if not HAVE_READV.
12153 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12155 * config.in: Regenerate.
12156 * configure: Regenerate.
12158 2009-10-09 Doug Kwan <dougkwan@google.com>
12160 * layout.cc (Layout::make_output_section): Call target hook to make
12161 ordinary output section.
12162 (Layout::finalize): Adjust parameter list of call the
12163 Target::may_relax().
12164 * layout.h (class Layout::section_list): New method.
12165 * merge.h (Output_merge_base::entsize): Change visibility to public.
12166 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12168 (Output_merge_string::do_is_string): New method.
12169 * object.cc (Sized_relobj::do_setup): renamed from
12170 Sized_relobj::set_up.
12171 * object.h (Sized_relobj::adjust_shndx,
12172 Sized_relobj::initializ_input_to_output_maps,
12173 Sized_relobj::free_input_to_output_maps): Change visibilities to
12175 (Sized_relobj::setup): Virtualize.
12176 (Sized_relobj::do_setup): New method declaration.
12177 (Sized_relobj::invalidate_section_offset,
12178 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12179 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12180 * options.cc (parse_int): New function.
12181 * options.h (parse_int): New declaration.
12182 (DEFINE_int): New macro.
12183 (stub_group_size): New option.
12184 * output.cc (Output_section::Output_section): Initialize memebers
12185 merge_section_map_, merge_section_by_properties_map_,
12186 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12187 (Output_section::add_input_section): Handled deferred code-fill
12188 generation and remove an old comment.
12189 (Output_section::add_relaxed_input_section): New method definition.
12190 (Output_section::add_merge_input_section): Use merge section by
12191 properties map to speed to search. Update merge section maps
12193 (Output_section::build_relaxation_map): New method definition.
12194 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12196 (Output_section::relax_input_section): Renamed to
12197 Output_section::convert_input_sections_to_relaxed_sections and change
12198 interface to take a vector of pointers to relaxed sections.
12199 (Output_section::find_merge_section,
12200 Output_section::find_relaxed_input_section): New method definitions.
12201 (Output_section::is_input_address_mapped,
12202 Output_section::output_offset, Output_section::output_address):
12203 Use output section data maps to speed up searching.
12204 (Output_section::find_starting_output_address): Add comments.
12205 (Output_section::do_write,
12206 Output_section::write_to_postprocessing_buffer): Do code-fill
12207 generation as appropriate.
12208 (Output_section::get_input_sections): Invalidate relaxed input section
12210 (Output_section::restore_states): Adjust type of checkpoint .
12211 Invalidate relaxed input section map.
12212 * output.h (Output_merge_base): New class declaration.
12213 (Input_section_specifier): New class defintion.
12214 (class Output_relaxed_input_section) Change base class to
12215 Output_section_data_build.
12216 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12217 base class initializer.
12218 (Output_section::add_relaxed_input_section): New method declaration.
12219 (Output_section::Input_section): Change visibility to protected.
12220 (Output_section::Input_section::relobj,
12221 Output_section::Input_section::shndx): Handle relaxed input sections.
12222 Output_section::input_sections) Change visibility to protected. Also
12223 define overload to return a non-const pointer.
12224 (Output_section::Merge_section_properties): New class defintion.
12225 (Output_section::Merge_section_by_properties_map,
12226 Output_section::Output_section_data_by_input_section_map,
12227 Output_section::Relaxation_map): New types.
12228 (Output_section::relax_input_section): Rename method to
12229 Output_section::convert_input_sections_to_relaxed_sections and change
12230 interface to take a vector of relaxed section pointers.
12231 (Output_section::find_merge_section,
12232 Output_section::find_relaxed_input_section,
12233 Output_section::build_relaxation_map,
12234 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12235 New method declarations.
12236 (Output_section::merge_section_map_
12237 Output_section::merge_section_by_properties_map_,
12238 Output_section::relaxed_input_section_map_,
12239 Output_section::is_relaxed_input_section_map_valid_,
12240 Output_section::generate_code_fills_at_write_): New data members.
12241 * script-sections.cc
12242 (Output_section_element_input::set_section_addresses): Call
12243 current_data_size and addralign methods of relaxed input sections.
12244 (Orphan_output_section::set_section_addresses): Call current_data_size
12245 and addralign methods of relaxed input sections.
12246 * symtab.cc (Symbol_table::compute_final_value): Extract template
12247 from the body of Symbol_table::sized_finalize_symbol.
12248 (Symbol_table::sized_finalized_symbol): Call
12249 Symbol_table::compute_final_value.
12250 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12251 (Symbol_table::compute_final_value): New templated method declaration.
12252 * target.cc (Target::do_make_output_section): New method defintion.
12253 * target.h (Target::make_output_section): New method declaration.
12254 (Target::relax): Add more parameters for input objects, symbol table
12255 and layout. Adjust call to do_relax.
12256 (Target::do_make_output_section): New method declaration.
12257 (Target::do_relax): Add parameters for input objects, symbol table
12260 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12262 * pread.c: Include stdio.h.
12264 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12266 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12269 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12271 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12272 Change read_shndx type to unsigned int.
12273 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12275 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12276 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12277 Change read_shndx type to unsigned int.
12278 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12280 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12281 * layout.cc (Layout::create_symtab_sections): Cast the result of
12282 local_symcount * symsize to off_t in the gold_assert.
12284 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12286 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12287 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12289 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12290 (Arm_relocate_functions::thm_abs5): New function.
12291 (Arm_relocate_functions::abs12): New function.
12292 (Arm_relocate_functions::abs16): New function.
12293 (Arm_relocate_functions::base_abs): New function.
12294 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12295 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12296 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12298 (Scan::global): Likewise.
12299 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12300 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12301 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12302 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12305 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12307 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12308 (Arm_relocate_functions::movt_prel): New function.
12309 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12310 (Arm_relocate_functions::thm_movt_prel): New function.
12311 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12312 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12313 (Scan::global, Relocate::relocate): Likewise.
12314 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12316 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12318 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12319 Incremental_checker.
12320 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12322 (class Incremental_inputs_header): New class.
12323 (Incremental_inputs_header_writer): Edit comment.
12324 (Incremental_inputs_entry): New class.
12325 (Incremental_inputs_entry_writer): Edit comment.
12326 (Sized_incremental_binary::do_find_incremental_inputs_section):
12327 Add *strtab_shndx parameter, fill it.
12328 (Sized_incremental_binary::do_check_inputs): New method.
12329 (Incremental_checker::can_incrementally_link_output_file): Use
12330 Sized_incremental_binary::check_inputs.
12331 (Incremental_inputs::report_command_line): Save command line in
12334 (Incremental_binary::find_incremental_inputs_section): New
12336 (Incremental_binary::do_find_incremental_inputs_section): Add
12337 strtab_shndx parameter.
12338 (Incremental_binary::do_check_inputs): New pure virtual method.
12339 (Sized_incremental_binary::do_check_inputs): Declare.
12340 (Incremental_checker::Incremental_checker): Add incremental_inputs
12341 parameter, use it to initialize incremental_inputs_.
12342 (Incremental_checker::incremental_inputs_): New field.
12343 (Incremental_checker::command_line): New method.
12344 (Incremental_checker::inputs): New method.
12345 (Incremental_checker::command_line_): New field.
12347 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12349 * incremental.cc: Include <cstdarg> and "target-select.h".
12350 (vexplain_no_incremental): New function.
12351 (explain_no_incremental): New function.
12352 (Incremental_binary::error): New method.
12353 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12355 (make_sized_incremental_binary): New function.
12356 (open_incremental_binary): New function.
12357 (can_incrementally_link_file): Add checks if output is ELF and has
12359 * incremental.h: Include "elfcpp_file.h" and "output.h".
12360 (Incremental_binary): New class.
12361 (Sized_incremental_binary): New class.
12362 (open_incremental_binary): Declare.
12363 * object.cc (is_elf_object): Use
12364 elfcpp::Elf_recognizer::is_elf_file.
12365 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12366 * output.h (Output_file::filesize): New method.
12368 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12370 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12372 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12373 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12375 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12377 (Arm_relocate_functions::movw_abs_nc): New function.
12378 (Arm_relocate_functions::movt_abs): New function.
12379 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12380 (Arm_relocate_functions::thm_movt_abs): New function.
12381 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12382 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12383 (Scan::global): Likewise.
12384 (Relocate::relocate): Likewise.
12385 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12387 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12389 * arm.cc (Arm_relocate_functions::got_prel) New function.
12390 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12391 (Relocate::relocate): Likewise.
12392 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12394 2009-10-06 Ian Lance Taylor <iant@google.com>
12396 * options.h (class General_options): Define
12397 split_stack_adjust_size parameter.
12398 * object.h (class Object): Add uses_split_stack_ and
12399 has_no_split_stack_ fields. Add uses_split_stack and
12400 has_no_split_stack accessor functions. Declare
12401 handle_split_stack_section.
12402 (class Reloc_symbol_changes): Define.
12403 (class Sized_relobj): Define Function_offsets. Declare
12404 split_stack_adjust, split_stack_adjust_reltype, and
12406 * object.cc (Object::handle_split_stack_section): New function.
12407 (Sized_relobj::do_layout): Call handle_split_stack_section.
12408 * dynobj.cc (Sized_dynobj::do_layout): Call
12409 handle_split_stack_section.
12410 * reloc.cc (Sized_relobj::relocate_sections): Call
12411 split_stack_adjust for executable sections in split_stack
12412 objects. Pass reloc_map to relocate_section.
12413 (Sized_relobj::split_stack_adjust): New function.
12414 (Sized_relobj::split_stack_adjust_reltype): New function.
12415 (Sized_relobj::find_functions): New function.
12416 * target-reloc.h: Include "object.h".
12417 (relocate_section): Add reloc_symbol_changes parameter. Change
12419 * target.h (class Target): Add calls_non_split method. Declare
12420 do_calls_non_split virtual method. Declare match_view and
12422 * target.cc: Include "elfcpp.h".
12423 (Target::do_calls_non_split): New function.
12424 (Target::match_view): New function.
12425 (Target::set_view_to_nop): New function.
12426 * gold.cc (queue_middle_tasks): Give an error if mixing
12427 split-stack and non-split-stack objects with -r.
12428 * i386.cc (Target_i386::relocate_section): Add
12429 reloc_symbol_changes parameter.
12430 (Target_i386::do_calls_non_split): New function.
12431 * x86_64.cc (Target_x86_64::relocate_section): Add
12432 reloc_symbol_changes parameter.
12433 (Target_x86_64::do_calls_non_split): New function.
12434 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12436 * powerpc.cc (Target_powerpc::relocate_section): Add
12437 reloc_symbol_changes parameter.
12438 * sparc.cc (Target_sparc::relocate_section): Add
12439 reloc_symbol_changes parameter.
12440 * configure.ac: Call AM_CONDITIONAL for the default target.
12441 * configure: Rebuild.
12442 * testsuite/Makefile.am (TEST_AS): New variable.
12443 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12444 (check_DATA): Add split_i386 and split_x86_64 files.
12445 (SPLIT_DEFSYMS): Define.
12446 (split_i386_[1234n].o): New targets.
12447 (split_i386_[124]): New targets.
12448 (split_i386_[1234r].stdout): New targets.
12449 (split_x86_64_[1234n].o): New targets.
12450 (split_x86_64_[124]): New targets.
12451 (split_x86_64_[1234r].stdout): New targets.
12452 (MOSTLYCLEANFILES): Add new executables.
12453 * testsuite/split_i386.sh: New file.
12454 * testsuite/split_x86_64.sh: New file.
12455 * testsuite/split_i386_1.s: New file.
12456 * testsuite/split_i386_2.s: New file.
12457 * testsuite/split_i386_3.s: New file.
12458 * testsuite/split_i386_4.s: New file.
12459 * testsuite/split_i386_n.s: New file.
12460 * testsuite/split_x86_64_1.s: New file.
12461 * testsuite/split_x86_64_2.s: New file.
12462 * testsuite/split_x86_64_3.s: New file.
12463 * testsuite/split_x86_64_4.s: New file.
12464 * testsuite/split_x86_64_n.s: New file.
12465 * testsuite/testfile.cc (Target_test): Update relocation_section
12467 * testsuite/Makefile.in: Rebuild.
12469 2009-10-06 Ian Lance Taylor <iant@google.com>
12471 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12472 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12473 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12474 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12475 the address on ldo_addrs_.
12476 (Target_i386::Relocate::fix_up_ldo): New function.
12478 2009-10-06 Rafael Espindola <espindola@google.com>
12480 * plugin.cc (add_input_library): New.
12481 (Plugin::load): Add add_input_library to tv.
12482 (Plugin_manager::add_input_file): Add the is_lib argument.
12483 (add_input_file): Update call to Plugin_manager::add_input_file.
12484 (add_input_library): New.
12485 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12487 2009-09-30 Doug Kwan <dougkwan@google.com>
12489 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12490 symbol and call Symbol::may_need_copy_reloc to determine if
12491 a copy reloc is needed.
12492 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12493 nocopyreloc is given in command line.
12494 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12495 given in command line.
12496 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12497 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12498 of the removed Target_i386::may_need_copy_reloc.
12499 * options.h (copyreloc): New option with default value false.
12500 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12501 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12502 instead of the removed Target_powerpc::may_need_copy_reloc.
12503 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12504 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12505 instead of the removed Target_sparc::may_need_copy_reloc.
12506 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12507 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12508 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12509 instead of the removed Target_x86_64::may_need_copy_reloc.
12511 2009-09-30 Ian Lance Taylor <iant@google.com>
12513 * object.h (class Object): Remove target_ field, and target,
12514 sized_target, and set_target methods.
12515 (Object::sized_target): Remove.
12516 (class Sized_relobj): Update declarations. Remove sized_target.
12517 * object.cc (Sized_relobj::setup): Remove target parameter.
12518 Change all callers.
12519 (Input_objects::add_object): Don't do anything with the target.
12520 (make_elf_sized_object): Add punconfigured parameter. Change all
12521 callers. Set or test parameter target.
12522 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12523 Change all callers.
12524 * parameters.cc (Parameters::set_target): Change parameter type to
12526 (Parameters::default_target): Remove.
12527 (set_parameters_target): Change parameter type to be non-const.
12528 (parameters_force_valid_target): New function.
12529 (parameters_clear_target): New function.
12530 * parameters.h (class Parameters): Update declarations. Remove
12531 default_target method. Add sized_target and clear_target
12532 methods. Change target_ to be non-const.
12533 (set_parameters_target): Update declaration.
12534 (parameters_force_valid_target): Declare.
12535 (parameters_clear_target): Declare.
12536 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12537 as NULL if we aren't searching.
12538 (Add_symbols::run): Don't check for compatible target.
12539 * fileread.cc (Input_file::open_binary): Call
12540 parameters_force_valid_target.
12541 * gold.cc (queue_middle_tasks): Likewise.
12542 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12543 set_target on object.
12544 * dynobj.h (class Sized_dynobj): Update declarations.
12545 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12546 make_elf_object returns NULL.
12547 (Archive::include_member): Don't check whether object target is
12549 * output.cc (Output_section::add_input_section): Get target from
12551 (Output_section::relax_input_section): Likewise.
12552 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12554 (Sized_relobj::do_scan_relocs): Likewise.
12555 (Sized_relobj::relocate_sections): Likewise.
12556 * resolve.cc (Symbol_table::resolve): Likewise.
12557 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12558 parameter. Change all callers.
12559 (Symbol_table::add_from_object): Get target from parameters.
12560 (Symbol_table::add_from_relobj): Don't check object target.
12561 (Symbol_table::add_from_dynobj): Likewise.
12562 (Symbol_table::define_special_symbol): Get target from
12564 * symtab.h (class Symbol_table): Update declaration.
12565 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12566 parameter. Change all callers. Clear parameter target.
12567 (Binary_test): Test target here.
12568 * testsuite/object_unittest.cc (gold_testsuite): Remove
12569 target_test_pointer parameter. Change all callers.
12570 (Object_test): Test target here.
12572 2009-09-26 Ian Lance Taylor <iant@google.com>
12574 * testsuite/initpri1.c: Don't try to use constructor priorities if
12575 compiling with gcc before 4.3.
12577 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12579 * testsuite/retain_symbols_file_test.sh (check_present): Change
12580 output file name to retain_symbols_file_test.stdout.
12581 (check_absent): Likewise.
12583 2009-09-18 Craig Silverstein <csilvers@google.com>
12585 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12586 * options.cc: Include <cerrno> and <fstream>.
12587 (General_options::finalize): Parse -retain-symbols-file tag.
12588 * options.h: New flag.
12589 (General_options): New method should_retain_symbol, new
12590 variable symbols_to_retain.
12591 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12592 should_retain_symbol map.
12593 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12594 * testsuite/Makefile.in: Regenerate.
12595 * testsuite/retain_symbols_file_test.sh: New file.
12597 2009-09-18 Nick Clifton <nickc@redhat.com>
12599 * po/es.po: Updated Spanish translation.
12601 2009-09-17 Doug Kwan <dougkwan@google.com>
12603 * debug.h (DEBUG_RELAXATION): New constant.
12604 (DEBUG_ALL): Add DEBUG_RELAXATION.
12605 (debug_string_to_enum): Add relaxation debug option.
12607 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12608 Layout::Relaxation_debug_check::read_sections,
12609 Layout::Relaxation_debug_check::read_sections): New method definitions.
12610 (Layout::Layout): Initialize data members
12611 record_output_section_data_from_scrips_,
12612 script_output_section_data_list_ and relaxation_debug_check_.
12613 (Layout::save_segments, Layout::restore_segments,
12614 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12615 Layout::relaxation_loop_body): New method definitions.
12616 (Layout::finalize): Support relaxation. Move section layout code to
12617 Layout::relaxation_loop_body.
12618 (Layout::set_asection_address_from_script): Move code for orphan
12619 section placement out.
12620 (Layout::place_orphan_sections_in_script): New method definition.
12621 * layout.h (Output_segment_headers, Output_file_header):
12622 New forward class declarations.
12623 (Layout::~Layout): Define.
12624 (Layout::new_output_section_data_from_script): New method definition.
12625 (Layout::place_orphan_sections_in_script): New method declaration.
12626 (Layout::Segment_states): New type declaration.
12627 (Layout::save_segments, Layout::restore_segments,
12628 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12629 Layout::relaxation_loop_body): New method declarations.
12630 (Layout::Output_section_data_list): New type declaration.
12631 (Layout::Relaxation_debug_check): New class definition.
12632 (Layout::record_output_section_data_from_script_,
12633 Layout::script_output_section_data_list_, Layout::segment_states_,
12634 Layout::relaxation_debug_check_): New data members.
12635 * output.cc: (Output_section_headers::do_size): New method definition.
12636 (Output_section_headers::Output_section_headers): Move size
12637 computation to Output_section_headers::do_size.
12638 (Output_segment_headers::do_size): New method definition.
12639 (Output_file_header::Output_file_header): Move size computation to
12640 Output_file_header::do_size and call it.
12641 (Output_file_header::do_size): New method definition.
12642 (Output_data_group::Output_data_group): Adjust call to
12643 Output_section_data.
12644 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12645 (Output_symtab_xindex::do_write): Add array bound check.
12646 (Output_section::Input_section::print_to_mapfile): Handle
12647 RELAXED_INPUT_SECTION_CODE.
12648 (Output_section::Output_section): Initialize data member checkpoint_.
12649 (Output_section::~Output_section): Delete checkpoint object pointed
12651 (Output_section::add_input_section): Always add an Input_section if
12653 (Output_section::add_merge_input_section): Add assert.
12654 (Output_section::relax_input_section): New method definition.
12655 (Output_section::set_final_data_size): Set load address to zero for
12656 an unallocated section.
12657 (Output_section::do_address_and_file_offset_have_reset_values):
12658 New method definition.
12659 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12660 Handle relaxed input section.
12661 (Output_section::sort_attached_input_sections): Checkpoint input
12662 section list lazily.
12663 (Output_section::get_input_sections): Change type of input_sections to
12664 list of Simple_input_section pointers. Checkpoint input section list
12665 lazily. Also handle relaxed input sections.
12666 (Output_section::add_input_section_for_script): Take a reference to
12667 a Simple_input_section object instead of Relobj pointer and section
12668 index as parameter. Handle relaxed input sections.
12669 (Output_section::save_states, Output_section::restore_states): New
12670 method definitions.
12671 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12672 (Output_data::is_data_size_fixed): New method definition.
12673 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12675 (Output_data::address_and_file_offset_have_reset_values): New method
12677 (Output_data::do_address_and_file_offset_have_reset_values): New method
12679 (Output_data::set_data_size): Check that data size is not fixed.
12680 (Output_data::fix_data_size): New method definition.
12681 (Output_data::is_data_size_fixed_): New data member.
12682 (Output_section_headers::set_final_data_size): New method definition.
12683 (Output_section_headers::do_size): New method declaration.
12684 (Output_segment_headers::set_final_data_size): New method definition.
12685 (Output_segment_headers::do_size): New method declaration.
12686 (Output_file_header::set_final_data_size)::New method definition.
12687 (Output_file_header::do_size)::New method declaration.
12688 (Output_section_data::Output_section_data): Add new parameter
12689 is_data_size_fixed and use it to fix data size.
12690 (Output_data_const::Output_data_const): Adjust call to base class
12691 constructor and fix data size.
12692 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12693 base class constructor and fix data size.
12694 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12695 base class constructor and fix data size.
12696 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12697 class constructor and fix data size.
12698 (Output_data_group::set_final_data_size): New method definition.
12699 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12700 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12701 class constructor and fix data size.
12702 (Output_relaxed_input_section): New class definition.
12703 (Output_section::Simple_input_section): New class definition.
12704 (Output_section::get_input_sections): Adjust parameter list.
12705 (Output_section::add_input_section_for_script): Same.
12706 (Output_section::save_states, Output_section::restore_states,
12707 Output_section::do_address_and_file_offset_have_reset_values,
12708 (Output_section::Input_section::Input_section): Handle
12709 RELAXED_INPUT_SECTION_CODE. Add new overload for
12710 Output_relaxed_input_section.
12711 (Output_section::Input_section::is_input_section,
12712 Output_section::Input_section::set_output_section): Handle relaxed
12714 (Output_section::Input_section::is_relaxed_input_section,
12715 Output_section::Input_section::output_section_data,
12716 Output_section::Input_section::relaxed_input_section): New method
12718 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12720 (Output_section::Input_section::u1_): Update comments.
12721 (Output_section::Input_section::u2_): Add new union member poris.
12722 (Output_section::Checkpoint_output_section): New classs definition.
12723 (Output_section::relax_input_section): New method declaration.
12724 (Output_section::checkpoint_): New data member.
12725 (Output_segment): Update comments.
12726 (Output_segment::Output_segment): Un-privatize copy constructor.
12727 (Output_segment::operator=): Un-privatize.
12728 * script-sections.cc (Output_section_element::Input_section_list):
12729 Change element type to Output_section::Simple_input_section.
12730 (Output_section_element_dot_assignment::set_section_addresses):
12731 Register output section data for relaxation clean up.
12732 (Output_data_exression::Output_data_expression): Adjust call to base
12733 constructor to fix data size.
12734 (Output_section_element_data::set_section_addresses): Register
12735 Output_data_expression object for relaxation clean up.
12736 (struct Input_section_info): Replace Relobj pointer and section index
12737 pair with Output_section::Simple_input_section and Convert struct to a
12739 (Input_section_sorter::operator()): Adjust access to
12740 Input_section_info data member to use accessors.
12741 (Output_section_element_input::set_section_addresses): Use layout
12742 parameter. Adjust code to use Output_section::Simple_input_section
12743 and Input_secction_info classes. Register filler for relaxation
12745 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12746 and section index pair with Output_section::Simple_input_section
12747 class. Adjust code accordingly.
12748 (Phdrs_element::release_segment): New method definition.
12749 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12751 (Script_sections::release_segments): New method definition.
12752 * gold/script-sections.h (Script_sections::release_segments): New
12753 method declaration.
12754 * gold/target.h (Target::may_relax, Target::relax,
12755 Target::do_may_relax, Target::do_relax): New method definitions.
12757 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12759 * arm.cc (has_signed_unsigned_overflow): New function.
12760 (Arm_relocate_functions::abs8): New function.
12761 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12762 (Target_arm::Scan::global): Likewise.
12763 (Target_arm::relocate::relocate): Likewise.
12764 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12767 2009-09-16 Cary Coutant <ccoutant@google.com>
12769 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12770 * testsuite/Makefile.in: Regenerate.
12772 2009-09-11 Nick Clifton <nickc@redhat.com>
12774 * po/gold.pot: Updated by the Translation project.
12776 2009-09-08 Cary Coutant <ccoutant@google.com>
12778 * output.cc (Output_file::open): Add execute permission to empty file.
12779 * testsuite/Makefile.am (permission_test): New test.
12780 * testsuite/Makefile.in: Regenerate.
12782 2009-09-02 Ian Lance Taylor <iant@google.com>
12784 * output.cc (Output_file::resize): Call map_no_anonymous rather
12787 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12789 * gold.cc: Include "incremental.h".
12790 (queue_initial_tasks): Call Incremental_checker methods.
12791 * incremental.cc: Include "output.h".
12792 (Incremental_checker::can_incrementally_link_output_file): New
12794 * incremental.h (Incremental_checker): New class.
12796 * output.cc (Output_file::open_for_modification): New method.
12797 (Output_file::map_anonymous): Changed return type to bool. Record
12798 map in base_ field.
12799 (Output_file::map_no_anonymous): New method, broken out of map.
12800 (Output_file::map): Use map_no_anonymous and map_anonymous.
12801 * output.h (class Output_file): Update declarations.
12803 2009-08-24 Cary Coutant <ccoutant@google.com>
12805 * options.h (Command_line::Pre_options): New class.
12806 (Command_line::pre_options): New member.
12807 * options.cc (gold::options::ready_to_register): New variable.
12808 (One_option::register_option): Do nothing if not registering options.
12809 Assert if same short option registered twice.
12810 (General_options::General_options): Turn off option registration when
12812 (Command_line::Pre_options::Pre_options): New constructor.
12814 2009-08-24 Cary Coutant <ccoutant@google.com>
12816 * options.h (General_options::no_keep_memory): Remove incorrect
12819 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12821 * Makefile.am (am__skiplex, am__skipyacc): New.
12822 * Makefile.in: Regenerate.
12824 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12826 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12827 (INCLUDES): ... this.
12828 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12829 (AM_CPPFLAGS): Renamed from ...
12830 (INCLUDE): ... this.
12831 * Makefile.in, testsuite/Makefile.in: Regenerate.
12833 * Makefile.in: Regenerate.
12834 * aclocal.m4: Likewise.
12835 * config.in: Likewise.
12836 * configure: Likewise.
12837 * testsuite/Makefile.in: Likewise.
12839 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12840 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12841 * Makefile.in: Regenerate.
12842 * testsuite/Makefile.in: Regenerate.
12844 2009-08-19 Cary Coutant <ccoutant@google.com>
12846 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12847 symbols in shared libraries overridden by hidden or internal symbols
12848 in the main program.
12850 2009-08-19 Chris Demetriou <cgd@google.com>
12852 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12853 checking source file names in error messages.
12855 2009-08-18 Doug Kwan <dougkwan@google.com>
12857 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12858 an elcpp::Ehdr as parameter. Adjust call to set_target.
12859 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12860 an elfcpp::Ehdr as parameter.
12861 * object.cc (Object::set_target): Remove the version that looks up
12862 a target and sets it.
12863 (Sized_relobj::setup): Take a Target object instead of
12864 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12865 (make_elf_sized_object): Find target and ask target to
12866 make an ELF object.
12867 * object.h: (Object::set_target): Remove the version that looks up
12868 a target and sets it.
12869 (Sized_relobj::setup): Take a Target object instead of
12870 an elfcpp:Ehdr as parameter.
12871 * target.cc: Include dynobj.h.
12872 (Target::do_make_elf_object_implementation): New.
12873 (Target::do_make_elf_object): New.
12874 * target.h (Target::make_elf_object): New template declaration.
12875 (Target::do_make_elf_object): New method declarations.
12876 (Target::do_make_elf_object_implementation): New template declaration.
12878 2009-08-14 Ian Lance Taylor <iant@google.com>
12880 * gold.h (FUNCTION_NAME): Define.
12881 (gold_unreachable): Use FUNCTION_NAME.
12883 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12885 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12886 symbol in the --keep-unique list is not found.
12888 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12890 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12891 been maked as --keep-unique.
12892 (Icf::unfold_section): New function.
12893 * icf.h (Icf::unfold_section): New function.
12894 * options.h (General_options::keep_unique): New option.
12895 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12896 * testsuite/Makefile.in: Regenerate.
12897 * testsuite/icf_keep_unique_test.sh: New file.
12898 * testsuite/icf_keep_unique_test.cc: New file.
12900 2009-08-12 Cary Coutant <ccoutant@google.com>
12903 * resolve.cc (Symbol_table::resolve): Check for references from
12904 dynamic objects to hidden and internal symbols.
12905 * testsuite/Makefile.am (hidden_test.sh): New test.
12906 * testsuite/Makefile.in: Regenerate.
12907 * testsuite/hidden_test.sh: New script.
12908 * testsuite/hidden_test_1.c: New test source.
12909 * testsuite/hidden_test_main.c: New test source.
12911 2009-08-11 Doug Kwan <dougkwan@google.com>
12913 * arm.cc: Update comments.
12914 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12915 segment to locate the .ARM.exidx section if present.
12917 2009-08-09 Doug Kwan <dougkwan@google.com>
12919 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12922 2009-08-07 Sriraman Tallam <tmsriram@google.com>
12923 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12926 2009-08-06 Sriraman Tallam <tmsriram@google.com>
12928 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12929 valid tls_segment only for non-debug-section relocations.
12930 * testsuite/Makefile.am: Add gc_tls_test.
12931 * testsuite/Makefile.in: Regenerate.
12932 * testsuite/gc_tls_test.cc: New file.
12933 * testsuite/gc_tls_test.sh: New file.
12935 2009-08-05 Sriraman Tallam <tmsriram@google.com>
12937 * icf.cc: New file.
12939 * Makefile.am (CCFILES): Add icf.cc.
12940 (HFILES): Add icf.h
12941 * Makefile.in: Regenerate.
12942 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12943 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12944 section, symbol and addend information for the relocs.
12945 * gold.cc (queue_middle_tasks): Call identical code folding.
12946 * gold.h: Add defines for multimap.
12947 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12948 to the call of finalize_local_symbols.
12949 * main.cc (main): Create object of class Icf.
12950 * object.cc (Sized_relobj::do_layout): Allow this function to be
12951 called twice during icf.
12952 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12953 to sections marked as identical by icf.
12954 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12956 (Sized_relobj::do_section_entsize): New function.
12957 * object.h (Object::section_entsize): New function.
12958 (Object::do_section_entsize): New pure virtual function.
12959 (Relobj::finalize_local_symbols): Add new parameter.
12960 (Relobj::do_section_entsize): New function.
12961 * options.h (General_options::icf): New option.
12962 (General_options::icf_iterations): New option.
12963 (General_options::print_icf_sections): New option.
12964 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12965 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12966 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12968 * symtab.cc (Symbol_table::is_section_folded): New function.
12969 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12970 to sections marked as identical by icf.
12971 * symtab.h (Symbol_table::set_icf): New function.
12972 (Symbol_table::icf): New function.
12973 (Symbol_table::is_section_folded): New function.
12974 (Symbol_table::icf_): New data member.
12975 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12976 * testsuite/Makefile.am: Add commands to build icf_test.
12977 * testsuite/Makefile.in: Regenerate.
12978 * testsuite/icf_test.sh: New file.
12979 * testsuite/icf_test.cc: New file.
12981 2009-07-24 Chris Demetriou <cgd@google.com>
12983 * layout.cc (is_compressible_debug_section): Fix incorrect
12984 comment about compressed section names.
12986 2009-07-20 Ian Lance Taylor <ian@airs.com>
12989 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12991 2009-07-16 Ian Lance Taylor <iant@google.com>
12994 * layout.h: #include <map>.
12995 (class Kept_section): Change from struct to class. Add accessors
12996 and setters. Add section size to Comdat_group mapping. Change
12997 Comdat_group to std::map. Add is_comdat_ field. Add
12998 linkonce_size field in union.
12999 (class Layout): Update declaration of find_or_add_kept_section.
13000 Don't declare find_kept_object.
13001 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13002 parameter. Add object, shndx, is_comdat, and is_group_name
13003 parameters. Change all callers. Adjust for new Kept_section.
13004 (Layout::find_kept_object): Remove.
13005 * object.cc (Sized_relobj::include_section_group): Update use of
13006 Kept_section. Rename secnum to shndx. Only record
13007 Kept_comdat_section if sections are the same size.
13008 (Sized_relobj::include_linkonce_section): Update use of
13009 Kept_section. Only record Kept_comdat_section if sections are the
13010 same size. Set size of linkonce section.
13011 (Sized_relobj::map_to_kept_section): Update call to
13012 get_kept_comdat_section.
13013 * object.h (class Sized_relobj): Rename fields in
13014 Kept_comdat_section to drop trailing underscores; change object
13015 field to Relobj*. Change Kept_comdat_section_table to store
13016 struct rather than pointer.
13017 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13018 Add kept_object and kept_shndx parameters. Change all callers.
13019 (Sized_relobj::get_kept_comdat_section): Change return type to
13020 bool. Add kept_object and kept_shndx parameters. Change all
13022 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13023 Layout::find_or_add_kept_section.
13025 2009-07-09 Ian Lance Taylor <iant@google.com>
13027 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13028 Reserve space in the hash table.
13030 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13032 * fileread.cc (File_read::get_mtime): New method.
13033 * fileread.h (Timespec): New structure.
13034 (File_read::get_mtime): New method.
13035 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13036 Renamed from timestamp_nsec.
13037 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13039 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
13041 (Incremental_inputs::report_archive): Save mtime; style fix.
13042 (Incremental_inputs::report_obejct): Save mtime; style fix.
13043 (Incremental_inputs::report_script): Save mtime; style fix.
13044 (Incremental_inputs::finalize_inputs): Style fix.
13045 (Incremental_inputs::finalize): Style fix.
13046 (Incremental_inputs::create_input_section_data): Store inputs
13048 * incremental.h (Incremental_inputs::report_script): Add mtime
13050 (Incremental_inputs::Input_info::Input_info): Intialize only one
13052 (Incremental_inputs::Input_info::archive): Move to nameless
13054 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13055 (Incremental_inputs::Input_info::script): Move to nameless union.
13056 (Incremental_inputs::mtime): New field.
13057 * script.cc (read_input_script): Pass file mtime to
13059 * script.h (Script_info::inputs): Style fix.
13061 2009-07-01 Ian Lance Taylor <ian@airs.com>
13063 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13066 2009-06-24 Ian Lance Taylor <iant@google.com>
13069 * layout.cc (Layout::choose_output_section): If we find an
13070 existing section, update the flags.
13071 (Layout::create_notes): New function, broken out of
13073 (Layout::finalize): Don't create note sections.
13074 (Layout::create_note): Don't crash if linker script discards
13076 (Layout::create_gold_note): Likewise.
13077 (Layout::create_build_id): Likewise. Don't set
13078 after_input_sections on the section.
13079 (Layout::create_executable_stack_info): Remove target parameter.
13081 * layout.h (class Layout): Declare create_notes. Update
13082 declaration of create_executable_stack_info.
13083 * gold.cc (queue_middle_tasks): Call create_notes.
13084 * output.cc (Output_section::update_flags_for_input_section): Move
13085 here from output.h. If SHF_ALLOC flag is newly set, mark address
13087 * output.h (Output_data::mark_address_invalid): New function.
13088 (class Output_section): Only declare, not define,
13089 update_flags_for_input_section. Remove set_flags.
13091 2009-06-24 Ian Lance Taylor <iant@google.com>
13093 * script-sections.cc (Output_section_definition::
13094 set_section_addresses): Rename shadowing local load_address to
13097 2009-06-24 Ian Lance Taylor <iant@google.com>
13100 * reloc.cc (relocate_sections): Skip empty relocation sections.
13102 2009-06-23 Ian Lance Taylor <iant@google.com>
13105 * layout.cc (Layout::create_note): Use choose_output_section
13106 rather than make_output_section.
13108 2009-06-23 Ian Lance Taylor <iant@google.com>
13111 * options.cc (General_options::parse_V): Set printed_version_.
13112 (General_options::General_options): Initialize printed_version_.
13113 * options.h (class General_options): Add printed_version_ field.
13114 * gold.cc (queue_initial_tasks): If there are no input files,
13115 don't give a fatal error if we printed the version information.
13116 (queue_middle_tasks): If using -r with a shared object, give a
13117 fatal error rather than an ordinary error.
13119 2009-06-23 Ian Lance Taylor <iant@google.com>
13122 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13123 (Layout::make_output_section): Set have_stabstr_section_ if we see
13124 a .stab*str section.
13125 (Layout::finalize): Call link_stabs_sections.
13126 (Layout::link_stabs_sections): New file.
13127 * layout.h (class Layout): Add have_stabstr_section_ field.
13128 Declare link_stabs_sections.
13130 2009-06-23 Doug Kwan <dougkwan@google.com>
13132 * Makefile.am (libgold_a_LIBADD): New.
13133 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
13134 * Makefile.in: Regenerate.
13135 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13136 * configure: Regenerate.
13137 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13138 * fileread.cc: Include sys/state.h
13139 * gold.h: Declare memmem and strndup if found missing.
13140 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13142 2009-06-23 Ian Lance Taylor <iant@google.com>
13144 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13145 * configure: Rebuild.
13147 2009-06-23 Ian Lance Taylor <iant@google.com>
13150 * object.cc (Object::section_contents): Don't try to get a view if
13151 the section has length zero.
13152 (Object::handle_gnu_warning_section): If the section is empty, use
13153 the name of the section as the warning.
13155 2009-06-23 Ian Lance Taylor <iant@google.com>
13158 * stringpool.h (class Stringpool_template): Add optimize_ field.
13159 (Stringpool_template::set_optimize): New function.
13160 * stringpool.cc (Stringpool_template::Stringpool_template):
13161 Initialize optimize_ field.
13162 (Stringpool_template::set_string_offsets): Test local optimize
13163 fild rather than parameter.
13164 * layout.cc (Layout::Layout): Call set_optimize on the section
13167 2009-06-22 Ian Lance Taylor <iant@google.com>
13170 * yyscript.y: Parse TARGET.
13171 * script.cc (script_set_target): New function.
13172 * script-c.h (script_set_target): Declare.
13173 * options.cc (General_options::string_to_object_format): Rename
13174 from string_to_object_format in anonymous namespace. Change
13176 * options.h (class General_options): Declare
13177 string_to_object_format.
13179 2009-06-22 Ian Lance Taylor <iant@google.com>
13181 * script-sections.cc (Script_sections::create_segments): Don't put
13182 program headers in a PT_LOAD segment if -n or -N.
13184 2009-06-22 Ian Lance Taylor <iant@google.com>
13187 * options.h (class General_options): Add -z lazy and -z now. Sort
13188 -z options into alphabetical order.
13189 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13191 2009-06-21 Ian Lance Taylor <iant@google.com>
13193 * layout.cc (Layout::make_output_section): Call
13194 Target::new_output_section.
13195 (Layout::attach_allocated_section_to_segment): Put large section
13196 sections in a separate load segment with the large segment flag
13198 (Layout::segment_precedes): Sort large data segments after other
13200 (align_file_offset): New static function.
13201 (Layout::set_segment_offsets): Use align_file_offset.
13202 * output.h (class Output_section): Add is_small_section_ and
13203 is_large_section_ fields.
13204 (Output_section::is_small_section): New function.
13205 (Output_section::set_is_small_section): New function.
13206 (Output_section::is_large_section): New function.
13207 (Output_section::set_is_large_section): New function.
13208 (Output_section::is_large_data_section): New function.
13209 (class Output_segment): Add is_large_data_segment_ field.
13210 (Output_segment::is_large_data_segment): New function.
13211 (Output_segment::set_is_large_data_segment): New function.
13212 * output.cc (Output_section::Output_section): Initialize new
13214 (Output_segment::Output_segment): Likewise.
13215 (Output_segment::add_output_section): Add assertion that large
13216 data sections always go in large data segments. Force small data
13217 sections to the end of the list of data sections. Force small BSS
13218 sections to the start of the list of BSS sections. For large BSS
13219 sections to the end of the list of BSS sections.
13220 * symtab.h (class Symbol): Declare is_common_shndx.
13221 (Symbol::is_defined): Check Symbol::is_common_shndx.
13222 (Symbol::is_common): Likewise.
13223 (class Symbol_table): Define enum Commons_section_type. Update
13224 declarations. Add small_commons_ and large_commons_ fields.
13225 * symtab.cc (Symbol::is_common_shndx): New function.
13226 (Symbol_table::Symbol_table): Initialize new fields.
13227 (Symbol_table::add_from_object): Put small and large common
13228 symbols in the right list.
13229 (Symbol_table::sized_finalized_symbol): Check
13230 Symbol::is_common_shndx.
13231 (Symbol_table::sized_write_globals): Likewise.
13232 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13233 common symbol lists. Don't call do_allocate_commons_list if the
13235 (Symbol_table::do_allocate_commons_list): Remove is_tls
13236 parameter. Add comons_section_type parameter. Change all
13237 callers. Handle small and large common symbols.
13238 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13239 Symbol::is_common_shndx.
13240 * resolve.cc (symbol_to_bits): Likewise.
13241 * target.h (Target::small_common_shndx): New function.
13242 (Target::small_common_section_flags): New function.
13243 (Target::large_common_shndx): New function.
13244 (Target::large_common_section_flags): New function.
13245 (Target::new_output_section): New function.
13246 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13247 small_common_section_flags, and large_common_section_flags
13249 (Target::do_new_output_section): New virtual function.
13250 * arm.cc (Target_arm::arm_info): Initialize new fields.
13251 * i386.cc (Target_i386::i386_info): Likewise.
13252 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13254 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13255 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13256 (Target_x86_64::do_new_output_section): New function.
13257 * configure.ac: Define conditional MCMODEL_MEDIUM.
13258 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13259 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13260 (large_LDFLAGS): Define.
13261 * testsuite/large.c: New file.
13262 * testsuite/testfile.cc (Target_test::test_target_info):
13263 Initialize new fields.
13264 * configure, testsuite/Makefile.in: Rebuild.
13266 2009-06-05 Doug Kwan <dougkwan@google.com>
13268 * Makefile.am (CCFILES): Add target.cc.
13269 * Makefile.in: Regenerate.
13270 * i386.cc (class Target_i386): Define new virtual method to
13271 override do_is_local_label_name in parent.
13272 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13273 local symbols if --discard-locals or -X is given.
13274 * options.h (class General_options): Declare new options
13275 '--discard-locals' and '-X' for discarding locals.
13276 * target.h (class Target): Define new methods is_local_label_name.
13277 Declare new virtual method do_is_local_label_name.
13278 * target.cc: New file.
13279 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13280 (check_SCRIPTS): Add discard_locals_test.sh.
13281 (check_DATA): Add discard_local_tests.syms.
13282 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13283 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13284 * testsuite/Makefile.in: Regenerate.
13285 * testsuite/discard_locals_test.c: New file.
13286 * testsuite/discard_locals_test.sh: Same.
13288 2009-06-05 Doug Kwan <dougkwan@google.com>
13290 * object.cc (Sized_relobj::Sized_relobj): Initialize
13291 discarded_eh_frame_shndx_ to -1U.
13292 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13294 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13295 a discarded .eh_frame section.
13296 (Sized_relobj::do_finalize_local_symbols): Ditto.
13297 * object.h (class Sized_relobj): Declare new member
13298 discarded_eh_frame_shndx_.
13299 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13300 (local_labels_test.o, local_labels_test): New rules.
13301 * testsuite/Makefile.in: Regenerate.
13303 2009-06-04 Doug Kwan <dougkwan@google.com>
13305 * layout.cc (Layout::section_name_mapping): Add mapping for
13306 special ARM sections.
13308 2009-06-03 Doug Kwan <dougkwan@google.com>
13310 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13311 (utils::has_overflow): Same.
13313 2009-06-03 Ian Lance Taylor <iant@google.com>
13315 * layout.cc (Layout::section_name_mapping): New array, replacing
13316 Layout::linkonce_mapping.
13317 (Layout::section_name_mapping_count): New variable, replacing
13318 Layout::linkonce_mapping_count.
13319 (Layout::linkonce_output_name): Remove.
13320 (Layout::output_section_name): Rewrite.
13321 * layout.h (class Layout): Rename Linkonce_mapping to
13322 Section_name_mapping, linkonce_mapping to section_name_mapping,
13323 linkonce_mapping_count to section_name_mapping_count. Don't
13324 declare linkonce_output_name.
13326 2009-06-03 Doug Kwan <dougkwan@google.com>
13328 * gold/arm.cc (namespace utils): New.
13329 (Target_arm::reloc_is_non_pic): Define new method.
13330 (class Arm_relocate_functions): New.
13331 (Target_arm::Relocate::relocate): Handle relocation types used by
13334 2009-06-03 Ian Lance Taylor <iant@google.com>
13336 * arm.cc (Target_arm::scan::global): Use || instead of |.
13338 2009-06-02 Doug Kwan <dougkwan@google.com>
13340 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13341 issued_non_pic_error_.
13342 (class Target_arm::Scan): Declare new method check_non_pic.
13343 Define new method symbol_needs_plt_entry.
13344 Declare new data member issued_non_pic_error_.
13345 (class Target_arm::Relocate): Declare new method
13346 should_apply_static_reloc.
13347 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13348 (Target_arm::Scan::check_non_pic): Define new method.
13349 (Target_arm::Scan::local): Handle a small subset of reloc types used
13351 (Target_arm::Scan::local): Same.
13352 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13354 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13356 * incremental.cc (Incremental_inputs::report_command_line): Filter
13357 out --incremental-* options.
13359 2009-05-29 Doug Kwan <dougkwan@google.com>
13361 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13363 (class Target_arm): Update comment.
13364 (Target_arm::Target_arm): Initialize new data members GOT_,
13365 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13366 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13367 and Target_arm::rel_dyn_section.
13368 Declare new_enum Target_arm::Got_type.
13369 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13371 Update commments for member do_dynsym_value.
13372 (Target_arm::got_size, Target_arm::plt_section,
13373 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13374 new methods inside class defintion.
13375 (Target_arm::got_section): Define new method.
13376 (Target_arm::rel_dyn_section): Same.
13377 (Output_data_plt_arm): New template class.
13378 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13379 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13380 (Output_data_plt_arm::add_entry): Same.
13381 (Output_data_plt_arm::first_plt_entry): Define new
13382 static data member for PLT instruction template.
13383 (Output_data_plt_arm::plt_entry): Same.
13384 (Output_data_plt_arm::do_write): Define new method.
13385 (Target_arm::make_plt_entry): Same.
13386 (Target_arm::do_finalize_sections): Same.
13387 (Target_arm::do_dynsym_value): Same.
13389 2009-05-28 Doug Kwan <dougkwan@google.com>
13391 * Makefile.am (TARGETSOURCES): Add arm.cc.
13392 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13393 * Makefile.in: Regenerate.
13394 * arm.cc: New file.
13395 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13397 2009-05-26 Doug Kwan <dougkwan@google.com>
13399 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13400 (General_options::check_excluded_libs): Strip off directories in
13401 archive name before matching like GNU ld does.
13402 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13403 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13404 (exclude_libs_test_LDFLAGS): Add linker option
13405 -Wl,--exclude-libs,libexclude_libs_test_3
13406 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13407 an explicit archive without using -l.
13408 (alt/libexclude_libs_test_3.a): New make rule.
13409 * testsuite/Makefile.in: Regenerate.
13410 * testsuite/exclude_libs_test.c : Declare lib3_default().
13412 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13413 * exclude_libs_test_3.c: New file.
13415 2009-05-26 Nick Clifton <nickc@redhat.com>
13417 * po/id.po: New Indonesian translation.
13418 * po/gold.pot: Updated template file.
13420 2009-05-22 Sriraman Tallam <tmsriram@google.com>
13422 * testsuite/Makefile.am: Add -ffunction-sections to compile
13423 gc_comdat_test files. Add -Wl,--gc-sections to build
13425 * testsuite/Makefile.in: Regenerate.
13426 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13428 2009-05-21 Sriraman Tallam <tmsriram@google.com>
13430 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13431 kept comdat section was garbage collected.
13432 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13433 * testsuite/Makefile.in: Regenerate.
13434 * testsuite/gc_comdat_test.sh: New file.
13435 * testsuite/gc_comdat_test_1.cc: New file.
13436 * testsuite/gc_comdat_test_2.cc: New file.
13438 2009-05-19 Doug Kwan <dougkwan@google.com>
13440 * archive.cc (Archive::Archive): Move constructor from archive.h
13441 to here. Initialize no_export_.
13442 (Archive::get_elf_object_for_member): Set no_export flag of object.
13443 * archive.h (Archive::Archive): Move constructor body to
13445 (Archive::no_export): New method.
13446 (Archive::no_export_): New field.
13447 * object.h (Object::Object): Initialize no_export_ to false.
13448 (Object::no_export, Object::set_no_export): New methods.
13449 (Object::no_export_): New field.
13450 * options.cc (General_options::parse_exclude_libs): New method.
13451 (General_options::check_excluded_libs) Same.
13452 * options.h (exclude_libs): New option.
13453 (General_options::check_excluded_libs): New method declaration.
13454 (General_options::excluded_libs_): New field.
13455 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13456 default or protected visibility if an object has no-export flag set.
13457 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13458 (check_SCRIPTS): Add exclude_libs_test.sh.
13459 (check_DATA): Add exclude_libs_test.syms.
13460 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13461 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13462 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13463 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13464 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13465 libexclude_libs_test_2.a): New rules.
13466 * testsuite/Makefile.in: Regenerate.
13467 * testsuite/exclude_libs_test.c: New file.
13468 * testsuite/exclude_libs_test.sh: Ditto.
13469 * testsuite/exclude_libs_test_1.c: Ditto.
13470 * testsuite/exclude_libs_test_2.c: Ditto.
13472 2009-05-15 Ian Lance Taylor <iant@google.com>
13474 * configure.ac: Check for declarations for cases where libiberty.h
13475 checks HAVE_DECL_xxx.
13476 * configure, config.in: Rebuild.
13478 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13480 * gold.h (Incremental_argument_list): Remove (invalid) forward
13482 * incremental.cc (Incremental_inputs::report_achive): New method.
13483 (Incremental_inputs::report_object): New method.
13484 (Incremental_inputs::report_script): New method.
13485 (Incremental_inputs::finalize_inputs): New method.
13486 (Incremental_inputs::finalize): Call finalize_inputs().
13487 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13488 Create inputs entries.
13489 * incremental.h (Incremental_input_type): New enum.
13490 (Incremental_inputs::Incremental_input): Initialize new fields.
13491 (Incremental_inputs::report_inputs): New method.
13492 (Incremental_inputs::report_achive): New method.
13493 (Incremental_inputs::report_object): New method.
13494 (Incremental_inputs::report_script): New method.
13495 (Incremental_inputs::finalize_inputs): New method.
13496 (Incremental_inputs::Input_info): New struct.
13497 (Incremental_inputs::Input_info_map): New typedef.
13498 (Incremental_inputs::lock_): New field.
13499 (Incremental_inputs::Inputs_): New field.
13500 (Incremental_inputs::Inputs_map): New field.
13501 * main.cc (main): Call Incremental_input::report_inputs.
13502 * options.h (Input_argument_list): Typedef moved from
13504 (Input_file_group::Files): Remove, use ::Input_argument_list.
13505 (Input_file_group::Input_argument_list): Remove, use
13506 ::Input_argument_list.
13507 * plugin.cc (Plugin_manager::add_input_file): Add error in
13509 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13511 * script.cc (read_input_script): Call
13512 Incremental_input::report_script.
13513 * script.h (Script_info): New class.
13515 2009-04-27 Ian Lance Taylor <iant@google.com>
13517 * x86_64.cc (do_adjust_output_section): Set entsize to
13520 2009-04-23 Elliott Hughes <enh@google.com>
13522 * output.cc (Output_file::close): After short writes, continue
13523 writing from the correct offset in the buffer being written.
13525 2009-04-23 Chris Demetriou <cgd@google.com>
13527 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13528 * configure: Regenerate.
13529 * config.in: Regenerate.
13530 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13531 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13533 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13535 * incremental.cc (Incremental_inputs_header_data): Renamed from
13536 Incremental_input_header_data.
13537 (Incremental_inputs_header_data::data_size): New field.
13538 (Incremental_inputs_header_data::put_input_file_count): Renamed
13539 from input_file_count.
13540 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13541 from command_line_offset.
13542 (Incremental_inputs_header_data::put_reserved): Renamed from
13544 (Incremental_inputs_entry_data): Renamed from
13545 Incremental_input_entry_data.
13546 (Incremental_inputs_entry_data::data_size): New field.
13547 (Incremental_inputs::report_command_line): New method.
13548 (Incremental_inputs::finalize): New method.
13549 (Incremental_inputs::create_incremental_inputs_data): New method.
13550 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13551 * incremental.h: New file.
13552 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
13553 (Layout::finalize): Create incremental inputs section in
13554 incremental builds.
13555 (Layout::create_incremental_info_sections): New method.
13556 * layout.h (Layout::incremental_inputs): New method.
13557 (Layout::create_incremental_info_sections): New method.
13558 (Layout::incremental_inputs_): New field.
13559 * main.cc (main): Notify Incremental_input of the command line.
13561 2009-04-01 Ian Lance Taylor <iant@google.com>
13562 Mikolaj Zalewski <mikolajz@google.com>
13564 * gold.h (reserve_unordered_map): Define, three versions, one for
13565 each version of Unordered_map.
13566 * layout.cc (Layout::Layout): Remove options parameter. Add
13567 number_of_input_files parameter. Don't initialize options_.
13568 Initialize number_of_input_files_ and resized_signatures_. Move
13569 sections_are_attached_.
13570 (Layout::layout_group): Reserve space for group_signatures_.
13571 (Layout::find_or_add_kept_section): Change name parameter to be a
13572 reference. Resize signatures_ map when it gets large enough.
13573 (Layout::layout_eh_frame): Use parameters->options() instead of
13575 (Layout::make_output_section): Likewise.
13576 (Layout::attach_allocated_section_to_segment): Likewise.
13577 (Layout::finalize, Layout::create_executable_stack): Likewise.
13578 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13579 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13580 * layout.h (class Layout): Update declarations. Remove options_
13581 field. Add number_of_input_files_ and resized_signatures_
13582 fields. Move sections_are_attached_ field.
13583 * main.cc (main): Pass number of input files to Layout
13584 constructor. Don't pass options.
13586 2009-03-30 Ian Lance Taylor <iant@google.com>
13588 * ffsll.c (ffsll): Correct implementation.
13590 2009-03-27 Ian Lance Taylor <iant@google.com>
13592 * ffsll.c: New file.
13593 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13594 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13595 * ftruncate.c (ftruncate): Declare before definition.
13596 * mremap.c (mremap): Likewise.
13597 * pread.c (pread): Likewise.
13598 * configure, Makefile.in, config.in: Rebuild.
13600 * mremap.c: New file.
13601 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13602 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13603 (mremap): Declare if HAVE_MREMAP is not defined.
13604 * configure, Makefile.in, config.in: Rebuild.
13606 2009-03-27 Cary Coutant <ccoutant@google.com>
13608 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13609 position independent.
13610 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13611 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13613 2009-03-24 Cary Coutant <ccoutant@google.com>
13615 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13617 (needs_dynamic_reloc): Likewise.
13619 2009-03-24 Ian Lance Taylor <iant@google.com>
13621 * yyscript.y (file_cmd): Recognize EXTERN.
13622 (extern_name_list, extern_name_list_body): New nonterminals.
13623 * script.cc (script_add_extern): Define.
13624 * script-c.h (script_add_extern): Declare.
13626 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
13628 * object.cc (is_elf_object): Define.
13629 * object.h (is_elf_object): Declare.
13630 * archive.cc (Archive::get_elf_object_for_member): Call
13632 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
13634 2009-03-24 Elliott Hughes <enh@google.com>
13636 * output.cc (Output_file::map_anonymous): Define.
13637 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13638 try an anonymous one. Report the size if the mmap fails.
13639 * output.h (class Output_file): Declare map_anonymous.
13641 2009-03-24 Ian Lance Taylor <iant@google.com>
13643 * target-select.cc (instantiate_target): Don't acquire the lock if
13644 the instantiated_target_ field has already been set.
13646 2009-03-23 Ian Lance Taylor <iant@google.com>
13648 * gold-threads.h (class Initialize_lock): Define.
13649 * gold-threads.cc (class Initialize_lock_once): Define.
13650 (initialize_lock_control): New static variable.
13651 (initialize_lock_pointer): New static variable.
13652 (initialize_lock_once): New static function.
13653 (Initialize_lock::Initialize_lock): Define.
13654 (Initialize_lock::initialize): Define.
13655 * target-select.h: Include "gold-threads.h".
13656 (class Target_selector): Add lock_ and initialize_lock_ fields.
13657 Don't define instantiate_target, just declare it.
13658 * target-select.cc (Target_selector::Target_selector): Initialize
13660 (Target_selector::instantiate_target): Define.
13661 * descriptors.h: Include "gold-threads.h".
13662 (class Descriptors): Add initialize_lock_ field.
13663 * descriptors.cc (Descriptors::Descriptors): Initialize new
13665 (Descriptors::open): Use initialize_lock_ field
13666 * errors.h (class Errors): Add initialize_lock_ field.
13667 * errors.cc (Errors::Errors): Initialize new field.
13668 (Errors::initialize_lock): Use initialize_lock_ field.
13669 * powerpc.cc (class Target_selector_powerpc): Remove
13670 instantiated_target_ field. In do_recognize call
13671 instantiate_target rather than do_instantiate_target. In
13672 do_instantiate_target just allocate a new target.
13673 * sparc.cc (class Target_selector_sparc): Likewise.
13675 * freebsd.h: New file.
13676 * i386.cc: Include "freebsd.h".
13677 (Target_i386): Derive from Target_freebsd rather than
13679 (Target_selector_i386): Derive from Target_selector_freebsd rather
13680 than Target_selector.
13681 * x86_64.cc: Include "freebsd.h".
13682 (Target_x86_64): Derive from Target_freebsd rather than
13684 (Target_selector_x86_64): Derive from Target_selector_freebsd
13685 rather than Target_selector.
13686 * target.h (class Target): Add adjust_elf_header and
13687 do_adjust_elf_header.
13688 * output.cc (Output_file_header:: do_sized_write): Call target
13689 adjust_elf_header routine.
13690 * configure.tgt: Set targ_osabi.
13691 * configure.ac: Define GOLD_DEFAULT_OSABI.
13692 * parameters.cc (Parameters::default_target): Pass
13693 GOLD_DEFAULT_OSABI to select_target.
13694 * target-select.h (class Target_selector): Make instantiate_target
13695 protected rather than private.
13696 * Makefile.am (HFILES): Add freebsd.h.
13697 * configure, Makefile.in, config.in: Rebuild.
13699 * merge.cc (do_add_input_section): Correct pend value. Change
13700 message about last entry not being null terminated from error to
13703 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13705 * incremental.cc: New file.
13706 * Makefile.am (CCFILES): Add incremental.cc.
13707 * Makefile.in: Rebuild.
13709 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13711 * layout.cc (Layout::output_section_name): Preserve names
13712 of '.note.' sections.
13714 2009-03-19 Ian Lance Taylor <iant@google.com>
13716 * descriptors.cc (Descriptors::open): Check that the options are
13717 valid before using them.
13719 2009-03-18 Ian Lance Taylor <iant@google.com>
13721 * script-sections.h: Include <list>.
13722 (class Script_sections): Change Sections_elements from std::vector
13723 to std::list. Typedef public Elements_iterator. Add
13724 orphan_section_placement_, data_segment_align_start_, and
13725 saw_data_segment_align_ fields. Remove data_segment_align_index_
13727 * script-sections.cc (class Orphan_section_placement): New class.
13728 (class Sections_element): Add virtual functions is_relro and
13729 orphan_section_init. Remove virtual function place_orphan_here.
13730 (class Output_section_definition): Add is_relro and
13731 orphan_section_init. Remove place_orphan_here.
13732 (class Orphan_output_section): Likewise.
13733 (Script_sections::Script_sections): Update for field changes.
13734 (Script_sections::data_segment_align): Set saw_data_segment_align_
13735 and data_segment_align_start_, not data_segment_align_index.
13736 (Script_sections::data_segment_relro_end): Check
13737 saw_data_segment_align_. Use data_segment_align_start_ rather
13738 than data_segment_align_index_.
13739 (Script_sections::place_orphan): Rewrite to use
13740 Orphan_section_placement.
13742 2009-03-17 Ian Lance Taylor <iant@google.com>
13744 * archive.cc (Archive::add_symbols): Check for a version attached
13745 to the symbol name in the archive map.
13746 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13747 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13748 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13749 (ver_test_11.a): New target.
13750 * testsuite/Makefile.in: Rebuild.
13752 * configure.ac: Check for chsize and posix_fallocate. Replace
13754 * ftruncate.c: New file, from gnulib.
13755 * output.cc (posix_fallocate): Define dummy version if not
13756 HAVE_POSIX_FALLOCATE.
13757 (Output_file::map): Call posix_fallocate rather than lseek and
13759 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13760 * configure, Makefile.in, config.in: Rebuild.
13762 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
13764 * layout.h (Layout::create_note): Add section_name parameter.
13765 * layout.cc (Layout::create_note): Likewise.
13766 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
13768 2009-03-17 Ian Lance Taylor <iant@google.com>
13770 * descriptors.cc: Include "options.h".
13771 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13772 (Descriptors::open): Always use O_CLOEXEC when opening a new
13773 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13774 then set FD_CLOEXEC.
13776 * sparc.cc (class Target_sparc): Add has_got_section.
13777 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13778 make sure we have a GOT section.
13780 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13781 (Target_sparc::Scan::local): Likewise.
13782 (Target_sparc::Scan::global): Likewise.
13783 (Target_sparc::Relocate::relocate): Likewise.
13784 (Target_sparc::Relocate::relocate_tls): Likewise.
13786 * symtab.cc (Symbol_table::define_default_version): New function,
13787 broken out of add_from_object.
13788 (Symbol_table::add_from_object): Call define_default_version.
13789 (Symbol_table::define_special_symbol): Add resolve_oldsym
13790 parameter. Change all callers. If the version for a symbol comes
13791 from a version script, resolve it with the symbol with the same
13792 name with no version. Also add the symbol without a version if
13794 (do_define_in_output_data): If resolving with oldsym, don't delete
13796 (do_define_in_output_segment): Likewise.
13797 (do_define_as_constant): Likewise.
13798 * symtab.h (class Symbol_table): Update declarations.
13800 2009-03-13 Ian Lance Taylor <iant@google.com>
13802 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13803 (Read_symbols::requeue): New function.
13804 (Read_symbols::do_read_symbols): If make_elf_object fails because
13805 the target type is not configured, and the file was searched for,
13806 issue a warning and retry with the next directory.
13807 (Add_symbols::run): If the file has an incompatible format, and
13808 it was searched for, requeue the Read_symbols task. On error,
13809 release the object.
13810 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13811 dirindex parameter to constructor. Change all callers. Declare
13812 incompatible_warning and requeue.
13813 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13814 input_argument_ and input_group_ fields. Add them to
13815 constructor. Change all callers.
13816 (class Read_script): Add dirindex_ field. Add it to constructor.
13817 Change all callers.
13818 * archive.cc (Archive::setup): Remove input_objects parameter.
13819 Change all callers.
13820 (Archive::get_file_and_offset): Likewise.
13821 (Archive::read_all_symbols): Likewise.
13822 (Archive::read_symbols): Likewise.
13823 (Archive::get_elf_object_for_member): Remove input_objects
13824 parameter. Add punconfigured parameter. Change all callers.
13825 (Archive::add_symbols): Change return type to bool. Check return
13826 value of include_member.
13827 (Archive::include_all_members): Likewise.
13828 (Archive::include_member): Change return type to bool. Return
13829 false if first included object has incompatible target. Set
13830 included_member_ field.
13831 (Add_archive_symbols::run): If add_symbols returns false, requeue
13833 * archive.h (class Archive): Add included_member_ field.
13834 Initialize it in constructor. Add input_file and searched_for
13835 methods. Update declarations.
13836 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13837 input_argument_ fields. Add them to constructor. Change all
13839 * script.cc: Include "target-select.h".
13840 (class Parser_closure): Add skip_on_incompatible_target_ and
13841 found_incompatible_target_ fields. Add
13842 skip_on_incompatible_target parameter to constructor. Change all
13843 callers. Add methods skip_on_incompatible_target,
13844 clear_skip_on_incompatible_target, found_incompatible_target, and
13845 set_found_incompatible_target.
13846 (read_input_script): Add dirindex parameter. Change all callers.
13847 If parser finds an incompatible target, requeue Read_symbols
13849 (script_set_symbol): Clear skip_on_incompatible_target in
13851 (script_add_assertion, script_parse_option): Likewise.
13852 (script_start_sections, script_add_phdr): Likewise.
13853 (script_check_output_format): New function.
13854 * script.h (read_input_script): Update declaration.
13855 * script-c.h (script_check_output_format): Declare.
13856 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13857 (ignore_cmd): Remove OUTPUT_FORMAT.
13858 * fileread.cc (Input_file::Input_file): Add explicit this.
13859 (Input_file::will_search_for): New function.
13860 (Input_file::open): Add pindex parameter. Change all callers.
13861 * fileread.h (class Input_file): Add input_file_argument method.
13862 Declare will_search_for. Update declarations.
13863 * object.cc (make_elf_object): Add punconfigured parameter.
13864 Change all callers.
13865 * object.h (class Object): Make input_file public. Add
13866 searched_for method.
13867 (make_elf_object): Update declaration.
13868 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13870 * dirsearch.h (class Dirsearch): Update declaration.
13871 * options.h (class General_options): Add --warn-search-mismatch.
13872 * parameters.cc (Parameters::is_compatible_target): New function.
13873 * parameters.h (class Parameters): Declare is_compatible_target.
13874 * workqueue.cc (Workqueue::add_blocker): New function.
13875 * workqueue.h (class Workqueue): Declare add_blocker.
13877 * fileread.cc (Input_file::open): Remove options parameter.
13878 Change all callers.
13879 (Input_file::open_binary): Likewise.
13880 * script.cc (read_input_script): Likewise.
13881 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13882 options parameter from constructor. Change all callers.
13883 (class Read_script): Likewise.
13884 * fileread.h (class Input_file): Update declarations.
13885 * script.h (read_input_script): Update declaration.
13887 2009-03-10 Nick Clifton <nickc@redhat.com>
13889 * po/es.po: New Spanish translation.
13891 2009-03-06 Cary Coutant <ccoutant@google.com>
13893 * options.cc (parse_short_option): Keep dash_z from registering itself.
13895 2009-03-03 Ian Lance Taylor <iant@google.com>
13898 * target-reloc.h (relocate_section): Pass output_section to
13900 * i386.cc (Target_i386::should_apply_static_reloc): Add
13901 output_section parameter. Change all callers.
13902 (Target_i386::Relocate::relocate): Add output_section parameter.
13903 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13904 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13905 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13906 * testsuite/two_file_shared.sh: New script.
13907 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13908 (check_DATA): Add two_file_shared.dbg.
13909 (two_file_shared.dbg): New target.
13910 * testsuite/Makefile.in: Rebuild.
13912 2009-03-01 Ian Lance Taylor <iant@google.com>
13914 * configure.ac: Check for byteswap.h.
13915 * configure: Rebuild.
13916 * config.in: Rebuild.
13918 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13920 * layout.cc (Layout::find_or_add_kept_section): New function.
13921 (Layout::add_comdat): Removed.
13922 * layout.h (struct Kept_section): Move out of class Layout.
13923 Remove trailing underscores from field names. Add group_sections
13924 field. Rename group_ field to is_group. Change all uses.
13925 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13926 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13927 comdat_groups_ field.
13928 (Sized_relobj::include_section_group): Use
13929 find_or_add_kept_section and Kept_section::group_sections.
13930 (Sized_relobj::include_linkonce_section): Likewise.
13931 * object.cc (class Sized_relobj): Don't define Comdat_group or
13932 Comdat_group_table. Remove find_comdat_group and
13933 add_comdat_group. Remove comdat_groups_ field.
13934 * plugin.cc (include_comdat_group): Use
13935 Layout::find_or_add_kept_section.
13937 2009-02-28 Ian Lance Taylor <iant@google.com>
13939 * README: --gc-sections and map files are now supported. Document
13940 some build requirements.
13943 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13944 relocatable link set the value of the section symbol to zero.
13945 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13946 relocatable link don't include the section address in the local
13949 2009-02-27 Ian Lance Taylor <iant@google.com>
13952 * options.h (class Search_directory): Add is_system_directory.
13953 (class General_options): Declare is_in_system_directory.
13954 * options.cc (get_relative_sysroot): Make static.
13955 (get_default_sysroot): Make static.
13956 (General_optoins::is_in_system_directory): New function.
13957 * fileread.cc (Input_file::is_in_system_directory): New function.
13958 * fileread.h (class Input_file): Declare is_in_system_directory.
13959 * object.h (class Object): Add is_in_system_directory.
13960 (class Input_objects): Remove system_library_directory_ field.
13961 * object.cc (Input_objects::add_object): Don't set
13962 system_library_directory_.
13963 (input_objects::found_in_system_library_directory): Remove.
13964 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13965 parameter. Change all callers.
13966 (Symbol_table::sized_write_globals): Likewise.
13967 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13968 Call Object::is_in_system_directory.
13969 * symtab.h (class Symbol_table): Update declarations.
13972 * descriptors.h (Open_descriptor): Add is_on_stack field.
13973 * descriptors.cc (Descriptors::open): If the descriptor is on the
13974 top of the stack, remove it. Initialize is_on_stack field.
13975 (Descriptors::release): Only add pod to stack if it is not on the
13977 (Descriptors::close_some_descriptor): Clear stack_next and
13978 is_on_stack fields.
13981 * output.cc (Output_section::find_starting_output_address): Rename
13982 from starting_output_address; add PADDR parameter; change return
13984 * output.h (class Output_section): Declare
13985 find_starting_output_address instead of starting_output_address.
13986 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13987 section symbol for which we can't find a merge section.
13990 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13991 hidden or internal, force the symbol to be local.
13992 * resolve.cc (Symbol::override_visibility): Define.
13993 (Symbol::override_base): Use override_visibility.
13994 (Symbol_table::resolve): Likewise.
13995 (Symbol::override_base_with_special): Likewise.
13996 (Symbol_table::override_with_special): If the visibility is hidden
13997 or internal, force the symbol to be local.
13998 * symtab.h (class Symbol): Add set_visibility and
13999 override_visibility.
14000 * testsuite/ver_test_1.sh: New file.
14001 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14002 (check_DATA): Add ver_test_1.syms.
14003 (ver_test_1.syms): New target.
14004 * testsuite/Makefile.in: Rebuild.
14006 2009-02-25 Cary Coutant <ccoutant@google.com>
14008 * layout.cc (Layout::choose_output_section): Don't rename sections
14009 when using a linker script that has a SECTIONS clause.
14010 * Makefile.in: Regenerate.
14012 * testsuite/Makefile.am (script_test_5.sh): New test case.
14013 * testsuite/Makefile.in: Regenerate.
14014 * testsuite/script_test_5.cc: New file.
14015 * testsuite/script_test_5.sh: New file.
14016 * testsuite/script_test_5.t: New file.
14018 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
14020 * archive.cc (Archive::include_member): Update calls to add_symbols.
14021 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14022 the Layout argument.
14023 * dynobj.h (do_add_symbols): Add the Layout argument.
14024 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14026 * object.h (Object::add_symbols): Add the Layout argument.
14027 (Object::do_add_symbols): Add the Layout argument.
14028 (Sized_relobj::do_add_symbols): Add the Layout argument.
14029 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14030 Unify the two versions.
14031 (Add_plugin_symbols): Remove.
14032 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14033 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14034 (Add_plugin_symbols): Remove.
14035 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14036 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14037 (Add_symbols::run): Make it work with Pulginobj.
14039 2009-02-06 Ian Lance Taylor <iant@google.com>
14041 * object.cc (Sized_relobj::do_layout): Make info message start
14042 with lower case letter.
14044 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14046 * binary.cc: Fix file comment.
14048 * options.h (enum Incremental_disposition): Define.
14049 (class General_options): Add new options: --incremental,
14050 --incremental_changed, --incremental_unchanged,
14051 --incremental_unknown. Add incremental_disposition_ and
14052 implicit_incremental_ fields.
14053 (General_options::incremental_disposition): New function.
14054 (class Position_dependent_options): Add incremental_disposition
14056 (Position_dependent_options::copy_from_options): Set incremental
14058 * options.cc (General_options::parse_incremental_changed): New
14060 (General_options::parse_incremental_unchanged): New function.
14061 (General_options::parse_incremental_unknown): New function.
14062 (General_options::General_options): Initialize new fields
14063 incremental_disposition_ and implicit_incremental_.
14064 (General_options::finalize): Check for uasge of --incremental-*
14065 without --incremental.
14067 2009-02-06 Chris Demetriou <cgd@google.com>
14069 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14070 pointer and to report location as the file name associated with
14072 (gold_undefined_symbol_at_location): New function to replace the
14073 old gold_undefined_symbol functionality.
14074 * target-reloc.h (relocate_section): Update to use
14075 gold_undefined_symbol_at_location.
14076 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14077 Call gold_undefined_symbol function rather than gold_error.
14078 * errors.h (Errors::undefined_symbol): Take location as a
14079 string, rather than calculating it from a relocation.
14080 * errors.cc (Errors::fatal): Print "fatal error:" before the
14082 (Errors::error, Errors::error_at_location): Print "error: "
14083 before the formatted message.
14084 (Errors::undefined_symbol): Take location as a string, rather
14085 than calculating it from a relocation.
14086 (gold_undefined_symbol_at_location): New function akin to
14087 old gold_undefined_symbol, calculates location from relocation.
14088 (gold_undefined_symbol): Change to take only a Symbol pointer
14089 and to report location as the file name associated with the symbol.
14090 * testsuite/debug_msg.sh: Update for changed error messages.
14091 * testsuite/undef_symbol.sh: Likewise.
14093 2009-02-04 Duncan Sands <baldrick@free.fr>
14096 * reduced_debug_output.h
14097 (Output_reduced_debug_abbrev_section::failed): Use format for
14099 (Output_reduced_debug_info_section::faild): Likewise.
14101 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14103 * script.cc (Lazy_demangler): New class.
14104 (Version_script_info::get_symbol_version_helper): Demangle a
14107 2009-01-29 Cary Coutant <ccoutant@google.com>
14109 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14111 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14113 2009-01-28 Ian Lance Taylor <iant@google.com>
14115 * version.cc (version_string): Bump to 1.9.
14117 * gold.h: Include <cstring> and <stdint.h>.
14118 * version.cc: Include <cstdio>.
14119 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14121 * reduced_debug_output.cc (insert_into_vector): Rename from
14122 Insert_into_vector; change all callers. Use Swap_unaligned to
14123 avoid aliasing issue; remove union since it is unnecessary.
14125 2009-01-27 Sriraman Tallam <tmsriram@google.com>
14127 * Makefile.am (CCFILES): Add gc.cc.
14128 (HFILES): Add gc.h.
14129 * Makefile.in: Regenerate.
14130 * gold.cc (Gc_runner): New class.
14131 (queue_initial_tasks): Call garbage collection related tasks
14132 when corresponding options are invoked.
14133 (queue_middle_gc_tasks): New function.
14134 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14135 processed early before laying out sections during garbage collection.
14136 * gold.h (queue_middle_gc_tasks): New function.
14137 (is_prefix_of): Move from "layout.cc".
14138 * i386.cc (Target_i386::gc_process_relocs): New function.
14139 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14140 * main.cc (main): Create object of class "Garbage_collection".
14141 * object.cc (Relobj::copy_symbols_data): New function.
14142 (Relobj::is_section_name_included): New function.
14143 (Sized_relobj::do_layout): Allow this function to be called twice
14144 during garbage collection and defer layout of section during the
14146 * object.h (Relobj::get_symbols_data): New function.
14147 (Relobj::is_section_name_included): New function.
14148 (Relobj::copy_symbols_data): New function.
14149 (Relobj::set_symbols_data): New function.
14150 (Relobj::get_relocs_data): New function.
14151 (Relobj::set_relocs_data): New function.
14152 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14153 (Relobj::gc_process_relocs): New function.
14154 (Relobj::do_gc_process_relocs): New pure virtual function.
14155 (Relobj::sd_): New data member.
14156 (Sized_relobj::is_output_section_offset_invalid): New function.
14157 (Sized_relobj::do_gc_process_relocs): New function.
14158 * options.h (General_options::gc_sections): Modify to not be a no-op.
14159 (General_options::print_gc_sections): New option.
14160 * plugin.cc (Plugin_finish::run): Remove function call to
14161 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14162 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14163 * reloc.cc (Read_relocs::run): Add task to process relocs and
14164 determine unreferenced sections when doing garbage collection.
14165 (Gc_process_relocs): New class.
14166 (Sized_relobj::do_gc_process_relocs): New function.
14167 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14168 sections that are garbage collected.
14169 * reloc.h (Gc_process_relocs): New class.
14170 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14171 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14172 symbols whose corresponding sections are garbage collected.
14173 (Symbol_table::Symbol_table): Add new parameter for the garbage
14175 (Symbol_table::gc_mark_undef_symbols): New function.
14176 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14177 (Symbol_table::gc_mark_dyn_syms): New function.
14178 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14180 (Symbol_table::add_from_object): Likewise.
14181 (Symbol_table::add_from_relobj): When building shared objects, do not
14182 treat externally visible symbols as garbage.
14183 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14184 table information for static and relocatable links.
14185 * symtab.h (Symbol_table::set_gc): New function.
14186 (Symbol_table::gc): New function.
14187 (Symbol_table::gc_mark_undef_symbols): New function.
14188 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14189 (Symbol_table::gc_mark_dyn_syms): New function.
14190 (Symbol_table::gc_): New data member.
14191 * target.h (Sized_target::gc_process_relocs): New pure virtual
14193 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14194 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14196 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14198 * options.h (General_options::gc_sections): Define as a no-op for now.
14199 (General_options::no_keep_memory): Ditto.
14200 (General_options::Bshareable): Define.
14201 * options.cc (General_options::finalize): Honor -Bshareable.
14203 2009-01-20 Andreas Schwab <schwab@suse.de>
14205 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14206 read the value in the contents, since we don't use it. Use the
14207 template endianness when writing.
14208 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14210 2009-01-19 Andreas Schwab <schwab@suse.de>
14212 * configure.tgt (powerpc64-*): Fix targ_obj.
14214 2009-01-15 Ian Lance Taylor <iant@google.com>
14216 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14217 local symbols when stripping all symbols.
14219 2009-01-14 Cary Coutant <ccoutant@google.com>
14221 * output.cc (Output_reloc): Add explicit instantiations.
14223 2009-01-14 Cary Coutant <ccoutant@google.com>
14225 * archive.cc (Archive::get_elf_object_for_member): Remove call
14226 to File_read::claim_for_plugin.
14227 * descriptors.cc (Descriptors::open): Remove reference to
14229 (Descriptors::claim_for_plugin): Remove.
14230 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14231 (Descriptors::is_claimed): Remove.
14232 (claim_descriptor_for_plugin): Remove.
14233 * fileread.cc (File_read::claim_for_plugin): Remove.
14234 * fileread.h (File_read::claim_for_plugin): Remove.
14235 (File_read::descriptor): Reopen descriptor if necessary.
14236 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14237 (Plugin_manager::all_symbols_read): Add task parameter. Change
14239 (Plugin_manager::get_input_file): New function.
14240 (Plugin_manager::release_input_file): New function.
14241 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14242 corresponding data member.
14243 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14244 and pass to base constructor. Change all callers.
14245 (get_input_file, release_input_file): New functions.
14246 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14247 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14248 (Plugin_manager::all_symbols_read): Add task parameter.
14249 (Plugin_manager::get_input_file): New function.
14250 (Plugin_manager::release_input_file): New function.
14251 (Plugin_manager::task_): New data member.
14252 (Pluginobj::Pluginobj): Add filesize parameter.
14253 (Pluginobj::filename): New function.
14254 (Pluginobj::descriptor): New function.
14255 (Pluginobj::filesize): New function.
14256 (Pluginobj::filesize_): New data member.
14257 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14258 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14259 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14261 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14262 with archive libraries.
14263 * testsuite/Makefile.in: Regenerate.
14264 * testsuite/plugin_test.c (struct sym_info): New type.
14265 (get_input_file, release_input_file): New static variables.
14266 (onload): Capture new transfer vector entries.
14267 (claim_file_hook): Stop reading at end of file according to filesize.
14268 Factor out parsing of readelf output into separate function.
14269 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14270 APIs and get the source file name from the symbol table. Convert
14271 source file name to corresponding object file name. Print info
14272 message when adding new input files.
14273 (parse_readelf_line): New function.
14274 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14275 * testsuite/plugin_test_2.sh: Likewise.
14276 * testsuite/plugin_test_3.sh: Likewise.
14277 * testsuite/plugin_test_4.sh: New test case.
14279 2009-01-07 Ian Lance Taylor <iant@google.com>
14281 * version.cc (version_string): Bump to 1.8.
14283 2008-12-23 Cary Coutant <ccoutant@google.com>
14285 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14286 * plugin.cc (Plugin_manager::finish): Rename as
14287 layout_deferred_objects. Move cleanup to separate function.
14288 (Plugin_manager::cleanup): New function.
14289 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14291 * plugin.h (Plugin_manager::finish): Rename as
14292 layout_deferred_objects.
14293 (Plugin_manager::cleanup): New function.
14294 (Plugin_manager::cleanup_done): New field.
14296 2008-12-23 Cary Coutant <ccoutant@google.com>
14298 * plugin.cc (is_visible_from_outside): New function.
14299 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14300 so we don't return "IR only" status for exported symbols or -r links.
14302 * testsuite/Makefile.am (plugin_test_3): New test case.
14303 * testsuite/Makefile.in: Regenerate.
14304 * testsuite/plugin_test_3.sh: New file.
14306 2008-12-22 Cary Coutant <ccoutant@google.com>
14308 * object.cc (Sized_relobj::layout_section): New function.
14309 (Sized_relobj::do_layout): Defer layout of input sections until after
14310 plugin has provided replacement files.
14311 (Sized_relobj::do_layout_deferred_sections): New function.
14312 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14313 (Relobj::layout_deferred_sections): New function.
14314 (Relobj::do_layout_deferred_sections): New function.
14315 (Sized_relobj::do_layout_deferred_sections): New function.
14316 (Sized_relobj::layout_section): New function.
14317 (Sized_relobj::Deferred_layout): New structure.
14318 (Sized_relobj::deferred_layout_): New field.
14319 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14320 Change all callers. Layout deferred sections.
14321 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14323 (Plugin_hook::run): Move code from do_plugin_hook inline.
14324 (Plugin_hook::do_plugin_hook): Remove.
14325 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14326 (Plugin_manager::finish): Renamed, was cleanup.
14327 (Plugin_manager::should_defer_layout): New function.
14328 (Plugin_manager::add_deferred_layout_object): New function.
14329 (Plugin_manager::Deferred_layout_list): New type.
14330 (Plugin_manager::deferred_layout_objects_): New field.
14331 (Plugin_hook::do_plugin_hook): Remove.
14333 2008-12-17 Ian Lance Taylor <iant@google.com>
14335 * options.h (class General_options): Add --no case for
14338 2008-12-16 Cary Coutant <ccoutant@google.com>
14340 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14342 (Plugin_manager::claim_file): Create plugin object even if
14343 plugin did not call the add_symbols callback.
14344 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14345 asking for more symbols than were added.
14346 * testsuite/Makefile.am (plugin_test_1): Add test case with
14348 (empty.syms): New target.
14349 * testsuite/Makefile.in: Regenerate.
14350 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14351 message. Don't call add_symbols if no globals.
14352 (all_symbols_read_hook): Don't provide replacement for empty
14355 2008-12-12 Ian Lance Taylor <iant@google.com>
14357 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14358 r_type == 0 for a local symbol with r_sym == 0.
14359 (scan_relocatable_relocs): Pass r_sym to
14360 local_non_section_strategy.
14361 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14364 * configure.ac: Update test for TLS descriptors: they are
14365 supported as of glibc 2.9.
14366 * configure: Rebuild.
14368 2008-12-11 Ian Lance Taylor <iant@google.com>
14371 * target-reloc.h (Default_scan_relocatable_relocs): For each
14372 function, map r_type == 0 to RELOC_DISCARD.
14374 2008-12-10 Cary Coutant <ccoutant@google.com>
14376 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14377 object to override a kept COMDAT group from a plugin object.
14379 2008-12-09 Ian Lance Taylor <iant@google.com>
14382 * yyscript.y (file_cmd): Handle INPUT.
14384 * testsuite/initpri1.c: Change all declarations to be full
14385 prototypes by adding void, to avoid compiler warnings.
14387 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
14389 * options.cc (General_options::parse_plugin_opt): New.
14390 (General_options::add_plugin): The argument now is just the filename.
14391 (General_options::add_plugin_option): New.
14392 * options.h (plugin_opt): New.
14393 (add_plugin): Change argument name.
14394 (add_plugin_option): New.
14395 * plugin.cc (Plugin::load): Don't parse the plugin option.
14396 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14397 (Plugin::add_option): New.
14398 (Plugin::args_): Change type.
14399 (Plugin::filename_): New.
14400 (Plugin_manager::add_plugin_option): New.
14401 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14402 * testsuite/Makefile.in: Regenerate.
14404 2008-12-05 Cary Coutant <ccoutant@google.com>
14406 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14407 Handle --strip-lto-sections option.
14408 * options.h (strip_lto_sections): New option.
14410 2008-12-01 Cary Coutant <ccoutant@google.com>
14412 * plugin.cc (ld_plugin_message): Change format parameter to const.
14413 Fix mismatch between new[] and delete.
14415 2008-11-14 Cary Coutant <ccoutant@google.com>
14417 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14420 2008-11-05 Craig Silverstein <csilvers@google.com>
14422 * options.cc (General_options::parse_dynamic_list): New function.
14423 * options.h (General_options): New flags dynamic_list,
14424 dynamic_list_data, dynamic_list_cpp_new, and
14425 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14426 (General_options::in_dynamic_list): New function.
14427 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14428 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14429 (Lex::can_continue_name): Likewise.
14431 (read_script_file): New parameter script_options.
14432 (read_dynamic_list): New function.
14433 (Script_options::define_dynamic_list): New function.
14434 (dynamic_list_keyword_parsecodes): New variable.
14435 (dynamic_list_keywords): New variable.
14436 * script.h (Script_options::define_dynamic_list): New function
14438 (read_dynamic_list): New function prototype.
14439 * symtab.cc (strprefix): New macro.
14440 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14441 dynamic_list_data, dynamic_list_cpp_new, and
14442 dynamic_list_cpp_typeinfo.
14443 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14444 (dynamic_list_expr): New rule.
14445 (dynamic_list_nodes): Likewise.
14446 (dynamic_list_node): Likewise.
14447 * testsuite/Makefile.am (dynamic_list): New test.
14448 * testsuite/Makefile.in: Regenerated.
14449 * testsuite/dynamic_list.t: New file.
14450 * testsuite/dynamic_list.sh: New file.
14452 2008-11-05 Craig Silverstein <csilvers@google.com>
14454 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14455 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14456 (t11_last): Likewise.
14457 * testsuite/ver_test_6.c (main): Likewise.
14459 2008-10-07 Cary Coutant <ccoutant@google.com>
14461 * options.c (General_options::finalize): Add check for -static and
14463 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14466 2008-10-02 Cary Coutant <ccoutant@google.com>
14468 * plugin.cc (make_sized_plugin_object): Fix conditional
14469 compilation to work when not all targets are enabled.
14471 2008-09-29 Cary Coutant <ccoutant@google.com>
14473 * archive.cc (Archive::get_file_and_offset): Use filename instead
14474 of name to get library path.
14475 (Archive::include_member): Unlock external member of a thin archive.
14477 * testsuite/Makefile.am (TEST_AR): New variable.
14478 (thin_archive_test_1): New test.
14479 (thin_archive_test_2): New test.
14480 * testsuite/Makefile.in: Regenerate.
14481 * testsuite/thin_archive_main.cc: New file.
14482 * testsuite/thin_archive_test_1.cc: New file.
14483 * testsuite/thin_archive_test_2.cc: New file.
14484 * testsuite/thin_archive_test_3.cc: New file.
14485 * testsuite/thin_archive_test_4.cc: New file.
14487 2008-09-29 Cary Coutant <ccoutant@google.com>
14489 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14490 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14492 (Sized_relobj::do_finalize_local_symbols): Likewise.
14493 (Sized_relobj::map_to_kept_section): Likewise.
14494 * object.h (Sized_relobj::invalid_address): New constant.
14495 (Sized_relobj::do_output_section_offset): Check for invalid_address
14497 * output.cc (Output_reloc::local_section_offset): Use constant
14498 invalid_address instead of -1U.
14499 (Output_reloc::get_address): Likewise.
14500 (Output_section::output_address): Change -1U to -1ULL.
14501 * output.h (Output_reloc::invalid_address): New constant.
14502 * reloc.cc (Sized_relobj::write_sections): Use constant
14503 invalid_address instead of -1U.
14504 (Sized_relobj::relocate_sections): Likewise.
14505 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14506 values for merge sections.
14507 * target-reloc.h (relocate_for_relocatable): Use constant
14508 invalid_address instead of -1U.
14510 2008-09-19 Cary Coutant <ccoutant@google.com>
14512 Add plugin functionality for link-time optimization (LTO).
14513 * configure.ac (plugins): Add --enable-plugins option.
14514 * configure: Regenerate.
14515 * config.in: Regenerate.
14516 * Makefile.am (LIBDL): New variable.
14517 (CCFILES): Add plugin.cc.
14518 (HFILES): Add plugin.h.
14519 (ldadd_var): Add LIBDL.
14520 * Makefile.in: Regenerate.
14522 * archive.cc: Include "plugin.h".
14523 (Archive::setup): Don't preread archive symbols when using a plugin.
14524 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14525 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14527 (Archive::include_member): Add symbols from plugin objects.
14528 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14529 * descriptors.cc (Descriptors::open): Check for file descriptors
14530 abandoned by plugins.
14531 (Descriptors::claim_for_plugin): New function.
14532 * descriptors.h (Descriptors::claim_for_plugin): New function.
14533 (Open_descriptor::is_claimed): New field.
14534 (claim_descriptor_for_plugin): New function.
14535 * fileread.cc (File_read::claim_for_plugin): New function.
14536 * fileread.h (File_read::claim_for_plugin): New function.
14537 (File_read::descriptor): New function.
14538 * gold.cc: Include "plugin.h".
14539 (queue_initial_tasks): Add task to call plugin hooks for generating
14541 * main.cc: Include "plugin.h".
14542 (main): Load plugin libraries.
14543 * object.h (Pluginobj): Declare.
14544 (Object::pluginobj): New function.
14545 (Object::do_pluginobj): New function.
14546 (Object::set_target): New function.
14547 * options.cc: Include "plugin.h".
14548 (General_options::parse_plugin): New function.
14549 (General_options::General_options): Initialize plugins_ field.
14550 (General_options::add_plugin): New function.
14551 * options.h (Plugin_manager): Declare.
14552 (General_options): Add --plugin option.
14553 (General_options::has_plugins): New function.
14554 (General_options::plugins): New function.
14555 (General_options::add_plugin): New function.
14556 (General_options::plugins_): New field.
14557 * plugin.cc: New file.
14558 * plugin.h: New file.
14559 * readsyms.cc: Include "plugin.h".
14560 (Read_symbols::do_read_symbols): Check for archive before checking
14561 for ELF file. Call plugin hooks to claim files.
14562 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14563 from a real object file; force override when processing replacement
14565 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14566 (Symbol::init_base_object): Likewise.
14567 (Symbol::init_base_output_data): Likewise.
14568 (Symbol::init_base_output_segment): Likewise.
14569 (Symbol::init_base_constant): Likewise.
14570 (Symbol::init_base_undefined): Likewise.
14571 (Symbol::output_section): Assert that object is not a plugin.
14572 (Symbol_table::add_from_pluginobj): New function.
14573 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14575 (Symbol_table::sized_write_globals): Likewise.
14576 (Symbol_table::add_from_pluginobj): Instantiate template.
14577 * symtab.h (Sized_pluginobj): Declare.
14578 (Symbol::in_real_elf): New function.
14579 (Symbol::set_in_real_elf): New function.
14580 (Symbol::in_real_elf_): New field.
14581 (Symbol_table::add_from_pluginobj): New function.
14583 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14584 (LIBDL): New variable.
14585 (LDADD): Add LIBDL.
14586 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14587 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14588 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14589 (MOSTLYCLEANFILES): Likewise.
14590 * testsuite/Makefile.in: Regenerate.
14591 * testsuite/plugin_test.c: New file.
14592 * testsuite/plugin_test_1.sh: New file.
14593 * testsuite/plugin_test_2.sh: New file.
14595 2008-09-16 Ian Lance Taylor <iant@google.com>
14597 * target-reloc.h (relocate_section): Check whether a symbol is
14598 defined by the ABI before reporting an undefined symbol error.
14599 * target.h (Target::is_defined_by_abi): Make parameter const.
14600 (Target::do_is_defined_by_abi): Likewise.
14601 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14602 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14603 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14604 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14605 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14606 * testsuite/Makefile.in: Rebuild.
14608 * fileread.cc (make_view): Add casts to avoid warning.
14610 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
14612 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14613 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14615 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
14617 * options.h (General_options::output_is_executable): New.
14618 (General_options::output_is_pie): New.
14619 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14620 for shared libraries.
14621 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14623 2008-09-11 Chris Demetriou <cgd@google.com>
14625 * options.h (origin): New -z option.
14626 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14627 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14630 2008-09-05 Cary Coutant <ccoutant@google.com>
14632 * fileread.cc (File_read::make_view): Add check for attempt to map
14633 beyond end of file.
14635 2008-09-05 Cary Coutant <ccoutant@google.com>
14637 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14638 explicit instantiations.
14640 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14643 * options.cc (General_options::finalize): Allow undefined symbols
14644 in shlibs if linking -shared.
14647 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14648 symbols as not needing a dynsym entry.
14650 2008-08-20 Craig Silverstein <csilvers@google.com>
14652 * fileread.cc (File_read::open): Do not lock the file unless it
14653 was successfully opened.
14655 2008-08-14 Cary Coutant <ccoutant@google.com>
14657 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14658 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14659 * testsuite/tls_test.cc (struct int128): 128-bit struct
14660 for testing TLS relocs with non-zero addend.
14661 (v12): New TLS variable.
14663 (t_last): Add check for v12.
14664 * testsuite/tls_test.h (t12): New function.
14665 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14667 2008-08-13 Ian Lance Taylor <iant@google.com>
14669 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14670 set tls_segment_ or relro_segment_.
14671 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14673 * output.h (Output_section::clear_is_relro): New function.
14674 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14675 sections specially even when output_data_ is empty.
14676 (Output_segment::maximum_alignment): When first section is relro,
14677 only force alignment for PT_LOAD segments.
14678 * script.cc (script_data_segment_align): New function.
14679 (script_data_segment_relro_end): New function.
14680 * script-c.h (script_data_segment_align): Declare.
14681 (script_data_segment_relro_end): Declare.
14682 * script-sections.h (class Script_sections): Declare
14683 data_segment_align and data_segment_relro_end. Add fields
14684 segment_align_index_ and saw_relro_end_.
14685 * script-sections.cc (class Sections_element): Add set_is_relro
14686 virtual function. Add new bool* parameter to place_orphan_here.
14687 Add get_output_section virtual function.
14688 (class Output_section_definition): Add set_is_relro. Add new
14689 bool* parameter to place_orphan_here. Add get_output_section.
14690 Add is_relro_ field.
14691 (Output_section_definition::Output_section_definition): Initialize
14692 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14693 and is_relro_ fields.
14694 (Output_section_definition::place_orphan_here): Add is_relro
14696 (Output_section_definition::set_section_addresses): Set relro for
14698 (Output_section_definition::alternate_constraint): Likewise.
14699 (class Orphan_output_section): Add new bool* parameter to
14700 place_orphan_here. Add get_output_section.
14701 (Orphan_output_section::place_orphan_here): Add is_relro
14703 (Script_sections::Script_sections): Initialize
14704 data_segment_align_index_ and saw_relro_end_.
14705 (Script_sections::data_segment_align): New function.
14706 (Script_sections::data_segment_relro_end): New function.
14707 (Script_sections::place_orphan): Set or clear is_relro.
14708 (Script_sections::set_section_addresses): Force alignment of first
14710 * yyscript.y (exp): Call script_data_segment_align and
14711 script_data_segment_relro_end.
14712 * testsuite/relro_script_test.t: New file.
14713 * testsuite/relro_test.cc (using_script): Declare.
14714 (t1, t2): Test using_script.
14715 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14716 (relro_script_test_SOURCES): Define.
14717 (relro_script_test_DEPENDENCIES): Define.
14718 (relro_script_test_LDFLAGS): Define.
14719 (relro_script_test_LDADD): Define.
14720 (relro_script_test.so): New target.
14721 * testsuite/Makefile.in: Rebuild.
14723 2008-08-06 Cary Coutant <ccoutant@google.com>
14725 * archive.cc (Archive::total_archives, Archive::total_members)
14726 (Archive::total_members_loaded): New variables.
14727 (Archive::setup): Add parameter. Add option to preread
14729 (Archive::read_armap): Add counter.
14730 (Archive::get_file_and_offset): New function.
14731 (Archive::get_elf_object_for_member): New function.
14732 (Archive::read_all_symbols): New function.
14733 (Archive::read_symbols): New function.
14734 (Archive::add_symbols): Add counters.
14735 (Archive::include_all_members): Use armap to find members if it's
14737 (Archive::include_member): Skip reading symbols if already read.
14738 Factored code into Archive::get_file_and_offset and
14739 Archive::get_elf_object_for_member. Changed call to
14740 Mapfile::report_include_archive_member.
14741 (Archive::print_stats): New function.
14742 * archive.h: Declare Object and Read_symbols_data classes.
14743 (Archive::Archive): Add initializers for new members.
14744 (Archive::setup): Add parameter.
14745 (Archive::print_stats): New function.
14746 (Archive::total_archives, Archive::total_members)
14747 (Archive::total_members_loaded): New variables.
14748 (Archive::get_file_and_offset): New function.
14749 (Archive::get_elf_object_for_member): New function.
14750 (Archive::read_all_symbols): New function.
14751 (Archive::read_symbols): New function.
14752 (Archive::Archive_member): New class.
14753 (Archive::members_): New member.
14754 (Archive::num_members_): New member.
14755 * main.cc: Include archive.h.
14756 (main): Call Archive::print_stats.
14757 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14758 archive parameter; member_name is now the fully-decorated name.
14759 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14760 * options.h: (General_options): Add --preread-archive-symbols option.
14761 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14764 2008-08-04 Ian Lance Taylor <iant@google.com>
14766 * symtab.h (Symbol::use_plt_offset): New function.
14767 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14768 * powerpc.cc (Relocate::relocate): Likewise.
14769 * sparc.cc (Relocate::relocate): Likewise.
14770 * x86_64.cc (Relocate::relocate): Likewise.
14771 * testsuite/weak_plt.sh: New test.
14772 * testsuite/weak_plt_main.cc: New test.
14773 * testsuite/weak_plt_shared.cc: New test.
14774 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14775 (check_PROGRAMS): Add weak_plt.
14776 (check_DATA): Add weak_plt_shared.so.
14777 (weak_plt_main_pic.o, weak_plt): New targets.
14778 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14779 * testsuite/Makefile.in: Rebuild.
14781 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14783 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14784 * testsuite/Makefile.in: Rebuild.
14786 2008-08-04 Alan Modra <amodra@bigpond.net.au>
14788 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14789 * Makefile.in: Regenerate.
14790 * po/POTFILES.in: Regenerate.
14792 2008-07-29 Ian Lance Taylor <iant@google.com>
14794 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14795 symbols before other symbols.
14796 * testsuite/script_test_2.cc (test_addr): Declare.
14797 (test_addr_alias): Declare.
14798 (main): Check that test_addr and test_addr_alias have the right
14800 * testsuite/script_test_2.t: Define test_addr_alias and
14803 2008-07-24 Ian Lance Taylor <iant@google.com>
14806 * descriptors.cc: New file.
14807 * descriptors.h: New file.
14808 * gold-threads.h (class Hold_optional_lock): New class.
14809 * fileread.cc: Include "descriptors.h".
14810 (File_read::~File_read): Release descriptor rather than closing
14812 (File_read::open) [file]: Call open_descriptor rather than open.
14813 Set is_descriptor_opened_.
14814 (File_read::open) [memory]: Assert that descriptor is not open.
14815 (File_read::reopen_descriptor): New function.
14816 (File_read::release): Release descriptor.
14817 (File_read::do_read): Make non-const. Reopen descriptor.
14818 (File_read::read): Make non-const.
14819 (File_read::make_view): Reopen descriptor.
14820 (File_read::do_readv): Likewise.
14821 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14822 Update declarations.
14823 * layout.cc: Include "descriptors.h".
14824 (Layout::create_build_id): Use open_descriptor rather than open.
14825 * output.cc: Include "descriptors.h".
14826 (Output_file::open): Use open_descriptor rather than open.
14827 * archive.cc (Archive::const_iterator): Change Archive to be
14829 (Archive::begin, Archive::end): Make non-const.
14830 (Archive::count_members): Likewise.
14831 * archive.h (class Archive): Update declarations.
14832 * object.h (Object::read): Make non-const.
14833 * Makefile.am (CCFILES): Add descriptors.cc.
14834 (HFILES): Add descriptors.h.
14835 * Makefile.in: Rebuild.
14838 * gold.h: Always include <clocale>. Add Solaris workarounds
14839 following code in binutils/sysdep.h.
14842 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14843 this->eh_frame_hdr_ is NULL before using it.
14845 * dynobj.cc (Versions::Versions): Update comment.
14847 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14848 the base version name.
14850 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14851 array size plus one.
14852 (Stringpool_template::set_string_offsets): Subtract one from key
14853 before using it as an array index.
14854 (Stringpool_template::get_offset_with_length): Likewise.
14855 (Stringpool_template::write_to_buffer): Likewise.
14856 * stringpool.h (Stringpool_template::get_offset_from_key):
14859 2008-07-23 Ian Lance Taylor <iant@google.com>
14862 * object.h (Merged_symbol_value::value): Do our best to handle a
14866 * script.cc (Version_script_info::get_versions): Don't add empty
14867 version tag to return value.
14868 (Version_script_info::get_symbol_version_helper): Change return
14869 type to bool. Add pversion parameter. Change all callers.
14870 (script_register_vers_node): Don't require a non-NULL tag.
14871 * script.h (class Version_script_info): Update declarations.
14872 (Version_script_info::get_symbol_version): Change return type to
14873 bool. Add version parameter. Change all callers.
14874 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14875 handling. Handle an empty version from a version script.
14876 (Symbol_table::define_special_symbol): Likewise.
14877 * testsuite/ver_test_10.script: New file.
14878 * testsuite/ver_test_10.sh: New file.
14879 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14880 (check_DATA): Add ver_test_10.syms.
14881 (ver_test_10.syms, ver_test_10.so): New target.
14882 * testsuite/Makefile.in: Rebuild.
14884 2008-07-23 Simon Baldwin <simonb@google.com>
14886 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14887 to zero for undefined symbols from dynamic libraries.
14889 2008-07-23 Ian Lance Taylor <iant@google.com>
14891 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14892 Change all callers.
14893 * symtab.h (class Symbol_table): Update declaration.
14894 * testsuite/ver_test_9.cc: New file.
14895 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14896 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14897 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14898 (ver_test_9.so, ver_test_9.o): New targets.
14899 * testsuite/Makefile.in: Rebuild.
14901 2008-07-22 Ian Lance Taylor <iant@google.com>
14903 * options.h (class General_options): Define --check-sections.
14904 * layout.cc (Layout::set_segment_offsets): Handle
14907 * options.h (class General_options): Define -n/--nmagic and
14909 * options.cc (General_options::finalize): For -n/--nmagic or
14910 -N/--omagic, set -static.
14911 * layout.cc (Layout::attach_allocated_section_to_segment): If
14912 -N/--omagic, don't put read-only and read-write sections in
14913 different segments.
14914 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14915 finding a read-only segment.
14916 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14917 don't set the minimum segment alignment to the common page size,
14918 and don't set the file offset to the address modulo the page size.
14919 * script-sections.cc (Script_sections::create_segments): If
14920 -n/--omagic, don't put read-only and read-write sections in
14921 different segments.
14923 * cref.cc: New file.
14924 * cref.h: New file.
14925 * options.h (class General_options): Add --print-symbol-counts.
14926 * main.cc (main): Issue defined symbol report if requested.
14927 * archive.cc (Archive::interpret_header): Make into a const member
14929 (Archive::add_symbols): Call Input_objects::archive_start and
14931 (Archive::const_iterator): Define new class.
14932 (Archive::begin, Archive::end): New functions.
14933 (Archive::include_all_members): Rewrite to use iterator.
14934 (Archive::count_members): New function.
14935 * archive.h (class Archive): Update declarations.
14936 (Archive::filename): New function.
14937 * object.cc: Include "cref.h".
14938 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14939 (Sized_relobj::do_get_global_symbol_counts): New function.
14940 (Input_objects::add_object): Add object to cross-referencer.
14941 (Input_objects::archive_start): New function.
14942 (Input_objects::archive_stop): New function.
14943 (Input_objects::print_symbol_counts): New function.
14944 * object.h: Declare Cref and Archive.
14945 (Object::get_global_symbol_counts): New function.
14946 (Object::do_get_global_symbol_counts): New pure virtual function.
14947 (class Sized_relobj): Add defined_count_ field. Update
14949 (class Input_objects): Add cref_ field. Update constructor.
14950 Update declarations.
14951 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14953 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14955 (Sized_dynobj::do_get_global_symbol_counts): New function.
14956 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14957 defined_count_. Update declarations. Define Symbols typedef.
14958 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14959 parameter. Change all callers.
14960 (Symbol_table::add_from_dynobj): Add sympointers and defined
14961 parameters. Change all callers.
14962 * symtab.h (class Symbol_table): Update declarations.
14963 * Makefile.am (CCFILES): Add cref.cc.
14964 (HFILES): Add cref.h.
14965 * Makefile.in: Rebuild.
14967 2008-07-22 Simon Baldwin <simonb@google.com>
14969 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14970 to zero when writing undefined symbols.
14972 2008-07-22 Ian Lance Taylor <iant@google.com>
14974 * output.cc (Output_section::add_input_section): Don't try to
14975 merge empty merge sections.
14977 2008-07-21 Craig Silverstein <csilvers@google.com>
14979 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14980 Include symbol version in error message.
14982 2008-07-20 Chris Demetriou <cgd@google.com>
14984 * configure.ac (gold_cv_c_random_seed): New configured variable.
14985 (RANDOM_SEED_CFLAGS): New substituted variable.
14986 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14987 * configure: Rebuild.
14988 * Makefile.in: Likewise.
14989 * testsuite/Makefile.in: Likewise.
14991 2008-07-18 Ian Lance Taylor <iant@google.com>
14993 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14994 where we see NAME/NULL and NAME/VERSION as separate symbols.
14995 * testsuite/ver_test_main.cc (main): Call t4.
14996 (t4, t4_2a): Define.
14997 * testsuite/ver_test_2.cc (t4_2): Define.
14998 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14999 * testsuite/ver_test_4.cc (t4_2a): Define.
15000 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15001 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15003 2008-07-17 Ian Lance Taylor <iant@google.com>
15005 * dynobj.cc (Versions::add_def): If we give an error about a
15006 missing version, go ahead and create the version anyhow.
15008 2008-07-10 Ian Lance Taylor <iant@google.com>
15010 Handle output sections with more than 0x7fffffff bytes.
15011 * object.h (class Relobj): Change map_to_output_ to
15012 output_sections_, and just keep a section pointer. Change all
15013 uses. Move comdat group support to Sized_relobj.
15014 (Relobj::is_section_specially_mapped): Remove.
15015 (Relobj::output_section): Remove poff parameter. Change all
15017 (Relobj::output_section_offset): New function.
15018 (Relobj::set_section_offset): Rewrite.
15019 (Relobj::map_to_output): Remove.
15020 (Relobj::output_sections): New function.
15021 (Relobj::do_output_section_offset): New pure virtual function.
15022 (Relobj::do_set_section_offset): Likewise.
15023 (class Sized_relobj): Add section_offsets_ field. Add comdat
15024 group support from Relobj. Update declarations.
15025 (Sized_relobj::get_output_section_offset): New function.
15026 (Sized_relobj::do_output_section_offset): New function.
15027 (Sized_relobj::do_set_section_offset): New function.
15028 * object.cc (Relobj::output_section_address): Remove.
15029 (Sized_relobj::Sized_relobj): Initialize new fields.
15030 (Sized_relobj::include_section_group): Cast find_kept_object to
15032 (Sized_relobj::include_linkonce_section): Likewise.
15033 (Sized_relobj::do_layout): Use separate arrays for output section
15035 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15037 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15038 output_sections and section_offsets.
15039 (Sized_relobj::write_local_symbols): Likewise.
15040 (map_to_kept_section): Compute output address directly.
15041 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15042 output_sections and section_offsets.
15043 (Sized_relobj::write_sections): Likewise.
15044 (Sized_relobj::relocate_sections): Likewise.
15045 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15046 * output.h (class Output_reloc): Update declarations. Change
15047 u2_.relobj to Sized_relobj*.
15048 (class Output_data_reloc): Change add functions to use
15050 * output.cc (Output_reloc::Output_reloc): Change relobj to
15052 (Output_reloc::local_section_offset): Change return type to
15053 Elf_Addr. Use get_output_section_offset.
15054 (Output_reloc::get_address): Likewise.
15055 (Output_section::is_input_address_mapped): Don't call
15056 is_section_specially_mapped.
15057 (Output_section::output_offset): Likewise.
15058 (Output_section::output_address): Likewise.
15059 (Output_section::starting_output_address): Likewise.
15060 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15061 parameter to Sized_relobj*.
15062 (Copy_relocs::need_copy_reloc): Likewise.
15063 (Copy_relocs::save): Likewise.
15064 * copy-relocs.h (class Copy_relocs): Update declarations.
15065 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15066 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15067 * target-reloc.h (relocate_for_relocatable): Change
15068 offset_in_output_section type to Elf_Addr. Change code that uses
15070 * layout.cc (Layout::layout): Always set *off.
15071 * mapfile.cc (Mapfile::print_input_section): Use
15072 output_section_offset.
15073 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15075 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15076 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15077 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15079 2008-07-03 Ian Lance Taylor <iant@google.com>
15081 * layout.cc (Layout::include_section): Do not discard unrecognized
15082 SHT_STRTAB sections.
15084 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15086 * script.cc (Lex::can_continue_name): Make '?' allowable in
15087 version-script names.
15088 * testsuite/version_script.map: Change glob pattern to use '?'
15090 2008-06-30 Manish Singh <yosh@gimp.org>
15093 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15096 2008-06-30 Ian Lance Taylor <iant@google.com>
15100 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15101 versions]: Don't try to read the value in the contents, since we
15102 don't use it. Use the template endianness when writing.
15104 2008-06-25 Cary Coutant <ccoutant@google.com>
15106 * fileread.cc (File_read::make_view): Assert on zero-length view.
15107 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15108 symbol table when there are no symbols to read.
15110 2008-06-23 Craig Silverstein <csilvers@google.com>
15112 * version.cc (version_string): Bump to 1.7
15114 2008-06-18 Craig Silverstein <csilvers@google.com>
15116 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15117 constant 0xFFFF to type Valtype.
15118 (Powerpc_relocate_functions::rel16_ha): Likewise.
15120 2008-06-17 Ian Lance Taylor <iant@google.com>
15122 * output.h (Output_section::Input_section): Initialize p2align_ to
15123 zero for Output_section_data constructors.
15124 (Output_section::Input_section::addralign): If not an input
15125 section, return the alignment of the Output_section_data.
15126 * testsuite/copy_test.cc: New file.
15127 * testsuite/copy_test_1.cc: New file.
15128 * testsuite/copy_test_2.cc: New file.
15129 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15130 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15131 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15132 (copy_test_1_pic.o, copy_test_1.so): New targets.
15133 (copy_test_2_pic.o, copy_test_2.so): New targets.
15134 * testsuite/Makefile.in: Rebuild.
15136 * script-sections.cc (Script_sections::place_orphan): Initialize
15137 local variable exact.
15139 2008-06-13 David Edelsohn <edelsohn@gnu.org>
15141 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15143 2008-06-12 David Edelsohn <edelsohn@gnu.org>
15144 David S. Miller <davem@davemloft.net>
15146 * powerpc.cc: New file.
15147 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15148 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15149 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15150 * Makefile.in: Rebuild.
15152 2008-06-09 Ian Lance Taylor <iant@google.com>
15154 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15156 (throwing, orig_terminate): New static variables.
15157 (terminate_handler): New static function.
15158 (t2): Set terminate handler.
15160 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15163 * binary.cc (Binary_to_elf::sized_convert): Fix .data
15166 2008-05-30 Cary Coutant <ccoutant@google.com>
15168 * archive.cc (Archive::include_all_members) Correct to step
15169 over symbol table and extended name table in thin archives.
15171 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15174 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15177 2008-05-28 Caleb Howe <cshowe@google.com>
15179 * reduced_debug_output.cc: New file.
15180 * reduced_debug_output.h: New file.
15181 * options.h (class General_options): Add --strip-debug-non-line.
15182 * options.cc (General_options::finalize): Add strip_debug_non_line
15183 to the strip heirarchy.
15184 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15186 * layout.cc: Include "reduced_debug_output.h".
15187 (Layout::Layout): Initialize new fields.
15188 (line_only_debug_sections): New static array.
15189 (is_lines_only_debug_sections): New static inline function.
15190 (Layout::include_section): Handle --strip-debug-non-line.
15191 (Layout::make_output_section): If --strip-debug-non-line, build
15192 new output sections for .debug_abbrev and .debug_info.
15193 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15194 gold. Warn about possible overflow.
15195 (read_signed_LEB_128): Likewise.
15196 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15197 (read_signed_LEB_128): Declare.
15198 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15199 (HFILES): Add reduced_debug_output.h.
15200 * Makefile.in: Rebuild.
15202 2008-05-21 Ian Lance Taylor <iant@google.com>
15204 * mapfile.cc: New file.
15205 * mapfile.h: New file.
15206 * options.h (class General_options): Add -M/--print-map and -Map.
15207 * options.cc (General_options::finalize): Make -M equivalent to
15209 * main.cc: Include <cstdio> and "mapfile.h".
15210 (main): Open mapfile if requested.
15211 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15212 constructor. Change caller.
15213 (queue_initial_tasks): Add mapfile parameter. Change caller.
15214 (queue_middle_tasks): Likewise.
15215 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15217 * archive.cc: Include "mapfile.h".
15218 (Archive::add_symbols): Add mapfile parameter. Change all
15219 callers. Pass mapfile, symbol, and reason to include_member.
15220 (Archive::include_all_members): Add mapfile parameter. Change all
15222 (Archive::include_member): Add mapfile, sym, and why parameters.
15223 Change all callers. Report inclusion to map file.
15224 * archive.h: Include "fileread.h".
15225 (class Archive): Update declarations.
15226 (Archive::file): New const method.
15227 (class Add_archive_symbols): Add mapfile_ field. Update
15228 constructor. Change all callers.
15229 * readsyms.h (class Read_symbols): Likewise.
15230 (class Finish_group): Likewise.
15231 (class Read_script): Likewise.
15232 * common.cc: Include "mapfile.h".
15233 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15235 (Symbol_table::do_allocate_commons): Likewise.
15236 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15237 symbol allocation to mapfile.
15238 * common.h (class Allocate_commons_task): Add mapfile_ field.
15239 Update constructor. Change all callers.
15240 * symtab.h (class Symbol_table): Update declarations.
15241 * layout.cc: Include "mapfile.h".
15242 (Layout_task_runner::run): Print information to mapfile.
15243 (Layout::create_gold_note): Change Output_data_fixed_space to
15244 Output_data_zero_fill.
15245 (Layout::create_build_id): Likewise.
15246 (Layout::print_to_mapfile): New function.
15247 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15248 constructor. Change caller.
15249 (class Layout): Declare print_to_mapfile.
15250 * output.cc (Output_section::Input_section::print_to_mapfile): New
15252 (Output_section::add_input_section): If producing a map, always
15253 add to input_sections_ list.
15254 (Output_section::do_print_to_mapfile): New function.
15255 (Output_segment::print_sections_to_mapfile): New function.
15256 (Output_segment::print_section_list_to_mapfile): New function.
15257 * output.h: Include "mapfile.h".
15258 (Output_data::print_to_mapfile): New function.
15259 (Output_data::do_print_to_mapfile): New virtual function.
15260 (Output_segment_headers::do_print_to_mapfile): New function.
15261 (Output_file_header::do_print_to_mapfile): New function.
15262 (Output_data_const::do_print_to_mapfile): New function.
15263 (class Output_data_const_buffer): Add map_name_ field. Update
15264 constructor. Change all callers. Add do_print_to_mapfile
15266 (class Output_data_fixed_space): Likewise.
15267 (class Output_data_space): Likewise.
15268 (class Output_data_zero_fill): New class.
15269 (Output_data_strtab::do_print_to_mapfile): New function.
15270 (Output_data_reloc_base::do_print_to_mapfile): New function.
15271 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15272 (Output_data_group::do_print_to_mapfile): New function.
15273 (Output_data_got::do_print_to_mapfile): New function.
15274 (Output_data_dynamic::do_print_to_mapfile): New function.
15275 (Output_symtab_xindex::do_print_to_mapfile): New function.
15276 (class Output_section): Declare do_print_to_mapflie. Declare
15277 print_to_mapfile in Input_section.
15278 (class Output_segment): Declare new functions.
15279 * object.h (Sized_relobj::symbol_count): New function.
15280 * script-sections.cc
15281 (Output_section_element_dot_assignment::set_section_addresses):
15282 Change Output_data_fixed_space to Output_data_zero_fill.
15283 (Output_data_expression::do_print_to_mapfile): New function.
15284 * script.cc (read_input_script): Add mapfile parameter. Change
15286 * script.h (read_input_script): Update declaration.
15287 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15288 (Eh_frame::do_print_to_mapfile): New function.
15289 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15290 (Output_merge_string::do_print_to_mapfile): New function.
15291 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15293 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15295 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15297 * Makefile.am (CCFILES): Add mapfile.cc.
15298 (HFILES): Add mapfile.h.
15299 * Makefile.in: Rebuild.
15301 2008-05-19 Ian Lance Taylor <iant@google.com>
15303 * options.h (class General_options): Add -z relro.
15304 * layout.cc (Layout::Layout): Initialize relro_segment_.
15305 (Layout::add_output_section_data): Return the output section.
15306 (Layout::make_output_section): Rcognize relro sections and mark
15307 them appropriately.
15308 (Layout::attach_allocated_section_to_segment): Put relro sections
15309 in a PT_GNU_RELRO segment.
15310 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15312 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15314 (Layout::linkonce_mapping): Map d.rel.ro.local to
15315 .data.rel.ro.local.
15316 (Layout::output_section_name): Us .data.rel.ro.local for any
15317 section which begins with that.
15318 * layout.h (class Layout): Update add_output_section_data
15319 declaration. Add relro_segment_ field.
15320 * output.cc (Output_section::Output_section): Initialize is_relro_
15321 and is_relro_local_ fields.
15322 (Output_segment::add_output_section): Group relro sections.
15323 (Output_segment::is_first_section_relro): New function.
15324 (Output_segment::maximum_alignment): If there is a relro section,
15325 align the segment to the common page size.
15326 (Output_segment::set_section_addresses): Track whether we are
15327 looking at relro sections. If the last section is a relro
15328 section, align to the common page size.
15329 (Output_segment::set_section_list_addresses): Add in_relro
15330 parameter. Change all callers. Align to the page size when
15331 moving from relro to non-relro section.
15332 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15334 * output.h (class Output_section): Add is_relro_ and
15335 is_relro_local_ fields.
15336 (Output_section::is_relro): New function.
15337 (Output_section::set_is_relro): New function.
15338 (Output_section::is_relro_local): New function.
15339 (Output_section::set_is_relro_local): New function.
15340 (class Output_segment): Update declarations.
15341 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15342 * sparc.cc (Target_sparc::got_section): Likewise.
15343 * x86_64.cc (Target_x86_64::got_section): Likewise.
15344 * testsuite/relro_test_main.cc: New file.
15345 * testsuite/relro_test.cc: New file.
15346 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15347 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15348 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15349 (relro_test.so, relro_test_pic.o): New targets.
15350 * testsuite/Makefile.in: Rebuild.
15352 2008-05-16 Ian Lance Taylor <iant@google.com>
15354 * output.cc (Output_segment::add_output_section): Remove front
15356 * output.h (class Output_segment): Remove
15357 add_initial_output_section and overloaded add_output_section.
15358 Update declaration of remaining add_output_section.
15359 * layout.cc (Layout::create_interp): Call add_output_section
15360 rather than add_initial_output_section.
15361 (Layout::finish_dynamic_section): Likewise.
15363 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15364 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15365 know the dynamic type.
15366 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15367 field. Initialize it in constructor.
15368 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15369 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15370 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15373 * output.cc (Output_reloc::get_address): Change return type to
15375 * output.h (class Output_reloc): Update get_address declaration.
15376 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15377 for section addresses.
15379 2008-05-09 Ian Lance Taylor <iant@google.com>
15382 * gold.cc (gold_nomem): Use return value of write.
15384 2008-05-08 Ian Lance Taylor <iant@google.com>
15386 * symtab.c (Symbol::init_base_output_data): Add version
15387 parameter. Change all callers.
15388 (Symbol::init_base_output_segment): Likewise.
15389 (Symbol::init_base_constant): Likewise.
15390 (Symbol::init_base_undefined): Likewise.
15391 (Sized_symbol::init_output_data): Likewise.
15392 (Sized_symbol::init_output_segment): Likewise.
15393 (Sized_symbol::init_constant): Likewise.
15394 (Sized_symbol::init_undefined): Likewise.
15395 (Symbol_table::do_define_in_output_data): If the new symbol has a
15396 version, mark it as the default.
15397 (Symbol_table::do_define_in_output_segment): Likewise.
15398 (Symbol_table::do_define_as_constant): Likewise.
15399 * symtab.h (class Symbol): Update declarations.
15400 (class Sized_symbol): Likewise.
15401 * resolve.cc (Symbol::override_version): New function.
15402 (Symbol::override_base): Call override_version.
15403 (Symbol::override_base_with_special): Likewise.
15404 * testsuite/ver_script_8.script: New file.
15405 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15406 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15407 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15408 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15410 2008-05-06 Ian Lance Taylor <iant@google.com>
15413 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15415 (class General_options): Remove existing --undefined, and add
15416 --no-undefined instead. Add new --undefined as synonym for -u.
15417 * archive.cc (Archive::add_symbols): Check whether symbol was
15419 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15420 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15421 all uses. Add IS_UNDEFINED. Update declarations to split
15422 different versions of init_base. Declare init_base_undefined.
15423 (Symbol::is_defined): Handle IS_UNDEFINED.
15424 (Symbol::is_undefined): Likewise.
15425 (Symbol::is_weak_undefined): Call is_undefined.
15426 (Symbol::is_absolute): Handle IS_CONSTANT.
15427 (class Sized_symbol): Update declarations to split different
15428 versions of init. Declare init_undefined.
15429 (class Symbol_table): Declare new functions.
15430 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15431 Change all callers.
15432 (Symbol::init_base_output_data): Likewise.
15433 (Symbol::init_base_output_segment): Likewise.
15434 (Symbol::init_base_constant): Likewise.
15435 (Symbol::init_base_undefined): New function.
15436 (Sized_symbol::init_object): Rename from init. Change all
15438 (Sized_symbol::init_output_data): Likewise.
15439 (Sized_symbol::init_output_segment): Likewise.
15440 (Sized_symbol::init_constant): Likewise.
15441 (Sized_symbol::init_undefined): New function.
15442 (Symbol_table::add_undefined_symbols_from_command_line): New
15444 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15446 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15447 (Symbol::output_section): Likewise.
15448 (Symbol::set_output_section): Likewise.
15449 (Symbol_table::sized_finalize_symbol): Likewise.
15450 (Symbol_table::sized_write_globals): Likewise.
15451 * resolve.cc (Symbol_table::should_override): Likewise.
15452 (Symbol::override_base_with_special): Likewise.
15454 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15455 symbol, change it to have default visibility.
15456 * testsuite/protected_1.cc: New file.
15457 * testsuite/protected_2.cc: New file.
15458 * testsuite/protected_3.cc: New file.
15459 * testsuite/protected_main_1.cc: New file.
15460 * testsuite/protected_main_2.cc: New file.
15461 * testsuite/protected_main_3.cc: New file.
15462 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15463 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15464 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15465 (protected_1.so): New target.
15466 (protected_1_pic.o, protected_2_pic.o): New targets.
15467 (protected_3_pic.o): New target.
15468 (check_PROGRAMS): Add protected_2.
15469 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15470 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15471 * testsuite/Makefile.in: Rebuild.
15473 * options.h (DEFINE_var): Add set_user_set_##varname__.
15474 (DEFINE_bool_alias): New macro.
15475 (class General_options): Define -Bstatic using DEFINE_bool_alias
15476 rather than DEFINE_special. Add --undefined as an alias for -z
15478 * options.cc (General_options::parse_Bstatic): Remove.
15480 * options.h (class General_options): Add --fatal-warnings.
15481 * main.cc (main): Implement --fatal-warnings.
15482 * errors.h (Errors::warning_count): New function.
15484 * options.h (class General_options): Add -Bsymbolic-functions.
15485 * symtab.h (Symbol::is_preemptible): Check for
15486 -Bsymbolic-functions.
15488 2008-05-05 Ian Lance Taylor <iant@google.com>
15490 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15491 as noVARNAME rather than no-VARNAME.
15492 (class General_options): Add option -z combreloc.
15493 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15495 (Output_reloc::sort_before) [SHT_REL]: New function.
15496 (Output_reloc::sort_before) [SHT_RELA]: New function.
15497 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15498 Sort_relocs_comparison.
15499 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15500 parameter. Change all callers.
15501 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15502 sort_relocs parameter. Change all callers.
15503 * output.cc (Output_reloc::get_address): New function, broken out
15505 (Output_reloc::write_rel): Call it.
15506 (Output_reloc::compare): New function.
15507 (Output_data_reloc_base::do_write): Optionally sort relocs.
15509 * configure.ac: If targ_extra_obj is set, link it in.
15510 * configure.tgt: Initialize all variables.
15511 (x86_64*): Set targ_extra_obj and targ_extra_size.
15512 * configure: Rebuild.
15514 * object.cc (Sized_relobj::include_section_group): Adjust section
15515 indexes read from group data. Build vector to pass to
15517 * layout.cc (Layout::layout_group): Add flags and shndxes
15518 parameters. Remove contents parameter. Change caller. Update
15519 explicit instantiations.
15520 * layout.h (class Layout): Update layout_group declaration.
15521 * output.cc (Output_data_group::Output_data_group): Add flags and
15522 input_shndxes parameters. Remove contents parameter. Change
15524 (Output_data_group::do_write): Change input_sections_ to
15526 * output.h (class Output_data_group): Update constructor
15527 declaration. Rename input_sections_ to input_shndxes_.
15528 * testsuite/many_sections_test.cc: Add template.
15530 2008-04-30 Cary Coutant <ccoutant@google.com>
15532 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15534 * layout.cc (Layout::include_section): Refactored check for debug
15536 (Layout::add_comdat): Add new parameters. Change type
15537 of signature parameter. Add object and shndx to signatures table.
15538 (Layout::find_kept_object): New function.
15539 * layout.h: Include <cstring>.
15540 (Layout::is_debug_info_section): New function.
15541 (Layout::add_comdat): Add new parameters.
15542 (Layout::find_kept_object): New function.
15543 (Layout::Kept_section): New struct.
15544 (Layout::Signatures): Change type of map range.
15545 * object.cc (Relobj::output_section_address): New function.
15546 (Sized_relobj::include_section_group): Add new parameters. Change
15547 calls to Layout::add_comdat. Change to build table of kept comdat
15548 groups and table mapping discarded sections to kept sections.
15549 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15550 (Sized_relobj::do_layout): Change calls to include_section_group and
15551 include_linkonce_section.
15552 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15553 value to zero when section is discarded.
15554 (Sized_relobj::map_to_kept_section): New function.
15555 * object.h (Relobj::output_section_address): New function.
15556 (Relobj::Comdat_group): New type.
15557 (Relobj::find_comdat_group): New function.
15558 (Relobj::Comdat_group_table): New type.
15559 (Relobj::Kept_comdat_section): New type.
15560 (Relobj::Kept_comdat_section_table): New type.
15561 (Relobj::add_comdat_group): New function.
15562 (Relobj::set_kept_comdat_section): New function.
15563 (Relobj::get_kept_comdat_section): New function.
15564 (Relobj::comdat_groups_): New field.
15565 (Relobj::kept_comdat_sections_): New field.
15566 (Symbol_value::input_value): Update comment.
15567 (Sized_relobj::map_to_kept_section) New function.
15568 (Sized_relobj::include_linkonce_section): Add new parameter.
15569 * target-reloc.h (Comdat_behavior): New type.
15570 (get_comdat_behavior): New function.
15571 (relocate_section): Add code to map a discarded section to the
15572 corresponding kept section when applying a relocation.
15574 2008-04-30 Craig Silverstein <csilvers@google.com>
15576 * dwarf_reader.cc (next_generation_count): New static var.
15577 (Addr2line_cache_entry): New struct.
15578 (addr2line_cache): New static var.
15579 (Dwarf_line_info::one_addr2line): Added caching.
15580 (Dwarf_line_info::clear_addr2line_cache): New function.
15581 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15582 cache-size parameter.
15583 (Dwarf_line_info::one_addr2line_cache): New function.
15584 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15585 new cache-size argument to one_addr2line(), and clear cache.
15587 2008-04-28 Cary Coutant <ccoutant@google.com>
15589 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15590 R_386_PC8 relocations.
15592 2008-04-23 Ian Lance Taylor <iant@google.com>
15594 * object.cc (Sized_relobj::include_section_group): Check for
15595 invalid section group.
15597 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15600 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15601 than read for file header.
15602 * archive.cc (Archive::include_member): Likewise.
15604 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
15606 * aclocal.m4: Regenerate.
15607 * configure: Regenerate.
15609 2008-04-19 Ian Lance Taylor <iant@google.com>
15611 * version.cc (version_string): Bump to 1.6.
15613 * testsuite/Makefile.am (many_sections_r_test): New target.
15614 (many_sections_r_test_SOURCES): Remove.
15615 (many_sections_r_test_DEPENDENCIES): Remove.
15616 (many_sections_r_test_LDFLAGS): Remove.
15617 (many_sections_r_test_LDADD): Remove.
15619 * object.cc (Sized_relobj::do_add_symbols): Always pass
15620 local_symbol_count_ to add_from_relobj.
15622 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15623 every thousand variables.
15624 * testsuite/Makefile.in: Rebuild.
15626 * object.cc (Xindex::initialize_symtab_xindex): New function.
15627 (Xindex::read_symtab_xindex): New function.
15628 (Xindex::sym_xindex_to_shndx): New function.
15629 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15631 (Sized_relobj::do_initialize_xindex): New function.
15632 (Sized_relobj::do_read_symbols): Adjust section links.
15633 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15634 parameter. Change all callers.
15635 (Sized_relobj::include_section_group): Adjust section links and
15636 symbol section indexes.
15637 (Sized_relobj::do_layout): Adjust section links.
15638 (Sized_relobj::do_count_local_symbols): Adjust section links and
15639 symbol section indexes.
15640 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15641 ordinary and special symbols.
15642 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15643 dynsym_xindex parameters. Change all callers. Adjust section
15644 links. Use SHN_XINDEX when needed.
15645 (Sized_relobj::get_symbol_location_info): Adjust section links.
15646 Don't get fooled by special symbols.
15647 * object.h (class Xindex): Define.
15648 (class Object): Add xindex_ parameter. Declare virtual functoin
15649 do_initialize_xindex.
15650 (Object::adjust_sym_shndx): New function.
15651 (Object::set_xindex): New protected function.
15652 (class Symbol_value): Add is_ordinary_shndx_ field.
15653 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15654 (Symbol_value::value): Assert ordinary section.
15655 (Symbol_value::initialize_input_to_output_map): Likewise.
15656 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15657 Change all callers.
15658 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15660 (class Sized_relobj): Update declarations.
15661 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15662 parameter. Change all callers.
15663 (Sized_relobj::adjust_shndx): New function.
15664 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15666 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15667 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15668 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15669 (Sized_dynobj::read_dynsym_section): Adjust section links.
15670 (Sized_dynobj::read_dynamic): Likewise.
15671 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15673 (Sized_dynobj::do_initialize_xindex): New function.
15674 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15675 do_initialize_xindex.
15676 (Sized_dynobj::adjust_shndx): New function.
15677 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15678 dynsym_xindex_ fields.
15679 (Layout::finalize): Add a call to set_section_indexes before
15680 creating the symtab sections.
15681 (Layout::set_section_indexes): Don't do anything if the section
15682 already has a section index.
15683 (Layout::create_symtab_sections): Add shnum parameter. Change
15684 caller. Create .symtab_shndx section if needed.
15685 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15687 (Layout::allocated_output_section_count): New function.
15688 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15690 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15691 fields. Update declarations.
15692 (Layout::symtab_xindex): New function.
15693 (Layout::dynsym_xindex): New function.
15694 (class Write_symbols_task): Add layout_ field.
15695 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15697 * output.cc (Output_section_headers::Output_section_headers): Add
15698 shstrtab_section parameter. Change all callers.
15699 (Output_section_headers::do_sized_write): Store overflow values
15700 for section count and section string table section index in
15701 section header zero.
15702 (Output_file_header::do_sized_write): Check for overflow of
15703 section count and section string table section index.
15704 (Output_symtab_xindex::do_write): New function.
15705 (Output_symtab_xindex::endian_do_write): New function.
15706 * output.h (class Output_section_headers): Add shstrtab_section_.
15707 Update declarations.
15708 (class Output_symtab_xindex): Define.
15709 (Output_section::has_out_shndx): New function.
15710 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15712 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15713 Change all callers.
15714 (Sized_symbol::init): Likewise.
15715 (Symbol::output_section): Check for ordinary symbol.
15716 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15717 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15719 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15720 Change all callers. Simplify handling of symbols from sections
15721 not included in the link.
15722 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15724 (Weak_alias_sorter::operator()): Assert that symbols are
15726 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15728 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15729 parameters. Change all callers.
15730 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15731 symbol distinction. Use SHN_XINDEX when needed.
15732 (Symbol_table::write_section_symbol): Add symtab_xindex
15733 parameter. Change all callers.
15734 (Symbol_table::sized_write_section_symbol): Likewise. Use
15735 SHN_XINDEX when needed.
15736 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15738 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15739 (Symbol::is_defined): Check is_ordinary.
15740 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15741 (Symbol::is_absolute, Symbol::is_common): Likewise.
15742 (class Sized_symbol): Update declarations.
15743 (class Symbol_table): Update declarations.
15744 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15745 parameters. Change all callers.
15746 (Sized_symbol::override): Likewise.
15747 (Symbol_table::override): Likewise.
15748 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15749 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15750 is_ordinary, and orig_st_shndx parameters. Change all callers.
15751 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15752 to be in an ordinary section.
15753 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15754 object and is_ordinary parameters. Change all callers.
15755 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15756 Change all callers. Don't add undefined or non-ordinary symbols
15758 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15759 Change all callers.
15760 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15762 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15763 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15764 (Sized_relobj::relocate_sections): Likewise.
15765 * target-reloc.h (scan_relocs): Adjust section symbol index.
15766 (scan_relocatable_relocs): Likewise.
15767 * i386.cc (Scan::local): Check for ordinary symbols.
15768 * sparc.cc (Scan::local): Likewise.
15769 * x86_64.cc (Scan::local): Likewise.
15770 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15771 to symbol_section_and_value.
15772 * testsuite/many_sections_test.cc: New file.
15773 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15774 (check_PROGRAMS): Add many_sections_test.
15775 (many_sections_test_SOURCES): Define.
15776 (many_sections_test_DEPENDENCIES): Define.
15777 (many_sections_test_LDFLAGS): Define.
15778 (BUILT_SOURCES): Add many_sections_define.h.
15779 (many_sections_define.h): New target.
15780 (BUILT_SOURCES): Add many_sections_check.h.
15781 (many_sections_check.h): New target.
15782 (check_PROGRAMS): Add many_sections_r_test.
15783 (many_sections_r_test_SOURCES): Define.
15784 (many_sections_r_test_DEPENDENCIES): Define.
15785 (many_sections_r_test_LDFLAGS): Define.
15786 (many_sections_r_test_LDADD): Define.
15787 (many_sections_r_test.o): New target.
15788 * testsuite/Makefile.in: Rebuild.
15790 2008-04-17 Cary Coutant <ccoutant@google.com>
15792 * errors.cc (Errors::info): New function.
15793 (gold_info): New function.
15794 * errors.h (Errors::info): New function.
15795 * gold.h (gold_info): New function.
15796 * object.cc (Input_objects::add_object): Print trace output.
15797 * options.cc (options::parse_set): New function.
15798 (General_options::parse_wrap): Deleted.
15799 (General_options::General_options): Deleted initializer.
15800 * options.h (options::String_set): New typedef.
15801 (options::parse_set): New function.
15802 (DEFINE_set): New macro.
15803 (General_options::wrap): Changed to use DEFINE_set. Changed
15804 callers of any_wrap_symbols and is_wrap_symbol.
15805 (General_options::trace, General_options::trace_symbol):
15807 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15808 (General_options::wrap_symbols_): Deleted.
15809 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15811 2008-04-17 David S. Miller <davem@davemloft.net>
15813 * options.cc (General_options::parse_V): New function.
15814 * options.h: Add entries for -V and -Qy.
15816 2008-04-17 Ian Lance Taylor <iant@google.com>
15818 * common.cc (Symbol_table::allocate_commons): Remove options
15819 parameter. Change caller.
15820 (Symbol_table::do_allocate_commons): Remove options parameter.
15821 Change caller. Just call do_allocate_commons_list twice.
15822 (Symbol_table::do_allocate_commons_list): New function, broken out
15823 of do_allocate_commons.
15824 * common.h (class Allocate_commons_task): Remove options_ field.
15825 Update constructor.
15826 * symtab.cc (Symbol_table::Symbol_table): Initialize
15828 (Symbol_table::add_from_object): Put TLS common symbols on
15830 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15831 which are IN_OUTPUT_DATA.
15832 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15833 allocate_commons and do_allocate_commons declarations. Declare
15834 do_allocate_commons_list.
15835 * gold.cc (queue_middle_tasks): Update creation of
15836 Allocate_commons_task to not pass options.
15837 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15838 (TLS_TEST_C_FLAGS): New variable.
15839 (tls_test_c_pic.o): New target.
15840 (tls_test_shared.so): Link in tls_test_c_pic.o.
15841 (tls_test_c_pic_ie.o): New target.
15842 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15843 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15844 (tls_test_c.o): New target.
15845 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15846 (tls_pic_test_LDADD): Likewise.
15847 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15848 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15849 (tls_test_c_gnu2.o): New target.
15850 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15852 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15853 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15854 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15855 * testsuite/tls_test.cc: Include "config.h".
15856 (t_last): Call t11_last.
15857 * testsuite/tls_test.h (t11, t11_last): Declare.
15858 * testsuite/tls_test_c.c: New file.
15859 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15860 * configure.ac: Check for OpenMP support.
15861 * configure, config.in, Makefile.in: Rebuild.
15862 * testsuite/Makefile.in: Rebuild.
15864 2008-04-16 Cary Coutant <ccoutant@google.com>
15866 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15867 (Target_i386::tls_base_symbol_defined_): New field.
15868 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15869 (Target_i386::Scan::global): Likewise.
15870 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15871 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15872 (Target_x86_64::tls_base_symbol_defined_): New field.
15873 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15874 (Target_x86_64::Scan::global): Likewise.
15876 2008-04-16 Cary Coutant <ccoutant@google.com>
15878 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15879 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15880 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15881 building shared libraries.
15882 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15883 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15884 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15885 * testsuite/Makefile.in: Rebuild.
15886 * testsuite/weak_undef.h: New file.
15887 * testsuite/weak_undef_file1.cc: Add extra test cases.
15888 * testsuite/weak_undef_file2.cc: Likewise.
15889 * testsuite/weak_undef_test.cc: Likewise.
15891 2008-04-16 David S. Miller <davem@davemloft.net>
15893 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15894 Add issued_non_pic_error_ field. Declare check_non_pic.
15895 (Target_sparc::Scan::check_non_pic): New function.
15896 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15897 (Target_sparc::Scan::global): Likewise.
15899 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15900 * configure: Rebuild.
15902 * options.h (DEFINE_enable): New macro.
15903 (new_dtags): New enable option.
15904 (initfirst, interpose, loadfltr, nodefaultlib,
15905 nodelete, nodlopen, nodump): New -z options.
15906 * layout.cc (Layout:finish_dynamic_section): If new
15907 dtags enabled, emit DT_RUNPATH. Also, emit a
15908 DT_FLAGS_1 containing any specified -z flags.
15910 2008-04-16 Ian Lance Taylor <iant@google.com>
15912 * copy-relocs.cc: New file.
15913 * copy-relocs.h: New file.
15914 * reloc.cc: Remove Copy_relocs code.
15915 * reloc.h: Likewise.
15916 * reloc-types.h (struct Reloc_types) [both versions]: Add
15917 get_reloc_addend_noerror.
15918 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15919 variants of add_global which take an addend which must be zero.
15920 * i386.cc: Include "copy-relocs.h".
15921 (class Target_i386): Change type of copy_relocs_ to variable,
15922 update initializer.
15923 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15924 Change all callers.
15925 (Target_i386::do_finalize_sections): Change handling of
15927 * sparc.cc: Include "copy-relocs.h".
15928 (class Target_sparc): Change type of copy_relocs_ to variable,
15929 update initializer.
15930 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15931 Change all callers.
15932 (Target_sparc::do_finalize_sections): Change handling of
15934 * x86_64.cc: Include "copy-relocs.h".
15935 (class Target_x86_64): Change type of copy_relocs_ to variable,
15936 update initializer.
15937 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15938 class. Change all callers.
15939 (Target_x86_64::do_finalize_sections): Change handling of
15941 * Makefile.am (CCFILES): Add copy-relocs.cc.
15942 (HFILES): Add copy-relocs.h.
15944 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15946 * testsuite/script_test_4.sh: Permit leading zeroes.
15948 2008-04-15 Ian Lance Taylor <iant@google.com>
15950 * script-sections.cc (Script_sections::create_segments): Use
15951 header_size_adjustment even when there is enough room for the
15953 * testsuite/script_test_4.sh: New file.
15954 * testsuite/script_test_4.t: New file.
15955 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15956 (check_DATA): Add script_test_4.stdout.
15957 (MOSTLYCLEANFILES): Likewise.
15958 (script_test_4): New target.
15959 (script_test_4.stdout): New target.
15960 * testsuite/Makefile.in: Rebuild.
15962 * sparc.cc: Add definitions for Output_data_plt_sparc class
15965 2008-04-14 David S. Miller <davem@davemloft.net>
15967 * sparc.cc: New file.
15968 * Makefile.am (TARGETSOURCES): Add sparc.cc
15969 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15970 * configure.tgt: Document targ_extra_size and
15971 targ_extra_big_endian. Add entries for sparc-* and
15973 * configure.ac: Handle targ_extra_size and
15974 targ_extra_big_endian.
15975 * Makefile.in: Rebuild.
15976 * configure: Likewise.
15977 * po/POTFILES.in: Likewise.
15978 * po/gold.pot: Likewise.
15980 2008-04-14 Ian Lance Taylor <iant@google.com>
15982 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15983 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15984 in the name/type/flags to section mapping. Don't call
15985 allocate_output_section.
15986 (Layout::choose_output_section): Change parameter from adjust_name
15987 to is_input_section. Don't permit input sections after sections
15988 are attached to segments. Don't call allocate_output_section.
15989 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15990 not write_enable_output_section.
15991 (Layout::make_output_section): Don't push to
15992 unattached_section_list_ nor call attach_to_segment. Call
15993 attach_section_to_segment if sections are attached.
15994 (Layout::attach_sections_to_segments): New function.
15995 (Layout::attach_section_to_segment): New function.
15996 (Layout::attach_allocated_section_to_segment): Rename from
15997 attach_to_segment. Remove flags parameter.
15998 (Layout::allocate_output_section): Remove function.
15999 (Layout::write_enable_output_section): Remove function.
16000 * layout.h (class Layout): Update for above changes. Add new
16001 field sections_are_attached_.
16002 * output.h (Output_section::update_flags_for_input_section): New
16004 * output.cc (Output_section::add_input_section): Call
16005 update_flags_for_input_section.
16006 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16008 2008-04-11 Cary Coutant <ccoutant@google.com>
16010 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16011 thought unnecessary.
16012 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16014 2008-04-11 Ian Lance Taylor <iant@google.com>
16016 * output.h (class Output_section_data): Remove inline definition
16018 * output.cc (Output_section_data::set_addralign): New function.
16020 2008-04-11 Cary Coutant <ccoutant@google.com>
16022 Add support for TLS descriptors for i386 and x86_64.
16023 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16024 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16025 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16027 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16028 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16029 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16031 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16032 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16033 Fix problem with initial-exec relocations.
16034 (Target_i386::Relocate::relocate_tls): Likewise.
16035 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16037 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16038 support for section-plus-offset dynamic table entries.
16039 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16040 (Output_data_dynamic::Dynamic_entry): Add support for
16041 section-plus-offset dynamic table entries.
16042 (Output_data_dynamic::Classification): Likewise.
16043 (Output_data_dynamic::classification_): Renamed offset_.
16044 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16045 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16046 (Target_x86_64::make_plt_section): New function.
16047 (Target_x86_64::reserve_tlsdesc_entries): New function.
16048 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16049 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16050 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16051 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16052 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16053 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16054 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16055 add extra PLT entry for TLS descriptors.
16056 (Output_data_plt_x86_64::got_): New field.
16057 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16058 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16060 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16062 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16063 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16064 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16065 R_386_TLS_DESC_CALL relocations.
16066 (Target_x86_64::Scan::global): Likewise.
16067 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16068 for TLS descriptors.
16069 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16070 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16071 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16072 GD-to-IE relaxation.
16073 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16074 and TLS_DESCRIPTORS.
16075 * Makefile.in: Rebuild.
16076 * configure: Rebuild.
16077 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16078 (tls_test_shared2.so): New target.
16079 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16080 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16081 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16082 (tls_shared_gd_to_ie_test_LDADD): New variable.
16083 (tls_shared_gnu2_gd_to_ie_test): New target.
16084 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16086 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16087 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16088 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16089 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16090 (tls_shared_gnu2_test): New target.
16091 (tls_test_gnu2_shared.so): New target.
16092 (tls_shared_gnu2_test_SOURCES): New variable.
16093 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16094 (tls_shared_gnu2_test_LDFLAGS): New variable.
16095 (tls_shared_gnu2_test_LDADD): New variable.
16096 * testsuite/Makefile.in: Rebuild.
16097 * testsuite/Makefile.
16099 2008-04-11 Ian Lance Taylor <iant@google.com>
16101 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16103 * testsuite/Makefile.in: Rebuild.
16105 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16107 * testsuite/script_test_2.cc (main): Adjust test.
16109 2008-04-11 David S. Miller <davem@davemloft.net>
16110 Ian Lance Taylor <iant@google.com>
16112 * options.h (General_options): Add entries for '-Y' and
16114 * options.cc (General_options:finalize): If -Y was used, add those
16115 entries to the library path instead of the default "/lib" and
16118 2008-04-11 David S. Miller <davem@davemloft.net>
16120 * testsuite/justsyms.t: Start at 0x100.
16121 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
16122 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16124 * testsuite/script_test_2.cc: Adjust string and section length
16127 2008-04-09 Ian Lance Taylor <iant@google.com>
16130 * script-sections.cc (Sections_element::allocate_to_segment): Add
16132 (Output_section_definition::allocate_to_segment): Likewise.
16133 (Orphan_output_section::allocate_to_segment): Likewise.
16134 (Script_sections::attach_sections_using_phdrs_clause): Don't
16135 propagate non-PT_LOAD segments to orphan sections.
16136 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16137 readelf rather than objdump.
16138 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16139 .interp section and PT_INTERP segment are the same size.
16140 * testsuite/Makefile.in: Rebuild.
16142 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16143 aliases for symbols defined in the same object.
16144 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16145 (weak_alias_test_SOURCES): New variable.
16146 (weak_alias_test_DEPENDENCIES): New variable.
16147 (weak_alias_test_LDFLAGS): New variable.
16148 (weak_alias_test_LDADD): New variable.
16149 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16150 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16151 (weak_alias_test_3.o): New target.
16152 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16153 * testsuite/weak_alias_test_main.cc: New file.
16154 * testsuite/weak_alias_test_1.cc: New file.
16155 * testsuite/weak_alias_test_2.cc: New file.
16156 * testsuite/weak_alias_test_3.cc: New file.
16158 2008-04-08 Ian Lance Taylor <iant@google.com>
16160 * options.h (class General_options): Add --noinhibit-exec option.
16161 * main.cc (main): Check --noinhibit-exec.
16163 * options.h (class General_options): Define --wrap as a special
16164 option. Add wrap_symbols_ field.
16165 (General_options::any_wrap_symbols): New function.
16166 (General_options::is_wrap_symbol): New function.
16167 * options.cc (General_options::parse_wrap): New function.
16168 (General_options::General_options): Initialize wrap_symbols_.
16169 * symtab.cc (Symbol_table::wrap_symbol): New function.
16170 (Symbol_table::add_from_object): Handle --wrap.
16171 * symtab.h (class Symbol_table): Declare wrap_symbol.
16172 * target.h (Target::wrap_char): New function.
16173 (Target::Target_info): Add wrap_char field.
16174 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16175 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16176 * testsuite/testfile.cc (Target_test::test_target_info):
16179 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16182 * layout.h (class Layout): Add added_eh_frame_data_ field.
16183 * layout.cc (Layout::Layout): Initialize new field.
16184 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16185 output section until we find a section we merged successfully.
16186 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16187 that the size be non-zero.
16189 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16192 2008-04-08 Craig Silverstein <csilvers@google.com>
16194 * configure.ac: Export new conditional variable HAVE_ZLIB.
16195 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16197 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16198 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16200 2008-04-07 Ian Lance Taylor <iant@google.com>
16202 * version.cc (version_string): Set to "1.5".
16204 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16205 Add issued_non_pic_error_ field. Declare check_non_pic.
16206 (Target_x86_64::Scan::check_non_pic): New function.
16207 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16208 (Target_x86_64::Scan::global): Likewise.
16210 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16211 addend parameter. Change caller. Handle merge sections.
16212 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16213 Address to Addend. Don't add in the result of
16214 local_section_offset, pass down the addend and use the returned
16216 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16217 Update declarations of local_section_offset and symbol_value.
16218 * testsuite/two_file_test_1.cc (t18): New function.
16219 * testsuite/two_file_test_2.cc (f18): New function.
16220 * testsuite/two_file_test_main.cc (main): Call t18.
16221 * testsuite/two_file_test.h (t18, f18): Declare.
16223 * configure.ac: Don't test for objdump, c++filt, or readelf.
16224 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16226 (TEST_READELF): New variable.
16227 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16228 (check_PROGRAMS): Add two_file_strip_test.
16229 (two_file_strip_test): New target.
16230 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16231 (two_file_same_shared_strip_test_SOURCES): New variable.
16232 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16233 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16234 (two_file_same_shared_strip_test_LDADD): New variable.
16235 (two_file_shared_strip.so): New target.
16236 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16237 (ver_test_5.syms, ver_test_7.syms): Likewise.
16238 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16239 (strip_test_3.stdout): Use TEST_OBJDUMP.
16240 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16242 2008-04-04 Cary Coutant <ccoutant@google.com>
16244 * symtab.h (Symbol::is_weak_undefined): New function.
16245 (Symbol::is_strong_undefined): New function.
16246 (Symbol::is_absolute): New function.
16247 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16248 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16250 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16251 (weak_undef_test): New target.
16252 * testsuite/Makefile.in: Rebuild.
16253 * testsuite/weak_undef_file1.cc: New file.
16254 * testsuite/weak_undef_file2.cc: New file.
16255 * testsuite/weak_undef_test.cc: New file.
16257 2008-04-03 Craig Silverstein <csilvers@google.com>
16259 * compressed_output.h (class Output_compressed_section): Use
16261 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16263 (zlib_compressed_suffix): Removed.
16264 (Output_compressed_section::set_final_data_size): Use unsigned
16266 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16267 Fix linker invocation.
16268 (flagstest_o_specialfile_and_compress_debug_sections):
16270 * testsuite/Makefile.in: Regenerated.
16272 2008-04-02 David S. Miller <davem@davemloft.net>
16274 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16275 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16277 2008-04-02 Craig Silverstein <csilvers@google.com>
16281 2008-04-02 Ian Lance Taylor <iant@google.com>
16283 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16284 parameters. Update for new key type to views_. Change all
16286 (File_read::read): Adjust for byteshift in returned view.
16287 (File_read::add_view): New function, broken out of
16288 find_and_make_view.
16289 (File_read::make_view): New function, broken out of
16290 find_and_make_view.
16291 (File_read::find_or_make_view): Add offset and aligned
16292 parameters. Rewrite accordingly. Change all callers.
16293 (File_read::get_view): Add offset and aligned parameters. Adjust
16294 for byteshift in return value.
16295 (File_read::get_lasting_view): Likewise.
16296 * fileread.h (class File_read): Update declarations.
16297 (class File_read::View): Add byteshift_ field. Add byteshift to
16298 constructor. Add byteshift method.
16299 * archive.h (Archive::clear_uncached_views): New function.
16300 (Archive::get_view): Add aligned parameter. Change all callers.
16301 * object.h (Object::get_view): Add aligned parameter. Change all
16303 (Object::get_lasting_view): Likewise.
16305 * fileread.cc (File_read::release): Don't call clear_views if
16306 there are multiple objects.
16307 * fileread.h (File_read::clear_uncached_views): New function.
16308 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16311 2008-03-31 Cary Coutant <ccoutant@google.com>
16313 Add thin archive support.
16314 * archive.cc (Archive::armagt): New const.
16315 (Archive::setup): Remove task parameter and calls to unlock.
16316 (Archive::unlock_nested_archives): New function.
16317 (Archive::read_header): Add nested_off parameter. Change
16319 (Archive::interpret_header): Likewise.
16320 (Archive::include_all_members): Change to handle thin
16322 (Archive::include_member): Likewise.
16323 * archive.h (Archive::Archive): Add new parameters and
16325 (Archive::armagt): New const.
16326 (Archive::setup): Remove task parameter.
16327 (Archive::unlock_nested_archives): New function.
16328 (Archive::read_header): Add nested_off parameter.
16329 (Archive::interpret_header): Likewise.
16330 (Archive::Nested_archive_table): New typedef.
16331 (Archive::is_thin_archive_): New field.
16332 (Archive::nested_archives_): New field.
16333 (Archive::options_): New field.
16334 (Archive::dirpath_): New field.
16335 (Archive::task_): New field.
16336 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16337 for thin archives. Pass additional parameters to
16338 Archive::Archive. Unlock the archive file after calling
16341 2008-03-29 Ian Lance Taylor <iant@google.com>
16343 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16344 version symbol to be local.
16345 * testsuite/ver_test_4.sh: New file.
16346 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16347 (check_DATA): Add ver_test_4.syms.
16348 (ver_test_4.syms): New target.
16349 * testsuite/Makefile.in: Rebuild.
16352 (Output_section::Input_section_sort_entry::has_priority): New
16354 (Output_section::Input_section_sort_entry::match_file_name): New
16356 (Output_section::Input_section_sort_entry::match_section_name):
16358 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16360 (Output_section::Input_section_sort_entry::match_section_file):
16362 (Output_section::Input_section_sort_compare::operator()): Rewrite
16363 using new Input_section_sort_entry functions. Sort crtbegin and
16364 crtend first. Sort sections with no priority before sections with
16366 * testsuite/initpri1.c (d3): Check j != 4.
16367 (cd5): New constructor/destructor function.
16368 (main): Check j != 2.
16370 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16371 new symbol when resolving, don't call set_is_default.
16372 * testsuite/ver_test_7.cc: New file.
16373 * testsuite/ver_test_7.sh: New file.
16374 * testsuite/Makefile.am (ver_test_7.so): New target.
16375 (ver_test_7.o): New target.
16376 (check_SCRIPTS): Add ver_test_7.sh.
16377 (check_DATA): Add ver_test_7.syms.
16378 (ver_test_7.syms): New target.
16380 2008-03-28 Ian Lance Taylor <iant@google.com>
16382 * layout.cc (Layout::layout): If we see an input section with a
16383 name that needs sorting, set the must_sort flag for the output
16385 (Layout::make_output_section): If the name of the output section
16386 indicates that it might require sorting, set the may_sort flag.
16387 * output.h (Output_section::may_sort_attached_input_sections): New
16389 (Output_section::set_may_sort_attached_input_sections): New
16391 (Output_section::must_sort_attached_input_sections): New
16393 (Output_section::set_must_sort_attached_input_sections): New
16395 (class Output_section): Declare Input_section_sort_entry. Define
16396 Input_section_sort_compare. Declare
16397 sort_attached_input_sections. Add new fields:
16398 may_sort_attached_input_sections_,
16399 must_sort_attached_input_sections_,
16400 attached_input_sections_are_sorted_.
16401 * output.cc (Output_section::Output_section): Initialize new
16403 (Output_section::add_input_section): Add an entry to
16404 input_sections_ if may_sort or must_sort are true.
16405 (Output_section::set_final_data_size): Call
16406 sort_attached_input_sections if necessary.
16407 (Output_section::Input_section_sort_entry): Define new class.
16408 (Output_section::Input_section_sort_compare::operator()): New
16410 (Output_section::sort_attached_input_sections): New function.
16411 * configure.ac: Check whether the compiler supports constructor
16412 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16413 * testsuite/initpri1.c: New file.
16414 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16415 CONSTRUCTOR_PRIORITY.
16416 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16417 (initpri1_LDFLAGS): New variable.
16418 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16420 2008-03-27 Ian Lance Taylor <iant@google.com>
16422 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16423 * testsuite/common_test_1.c: New file.
16424 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16425 (common_test_1_SOURCES): New variable.
16426 (common_test_1_DEPENDENCIES): New variable.
16427 (common_test_1_LDFLAGS): New variable.
16429 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16430 and commons_ correctly when NAME/VERSION does not override
16432 * testsuite/ver_test_6.c: New file.
16433 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16434 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16435 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16437 2008-03-26 Ian Lance Taylor <iant@google.com>
16439 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16440 of an undefined symbol from a version script.
16441 * testsuite/Makefile.am (ver_test_5.so): New target.
16442 (ver_test_5.o): New target.
16443 (check_SCRIPTS): Add ver_test_5.sh.
16444 (check_DATA): Add ver_test_5.syms.
16445 (ver_test_5.syms): New target.
16446 * testsuite/ver_test_5.cc: New file.
16447 * testsuite/ver_test_5.script: New file.
16448 * testsuite/ver_test_5.sh: New file.
16449 * Makefile.in, testsuite/Makefile.in: Rebuild.
16452 Fix problems building gold with gcc 4.3.0.
16453 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16454 (gold_error_at_location, gold_warning_at_location): Use it.
16455 * configure.ac: Check whether we can compile and use a template
16456 function with a printf attribute.
16457 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16458 when jumping over bytes.
16459 * object.cc: Instantiate Object::read_section_data.
16460 * debug.h: Include <cstring>
16461 * dwarf_reader.cc: Include <algorithm>
16462 * main.cc: Include <cstring>.
16463 * options.cc: Include <cstring>.
16464 * output.cc: Include <cstring>.
16465 * script.cc: Include <cstring>.
16466 * script.h: Include <string>.
16467 * symtab.cc: Include <cstring> and <algorithm>.
16468 * target-select.cc: Include <cstring>.
16469 * version.cc: Include <string>.
16470 * testsuite/testmain.cc: Include <cstdlib>.
16471 * configure, config.in: Rebuild.
16473 2008-03-25 Ian Lance Taylor <iant@google.com>
16475 * options.cc: Include "../bfd/bfdver.h".
16476 (options::help): Print bug reporting address.
16478 * version.cc (print_version): Adjust output for current value of
16479 BFD_VERSION_STRING.
16483 * options.cc (options::help): Print list of supported targets.
16484 * target-select.h: Include <vector>.
16485 (class Target_selector): Make machine_, size_, and is_big_endian_
16486 fields const. Add bfd_name_ and instantiated_target_ fields.
16487 (Target_selector::Target_selector): Add bfd_name parameter.
16488 (Target_selector::recognize): Make non-virtual, call
16490 (Target_selector::recognize_by_name): Make non-virtual, call
16491 do_recognize_by_name.
16492 (Target_selector::supported_names): New function.
16493 (Target_selector::bfd_name): New function.
16494 (Target_selector::do_instantiate_target): New pure virtual
16496 (Target_selector::do_recognize): New virtual function.
16497 (Target_selector::do_recognize_by_name): New virtual function.
16498 (Target_selector::instantiate_target): New private function.
16499 (supported_target_names): Declare.
16500 * target-select.cc (Target_selector::Target_selector): Update for
16501 new parameter and fields.
16502 (select_target_by_name): Check that the name matches before
16503 calling recognize_by_name.
16504 (supported_target_names): New function.
16505 * i386.cc (class Target_selector_i386): Update Target_selector
16506 constructor call. Remove recognize and recognize_by_name. Add
16507 do_instantiate_target.
16508 * x86_64.cc (class Target_selector_x86_64): Likewise.
16509 * testsuite/testfile.cc (class Target_selector_test): Update for
16510 changes to Target_selector.
16512 * README: Rewrite, with some notes on unsupported features.
16514 2008-03-24 Cary Coutant <ccoutant@google.com>
16516 * i386.cc (Target_i386::Got_type): New enum declaration.
16517 (Target_i386::Scan::local): Updated callers of Output_data_got
16519 (Target_i386::Scan::global): Likewise.
16520 (Target_i386::Relocate::relocate): Likewise.
16521 (Target_i386::Relocate::relocate_tls): Likewise.
16522 * object.h (Got_offset_list): New class.
16523 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16524 (Sized_relobj::local_got_offset): Likewise.
16525 (Sized_relobj::set_local_got_offset): Likewise.
16526 (Sized_relobj::local_has_tls_got_offset): Removed.
16527 (Sized_relobj::local_tls_got_offset): Removed.
16528 (Sized_relobj::set_local_tls_got_offset): Removed.
16529 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16530 * output.cc (Output_data_got::add_global): Added got_type parameter.
16531 (Output_data_got::add_global_with_rel): Likewise.
16532 (Output_data_got::add_global_with_rela): Likewise.
16533 (Output_data_got::add_global_pair_with_rel): New function.
16534 (Output_data_got::add_global_pair_with_rela): New function.
16535 (Output_data_got::add_local): Added got_type parameter.
16536 (Output_data_got::add_local_with_rel): Likewise.
16537 (Output_data_got::add_local_with_rela): Likewise.
16538 (Output_data_got::add_local_pair_with_rel): New function.
16539 (Output_data_got::add_local_pair_with_rela): New function.
16540 (Output_data_got::add_global_tls): Removed.
16541 (Output_data_got::add_global_tls_with_rel): Removed.
16542 (Output_data_got::add_global_tls_with_rela): Removed.
16543 (Output_data_got::add_local_tls): Removed.
16544 (Output_data_got::add_local_tls_with_rel): Removed.
16545 (Output_data_got::add_local_tls_with_rela): Removed.
16546 * output.h (Output_data_got::add_global): Added got_type parameter.
16547 (Output_data_got::add_global_with_rel): Likewise.
16548 (Output_data_got::add_global_with_rela): Likewise.
16549 (Output_data_got::add_global_pair_with_rel): New function.
16550 (Output_data_got::add_global_pair_with_rela): New function.
16551 (Output_data_got::add_local): Added got_type parameter.
16552 (Output_data_got::add_local_with_rel): Likewise.
16553 (Output_data_got::add_local_with_rela): Likewise.
16554 (Output_data_got::add_local_pair_with_rel): New function.
16555 (Output_data_got::add_local_pair_with_rela): New function.
16556 (Output_data_got::add_global_tls): Removed.
16557 (Output_data_got::add_global_tls_with_rel): Removed.
16558 (Output_data_got::add_global_tls_with_rela): Removed.
16559 (Output_data_got::add_local_tls): Removed.
16560 (Output_data_got::add_local_tls_with_rel): Removed.
16561 (Output_data_got::add_local_tls_with_rela): Removed.
16562 * resolve.cc (Symbol::override_base_with_special): Removed
16563 reference to has_got_offset_ field.
16564 * symtab.cc (Symbol::init_fields): Replaced initialization
16565 of got_offset_ with got_offsets_. Removed initialization
16567 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
16568 (Symbol::got_offset): Likewise.
16569 (Symbol::set_got_offset): Likewise.
16570 (Symbol::has_tls_got_offset): Removed.
16571 (Symbol::tls_got_offset): Removed.
16572 (Symbol::set_tls_got_offset): Removed.
16573 (Symbol::got_offset_): Removed.
16574 (Symbol::tls_mod_got_offset_): Removed.
16575 (Symbol::tls_pair_got_offset_): Removed.
16576 (Symbol::got_offsets_): New field.
16577 (Symbol::has_got_offset): Removed.
16578 (Symbol::has_tls_mod_got_offset): Removed.
16579 (Symbol::has_tls_pair_got_offset): Removed.
16580 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16581 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16583 (Target_x86_64::Scan::global): Likewise.
16584 (Target_x86_64::Relocate::relocate): Likewise.
16585 (Target_x86_64::Relocate::relocate_tls): Likewise.
16587 2008-03-25 Ben Elliston <bje@au.ibm.com>
16589 * yyscript.y: Fix spelling error in comment.
16591 2008-03-24 Ian Lance Taylor <iant@google.com>
16593 * options.h (class General_options): Define build_id option.
16594 * layout.h (class Layout): Declare write_build_id, create_note,
16595 create_build_id. Add build_id_note_ member.
16596 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16597 "libiberty.h", "md5.h", "sha1.h".
16598 (Layout::Layout): Initialize eh_frame_data_,
16599 eh_frame_hdr_section_, and build_id_note_.
16600 (Layout::finalize): Call create_build_id.
16601 (Layout::create_note): New function, broken out of
16602 Layout::create_gold_note.
16603 (Layout::create_gold_note): Call create_note.
16604 (Layout::create_build_id): New function.
16605 (Layout::write_build_id): New function.
16606 (Close_task_runner::run): Call write_build_id.
16608 * x86_64.cc: Correct license to GPLv3.
16610 2008-03-23 Ian Lance Taylor <iant@google.com>
16612 * options.cc: Include "demangle.h".
16613 (parse_optional_string): New function.
16614 (parse_long_option): Handle takes_optional_argument.
16615 (parse_short_option): Update dash_z initializer. Handle
16616 takes_optional_argument.
16617 (General_options::General_options): Initialize do_demangle_.
16618 (General_options::finalize): Set do_demangle_. Handle demangling
16620 * options.h (parse_optional_string): Declare.
16621 (struct One_option): Add optional_arg field. Update constructor.
16622 Update call constructor calls. Add takes_optional_argument
16624 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16625 (DEFINE_optional_string): Define.
16626 (General_options::demangle): Change from DEFINE_bool to
16627 DEFINE_optional_string.
16628 (General_options::no_demangle): New function.
16629 (General_options::do_demangle): New function.
16630 (General_options::set_do_demangle): New function.
16631 (General_options::execstack_status_): Move definition to end of
16633 (General_options::static_): Likewise.
16634 (General_options::do_demangle_): New field.
16635 * object.cc (big_endian>::get_symbol_location_info): Call
16636 Options::do_demangle, not Options::demangle.
16637 * symtab.cc (demangle): Likewise.
16639 2008-03-22 Ian Lance Taylor <iant@google.com>
16641 * gold.h: Include <cstddef> and <sys/types.h>
16642 * options.h: Include <cstring>.
16644 2008-03-21 Ian Lance Taylor <iant@google.com>
16646 * Added source code to GNU binutils.
16648 Copyright (C) 2008-2015 Free Software Foundation, Inc.
16650 Copying and distribution of this file, with or without modification,
16651 are permitted in any medium without royalty provided the copyright
16652 notice and this notice are preserved.
16658 version-control: never