1 2015-03-02 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
3 * ehframe.cc (Cie::set_output_offset): Pass in and use a
4 Output_section_data instead of a Merge_map.
5 (Eh_frame::Eh_frame): Don't initialize merge_map_.
6 (Eh_frame::read_cie): Use add_merge_mapping instead of
7 Merge_map::add_mapping.
8 (Eh_frame::read_fde): Ditto.
9 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
10 (Eh_frame::do_output_offset): Use merge_output_offset istead of
11 merge_map_->get_output_offset.
12 (Eh_frame::do_is_merge_section_for): Delete.
13 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
14 instead of a Merge_map.
15 (Cie::set_output_offset): Pass in a Output_section_data instead of a
17 (Eh_frame::do_is_merge_section_for): Delete.
18 (Eh_frame::merge_map_): Delete.
19 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
20 and use a Output_section_data instead of a Merge_map.
21 (Object_merge_map::add_mapping): Ditto.
22 (Object_merge_map::get_output_offset): Remove the merge_map argument.
23 (Object_merge_map::is_merge_section_for): Pass in and use a
24 Output_section_data instead of a Merge_map.
26 (Output_merge_base::do_output_offset): Use merge_output_offset instead
27 of merge_map_.get_output_offset.
28 (Output_merge_base::do_is_merge_section_for): Delete.
29 (Output_merge_data::do_add_input_section): Use
30 object->add_merge_mapping instead of add_mapping.
31 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
32 * merge.h (Merge_map): Delete forward declaration.
33 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
34 instead of a Merge_map.
35 (Object_merge_map::get_output_offset): Remove the merge_map argument.
36 (Object_merge_map::is_merge_section_for): Pass in and use a
37 Output_section_data instead of a Merge_map.
38 (Input_merge_map::Object_merge_map::merge_map): Replace with
40 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
41 Output_section_data instead of a Merge_map.
43 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
44 (Output_merge_base::do_is_merge_section_for): Delete.
45 (Output_merge_base::add_mapping): Delete.
46 (Output_merge_base::merge_map_): Delete.
47 * object.cc (Relobj::initialize_input_to_output_map): New.
48 (Relobj::initialize_input_to_output_map): New.
49 (Relobj::merge_output_offset): New.
50 (Relobj::is_merge_section_for): New.
51 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
53 * object.h (Relobj::merge_map): Delete.
54 (initialize_input_to_output_map): New.
55 (set_merge_map): Delete.
56 (add_merge_mapping): New.
57 (merge_output_offset): New.
58 (is_merge_section_for): New.
59 * output.cc (Output_section::Input_section::is_merge_section_for):
60 Use object->is_merge_section_for.
61 * output.h (Output_section_data::is_merge_section_for): Delete.
62 (Output_section_data::do_is_merge_section_for): Delete.
63 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
64 Use object->initialize_input_to_output_map.
65 (Merged_symbol_value<size>::value_from_output_section): Use
66 object->merge_output_offset.
68 2015-02-04 Peter Collingbourne <pcc@google.com>
69 Cary Coutant <ccoutant@google.com>
71 * output.cc (Output_section::add_merge_input_section): Do not
72 attempt to merge sections with an entsize of 0.
74 2015-02-02 Khem Raj <raj.khem@gmail.com>
76 * attributes.h (class Output_attributes_section_data ): Add
77 do_print_to_mapfile function.
79 2015-02-24 Alan Modra <amodra@gmail.com>
82 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
83 complain if value is not a multiple of four.
84 (Target_powerpc::Relocate::relocate): Correct handling of
85 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
87 2015-02-21 H.J. Lu <hongjiu.lu@intel.com>
89 * configure.ac (default_size): Set to 32 for x32.
90 * configure: Regenerated.
92 2015-02-18 Alan Modra <amodra@gmail.com>
95 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
98 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
100 * gc.h (Garbage_collection::add_reference): Don't use find.
102 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
104 * object.cc (write_local_symbols): avoid std::vector copy.
106 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
108 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
110 2015-02-09 Mark Wielaard <mjw@redhat.com>
112 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
113 DW_LANG_Fortran03 and DW_LANG_Fortran08.
115 2015-02-16 Cary Coutant <ccoutant@google.com>
119 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
120 DF_SYMBOLIC if --dynamic-list option is used.
121 * options.cc (General_options::finalize): --dynamic-list is not
122 mutually exclusive with -Bsymbolic.
123 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
124 listed in --dynamic-list.
125 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
126 -Bsymbolic-functions.
127 * testsuite/Makefile.in: Regenerate.
129 2015-02-16 Cary Coutant <ccoutant@google.com>
132 * incremental.cc: Remove redundant include of "output.h".
134 2015-02-12 Jing Yu <jingyu@google.com>
136 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
137 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
139 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
140 TLSLE_MOVW_* relocations.
141 (Target_aarch64::Scan::global): Likewise.
142 (Target_aarch64::Relocate::relocate): Likewise.
143 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
144 for new TLSLE_MOVW_* relocations.
146 2015-02-11 Will Newton <will.newton@linaro.org>
149 * arm.cc (Target_arm::make_plt_section): Create an ARM
150 state mapping symbol at the start of the PLT.
152 2015-02-09 H.J. Lu <hongjiu.lu@intel.com>
154 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
155 Replace two_file_shared_2.so with two_file_shared_1.so.
156 * testsuite/Makefile.in: Regenerated.
158 2015-02-09 Alan Modra <amodra@gmail.com>
160 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
161 plugin_test_thin.a and defsym_test.
162 * testsuite/Makefile.in: Regenerate.
164 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
166 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
169 2015-02-04 Peter Collingbourne <pcc@google.com>
171 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
172 forwarding symbols when computing symbol resolution info for plugins.
173 * plugin.h (Plugin_manager::symtab): New method.
174 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
176 2015-02-03 Cary Coutant <ccoutant@google.com>
177 Peter Collingbourne <pcc@google.com>
180 * archive.cc (Thin_archive_object_unlocker): New class.
181 (Archive::include_member): Unlock external members of thin archives.
182 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
183 (plugin_test_2): Likewise.
184 (plugin_test_3): Likewise.
185 (plugin_test_4): Likewise.
186 (plugin_test_5): Likewise.
187 (plugin_test_6): Likewise.
188 (plugin_test_7): Likewise.
189 (plugin_test_8): Likewise.
190 (plugin_test_9): Likewise.
191 (plugin_test_10): Likewise.
192 (plugin_test_11): New test case.
193 * testsuite/Makefile.in: Regenerate.
194 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
195 file to decide whether to claim file.
196 (all_symbols_read_hook): Likewise.
197 * testsuite/plugin_test_1.sh: Adjust expected output.
198 * testsuite/plugin_test_2.sh: Likewise.
199 * testsuite/plugin_test_3.sh: Likewise.
200 * testsuite/plugin_test_6.sh: Likewise.
201 * testsuite/plugin_test_tls.sh: Likewise.
202 * testsuite/plugin_test_11.sh: New testcase.
204 2015-02-03 Cary Coutant <ccoutant@google.com>
206 * descriptors.cc (Descriptors::open): Set artificially-low limit for
207 file descriptors when debugging enabled. Add debug output.
208 (Descriptors::release): Add debug output.
209 (Descriptors::close_some_descriptor): Likewise.
210 (Descriptors::close_all): Likewise.
211 * fileread.cc (File_read::lock): Likewise.
212 (File_read::unlock): Likewise.
214 2015-02-02 Cary Coutant <ccoutant@google.com>
216 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
217 executable output file.
219 2015-01-22 Han Shen <shenhan@google.com>
221 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
222 (Target_arm::do_plt_address_for_global): New method.
223 (Target_arm::do_plt_address_for_local): New method.
224 (Target_arm::rel_irelative_section): New method.
225 (Target_arm::make_data_plt): Add more parameters for plt ctor.
226 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
227 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
228 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
229 (Target_arm::Scan::check_non_pic): Add ifunc support.
230 (Target_arm::Scan::local): Add ifunc support.
231 (Target_arm::Scan::global): Add ifunc support.
232 (Target_arm::make_plt_section): New method.
233 (Target_arm::make_plt_entry): Change to call to make_plt_section.
234 (Target_arm::make_local_ifunc_plt_entry): New method.
235 (Target_arm::got_irelative_): New member.
236 (Target_arm::rel_irelative_): New member.
237 (Target_arm::got_section): Add creation for got_irelative_.
238 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
239 (Target_arm::Relocate::relocate): Properly set local ifunc address.
240 (Target_arm::do_dynsym_value): Properly set global ifunc address.
241 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
242 (Output_data_plt_arm::IRelative_data): New type.
243 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
244 (Output_data_plt_arm::add_entry): Add more parameters.
245 (Output_data_plt_arm::add_relocation): New method.
246 (Output_data_plt_arm::add_local_ifunc_entry): New method.
247 (Output_data_plt_arm::rel_irelative): New method.
248 (Output_data_plt_arm::entry_count): Modified.
249 (Output_data_plt_arm::address_for_global): New method.
250 (Output_data_plt_arm::address_for_local): New method.
252 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
253 (Output_data_plt_arm::insert_irelative_data): New method.
254 (Output_data_plt_arm::irelative_rel_): New member.
255 (Output_data_plt_arm::got_): New member.
256 (Output_data_plt_arm::got_irelative_): New member.
257 (Output_data_plt_arm::irelative_count_): New member.
258 (Output_data_plt_arm::IRelative_data_vec): New typedef.
259 (Output_data_plt_arm::irelative_data_vec_): New member.
260 (Output_data_plt_arm::do_write): Write out irelative entries.
261 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
262 more parameters to ctor.
263 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
264 more parameters to ctor.
265 * output.h (Output_data_reloc::add_local_relative): New method.
266 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
268 2015-01-29 Alan Modra <amodra@gmail.com>
270 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
271 and GOT_TLSGD to LE optimization.
273 2015-01-28 Cary Coutant <ccoutant@google.com>
275 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
276 for undef TLS symbols.
277 (Target_x86_64::Relocate::relocate_tls): Likewise.
278 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
280 2015-01-25 Cary Coutant <ccoutant@google.com>
282 * output.cc (Output_segment::set_section_addresses): Fix calculation
283 of size of relro segment.
285 2015-01-22 Alan Modra <amodra@gmail.com>
287 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
288 condition for need of ifunc plt entry.
289 (Target_powerpc::Scan::global <got relocs>): Likewise.
291 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
293 * mips.cc (reloc_high): Add r_sym.
294 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
295 reloc_high constructor.
296 (Mips_relocate_functions::relgot16_local): Likewise.
297 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
298 r_type to decide whether LO16 matches HI16.
299 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
300 rello16 and relgot16_local.
302 2015-01-09 Cary Coutant <ccoutant@google.com>
304 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
305 unless alignment is larger than page size.
307 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
308 Cary Coutant <ccoutant@google.com>
311 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
312 (DEFAULT_TARGET_X32): Set for x32.
313 * x86_64.cc (cmp_insn_32): New.
314 (lea_r10_insn_32): Likewise.
315 (lea_r11_insn_32): Likewise.
316 (cmp_insn_64): Likewise.
317 (lea_r10_insn_64): Likewise.
318 (lea_r11_insn_64): Likewise.
319 (Target_x86_64<size>::do_calls_non_split): Handle x32.
320 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
321 (check_DATA): Add split_x32 files.
322 (split_x32_[1234n].o): New targets.
323 (split_x32_[124]): New targets.
324 (split_x32_[1234r].stdout): New targets.
325 * testsuite/split_x32.sh: New file.
326 * testsuite/split_x32_1.s: Likewise.
327 * testsuite/split_x32_2.s: Likewise.
328 * testsuite/split_x32_3.s: Likewise.
329 * testsuite/split_x32_4.s: Likewise.
330 * testsuite/split_x32_n.s: Likewise.
331 * configure: Regenerated.
332 * testsuite/Makefile.in: Likewise.
334 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
337 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
340 2015-01-02 Alan Modra <amodra@gmail.com>
342 * version.cc (print_version): Just print current year.
343 * dwp.cc (print_version): Likewise.
345 2015-01-01 Alan Modra <amodra@gmail.com>
347 Update year range in copyright notice of all files.
349 2014-12-25 Alan Modra <amodra@gmail.com>
351 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
353 (Target_arm::merge_object_attributes, ): Likewise.
355 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
357 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
358 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
359 AEABI_VFP_args_vfp to check that.
360 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
361 value and replace hardcoded values by enum values.
363 2014-12-22 Cary Coutant <ccoutant@google.com>
365 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
367 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
370 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
371 to "return i * i * 3;".
373 2014-12-16 Cary Coutant <ccoutant@google.com>
375 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
376 (Mapfile::print_output_data): Use current_data_size() to avoid
377 assert for sections requiring postprocessing; if address is not valid,
379 (Mapfile::print_output_section): Use current_data_size(); print note
380 that addresses and sizes are before compression.
382 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
384 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
385 Cast current_group_size to unsigned long when reporting error.
387 2014-12-10 Jing Yu <jingyu@google.com>
389 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
390 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
391 Update error message.
392 (Target_aarch64::do_relax): Use absolute value of option
393 stub_group_size. Replace local variable with class member
396 2014-12-04 Alan Modra <amodra@gmail.com>
398 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
399 addend of PLTREL24 reloc when not generating a plt stub. Make
400 max_branch_offset an "Address".
401 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
402 (Target_powerpc::Relocate::relocate): Likewise.
404 2014-12-04 Alan Modra <amodra@gmail.com>
407 * symtab.cc (Symbol::set_undefined): Remove assertion.
408 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
409 on symbols defined in discarded sections, instead return false.
410 Rearrange params, update all callers.
411 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
412 branches to syms in discarded sections.
413 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
414 undefined and flag as discarded.
415 (Target_powerpc::Relocate::relocate): Localize variable.
417 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
420 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
421 * testsuite/Makefile.in: Regenerated.
423 2014-12-03 Alan Modra <amodra@gmail.com>
426 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
427 when adding dynamic relocations against section symbols.
429 2014-12-01 Dimitry Ivanov <dimitry@google.com>
431 * layout.cc (Layout::finish_dynamic_section): When '-z global'
432 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
433 * options.h (General_options): New -z option (global).
435 2014-12-01 Cary Coutant <ccoutant@google.com>
438 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
440 (Layout::create_executable_stack_info): Warn when -z noexecstack is
441 given but some inputs require executable stack.
443 2014-11-26 Cary Coutant <ccoutant@google.com>
445 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
446 .debug_str_offsets; strip .debug_gnu_pubnames and
448 (lines_only_debug_sections): Strip all four new sections.
450 2014-11-26 Jing Yu <jingyu@google.com>
452 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
453 register to be x0 when to relax TLSDESC_LD64_LO12.
455 2014-11-26 Alan Modra <amodra@gmail.com>
457 * powerpc.cc (struct Stub_table_owner): New.
458 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
459 unsigned int vector. Update all references.
460 (powerpc_relobj::set_stub_table): Take an unsigned int param
461 rather than a Stub_table. Update callers.
462 (Powerpc_relobj::clear_stub_table): New function.
463 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
464 stub_group_size_ vars.
465 (Target_powerpc::new_stub_table): Delete.
466 (max_branch_delta): New function, extracted from..
467 (Target_powerpc::Relocate::relocate): ..here..
468 (Target_powerpc::Branch_info::make_stub): ..and here. Return
469 status on whether stub created successfully.
470 (Stub_control::Stub_control): Add "no_size_errors" param. Move
472 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
473 reduce on relax failure.
474 (Target_powerpc::group_sections): Add "no_size_errors" param.
475 Use stub_group_size_. Set up group info in a temp vector,
476 before building Stub_table vector. Account for input sections
477 possibly already converted to relaxed sections.
478 (Stub_table::init): Delete. Merge into..
479 (Stub_table::Stub_table): ..here.
480 (Stub_table::can_reach_stub): New function.
481 (Stub_table::add_plt_call_entry): Add "from" parameter and
482 return true iff stub could be reached.
483 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
485 (Stub_table::clear_stubs): Add "all" param.
487 2014-11-26 Alan Modra <amodra@gmail.com>
489 * powerpc.cc (Stub_control::set_output_and_owner): New function.
490 (Target_powerpc::group_sections): Use it.
492 2014-11-25 Cary Coutant <ccoutant@google.com>
494 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
495 (Binary_to_elf::write_symbol): Add st_size parameter.
496 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
498 2014-11-25 Cary Coutant <ccoutant@google.com>
501 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
502 (Sized_relobj_file::do_layout): Handle deferred sections properly
503 during GC pass 1. Don't add reloc sections to deferred list twice.
504 * object.h (Sized_relobj_file::is_deferred_layout): New function.
505 (Sized_relobj_file::is_deferred_layout_): New data member.
507 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
510 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
511 Check PC-relative offset overflow in PLT entry.
513 2014-11-21 Alan Modra <amodra@gmail.com>
515 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
518 2014-11-20 Alan Modra <amodra@gmail.com>
520 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
521 from --stub-group-size parameter divided by 1024.
522 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
523 template parameter. Update all uses.
524 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
525 has_stub_value. Set for long branches. Don't report overflow for
526 branch to undefined weak symbols. Print info message on
527 overflowing branch to stub.
529 2014-11-20 Alan Modra <amodra@gmail.com>
531 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
533 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
535 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
536 entry for R_X86_64_GOTPLT64.
537 (Target_x86_64<size>::Relocate::relocate): Update comments for
540 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
542 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
543 * plugin.h: add lock definition
545 2014-10-29 Han Shen <shenhan@google.com>
546 Jing Yu <jingyu@google.com>
548 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
549 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
550 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
552 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
554 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
555 (Target_aarch64::tls_ld_to_le): New method.
556 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
558 (Output_data_plt_aarch64::irelative_rel_): New data member.
559 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
560 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
561 (Output_data_plt_aarch64::add_relocation): New method.
562 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
563 offset. Add got_irelative size to got size.
564 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
565 type string with the new typename.
566 (AArch64_relocate_functions::update_adr): Replace parameter x with
568 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
569 (AArch64_relocate_functions::reloc_common): New method.
570 (AArch64_relocate_funcsions::rela_general): Extract common part out
571 into reloc_common method.
572 (AArch64_relocate_functions::rela_general): Likewise.
573 (AArch64_relocate_functions::pcrela_general): Likewise.
574 (AArch64_relocate_functions::adr): New method.
575 (AArch64_relocate_functions::adrp): Calculate immed before calling
577 (AArch64_relocate_functions::adrp): Likewise.
578 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
579 comparing x to 0. Calculate immed from ~x when x < 0.
580 (Target_aarch64::optimize_tls_reloc): Add new cases for
581 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
582 TLSLD_MOVW_DTPREL_G0_NC.
583 (Target_aarch64::possible_function_pointer_reloc): Implement this
585 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
587 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
588 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
589 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
590 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
591 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
592 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
593 (Target_aarch64::make_plt_entry): Call add_entry with two more
595 (Target_aarch64::make_local_ifunc_plt_entry): New method.
596 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
597 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
598 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
599 (Target_aarch64::Relocate::relocate_tls): Add cases for
600 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
601 TLSLD_MOVW_DTPREL_G0_NC.
602 * testsuite/icf_safe_so_test.cc: Correct test comment.
603 * testsuite/icf_safe_test.sh: Add AArch64 arch.
605 2014-10-22 Alan Modra <amodra@gmail.com>
607 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
610 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
612 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
614 2014-10-17 Cary Coutant <ccoutant@google.com>
616 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
617 Add "typename" keyword.
619 2014-10-15 Han Shen <shenhan@google.com>
620 Jing Yu <jingyu@google.com>
622 Patch for gold aarch64 backend to support relaxation.
623 * aarch64-reloc.def: Change format.
624 * aarch64.cc (class Reloc_stub): New class.
625 (class Stub_table): New class.
626 (class AArch64_relobj): New class.
627 (class AArch64_input_section): New class.
628 (class AArch64_output_section): New class.
629 (Target_aarch64::new_stub_table): New method.
630 (Target_aarch64::new_aarch64_input_section): New method.
631 (Target_aarch64::find_aarch64_input_section): New method.
632 (Target_aarch64::scan_section_for_stubs): New method.
633 (Target_aarch64::scan_reloc_section_for_stubs): New method.
634 (Target_aarch64::relocate_stub): New method.
635 (Target_aarch64::current_target): New method.
636 (Target_aarch64::do_make_elf_object): New method.
637 (Target_aarch64::do_may_relax): New method.
638 (Target_aarch64::do_relax): New method.
639 (Target_aarch64::group_sections): New method.
640 (Target_aarch64::scan_reloc_for_stub): New method.
641 (Target_aarch64::do_make_output_section): New method.
642 (Target_aarch64::stub_tables_): New data member.
643 (Target_aarch64::aarch64_input_section_map_): New data member.
644 (AArch64_relocate_functions::maybe_apply_stub): New method.
646 2014-09-30 Cary Coutant <ccoutant@google.com>
649 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
651 2014-09-30 Kito Cheng <kito@0xlab.org>
654 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
655 hash table before sysv-style hash table.
657 2014-09-29 Sriraman Tallam <tmsriram@google.com>
659 * options.h (--pic-executable): Add negative to alias to -no-pie.
661 2014-09-26 Cary Coutant <ccoutant@google.com>
664 * object.cc (Sized_relobj_file): Compute value of section symbols
665 for TLS sections the same as TLS symbols.
667 2014-09-25 Cary Coutant <ccoutant@google.com>
670 * resolve.cc (Symbol_table::resolve): Override common placeholder
671 symbols, but adjust sizes.
672 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
673 symbols to common lists.
675 2014-09-24 Alan Modra <amodra@gmail.com>
677 * po/POTFILES.in: Regenerate.
679 2014-09-23 Taiju Tsuiki <tzik@google.com>
680 Cary Coutant <ccoutant@google.com>
683 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
684 on input_sections_blocker.
685 * layout.cc (Write_sections_task::locks): Unblock
686 input_sections_blocker_.
687 * layout.h (Write_sections_task::Write_sections_task): Add
688 input_sections_blocker.
689 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
691 * testsuite/Makefile.in: Regenerate.
693 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
695 * testsuite/Makefile.am (plugin_test_10): New test.
696 * testsuite/Makefile.in: Regenerate
697 * testsuite/plugin_common_test_2.c (c1): Align to 8.
698 * testsuite/plugin_test_10.sh: New file.
700 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
702 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
703 * resolve.cc (Symbol_table::resolve): Don't override common symbols
704 during the replacement phase.
706 2014-09-17 Han Shen <shenhan@google.com>
707 Jing Yu <jingyu@google.com>
709 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
710 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
711 * aarch64.cc (Target_aarch64): Add data members
712 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
713 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
715 (Target_aarch64::do_reloc_symbol_index): New method.
716 (Target_aarch64::do_reloc_addend): New method.
717 (Target_aarch64::add_tlsdesc_info): New method.
718 (Target_aarch64::do_dynsym_value): New method.
719 (Target_aarch64::do_make_data_plt): Add new parameters: got,
720 got_irelative. Pass them to Output_data_plt_aarch64_standard.
721 (Target_aarch64::make_data_plt): Add new parameters: got,
722 got_irelative. Pass them to do_make_data_plt.
723 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
724 (Target_aarch64::Relocate:tls_gd_to_le): New method.
725 (Target_aarch64::Relocate:tls_ie_to_le): New method.
726 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
727 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
728 (Target_aarch64::got_tlsdesc_section): New method.
729 (Target_aarch64::make_local_ifunc_plt_entry): New method.
730 (Target_aarch64::define_tls_base_symbol): New method.
731 (Target_aarch64::reserve_tlsdesc_entries): New method.
732 (Target_aarch64::got_mod_index_entry): New method.
733 (Target_aarch64::rela_tlsdesc_section): New method.
734 (Target_aarch64::rela_irelative_section): New method.
735 (Target_aarch64::Tlsdesc_info): New struct.
736 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
737 relocations and tlsdesc relocations.
738 (Target_aarch64::optimize_tls_reloc): Implement method.
739 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
740 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
742 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
743 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
744 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
745 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
746 (Output_data_plt_aarch64::rela_tlsdesc): New method.
747 (Output_data_plt_aarch64::rela_irelative): New method.
748 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
749 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
750 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
751 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
752 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
753 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
754 (Output_data_plt_aarch64_standard): New member variables:
755 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
756 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
757 New parameter: got, got_irelative.
758 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
759 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
760 (Output_data_plt_aarch64::do_write): Replace got_address with
761 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
762 (AArch64_relocate_functions::update_movnz): New method.
763 (AArch64_relocate_functions): Correct format.
764 (AArch64_relocate_functions::movnz): New method.
765 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
766 before the switch. Add new cases to switch.
767 Check ie_to_le relaxation on tlsie relocations. Add code handling
769 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
770 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
771 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
772 Call reloc_name_in_error_message to print unsupported reloc.
773 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
775 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
776 relocs. Fill in some more dynamic tags.
777 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
778 Skip call tls_get_addr when tlsgd is relaxed.
779 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
780 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
781 tlsdesc->ie relaxation.
783 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
785 * mips.cc (Target_mips_nacl): New class.
786 (Target_selector_mips_nacl): New class.
787 (target_selector_mips32): Rename from target_selector_mips32be and use
788 Target_selector_mips_nacl instead of Target_selector_mips.
789 (target_selector_mips32el): Rename from target_selector_mips32 and use
790 Target_selector_mips_nacl instead of Target_selector_mips.
791 (target_selector_mips64): Rename from target_selector_mips64be and use
792 Target_selector_mips_nacl instead of Target_selector_mips.
793 (target_selector_mips64el): Rename from target_selector_mips64 and use
794 Target_selector_mips_nacl instead of Target_selector_mips.
795 (Target_mips::mips_info): Add const attribute.
797 2014-09-02 Cary Coutant <ccoutant@google.com>
799 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
800 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
801 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
802 (Sized_incr_dynobj::do_section_name): Likewise.
803 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
804 (Sized_incr_dynobj::do_section_name): Likewise.
805 * object.h (Object::section_name): Likewise.
806 (Object::do_section_name): Likewise.
807 (Sized_relobj_file::do_section_name): Likewise.
808 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
809 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
811 2014-09-02 Cary Coutant <ccoutant@google.com>
814 * ehframe.cc (Fde::write): Add output_offset parameter.
815 (Cie::write): Likewise.
816 (Eh_frame::set_final_data_size): Account for offset within output
818 (Eh_frame::do_sized_write): Likewise.
819 * ehframe.h (Fde::write): Add output_offset parameter.
820 (Cie::write): Likewise.
821 * output.cc (Output_section::Input_section_sort_entry): Remove
822 section_has_name_; add output_section_name parameter. Use
823 output section name for non-input sections.
824 (Output_section::Input_section_sort_entry::section_has_name): Remove.
825 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
826 (Output_section::Input_section_sort_compare): Remove logic for
827 sections without names.
828 (Output_section::Input_section_sort_init_fini_compare): Likewise.
829 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
831 (Output_section::Input_section_sort_section_name_compare): Likewise.
833 2014-08-29 Han Shen <shenhan@google.com>
834 Jing Yu <jingyu@google.com>
836 * aarch64-reloc-property.cc
837 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
838 reference reloc property in the table.
839 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
841 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
842 2 new overloaded methods.
843 (Output_data_got_aarch64::do_write): Add code to write out
845 (class Output_data_got_aarch64::Static_reloc): New class to wrap
847 (Output_data_got_aarch64::static_relocs): New vector to
849 (Target_aarch64::TCB_SIZE): New const static memeber.
850 (Target_aarch64::tcb_size): New method.
851 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
852 (Target_aarch64::Relocate::relocate_tls): New method.
853 (Target_aarch64::Scan::local): Add code handling new reloc types.
854 (Target_aarch64::Scan::global): Add code handling new reloc types.
856 2014-08-13 Sriraman Tallam <tmsriram@google.com>
858 * options.h (-no-pie): Add option.
860 2014-08-08 Jing Yu <jingyu@google.com>
861 Han Shen <shenhan@google.com>
863 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
864 (DEFFILES): add aarch64-reloc.def.
865 (TARGETSOURCES): Add aarch64-reloc-property.cc.
866 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
867 * Makefile.in: Regenerate.
868 * aarch64-reloc-property.cc: New file.
869 * aarch64-reloc-property.h: New file.
870 * aarch64-reloc.def: New file.
871 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
872 with tab to make the format consistent.
873 (Output_data_got_aarch64::symbol_table_): New method.
874 (Target_aarch64::do_plt_address_for_global): New method.
875 (Target_aarch64::do_plt_address_for_local): New method.
876 (Target_aarch64::do_select_as_default_target): New method.
877 (Target_aarch64::do_make_data_plt): New method.
878 (Target_aarch64::make_data_plt): New method.
879 (Output_data_plt_aarch64::has_irelative_section): New method.
880 (Output_data_plt_aarch64::address_for_global): New method.
881 (Output_data_plt_aarch64::address_for_local): New method.
882 (Output_data_plt_aarch64::irelative_rel_): New parameter.
883 (Output_data_plt_aarch64::add_entry): Implement contents.
884 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
885 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
886 the got_pov entry to plt0.
887 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
889 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
890 (AArch64_howto): New struct.
891 (aarch64_howto[]): New static const array.
892 (AArch64_relocate_functions): New class.
893 (Target_aarch64::Scan::get_reference_flags): Remove method.
894 (Target_aarch64::Scan::local): Implement to support a few relocations.
895 (Target_aarch64::Scan::global): Implement to support a few relocations.
896 (Target_aarch64::make_plt_section): Implement contents.
897 (Target_aarch64::make_plt_entry): Implement contents.
898 (Target_aarch64::do_finalize_sections): Implement contents.
899 (Target_aarch64::Relocate::relocate): Implement a few relocations.
900 (Target_aarch64::relocate_section): Implement contents.
902 2014-08-06 Alan Modra <amodra@gmail.com>
904 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
906 2014-08-06 Alan Modra <amodra@gmail.com>
909 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
911 2014-07-21 Sriraman Tallam <tmsriram@google.com>
913 * object.cc (Relobj::is_section_name_included): Add
914 ".rodata.nptl_version" to not garbage collect this section.
916 2014-07-08 Cary Coutant <ccoutant@google.com>
918 * expression.cc (struct Expression::Expression_eval_info): Add
919 new fields type_pointer, vis_pointer, and nonvis_pointer.
920 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
921 nonvis_pointer parameters. Adjust all calls.
922 (Symbol_expression::value): Update type, visibility, and nonvis bits
924 * script.cc (Symbol_assignment::sized_finalize): Update type,
925 visibility, and remaining st_other bits for new symbol.
926 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
927 vis_pointer, and nonvis_pointer parameters.
928 * symtab.h (Symbol::set_type): New method.
930 * testsuite/Makefile.am (defsym_test): New test.
931 * testsuite/Makefile.in: Regenerate.
932 * testsuite/defsym_test.c: New file.
933 * testsuite/defsym_test.sh: New file.
935 2014-07-08 Cary Coutant <ccoutant@google.com>
938 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
939 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
940 (Sized_dynobj::base_read_symbols): ...new method.
941 * object.h (Sized_relobj_file::base_read_symbols): New method.
942 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
943 (Sized_relobj_file::base_read_symbols): ...new method.
944 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
945 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
946 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
948 2014-07-04 Alan Modra <amodra@gmail.com>
950 * po/POTFILES.in: Regenerate.
952 2014-07-02 Jing Yu <jingyu@google.com>
954 * aarch64.cc: New file
955 * Makefile.am (TARGETSOURCES): Add aarch64.cc
956 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
957 * Makefile.in: Regenerate.
958 * configure.tgt: Add entries for aarch64*.
959 * configure.ac: Likewise.
960 * configure: Likewise.
962 2014-06-27 Alan Modra <amodra@gmail.com>
964 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
966 2014-06-24 Cary Coutant <ccoutant@google.com>
968 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
970 (Dwo_file::sized_read_unit_index): Likewise.
972 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
975 * Makefile.am (TARGETSOURCES): Add mips.cc
976 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
977 * configure.tgt: Add entries for mips*.
978 * configure.ac: Likewise.
979 * Makefile.in: Regenerate.
980 * configure: Likewise.
982 2014-06-09 Cary Coutant <ccoutant@google.com>
984 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
985 unit_length is within section bounds.
987 2014-06-09 Cary Coutant <ccoutant@google.com>
990 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
993 2014-06-07 Alan Modra <amodra@gmail.com>
995 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
997 2014-06-06 Cary Coutant <ccoutant@google.com>
999 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1000 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1001 (Dwarf_pubnames_table::read_header): Likewise.
1002 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1003 .debug_gnu_pubtypes.
1005 2014-06-05 Joel Brobecker <brobecker@adacore.com>
1007 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1008 * Makefile.in, configure: Regenerate.
1010 2014-06-03 Alan Modra <amodra@gmail.com>
1012 * powerpc.cc (addis_12_2): Define.
1013 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1015 2014-06-03 Alan Modra <amodra@gmail.com>
1017 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1020 2014-06-02 Alan Modra <amodra@gmail.com>
1022 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1023 Only ignore relocs on ELFv1.
1024 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1026 2014-05-30 Cary Coutant <ccoutant@google.com>
1028 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1029 * testsuite/Makefile.in: Regenerate.
1030 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1032 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1035 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1036 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1038 2014-05-15 Alan Modra <amodra@gmail.com>
1040 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1041 Compare FDE contents with DW_CFA_nop rather than 0.
1043 2014-05-13 Sriraman Tallam <tmsriram@google.com>
1045 * symtab.h (may_need_copy_reloc): Remove check for position independent
1047 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1048 position independence before pc absolute may_need_copy_reloc call.
1049 Add check for executable output befor pc relative may_need_copy_reloc
1055 * powerpc.cc: Add check for no position independence before
1056 may_need_copy_reloc calls.
1057 * testsuite/pie_copyrelocs_test.cc: New file.
1058 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1059 * Makefile.am (pie_copyrelocs_test): New test.
1060 * Makefile.in: Regenerate.
1062 2014-05-08 Martin Liška <mliska@suse.cz>
1064 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1066 2014-05-06 Cary Coutant <ccoutant@google.com>
1069 * i386.cc (Output_data_got_plt_i386): New class.
1070 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1071 parameter. Change all callers.
1072 (Output_data_plt_i386::layout_): Remove.
1073 (Output_data_plt_i386::got_plt_): Change type.
1074 (Target_i386::got_plt_): Change type. Change all references.
1075 (Target_i386::got_section): Create instance of new class.
1076 (Output_data_got_plt_i386::do_write): New function.
1077 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1078 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1079 parameter. Change all callers.
1080 (Output_data_plt_x86_64::layout_): Remove.
1081 (Output_data_plt_x86_64::got_plt_): Change type.
1082 (Target_x86_64::got_plt_): Change type. Change all references.
1083 (Target_x86_64::got_section): Create instance of new class.
1084 (Output_data_got_plt_x86_64::do_write): New function.
1085 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1086 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1089 2014-05-05 Cary Coutant <ccoutant@google.com>
1091 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1092 if we have pubnames/pubtypes.
1094 2014-05-02 Cary Coutant <ccoutant@google.com>
1096 * defstd.cc (in_segment): Define __ehdr_start here...
1097 * layout.cc (Layout::finalize): ...Instead of here. Set the
1098 output segment when known.
1099 * resolve.cc (Symbol::override_base_with_special): Remember
1100 the original binding.
1101 * symtab.cc (Symbol::set_output_segment): New function.
1102 (Symbol::set_undefined): New function.
1103 * symtab.h (Symbol::is_weak_undefined): Check original undef
1105 (Symbol::is_strong_undefined): New function.
1106 (Symbol::set_output_segment): New function.
1107 (Symbol::set_undefined): New function.
1108 * target-reloc.h (is_strong_undefined): Remove.
1109 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1110 Check for hidden undefs.
1111 (relocate_section): Call Symbol::is_strong_undefined.
1113 * testsuite/Makefile.am (ehdr_start_test_1)
1114 (ehdr_start_test_2, ehdr_start_test_3)
1115 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1116 * testsuite/Makefile.in: Regenerate.
1117 * testsuite/ehdr_start_def.cc: New source file.
1118 * testsuite/ehdr_start_test.cc: New source file.
1119 * testsuite/ehdr_start_test.t: New linker script.
1120 * testsuite/ehdr_start_test_4.sh: New shell script.
1122 2014-04-23 Cary Coutant <ccoutant@google.com>
1125 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1127 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1129 * layout.cc (Layout::include_section): Allow a target to decide
1130 whether to include a section.
1131 * target.h (Target::should_include_section): New function.
1132 (Target::do_should_include_section): New function.
1134 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1136 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1138 (Copy_relocs::emit): ... here.
1139 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1140 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1141 (Copy_reloc_entry::entries_): Change from private to protected.
1143 2014-04-02 Sriraman Tallam <tmsriram@google.com>
1145 * icf.cc (get_section_contents): Replace copies of reloc
1146 vectors with const references.
1148 2014-04-02 Cary Coutant <ccoutant@google.com>
1150 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1151 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1152 * configure: Regenerate.
1153 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1154 -fno-use-linker-plugin.
1155 (LINK1, CXXLINK1): Add it to the link command.
1156 * testsuite/Makefile.in: Regenerate.
1158 2014-03-12 Alan Modra <amodra@gmail.com>
1160 * Makefile.in: Regenerate.
1162 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1164 * symtab.h (Symbol::set_nonvis): New function.
1166 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1168 * symtab.cc (Sized_symbol<32>::init_output_data):
1169 Instantiate the template.
1170 (Sized_symbol<64>::init_output_data): Likewise.
1172 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1174 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1175 adjust dynamic symbol value.
1176 * target.h (Target::adjust_dyn_symbol): New function.
1177 (Target::do_adjust_dyn_symbol): New function.
1179 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1181 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1182 Get the value of DYNAMIC_CUSTOM dynamic entry.
1183 * output.h (Output_data_dynamic::add_custom): New function.
1184 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1186 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1187 * target.h (Target::dynamic_tag_custom_value): New function.
1188 (Target::do_dynamic_tag_custom_value): New function.
1190 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1192 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1194 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1195 (Target::do_has_custom_set_dynsym_indexes): New function.
1196 (Target::set_dynsym_indexes): New function.
1197 (Target::do_set_dynsym_indexes): New function.
1199 2014-03-07 Alan Modra <amodra@gmail.com>
1201 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1202 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1203 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1204 (Powerpc_relocate_functions::has_overflow_bitfield,
1205 overflowed): Use the above.
1206 (Target_powerpc::Relocate::relocate): Correct overflow checking
1207 for a number of relocations. Modify overflow test for 16-bit
1208 fields in instructions to signed/unsigned according to whether
1209 the field takes a signed or unsigned value.
1211 2014-03-05 Alan Modra <amodra@gmail.com>
1213 Update copyright years.
1215 2014-03-05 Alan Modra <amodra@gmail.com>
1217 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1218 R_PPC64_ADDR64_LOCAL.
1219 (Target_powerpc::Relocate::relocate): Likewise.
1221 2014-03-03 Alan Modra <amodra@gmail.com>
1223 * dwp.cc (print_version): Update copyright year to current.
1225 2014-02-10 Alan Modra <amodra@gmail.com>
1227 * po/gold.pot: Regenerate.
1229 2014-02-06 Cary Coutant <ccoutant@google.com>
1231 Fix problem where -u is ignored when a weak undef is seen.
1233 * archive.cc (Library_base::should_include_member): Reorder
1234 code to check for -u option if a weak undef has already been seen.
1235 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1236 * testsuite/Makefile.in: Regenerate.
1237 * testsuite/weak_undef_file3.cc: New file.
1238 * testsuite/weak_undef_file4.cc: New file.
1239 * testsuite/weak_undef_test_2.cc: New file.
1241 2014-02-05 Cary Coutant <ccoutant@google.com>
1243 Fix issues with gold undefined symbol diagnostics.
1246 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1248 * target-reloc.h (is_strong_undefined): New function.
1249 (relocate_section): Move undef vtable symbol check from here.
1250 Check for is_strong_undefined.
1252 2014-02-05 Cary Coutant <ccoutant@google.com>
1254 Fix problems with the --dynamic-list option.
1257 * options.cc (General_options::parse_dynamic_list):
1258 Set have_dynamic_list_.
1259 (General_options::General_options): Initialize have_dynamic_list_.
1260 (General_options::finalize): Turn off -Bsymbolic and
1261 -Bsymbolic-functions if --dynamic-list provided.
1262 * options.h (General_options::have_dynamic_list): New function.
1263 (General_options::have_dynamic_list_): New data member.
1264 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1268 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1269 in --dynamic-list, mark it.
1271 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1272 (dynamic_list_2): New test case.
1273 * testsuite/Makefile.in: Regenerate.
1274 * testsuite/dynamic_list_2.cc: New file.
1275 * testsuite/dynamic_list_2.t: New file.
1276 * testsuite/dynamic_list_lib1.cc: New file.
1277 * testsuite/dynamic_list_lib2.cc: New file.
1278 * testsuite/gc_dynamic_list_test.c: New file.
1279 * testsuite/gc_dynamic_list_test.sh: New file.
1280 * testsuite/gc_dynamic_list_test.t: New file.
1282 2014-01-28 Cary Coutant <ccoutant@google.com>
1284 Add .gdb_index version 7 support.
1286 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1287 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1289 (Dwarf_ranges_table::read_ranges_table): Likewise.
1290 (Dwarf_pubnames_table::read_section): Check for GNU-style
1291 sections, and for compressed debug sections.
1292 (Dwarf_pubnames_table::read_header): Compute end address of table.
1293 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1294 for end of list by offset, not by offset == 0.
1295 (Dwarf_info_reader::do_read_string_table): Check for compressed
1297 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1298 Initialize new data members.
1299 (Dwarf_pubnames_table::next_name): return flag_byte.
1300 (Dwarf_pubnames_table::end_of_table_): New data member.
1301 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1302 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1303 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1304 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1305 read skeleton type unit DIEs.
1306 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1307 (Gdb_index::do_write): Write flag_byte.
1308 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1309 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1310 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1311 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1313 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1315 * version.cc (print_version): Update copyright year to 2014.
1317 2013-12-19 Dimitry Andric <dimitry@andric.com>
1319 * stringpool.cc (Stringpool_template::reserve): Add
1320 HAVE_UNORDERED_MAP case.
1321 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1323 2013-12-18 Cary Coutant <ccoutant@google.com>
1325 * configure.ac: Check for <unordered_set> and <unordered_map>.
1326 * config.in: Regenerate.
1327 * configure: Regenerate.
1328 * system.h: Use <unordered_set> and <unordered_map> if available.
1330 2013-12-10 Roland McGrath <mcgrathr@google.com>
1332 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1333 with $(INSTALL_PROGRAM_ENV).
1334 * Makefile.in: Regenerate.
1336 2013-11-22 Cary Coutant <ccoutant@google.com>
1338 * configure.ac: Add check for which library is needed for
1340 * configure: Regenerate.
1342 2013-11-22 Cary Coutant <ccoutant@google.com>
1344 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1346 * testsuite/Makefile.in: Regenerate.
1348 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1350 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1351 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1352 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1353 (Target_x86_64<size>::Scan::local): Likewise.
1354 (Target_x86_64<size>::Scan::global): Likewise.
1355 (Target_x86_64<size>::Relocate::relocate): Likewise.
1356 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1358 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1361 * testsuite/Makefile.am (check_PROGRAMS): Add
1362 exception_x86_64_bnd_test.
1363 (exception_x86_64_bnd_test_SOURCES): New macro.
1364 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1365 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1366 (exception_x86_64_bnd_test_LDADD): Likewise.
1367 (exception_x86_64_bnd_1.o): New rule.
1368 (exception_x86_64_bnd_2.o): Likewise.
1369 * testsuite/Makefile.in: Regenerated.
1371 2013-11-15 Alan Modra <amodra@gmail.com>
1373 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1375 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1376 Only call ppc64_local_entry_offset for 64-bit. Restrict
1377 symval_for_branch lookup to ELFv1.
1378 (Stub_table::add_plt_call_entry): Use unsigned int off.
1379 (Output_data_glink::Address, invalid_address): New.
1380 (Output_data_glink::add_eh_frame): Move out of line. Add
1382 (Output_data_glink::add_global_entry, find_global_entry,
1383 global_entry_address): New functions.
1384 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1385 ge_size): New variables.
1386 (Output_data_glink::set_final_data_size): Add global entry
1388 (Output_data_glink::do_write): Write global entry stubs.
1389 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1390 parameter. Return true for ELFv2. Adjust callers.
1391 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1392 ELFv1. Similarly for ifunc and dynamic relocation processing
1393 specific to ELFv1. Recognize that symbols are defined on
1394 their plt entries for ELFv2.
1395 (Target_powerpc::symval_for_branch): Assert if called for
1397 (Target_powerpc::Relocate::relocate): Use global entry plt
1398 stub for symbol value if such exists on ELFv2.
1399 (Target_powerpc::Relocate::relocate): Don't call
1400 symval_for_branch when ELFv2. Do adjust for local entry
1402 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1404 (Target_powerpc::do_plt_address_for_global): Similarly.
1406 2013-11-14 Cary Coutant <ccoutant@google.com>
1408 Revert patch -- this did not fix the problem, and there is
1411 2013-11-14 Cary Coutant <ccoutant@google.com>
1414 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1415 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1416 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1417 updating fde_offsets_.
1418 (Eh_frame_hdr::lock_): New data member.
1420 2013-11-14 Cary Coutant <ccoutant@google.com>
1422 * dwp.cc (Dwo_file_entry): New type.
1423 (File_list): Use Dwo_file_entry.
1424 (Dwo_file::verify): New function.
1425 (Dwo_file::verify_dwo_list): New function.
1426 (Dwo_file::sized_verify_dwo_list): New function.
1427 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1429 (Dwp_options): New enum type.
1430 (dwp_options): Add --verify-only.
1433 * dwp.h (gold_info): Add declaration.
1435 2013-11-14 Cary Coutant <ccoutant@google.com>
1438 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1439 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1440 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1441 updating fde_offsets_.
1442 (Eh_frame_hdr::lock_): New data member.
1444 2013-11-06 Cary Coutant <ccoutant@google.com>
1447 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1448 before reloc sections.
1450 2013-11-04 Alan Modra <amodra@gmail.com>
1452 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1453 (Symbol::needs_dynamic_reloc): Test new flag.
1454 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1455 (Target_powerpc::Scan::get_reference_flags): Add target param.
1456 Return FUNC_DESC_ABI for 64-bit ELFv1.
1457 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1459 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1460 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1462 2013-10-31 Cary Coutant <ccoutant@google.com>
1464 Restore support for dwp v2 DWARF package file format.
1466 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1467 tu_length parameter. Adjust all callers.
1468 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1469 * dwp.cc: Include dwarf.h.
1470 (Section_bounds): New struct type.
1471 (Unit_set): New struct type.
1472 (Dwo_file::Dwo_file): Initialize new data member.
1473 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1474 Combine and rename to...
1475 (Dwo_file::read_unit_index): ...this.
1476 (Dwo_file::sized_read_compunit_index)
1477 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1478 (Dwo_file::sized_read_unit_index): ...this.
1479 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1480 parameters; add section_id parameter.
1481 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1482 (Dwo_file::add_unit_set): ...this.
1483 (Dwo_file::shndx_map_): Remove.
1484 (Dwo_file::sect_offsets_): New data member.
1485 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1486 (Dwp_output_file::add_section): Rename to...
1487 (Dwp_output_file::add_contribution): ...this.
1488 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1489 (Dwp_output_file::add_tu_set): Likewise.
1490 (Dwp_output_file::Contribution): New type.
1491 (Dwp_output_file::Section::contributions): New data member.
1492 (Dwp_output_file::Cu_or_tu_set): Remove.
1493 (Dwp_output_file::Section::Section): New ctor.
1494 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1495 (Dwp_output_file::Dwp_index::Section_table): New type.
1496 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1497 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1499 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1500 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1501 (Dwp_output_file::Dwp_index::section_table): New member function.
1502 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1503 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1504 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1505 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1506 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1507 (Dwp_output_file::Dwp_index::section_table_): New data member.
1508 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1509 (Dwp_output_file::add_output_section): New member function.
1510 (Dwp_output_file::write_new_section): New member function.
1511 (Dwp_output_file::write_contributions): New member function.
1512 (Dwp_output_file::section_id_map_): New data member.
1513 (class Dwo_id_info_reader): Remove.
1514 (class Unit_reader): New class.
1515 (get_dwarf_section_name): New function.
1516 (Dwo_file::read_executable): Adjust initializations of class data.
1517 (Dwo_file::read): Add support for v2 package file format.
1518 (Dwo_file::read_unit_index): Likewise.
1519 (Dwo_file::sized_read_unit_index): Likewise.
1520 (Dwo_file::copy_section): Likewise.
1521 (Dwo_file::add_unit_set): Likewise.
1522 (Dwp_output_file::add_output_section): Likewise.
1523 (Dwp_output_file::add_contribution): Likewise.
1524 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1526 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1528 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1530 (Dwp_output_file::initialize): Remove unused function.
1531 (Dwp_output_file::finalize): Add support for v2 package file format.
1532 (Dwp_output_file::write_index): Likewise.
1533 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1536 2013-10-31 Cary Coutant <ccoutant@google.com>
1538 * configure.ac: Fix check for -fmerge-constants.
1539 * configure.ac: Regenerate.
1541 2013-10-30 Roland McGrath <mcgrathr@google.com>
1543 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1544 Correct 9-byte nop sequence to match what the assembler generates.
1546 2013-10-30 Alan Modra <amodra@gmail.com>
1548 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1549 ppc64_local_entry_offset, ppc64_local_entry_offset,
1550 do_read_symbols): New functions.
1551 (Powerpc_relobj::e_flags_, st_other_): New vars.
1552 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1553 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1554 (Powerpc_relobj::e_flags_): New var.
1555 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1556 and adjust for ELFv2.
1557 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1558 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1559 (Powerpc_dynobj::do_find_special_sections): Likewise.
1560 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1561 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1562 to ELFv2 local entry.
1563 (Target_powerpc::do_relax): No thread safe barriers needed for
1565 (Output_data_plt_powerpc::initial_plt_entry_size_,
1566 plt_entry_size): Delete. Replace all uses with
1567 first_plt_entry_offset() and plt_entry_size().
1568 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1569 reserved_size parm. Update callers.
1570 (Output_data_plt_powerpc::entry_count): Update.
1571 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1572 and use Target_powerpc::first_plt_entry_offset().
1573 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1574 rename to plt_entry_size.
1575 (Output_data_plt_powerpc::add_ifunc_entry,
1576 add_local_ifunc_entry): Adjust reloc for ELFv2.
1577 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1578 (glink_eh_frame_fde_64v2): New.
1579 (Stub_table::plt_call_size): Support ELFv2 sizing.
1580 (Output_data_glink::add_eh_frame): Use the new FDE.
1581 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1582 (Stub_table::do_write): Write ELFv2 stubs and glink.
1583 (Target_powerpc::Relocate::relocate): Replaces nop after call
1584 with ld 2,24(1) and adjust local offset destination for ELFv2.
1586 2013-10-30 Alan Modra <amodra@gmail.com>
1588 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1589 (Target_powerpc::Scan::global, local): Likewise.
1590 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1591 on all ppc64 @h and @ha relocs.
1593 2013-10-14 Alan Modra <amodra@gmail.com>
1595 * output.h (Output_data_got::add_constant): Tidy.
1596 (Output_data_got::add_constant_pair): New function.
1597 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1598 methods used so as to first call reserve_ent().
1600 2013-10-11 Roland McGrath <mcgrathr@google.com>
1602 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1603 add_got_entry and add_got_entry_pair.
1605 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1606 (HAVE_PUBNAMES): Likewise.
1607 * configure: Regenerate.
1609 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1610 * testsuite/Makefile.in: Regenerate.
1612 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1613 Remove const from declaration.
1614 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1615 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1616 * output.h (Output_file_header): Remove const from member target_
1617 and corresponding constructor argument.
1618 * output.cc (Output_file_header::Output_file_header): Update prototype.
1619 (Output_file_header::do_sized_write): Use this->target_ in place
1620 of parameters()->target().
1622 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1624 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1625 * configure: Regenerate.
1626 * Makefile.in: Regenerate.
1627 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1628 * testsuite/merge_string_literals_2.c: Likewise.
1629 * testsuite/Makefile.am
1630 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1631 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1632 literal -fmerge-constants.
1633 * testsuite/Makefile.in: Regenerate.
1635 * i386.cc (Target_i386): Remove unused member dynbss_.
1636 * arm.cc (Target_arm): Likewise.
1637 * powerpc.cc (Target_powerpc): Likewise.
1638 * sparc.cc (Target_sparc): Likewise.
1639 * tilegx.cc (Target_tilegx): Likewise.
1640 * x86_64.cc (Target_x86_64): Likewise.
1641 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1642 type_signature_, type_offset_.
1643 * plugin.h (Plugin_hook): Remove unused member layout_.
1644 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1646 (Read_member): Remove unused members input_objects_, symtab_,
1648 (Check_library): Remove unused member symtab_.
1649 * archive.h (Lib_group): Remove unused member lib_.
1650 * archive.cc (Lib_group::Lib_group): Update initializer.
1651 * incremental.h (Incremental_binary): Remove unused member target_.
1652 (Incremental_script_entry): Removed unused member script_.
1653 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1654 * icf.h (Icf): Remove unused member num_tracked_relocs.
1656 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1657 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1659 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1661 * archive.h: Use struct rather than class for forward declaration
1662 of Read_symbols_data.
1664 2013-10-07 Cary Coutant <ccoutant@google.com>
1667 * testsuite/Makefile.am (icf_test): Fix dependencies.
1668 (icf_safe_test): Likewise.
1669 (icf_safe_so_test): Likewise.
1670 (large_symbol_alignment): Add empty _LDADD rule.
1671 * testsuite/Makefile.in: Regenerate.
1673 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1676 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1677 relocation for R_X86_64_32 on x32.
1679 2013-08-27 Roland McGrath <mcgrathr@google.com>
1681 * output.cc (Output_segment::set_section_addresses): Take new
1682 Target* argument. If target->isolate_execinstr() and the segment
1683 is executable and starts at a target->abi_pagesize() boundary,
1684 pad its end out to a target->abi_pagesize() boundary with code fill.
1685 * output.h (Output_segment::set_section_addresses): Update decl.
1686 * layout.h (Layout::check_output_data_for_reset_values): Take new
1687 argument RELAX_OUTPUTS.
1688 (Layout): New member relax_output_list_.
1689 (Layout::add_relax_output): New method.
1690 * layout.cc (Layout::Layout): Update constructor.
1691 (Layout::reset_relax_output): New method.
1692 (Layout::clean_up_after_relaxation): Call it.
1693 (Layout::prepare_for_relaxation): Update caller.
1694 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1695 Call reset_relax_output before re-processing segments for
1696 isolate_execinstr case.
1697 (Layout::write_data): Handle relax_output_list_.
1698 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1699 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1701 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1704 * object.h: Fix typos.
1706 2013-08-16 Roland McGrath <mcgrathr@google.com>
1708 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1709 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1711 2013-08-07 Cary Coutant <ccoutant@google.com>
1713 Revert support for v2 DWP files:
1715 2013-03-01 Cary Coutant <ccoutant@google.com>
1717 Add dwp support for v2 DWARF package file format.
1718 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1719 tu_length parameter. Adjust all callers.
1720 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1721 * dwp.cc: Include dwarf.h.
1722 (Section_bounds): New struct type.
1723 (Unit_set): New struct type.
1724 (Dwo_file::Dwo_file): Initialize new data member.
1725 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1726 Combine and rename to...
1727 (Dwo_file::read_unit_index): ...this.
1728 (Dwo_file::sized_read_compunit_index)
1729 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1730 (Dwo_file::sized_read_unit_index): ...this.
1731 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1732 parameters; add section_id parameter.
1733 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1734 (Dwo_file::add_unit_set): ...this.
1735 (Dwo_file::shndx_map_): Remove.
1736 (Dwo_file::sect_offsets_): New data member.
1737 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1738 (Dwp_output_file::add_section): Rename to...
1739 (Dwp_output_file::add_contribution): ...this.
1740 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1741 (Dwp_output_file::add_tu_set): Likewise.
1742 (Dwp_output_file::Contribution): New type.
1743 (Dwp_output_file::Section::contributions): New data member.
1744 (Dwp_output_file::Cu_or_tu_set): Remove.
1745 (Dwp_output_file::Section::Section): New ctor.
1746 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1747 (Dwp_output_file::Dwp_index::Section_table): New type.
1748 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1749 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1751 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1752 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1753 (Dwp_output_file::Dwp_index::section_table): New member function.
1754 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1755 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1756 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1757 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1758 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1759 (Dwp_output_file::Dwp_index::section_table_): New data member.
1760 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1761 (Dwp_output_file::add_output_section): New member function.
1762 (Dwp_output_file::write_new_section): New member function.
1763 (Dwp_output_file::write_contributions): New member function.
1764 (Dwp_output_file::section_id_map_): New data member.
1765 (class Dwo_id_info_reader): Remove.
1766 (class Unit_reader): New class.
1767 (get_dwarf_section_name): New function.
1768 (Dwo_file::read_executable): Adjust initializations of class data.
1769 (Dwo_file::read): Add support for v2 package file format.
1770 (Dwo_file::read_unit_index): Likewise.
1771 (Dwo_file::sized_read_unit_index): Likewise.
1772 (Dwo_file::copy_section): Likewise.
1773 (Dwo_file::add_unit_set): Likewise.
1774 (Dwp_output_file::add_output_section): Likewise.
1775 (Dwp_output_file::add_contribution): Likewise.
1776 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1778 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1780 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1782 (Dwp_output_file::initialize): Remove unused function.
1783 (Dwp_output_file::finalize): Add support for v2 package file format.
1784 (Dwp_output_file::write_index): Likewise.
1785 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1788 2013-07-31 Cary Coutant <ccoutant@google.com>
1790 * object.cc (Sized_relobj::do_output_section_address): New function.
1791 (Sized_relobj): Instantiate explicitly.
1792 * object.h (Object::output_section_address): New function.
1793 (Object::do_output_section_address): New function.
1794 (Sized_relobj::do_output_section_address): New function.
1795 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1797 2013-07-30 Cary Coutant <ccoutant@google.com>
1798 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1800 * parameters.cc (Parameters::entry): Return target-specific entry
1802 * target.h (Target::entry_symbol_name): New function.
1803 (Target_info::entry_symbol_name): New data member.
1805 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1806 * i386.cc (Target_i386::i386_info): Likewise.
1807 (Target_i386_nacl::i386_nacl_info): Likewise.
1808 * sparc.cc (Target_sparc::sparc_info): Likewise.
1809 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1810 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1811 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1812 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1814 2013-07-22 Sterling Augustine <saugustine@google.com>
1816 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1817 Convert parameter shndx to local variable. Add parameters symtab
1818 and symtab_size. Scan over section names. Find relocation
1819 section corresponding to current section. Create and initialize
1820 reloc_mapper_ and reloc_type_.
1821 (Dwarf_pubnames_table::read_header): Add assertion. Change
1822 unit_length to off_t. Initialize member unit_length_. Fill in field
1824 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1825 Initialize new fields unit_length_ and cu_offset_.
1826 (Dwarf_pubnames_table::read_section): Update prototype.
1827 (Dwarf_pubnames_table::cu_offset): New member function.
1828 (Dwarf_pubnames_table::subsection_size): Likewise.
1829 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1831 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1832 member functions public.
1833 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1834 Update comment. Rework logic. Move repeated parts to...
1835 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1836 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1837 pubtypes_table_, and stmt_list_offset.
1838 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1839 Gdb_index::find_pubtype_offset,
1840 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1841 (Gdb_index::pubnames_read): Update prototype and rework logic.
1842 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1844 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1845 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1846 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1847 Gdb_index::map_pubtable_to_dies):
1849 (Gdb_index::pubnames_read): Update declaration.
1850 (Gdb_index::Pubname_offset_map): New type.
1851 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1852 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1853 Gdb_index::stmt_list_offset): Declare.
1854 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1855 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1856 Gdb_index::pubtypes_offset_): Remove.
1858 2013-07-19 Roland McGrath <mcgrathr@google.com>
1860 * options.h (General_options): Add -Trodata-segment option.
1861 * parameters.cc (Parameters::check_rodata_segment): New function.
1862 (Parameters::set_target_once): Call it.
1863 * parameters.h (Parameters): Declare it (private member function).
1864 * layout.cc (load_seg_unusable_for_headers): New function, broken
1865 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1866 then validate rodata segment rather than text segment.
1867 (relaxation_loop_body): Call that.
1868 (is_text_segment): New function. Don't admit a non-executable
1869 segment if TARGET->isolate_execinstr().
1870 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1872 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
1875 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1876 * nacl.h (Sniff_file::View::View): Request aligned view.
1878 2013-07-11 Cary Coutant <ccoutant@google.com>
1880 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1881 correct BRLT entry size.
1883 2013-07-03 Alan Modra <amodra@gmail.com>
1885 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1888 2013-07-01 Cary Coutant <ccoutant@google.com>
1890 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1892 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1893 (Dwarf_ranges_table::lookup_reloc): New function.
1894 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1896 (Dwarf_ranges_table::lookup_reloc): New function.
1897 (Dwarf_ranges_table::reloc_type_): New data member.
1899 2013-06-27 Jing Yu <jingyu@google.com>
1902 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1904 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1905 (Target_powerpc::do_relax): Call the above.
1907 2013-06-27 Cary Coutant <ccoutant@google.com>
1909 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1910 on garbage collected .opd section.
1912 2013-06-27 Alan Modra <amodra@gmail.com>
1914 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1916 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1917 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1919 2013-06-14 Cary Coutant <ccoutant@google.com>
1921 * resolve.cc (Symbol::override_base): Don't override st_type
1922 from plugin placeholder symbols.
1923 (Symbol_table::resolve): Likewise.
1924 (Symbol_table::should_override): Don't complain about TLS mismatch
1925 if the TO symbol is a plugin placeholder.
1926 * testsuite/Makefile.am (plugin_test_tls): New test.
1927 * testsuite/Makefile.in: Regenerate.
1928 * testsuite/plugin_test_tls.sh: New test script.
1929 * testsuite/two_file_test_2_tls.cc: New test source.
1930 * testsuite/two_file_test_tls.cc: New test source.
1932 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1934 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1935 the maximum segment alignment is larger than the page size.
1936 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1937 correctly aligns the symbols with large alignemnt.
1938 * testsuite/Makefile.in: Regenerate.
1939 * testsuite/large_symbol_alignment.cc: New file.
1941 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1942 Sriraman Tallam <tmsriram@google.com>
1944 * options.h (sort_section): New option.
1945 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1946 Rename from Input_section_sort_section_name_special_ordering_compare.
1947 (Input_section_sort_section_name_compare): New struct.
1948 * output.cc (Output_section::Input_section_sort_section_name_compare::
1949 operator()): New function.
1950 (Output_section::sort_attached_input_sections): Use new sort function
1951 for .text if --sort-section=name is specified.
1952 * layout.cc (Layout::make_output_section):
1953 Add sorting by name when --sort-section=name is specified.
1954 * testsuite/Makefile.am (text_section_grouping): Test option
1955 --sort-section=name.
1956 * testsuite/Makefile.in: Regenerate.
1957 * testsuite/section_sorting_name.cc: New file.
1958 * testsuite/section_sorting_name.sh: New file.
1960 2013-05-21 Cary Coutant <ccoutant@google.com>
1962 * symtab.h (Symbol::is_cxx_vtable): New function.
1963 * target-reloc.h (relocate_section): Check for vtable symbol.
1964 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1965 * testsuite/Makefile.in: Regenerate.
1966 * testsuite/missing_key_func.cc: New test source.
1967 * testsuite/missing_key_func.sh: New test script.
1969 2013-05-21 Cary Coutant <ccoutant@google.com>
1971 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1972 type of enclosing symbol.
1973 (Relocate_info::location): Check symbol type when describing symbol.
1974 * object.h (Symbol_location_info): Remove unused line_number;
1975 add enclosing_symbol_type.
1976 * testsuite/debug_msg.sh: Adjust expected output.
1978 2013-05-13 Cary Coutant <ccoutant@google.com>
1980 * configure.ac: Export DEFAULT_TARGET.
1981 * configure: Regenerate.
1982 * Makefile.in: Regenerate.
1983 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1984 * testsuite/Makefile.in: Regenerate.
1985 * testsuite/debug_msg.sh: Delete duplicate tests.
1986 Don't check undef_int error message match for powerpc where the
1987 source file and line number aren't available.
1989 2013-05-10 Roland McGrath <mcgrathr@google.com>
1991 * options.h (General_options): Add --rosegment-gap option.
1992 * options.cc (finalize): --rosegment-gap implies --rosegment.
1993 * layout.cc (set_segment_offsets): Let user option override
1994 target->rosegment_gap().
1996 2013-05-10 Roland McGrath <mcgrathr@google.com>
1998 * options.h (General_options): Remove leading space from help
1999 messages for -nostdlib and --rosegment.
2001 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2004 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2006 2013-05-03 Alan Modra <amodra@gmail.com>
2008 * merge.cc (Output_merge_string::do_add_input_section): Correct
2009 scan for number of strings. Rename vars to avoid shadowing.
2010 Include missing terminator in input_size_.
2012 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2014 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2015 Restore empty string handling.
2017 2013-05-01 Cary Coutant <ccoutant@google.com>
2019 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2020 uninitialized warning.
2022 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2024 * output.cc (Output_section::add_merge_input_section): Allow
2025 to merge sections if the alignment is more than character size.
2026 * merge.h (Output_merge_string::Output_merge_string): Remove
2028 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2029 only not-null strings. Check the alignment of strings.
2031 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2032 alignment as the argument.
2033 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2034 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2035 Align non-zero length strings according to the addralign_.
2036 (Stringpool_template<Stringpool_char>::set_string_offsets):
2037 Updating offsets according to the given alignment.
2038 * testsuite/Makefile.am (text_section_grouping): Test if string
2039 literals are getting merged.
2040 * testsuite/Makefile.in: Regenerate.
2041 * testsuite/merge_string_literals_1.c: New file.
2042 * testsuite/merge_string_literals_2.c: Ditto.
2043 * testsuite/merge_string_literals.sh: Ditto.
2045 2013-04-26 Ian Lance Taylor <iant@google.com>
2047 * target-reloc.h (relocate_section): If the reloc offset is out of
2048 range, pass VIEW as NULL to relocate.relocate.
2049 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2050 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2051 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2052 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2053 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2054 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2056 2013-04-26 Geoff Pike <gpike@chromium.org>
2058 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2059 * layout.cc (Hash_task): New class.
2060 (Layout::queue_build_id_tasks): New function.
2061 (Layout::write_build_id): Handle single-thread portion of build ID
2062 computation. (In some cases, all of it is single-threaded.) Replace
2063 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2064 functionality in fewer lines of code.
2065 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2066 * options.h (General_options): make "--build-id" default to tree
2067 rather than sha1. Add two new options related to --build-id=tree:
2068 --build-id-chunk-size-for-treehash and
2069 --build-id-min-file-size-for-treehash.
2070 * Makefile.am: add testing of --build-id=tree and related new options
2071 (these tests will be invoked by "make check").
2072 * Makefile.in: Regenerate.
2074 2013-04-25 Alan Modra <amodra@gmail.com>
2076 * configure.tgt: Add powerpcle and powerpc64le.
2078 2013-04-22 Alan Modra <amodra@gmail.com>
2081 * layout.cc (Layout::segment_precedes): Allow more than one
2082 segment with the same type and flags.
2084 2013-04-15 Cary Coutant <ccoutant@google.com>
2086 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2087 allocate space in file for BSS sections.
2089 2013-04-15 Cary Coutant <ccoutant@google.com>
2091 * script-sections.cc (Orphan_output_section): Reset address
2092 to zero after each orphaned section for relocatable links.
2094 2013-04-15 Cary Coutant <ccoutant@google.com>
2096 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2097 section starting address for relocatable link.
2098 * testsuite/Makefile.am (script_test_11): New test.
2099 * testsuite/Makefile.in: Regenerate.
2100 * testsuite/script_test_11.c: New source file.
2101 * testsuite/script_test_11.t: New linker script.
2103 2013-04-13 Alan Modra <amodra@gmail.com>
2105 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2106 owner when sections are not adjacent and exceed group size.
2107 (Target_powerpc::group_sections): Handle corner case.
2108 (Target_powerpc::Branch_info::make_stub): Handle case where
2109 stub table doesn't exist due to branches in non-exec sections.
2110 (Target_powerpc::Relocate::relocate): Likewise.
2112 2013-04-11 Alan Modra <amodra@gmail.com>
2115 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2116 .branch_lt to match bfd ld. Adjust comments throughout file.
2118 2013-04-04 Ian Lance Taylor <iant@google.com>
2121 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2122 sections before checking whether they are included in the link.
2124 2013-03-29 Sriraman Tallam <tmsriram@google.com>
2126 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2127 object before calling the plugin claim_file handler. Pass the elf
2128 object of the archive to the plugin. Delete the elf object if the
2129 plugin claims the file.
2131 2013-03-21 Alan Modra <amodra@gmail.com>
2133 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2134 segment when omagic.
2136 2013-03-21 Alan Modra <amodra@gmail.com>
2138 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2140 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2141 uninitialized" warning.
2143 2013-03-20 Alan Modra <amodra@gmail.com>
2145 * symtab.h (Symbol::clear_version): New function.
2146 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2147 is_needed by weak references. Clear version for symbols defined
2148 in as-needed objects that are not needed.
2150 2013-03-15 Alan Modra <amodra@gmail.com>
2152 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2153 static and public. Add report_err param. Return false for data refs.
2154 (Target_powerpc::rela_dyn_section): New overloaded function.
2155 (Target_powerpc::plt_, iplt_): Elucidate.
2156 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2157 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2158 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2159 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2160 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2161 push_branch and make_plt_entry for ifunc syms when
2162 reloc_needs_plt_for_ifunc.
2163 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2164 for ifunc unless reloc_needs_plt_for_ifunc.
2166 2013-03-15 Alan Modra <amodra@gmail.com>
2168 * gc.h (gc_process_relocs): Don't look through function descriptors.
2169 * icf.cc (get_section_contents): Do so here instead.
2171 2013-03-13 Alan Modra <amodra@gmail.com>
2173 * powerpc.cc (is_branch_reloc): Forward declare.
2174 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2175 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2176 false for 64-bit, true for 32-bit non-branch relocs.
2177 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2178 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2180 (icf_safe_test): Generate linker map file as well as nm output.
2181 (icf_safe_so_test): Likewise.
2182 * testsuite/Makefile.in: Regenerate.
2183 * testsuite/icf_test.sh: Parse linker map file to determine
2185 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2186 * testsuite/icf_safe_so_test.sh: Likewise.
2187 (X86_32_or_ARM_specific_safe_fold): Merge into..
2188 (arch_specific_safe_fold): ..this.
2189 (X86_64_specific_safe_fold): Delete unused function.
2191 2013-03-12 Alan Modra <amodra@gmail.com>
2193 * gc.h (gc_process_relocs): Look through function descriptors
2194 to determine shndx, symvalue and addend used by ICF. Tidy
2195 variable duplication.
2197 2013-03-11 Alan Modra <amodra@gmail.com>
2199 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2200 * layout.cc (Layout_task_runner::run): ..to here.
2201 * symtab.h (struct Symbol_location): Extract from..
2202 (class Symbol_table): ..here.
2203 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2204 * target.h (class Target): Add function_location and
2205 do_function_location functions.
2206 (class Sized_target): Add do_function_location.
2207 * object.h (class Sized_relobj_file): Move find_shdr..
2208 (class Object): ..to here.
2209 * object.cc: Likewise. Update to suit. Instantiate.
2210 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2211 * powerpc.cc (class Powerpc_dynobj): New.
2212 (Target_powerpc::do_function_location): New function.
2213 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2214 (Powerpc_dynobj::do_read_symbols): New function.
2215 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2217 2013-03-08 Ian Lance Taylor <iant@google.com>
2219 * options.cc (General_options::string_to_object_format): Accept
2222 2013-03-08 Alan Modra <amodra@gmail.com>
2224 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2225 pointer to Post_fde.
2226 (struct Post_fde): Move definition to here..
2227 * ehframe.cc (struct Post_fde): ..from here.
2228 (Cie::write): Don't alloc Post_fde.
2229 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2231 2013-03-07 Alan Modra <amodra@gmail.com>
2233 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2234 relocation referencing .LC0.
2235 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2237 2013-03-07 Alan Modra <amodra@gmail.com>
2239 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2240 always_inline. Add assembly for powerpc to avoid GOT.
2242 2013-03-07 Alan Modra <amodra@gmail.com>
2244 * testsuite/script_test_10.sh: Don't test .bss section
2247 2013-03-06 Alan Modra <amodra@gmail.com>
2249 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2250 (Target_powerpc::symval_for_branch): Add symtab param. Update
2251 all callers. Handle folded sections.
2252 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2254 (Global_symbol_visitor_opd::operator()): Likewise.
2256 2013-03-04 Alan Modra <amodra@gmail.com>
2258 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2259 * testsuite/Makefile.in: Regenerate.
2261 2013-03-01 Cary Coutant <ccoutant@google.com>
2263 Add dwp support for v2 DWARF package file format.
2264 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2265 tu_length parameter. Adjust all callers.
2266 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2267 * dwp.cc: Include dwarf.h.
2268 (Section_bounds): New struct type.
2269 (Unit_set): New struct type.
2270 (Dwo_file::Dwo_file): Initialize new data member.
2271 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2272 Combine and rename to...
2273 (Dwo_file::read_unit_index): ...this.
2274 (Dwo_file::sized_read_compunit_index)
2275 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2276 (Dwo_file::sized_read_unit_index): ...this.
2277 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2278 parameters; add section_id parameter.
2279 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2280 (Dwo_file::add_unit_set): ...this.
2281 (Dwo_file::shndx_map_): Remove.
2282 (Dwo_file::sect_offsets_): New data member.
2283 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2284 (Dwp_output_file::add_section): Rename to...
2285 (Dwp_output_file::add_contribution): ...this.
2286 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2287 (Dwp_output_file::add_tu_set): Likewise.
2288 (Dwp_output_file::Contribution): New type.
2289 (Dwp_output_file::Section::contributions): New data member.
2290 (Dwp_output_file::Cu_or_tu_set): Remove.
2291 (Dwp_output_file::Section::Section): New ctor.
2292 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2293 (Dwp_output_file::Dwp_index::Section_table): New type.
2294 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2295 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2297 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2298 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2299 (Dwp_output_file::Dwp_index::section_table): New member function.
2300 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2301 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2302 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2303 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2304 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2305 (Dwp_output_file::Dwp_index::section_table_): New data member.
2306 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2307 (Dwp_output_file::add_output_section): New member function.
2308 (Dwp_output_file::write_new_section): New member function.
2309 (Dwp_output_file::write_contributions): New member function.
2310 (Dwp_output_file::section_id_map_): New data member.
2311 (class Dwo_id_info_reader): Remove.
2312 (class Unit_reader): New class.
2313 (get_dwarf_section_name): New function.
2314 (Dwo_file::read_executable): Adjust initializations of class data.
2315 (Dwo_file::read): Add support for v2 package file format.
2316 (Dwo_file::read_unit_index): Likewise.
2317 (Dwo_file::sized_read_unit_index): Likewise.
2318 (Dwo_file::copy_section): Likewise.
2319 (Dwo_file::add_unit_set): Likewise.
2320 (Dwp_output_file::add_output_section): Likewise.
2321 (Dwp_output_file::add_contribution): Likewise.
2322 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2324 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2326 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2328 (Dwp_output_file::initialize): Remove unused function.
2329 (Dwp_output_file::finalize): Add support for v2 package file format.
2330 (Dwp_output_file::write_index): Likewise.
2331 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2334 2013-03-01 Cary Coutant <ccoutant@google.com>
2336 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2337 function into class definition in header file.
2338 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2339 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2341 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2343 2013-02-28 Alan Modra <amodra@gmail.com>
2345 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2346 * target.cc (Target::do_plt_fde_location): New function.
2347 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2348 accessor function, and constructor param.
2349 (struct Post_fde, Post_fdes): Declare.
2350 (Cie::write): Add post_fdes param.
2351 * ehframe.cc (Fde::write): Use plt_fde_location.
2352 (struct Post_fde): Define.
2353 (Cie::write): Stash FDEs added post merge mapping.
2354 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2355 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2356 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2358 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2359 (Target_powerpc::has_glink): New function.
2360 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2361 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2362 glink_eh_frame_fde_32, default_fde): New data.
2363 (Stub_table::eh_frame_added_): New var.
2364 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2366 (Stub_table::add_eh_frame): New function.
2367 (Output_data_glink::add_eh_frame): New function.
2368 (Target_powerpc::make_glink_section): Call add_eh_frame.
2370 2013-02-15 Ian Lance Taylor <iant@google.com>
2372 * options.h (DEFINE_uint64_alias): Define.
2373 (class General_options): Add -Ttext-segment as an alias for
2376 2013-02-15 Alan Modra <amodra@gmail.com>
2378 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2379 (Stub_table::do_write): ..here, two places.
2380 (Stub_table::plt_call_size): Use it here too.
2382 2013-02-11 Ian Lance Taylor <iant@google.com>
2384 * descriptors.cc (Descriptors::close_all): New function.
2385 * descriptors.h (class Descriptors): Declare close_all.
2386 (close_all_descriptors): New inline function.
2387 * plugin.cc: Include "descriptors.h".
2388 (Plugin_manager::cleanup): Call close_all_descriptors.
2390 2013-02-06 Alan Modra <amodra@gmail.com>
2392 * README: Update coding style link.
2394 2013-01-28 Cary Coutant <ccoutant@google.com>
2396 * dwp.cc (File_list): New typedef.
2397 (Dwo_name_info_reader): New class.
2398 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2399 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2400 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2401 (Dwo_file::read_executable): New function.
2402 (Dwo_file::read): Move common setup code to ...
2403 (Dwo_file::make_object): ... here.
2404 (dwp_options): Add --exec/-e.
2408 2013-01-24 Sriraman Tallam <tmsriram@google.com>
2410 * layout.cc (Layout::layout): Check for option text_reorder.
2411 (Layout::make_output_section): Ditto.
2412 * options.h (text_reorder): New option.
2413 * output.cc (Input_section_sort_compare): Remove special ordering
2416 Input_section_sort_section_name_special_ordering_compare::
2417 operator()): New function.
2418 (Output_section::sort_attached_input_sections): Use new sort function
2420 * output.h (Input_section_sort_section_name_special_ordering_compare):
2422 * testsuite/Makefile.am (text_section_grouping): Test option
2424 * testsuite/Makefile.in: Regenerate.
2425 * testsuite/text_section_grouping.sh: Check order of functions without
2426 default text reordering.
2428 2013-01-18 Mike Frysinger <vapier@gentoo.org>
2430 * options.h (General_options): Change default to true for new_dtags.
2432 2013-01-18 Mike Frysinger <vapier@gentoo.org>
2434 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2435 when enable_new_dtags is false. Only add DT_RUNPATH when
2436 enable_new_dtags is true.
2438 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2440 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2441 used in declaration and definition consistent.
2442 (Target_powerpc::symval_for_branch): Ditto.
2444 2013-01-16 Sriraman Tallam <tmsriram@google.com>
2446 * testsuite/plugin_final_layout.cc: Fix comment.
2448 2013-01-16 Sriraman Tallam <tmsriram@google.com>
2450 * layout.cc (Layout::layout): Do not do default sorting for
2451 text sections when section ordering is specified.
2452 (make_output_section): Ditto.
2453 * testsuite/plugin_final_layout.cc: Name the function sections
2454 to catch reordering issues.
2456 2013-01-15 Alan Modra <amodra@gmail.com>
2458 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2461 2013-01-15 Alan Modra <amodra@gmail.com>
2463 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2464 * testsuite/Makefile.in: Regenerate.
2466 2013-01-14 Alan Modra <amodra@gmail.com>
2468 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2469 * testsuite/Makefile.in: Regenerate.
2471 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2474 Fix mingw gold build with plugins enabled
2475 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2476 * configure.ac: Export DLOPEN_LIBS and add headers check.
2477 * plugin.cc: Handle non-dlfcn case.
2478 * Makefile.in: Regenerate.
2479 * config.in: Regenerate.
2480 * configure: Regenerate.
2481 * testsuite/Makefile.in: Regenerate.
2483 2013-01-09 Sriraman Tallam <tmsriram@google.com>
2485 * output.h (sort_attached_input_sections): Change to be public.
2486 * script-sections.cc
2487 (Output_section_definition::set_section_addresses): Sort
2488 attached input sections according to section order before linker
2489 script assigns section addresses.
2490 (Orphan_output_section::set_section_addresses): Sort
2491 attached input sections according to section order before linker
2492 script assigns section addresses.
2493 * Makefile.am (final_layout.sh): Use a simple linker script to
2494 check if section ordering still works.
2495 * Makefile.in: Regenerate.
2497 2013-01-09 Ben Cheng <bccheng@google.com>
2499 * arm.cc (Target_arm::attributes_accept_div): New function.
2500 (Target_arm::attributes_forbid_div): New function.
2501 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2502 attribute using the same new functions as what bfd/elf32_arm.c
2505 2013-01-07 Cary Coutant <ccoutant@google.com>
2508 * output.cc (Output_section::add_input_section): For incremental
2509 updates, don't track input sections that are allocated from patch
2512 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2513 Ian Lance Taylor <iant@google.com>
2516 * configure.ac (--enable-ld): Removed.
2517 (install_as_default): Set to yes only for --enable-gold=default
2519 * configure: Regenerated.
2521 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2523 * options.h (General_options): Add -fuse-ld= for GCC linker
2524 option compatibility.
2526 2013-01-04 Cary Coutant <ccoutant@google.com>
2528 * configure.ac: Fix typo restoring CXXFLAGS.
2529 * configure: Regenerate.
2531 2013-01-04 Cary Coutant <ccoutant@google.com>
2533 * testsuite/Makefile.am (CXXLINK_S): New macro.
2534 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2535 * testsuite/Makefile.in: Regenerate.
2537 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2539 * version.cc (print_version): Update copyright year to 2013.
2541 2012-12-20 Ian Lance Taylor <iant@google.com>
2543 * layout.cc (Layout::special_ordering_of_input_section): New
2545 (Layout::layout): If input section requires special ordering, must
2546 sort input sections.
2547 (Layout::make_output_section): May sort .text input sections.
2548 (Layout::is_section_name_prefix_grouped): Remove.
2549 * layout.h (class Layout): Declare
2550 special_ordering_of_input_section. Don't declare
2551 is_section_name_prefix_grouped.
2552 * output.cc (Output_section::add_input_section): Revert last
2554 (Output_section::Input_section_sort::match_file_name): Don't crash
2555 if called on output section data.
2556 (Output_section::Input_section_sort_compare): Sort based on
2558 (Output_section::Input_section_sort_section_order_index_compare):
2560 (Output_section::sort_attached_input_sections): Likewise.
2562 2012-12-18 Sriraman Tallam <tmsriram@google.com>
2564 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
2565 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2566 * output.cc (Output_section::add_input_section): Check if section
2567 name contains special prefix. Keep input sections to sort such
2569 (Output_section::Input_section_sort_section_order_index_compare
2570 ::operator()): Group sections according to prefixes.
2571 (Output_section::sort_attached_input_sections): Add condition to
2572 Input_section_entry constructor call.
2573 * testsuite/Makefile.am (text_section_grouping): New test.
2574 * testsuite/Makefile.in: Regenerate.
2575 * testsuite/text_section_grouping.cc: New file.
2576 * testsuite/text_section_grouping.sh: New file.
2578 2012-12-17 Nick Clifton <nickc@redhat.com>
2580 * Makefile.am: Add copyright notice.
2583 * configure.ac: Likewise.
2584 * ftruncate.c: Likewise.
2585 * Makefile.in: Regenerate.
2587 2012-12-14 Cary Coutant <ccoutant@google.com>
2589 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2590 --no-as-needed flag.
2591 (exception_separate_shared_12_test): Likewise.
2592 (incremental_copy_test): Likewise.
2593 * testsuite/Makefile.in: Regenerate.
2595 2012-12-14 Cary Coutant <ccoutant@google.com>
2597 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2598 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2600 2012-12-12 Alan Modra <amodra@gmail.com>
2602 * powerpc.cc (class Track_tls): New.
2603 (class Relocate, class Scan): Inherit Track_tls.
2604 (Target_powerpc::Scan::local, global): Track tls optimization
2605 and avoid creating plt entry for __tls_get_addr if all uses
2607 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2609 2012-12-12 Alan Modra <amodra@gmail.com>
2611 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2612 Replace no_toc_optimize with toc_optimize.
2613 * output.h (Output_section::input_sections): Provide non-const variant.
2614 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2615 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2617 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2618 (class Sort_toc_sections): New.
2619 (Target_powerpc::do_finalize_sections): Sort toc sections.
2620 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2622 2012-12-10 Roland McGrath <mcgrathr@google.com>
2624 * testsuite/binary_unittest.cc (read_all): New function.
2625 (Sized_binary_test): Use it instead of ::read.
2626 * fileread.cc (do_read): Don't assume pread always reads the whole
2627 amount in a single call.
2629 2012-12-10 Alan Modra <amodra@gmail.com>
2631 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2632 Set EM_PPC64 or EM_PPC here.
2633 (Target_selector_powerpc::do_recognize): Delete.
2635 2012-12-10 Alan Modra <amodra@gmail.com>
2637 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2639 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2641 2012-12-07 Roland McGrath <mcgrathr@google.com>
2643 * testsuite/binary_unittest.cc (Sized_binary_test):
2644 Use open_descriptor rather than ::open.
2646 2012-12-07 Alan Modra <amodra@gmail.com>
2648 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2649 typedef and invalid_address constant.
2650 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2651 instantiate constants.
2653 2012-12-06 Roland McGrath <mcgrathr@google.com>
2655 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2656 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2657 * aclocal.m4: Regenerate.
2658 * configure: Regenerate.
2659 * Makefile.in: Regenerate.
2660 * testsuite/Makefile.in: Regenerate.
2662 2012-12-07 Alan Modra <amodra@gmail.com>
2664 * options.h (General_options): Add no_toc_optimize.
2665 * powerpc.cc (ok_lo_toc_insn): New function.
2666 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2668 2012-12-06 Alan Modra <amodra@gmail.com>
2670 * options.h (General_options): Add plt_align, plt_static_chain,
2671 plt_thread_safe. Update stub_group_size help text.
2672 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2673 for new plt_thread_safe_ var.
2674 (use_plt_offset): Correct comments.
2675 (Target_powerpc::do_relax): Look for thread creation symbols to
2676 determine default plt_thread_safe value. Clear plt call stubs
2677 as well as branch stubs each iteration.
2678 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2680 (l, hi, ha, write_insn): Move earlier.
2681 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2682 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2684 (Stub_table::update_size): Adjust.
2685 (Stub_table::prev_size, set_prev_size): Delete.
2686 (Stub_table::stub_align): Let --plt-align affect result.
2687 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2688 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2689 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2690 (Stub_table::do_write): Support more stub variants.
2692 2012-12-04 Alan Modra <amodra@gmail.com>
2694 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2695 (Target_powerpc::do_define_standard_symbols): New function.
2697 2012-12-03 Alan Modra <amodra@gmail.com>
2699 * output.h: Formatting, whitespace.
2701 2012-12-03 Alan Modra <amodra@gmail.com>
2703 * layout.h (Layout::get_executable_sections): Declare.
2704 * layout.cc (Layout::get_executable_sections): New function.
2705 * arm.cc (Target_arm::group_sections): Use it.
2706 (Arm_output_section::group_sections): Delete now redundant test.
2707 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2708 param to handle relative relocs.
2709 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2710 (Output_data_reloc::add_absolute): Adjust.
2711 (Output_data_reloc::add_relative): New function.
2712 (Output_data::reset_data_size): New function.
2713 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2714 (Output_section::set_addralign): New function.
2715 (Output_section::checkpoint_set_addralign): New function.
2716 (Output_section::clear_section_offsets_need_adjustment): New function.
2717 (Output_section::input_sections): Make public.
2718 * powerpc.cc (class Output_data_brlt_powerpc): New.
2719 (class Stub_table, class Stub_control): New.
2720 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2721 stub_table_, set_stub_table, stub_table): New vectors and accessor
2723 (Target_powerpc::do_may_relax, do_relax, push_branch,
2724 new_stub_table, stub_tables, brlt_section, group_sections,
2725 add_branch_lookup_table, find_branch_lookup_table,
2726 write_branch_lookup_table, make_brlt_section): New functions.
2727 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2728 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2729 branch_info_): New vars.
2730 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2731 make call stubs here.
2732 (Output_data_glink): Remove all call stub handling from this class.
2733 (Target_powerpc::Scan::local, global): Save interesting branch
2734 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2735 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2736 functions on final link.
2737 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2738 Handle long branch destinations too.
2739 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2740 do_plt_address_for_local): Adjust lookup of plt call stubs.
2742 2012-11-30 Alan Modra <amodra@gmail.com>
2744 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2745 relocs against protected symbols when building 32-bit shared libs.
2747 2012-11-30 Alan Modra <amodra@gmail.com>
2749 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2750 param. Call got_section() to make .got. Update all callers
2751 and their callers and so on.
2753 2012-11-30 Alan Modra <amodra@gmail.com>
2755 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2756 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2757 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2758 value if it already exists.
2760 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2763 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2765 2012-11-14 Roland McGrath <mcgrathr@google.com>
2767 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2768 than bfc instruction for data sandboxing.
2770 2012-11-08 Alan Modra <amodra@gmail.com>
2772 * po/POTFILES.in: Regenerate.
2774 2012-11-05 Alan Modra <amodra@gmail.com>
2776 * configure.ac: Apply 2012-09-10 change to config.in here.
2777 * configure: Regenerate.
2779 2012-11-05 Alan Modra <amodra@gmail.com>
2781 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2782 (struct Opd_ent): Use "Address" rather than "Offset".
2783 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2784 (Target_powerpc::got_section): Make public.
2785 (Target_powerpc::scan_relocs): Move code setting symbols..
2786 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2787 Create _SDA_BASE_ only when referenced.
2789 2012-11-02 Roland McGrath <mcgrathr@google.com>
2791 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2794 2012-11-01 Roland McGrath <mcgrathr@google.com>
2796 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2797 for offset_in_output_section parameter.
2798 (Sized_target::relocate_special_relocatable): Likewise.
2799 * arm.cc (Target_arm::relocate_relocs): Likewise.
2800 (Target_arm::relocate_special_relocatable): Likewise.
2801 * i386.cc (Target_i386::relocate_relocs): Likewise.
2802 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2803 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2804 * target-reloc.h (relocate_relocs): Likewise.
2805 * testsuite/testfile.cc (Target_test): Likewise.
2806 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2807 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2809 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2810 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2812 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2813 parameter, which is unused in the [!F_SETFD] case.
2815 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2816 SYMNDX to off_t before comparing it to this->data_size().
2817 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2818 * incremental.cc (Output_section_incremental_inputs::do_write):
2819 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2821 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2823 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2825 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2826 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2829 2012-10-29 Cary Coutant <ccoutant@google.com>
2831 * dwp.cc (usage): Add file and exit status parameters;
2832 add --help and --version options.
2833 (print_version): New function.
2834 (main): Add --help and --version options.
2836 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2838 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2839 final_layout_sequence.txt.
2840 * testsuite/Makefile.in: Regenerated.
2842 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2844 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2845 COMPILE generated by automake.
2847 (CXXCOMPILE1): Likewise.
2848 (CXXLINK1): Likewise.
2849 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2851 (CXXCOMPILE): Likewise.
2852 (CXXLINK): Likewise.
2853 * testsuite/Makefile.in: Regenerated.
2855 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2857 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2858 on bad fwrite return.
2860 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2862 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2865 2012-10-23 Cary Coutant <ccoutant@google.com>
2867 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2868 * testsuite/Makefile.in: Regenerate.
2869 * testsuite/dwp_test.h: New source file.
2870 * testsuite/dwp_test_1.cc: New source file.
2871 * testsuite/dwp_test_1.s: New source file.
2872 * testsuite/dwp_test_1.sh: New source file.
2873 * testsuite/dwp_test_1b.cc: New source file.
2874 * testsuite/dwp_test_1b.s: New source file.
2875 * testsuite/dwp_test_2.cc: New source file.
2876 * testsuite/dwp_test_2.s: New source file.
2877 * testsuite/dwp_test_2.sh: New source file.
2878 * testsuite/dwp_test_main.cc: New source file.
2879 * testsuite/dwp_test_main.s: New source file.
2881 2012-10-23 Cary Coutant <ccoutant@google.com>
2883 * dwp.h: New header file.
2884 * dwp.cc: New source file.
2885 * gold.h: Move shared declarations to system.h.
2886 * system.h: New header file.
2887 * Makefile.am: Add dwp.
2888 * Makefile.in: Regenerate.
2890 2012-10-23 Cary Coutant <ccoutant@google.com>
2892 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2893 Dwarf_info_reader::read_from_pointer.
2894 (Dwarf_pubnames_table::read_header): Likewise.
2895 (Dwarf_pubnames_table::next_name): Likewise.
2896 (Dwarf_die::read_attributes): Likewise.
2897 (Dwarf_die::skip_attributes): Likewise.
2898 (Dwarf_info_reader::read_from_pointer): New function template.
2899 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2900 (Dwarf_pubnames_table): Likewise.
2901 (Dwarf_info_reader::read_from_pointer): New function template.
2902 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2903 Dwarf_pubnames_table ctor.
2905 2012-10-23 Cary Coutant <ccoutant@google.com>
2907 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2909 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2911 (Dwarf_info_reader::set_abbrev_shndx): New method.
2912 (Dwarf_info_reader::abbrev_shndx_): New data member.
2914 2012-10-23 Cary Coutant <ccoutant@google.com>
2916 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2917 from object, not parameters.
2918 (Dwarf_info_reader::parse): Likewise.
2919 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2920 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2921 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2924 2012-10-23 Cary Coutant <ccoutant@google.com>
2926 * fileread.cc (Input_file::Input_file): New constructor.
2927 * fileread.h (class Input_file): Add new constructor.
2929 2012-10-18 Alan Modra <amodra@gmail.com>
2932 * object.cc (Relobj::is_section_name_included): Also match
2933 .sdata personality section.
2935 2012-10-18 Alan Modra <amodra@gmail.com>
2937 * target-reloc.h (class Default_comdat_behavior): New, package up..
2938 (get_comdat_behaviour): ..this.
2939 (relocate_section): Add Relocate_comdat_behavior template arg,
2940 adjust code to suit.
2941 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2942 (Target_arm::scan_reloc_section): Likewise.
2943 * i386.cc (Target_i386::relocate_section): Likewise.
2944 * sparc.cc (Target_sparc::relocate_section): Likewise.
2945 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2946 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2947 * powerpc.cc (class Relocate_comdat_behavior): New.
2948 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2949 gold::relocate_section with new template arg.
2951 2012-10-18 Alan Modra <amodra@gmail.com>
2953 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2954 dynamic relocs for GOT_TPREL got entries, without symbol if
2956 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2957 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2958 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2960 2012-10-17 Alan Modra <amodra@gmail.com>
2963 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2965 2012-10-16 Sriraman Tallam <tmsriram@google.com>
2967 * layout.cc (Layout::include_section): Keep sections marked
2968 SHF_EXCLUDE when doing relocatable links.
2970 2012-10-16 Alan Modra <amodra@gmail.com>
2972 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2973 (Target_powerpc::do_finalize_sections): Call it.
2974 (Output_data_save_res): New class and supporting functions.
2975 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2976 normal symbols defined in object files.
2978 2012-10-12 Alan Modra <amodra@gmail.com>
2980 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2981 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2982 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2983 section if scan_opd_relocs not yet called.
2984 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2986 2012-10-12 Alan Modra <amodra@gmail.com>
2988 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2989 add_local_ifunc_entry): Revert last change.
2990 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2992 2012-10-05 Alan Modra <amodra@gmail.com>
2994 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2995 do_plt_address_for_global): New functions.
2996 (Output_data_got_powerpc::do_write): Don't segfault when linking
2998 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2999 add_local_ifunc_entry): Return true on adding entry..
3000 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3001 glink->add_entry call. Remove unused symtab param. Adjust calls.
3002 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3003 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3004 set up symbols here.
3005 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3006 syms here. Do so even when no .iplt. Don't segfault when linking
3008 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3009 new variants without reloc param.
3010 (Glink_sym_ent::Glink_sym_ent): Likewise.
3011 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3012 reloc when refs will resolve to plt call stub.
3013 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3014 R_PPC_PLTREL24 to resolve locally.
3015 (Target_powerpc::Scan::global): Correct ifunc handling.
3016 (Target_powerpc::Relocate::relocate): Correct local sym glink
3017 lookup. Don't destroy "value" when we have a plt call stub,
3018 and when checking plt call validity.
3019 (Target_powerpc::do_dynsym_value): Simplify.
3021 2012-10-05 Alan Modra <amodra@gmail.com>
3023 * i386.cc (Output_data_plt_i386::address_for_global,
3024 address_for_local): Add plt offset to returned value. Adjust uses.
3025 * sparc.cc (Output_data_plt_sparc::address_for_global,
3026 address_for_local): Likewise.
3027 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3028 address_for_local): Likewise.
3029 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3030 address_for_local): Likewise.
3031 * target.h (Target::plt_address_for_global, plt_address_for_local):
3033 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3034 (Output_data_got::Got_entry::write): Nor here.
3035 * output.h: Comment fix.
3037 2012-10-02 Jiong Wang <jiwang@tilera.com>
3039 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3040 global_offset_table_ value for larget got.
3041 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3043 2012-09-29 Alan Modra <amodra@gmail.com>
3045 * powerpc.cc (Target_powerpc::iplt_): New output section.
3046 (Target_powerpc::iplt_section, make_iplt_section,
3047 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3048 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3049 Target_powerpc::plt_entry_count): Count iplt entries too.
3050 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3051 reloc section in constructor. New params.
3052 (Target_powerpc::make_plt_section): Create reloc section here instead.
3053 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3055 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3056 (Output_data_glink::add_entry, find_entry): New functions to
3057 deal with local syms.
3058 (Glink_sym_ent): Add support for local syms.
3059 (Output_data_glink::do_write): Handle ifunc plt entries.
3060 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3061 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3062 (Target_powerpc::Relocate::relocate): Likewise.
3063 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3065 2012-09-25 Alan Modra <amodra@gmail.com>
3067 * object.h (Sized_relobj_file::adjust_local_symbol,
3068 do_adjust_local_symbol): New functions.
3069 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3070 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3071 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3072 and irregular opd entry spacing.
3073 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3074 (Global_symbol_visitor_opd): New functor.
3075 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3076 on deleted opd entries.
3078 2012-09-15 Jiong Wang <jiwang@tilera.com>
3080 * tilegx.cc: New file.
3081 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3082 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3083 * configure.tgt: Add entries for tilegx*.
3084 * configure.ac: Likewise.
3085 * Makefile.in: Rebuild.
3086 * configure: Likewise.
3087 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3090 2012-09-13 Alan Modra <amodra@gmail.com>
3092 * target-reloc.h (scan_relocs): Call scan.local for relocs
3093 against symbols in discarded sections. Pass is_discarded
3095 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3096 Add is_discarded param.
3097 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3098 is_discarded to flag opd entry as discarded. Don't emit dyn
3099 relocs on such entries.
3100 (Target_powerpc::Scan::global): Similarly detect and handle
3102 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3103 opd_ent_. Update all uses.
3104 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3105 (Target_powerpc::relocate_section): Zero out discarded opd
3108 2012-09-12 Ian Lance Taylor <iant@google.com>
3111 * output.cc: Rename Output_data_got template parameter from size
3112 to got_size for all functions. Compile all variants of
3114 (Output_data_got::Got_entry::write): Correct use of size for
3115 symbol value. Use local_is_tls rather than casting to
3117 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3118 (class Sized_relobj_file): Add do_local_is_tls.
3119 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3121 2012-09-11 Alan Modra <amodra@gmail.com>
3124 * layout.cc (Layout::set_segment_offsets): When using
3125 common-page-size alignment, ensure we are on a new max-page-size
3127 * output.cc (Output_segment::set_section_addresses): Use
3128 abi_pagesize, not common_pagesize for relro boundary.
3129 (Output_segment::set_offset): Likewise.
3131 2012-09-11 Alan Modra <amodra@gmail.com>
3133 * output.h (Output_data_got::add_global_tls, add_local_tls,
3134 add_local_tls_pair): New functions.
3135 (Output_data_got::add_local_pair_with_rel): Remove second
3136 reloc param. Expand comment.
3137 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3138 use_plt_or_tls_offset_, similarly for constructor param.
3139 (Output_data_got::Got_entry::write): Add got_index param.
3140 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3141 add_local_tls_pair): New functions.
3142 (Output_data_got::Got_entry::write): Handle tls symbols
3143 with use_plt_or_tls_offset_ set specially.
3144 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3145 (Output_data_got::do_write): Replace iterator with index, pass
3146 index to entry write function.
3147 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3148 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3149 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3151 * i386.cc (Target_i386::Scan::local): Likewise.
3152 * sparc.cc (Target_sparc::Scan::local): Likewise.
3153 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3154 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3155 do_tls_offset_for_global): New functions.
3156 (Target_powerpc::Scan::local): Correct TLS relocations and got
3158 (Target_powerpc::Scan::global): Don't emit unnecessary
3159 dynamic relocations on TLS GOT entries.
3161 2012-09-10 Matthias Klose <doko@ubuntu.com>
3163 * config.in: Disable sanity check for kfreebsd.
3165 2012-09-10 Sterling Augustine <saugustine@google.com>
3167 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3168 (Gdb_index::pubtypes_read): New parameter.
3169 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3171 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3174 2012-09-09 Alan Modra <amodra@gmail.com>
3176 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3177 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3178 * gc.h (gc_process_relocs): Call target gc_add_reference.
3179 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3180 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3181 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3183 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3184 to cater for when we don't need code offset. Update use.
3185 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3186 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3187 set_opd_valid): New functions.
3188 (Target_powerpc::do_gc_add_reference): New function.
3189 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3191 (Target_powerpc::do_gc_mark_symbol): New function.
3193 2012-09-06 Cary Coutant <ccoutant@google.com>
3195 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3196 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3197 (Dwarf_die::skip_attributes): Likewise.
3198 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3199 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3201 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3203 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3205 * testsuite/script_test_3.t: Add .got.plt output section
3207 * testsuite/script_test_4.t: Likewise.
3209 2012-09-05 Alan Modra <amodra@gmail.com>
3211 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3212 update all uses and lose "enum" when using type.
3214 2012-09-05 Alan Modra <amodra@gmail.com>
3216 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3217 * configure: Regenerate.
3218 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3219 (plugin_final_layout.stdout): Likewise.
3220 (memory_test): Set page sizes to 0x1000.
3221 * testsuite/Makefile.in: Regenerate.
3222 * testsuite/discard_locals_test.sh: Add FIXME comment.
3223 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3224 * testsuite/pr14265.t: Add .got output section statement.
3225 * testsuite/script_test_2.t: Likewise.
3226 * testsuite/script_test_3.t: Likewise.
3227 * testsuite/script_test_4.t: Likewise.
3228 * testsuite/script_test_5.t: Likewise.
3229 * testsuite/script_test_6.t: Likewise.
3230 * testsuite/script_test_7.t: Likewise.
3231 * testsuite/script_test_9.t: Likewise.
3233 2012-09-05 Alan Modra <amodra@gmail.com>
3235 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3236 (Powerpc_relocate_functions::Status): New typedef.
3237 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3238 (Target_powerpc::Scan::local): Handle REL64.
3239 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3240 for REL32 and REL64.
3241 (Target_powerpc::symval_for_branch): New function, extracted from..
3242 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3243 checks. Report overflow errors.
3245 2012-09-05 Alan Modra <amodra@gmail.com>
3247 * object.h (Sized_relobj_file::emit_relocs): Delete.
3248 (Sized_relobj_file::emit_relocs_reltype): Delete.
3249 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3250 relocate_relocs for --emit-relocs.
3251 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3252 * output.h: Update comment.
3253 (Output_segment::first_section): New function.
3254 (Output_segment::first_section_load_address): Use first_section.
3255 * output.cc (Output_segment::first_section): New function extracted..
3256 (Output_segment::first_section_load_address): ..from here. Delete.
3257 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3258 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3259 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3260 adjust call to target.h function.
3261 * i386.cc (Target_i386): Likewise.
3262 * sparc.cc (Target_sparc): Likewise.
3263 * x86_64.cc (Target_x86_64): Likewise.
3264 * powerpc.cc (Target_powerpc): Likewise.
3265 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3266 first tls section has section symbol for optimised local dynamic
3268 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3269 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3271 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3272 Rename to relocate_relocs. Update error message.
3274 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3276 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3279 2012-08-31 Alan Modra <amodra@gmail.com>
3281 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3282 (Powerpc_relobj::toc_base_offset): New stub function.
3283 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3284 got_mod_index_offset to tlsld_got_offset. Update all refs.
3285 (Target_powerpc::Relocate::enum skip_tls): New.
3286 (Target_powerpc::call_tls_get_addr_): New var.
3287 (Target_powerpc::is_branch_reloc): Move to file scope.
3288 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3289 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3291 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3292 (powerpc_info): Correct common_pagesize for ppc64.
3293 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3294 (Powerpc_relocate_functions): Add overflow check enums and functions.
3295 Add non-shift version of rela, rela_ua. Delete all rel public
3296 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3297 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3298 addr16_ha3, addr14 functions.
3299 (Output_data_got_powerpc::add_constant_pair): New function.
3300 (Output_data_got_powerpc::got_base_offset): Likewise.
3301 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3302 (instruction constants): Sort, add some more.
3303 (Output_data_glink::do_write): Add and use Address typedef. Use
3304 object->toc_base_offset() stub for 64-bit.
3305 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3306 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3307 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3308 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3309 Always treat .opd relocs as against locally defined symbol.
3310 Correct condition for RELATIVE relocs.
3311 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3312 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3313 for 32-bit syms with a plt entry. Correct ppc64 toc base
3314 calculations. Handle TLS relocs, and more. Add overflow
3315 checking and adjust for Powerpc_relocate_functions changes.
3316 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3317 Reinstate --emit-relocs code with FIXME.
3319 2012-08-30 Alan Modra <amodra@gmail.com>
3321 * layout.cc (Layout::set_segment_offsets): Set p_align to
3322 abi_pagesize, not common_pagesize.
3323 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3324 to determine whether file header can go in segment.
3326 2012-08-30 Alan Modra <amodra@gmail.com>
3328 * output.h (Output_reloc::Output_reloc <output section>): Add
3329 is_relative param. Adjust calls.
3330 (Output_reloc::add_output_section_relative): New functions.
3331 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3333 (Output_reloc::symbol_value): Handle SECTION_CODE.
3335 2012-08-24 Sriraman Tallam <tmsriram@google.com>
3337 * gold.cc (queue_middle_tasks): Call layout again when unique
3338 segments for sections is desired.
3339 * layout.cc (Layout::Layout): Initialize new members.
3340 (Layout::get_output_section_flags): New function.
3341 (Layout::choose_output_section): Call get_output_section_flags.
3342 (Layout::layout): Make output section for mapping to a unique segment.
3343 (Layout::insert_section_segment_map): New function.
3344 (Layout::attach_allocated_section_to_segment): Make unique segment for
3345 output sections marked so.
3346 (Layout::segment_precedes): Check for unique segments when sorting.
3347 * layout.h (Layout::Unique_segment_info): New struct.
3348 (Layout::Section_segment_map): New typedef.
3349 (Layout::insert_section_segment_map): New function.
3350 (Layout::get_output_section_flags): New function.
3351 (Layout::is_unique_segment_for_sections_specified): New function.
3352 (Layout::set_unique_segment_for_sections_specified): New function.
3353 (Layout::unique_segment_for_sections_specified_): New member.
3354 (Layout::section_segment_map_): New member.
3355 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3356 Rename is_gc_pass_one to is_pass_one.
3357 Rename is_gc_pass_two to is_pass_two.
3358 Rename is_gc_or_icf to is_two_pass.
3359 Check for which pass based on whether symbols data is present.
3360 Make it two pass when unique segments for sections is desired.
3361 * output.cc (Output_section::Output_section): Initialize new
3363 * output.h (Output_section::is_unique_segment): New function.
3364 (Output_section::set_is_unique_segment): New function.
3365 (Output_section::is_unique_segment_): New member.
3366 (Output_section::extra_segment_flags): New function.
3367 (Output_section::set_extra_segment_flags): New function.
3368 (Output_section::extra_segment_flags_): New member.
3369 (Output_section::segment_alignment): New function.
3370 (Output_section::set_segment_alignment): New function.
3371 (Output_section::segment_alignment_): New member.
3372 (Output_segment::Output_segment): Initialize is_unique_segment_.
3373 (Output_segment::is_unique_segment): New function.
3374 (Output_segment::set_is_unique_segment): New function.
3375 (Output_segment::is_unique_segment_): New member.
3376 * plugin.cc (allow_unique_segment_for_sections): New function.
3377 (unique_segment_for_sections): New function.
3378 (Plugin::load): Add new functions to transfer vector.
3379 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3380 * Makefile.in: Regenerate.
3381 * testsuite/plugin_final_layout.sh: Check if unique segment
3382 functionality works.
3383 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3385 (allow_unique_segment_for_sections): New global.
3386 (unique_segment_for_sections): New global.
3387 (claim_file_hook): Call allow_unique_segment_for_sections.
3388 (all_symbols_read_hook): Call unique_segment_for_sections.
3390 2012-08-22 Cary Coutant <ccoutant@google.com>
3392 * layout.cc (Layout::include_section): Don't assert on GROUP
3393 sections with --emit-relocs.
3395 2012-08-21 Cary Coutant <ccoutant@google.com>
3397 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3398 if --export-dynamic-symbol names an undef symbol.
3400 2012-08-18 Alan Modra <amodra@gmail.com>
3402 * powerpc.cc: Formatting and white space.
3403 (Powerpc_relobj): Rename got2_section_ to special_.
3404 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3405 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3406 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3407 (Target_powerpc): Add Address typedef and invalid_address. Use
3409 (Target_powerpc::is_branch_reloc): New function.
3410 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3411 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3412 for dst_mask, value and addend.
3413 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3414 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3415 (Output_data_glink::do_write): Correct toc base. Don't try to use
3416 uint16_t for 24-bit offset. Use get_output_section_offset and
3418 (Target_powerpc::Scan::local): Handle more relocs.
3419 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3420 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3421 Plug in toc restoring insn after plt calls. Translate branches
3422 to function descriptor symbols to corresponding entry point.
3423 (Target_powerpc::relocate_for_relocatable): Check return from
3424 get_output_section_offset.
3425 * symtab.h: Comment typo.
3427 2012-08-14 Ian Lance Taylor <iant@google.com>
3429 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3430 unsupported_relocal_local to call unsupported_reloc_global.
3432 2012-08-14 Nick Clifton <nickc@redhat.com>
3435 * script-sections.cc (Sections_element::output_section_name): Add
3436 keep return parameter.
3437 (Output_section_element::match_name): Add keep return parameter.
3438 Return the value of the keep_ member.
3439 * script-sections.h (class Output_section): Update
3440 output_section_name prototype.
3441 * layout.cc (Layout::keep_input_section): New public member
3443 (Layout::choose_output_section): Pass keep parameter to
3444 output_section_name.
3445 * layout.h (class Layout): Add keep_input_section.
3446 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3448 * testsuite/Makefile.am: Add a test.
3449 * testsuite/Makefile.in: Regenerate.
3450 * testsuite/pr14265.c: Source file for the test.
3451 * testsuite/pr14265.t: Linker script for the test.
3452 * testsuite/pr14265.sh: Shell script for the test.
3454 2012-08-14 Alan Modra <amodra@gmail.com>
3456 * target.h (Target::output_section_name): New function.
3457 (Target::do_output_section_name): New function.
3458 * layout.cc (Layout::choose_output_section): Call the above.
3459 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3461 2012-08-14 Alan Modra <amodra@gmail.com>
3463 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3464 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3465 for replace_constant call.
3466 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3467 (Output_data_glink::do_print_to_mapfile): New function.
3468 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3469 (Target_powerpc::Relocate::relocate): Likewise.
3471 2012-08-14 Alan Modra <amodra@gmail.com>
3473 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3474 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3475 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3476 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3477 all references to shndx_. Handle special case for R_PPC_PLTREL24
3479 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3480 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3481 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3483 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3484 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3486 2012-08-12 Alan Modra <amodra@gmail.com>
3488 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3489 (glink insn constants): Use uint32_t.
3490 (Output_data_glink::add_entry): Use insert, not [] operator.
3492 2012-08-11 Alan Modra <amodra@gmail.com>
3494 * object.h (Sized_relobj_file::find_shdr): New function.
3495 (Sized_relobj_file::find_special_sections): New function.
3496 * object.cc (Sized_relobj_file::find_shdr): New function.
3497 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3498 (Sized_relobj_file::find_special_sections): New function, split out..
3499 (Sized_relobj_file::do_read_symbols): ..from here.
3500 * output.h (Output_data_got::replace_constant): New function.
3501 (Output_data_got::num_entries): New function.
3502 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3503 (Output_data_got::got_offset): Protected rather than private.
3504 (Output_data_got::replace_got_entry): New function.
3505 * output.cc (Output_data_got::replace_got_entry): New function.
3506 * powerpc.cc (class Powerpc_relobj): New.
3507 (class Powerpc_relocate_functions): Delete all psymval variants or
3508 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3509 Implement _ha functions using corresponding _hi function.
3510 (Powerpc_relobj::find_special_sections): New function.
3511 (Target_powerpc::do_make_elf_object): New function.
3512 (class Output_data_got_powerpc): New.
3513 (class Output_data_glink): New.
3514 (class Powerpc_scan_relocatable_reloc): New.
3515 Many more changes througout file.
3517 2012-08-09 Nick Clifton <nickc@redhat.com>
3519 * po/vi.po: Updated Vietnamese translation.
3521 2012-08-07 Ian Lance Taylor <iant@google.com>
3523 * layout.cc (Layout::add_target_dynamic_tags): If
3524 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3527 2012-07-30 Nick Clifton <nickc@redhat.com>
3529 * po/gold.pot: Updated template.
3530 * po/es.po: Updated Spanish translation.
3532 2012-07-18 Cary Coutant <ccoutant@google.com>
3535 * configure.ac: Add check for -gpubnames support.
3536 * configure: Regenerate.
3537 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3538 support; force -gno-pubnames.
3539 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3541 (gdb_index_test_4): New test.
3542 * testsuite/Makefile.in: Regenerate.
3543 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3544 * testsuite/gdb_index_test_2.sh: Likewise.
3545 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3546 * testsuite/gdb_index_test_4.sh: New script.
3547 * testsuite/gdb_index_test_comm.sh: New script with common code;
3548 don't look for space after colon.
3550 2012-07-16 Sriraman Tallam <tmsriram@google.com>
3552 * gold.cc (queue_middle_tasks): Update function order only after
3553 deferred objects due to plugins are processed.
3555 2012-07-11 Ian Lance Taylor <iant@google.com>
3557 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3558 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3559 (Target_arm::scan_reloc_for_stub): Likewise.
3560 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3561 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3562 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3563 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3564 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3566 2012-07-10 Dodji Seketeli <dodji@redhat.com>
3567 Ian Lance Taylor <iant@google.com>
3570 * configure.ac: Test whether std::tr1::hash<off_t> works.
3571 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3573 * output.h (class Output_fill): Add virtual destructor.
3574 * configure, config.in: Rebuild.
3576 2012-06-22 Roland McGrath <mcgrathr@google.com>
3578 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3580 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3582 * plugin.cc (Plugin::load): Handle position independent executables.
3584 2012-06-06 Cary Coutant <ccoutant@google.com>
3586 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3588 (lines_only_debug_sections): Likewise.
3589 (gdb_fast_lookup_sections): New static array.
3590 (is_gdb_debug_section): Rename formal parameter.
3591 (is_lines_only_debug_section): Likewise.
3592 (is_gdb_fast_lookup_section): New function.
3593 (Layout::include_section): Check for ".zdebug_" prefix; pass
3594 section name suffix to is_gdb_debug_section, et al.; check for
3595 fast-lookup sections when building .gdb_index.
3596 * options.h (--strip-debug-gdb): Update GDB version number.
3598 2012-06-06 Cary Coutant <ccoutant@google.com>
3600 * configure.ac: Add check for fallocate.
3601 * configure: Regenerate.
3602 * config.in: Regenerate.
3604 * options.h (class General_options): Add --mmap-output-file and
3605 --posix-fallocate options.
3606 * output.cc: (posix_fallocate): Remove; replace with...
3607 (gold_fallocate): New function.
3608 (Output_file::map_no_anonymous): Call gold_fallocate.
3609 (Output_file::map): Check --mmap-output-file option.
3611 2012-06-05 Jing Yu <jingyu@google.com>
3613 * gold.h (textdomain): Add do {} to empty while(0).
3614 (bindtextdomain): Likewise.
3616 2012-06-04 Cary Coutant <ccoutant@google.com>
3618 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3621 2012-05-25 Sriraman Tallam <tmsriram@google.com>
3623 * symtab.cc (Symbol_table::define_special_symbol):
3624 Initialize *poldsym to prevent uninitialized variable errors.
3626 2012-05-23 Cary Coutant <ccoutant@google.com>
3628 * layout.cc (Layout::section_name_mapping): Add rules to handle
3629 exact match on .data.rel.ro.local or .data.rel.ro.
3630 (Layout::output_section_name): Check for exact matches.
3632 2012-05-23 Cary Coutant <ccoutant@google.com>
3634 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3637 2012-05-22 Cary Coutant <ccoutant@google.com>
3639 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3640 object before exporting symbol.
3642 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3644 * testsuite/tls_test.cc: Include "config.h" first.
3645 * testsuite/tls_test_c.c: Likewise.
3647 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
3648 Nick Clifton <nickc@redhat.com>
3651 * configure.in: Add check that sysdep.h has been included before
3652 any system header files.
3653 * configure: Regenerate.
3654 * config.in: Regenerate.
3656 2012-05-14 Cary Coutant <ccoutant@google.com>
3658 * layout.cc (Layout::make_output_section): Mark .tdata section
3660 * testsuite/relro_test.cc: Add a TLS variable.
3662 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3665 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3666 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3669 2012-05-08 Cary Coutant <ccoutant@google.com>
3671 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3672 (lines_only_debug_sections): Likewise.
3674 2012-05-02 Roland McGrath <mcgrathr@google.com>
3676 * nacl.cc: New file.
3678 * Makefile.am (CCFILES, HFILES): Add them.
3679 * Makefile.in: Regenerate.
3680 * i386.cc (Output_data_plt_i386_nacl): New class.
3681 (Output_data_plt_i386_nacl_exec): New class.
3682 (Output_data_plt_i386_nacl_dyn): New class.
3683 (Target_i386_nacl): New class.
3684 (Target_selector_i386_nacl): New class.
3685 (target_selector_i386): Use it instead of Target_selector_i386.
3686 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3687 (Target_x86_64_nacl): New class.
3688 (Target_selector_x86_64_nacl): New class.
3689 (target_selector_x86_64, target_selector_x32): Use it instead of
3690 Target_selector_x86_64.
3691 * arm.cc (Output_data_plt_arm_nacl): New class.
3692 (Target_arm_nacl): New class.
3693 (Target_selector_arm_nacl): New class.
3694 (target_selector_arm, target_selector_armbe): Use it instead of
3695 Target_selector_arm.
3697 * target-select.cc (select_target): Take new Input_file* and off_t
3698 arguments, pass them on to recognize method of selector.
3699 * object.cc (make_elf_sized_object): Update caller.
3700 * parameters.cc (parameters_force_valid_target): Likewise.
3701 * incremental.cc (make_sized_incremental_binary): Likewise.
3702 * target-select.h: Update decl.
3703 (Target_selector::recognize): Take new Input_file* argument,
3704 pass it on to do_recognize.
3705 (Target_selector::do_recognize): Take new Input_file* argument.
3706 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3707 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3708 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3709 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3711 * target.h (Target::Target_info): New members isolate_execinstr
3713 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3714 * arm.cc (Target_arm::arm_info): Update initializer.
3715 * i386.cc (Target_i386::i386_info): Likewise.
3716 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3717 * sparc.cc (Target_sparc::sparc_info): Likewise.
3718 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3719 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3720 * layout.cc (Layout::attach_allocated_section_to_segment):
3721 Take new const Target* argument. If target->isolate_execinstr(), act
3723 (Layout::find_first_load_seg): Take new const Target* argument;
3724 if target->isolate_execinstr(), reject PF_X segments.
3725 (Layout::relaxation_loop_body): Update caller.
3726 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3727 reset file offset to zero when we hit LOAD_SEG, and then do a second
3728 loop over the segments before LOAD_SEG to reassign offsets after
3729 addresses have been determined. Handle target->rosegment_gap().
3730 (Layout::attach_section_to_segment): Take new const Target* argument;
3731 pass it to attach_allocated_section_to_segment.
3732 (Layout::make_output_section): Update caller.
3733 (Layout::attach_sections_to_segments): Take new const Target* argument;
3734 pass it to attach_section_to_segment.
3735 * gold.cc (queue_middle_tasks): Update caller.
3736 * layout.h (Layout): Update method decls with new arguments.
3738 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3739 Target_info pointer to use.
3740 (Target_arm::do_make_data_plt): New virtual method.
3741 (Target_arm::make_data_plt): New method that calls it.
3742 (Target_arm::make_plt_entry): Use it.
3743 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3744 for the section alignment.
3745 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3747 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3748 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3750 (Output_data_plt_arm::get_plt_entry_size): Call it.
3751 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3752 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3753 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3755 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3756 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3757 method instead of sizeof(plt_entry).
3758 (Output_data_plt_arm::add_entry): Likewise.
3759 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3760 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3762 (Target_arm::plt_entry_size): Likewise.
3763 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3765 (Output_data_plt_arm_standard): ... here, new class.
3766 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3767 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3768 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3770 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3771 Take additional argument for the PLT entry size.
3772 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3773 Use get_plt_entry_size method rather than plt_entry_size variable.
3774 (Output_data_plt_x86_64::reserve_slot): Likewise.
3775 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3776 (Output_data_plt_x86_64::add_entry): Likewise.
3777 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3778 (Output_data_plt_x86_64::address_for_global): Likewise.
3779 (Output_data_plt_x86_64::address_for_local): Likewise.
3780 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3781 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3782 Make method non-static.
3783 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3785 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3786 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3787 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3788 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3790 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3791 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3793 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3794 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3796 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3797 (Output_data_plt_x86_64::plt_entry_size)
3798 (Output_data_plt_x86_64::first_plt_entry)
3799 (Output_data_plt_x86_64::plt_entry)
3800 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3801 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3802 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3803 (Output_data_plt_x86_64_standard): ... here, new class.
3804 (Target_x86_64::Target_x86_64): Take optional argument for the
3805 Target_info pointer to use.
3806 (Target_x86_64::do_make_data_plt): New virtual method.
3807 (Target_x86_64::make_data_plt): New method to call it.
3808 (Target_x86_64::init_got_plt_for_update): Use that.
3809 Call this->plt_->add_eh_frame method here.
3810 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3811 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3812 rather than static method.
3813 (Target_x86_64::plt_entry_size): Likewise.
3814 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3815 rather than plt_entry_size variable. Move guts of PLT filling to...
3816 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3817 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3818 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3820 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3821 additional argument for the section alignment.
3822 Don't do add_eh_frame_for_plt here.
3823 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3824 non-static. Use get_plt_entry_size method rather than plt_entry_size
3826 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3828 (Output_data_plt_i386::get_plt_entry_size): Call it.
3829 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3830 (Output_data_plt_i386::add_eh_frame): New method to call it.
3831 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3833 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3834 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3836 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3837 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3838 method instead of plt_entry_size.
3839 (Output_data_plt_i386::plt_entry_size)
3840 (Output_data_plt_i386::plt_eh_frame_fde_size)
3841 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3842 (Output_data_plt_i386_standard): ... here, new class.
3843 (Output_data_plt_i386_exec): New class.
3844 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3845 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3846 (Output_data_plt_i386::exec_plt_entry): Move to ...
3847 (Output_data_plt_i386_exec::plt_entry): ... here.
3848 (Output_data_plt_i386_dyn): New class.
3849 (Output_data_plt_i386::first_plt_entry): Move to ...
3850 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3851 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3852 (Output_data_plt_i386_dyn::plt_entry): ... here.
3853 (Target_i386::Target_i386): Take optional argument for the Target_info
3855 (Target_i386::do_make_data_plt): New virtual method.
3856 (Target_i386::make_data_plt): New method to call it.
3857 (Target_i386::make_plt_section): Use that.
3858 Call this->plt_->add_eh_frame method here.
3859 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3860 rather than plt_entry_size variable.
3861 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3862 (Output_data_plt_i386::address_for_local): Likewise.
3863 (Output_data_plt_i386::do_write): Likewise.
3864 Move guts of PLT filling to...
3865 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3866 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3867 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3868 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3870 2012-05-01 Cary Coutant <ccoutant@google.com>
3872 * dwarf_reader.cc (Dwarf_die::read_attributes)
3873 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3874 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3875 * reduced_debug_output.cc
3876 (Output_reduced_debug_info_section::get_die_end): Remove
3877 DW_FORM_GNU_ref_index. Add default case.
3879 2012-04-26 Mark Wielaard <mjw@redhat.com>
3881 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3882 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3883 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3884 DW_AT_high_pc as offset from DW_AT_low_pc.
3886 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3887 * testsuite/Makefile.in: Regenerate.
3888 * testsuite/gdb_index_test_3.c: New test source file.
3889 * testsuite/gdb_index_test_3.sh: New test source file.
3891 2012-04-25 Ian Lance Taylor <iant@google.com>
3893 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3895 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3896 as a class, not a struct.
3897 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3898 (Target_arm::apply_cortex_a8_workaround): Likewise.
3899 * gc.h: Declare Reloc_types as a struct, not a class.
3900 * object.h: Declare Symbols_data as a struct.
3901 * reloc.h: Declare Read_relocs_data as a struct.
3902 * target.h: Declare Relocate_info as a struct.
3904 2012-04-24 David S. Miller <davem@davemloft.net>
3906 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3907 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3910 2012-04-24 Cary Coutant <ccoutant@google.com>
3912 * incremental-dump.cc (find_input_containing_global): Replace
3913 magic number with symbolic constant.
3914 (dump_incremental_inputs): Update version number.
3915 * incremental.cc (Output_section_incremental_inputs): Update version
3916 number; import symbolic constants from Incremental_inputs_reader.
3917 (Incremental_inputs::create_data_sections): Align relocations
3918 section correctly for 64-bit targets.
3919 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3920 constants; add padding.
3921 (Output_section_incremental_inputs::write_header): Add assert for
3923 (Output_section_incremental_inputs::write_input_files): Add assert
3924 for input_entry_size.
3925 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3926 add assert for object_info_size, input_section_entry_size,
3927 global_sym_entry_size.
3928 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3929 for data structure sizes; use them.
3930 (Incremental_input_entry_reader): Import symbolic constants from
3931 Incremental_inputs_reader; use them.
3933 2012-04-23 David S. Miller <davem@davemloft.net>
3935 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3937 (Target_sparc::Target_sparc): Initialize new fields.
3938 (Target_sparc::do_make_elf_object): New function.
3939 (Target_sparc::do_adjust_elf_header): New function.
3941 2012-04-23 Cary Coutant <ccoutant@google.com>
3943 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3944 CU range table of gdb index.
3946 2012-04-20 David S. Miller <davem@davemloft.net>
3948 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3951 2012-04-16 David S. Miller <davem@davemloft.net>
3953 * sparc.cc (Target_sparc::got_address): New function.
3954 (Sparc_relocate_functions::gdop_hix22): New function.
3955 (Sparc_relocate_functions::gdop_lox10): New function.
3956 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3958 (Target_sparc::Scan::local): Likewise if the global symbol is not
3959 preemptible and is not IFUNC.
3960 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3961 transformations for local and non-preemptible non-IFUNC global
3964 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3965 writing out 64-bit part of ranges.
3967 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3968 -fpic and -fpie respectively.
3969 * Makefile.in: Regenerate.
3971 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3972 (Target_sparc::Target_sparc): Initialize new field.
3973 (Target_sparc::do_plt_section_for_global): New function.
3974 (Target_sparc::do_plt_section_for_local): New function.
3975 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3976 (Target_sparc::make_plt_section): New function, broken out of
3977 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3978 (Target_sparc::make_plt_entry): Call make_plt_section.
3979 (Target_sparc::make_local_ifunc_plt_entry): New function.
3980 (Target_sparc::rela_ifunc_section): New function.
3981 (Target_sparc::plt_section): Remove const.
3982 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3983 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3984 and ifunc_count_ fields.
3985 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3986 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3987 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3988 (Output_data_plt_sparc::rela_ifunc): New function.
3989 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3990 (Output_data_plt_sparc::has_ifunc_section): New function.
3991 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3992 (Output_data_plt_sparc::address_for_global): New function.
3993 (Output_data_plt_sparc::address_for_local): New function.
3994 (Output_data_plt_sparc::plt_index_to_offset): New function.
3995 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3997 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3999 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4000 R_SPARC_JMP_IREL to switch.
4001 (Target_sparc::Scan::check_non_pic): Likewise.
4002 (Target_sparc::Scan::local): Handle IFUNC symbols.
4003 (Target_sparc::Scan::local): Likewise.
4004 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4005 and plt_address_for_local.
4006 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4007 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4009 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4010 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4011 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4012 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4014 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4015 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4017 * sparc.cc (Target_sparc::Scan::global): Likewise.
4018 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4020 2012-04-16 Cary Coutant <ccoutant@google.com>
4022 * archive.cc (Library_base::should_include_member): Check for
4023 --export-dynamic-symbol.
4024 * options.h (class General_options): Add --export-dynamic-symbol.
4025 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4026 --export-dynamic-symbol.
4027 (Symbol_table::gc_mark_undef_symbols): Likewise.
4028 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4030 2012-04-12 David S. Miller <davem@davemloft.net>
4032 * sparc.cc (Reloc::wdisp10): New relocation method.
4033 (Reloc::h34): Likewise.
4034 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4035 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4037 (Target_sparc::Scan::local): Likewise.
4038 (Target_sparc::Scan::global): Likewise.
4039 (Target_sparc::Relocate::relocate): Likewise.
4041 2012-04-09 Cary Coutant <ccoutant@google.com>
4043 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4046 2012-04-06 Ian Lance Taylor <iant@google.com>
4048 * timer.cc: #include <unistd.h>.
4050 2012-04-06 Roland McGrath <mcgrathr@google.com>
4052 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4053 * config.in: Regenerate.
4054 * configure: Regenerate.
4056 2012-04-05 Nick Clifton <nickc@redhat.com>
4058 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4059 (AM_LC_MESSAGES): Add.
4060 * aclocal.m4: Regenerate.
4061 * config.in: Regenerate.
4062 * configure: Regenerate.
4064 2012-03-21 Cary Coutant <ccoutant@google.com>
4066 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4067 * Makefile.in: Regenerate.
4068 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4069 (Sized_elf_reloc_mapper::symbol_section): New function.
4070 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4071 (make_elf_reloc_mapper): New function.
4072 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4073 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4074 (Dwarf_abbrev_table::do_get_abbrev): New function.
4075 (Dwarf_ranges_table::read_ranges_table): New function.
4076 (Dwarf_ranges_table::read_range_list): New function.
4077 (Dwarf_pubnames_table::read_section): New function.
4078 (Dwarf_pubnames_table::read_header): New function.
4079 (Dwarf_pubnames_table::next_name): New function.
4080 (Dwarf_die::Dwarf_die): New function.
4081 (Dwarf_die::read_attributes): New function.
4082 (Dwarf_die::skip_attributes): New function.
4083 (Dwarf_die::set_name): New function.
4084 (Dwarf_die::set_linkage_name): New function.
4085 (Dwarf_die::attribute): New function.
4086 (Dwarf_die::string_attribute): New function.
4087 (Dwarf_die::int_attribute): New function.
4088 (Dwarf_die::uint_attribute): New function.
4089 (Dwarf_die::ref_attribute): New function.
4090 (Dwarf_die::child_offset): New function.
4091 (Dwarf_die::sibling_offset): New function.
4092 (Dwarf_info_reader::check_buffer): New function.
4093 (Dwarf_info_reader::parse): New function.
4094 (Dwarf_info_reader::do_parse): New function.
4095 (Dwarf_info_reader::do_read_string_table): New function.
4096 (Dwarf_info_reader::lookup_reloc): New function.
4097 (Dwarf_info_reader::get_string): New function.
4098 (Dwarf_info_reader::visit_compilation_unit): New function.
4099 (Dwarf_info_reader::visit_type_unit): New function.
4100 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4101 Sized_elf_reloc_mapper.
4102 (Sized_dwarf_line_info::symbol_section): Remove function.
4103 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4104 (Sized_dwarf_line_info::read_line_mappings): Remove object
4105 parameter, adjust callers.
4106 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4107 * dwarf_reader.h: Include <sys/types.h>.
4108 (class Track_relocs): Remove forward declaration.
4109 (class Elf_reloc_mapper): New class.
4110 (class Sized_elf_reloc_mapper): New class.
4111 (class Dwarf_abbrev_table): New class.
4112 (class Dwarf_range_list): New class.
4113 (class Dwarf_ranges_table): New class.
4114 (class Dwarf_pubnames_table): New class.
4115 (class Dwarf_die): New class.
4116 (class Dwarf_info_reader): New class.
4117 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4118 (Sized_dwarf_line_info::symbol_section): Remove member function.
4119 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4121 * gdb-index.cc: New source file.
4122 * gdb-index.h: New source file.
4123 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4124 and .debug_types sections, call Layout::add_to_gdb_index.
4125 (Sized_relobj_incr::do_section_name): Implement.
4126 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4127 return type; Implement.
4128 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4130 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4131 parameter list and return type.
4132 (Sized_incr_dynobj::do_section_contents): Likewise.
4133 * layout.cc: Include gdb-index.h.
4134 (Layout::Layout): Initialize gdb_index_data_.
4135 (Layout::init_fixed_output_section): Check for .gdb_index section.
4136 (Layout::add_to_gdb_index): New function. Instantiate.
4137 * layout.h: Add forward declaration for class Gdb_index.
4138 (Layout::add_to_gdb_index): New member function.
4139 (Layout::gdb_index_data_): New data member.
4140 * main.cc: Include gdb-index.h.
4141 (main): Print statistics for gdb index.
4142 * object.cc (Object::section_contents): Move code into
4143 do_section_contents.
4144 (need_decompressed_section): Check for sections needed when building
4146 (build_compressed_section_map): Likewise.
4147 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4149 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4150 sections; call Layout::add_to_gdb_index.
4151 (Sized_relobj_file::do_decompressed_section_contents): Call
4152 do_section_contents directly.
4153 * object.h (Object::do_section_contents): Adjust parameter list and
4155 (Object::do_decompressed_section_contents): Call do_section_contents
4157 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4159 * options.h (class General_options): Add --gdb-index option.
4160 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4161 list and return type.
4162 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4163 * reloc.h (Track_relocs::checkpoint): New function.
4164 (Track_relocs::reset): New function.
4166 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4168 * testsuite/Makefile.in: Regenerate.
4169 * testsuite/gdb_index_test.cc: New test source file.
4170 * testsuite/gdb_index_test_1.sh: New test source file.
4171 * testsuite/gdb_index_test_2.sh: New test source file.
4173 2012-03-19 Doug Kwan <dougkwan@google.com>
4175 * arm.cc (Target_arm::do_define_standard_symbols): New method.
4176 (Target_arm::do_finalize_sections): Remove code which defines
4177 __exidx_start and __exidx_end. Make symbol table parameter
4178 anonymous as it is not used.
4179 * gold.cc (queue_middle_tasks): Call target hook to define any
4180 target-specific symbols.
4181 * target.h (Target::define_standard_symbols): New method.
4182 (Target::do_define_standard_symbols): Same.
4183 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4184 * testsuite/Makefile.in: Regenerate.
4185 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4187 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4188 relocations are generated for __exidx_start and __exidx_end.
4190 2012-03-16 Doug Kwan <dougkwan@google.com>
4192 * testsuite/Makefile.am: Disable test initpri3b.
4193 * testsuite/Makefile.in: Regenerate.
4195 2012-03-15 Doug Kwan <dougkwan@google.com>
4197 * arm.cc (Target_arm::got_section): Make .got section read-only
4200 2012-03-15 Ian Lance Taylor <iant@google.com>
4203 * layout.cc (Layout::make_output_section): Correctly mark
4204 SHT_INIT_ARRAY, et. al., as relro.
4206 2012-03-14 Doug Kwan <dougkwan@google.com>
4208 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4209 dynamic relocations for protected symbols in shared objects.
4211 2012-03-13 Ian Lance Taylor <iant@google.com>
4213 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4214 keep the larger alignment.
4216 2012-03-12 Cary Coutant <ccoutant@google.com>
4218 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4219 handling of DW_LNE_define_file.
4221 2012-03-12 Cary Coutant <ccoutant@google.com>
4223 * reduced_debug_output.cc
4224 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4227 2012-02-29 Cary Coutant <ccoutant@google.com>
4229 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4231 2012-02-29 Cary Coutant <ccoutant@google.com>
4233 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4234 Call Object::decompressed_section_contents.
4235 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4237 (Sized_dwarf_line_info::buffer_start_): New data member.
4238 * merge.cc (Output_merge_data::do_add_input_section): Call
4239 Object::decompressed_section_contents.
4240 (Output_merge_string::do_add_input_section): Likewise.
4241 * object.cc (need_decompressed_section): New function.
4242 (build_compressed_section_map): Decompress sections needed later.
4243 (Sized_relobj_file::do_decompressed_section_contents): New function.
4244 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4245 * object.h (Object::decompressed_section_contents): New function.
4246 (Object::discard_decompressed_sections): New function.
4247 (Object::do_decompressed_section_contents): New function.
4248 (Object::do_discard_decompressed_sections): New function.
4249 (Compressed_section_info): New type.
4250 (Compressed_section_map): Include decompressed section contents.
4251 (Sized_relobj_file::do_decompressed_section_contents): New function.
4252 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4254 2012-02-16 Cary Coutant <ccoutant@google.com>
4256 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4257 * testsuite/Makefile.in: Regenerate.
4259 2012-02-14 Cary Coutant <ccoutant@google.com>
4261 * options.cc (General_options::finalize): Disallow -pie and -static.
4263 2012-02-03 Doug Kwan <dougkwan@google.com>
4265 * arm.cc (Arm_relocate_functions::abs8,
4266 Arm_relocate_functions::abs16): Use
4267 Bits::has_signed_unsigned_overflow32.
4268 (Arm_relocate_functions::thm_abs8): Correct range of
4270 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4273 2012-02-02 Doug Kwan <dougkwan@google.com>
4275 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4276 position independent outputs, not just shared objects.
4278 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4280 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4281 * configure: Regenerated.
4283 2012-01-27 Ian Lance Taylor <iant@google.com>
4285 * reloc.h (Bits): New class with static functions, copied from
4286 namespace utils in arm.cc.
4287 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4290 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4292 * incremental.cc (write_info_blocks): Correct relocation offset.
4294 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4296 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4297 (Relocate::tls_gd_to_le): Likewise.
4299 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4301 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4303 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4305 * configure.ac: Check if -mcmodel=medium works.
4306 * configure: Regenerated.
4308 2012-01-24 Cary Coutant <ccoutant@google.com>
4310 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4312 (read_unsigned_LEB_128_x): ... this new function.
4313 (read_signed_LEB_128): Replaced with inline definition and ...
4314 (read_signed_LEB_128_x): ... this new function.
4315 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4316 (read_unsigned_LEB_128): Add inline definition.
4317 (read_signed_LEB_128_x): New function.
4318 (read_signed_LEB_128): Add inline definition.
4319 * testsuite/Makefile.am (leb128_unittest): New unit test.
4320 * testsuite/Makefile.in: Regenerate.
4321 * testsuite/leb128_unittest.cc: New unit test.
4323 2012-01-23 Ian Lance Taylor <iant@google.com>
4326 * i386.cc (Target_i386::do_code_fill): When using a jmp
4327 instruction, pad with nop instructions.
4328 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4330 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4332 * x86_64.cc (gc_process_relocs): Add typename on types used in
4334 (scan_relocs): Likewise.
4335 (relocate_section): Likewise.
4336 (apply_relocation): Likewise.
4338 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4340 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4341 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4344 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4346 * x86_64.cc: Initial support for x32.
4348 2012-01-03 Cary Coutant <ccoutant@google.com>
4350 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4351 Use abstract base class for GOT.
4352 * gold/output.h (class Output_data_got_base): New abstract base class.
4353 (class Output_data_got): Derive from new base class, adjust ctors.
4354 (Output_data_got::reserve_slot): Make virtual; rename to
4355 do_reserve_slot; Adjust callers.
4356 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4357 pointer to abstract base class.
4358 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4360 2011-12-18 Ian Lance Taylor <iant@google.com>
4362 * object.h (Relobj::local_symbol_value): New function.
4363 (Relobj::local_plt_offset): New function.
4364 (Relobj::local_has_got_offset): New function.
4365 (Relobj::local_got_offset): New function.
4366 (Relobj::set_local_got_offset): New function.
4367 (Relobj::do_local_symbol_value): New pure virtual function.
4368 (Relobj::do_local_plt_offset): Likewise.
4369 (Relobj::do_local_has_got_offset): Likewise.
4370 (Relobj::do_local_got_offset): Likewise.
4371 (Relobj::do_set_local_got_offset): Likewise.
4372 (Sized_relobj::do_local_has_got_offset): Rename from
4373 local_has_got_offset.
4374 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4375 (Sized_relobj::do_set_local_got_offset): Rename from
4376 set_local_got_offset.
4377 (Sized_relobj_file::do_local_plt_offset): Rename from
4379 (Sized_relobj_file::do_local_symbol_value): New function.
4380 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4382 * output.cc (Output_data_got::Got_entry::write): Change object to
4383 Relobj. Use local_symbol_value.
4384 (Output_data_got::add_global_with_rel): Change rel_dyn to
4385 Output_data_reloc_generic*. Use add_global_generic.
4386 (Output_data_got::add_global_with_rela): Remove. Change all
4387 callers to use add_global_with_rel.
4388 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4389 Output_data_reloc_generic*. Use add_global_generic.
4390 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4391 callers to use add_global_pair_with_rel.
4392 (Output_data_got::add_local): Change object to Relobj*.
4393 (Output_data_got::add_local_plt): Likewise.
4394 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4395 change rel_dyn to Output_data_reloc_generic*. Use
4397 (Output_data_got::add_local_with_rela): Remove. Change all
4398 callers to use all_local_with_rel.
4399 (Output_data_got::add_local_pair_with_rel): Change object to
4400 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4401 add_output_section_generic.
4402 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4403 callers to use add_local_pair_with_rel.
4404 (Output_data_got::reserve_local): Change object to Relobj*.
4405 * output.h: (class Output_data_reloc_generic): Add pure virtual
4406 declarations for add_global_generic, add_local_generic,
4407 add_output_section_generic.
4408 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4409 functions for Output_data_reloc_generic. Update declarations for
4410 changes listed in output.cc.
4411 (class Output_data_got): Change template parameter to got_size.
4412 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4413 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4415 (Sized_relobj_incr::do_local_plt_offset): New function.
4416 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4419 2011-12-17 Cary Coutant <ccoutant@google.com>
4421 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4422 * resolve.cc (Symbol_table::resolve): Likewise.
4423 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4425 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4427 2011-12-16 Ian Lance Taylor <iant@google.com>
4429 * output.h (Output_data_reloc_generic::add): Only call
4430 add_dynamic_reloc if this is a dynamic reloc section.
4432 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4435 * target-reloc.h (apply_relocation): Replace <64, false> with
4438 2011-11-25 Nick Clifton <nickc@redhat.com>
4440 * po/it.po: New Italian translation.
4442 2011-11-17 Sterling Augustine <saugustine@google.com>
4444 * script.cc (script_include_directive): Implement.
4445 (read_script_file): New local variables name and search_path. Update
4446 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4447 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4448 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4450 2011-11-11 Sterling Augustine <saugustine@google.com>
4452 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4453 (file_or_sections_cmd): Likewise.
4455 2011-11-11 Doug Kwan <dougkwan@google.com>
4457 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4458 if --just-symbols is given.
4460 2011-11-10 Doug Kwan <dougkwan@google.com>
4463 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4464 when processing data relocs.
4465 * reloc.h (Relocate_functions::rel_unaligned): New method.
4466 (Relocate_functions::pcrel_unaligned): Ditto.
4467 (Relocate_functions::rel32_unaligned): Ditto.
4468 (Relocate_functions::pcrel32_unaligned): Ditto.
4470 2011-11-09 Doug Kwan <dougkwan@google.com>
4473 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4474 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4475 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4476 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4477 (Relocate_functions::rel_unaligned): New.
4478 (Relocate_functions::rel32_unaligned): New.
4479 * target-reloc.h (relocate_for_relocatable): Add code to handle
4480 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4481 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4482 arm_unaligned_reloc_r): New targets.
4483 * testsuite/Makefile.in: Regenerate.
4484 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4487 2011-11-02 Ian Lance Taylor <iant@google.com>
4489 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4491 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4492 * options.cc (General_options::finalize): Use library search path
4493 from configure script if specified. If not native and no sysroot,
4494 only search TOOLLIBDIR.
4495 * options.h (Search_directory::Search_directory): Change name to
4497 (General_options::add_to_library_path_with_sysroot): Change arg to
4499 * configure, Makefile.in, config.in: Rebuild.
4501 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4503 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4504 we are working around the ARM1176 Erratum.
4505 * options.h (General_options::fix_arm1176): Add option.
4506 * testsuite/Makefile.am: Add testcases, and keep current ones
4508 * testsuite/Makefile.in: Regenerate.
4509 * testsuite/arm_fix_1176.s: New file.
4510 * testsuite/arm_fix_1176.sh: Likewise.
4512 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4514 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4516 (Target_arm::may_use_blx): Remove method.
4517 (Target_arm::set_may_use_blx): Likewise.
4518 (Target_arm::may_use_v4t_interworking): New method.
4519 (Target_arm::may_use_v5t_interworking): Likewise.
4520 (Target_arm::may_use_blx_): Remove member variable.
4521 (Arm_relocate_functions::arm_branch_common): Check for v5T
4523 (Arm_relocate_functions::thumb_branch_common): Likewise.
4524 (Reloc_stub::stub_type_for_reloc): Likewise.
4525 (Target_arm::do_finalize_sections): Correct interworking checks.
4526 * testsuite/Makefile.am: Add new tests.
4527 * testsuite/Makefile.in: Regenerate.
4528 * testsuite/arm_farcall_arm_arm.s: New test.
4529 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4530 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4531 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4532 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4533 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4534 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4535 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4537 2011-10-31 Cary Coutant <ccoutant@google.com>
4540 * expression.cc (Expression::eval_with_dot): Add
4541 is_section_dot_assignment parameter.
4542 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4543 absolute and assigning to dot within a section.
4544 * script-sections.cc
4545 (Output_section_element_assignment::set_section_addresses): Pass
4546 dot_section to set_if_absolute.
4547 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4548 as is_section_dot_assignment flag to eval_with_dot.
4549 (Output_section_element_dot_assignment::set_section_addresses):
4551 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4552 parameter. Also set value if relative to dot_section; set the
4553 symbol's output_section.
4554 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4555 parameter. Adjust all callers.
4556 (Expression::eval_maybe_dot): Likewise.
4557 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4559 * testsuite/script_test_2.t: Test assignment of an absolute value
4560 to dot within an output section element.
4562 2011-10-31 Cary Coutant <ccoutant@google.com>
4564 * options.h (class General_options): Add --[no-]gnu-unique options.
4565 * symtab.cc (Symbol_table::sized_write_globals): Convert
4566 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4568 2011-10-31 Cary Coutant <ccoutant@google.com>
4571 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4572 unnecessary assertion.
4573 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4575 2011-10-31 Sriraman Tallam <tmsriram@google.com>
4577 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4579 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4581 Change to just keep the section associated with symbol.
4582 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4583 they are externally visible and --export-dynamic is turned on.
4584 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4586 2011-10-19 Ian Lance Taylor <iant@google.com>
4589 * script-sections.cc
4590 (Output_section_element_dot_assignment::needs_output_section): New
4593 2011-10-19 Ian Lance Taylor <iant@google.com>
4596 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4597 --section-start option was seen.
4598 * options.h (General_options::any_section_start): New function.
4600 2011-10-18 David S. Miller <davem@davemloft.net>
4603 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4604 member to track relocation locations that have moved during TLS
4605 reloc optimizations.
4606 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4607 (Target_sparc::Relocate::relocate): Adjust view down by 4
4608 bytes if it matches reloc_adjust_addr_.
4609 (Target_sparc::Relocate::relocate_tls): Always move the
4610 __tls_get_addr call delay slot instruction forward 4 bytes when
4611 performing relaxation.
4613 2011-10-18 Cary Coutant <ccoutant@google.com>
4615 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4616 (Output_file::map_no_anonymous): Check for non-zero
4617 return code from posix_fallocate.
4619 2011-10-17 Cary Coutant <ccoutant@google.com>
4622 * plugin.cc (is_visible_from_outside): Check for symbols
4623 referenced from dynamic objects.
4624 * resolve.cc (Symbol_table::resolve): Don't count references
4625 from dynamic objects as references from real ELF files.
4626 * testsuite/plugin_test_2.sh: Adjust expected result.
4628 2011-10-17 Cary Coutant <ccoutant@google.com>
4630 * gold.cc: Include timer.h.
4631 (queue_middle_tasks): Stamp time.
4632 (queue_final_tasks): Likewise.
4633 * main.cc (main): Store timer in parameters. Print timers
4635 * parameters.cc (Parameters::Parameters): Initialize timer_.
4636 (Parameters::set_timer): New function.
4637 (set_parameters_timer): New function.
4638 * parameters.h (Parameters::set_timer): New function.
4639 (Parameters::timer): New function.
4640 (Parameters::timer_): New data member.
4641 (set_parameters_timer): New function.
4642 * timer.cc (Timer::stamp): New function.
4643 (Timer::get_pass_time): New function.
4644 * timer.h (Timer::stamp): New function.
4645 (Timer::get_pass_time): New function.
4646 (Timer::pass_times_): New data member.
4648 2011-10-17 Cary Coutant <ccoutant@google.com>
4650 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4651 task for members of lib groups.
4653 2011-10-17 Cary Coutant <ccoutant@google.com>
4656 * fileread.cc (File_read::find_view): Add assert.
4657 (File_read::make_view): Move bounds check (replace with assert)...
4658 (File_read::find_or_make_view): ... to here.
4660 2011-10-12 Cary Coutant <ccoutant@google.com>
4662 * output.cc (Output_file::open_base_file): Handle case where
4663 ::read returns less than requested size.
4665 2011-10-10 Cary Coutant <ccoutant@google.com>
4667 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
4668 Initialize defined_count_.
4669 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4670 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4671 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4672 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4673 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4674 * incremental.h (Sized_relobj_incr::defined_count_): New data
4676 (Sized_incr_dynobj::defined_count_): New data member.
4677 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
4678 Return zeroes instead of internal error.
4680 2011-10-10 Cary Coutant <ccoutant@google.com>
4683 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
4684 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4685 * output.h (class Output_reloc): Add use_plt_offset flag.
4686 (Output_reloc::type_): Adjust size of bit field.
4687 (Output_reloc::use_plt_offset_): New bit field.
4688 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4689 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4690 flag. Adjust all callers.
4691 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
4692 creating RELATIVE relocations.
4694 2011-10-10 Nick Clifton <nickc@redhat.com>
4696 * po/es.po: Updated Spanish translation.
4697 * po/fi.po: Updated Finnish translation.
4699 2011-10-03 Diego Novillo <dnovillo@google.com>
4701 * options.cc (parse_uint): Fix dereference of RETVAL.
4703 2011-09-29 Sriraman Tallam <tmsriram@google.com>
4705 * layout.h (section_order_map_): New member.
4706 (get_section_order_map): New member function.
4707 * output.cc (Output_section::add_input_section): Check for patterns
4708 only when --section-ordering-file is specified.
4709 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4710 output_sections have been formed.
4711 * layout.cc (Layout_Layout): Initialize section_order_map_.
4712 * plugin.cc (update_section_order): Store order in order_map. Do not
4714 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4715 * testsuite/Makefile.in: Regenerate.
4716 * testsuite/plugin_section_order.c: New file.
4717 * testsuite/plugin_final_layout.cc: New file.
4718 * testsuite/plugin_final_layout.sh: New file.
4720 2011-09-29 Cary Coutant <ccoutant@google.com>
4722 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4724 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
4725 symbols during incremental update.
4726 (Symbol_table::add_from_dynobj): Likewise.
4728 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4729 Ian Lance Taylor <iant@google.com>
4731 * symtab.cc (Symbol_table::define_special_symbol): Always
4732 canonicalize version string.
4734 2011-09-26 Cary Coutant <ccoutant@google.com>
4736 * gold.cc (queue_initial_tasks): Move option checks ...
4737 * options.cc (General_options::finalize): ... to here. Disable
4738 some options; make others fatal.
4740 2011-09-26 Cary Coutant <ccoutant@google.com>
4743 * plugin.cc (get_symbols_v2): New function.
4744 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4745 (is_referenced_from_outside): New function.
4746 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4747 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4748 (get_symbols): Pass version parameter.
4749 (get_symbols_v2): New function.
4750 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4752 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4753 (onload): Add LDPT_GET_SYMBOLS_V2.
4754 (all_symbols_read_hook): Use get_symbols_v2; check for
4755 LDPR_PREVAILING_DEF_IRONLY_EXP.
4756 * testsuite/plugin_test_3.sh: Update expected results.
4758 2011-09-23 Simon Baldwin <simonb@google.com>
4760 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4761 configuration options.
4762 * configure: Regenerate.
4763 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4764 * Makefile.in: Regenerate.
4765 * testsuite/Makefile.in: Regenerate.
4767 2011-09-19 Sriraman Tallam <tmsriram@google.com>
4769 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4771 2011-09-19 Cary Coutant <ccoutant@google.com>
4773 * incremental.cc (can_incremental_update): Fix typo in comment.
4774 * incremental.h (can_incremental_update): Likewise.
4776 2011-09-18 Cary Coutant <ccoutant@google.com>
4778 * incremental.cc (can_incremental_update): New function.
4779 * incremental.h (can_incremental_update): New function.
4780 * layout.cc (Layout::init_fixed_output_section): Call it.
4781 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4782 * object.cc (Sized_relobj_file::do_layout): Call
4783 can_incremental_update.
4785 2011-09-13 Cary Coutant <ccoutant@google.com>
4787 * configure.ac: Check for glibc support for gnu_indirect_function
4788 support with static linking, setting automake conditional
4790 * Makefile.in: Regenerate.
4791 * configure: Regenerate.
4793 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4794 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4796 * testsuite/Makefile.in: Regenerate.
4798 2011-09-13 Cary Coutant <ccoutant@google.com>
4800 * incremental.cc (Sized_relobj_incr::do_layout): Call
4801 report_comdat_group for kept comdat sections.
4802 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4803 * testsuite/Makefile.in: Regenerate.
4804 * testsuite/incr_comdat_test_1.cc: New source file.
4805 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4806 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4807 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4809 2011-09-13 Ian Lance Taylor <iant@google.com>
4811 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4812 variable external_symbols_offset.
4814 2011-09-12 Ian Lance Taylor <iant@google.com>
4816 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4817 triggered if object has no symbols.
4819 2011-09-09 David S. Miller <davem@davemloft.net>
4821 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4822 (Output_fill_debug_line::do_write): Likewise.
4824 2011-08-29 Cary Coutant <ccoutant@google.com>
4826 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4827 casts to match formatting specs.
4828 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4830 2011-08-26 Cary Coutant <ccoutant@google.com>
4832 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4833 remaining hole size when allocating.
4834 (Layout::make_output_section): Set fill methods for debug sections.
4835 * layout.h (Free_list::Free_list_node): Move from private to
4837 (Free_list::set_min_hole_size): New function.
4838 (Free_list::begin, Free_list::end): New functions.
4839 (Free_list::min_hole_): New data member.
4840 * output.cc: Include dwarf.h.
4841 (Output_fill_debug_info::do_minimum_hole_size): New function.
4842 (Output_fill_debug_info::do_write): New function.
4843 (Output_fill_debug_line::do_minimum_hole_size): New function.
4844 (Output_fill_debug_line::do_write): New function.
4845 (Output_section::Output_section): Initialize new data member.
4846 (Output_section::set_final_data_size): Ensure patch space is larger
4847 than minimum hole size.
4848 (Output_section::do_write): Fill holes in debug sections.
4849 * output.h (Output_fill): New class.
4850 (Output_fill_debug_info): New class.
4851 (Output_fill_debug_line): New class.
4852 (Output_section::set_free_space_fill): New function.
4853 (Output_section::free_space_fill_): New data member.
4854 * testsuite/Makefile.am (incremental_test_3): Add
4855 --incremental-patch option.
4856 (incremental_test_4): Likewise.
4857 (incremental_test_5): Likewise.
4858 (incremental_test_6): Likewise.
4859 (incremental_copy_test): Likewise.
4860 (incremental_common_test_1): Likewise.
4861 * testsuite/Makefile.in: Regenerate.
4863 2011-08-26 Nick Clifton <nickc@redhat.com>
4865 * po/es.po: Updated Spanish translation.
4867 2011-08-01 Cary Coutant <ccoutant@google.com>
4869 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4870 * gold/testsuite/Makefile.in: Regenerate.
4871 * gold/testsuite/justsyms_exec.c: New source file.
4872 * gold/testsuite/justsyms_lib.c: New source file.
4874 2011-08-01 Cary Coutant <ccoutant@google.com>
4876 * layout.cc (Layout::set_segment_offsets): Don't realign text
4877 segment if -Ttext was specified.
4878 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4880 * object.h (Sized_relobj_file::e_type): New function.
4881 (Sized_relobj_file::e_type_): New data member.
4882 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4883 base address for ET_EXEC files.
4884 * target.cc (Target::do_make_elf_object_implementation): Allow
4885 ET_EXEC files with --just-symbols option.
4887 2011-07-28 Cary Coutant <ccoutant@google.com>
4889 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4890 Add thread_number parameter.
4891 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4892 * workqueue-threads.cc
4893 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4894 current thread if its thread number is greater than desired thread
4896 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4897 Add thread_number parameter.
4898 (Workqueue::should_cancel_thread): Likewise.
4899 (Workqueue::find_runnable_or_wait): Pass thread_number to
4900 should_cancel_thread.
4901 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4904 2011-07-22 Sriraman Tallam <tmsriram@google.com>
4906 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4907 only after checking if it cannot be forced local.
4908 * symtab.h (is_externally_visible): Check if the symbol is not forced
4911 2011-07-15 Ian Lance Taylor <iant@google.com>
4913 * options.h (class General_options): Add --print-output-format.
4914 Move -EL next to -EB, for better --help output.
4915 * target-select.cc: Include <cstdio>, "options.h", and
4917 (Target_selector::do_target_bfd_name): New function.
4918 (print_output_format): New function.
4919 * target-select.h (class Target_selector): Update declarations.
4920 (Target_selector::target_bfd_name): New function.
4921 (print_output_format): Declare.
4922 * main.cc: Include "target-select.h".
4923 (main): Handle --print-output-format.
4924 * gold.cc: Include "target-select.h".
4925 (queue_initial_tasks): Handle --print-output-format when there are
4927 * parameters.cc (parameters_force_valid_target): Give a better
4928 error message if -EB/-EL does not match target.
4929 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4932 2011-07-15 Ian Lance Taylor <iant@google.com>
4934 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4935 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4936 (Output_data_plt_i386::do_write): Write address of .dynamic
4937 section to first entry in .got.plt section.
4938 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4939 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4941 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4942 section to first entry in .got.plt section.
4943 * layout.h (Layout::dynamic_section): New function.
4945 2011-07-13 Sriraman Tallam <tmsriram@google.com>
4947 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4949 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4950 input_section_position_, and input_section_glob_.
4951 (read_layout_from_file): Call function section_ordering_specified.
4952 * layout.h (is_section_ordering_specified): New function.
4953 (section_ordering_specified): New function.
4954 (section_ordering_specified_): New boolean member.
4955 * main.cc(main): Call load_plugins after layout object is defined.
4956 * output.cc (Output_section::add_input_section): Use
4957 function section_ordering_specified to check if section ordering is
4959 * output.cc (Output_section::add_relaxed_input_section): Use
4960 function section_ordering_specified to check if section ordering is
4962 (Output_section::update_section_layout): New function.
4963 (Output_section::sort_attached_input_sections): Check if input section
4965 * output.h (Output_section::update_section_layout): New function.
4966 * plugin.cc (get_section_count): New function.
4967 (get_section_type): New function.
4968 (get_section_name): New function.
4969 (get_section_contents): New function.
4970 (update_section_order): New function.
4971 (allow_section_ordering): New function.
4972 (Plugin::load): Add the new interfaces to the transfer vector.
4973 (Plugin_manager::load_plugins): New parameter.
4974 (Plugin_manager::all_symbols_read): New parameter.
4975 (Plugin_manager::claim_file): New parameter. Save the elf object for
4977 (Plugin_manager::get_elf_object): New function.
4978 (Plugin_manager::get_view): Change to directly use the bool to check
4979 if get_view is called from claim_file_hook.
4980 * plugin.h (input_objects): New function
4981 (Plugin__manager::load_plugins): New parameter.
4982 (Plugin_manager::claim_file): New parameter.
4983 (Plugin_manager::get_elf_object): New function.
4984 (Plugin_manager::in_claim_file_handler): New function.
4985 (Plugin_manager::in_claim_file_handler_): New member.
4986 (layout): New function.
4987 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4988 handler with an extra parameter. Make the elf object before calling
4990 * testsuite/plugin_test.c (get_section_count): New function pointer.
4991 (get_section_type): New function pointer.
4992 (get_section_name): New function pointer.
4993 (get_section_contents): New function pointer.
4994 (update_section_order): New function pointer.
4995 (allow_section_ordering): New function pointer.
4996 (onload): Check if the new interfaces exist.
4998 2011-07-13 Ian Lance Taylor <iant@google.com>
5000 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5002 * x86_64.cc (Target_x86_64::got_section): Likewise.
5003 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5004 (relro_now_test_SOURCES): New variable.
5005 (relro_now_test_DEPENDENCIES): New variable.
5006 (relro_now_test_LDFLAGS): New variable.
5007 (relro_now_test_LDADD): New variable.
5008 (relro_now_test.so): New target.
5009 * testsuite/Makefile.in: Rebuild.
5011 2011-07-12 Ian Lance Taylor <iant@google.com>
5014 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5015 GLOB_DAT relocation rather than a RELATIVE relocation for a
5016 protected symbol when creating a shared library.
5017 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5018 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5019 * testsuite/protected_main_1.cc (main): Test that protected
5020 function has same address.
5022 2011-07-11 Ian Lance Taylor <iant@google.com>
5025 * options.h (class General_options): Add -Bgroup.
5026 * options.cc (General_options::finalize): If -Bgroup is set,
5027 default to --unresolved-symbols=report-all.
5028 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5029 * target-reloc.h (issue_undefined_symbol_error): Handle
5030 --unresolved-symbols=report-all.
5032 2011-07-08 Ian Lance Taylor <iant@google.com>
5035 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5036 if linker script discards key sections.
5037 (Layout::create_dynamic_symtab): Likewise.
5038 (Layout::assign_local_dynsym_offsets): Likewise.
5039 (Layout::sized_create_version_sections): Likewise.
5040 (Layout::create_interp): Likewise.
5041 (Layout::finish_dynamic_section): Likewise.
5042 (Layout::set_dynamic_symbol_size): Likewise.
5044 2011-07-08 Ian Lance Taylor <iant@google.com>
5047 * options.h (class General_options): Add --unresolved-symbols.
5048 * target-reloc.h (issue_undefined_symbol_error): Check
5049 --unresolved-symbols. Add comments.
5051 2011-07-08 Ian Lance Taylor <iant@google.com>
5053 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5054 expression more complex.
5056 2011-07-08 Ian Lance Taylor <iant@google.com>
5059 * target-reloc.h (issue_undefined_symbol_error): New inline
5060 function, broken out of relocate_section.
5061 (relocate_section): Call issue_undefined_symbol_error.
5062 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5063 there is no TLS segment if we are about to issue an undefined
5065 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5067 2011-07-08 Ian Lance Taylor <iant@google.com>
5070 * resolve.cc (Symbol_table::should_override): Add fromtype
5071 parameter. Change all callers. Give error when linking together
5072 TLS and non-TLS symbol.
5073 (Symbol_table::should_override_with_special): Add fromtype
5074 parameter. Change all callers.
5075 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5076 there is no TLS segment if we have reported some errors.
5077 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5079 2011-07-08 Ian Lance Taylor <iant@google.com>
5082 * target.h (Target::plt_address_for_global): New function.
5083 (Target::plt_address_for_local): New function.
5084 (Target::plt_section_for_global): Remove.
5085 (Target::plt_section_for_local): Remove.
5086 (Target::do_plt_address_for_global): New virtual function.
5087 (Target::do_plt_address_for_local): New virtual function.
5088 (Target::do_plt_section_for_global): Remove.
5089 (Target::do_plt_section_for_local): Remove.
5090 (Target::register_global_plt_entry): Add Symbol_table and Layout
5092 * output.cc (Output_data_got::Got_entry::write): Use
5093 plt_address_for_global and plt_address_for_local.
5094 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5095 address of output section.
5096 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5097 got_irelative_, and irelative_count_ fields. Update
5099 (Output_data_plt_i386::has_irelative_section): New function.
5100 (Output_data_plt_i386::entry_count): Add irelative_count_.
5101 (Output_data_plt_i386::set_final_data_size): Likewise.
5102 (class Target_i386): Add got_irelative_ and rel_irelative_
5103 fields. Update declarations.
5104 (Target_i386::Target_i386): Initialize new fields.
5105 (Target_i386::do_plt_address_for_global): New function replacing
5106 do_plt_section_for_global.
5107 (Target_i386::do_plt_address_for_local): New function replacing
5108 do_plt_section_for_local.
5109 (Target_i386::got_section): Create got_irelative_.
5110 (Target_i386::rel_irelative_section): New function.
5111 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5112 fields. Don't define __rel_iplt_{start,end}.
5113 (Output_data_plt_i386::add_entry): Add symtab and layout
5114 parameters. Change all callers. Use different PLT and GOT for
5116 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5117 layout parameters. Change all callers. Use different PLT and
5119 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5120 (Output_data_plt_i386::rel_irelative): New function.
5121 (Output_data_plt_i386::address_for_global): New function.
5122 (Output_data_plt_i386::address_for_local): New function.
5123 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5124 IRELATIVE GOT when changing IFUNC GOT entries.
5125 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5127 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5128 if we didn't create an IRELATIVE GOT.
5129 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5130 plt_address_for_local.
5131 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5132 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5133 got_irelative_, and irelative_count_ fields. Update
5135 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5136 Initialize new fields. Remove symtab parameter. Change all
5138 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5140 (Output_data_plt_x86_64::has_irelative_section): New function.
5141 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5142 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5143 fields. Update declarations.
5144 (Target_x86_64::Target_x86_64): Initialize new fields.
5145 (Target_x86_64::do_plt_address_for_global): New function replacing
5146 do_plt_section_for_global.
5147 (Target_x86_64::do_plt_address_for_local): New function replacing
5148 do_plt_section_for_local.
5149 (Target_x86_64::got_section): Create got_irelative_.
5150 (Target_x86_64::rela_irelative_section): New function.
5151 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5152 all callers. Don't create __rel_iplt_{start,end}.
5153 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5154 parameters. Change all callers. Use different PLT and GOT for
5156 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5157 layout parameters. Change all callers. Use different PLT and
5159 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5160 parameters. Change all callers. Use different PLT and GOT for
5162 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5163 (Output_data_plt_x86_64::rela_irelative): New function.
5164 (Output_data_plt_x86_64::address_for_global): New function.
5165 (Output_data_plt_x86_64::address_for_local): New function.
5166 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5167 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5168 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5169 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5171 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5173 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5174 symbols if we didn't create an IRELATIVE GOT.
5175 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5176 plt_address_for_local.
5177 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5178 * testsuite/ifuncvar1.c: New test file.
5179 * testsuite/ifuncvar2.c: New test file.
5180 * testsuite/ifuncvar3.c: New test file.
5181 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5182 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5183 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5184 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5185 * testsuite/Makefile.in: Rebuild.
5187 2011-07-07 Cary Coutant <ccoutant@google.com>
5189 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5190 (two_file_test_1_ndebug.o): Likewise.
5191 (two_file_test_1b_ndebug.o): Likewise.
5192 (two_file_test_2_ndebug.o): Likewise.
5193 (two_file_test_main_ndebug.o): Likewise.
5194 (incremental_test_2): Link with no-debug versions.
5196 2011-07-06 Cary Coutant <ccoutant@google.com>
5198 * gold/incremental.cc
5199 (Output_section_incremental_inputs::write_info_blocks): Check for
5200 hidden and internal symbols.
5202 2011-07-06 Cary Coutant <ccoutant@google.com>
5204 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5205 Check disposition for startup file.
5206 (Incremental_inputs::report_command_line): Ignore
5207 --incremental-startup-unchanged option.
5208 * options.cc (General_options::parse_incremental_startup_unchanged):
5210 (General_options::General_options): Initialize new data member.
5211 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5212 (General_options): Add --incremental-startup-unchanged option.
5213 (General_options::incremental_startup_disposition): New function.
5214 (General_options::incremental_startup_disposition_): New data member.
5216 2011-07-06 Cary Coutant <ccoutant@google.com>
5218 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5219 input file index to Script_info ctor.
5220 (Sized_incremental_binary::do_file_has_changed): Find the
5221 command-line argument for files named in scripts.
5222 * incremental.h (Script_info::Script_info): New ctor
5223 with input file index.
5224 (Script_info::input_file_index): New function.
5225 (Script_info::input_file_index_): New data member.
5226 (Incremental_binary::get_library): Add const.
5227 (Incremental_binary::get_script_info): Add const.
5228 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5229 * testsuite/Makefile.am (incremental_test_5): New test case.
5230 (incremental_test_6): New test case.
5231 * testsuite/Makefile.in: Regenerate.
5233 2011-07-06 Cary Coutant <ccoutant@google.com>
5235 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5236 debug output when command lines differ.
5238 2011-07-06 Cary Coutant <ccoutant@google.com>
5240 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5241 --incremental-patch option.
5242 * layout.cc (Free_list::allocate): Extend allocation beyond original
5244 (Layout::make_output_section): Mark sections that should get
5246 * options.cc (parse_percent): New function.
5247 * options.h (parse_percent): New function.
5248 (DEFINE_percent): New macro.
5249 (General_options): Add --incremental-patch option.
5250 * output.cc (Output_section::Output_section): Initialize new data
5252 (Output_section::add_input_section): Print section name when out
5254 (Output_section::add_output_section_data): Likewise.
5255 (Output_section::set_final_data_size): Add patch space when
5256 doing --incremental-full.
5257 (Output_section::do_reset_address_and_file_offset): Remove patch
5259 (Output_segment::set_section_list_addresses): Print debug output
5260 only if --incremental-update.
5261 * output.h (Output_section::set_is_patch_space_allowed): New function.
5262 (Output_section::is_patch_space_allowed_): New data member.
5263 (Output_section::patch_space_): New data member.
5264 * parameters.cc (Parameters::incremental_full): New function.
5265 * parameters.h (Parameters::incremental_full): New function
5266 * testsuite/Makefile.am (incremental_test_2): Add test for
5267 --incremental-patch option.
5268 * testsuite/Makefile.in: Regenerate.
5269 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5270 (t18): Remove function body.
5272 2011-07-05 Doug Kwan <dougkwan@google.com>
5275 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5276 Arm_Address type for relocation result.
5277 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5279 (Arm_relocate_functions::abs32): Use unaligned access.
5280 (Arm_relocate_functions::rel32): Ditto.
5281 (Arm_relocate_functions::prel31): Ditto.
5282 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5283 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5284 static data relocations.
5285 * testsuite/Makefile.in: Regnerate.
5286 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5288 2011-07-05 Ian Lance Taylor <iant@google.com>
5291 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5292 symbols if necessary.
5293 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5295 2011-07-05 Ian Lance Taylor <iant@google.com>
5298 * resolve.cc (Symbol::override_base_with_special): Simply override
5299 version with special symbol version, ignoring previous version.
5301 2011-07-05 Ian Lance Taylor <iant@google.com>
5303 * object.cc (Sized_relobj_file::include_section_group): Add
5304 information to comment about signature location.
5306 2011-07-02 Ian Lance Taylor <iant@google.com>
5309 * options.h (class General_options): Add -f and -F.
5310 * options.cc (General_options::finalize): Fatal error if -f/-F
5311 are used without -shared.
5312 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5314 2011-07-02 Ian Lance Taylor <iant@google.com>
5316 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5318 2011-07-01 Ian Lance Taylor <iant@google.com>
5322 * resolve.cc (Symbol::override_base_with_special): Don't override
5323 the version if the overriding symbol has a different name.
5324 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5325 all callers. If we give an error about an undefined version,
5326 define the base version if necessary.
5327 * dynobj.h (class Versions): Update declaration.
5328 * testsuite/weak_alias_test_5.cc: New file.
5329 * testsuite/weak_alias_test.script: New file.
5330 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5331 and versioned_alias have the right value, and call t2.
5332 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5333 weak_alias_test_5.so.
5334 (weak_alias_test_LDADD): Likewise.
5335 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5336 * testsuite/Makefile.in: Rebuild.
5338 2011-07-01 Ian Lance Taylor <iant@google.com>
5341 * options.h (class General_options): Support -z notext.
5342 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5344 (two_file_shared_nonpic.so): Likewise.
5345 (two_file_shared_mixed.so): Likewise.
5346 (two_file_shared_mixed_1.so): Likewise.
5347 (weak_undef_lib_nonpic.so): Likewise.
5348 (alt/weak_undef_lib_nonpic.so): Likewise.
5349 (tls_test_shared_nonpic.so): Likewise.
5350 * testsuite/Makefile.in: Rebuild.
5352 2011-07-01 Ian Lance Taylor <iant@google.com>
5355 * configure.ac: Test whether static linking works, setting
5356 the automake conditional HAVE_STATIC.
5357 * testsuite/Makefile.am: Disable tests using -static if
5358 HAVE_STATIC is not true.
5359 * configure, testsuite/Makefile.in: Rebuild.
5361 2011-07-01 Ian Lance Taylor <iant@google.com>
5364 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5365 Assert if we see DW_EH_PE_indirect.
5366 * target.h (Target::ehframe_datarel_base): New function.
5367 (Target::do_ehframe_datarel_base): New target function.
5368 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5369 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5372 2011-07-01 Ian Lance Taylor <iant@google.com>
5375 * options.h (class General_options): Add
5376 --ld-generated-unwind-info.
5377 * ehframe.cc (Fde::write): Add address parameter. Change all
5378 callers. If associated with PLT, fill in address and size.
5379 (Cie::set_output_offset): Only add merge mapping if there is an
5381 (Cie::write): Add address parameter. Change all callers.
5382 (Eh_frame::add_ehframe_for_plt): New function.
5383 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5384 input_offset_ fields into union u_, with new plt field.
5385 (Fde::Fde): Adjust for new union field.
5386 (Fde::Fde) [Output_data version]: New constructor.
5387 (Fde::add_mapping): Only add merge mapping if there is an object.
5388 (class Cie): Update declarations.
5389 (class Eh_frame): Declare add_ehframe_for_plt.
5390 * layout.cc (Layout::layout_eh_frame): Break out code into
5391 make_eh_frame_section, and call it.
5392 (Layout::make_eh_frame_section): New function.
5393 (Layout::add_eh_frame_for_plt): New function.
5394 * layout.h (class Layout): Update declarations.
5395 * merge.cc (Merge_map::add_mapping): Add assertion.
5396 * i386.cc: Include "dwarf.h".
5397 (class Output_data_plt_i386): Make first_plt_entry,
5398 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5399 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5400 and plt_eh_frame_fde.
5401 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5402 boundary. Call add_eh_frame_for_plt if appropriate.
5403 * x86_64.cc: Include "dwarf.h".
5404 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5405 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5406 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5407 and plt_eh_frame_fde.
5408 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5411 2011-06-29 Ian Lance Taylor <iant@google.com>
5414 * object.cc (Sized_relobj_file::layout_section): Change shdr
5415 parameter to be const.
5416 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5418 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5419 appropriate. Call layout_eh_frame_section.
5420 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5422 * object.h (class Sized_relobj_file): Update declarations.
5424 2011-06-29 Ian Lance Taylor <iant@google.com>
5427 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5429 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5431 2011-06-29 Ian Lance Taylor <iant@google.com>
5434 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5436 * layout.cc (Layout::layout_eh_frame): Likewise.
5438 2011-06-29 Ian Lance Taylor <iant@google.com>
5441 * layout.cc (Layout::symtab_section_shndx): New function.
5442 * layout.h (class Layout): Declare symtab_section_shndx.
5443 * output.cc (Output_section::write_header): Call it.
5445 2011-06-29 Ian Lance Taylor <iant@google.com>
5448 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5449 symbols which are not used in a relocation.
5451 2011-06-28 Ian Lance Taylor <iant@google.com>
5454 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5455 script create indistinguishable segments.
5456 (Layout::set_segment_offsets): Use stable_sort when sorting
5457 segments. Pass this to Compare_segments constructor.
5458 * layout.h (class Layout): Make segment_precedes non-static.
5459 (class Compare_segments): Change from struct to class. Add
5460 layout_ field. Add constructor.
5461 * script-sections.cc
5462 (Script_sections::attach_sections_using_phdrs_clause): Rename
5463 local orphan to is_orphan. Don't report failure to put empty
5464 section in segment. On attachment failure, report name of
5465 section, and attach to first PT_LOAD segment.
5467 2011-06-28 Ian Lance Taylor <iant@google.com>
5470 * target-select.cc (Target_selector::Target_selector): Add
5471 emulation parameter. Change all callers.
5472 (select_target_by_bfd_name): Rename from select_target_by_name.
5474 (select_target_by_emulation): New function.
5475 (supported_emulation_names): New function.
5476 * target-select.h (class Target_selector): Add emulation_ field.
5477 Update declarations.
5478 (Target_selector::recognize_by_bfd_name): Rename from
5479 recognize_by_name. Change all callers.
5480 (Target_selector::supported_bfd_names): Rename from
5481 supported_names. Change all callers.
5482 (Target_selector::recognize_by_emulation): New function.
5483 (Target_selector::supported_emulations): New function.
5484 (Target_selector::emulation): New function.
5485 (Target_selector::do_recognize_by_bfd_name): Rename from
5486 do_recognize_by_name. Change all callers.
5487 (Target_selector::do_supported_bfd_names): Rename from
5488 do_supported_names. Change all callers.
5489 (Target_selector::do_recognize_by_emulation): New function.
5490 (Target_selector::do_supported_emulations): New function.
5491 (select_target_by_bfd_name): Change name in declaration.
5492 (select_target_by_emulation): Declare.
5493 (supported_emulation_names): Declare.
5494 * parameters.cc (parameters_force_valid_target): Try to find
5495 target based on emulation from -m option.
5496 * options.h (class General_options): Change doc string for -m.
5497 * options.cc (help): Print emulations.
5498 (General_options::parse_V): Likewise.
5499 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5500 Add emulation parameter. Change all callers.
5502 2011-06-28 Ian Lance Taylor <iant@google.com>
5504 * target.h (class Target): Add osabi_ field.
5505 (Target::osabi): New function.
5506 (Target::set_osabi): New function.
5507 (Target::Target): Initialize osabi_.
5508 (Target::do_adjust_elf_header): Make pure virtual.
5509 (Sized_target::do_adjust_elf_header): Declare.
5510 * target.cc (Sized_target::do_adjust_elf_header): New function.
5511 (class Sized_target): Instantiate all versions.
5512 * freebsd.h (class Target_freebsd): Remove.
5513 (Target_selector_freebsd::do_recognize): Call set_osabi on
5515 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5516 (Target_selector_freebsd::set_osabi): Remove.
5517 * i386.cc (class Target_i386): Inherit from Sized_target rather
5518 than Target_freebsd.
5519 * x86_64.cc (class Target_x86_64): Likewise.
5521 2011-06-28 Ian Lance Taylor <iant@google.com>
5523 * target.h (Target::can_check_for_function_pointers): Rewrite.
5525 (Target::can_icf_inline_merge_sections): Likewise.
5526 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5527 (Target::Target_info): Add can_icf_inline_merge_sections field.
5528 (Target::do_can_check_for_function_pointers): New virtual
5530 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5531 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5532 from can_check_for_function_pointers, move in file.
5533 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5534 section_may_have_icf_unsafe_poineters, move in file.
5535 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5536 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5537 Rename from can_check_for_function_pointers, move in file.
5538 (Target_i386::can_icf_inline_merge_sections): Remove.
5539 (Target_i386::i386_info): Initialize
5540 can_icf_inline_merge_sections.
5541 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5542 Initialize can_icf_inline_merge_sections.
5543 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5544 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5545 Rename from can_check_for_function_pointers, move in file.
5546 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5547 (Target_x86_64::x86_64_info): Initialize
5548 can_icf_inline_merge_sections.
5549 * testsuite/testfile.cc (Target_test::test_target_info):
5551 * icf.cc (get_section_contents): Correct formatting.
5553 2011-06-27 Ian Lance Taylor <iant@google.com>
5555 * symtab.cc (Symbol::versioned_name): New function.
5556 (Symbol_table::add_to_final_symtab): Use versioned_name when
5558 (Symbol_table::sized_write_symbol): Likewise.
5559 * symtab.h (class Symbol): Declare versioned_name.
5560 * stringpool.h (class Stringpool_template): Add variant of add
5561 which takes a std::basic_string.
5562 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5563 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5564 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5565 (ver_test_12.o): New target.
5566 * testsuite/Makefile.in: Rebuild.
5568 2011-06-27 Doug Kwan <dougkwan@google.com>
5570 * arm.cc (Arm_relocate_functions::thm_jump8,
5571 Arm_relocate_functions::thm_jump11): Use a wider signed
5572 type to compute offset.
5573 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5575 * testsuite/Makefile.in: Regenerate.
5576 * testsuite/arm_branch_in_range.sh: Check test results of
5577 arm_thm_jump11 and arm_thm_jump8.
5578 * testsuite/arm_thm_jump11.s: New test source file.
5579 * testsuite/arm_thm_jump11.t: New linker script.
5580 * testsuite/arm_thm_jump8.s: New test source file.
5581 * testsuite/arm_thm_jump8.t: New linker script.
5583 2011-06-24 Ian Lance Taylor <iant@google.com>
5585 * layout.cc: Include "object.h".
5586 (ctors_sections_in_init_array): New static variable.
5587 (Layout::is_ctors_in_init_array): New function.
5588 (Layout::layout): Add entry to ctors_sections_in_init_array if
5590 * layout.h (class Layout): Declare is_ctors_in_init_array.
5591 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5592 is_ctors_reverse_view is set.
5593 (Sized_relobj_file::write_sections): Add layout parameter. Change
5594 all callers. Set is_ctors_reverse_view field of View_size.
5595 (Sized_relobj_file::reverse_words): New function.
5596 * object.h (Sized_relobj_file::View_size): Add
5597 is_ctors_reverse_view field.
5598 (class Sized_relobj_file): Update declarations.
5599 * testsuite/initpri3.c: New test.
5600 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5602 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5603 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5604 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5605 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5606 * testsuite/Makefile.in: Rebuild.
5608 2011-06-24 Cary Coutant <ccoutant@google.com>
5610 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5611 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5612 (debug_msg_cdebug.err): New targets.
5613 * testsuite/Makefile.in: Regenerate.
5614 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5615 Fix checks for link with shared library.
5617 2011-06-24 Doug Kwan <dougkwan@google.com>
5619 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5620 skip empty text sections.
5621 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5623 2011-06-22 Ian Lance Taylor <iant@google.com>
5626 * options.h (class General_options): Add --ctors-in-init-array.
5627 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5628 friends as SHT_PROGBITS for merging sections.
5629 (Layout::layout): Remove special handling of .init_array and
5630 friends. Don't sort if doing relocatable link. Sort for .ctors
5631 and .dtors if ctors_in_init_array.
5632 (Layout::make_output_section): Force correct section types for
5633 .init_array and friends. Don't sort if doing relocatable link,
5634 Don't sort .ctors and .dtors if ctors_in_init_array.
5635 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5636 (Layout::output_section_name): Add relobj parameter. Change all
5637 callers. Handle .ctors. and .dtors. in code rather than table.
5638 Handle .ctors and .dtors if ctors_in_init_array.
5639 (Layout::match_file_name): New function, moved from output.cc.
5640 * layout.h (class Layout): Update declarations.
5641 * output.cc: Include "layout.h".
5642 (Input_section_sort_entry::get_priority): New function.
5643 (Input_section_sort_entry::match_file_name): Just call
5644 Layout::match_file_name.
5645 (Output_section::Input_section_sort_init_fini_compare::operator()):
5646 Handle .ctors and .dtors. Sort by explicit priority rather than
5648 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5649 * testsuite/initpri2.c: New test.
5650 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5651 (check_PROGRAMS): Add initpri2.
5652 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5653 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5654 * configure, testsuite/Makefile.in: Rebuild.
5656 2011-06-19 Ian Lance Taylor <iant@google.com>
5659 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5660 .interp section to a PT_INTERP segment even if we have seen a
5661 --dynamic-linker option. Don't do it if we have seen a PHDRS
5662 clause in a linker script.
5663 (Layout::finalize): Don't create a .interp section if we've
5664 already create a PT_INTERP segment.
5665 (Layout::create_interp): Always call choose_output_section (revert
5666 patch of 2011-06-17). Don't create PT_INTERP segment.
5667 * script-sections.cc
5668 (Script_sections::create_note_and_tls_segments): Add a .interp
5669 section to a PT_INTERP segment even if we have seen a
5670 --dynamic-linker option.
5672 2011-06-18 Ian Lance Taylor <iant@google.com>
5674 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5675 merely because a non-PT_LOAD segment has a dynamic reloc.
5677 2011-06-18 Ian Lance Taylor <iant@google.com>
5679 * layout.cc (Layout::finish_dynamic_section): Don't create
5680 DT_FLAGS entry if not needed.
5682 2011-06-18 Ian Lance Taylor <iant@google.com>
5685 * layout.cc (Layout::layout_eh_frame): Correct handling of
5686 writable .eh_frame section.
5688 2011-06-17 Ian Lance Taylor <iant@google.com>
5691 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5692 symbol is redefined with the exact same object and value.
5694 2011-06-17 Ian Lance Taylor <iant@google.com>
5697 * layout.h (class Layout): Add interp_segment_ field.
5698 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5699 (Layout::attach_allocated_section_to_segment): If making shared
5700 library, put .interp section in PT_INTERP segment.
5701 (Layout::finalize): Also call create_interp if -dynamic-linker
5703 (Layout::create_interp): Assert that there is no PT_INTERP
5704 segment. If not using a SECTIONS clause, use make_output_section.
5705 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5706 * script-sections.cc
5707 (Script_sections::create_note_and_tls_segments): If making shared
5708 library, put .interp section in PT_INTERP segment.
5710 2011-06-17 Ian Lance Taylor <iant@google.com>
5712 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5713 when making a shared library.
5715 2011-06-17 Ian Lance Taylor <iant@google.com>
5717 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5718 parameter. Change all callers. Don't issue warning about PC32
5719 against locally defined symbol.
5721 2011-06-16 Ian Lance Taylor <iant@google.com>
5723 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5724 occurs in same object.
5726 2011-06-14 Alan Modra <amodra@gmail.com>
5728 * po/POTFILES.in: Regenerate.
5730 2011-06-09 Ian Lance Taylor <iant@google.com>
5732 * script-sections.cc
5733 (Orphan_output_section::set_section_addresses): For a relocatable
5734 link set address to 0.
5736 2011-06-09 Cary Coutant <ccoutant@google.com>
5739 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5740 used with --compress-debug-sections.
5741 * gold/object.cc (Sized_relobj_file::do_layout): Report
5742 uncompressed size of compressed input sections.
5744 2011-06-08 Cary Coutant <ccoutant@google.com>
5747 * testsuite/two_file_test_2_v1.cc: Change initialization of
5748 v2 to keep it in .data.
5750 2011-06-07 Cary Coutant <ccoutant@google.com>
5752 * common.cc (Symbol_table::do_allocate_commons_list): Call
5754 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5755 (Errors::fallback): New function.
5756 (gold_fallback): New function.
5757 * errors.h (Errors::fallback): New function.
5758 * gold.cc (gold_exit): Change status parameter to enum; adjust
5760 (queue_initial_tasks): Call gold_fallback.
5761 * gold.h: Include cstdlib.
5762 (Exit_status): New enum type.
5763 (gold_exit): Change status parameter to enum.
5764 (gold_fallback): New function.
5765 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5766 (Layout::create_symtab_sections): Likewise.
5767 (Layout::create_shdrs): Likewise.
5768 * main.cc (main): Adjust call to gold_exit.
5769 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5770 (Output_data_got::add_got_entry_pair): Likewise.
5771 (Output_section::add_input_section): Likewise.
5772 (Output_section::add_output_section_data): Likewise.
5773 (Output_segment::set_section_list_addresses): Likewise.
5774 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5776 2011-06-07 Cary Coutant <ccoutant@google.com>
5778 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5779 for incremental links.
5780 * output.cc (Output_segment::set_section_list_addresses): Remove
5781 FIXME and test for TLS or BSS.
5783 2011-06-07 Cary Coutant <ccoutant@google.com>
5785 * testsuite/Makefile.am: Add incremental_copy_test,
5786 incremental_common_test_1.
5787 * testsuite/Makefile.in: Regenerate.
5788 * testsuite/common_test_1_v1.c: New source file.
5789 * testsuite/common_test_1_v2.c: New source file.
5790 * testsuite/copy_test_v1.cc: New source file.
5792 2011-06-07 Cary Coutant <ccoutant@google.com>
5794 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5795 update, allocate common from bss section's free list.
5796 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5797 linker-defined symbols.
5798 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5799 Skip GOT and PLT entries that are no longer referenced.
5800 (Output_section_incremental_inputs::write_info_blocks): Mark
5801 linker-defined symbols.
5802 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5803 * output.cc (Output_section::allocate): New function.
5804 * output.h (Output_section::allocate): New function.
5805 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5806 linker-defined symbols.
5807 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5808 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5809 (Symbol::init_base_output_data): Likewise.
5810 (Symbol::init_base_output_segment): Likewise.
5811 (Symbol::init_base_constant): Likewise.
5812 (Sized_symbol::init_output_data): Likewise.
5813 (Sized_symbol::init_output_segment): Likewise.
5814 (Sized_symbol::init_constant): Likewise.
5815 (Symbol_table::do_define_in_output_data): Likewise.
5816 (Symbol_table::do_define_in_output_segment): Likewise.
5817 (Symbol_table::do_define_as_constant): Likewise.
5818 * symtab.h (Symbol::is_predefined): New function.
5819 (Symbol::init_base_output_data): Add is_predefined parameter.
5820 (Symbol::init_base_output_segment): Likewise.
5821 (Symbol::init_base_constant): Likewise.
5822 (Symbol::is_predefined_): New data member.
5823 (Sized_symbol::init_output_data): Add is_predefined parameter.
5824 (Sized_symbol::init_output_segment): Likewise.
5825 (Sized_symbol::init_constant): Likewise.
5826 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5828 2011-06-07 Cary Coutant <ccoutant@google.com>
5830 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5831 instead of emit_copy_reloc.
5832 (Copy_relocs::emit_copy_reloc): Refactor.
5833 (Copy_relocs::make_copy_reloc): New function.
5834 (Copy_relocs::add_copy_reloc): Remove.
5835 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5837 (Copy_relocs::make_copy_reloc): New function.
5838 (Copy_relocs::add_copy_reloc): Remove.
5839 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5840 unchanged input files.
5841 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5842 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5843 Reserve BSS space for COPY relocations.
5844 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5845 (Output_section_incremental_inputs::write_info_blocks): Record
5846 whether a symbol is copied from a shared object.
5847 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5848 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5849 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5850 (Incremental_input_entry_reader::get_output_symbol_index): Add
5852 (Incremental_binary::emit_copy_relocs): New function.
5853 (Incremental_binary::do_emit_copy_relocs): New function.
5854 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5856 (Sized_incremental_binary::add_copy_reloc): New function.
5857 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5858 (Sized_incremental_binary::Copy_reloc): New struct.
5859 (Sized_incremental_binary::Copy_relocs): New typedef.
5860 (Sized_incremental_binary::copy_relocs_): New data member.
5861 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5862 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5863 * target.h (Sized_target::emit_copy_reloc): New function.
5864 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5866 2011-06-02 Cary Coutant <ccoutant@google.com>
5869 * gold/archive.cc (Archive::Archive): Initialize new data member.
5870 (Archive::include_all_members): Return if archive has already been
5872 * gold/archive.h (Archive::include_all_members_): New data member.
5874 2011-06-02 Nick Clifton <nickc@redhat.com>
5876 * dynobj.h: Fix spelling mistake in comment.
5877 * output.cc: Likewise.
5879 2011-05-31 Doug Kwan <dougkwan@google.com>
5883 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
5884 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5885 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5886 redundant arm_exidx_test.so.
5887 * testsuite/Makefile.in: Regenerate.
5888 (check_SCRIPTS): Add pr12826.sh
5889 (check_DATA): Add pr12826.stdout
5890 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5891 * testsuite/pr12826.sh: New file.
5892 * testsuite/pr12826_1.s: Ditto.
5893 * testsuite/pr12826_1.s: Ditto.
5895 2011-05-30 Ian Lance Taylor <iant@google.com>
5897 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5900 2011-05-29 Ian Lance Taylor <iant@google.com>
5903 * testsuite/Makefile.am: Use different file name for two_file_test
5904 temporary file for each incremental test.
5905 * testsuite/Makefile.in: Rebuild.
5907 2011-05-29 Ian Lance Taylor <iant@google.com>
5909 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5910 binary input file is empty.
5912 2011-05-27 Ian Lance Taylor <iant@google.com>
5914 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5915 (ver_test_9.so): Likewise.
5916 * testsuite/Makefile.in: Rebuild.
5918 2011-05-26 Cary Coutant <ccoutant@google.com>
5920 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5921 * incremental.cc (Incremental_inputs::report_input_section): Fix
5922 comment, indentation.
5923 (Incremental_inputs::report_comdat_group): New function.
5924 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5925 of data for incremental input file entry.
5926 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5927 group count, COMDAT group signatures.
5928 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5929 an unchanged input file.
5930 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5931 Initialize new data member.
5932 (Incremental_object_entry::add_comdat_group): New function.
5933 (Incremental_object_entry::get_comdat_group_count): New function.
5934 (Incremental_object_entry::get_comdat_signature_key): New function.
5935 (Incremental_object_entry::groups_): New data member.
5936 (Incremental_inputs::report_comdat_group): New function.
5937 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5938 data for incremental input file entry.
5939 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5940 (Incremental_input_entry_reader::get_input_section): Adjust size of
5941 data for incremental input file entry.
5942 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5943 (Incremental_input_entry_reader::get_comdat_group_signature): New
5945 * object.cc (Sized_relobj::include_section_group): Report kept
5946 COMDAT groups for incremental links.
5948 2011-05-24 David Meyer <pdox@google.com>
5950 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5951 with name parameter. Add found_name parameter.
5952 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5953 * dirsearch.h (class Dirsearch): Update declaration.
5955 2011-05-24 Ian Lance Taylor <iant@google.com>
5957 * archive.cc (Library_base::should_include_member): Pull in object
5958 from archive if it defines the entry symbol.
5959 * parameters.cc (Parameters::entry): New function.
5960 * parameters.h (class Parameters): Declare entry.
5961 * output.h (class Output_file_header): Remove entry_ field.
5962 * output.cc (Output_file_header::Output_file_header): Remove entry
5963 parameter. Change all callers.
5964 (Output_file_header::entry): Use parameters->entry.
5965 * gold.cc (queue_middle_tasks): Likewise.
5966 * plugin.cc (Plugin_hook::run): Likewise.
5968 2011-05-24 Cary Coutant <ccoutant@google.com>
5970 * gold.cc (queue_initial_tasks): Pass incremental base filename
5971 to Output_file::open_base_file; don't print error message.
5972 * incremental-dump.cc (main): Adjust call to
5973 Output_file::open_for_modification.
5974 * incremental-dump.cc (main): Likewise.
5975 * incremental.cc (Incremental_inputs::report_command_line):
5976 Ignore --incremental-base option when comparing command lines.
5977 Ignore parameter when given as separate argument.
5978 * options.h (class General_options): Add --incremental-base.
5979 * output.cc (Output_file::Output_file):
5980 (Output_file::open_base_file): Add base_name and writable parameters;
5981 read base file into new file; print error message here.
5982 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5984 * output.h (Output_file::open_for_modification): Rename to...
5985 (Output_file::open_base_file): ...this; add base_name and
5986 writable parameters; adjust all callers.
5987 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5989 * testsuite/Makefile.am (incremental_test_4): Test
5991 * testsuite/Makefile.in: Regenerate.
5993 2011-05-24 Cary Coutant <ccoutant@google.com>
5995 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5997 * testsuite/Makefile.in: Regenerate.
5998 * testsuite/two_file_test_1_v1.cc: New test source file.
5999 * testsuite/two_file_test_1b_v1.cc: New test source file.
6000 * testsuite/two_file_test_2_v1.cc: New test source file.
6002 2011-05-24 Cary Coutant <ccoutant@google.com>
6004 * dynobj.h (Dynobj::do_dynobj): New function.
6005 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6006 flag and soname for shared objects.
6007 * incremental.cc (Incremental_inputs::report_object): Make
6008 either Incremental_object_entry or Incremental_dynobj_entry; add
6009 soname to string table.
6010 (Incremental_inputs::report_input_section): Add assertion.
6011 (Output_section_incremental_inputs::set_final_data_size): Adjust
6012 type of input file entry for shared libraries; adjust size of
6013 shared library info entry.
6014 (Output_section_incremental_inputs::write_input_files): Write
6015 as_needed flag for shared libraries.
6016 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6017 of input file entry for shared libraries; write soname.
6018 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6019 soname from incremental info.
6020 * incremental.h (enum Incremental_input_flags): Add
6021 INCREMENTAL_INPUT_AS_NEEDED.
6022 (Incremental_input_entry::Incremental_input_entry): Initialize new
6024 (Incremental_input_entry::set_as_needed): New function.
6025 (Incremental_input_entry::as_needed): New function.
6026 (Incremental_input_entry::do_dynobj_entry): New function.
6027 (Incremental_input_entry::as_needed_): New data member.
6028 (Incremental_object_entry::Incremental_object_entry): Don't check
6030 (Incremental_object_entry::do_type): Likewise.
6031 (class Incremental_dynobj_entry): New class.
6032 (Incremental_input_entry_reader::as_needed): New function.
6033 (Incremental_input_entry_reader::get_soname): New function.
6034 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6035 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6036 size of shared library info entry.
6037 * layout.cc (Layout::finish_dynamic_section): Don't test for
6038 incremental link when adding DT_NEEDED entries.
6039 * object.h (Object::Object): Initialize new data member.
6040 (Object::dynobj): New function.
6041 (Object::set_as_needed): New function.
6042 (Object::as_needed): New function.
6043 (Object::do_dynobj): New function.
6044 (Object::as_needed_): New data member.
6046 2011-05-24 Cary Coutant <ccoutant@google.com>
6048 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6049 info; adjust display of GOT entries.
6050 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6051 vector of input objects; remove file_status_.
6052 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6053 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6054 got_plt reader; call target hooks to reserve GOT entries.
6055 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6056 of input file info header and GOT info entry.
6057 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6059 (Got_plt_view_info::got_descriptor): Remove.
6060 (Got_plt_view_info::sym_index): New data member.
6061 (Got_plt_view_info::input_index): New data member.
6062 (Local_got_offset_visitor::visit): Write input file index.
6063 (Global_got_offset_visitor::visit): Write 0 for input file index.
6064 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6065 with sym_index and input_index.
6066 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6067 incremental info GOT entry; replace got_descriptor with input_index.
6068 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6069 map from input file index to object.
6070 (Sized_relobj_incr::do_layout): Replace direct data member reference
6071 with accessor function.
6072 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6073 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6074 Adjust size of input file info header.
6075 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6076 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6077 (Incremental_input_entry_reader::get_input_section): Adjust size of
6078 input file info header.
6079 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6080 of incremental info GOT entry.
6081 (Incremental_got_plt_reader::get_got_desc): Remove.
6082 (Incremental_got_plt_reader::get_got_symndx): New function.
6083 (Incremental_got_plt_reader::get_got_input_index): New function.
6084 (Sized_incremental_binary::Sized_incremental_binary): Remove
6085 file_status_; add input_objects_.
6086 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6087 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6088 (Sized_incremental_binary::file_is_unchanged): Remove.
6089 (Sized_incremental_binary::set_input_object): New function.
6090 (Sized_incremental_binary::input_object): New function.
6091 (Sized_incremental_binary::file_status_): Remove.
6092 (Sized_incremental_binary::input_objects_): New data member.
6093 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6095 (Sized_relobj_incr::invalid_address): Move to base class.
6096 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6098 (Sized_relobj_incr::do_output_section_offset): Likewise.
6099 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6100 (Sized_relobj_incr::section_offsets_): Likewise.
6101 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6103 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6104 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6105 with accessor function.
6106 (Sized_relobj_file::do_layout): Likewise.
6107 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6108 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6109 (Sized_relobj_file::compute_final_local_value): Replace refs to
6110 section_offsets_ with accessor function.
6111 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6112 * object.h (Relobj::Relobj): Initialize new data members.
6113 (Relobj::add_dyn_reloc): New function.
6114 (Relobj::first_dyn_reloc): New function.
6115 (Relobj::dyn_reloc_count): New function.
6116 (Relobj::first_dyn_reloc_): New data member.
6117 (Relobj::dyn_reloc_count_): New data member.
6118 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6120 (Sized_relobj::Address): New typedef.
6121 (Sized_relobj::invalid_address): Move here from child class.
6122 (Sized_relobj::Sized_relobj): Initialize new data members.
6123 (Sized_relobj::sized_relobj): New function.
6124 (Sized_relobj::is_output_section_offset_invalid): Move here from
6126 (Sized_relobj::get_output_section_offset): Likewise.
6127 (Sized_relobj::local_has_got_offset): Likewise.
6128 (Sized_relobj::local_got_offset): Likewise.
6129 (Sized_relobj::set_local_got_offset): Likewise.
6130 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6131 (Sized_relobj::clear_got_offsets): New function.
6132 (Sized_relobj::section_offsets): Move here from child class.
6133 (Sized_relobj::do_output_section_offset): Likewise.
6134 (Sized_relobj::do_set_section_offset): Likewise.
6135 (Sized_relobj::Local_got_offsets): Likewise.
6136 (Sized_relobj::local_got_offsets_): Likewise.
6137 (Sized_relobj::section_offsets_): Likewise.
6138 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6140 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6142 (Sized_relobj_file::sized_relobj): New function
6143 (Sized_relobj_file::local_has_got_offset): Move to base class.
6144 (Sized_relobj_file::local_got_offset): Likewise.
6145 (Sized_relobj_file::set_local_got_offset): Likewise.
6146 (Sized_relobj_file::get_output_section_offset): Likewise.
6147 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6148 (Sized_relobj_file::do_output_section_offset): Likewise.
6149 (Sized_relobj_file::do_set_section_offset): Likewise.
6150 (Sized_relobj_file::Local_got_offsets): Likewise.
6151 (Sized_relobj_file::local_got_offsets_): Likewise.
6152 (Sized_relobj_file::section_offsets_): Likewise.
6153 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6155 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6156 (Output_reloc::get_symbol_index): Likewise.
6157 (Output_reloc::local_section_offset): Likewise.
6158 (Output_reloc::get_address): Likewise.
6159 (Output_reloc::symbol_value): Likewise.
6160 (Output_data_got::reserve_slot): Move to class definition.
6161 (Output_data_got::reserve_local): New function.
6162 (Output_data_got::reserve_slot_for_global): Remove.
6163 (Output_data_got::reserve_global): New function.
6164 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6165 (all constructors, two instantiations).
6166 (Output_reloc::get_relobj): New function (two instantiations).
6167 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6168 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6169 (Output_data_reloc::add_global): Adjust type of relobj.
6170 (Output_data_reloc::add_global_relative): Likewise.
6171 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6172 (Output_data_reloc::add_local): Likewise.
6173 (Output_data_reloc::add_local_relative): Likewise.
6174 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6175 (Output_data_reloc::add_local_section): Likewise.
6176 (Output_data_reloc::add_output_section): Likewise.
6177 (Output_data_reloc::add_absolute): Likewise.
6178 (Output_data_reloc::add_target_specific): Likewise.
6179 (Output_data_got::reserve_slot): Move definition here.
6180 (Output_data_got::reserve_local): New function.
6181 (Output_data_got::reserve_global): New function.
6182 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6183 section_offsets_ with accessor function.
6184 (Sized_relobj_file::write_sections): Likewise.
6185 (Sized_relobj_file::do_relocate_sections): Likewise.
6186 * target.h (Sized_target::reserve_local_got_entry): New function.
6187 (Sized_target::reserve_global_got_entry): New function.
6188 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6189 (Target_x86_64::reserve_global_got_entry): New function.
6190 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6192 2011-05-23 Cary Coutant <ccoutant@google.com>
6194 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6195 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6196 bit when checking got_type.
6197 * incremental.cc (Sized_incremental_binary::setup_readers):
6198 Store symbol table and string table locations; initialize bit vector
6199 of file status flags.
6200 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6202 (Sized_incremental_binary::do_process_got_plt): New function.
6203 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6204 (Output_section_incremental_inputs::set_final_data_size): Record
6205 file index for each input file.
6206 (Output_section_incremental_inputs::write_got_plt): Store file index
6207 instead of input entry offset for each GOT entry.
6209 (Incremental_input_entry::Incremental_input_entry): Initialize new
6211 (Incremental_input_entry::set_offset): Store file index.
6212 (Incremental_input_entry::get_file_index): New function.
6213 (Incremental_input_entry::file_index_): New data member.
6214 (Incremental_binary::process_got_plt): New function.
6215 (Incremental_binary::do_process_got_plt): New function.
6216 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6218 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6219 (Sized_incremental_binary::set_file_is_unchanged): New function.
6220 (Sized_incremental_binary::file_is_unchanged): New function.
6221 (Sized_incremental_binary::do_process_got_plt): New function.
6222 (Sized_incremental_binary::file_status_): New data member.
6223 (Sized_incremental_binary::main_symtab_loc_): New data member.
6224 (Sized_incremental_binary::main_strtab_loc_): New data member.
6225 * output.cc (Output_data_got::Got_entry::write): Add case
6227 (Output_data_got::add_global): Call add_got_entry.
6228 (Output_data_got::add_global_plt): Likewise.
6229 (Output_data_got::add_global_with_rel): Likewise.
6230 (Output_data_got::add_global_with_rela): Likewise.
6231 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6232 (Output_data_got::add_global_pair_with_rela): Likewise.
6233 (Output_data_got::add_local): Call add_got_entry.
6234 (Output_data_got::add_local_plt): Likewise.
6235 (Output_data_got::add_local_with_rel): Likewise.
6236 (Output_data_got::add_local_with_rela): Likewise.
6237 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6238 (Output_data_got::add_local_pair_with_rela): Likewise.
6239 (Output_data_got::reserve_slot): New function.
6240 (Output_data_got::reserve_slot_for_global): New function.
6241 (Output_data_got::add_got_entry): New function.
6242 (Output_data_got::add_got_entry_pair): New function.
6243 (Output_section::add_output_section_data): Edit FIXME.
6245 (Output_section_data_build::Output_section_data_build): New
6246 constructor with size parameter.
6247 (Output_data_space::Output_data_space): Likewise.
6248 (Output_data_got::Output_data_got): Initialize new data member; new
6249 constructor with size parameter.
6250 (Output_data_got::add_constant): Call add_got_entry.
6251 (Output_data_got::reserve_slot): New function.
6252 (Output_data_got::reserve_slot_for_global): New function.
6253 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6254 (Output_data_got::add_got_entry): New function.
6255 (Output_data_got::add_got_entry_pair): New function.
6256 (Output_data_got::free_list_): New data member.
6257 * target.h (Sized_target::init_got_plt_for_update): New function.
6258 (Sized_target::register_global_plt_entry): New function.
6259 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6260 Initialize new data member; call init; add constructor with PLT count.
6261 (Output_data_plt_x86_64::init): New function.
6262 (Output_data_plt_x86_64::add_relocation): New function.
6263 (Output_data_plt_x86_64::reserve_slot): New function.
6264 (Output_data_plt_x86_64::free_list_): New data member.
6265 (Target_x86_64::init_got_plt_for_update): New function.
6266 (Target_x86_64::register_global_plt_entry): New function.
6267 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6268 incremental updates.
6269 (Output_data_plt_x86_64::add_relocation): New function.
6270 * testsuite/object_unittest.cc (Object_test): Set default options.
6272 2011-05-16 Ian Lance Taylor <iant@google.com>
6274 * options.h (class General_options): Make -i a synonym for -r.
6276 2011-05-16 Ian Lance Taylor <iant@google.com>
6278 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6280 2011-05-10 Cary Coutant <ccoutant@google.com>
6282 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6285 2011-05-06 Ian Lance Taylor <iant@google.com>
6287 * layout.cc (Layout::layout): If the output section flags change,
6288 update the ordering.
6290 2011-04-25 Cary Coutant <ccoutant@google.com>
6292 * incremental-dump.cc (dump_incremental_inputs): Print local
6293 symbol info for each input file.
6295 (Output_section_incremental_inputs::set_final_data_size): Add local
6296 symbol info to input file entries in incremental info.
6297 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6298 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6299 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6300 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6302 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6303 (Sized_incr_relobj::do_relocate): Write the local symbols.
6304 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6305 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6306 Adjust size of input file header.
6307 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6308 (Incremental_inputs_reader::get_local_symbol_count): New function.
6309 (Incremental_inputs_reader::get_input_section): Adjust size of input
6311 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6312 (Sized_incr_relobj::This): New typedef.
6313 (Sized_incr_relobj::sym_size): New const data member.
6314 (Sized_incr_relobj::Local_symbol): New struct.
6315 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6316 (Sized_incr_relobj::do_local_symbol_offset): New function.
6317 (Sized_incr_relobj::local_symbol_count_): New data member.
6318 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6319 (Sized_incr_relobj::local_symbol_index_): New data member.
6320 (Sized_incr_relobj::local_symbol_offset_): New data member.
6321 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6322 (Sized_incr_relobj::local_symbols_): New data member.
6323 * object.h (Relobj::output_local_symbol_count): New function.
6324 (Relobj::local_symbol_offset): New function.
6325 (Relobj::do_output_local_symbol_count): New function.
6326 (Relobj::do_local_symbol_offset): New function.
6327 (Sized_relobj::do_output_local_symbol_count): New function.
6328 (Sized_relobj::do_local_symbol_offset): New function.
6330 2011-04-22 Vladimir Simonov <sv@sw.ru>
6332 * descriptors.cc (set_close_on_exec): New function.
6333 (Descriptors::open): Use set_close_on_exec.
6334 * output.cc (S_ISLNK): Define if not defined.
6336 2011-04-22 Cary Coutant <ccoutant@google.com>
6338 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6340 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6341 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6342 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6344 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6345 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6346 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6348 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6350 (Incremental_binary::apply_incremental_relocs): New function.
6351 (Incremental_binary::do_apply_incremental_relocs): New function.
6352 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6354 (Sized_incremental_binary::add_global_symbol): New function.
6355 (Sized_incremental_binary::global_symbol): New function.
6356 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6357 (Sized_incremental_binary::symbol_map_): New data member.
6358 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6359 * target.h (Sized_target::apply_relocation): New function.
6360 * target-reloc.h (apply_relocation): New function.
6361 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6363 2011-04-22 Doug Kwan <dougkwan@google.com>
6365 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6366 flag of a SHT_ARM_EXIDX section.
6367 * testsuite/Makefile.am (arm_exidx_test): New test rules.
6368 * testsuite/Makefile.in: Regenerate.
6369 * testsuite/arm_exidx_test.s: New file.
6370 * testsuite/arm_exidx_test.sh: Same.
6372 2011-04-20 Cary Coutant <ccoutant@google.com>
6375 * archive.h (Incremental_archive_entry::Archive_member):
6376 Initialize arg_serial_ (second constructor).
6378 2011-04-17 Ian Lance Taylor <iant@google.com>
6380 * object.cc (Relocate_info::location): Simplify location string.
6381 * errors.cc (Errors::error_at_location): Don't print program
6383 (Errors::warning_at_location): Likewise.
6384 (Errors::undefined_symbol): Likewise.
6385 * testsuite/debug_msg.sh: Update accordingly.
6387 2011-04-14 Cary Coutant <ccoutant@google.com>
6389 * gold/layout.cc (Layout::symtab_section_offset): New function.
6390 * gold/layout.h (Layout::symtab_section_offset): New function.
6391 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6393 2011-04-12 Ian Lance Taylor <iant@google.com>
6395 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6396 with MREMAP_MAYMOVE.
6397 * output.h (class Output_file): Add map_is_allocated_ field.
6398 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6399 not available, provide stubs. If mremap is not available, #define
6401 (MREMAP_MAYMOVE): Define if not defined.
6402 (Output_file::Output_file): Initialize map_is_allocated_.
6403 (Output_file::resize): Check map_is_allocated_.
6404 (Output_file::map_anonymous): If mmap fails, use malloc.
6405 (Output_file::unmap): Don't do anything for an anonymous map.
6406 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6407 is not available, provide stubs.
6408 (File_read::View::~View): Use free rather than delete[].
6409 (File_read::make_view): Use malloc rather than new[]. If mmap
6411 (File_read::find_or_make_view): Use malloc rather than new[].
6412 * gold.h: Remove HAVE_REMAP code.
6413 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6414 exists. Rename mremap to gold_mremap. If mmap is not available
6416 * configure, config.in: Rebuild.
6418 2011-04-11 Ian Lance Taylor <iant@google.com>
6420 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6421 initialize local variable v.
6423 2011-04-11 Cary Coutant <ccoutant@google.com>
6425 * archive.cc (Archive::include_member): Adjust call to
6427 (Add_archive_symbols::run): Track argument serial numbers.
6428 (Lib_group::include_member): Likewise.
6429 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6430 * archive.h (Incremental_archive_entry::Archive_member):
6431 Initialize arg_serial_.
6432 (Archive_member::arg_serial_): New data member.
6433 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6434 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6436 (Sized_dynobj::do_for_all_local_got_entries): New function.
6437 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6439 * fileread.cc (get_mtime): New function.
6440 * fileread.h (get_mtime): New function.
6441 * gold.cc (queue_initial_tasks): Check for incremental update.
6442 (process_incremental_input): New function.
6443 (queue_middle_tasks): Don't force valid target for incremental
6445 * incremental-dump.cc (find_input_containing_global): Adjust
6446 size of symbol info entry.
6447 (dump_incremental_inputs): Dump argument serial number and
6448 in_system_directory flag; bias shndx by 1; print symbol names
6449 when dumping per-file symbol lists; use new symbol info readers.
6451 (Output_section_incremental_inputs:update_data_size): New function.
6452 (Sized_incremental_binary::setup_readers): Setup input readers
6453 for each input file; build maps for files added from libraries
6455 (Sized_incremental_binary::check_input_args): New function.
6456 (Sized_incremental_binary::do_check_inputs): Build map of argument
6457 serial numbers to input arguments.
6458 (Sized_incremental_binary::do_file_has_changed): Rename
6459 do_file_is_unchanged to this; compare file modification times.
6460 (Sized_incremental_binary::do_init_layout): New function.
6461 (Sized_incremental_binary::do_reserve_layout): New function.
6462 (Sized_incremental_binary::do_get_input_reader): Remove.
6463 (Sized_incremental_binary::get_symtab_view): New function.
6464 (Incremental_checker::can_incrementally_link_output_file): Remove.
6465 (Incremental_inputs::report_command_line): Exclude --debug options.
6466 (Incremental_inputs::report_archive_begin): Add parameter; track
6467 argument serial numbers; don't put input file entry for archive
6468 before archive members.
6469 (Incremental_inputs::report_archive_end): Put input file entry
6470 for archive after archive members.
6471 (Incremental_inputs::report_object): Add parameter; track argument
6472 serial numbers and in_system_directory flag.
6473 (Incremental_inputs::report_script): Add parameter; track argument
6475 (Output_section_incremental_inputs::set_final_data_size): Adjust
6476 size of symbol info entry; check for forwarding symbols.
6477 (Output_section_incremental_inputs::write_input_files): Write
6478 in_system_directory flag and argument serial number.
6479 (Output_section_incremental_inputs::write_info_blocks): Map section
6480 indices between incremental info and original input file; store
6481 input section index for each symbol.
6482 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6483 change operator() to visit().
6484 (class Global_got_offset_visitor): Likewise.
6485 (class Global_symbol_visitor_got_plt):
6486 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6488 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6489 (Sized_incr_relobj::do_read_symbols): New function.
6490 (Sized_incr_relobj::do_layout): New function.
6491 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6492 (Sized_incr_relobj::do_add_symbols): New function.
6493 (Sized_incr_relobj::do_should_include_member): New function.
6494 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6495 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6496 (Sized_incr_relobj::do_section_size): New function.
6497 (Sized_incr_relobj::do_section_name): New function.
6498 (Sized_incr_relobj::do_section_contents): New function.
6499 (Sized_incr_relobj::do_section_flags): New function.
6500 (Sized_incr_relobj::do_section_entsize): New function.
6501 (Sized_incr_relobj::do_section_address): New function.
6502 (Sized_incr_relobj::do_section_type): New function.
6503 (Sized_incr_relobj::do_section_link): New function.
6504 (Sized_incr_relobj::do_section_info): New function.
6505 (Sized_incr_relobj::do_section_addralign): New function.
6506 (Sized_incr_relobj::do_initialize_xindex): New function.
6507 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6508 (Sized_incr_relobj::do_read_relocs): New function.
6509 (Sized_incr_relobj::do_gc_process_relocs): New function.
6510 (Sized_incr_relobj::do_scan_relocs): New function.
6511 (Sized_incr_relobj::do_count_local_symbols): New function.
6512 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6513 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6514 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6515 (Sized_incr_relobj::do_relocate): New function.
6516 (Sized_incr_relobj::do_set_section_offset): New function.
6517 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6518 (Sized_incr_dynobj::do_read_symbols): New function.
6519 (Sized_incr_dynobj::do_layout): New function.
6520 (Sized_incr_dynobj::do_add_symbols): New function.
6521 (Sized_incr_dynobj::do_should_include_member): New function.
6522 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6523 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6524 (Sized_incr_dynobj::do_section_size): New function.
6525 (Sized_incr_dynobj::do_section_name): New function.
6526 (Sized_incr_dynobj::do_section_contents): New function.
6527 (Sized_incr_dynobj::do_section_flags): New function.
6528 (Sized_incr_dynobj::do_section_entsize): New function.
6529 (Sized_incr_dynobj::do_section_address): New function.
6530 (Sized_incr_dynobj::do_section_type): New function.
6531 (Sized_incr_dynobj::do_section_link): New function.
6532 (Sized_incr_dynobj::do_section_info): New function.
6533 (Sized_incr_dynobj::do_section_addralign): New function.
6534 (Sized_incr_dynobj::do_initialize_xindex): New function.
6535 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6536 (make_sized_incremental_object): New function.
6537 (Incremental_library::copy_unused_symbols): New function.
6538 (Incremental_library::do_for_all_unused_symbols): New function.
6539 * incremental.h (enum Incremental_input_flags): New type.
6540 (class Incremental_checker): Remove.
6541 (Incremental_input_entry::Incremental_input_entry): Add argument
6543 (Incremental_input_entry::arg_serial): New function.
6544 (Incremental_input_entry::set_is_in_system_directory): New function.
6545 (Incremental_input_entry::is_in_system_directory): New function.
6546 (Incremental_input_entry::arg_serial_): New data member.
6547 (Incremental_input_entry::is_in_system_directory_): New data member.
6548 (class Script_info): Move here from script.h.
6549 (Script_info::Script_info): Add filename parameter.
6550 (Script_info::filename): New function.
6551 (Script_info::filename_): New data member.
6552 (Incremental_script_entry::Incremental_script_entry): Add argument
6554 (Incremental_object_entry::Incremental_object_entry): Likewise.
6555 (Incremental_object_entry::add_input_section): Build list of input
6556 sections with map to original shndx.
6557 (Incremental_object_entry::get_input_section_index): New function.
6558 (Incremental_object_entry::shndx_): New data member.
6559 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6560 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6561 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6563 (Incremental_inputs::report_archive_begin): Likewise.
6564 (Incremental_inputs::report_object): Likewise.
6565 (Incremental_inputs::report_script): Likewise.
6566 (class Incremental_global_symbol_reader): New class.
6567 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6568 and store flags and input file type.
6569 (Incremental_input_entry_reader::arg_serial): New function.
6570 (Incremental_input_entry_reader::type): Extract type from flags.
6571 (Incremental_input_entry_reader::is_in_system_directory): New function.
6572 (Incremental_input_entry_reader::get_input_section_count): Call
6573 accessor function for type.
6574 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6575 function for type; adjust size of global symbol entry.
6576 (Incremental_input_entry_reader::get_global_symbol_count): Call
6577 accessor function for type.
6578 (Incremental_input_entry_reader::get_object_count): Likewise.
6579 (Incremental_input_entry_reader::get_object_offset): Likewise.
6580 (Incremental_input_entry_reader::get_member_count): Likewise.
6581 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6582 (Incremental_input_entry_reader::get_member_offset): Likewise.
6583 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6584 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6585 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6586 (Incremental_input_entry_reader::get_global_symbol_reader): New
6588 (Incremental_input_entry_reader::get_output_symbol_index): New
6590 (Incremental_input_entry_reader::type_): Remove.
6591 (Incremental_input_entry_reader::flags_): New data member.
6592 (Incremental_inputs_reader::input_file_offset): New function.
6593 (Incremental_inputs_reader::input_file_index): New function.
6594 (Incremental_inputs_reader::input_file): Call input_file_offset.
6595 (Incremental_inputs_reader::input_file_at_offset): New function.
6596 (Incremental_relocs_reader::get_r_type): Reformat.
6597 (Incremental_relocs_reader::get_r_shndx): Reformat.
6598 (Incremental_relocs_reader::get_r_offset): Reformat.
6599 (Incremental_relocs_reader::data): New function.
6600 (Incremental_binary::Incremental_binary): Initialize new data members.
6601 (Incremental_binary::check_inputs): Add cmdline parameter.
6602 (Incremental_binary::file_is_unchanged): Remove.
6603 (Input_reader::arg_serial): New function.
6604 (Input_reader::get_unused_symbol_count): New function.
6605 (Input_reader::get_unused_symbol): New function.
6606 (Input_reader::do_arg_serial): New function.
6607 (Input_reader::do_get_unused_symbol_count): New function.
6608 (Input_reader::do_get_unused_symbol): New function.
6609 (Incremental_binary::input_file_count): New function.
6610 (Incremental_binary::get_input_reader): Change signature to use
6611 index instead of filename.
6612 (Incremental_binary::file_has_changed): New function.
6613 (Incremental_binary::get_input_argument): New function.
6614 (Incremental_binary::get_library): New function.
6615 (Incremental_binary::get_script_info): New function.
6616 (Incremental_binary::init_layout): New function.
6617 (Incremental_binary::reserve_layout): New function.
6618 (Incremental_binary::output_file): New function.
6619 (Incremental_binary::do_check_inputs): New function.
6620 (Incremental_binary::do_file_is_unchanged): Remove.
6621 (Incremental_binary::do_file_has_changed): New function.
6622 (Incremental_binary::do_init_layout): New function.
6623 (Incremental_binary::do_reserve_layout): New function.
6624 (Incremental_binary::do_input_file_count): New function.
6625 (Incremental_binary::do_get_input_reader): Change signature.
6626 (Incremental_binary::input_args_map_): New data member.
6627 (Incremental_binary::library_map_): New data member.
6628 (Incremental_binary::script_map_): New data member.
6629 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6631 (Sized_incremental_binary::output_section): New function.
6632 (Sized_incremental_binary::inputs_reader): Add const.
6633 (Sized_incremental_binary::symtab_reader): Add const.
6634 (Sized_incremental_binary::relocs_reader): Add const.
6635 (Sized_incremental_binary::got_plt_reader): Add const.
6636 (Sized_incremental_binary::get_symtab_view): New function.
6637 (Sized_incremental_binary::Inputs_reader): New typedef.
6638 (Sized_incremental_binary::Input_entry_reader): New typedef.
6639 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6640 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6641 (Sized_incremental_binary::do_file_has_changed): New function.
6642 (Sized_incremental_binary::do_init_layout): New function.
6643 (Sized_incremental_binary::do_reserve_layout): New function.
6644 (Sized_input_reader::Inputs_reader): Remove.
6645 (Sized_input_reader::Input_entry_reader): Remove.
6646 (Sized_input_reader::do_arg_serial): New function.
6647 (Sized_input_reader::do_get_unused_symbol_count): New function.
6648 (Sized_input_reader::do_get_unused_symbol): New function.
6649 (Sized_incremental_binary::do_input_file_count): New function.
6650 (Sized_incremental_binary::do_get_input_reader): Change signature;
6651 use index instead of filename.
6652 (Sized_incremental_binary::section_map_): New data member.
6653 (Sized_incremental_binary::input_entry_readers_): New data member.
6654 (class Sized_incr_relobj): New class.
6655 (class Sized_incr_dynobj): New class.
6656 (make_sized_incremental_object): New function.
6657 (class Incremental_library): New class.
6658 * layout.cc (Free_list::num_lists): New static data member.
6659 (Free_list::num_nodes): New static data member.
6660 (Free_list::num_removes): New static data member.
6661 (Free_list::num_remove_visits): New static data member.
6662 (Free_list::num_allocates): New static data member.
6663 (Free_list::num_allocate_visits): New static data member.
6664 (Free_list::init): New function.
6665 (Free_list::remove): New function.
6666 (Free_list::allocate): New function.
6667 (Free_list::dump): New function.
6668 (Free_list::print_stats): New function.
6669 (Layout_task_runner::run): Resize output file for incremental updates.
6670 (Layout::Layout): Initialize new data members.
6671 (Layout::set_incremental_base): New function.
6672 (Layout::init_fixed_output_section): New function.
6673 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6674 incremental updates.
6675 (Layout::create_gold_note): Do not create gold note section for
6676 incremental updates.
6677 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6678 for incremental updates.
6679 (Layout::set_section_offsets): For incremental updates, allocate space
6681 (Layout::create_symtab_sections): Layout with offsets relative to
6682 start of section; for incremental updates, allocate space from free
6684 (Layout::create_shdrs): For incremental updates, allocate space from
6686 (Layout::finish_dynamic_section): For incremental updates, do not
6687 check --as-needed (fixed in subsequent patch).
6688 * layout.h (class Free_list): New class.
6689 (Layout::set_incremental_base): New function.
6690 (Layout::incremental_base): New function.
6691 (Layout::init_fixed_output_section): New function.
6692 (Layout::allocate): New function.
6693 (Layout::incremental_base_): New data member.
6694 (Layout::free_list_): New data member.
6695 * main.cc (main): Print Free_list statistics.
6696 * object.cc (Relobj::finalize_incremental_relocs): Add
6697 clear_counts parameter; clear counts only when clear_counts is set.
6698 (Sized_relobj::Sized_relobj): Initialize new base class.
6699 (Sized_relobj::do_layout): Don't report special sections.
6700 (Sized_relobj::do_for_all_local_got_entries): New function.
6701 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6702 symtab_off to all symbol table offsets.
6703 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6704 * object.h (class Got_offset_list): Move to top of file.
6705 (Object::Object): Allow case where input_file == NULL.
6706 (Object::~Object): Likewise.
6707 (Object::input_file): Assert that input_file != NULL.
6708 (Object::lock): Allow case where input_file == NULL.
6709 (Object::unlock): Likewise.
6710 (Object::is_locked): Likewise.
6711 (Object::token): Likewise.
6712 (Object::release): Likewise.
6713 (Object::is_incremental): New function.
6714 (Object::get_mtime): New function.
6715 (Object::for_all_local_got_entries): New function.
6716 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6717 (Object::set_is_in_system_directory): New function.
6718 (Object::is_in_system_directory): New function.
6719 (Object::do_is_incremental): New function.
6720 (Object::do_get_mtime): New function.
6721 (Object::do_for_all_local_got_entries): New function.
6722 (Object::is_in_system_directory_): New data member.
6723 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6724 (class Sized_relobj_base): New class.
6725 (class Sized_relobj): Derive from Sized_relobj_base.
6726 (class Sized_relobj::Symbols): Redeclare from base class.
6727 (class Sized_relobj::local_got_offset_list): Remove.
6728 (class Sized_relobj::Output_sections): Redeclare from base class.
6729 (class Sized_relobj::do_for_all_local_got_entries): New function.
6730 (class Sized_relobj::write_local_symbols): Add offset parameter.
6731 (class Sized_relobj::local_symbol_offset_): Update comment.
6732 (class Sized_relobj::local_dynsym_offset_): Update comment.
6733 * options.cc (Input_arguments::add_file): Remove const.
6734 * options.h (Input_file_argument::Input_file_argument):
6735 Initialize arg_serial_ (all constructors).
6736 (Input_file_argument::set_arg_serial): New function.
6737 (Input_file_argument::arg_serial): New function.
6738 (Input_file_argument::arg_serial_): New data member.
6739 (Input_arguments::Input_arguments): Initialize file_count_.
6740 (Input_arguments::add_file): Remove const.
6741 (Input_arguments::number_of_input_files): New function.
6742 (Input_arguments::file_count_): New data member.
6743 (Command_line::number_of_input_files): Call
6744 Input_arguments::number_of_input_files.
6745 * output.cc (Output_segment_headers::Output_segment_headers):
6747 (Output_section::Input_section::current_data_size): New function.
6748 (Output_section::Output_section): Initialize new data members.
6749 (Output_section::add_input_section): Don't do merge sections for
6750 an incremental link; allocate space from free list for an
6752 (Output_section::add_output_section_data): Allocate space from
6753 free list for an incremental update.
6754 (Output_section::update_data_size): New function.
6755 (Output_section::set_fixed_layout): New function.
6756 (Output_section::reserve): New function.
6757 (Output_segment::set_section_addresses): Remove const.
6758 (Output_segment::set_section_list_addresses): Remove const; allocate
6759 space from free list for an incremental update.
6760 (Output_segment::set_offset): Adjust size of RELRO segment for an
6762 * output.h (Output_data::current_data_size): Move here from
6764 (Output_data::pre_finalize_data_size): New function.
6765 (Output_data::update_data_size): New function.
6766 (Output_section_headers::update_data_size): new function.
6767 (Output_section_data_build::current_data_size): Move to Output_data.
6768 (Output_data_strtab::update_data_size): New function.
6769 (Output_section::current_data_size): Move to Output_data.
6770 (Output_section::set_fixed_layout): New function.
6771 (Output_section::has_fixed_layout): New function.
6772 (Output_section::reserve): New function.
6773 (Output_section::update_data_size): New function.
6774 (Output_section::has_fixed_layout_): New data member.
6775 (Output_section::free_list_): New data member.
6776 (Output_segment::set_section_addresses): Remove const.
6777 (Output_segment::set_section_list_addresses): Remove const.
6778 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6780 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6782 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6783 parameter when calling Add_symbols constructor; store argument
6784 serial number for members of a lib group.
6785 (Add_symbols::locks): Allow case where token == NULL.
6786 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6787 (Read_member::~Read_member): New function.
6788 (Read_member::is_runnable): New function.
6789 (Read_member::locks): New function.
6790 (Read_member::run): New function.
6791 (Check_script::~Check_script): New function.
6792 (Check_script::is_runnable): New function.
6793 (Check_script::locks): New function.
6794 (Check_script::run): New function.
6795 (Check_library::~Check_library): New function.
6796 (Check_library::is_runnable): New function.
6797 (Check_library::locks): New function.
6798 (Check_library::run): New function.
6799 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6800 (Add_symbols::library_): New data member.
6801 (class Read_member): New class.
6802 (class Check_script): New class.
6803 (class Check_library): New class.
6804 * reloc.cc (Read_relocs::is_runnable): Allow case where
6806 (Read_relocs::locks): Likewise.
6807 (Scan_relocs::locks): Likewise.
6808 (Relocate_task::locks): Likewise.
6809 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6811 (Sized_relobj::incremental_relocs_scan): Fix comment.
6812 (Sized_relobj::do_relocate): Pass output file offset to
6813 write_local_symbols.
6814 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6815 from class declaration.
6816 * script.cc (read_input_script): Allocate Script_info; pass
6817 argument serial number to report_script.
6818 * script.h (class Script_info): Move to incremental.h.
6819 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6820 * symtab.h (Symbol_table::add_from_incrobj): New function.
6821 (Symbol_table::set_file_offset): New function.
6823 2011-04-05 Cary Coutant <ccoutant@google.com>
6825 * incremental-dump.cc (dump_incremental_inputs): Change signature
6826 to take a Sized_incremental_binary; change caller. Use readers
6827 in Sized_incremental_binary.
6829 (Sized_incremental_binary::find_incremental_inputs_sections):
6830 Rename do_find_incremental_inputs_sections to this.
6831 (Sized_incremental_binary::setup_readers): New function.
6832 (Sized_incremental_binary::do_check_inputs): Check
6833 has_incremental_info_ flag; move setup code to setup_readers;
6835 (Sized_incremental_binary::do_file_is_unchanged): New function.
6836 (Sized_incremental_binary::do_get_input_reader): New function.
6837 * incremental.h (class Incremental_binary): Move to end of file.
6838 (Incremental_binary::file_is_unchanged): New function.
6839 (Incremental_binary::do_file_is_unchanged): New function.
6840 (Incremental_binary::Input_reader): New class.
6841 (Incremental_binary::get_input_reader): New function.
6842 (class Sized_incremental_binary): Move to end of file.
6843 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6844 input section reader classes.
6845 (Sized_incremental_binary::has_incremental_info): New function.
6846 (Sized_incremental_binary::inputs_reader): New function.
6847 (Sized_incremental_binary::symtab_reader): New function.
6848 (Sized_incremental_binary::relocs_reader): New function.
6849 (Sized_incremental_binary::got_plt_reader): New function.
6850 (Sized_incremental_binary::do_file_is_unchanged): New function.
6851 (Sized_incremental_binary::Sized_input_reader): New class.
6852 (Sized_incremental_binary::get_input_reader): New function.
6853 (Sized_incremental_binary::find_incremental_inputs_sections):
6854 Rename do_find_incremental_inputs_sections to this.
6855 (Sized_incremental_binary::setup_readers): New function.
6856 (Sized_incremental_binary::has_incremental_info_): New data member.
6857 (Sized_incremental_binary::inputs_reader_): New data member.
6858 (Sized_incremental_binary::symtab_reader_): New data member.
6859 (Sized_incremental_binary::relocs_reader_): New data member.
6860 (Sized_incremental_binary::got_plt_reader_): New data member.
6861 (Sized_incremental_binary::current_input_file_): New data member.
6863 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6866 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6869 2011-03-30 Cary Coutant <ccoutant@google.com>
6871 * archive.cc (Archive::include_member): Adjust call to report_object.
6872 (Add_archive_symbols::run): Add script_info to call to
6873 report_archive_begin.
6874 (Lib_group::include_member): Adjust call to report_object.
6875 (Add_lib_group_symbols::run): Adjust call to report_object.
6876 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6877 blocks. Add object count for script input files.
6878 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6879 script_info parameter; change all callers.
6880 (Incremental_inputs::report_object): Add script_info parameter;
6882 (Incremental_inputs::report_script): Store backpointer to
6883 incremental info entry.
6884 (Output_section_incremental_inputs::set_final_data_size): Record
6885 additional information for scripts.
6886 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6887 * incremental.h (Incremental_script_entry::add_object): New function.
6888 (Incremental_script_entry::get_object_count): New function.
6889 (Incremental_script_entry::get_object): New function.
6890 (Incremental_script_entry::objects_): New data member; adjust
6892 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6893 (Incremental_inputs::report_object): Add script_info parameter.
6894 (Incremental_inputs_reader::get_object_count): New function.
6895 (Incremental_inputs_reader::get_object_offset): New function.
6896 * options.cc (Input_arguments::add_file): Return reference to
6898 * options.h (Input_argument::set_script_info): New function.
6899 (Input_argument::script_info): New function.
6900 (Input_argument::script_info_): New data member; adjust all
6902 (Input_file_group::add_file): Return reference to new input argument.
6903 (Input_file_lib::add_file): Likewise.
6904 (Input_arguments::add_file): Likewise.
6905 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6906 * script.cc (Parser_closure::Parser_closure): Add script_info
6907 parameter; adjust all callers.
6908 (Parser_closure::script_info): New function.
6909 (Parser_closure::script_info_): New data member.
6910 (read_input_script): Report scripts earlier to incremental info.
6911 (script_add_file): Set script_info in Input_argument.
6912 (script_add_library): Likewise.
6913 * script.h (Script_options::Script_info): Rewrite class.
6915 2011-03-29 Cary Coutant <ccoutant@google.com>
6917 * archive.cc (Library_base::should_include_member): Move
6918 method here from class Archive.
6919 (Archive::Archive): Initialize base class.
6920 (Archive::should_include_member): Move to base class.
6921 (Archive::do_for_all_unused_symbols): New function.
6922 (Add_archive_symbols::run): Remove redundant access to
6924 (Lib_group::Lib_group): Initialize base class.
6925 (Lib_group::do_filename): New function.
6926 (Lib_group::include_member): Pass pointer to Lib_group to
6928 (Lib_group::do_for_all_unused_symbols): New function.
6929 (Add_lib_group_symbols::run): Report archive information for
6931 * archive.h (class Library_base): New base class.
6932 (class Archive): Derive from Library_base.
6933 (Archive::filename): Move to base class.
6934 (Archive::set_incremental_info): Likewise.
6935 (Archive::incremental_info): Likewise.
6936 (Archive::Should_include): Likewise.
6937 (Archive::should_include_member): Likewise.
6938 (Archive::Armap_entry): Remove.
6939 (Archive::Unused_symbol_iterator): Remove.
6940 (Archive::unused_symbols_begin): Remove.
6941 (Archive::unused_symbols_end): Remove.
6942 (Archive::do_filename): New function.
6943 (Archive::do_get_mtime): New function.
6944 (Archive::do_for_all_unused_symbols): New function.
6945 (Archive::task_): Move to base class.
6946 (Archive::incremental_info_): Likewise.
6947 (class Lib_group): Derive from Library_base.
6948 (Lib_group::do_filename): New function.
6949 (Lib_group::do_get_mtime): New function.
6950 (Lib_group::do_for_all_unused_symbols): New function.
6951 (Lib_group::task_): Move to base class.
6952 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6954 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6956 * incremental.cc (Incremental_inputs::report_archive_begin):
6957 Use Library_base; call library's get_mtime; add incremental inputs
6958 entry before members.
6959 (class Unused_symbol_visitor): New class.
6960 (Incremental_inputs::report_archive_end): Use Library_base; use
6961 visitor class to record unused symbols; don't add incremental inputs
6962 entry after members.
6963 (Incremental_inputs::report_object): Use Library_base.
6965 (Incremental_archive_entry::Incremental_archive_entry): Remove
6966 unused Archive parameter.
6967 (Incremental_inputs::report_archive_begin): Use Library_base.
6968 (Incremental_inputs::report_archive_end): Likewise.
6969 (Incremental_inputs::report_object): Likewise.
6970 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6972 * object.h (Object::for_all_global_symbols): New function.
6973 (Object::do_for_all_global_symbols): New function.
6974 (Sized_relobj::do_for_all_global_symbols): New function.
6975 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6977 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6980 2011-03-27 Ian Lance Taylor <iant@google.com>
6982 * archive.cc (Archive::interpret_header): Return -1 if something
6983 goes wrong. Change callers accordingly.
6985 2011-03-25 Cary Coutant <ccoutant@google.com>
6987 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6988 * testsuite/Makefile.in: Regenerate.
6990 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
6992 * plugin.cc (get_view): New.
6993 (Plugin::load): Pass get_view to the plugin.
6994 (Plugin_manager::get_view): New.
6996 2011-03-21 Ian Lance Taylor <iant@google.com>
6998 * testsuite/final_layout.sh: Rewrite to not use dc.
6999 * testsuite/relro_test.sh: Fail if dc is not present.
7001 2011-03-21 Sriraman Tallam <tmsriram@google.com>
7003 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7005 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7006 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7008 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7009 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7011 2011-03-14 Ian Lance Taylor <iant@google.com>
7013 * script-sections.cc (Sort_output_sections::script_compare):
7014 Rename from is_before, change return type.
7015 (Sort_output_sections::operator()): Adjust accordingly.
7017 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7020 * testsuite/odr_violation2.cc: Add comment to make all error line
7021 numbers double digits.
7022 * testsuite/debug_msg.sh: Adjust expected errors.
7024 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7026 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7027 but mark earlier ones as non-canonical
7028 (offset_to_iterator): Update search target and example
7029 (do_addr2line): Return extra lines in a vector*
7030 (format_file_lineno): Extract from do_addr2line
7031 (one_addr2line): Add vector* out-param
7032 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7033 when a lineno entry appeared last for its instruction
7034 (Dwarf_line_info): Add vector* out-param
7035 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7036 * symtab.cc (Odr_violation_compare): Include the lineno in the
7038 (linenos_from_loc): New. Combine the canonical line for an
7039 address with its other lines.
7040 (True_if_intersect): New. Helper functor to make
7041 std::set_intersection a query.
7042 (detect_odr_violations): Compare sets of lines instead of just
7043 one line for each function. This became less deterministic, but
7044 has fewer false positives.
7045 * symtab.h: Declarations.
7046 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7047 mix an optimized and non-optimized object in the same binary
7048 (odr_violation2.so): Same.
7049 * testsuite/Makefile.in: Regenerate from Makefile.am.
7050 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7051 * testsuite/debug_msg.sh: Update line numbers and add
7053 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7054 non-optimized context.
7055 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7056 isn't inlined, and use OdrDerived in an optimized context.
7057 * testsuite/odr_header1.h: Defines OdrDerived, where
7058 optimization will change the
7059 first-instruction-in-the-destructor's file and line number.
7060 * testsuite/odr_header2.h: Defines OdrBase.
7062 2011-03-09 Ian Lance Taylor <iant@google.com>
7064 * fileread.cc (File_read::clear_views): Don't delete the whole
7067 2011-03-08 Ian Lance Taylor <iant@google.com>
7070 * fileread.cc: #include <climits>.
7071 (GOLD_IOV_MAX): Define.
7072 (File_read::read_multiple): Limit number of entries by iov_max.
7073 * fileread.h (class File_read): Always set max_readv_entries to
7076 2011-03-07 Ian Lance Taylor <iant@google.com>
7079 * options.h (class General_options): Add -dy and -dn.
7081 2011-03-02 Cary Coutant <ccoutant@google.com>
7083 * testsuite/script_test_9.t: Add TLS segment.
7085 2011-03-02 Simon Baldwin <simonb@google.com>
7087 * configure.ac: Add check for gnu_indirect_function support in
7088 the toolchain building binutils.
7089 * configure: Rebuild.
7091 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
7093 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7094 plugin only symbols.
7095 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7096 in plugin files as not needed in the symbol table.
7098 2011-02-11 Sriraman Tallam <tmsriram@google.com>
7100 * output.cc (Output_section::add_input_section): Delay fill
7101 generation for section ordering.
7103 2011-02-09 Ian Lance Taylor <iant@google.com>
7106 * object.h (class Sized_relobj): Remove clear_local_symbols.
7107 * reloc.cc (Sized_relobj::do_relocate): Don't call
7108 clear_local_symbols.
7110 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
7112 * plugin.cc (is_visible_from_outside): Return true for symbols
7115 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7117 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7120 2011-02-02 Sriraman Tallam <tmsriram@google.com>
7122 * icf.h (is_section_foldable_candidate): Change type of parameter
7124 * icf.cc (Icf::find_identical_sections): Change type of local variable
7125 section_name to be std::string.
7126 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7128 2011-01-25 Ian Lance Taylor <iant@google.com>
7130 * script.cc (script_add_extern): Rewrite to use
7131 add_symbol_reference.
7133 2011-01-25 Doug Kwan <dougkwan@google.com>
7135 * icf.cc (get_section_contents): Always lock section's object.
7137 2011-01-24 Ian Lance Taylor <iant@google.com>
7139 * options.h (class General_options): Accept
7140 --no-detect-odr-violations.
7142 2011-01-24 Ian Lance Taylor <iant@google.com>
7144 * version.cc (version_string): Bump to 1.11.
7146 2011-01-24 Ian Lance Taylor <iant@google.com>
7148 * plugin.cc (class Plugin_rescan): Define new class.
7149 (Plugin_manager::claim_file): Set any_claimed_.
7150 (Plugin_manager::save_archive): New function.
7151 (Plugin_manager::save_input_group): New function.
7152 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7154 (Plugin_manager::new_undefined_symbol): New function.
7155 (Plugin_manager::rescan): New function.
7156 (Plugin_manager::rescannable_defines): New function.
7157 (Plugin_manager::add_input_file): Set any_added_.
7158 * plugin.h (class Plugin_manager): define new fields rescannable_,
7159 undefined_symbols_, any_claimed_, and any_added_. Declare
7160 Plugin_rescan as friend. Declare new functions.
7161 (Plugin_manager::Rescannable): Define type.
7162 (Plugin_manager::Rescannable_list): Define type.
7163 (Plugin_manager::Undefined_symbol_list): Define type.
7164 (Plugin_manager::Plugin_manager): Initialize new fields.
7165 * archive.cc (Archive::defines_symbol): New function.
7166 (Add_archive_symbols::run): Pass archive to plugins if any.
7167 * archive.h (class Archive): Declare defines_symbol.
7168 * readsyms.cc (Input_group::~Input_group): New function.
7169 (Finish_group::run): Pass input_group to plugins if any.
7170 * readsyms.h (class Input_group): Declare destructor.
7171 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7174 2011-01-10 Ian Lance Taylor <iant@google.com>
7176 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7178 (Layout::set_segment_offsets): Reset increase_relro before calling
7179 set_section_addresses a second time.
7181 2011-01-04 Cary Coutant <ccoutant@google.com>
7183 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7184 sections before NOBITS sections.
7186 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7188 * version.cc (print_version): Update copyright to 2011.
7190 2010-12-23 Cary Coutant <ccoutant@google.com>
7192 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7193 of OS to this->add. Add OD parameter to second form of the function.
7195 2010-12-20 Ian Lance Taylor <iant@google.com>
7197 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7198 second of two consecutive entries with same offset.
7200 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7202 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7203 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7204 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7205 to avoid unneeded links against $(LDADD).
7206 * testsuite/Makefile.in: Regenerate.
7208 2010-12-15 Ian Lance Taylor <iant@google.com>
7211 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7212 for R_X86_64_32 and R_X86_64_PC32.
7213 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7214 ver_matching_def_pic.o.
7215 (ver_matching_def_pic.o): New target.
7217 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7219 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7220 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7221 Move definition before File_read::View member definitions.
7222 (File_read::View::~View): Initialize and hold lock before
7223 updating current_mapped_bytes.
7225 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7227 * dwarf_reader.cc: Remove outdated comment.
7228 * gold-threads.cc: Fix typo in error message.
7229 * archive.cc: Fix typos in comments.
7230 * archive.h: Likewise.
7231 * arm-reloc-property.cc: Likewise.
7232 * arm-reloc-property.h: Likewise.
7233 * arm-reloc.def: Likewise.
7235 * attributes.h: Likewise.
7236 * cref.cc: Likewise.
7237 * ehframe.cc: Likewise.
7238 * fileread.h: Likewise.
7240 * i386.cc: Likewise.
7242 * incremental.h: Likewise.
7243 * int_encoding.cc: Likewise.
7244 * layout.h: Likewise.
7245 * main.cc: Likewise.
7246 * merge.h: Likewise.
7247 * object.cc: Likewise.
7248 * object.h: Likewise.
7249 * options.cc: Likewise.
7250 * readsyms.cc: Likewise.
7251 * reduced_debug_output.cc: Likewise.
7252 * reloc.cc: Likewise.
7253 * script-sections.cc: Likewise.
7254 * sparc.cc: Likewise.
7255 * symtab.h: Likewise.
7256 * target-reloc.h: Likewise.
7257 * target.cc: Likewise.
7258 * target.h: Likewise.
7259 * timer.cc: Likewise.
7260 * timer.h: Likewise.
7261 * x86_64.cc: Likewise.
7263 2010-12-09 Cary Coutant <ccoutant@google.com>
7265 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7267 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7268 parameter; change all callers.
7269 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7270 * options.h (warn_execstack): New option.
7272 2010-12-07 Doug Kwan <dougkwan@google.com>
7274 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7275 like function call relocations.
7277 2010-12-07 Ian Lance Taylor <iant@google.com>
7279 * archive.cc (Archive::get_elf_object_for_member): Permit
7280 punconfigured to be NULL.
7281 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7282 (Archive::include_member): Pass NULL to get_elf_object_for_member
7283 if we searched for the archive and this is the first included
7286 2010-12-01 Ian Lance Taylor <iant@google.com>
7288 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7289 track_relocs_type_ field.
7290 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7291 Set track_relocs_type_.
7292 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7293 contents when using RELA relocs.
7294 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7296 * reloc.cc (Track_relocs::next_addend): New function.
7297 * reloc.h (class Track_relocs): Declare next_addend.
7299 2010-12-01 Ian Lance Taylor <iant@google.com>
7301 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7304 2010-12-01 Ian Lance Taylor <iant@google.com>
7306 * README: Update compilers known to work and fail.
7308 2010-11-23 Matthias Klose <doko@ubuntu.com>
7310 * configure.in: For --enable-gold, handle value `default' instead of
7311 `both*'. Always install ld as ld.bfd, install as ld if gold is
7313 * configure: Regenerate.
7315 2010-11-18 Doug Kwan <dougkwan@google.com>
7317 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7318 and right_alignment to be zero. Store result alignment only if it is
7319 greater than existing alignment.
7321 2010-11-16 Cary Coutant <ccoutant@google.com>
7324 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7325 Check for ".zdebug_line".
7327 2010-11-16 Doug Kwan <dougkwan@google.com>
7328 Cary Coutant <ccoutant@google.com>
7330 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7331 by reference; adjust all callers.
7332 * output.cc (Output_segment::set_section_addresses): Adjust references
7333 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7335 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7336 end at page boundary.
7338 2010-11-16 Cary Coutant <ccoutant@google.com>
7341 * layout.cc (Layout::choose_output_section): Transform names of
7342 compressed sections even when using a script with a SECTIONS clause.
7343 (Layout::output_section_name): Remove code to transform
7344 compressed debug section names.
7345 * output.cc (Output_section::add_input_section): Use uncompressed
7346 section size when tracking input sections.
7348 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7350 * symtab.h (Symbol::NON_PIC_REF): Remove.
7351 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7352 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7353 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7354 (Symbol::use_plt_offset): Take a flags argument and pass it
7355 directly to needs_dynamic_reloc. Restrict check for undefined
7356 weak symbols to function calls.
7357 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7358 (Target_arm::Scan::global): Use it.
7359 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7360 (Target_arm::Relocate::relocate): Likewise.
7361 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7362 parameter with an r_type parameter. Use get_reference_flags
7364 (Target_arm::Relocate::relocate): Update accordingly.
7365 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7366 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7367 (Target_i386::Scan::global): Likewise.
7368 (Target_i386::Relocate::relocate): Likewise.
7369 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7370 parameter with an r_type parameter. Use get_reference_flags
7372 (Target_i386::Relocate::relocate): Update accordingly.
7373 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7374 (Target_powerpc::Scan::global): Use it.
7375 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7376 (Target_powerpc::Relocate::relocate): Likewise.
7377 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7378 (Target_sparc::Scan::global): Use it.
7379 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7380 (Target_sparc::Relocate::relocate): Likewise.
7381 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7382 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7383 (Target_x86_64::Scan::global): Likewise.
7384 (Target_x86_64::Relocate::relocate): Likewise.
7386 2010-11-08 Doug Kwan <dougkwan@google.com>
7387 Cary Coutant <ccoutant@google.com>
7389 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7390 (Arm_exidx_merge_section::section_contents_): New data member.
7391 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7392 (Arm_input_section::~Arm_input_section): De-allocate memory.
7393 (Arm_input_section::original_contents_): New data member.
7394 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7395 in parameters instead of calling Object::section_contents without
7397 (Arm_output_section::group_section): New parameter TASK. Pass it
7398 to callees that need locking objects.
7399 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7400 to lock EXIDX input sections. Fix a formatting issue. Call
7401 Arm_exidx_merged_section::build_contents to create merged section
7403 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7404 to lock object of stub table owner.
7405 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7406 TEXT_SIZE to initialize data member TEXT_SIZE_.
7407 (Arm_exidx_input_section::addralign): Fix typo in comment.
7408 (Arm_exidx_input_section::text_size): New method.
7409 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7410 that require locking objects. Lock objects before scanning for stubs
7411 and updating local symbols.
7412 (Arm_input_section<big_endian>::init): Copy contents of original
7414 (Arm_input_section<big_endian>::do_write): Use saved contents of
7415 original input section instead of calling Object::section_contents
7417 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7418 size without calling Object::section_size().
7419 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7420 for size. Allocate a buffer for merged EXIDX entries.
7421 (Arm_exidx_merged_section::build_contents): New method.
7422 (Arm_exidx_merged_section::do_write): Move merge section contents
7423 building code to Arm_exidx_merged_section::build_contetns. Write
7424 out contetns in buffer instead of building it on the fly.
7425 (Arm_relobj::make_exidx_input_section): Also pass text section size
7426 to Arm_exidx_input_section constructor.
7427 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7428 (Arm_dynobj::do_read_symbols): Fix memory leak.
7429 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7430 * target.h: (class Task): Add forward declaration.
7431 (Target::relax): Add new parameter TASK and pass it to
7433 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7435 2010-11-05 Cary Coutant <ccoutant@google.com>
7438 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7439 object when reading from the file.
7440 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7442 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7443 when reading section contents.
7444 (get_section_contents): Likewise.
7445 (icf::find_identical_sections): Likewise.
7446 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7447 object when reading from the file.
7448 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7449 the object when doing deferred section layout.
7451 2010-11-03 Nick Clifton <nickc@redhat.com>
7454 * script.h (class Symbol_assignment: name): New member. Returns
7455 the name of the symbol.
7456 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7457 Returns true if the given symbol name is on the list of
7458 assignments wating to be processed.
7459 * archive.cc (should_incldue_member): If the symbol is undefined,
7460 check to see if it is on the list of symbols pending assignment.
7462 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7464 * script-sections.cc (Script_sections::find_memory_region): Check
7465 for a NULL output section pointer.
7467 2010-10-29 Doug Kwan <dougkwan@google.com>
7469 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7470 Output_section::add_relaxed_input_section.
7471 * output.cc (Output_section::add_relaxed_input_section): Add new
7472 arguments LAYOUT and NAME. Set section order index.
7473 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7474 Copy section order index.
7475 * output.h (Output_section::add_relaxed_input_section): Add new
7476 arguments LAYOUT and NAME.
7478 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7480 * testsuite/Makefile.am: Move gcctestdir/ld rule to
7481 NATIVE_OR_CROSS_LINKER.
7482 * testsuite/Makefile.in: Regenerate.
7484 2010-10-20 Doug Kwan <dougkwan@google.com>
7486 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7487 without SHF_LINK_ORDER flags.
7488 * layout.cc (Layout::choose_output_section): Do not filter
7489 SHF_LINK_ORDER flag in a relocatable link.
7491 2010-10-17 Cary Coutant <ccoutant@google.com>
7493 * output.h (Output_segment::set_section_addresses): Change function
7494 signature. Update all callers.
7495 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7497 (Output_segment::set_section_addresses): Align after last TLS
7498 section. Add padding before last relro section instead of after.
7500 2010-10-17 Doug Kwan <dougkwan@google.com>
7502 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7503 GOT output section to be writable.
7505 2010-10-14 Cary Coutant <ccoutant@google.com>
7507 * debug.h (DEBUG_INCREMENTAL): New flag.
7508 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7509 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7511 * incremental.cc (report_command_line): Ignore all forms of
7513 * layout.cc (Layout::Layout): Check parameters for incremental link
7515 * options.cc (General_options::parse_incremental): New function.
7516 (General_options::parse_no_incremental): New function.
7517 (General_options::parse_incremental_full): New function.
7518 (General_options::parse_incremental_update): New function.
7519 (General_options::incremental_mode_): New data member.
7520 (General_options::finalize): Check incremental_mode_.
7521 * options.h (General_options): Update help text for --incremental.
7522 Add --no-incremental, --incremental-full, --incremental-update.
7523 (General_options::Incremental_mode): New enum type.
7524 (General_options::incremental_mode): New function.
7525 (General_options::incremental_mode_): New data member.
7526 * parameters.cc (Parameters::incremental_mode_): New data member.
7527 (Parameters::set_options): Set incremental_mode_.
7528 (Parameters::set_incremental_full): New function.
7529 (Parameters::incremental): New function.
7530 (Parameters::incremental_update): New function.
7531 (set_parameters_incremental_full): New function.
7532 * parameters.h (Parameters::set_incremental_full): New function.
7533 (Parameters::incremental): New function.
7534 (Parameters::incremental_update): New function.
7535 (Parameters::incremental_mode_): New data member.
7536 (set_parameters_incremental_full): New function.
7537 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7538 incremental link mode.
7539 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7540 (Sized_relobj::do_relocate_sections): Likewise.
7541 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7543 * testsuite/Makefile.in: Regenerate.
7544 * testsuite/incremental_test.sh: Filter all forms of --incremental.
7546 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7548 * script-sections.h (class Script_sections): Make
7549 Sections_elements typedef public.
7550 * script-sections.cc (class Sort_output_sections): Add elements_
7551 field. Add constructor which sets it; change all callers.
7552 (Sort_output_sections::is_before): New function.
7553 (Sort_output_sections::operator()): Call is_before.
7554 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7556 * testsuite/script_test_10.sh: New test. Test script section
7558 * testsuite/script_test_10.t: Likewise.
7559 * testsuite/script_test_10.s: Likewise.
7560 * testsuite/Makefile.am: Wrap the cross linker tests and the
7561 common tests into NATIVE_OR_CROSS_LINKER.
7562 (check_SCRIPTS): Add script_test_10.sh.
7563 (check_DATA): Add script_test_10.stdout.
7564 (script_test_10.o, script_test_10): New targets.
7565 (script_test_10.stdout): New target.
7566 * configure, testsuite/Makefile.in: Regenerate.
7568 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7570 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7571 error for the deprecated relocations.
7572 (Target_arm::Scan::global): Likewise.
7573 (Target_arm::Relocate::relocate): Likewise.
7575 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7577 * fileread.cc (Input_file::find_file): Initialize *found_name
7578 and *namep when using the fallback search for case 4.
7580 2010-10-11 Cary Coutant <ccoutant@google.com>
7582 * options.h (class General_options): Redefine -z lazy as an alias for
7583 the negation of -z now.
7585 2010-10-11 Ian Lance Taylor <iant@google.com>
7587 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7590 2010-10-06 Nick Clifton <nickc@redhat.com>
7592 * script-sections.cc(class Memory_region): Remove
7593 current_lma_offset_ field. Rename current_vma_offset_ to
7594 current_offset_. Add last_section_ field.
7595 (Memory_region::get_current_vma_address): Rename to
7596 get_current_address.
7597 (Memory_region::get_current_lma_address): Delete.
7598 (Memory_region::increment_vma_offset): Rename to
7600 (Memory_region::increment_lma_offset): Delete.
7601 (Memory_region::attributes_compatible): New method. Returns
7602 true if the provided section is compatible with the region.
7603 (Memory_region::get_last_section): New method. Returns the last
7604 section to use the region.
7605 (Memory_region::set_last_section): New method. Stores the last
7606 section to use the region.
7607 (Script_sections::block_in_region): New method. Returns true if
7608 a block of memory is contained within a region.
7609 (Script_sections::find_memory_region): New method. Locates a
7610 memory region to be used to set a VMA or LMA address.
7611 (Output_section_definition::set_section_addresses): Add code to
7612 check for addresses set by memory regions.
7613 (Output_segment::set_section_addresses): Remove memory region
7615 (Script_sections::create_segment): Add a warning if a header
7616 segment is created outside of any region.
7617 * script-sections.h (class Script_sections): Add prototypes for
7618 find_memory_region and block_in_region methods.
7619 * testsuite/memory_test.s: Use .long instead of .word.
7620 * testsuite/memory_test.t: Add some more output sections.
7621 * testsuite/memory_test.sh: Update expected output.
7623 2010-10-02 Doug Kwan <dougkwan@google.com>
7625 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7626 defintion to symtab.h
7627 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7628 declaration to defintion.
7630 2010-10-01 Nick Clifton <nickc@redhat.com>
7632 * expression.cc (eval): Replace dummy argument with NULL.
7633 (eval_maybe_dot): Check for a NULL result section pointer.
7634 (Symbol_expression::value): Likewise.
7635 (Dot_expression::value): Likewise.
7636 (BINARY_EXPRESSION): Likewise.
7637 (Max_expression::value): Likewise.
7638 (Min_expression::value): Likewise.
7639 (Absolute_expression::value): Likewise.
7640 (Addr_expression::value_from_output_section): Likewise.
7641 (Loaddddr_expression::value_from_output_section): Likewise.
7642 (Segment_start_expression::value): Likewise.
7643 * script-sections.cc
7644 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7646 (Sections_elememt_dot_assignment::set_section_addresses):
7648 (Output_data_expression::do_write_to_buffer): Likewise.
7649 (Output_section_definition::finalize_symbols): Likewise.
7650 (Output_section_definition::set_section_addresses): Likewise.
7652 2010-09-30 Doug Kwan <dougkwan@google.com>
7654 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7656 2010-09-28 Sriraman Tallam <tmsriram@google.com>
7658 * target.h (Target::can_icf_inline_merge_sections): New virtual
7660 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7662 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7664 * icf.cc (get_section_contents): Inline merge sections only when
7667 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7669 * configure: Regenerate.
7671 2010-09-17 Ian Lance Taylor <iant@google.com>
7673 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
7674 * testsuite/Makefile.am (memory_test.o): New target.
7675 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7677 * testsuite/Makefile.in: Rebuild.
7679 2010-09-17 Doug Kwan <dougkwan@google.com>
7681 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7682 defintion if relocation uses GOT entries of the symbol.
7683 * testsuite/icf_safe_test.sh: Fix test.
7684 * testsuite/icf_safe_so_test.sh: Fix test.
7686 2010-09-16 Cary Coutant <ccoutant@google.com>
7688 * script_sections.cc (class Memory_region): Remove "NULL" from
7689 vector initializations.
7691 2010-09-15 Cary Coutant <ccoutant@google.com>
7693 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7694 Resolve forwarding symbols.
7696 2010-09-15 Doug Kwan <dougkwan@google.com>
7698 * gold/testsuite/script_test_3.t: Add ARM special sections.
7699 * gold/testsuite/script_test_4.t: Same.
7700 * gold/testsuite/script_test_5.t: Same.
7701 * gold/testsuite/script_test_6.t: Same.
7702 * gold/testsuite/script_test_7.t: Same.
7703 * gold/testsuite/script_test_7.t: Same.
7704 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7706 2010-09-14 Cary Coutant <ccoutant@google.com>
7708 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7709 (Target_x86_64::Relocate::relocate_tls): Replace check for
7710 saw_tls_block_reloc_ with test for executable section.
7712 2010-09-12 Cary Coutant <ccoutant@google.com>
7714 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7715 position-independent executables to shared libraries need dynamic
7717 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7718 position-independent executables.
7719 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7720 * testsuite/Makefile.in: Regenerate.
7722 2010-09-10 Nick Clifton <nickc@redhat.com>
7725 * testsuite/memory_test.t: Discard any sections that are not
7728 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7731 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7732 "This::" to work around a bug in gcc 4.2.
7734 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7736 2010-09-09 Rafael Espindola <espindola@google.com>
7738 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7739 sections with different PF_X flags in the same segment.
7740 (Layout::find_first_load_seg): Search all segments to find the first
7742 * options.h (rosegment): New.
7744 2010-09-08 Rafael Espindola <espindola@google.com>
7746 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
7748 2010-09-08 Doug Kwan <dougkwan@google.com>
7750 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7751 (Arm_relobj::do_relocate_sections): Add new parameter for output
7752 file to match the parent.
7753 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7754 of local symbols instead of input values. Update code to track
7755 changes in gold::relocate_section.
7756 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7757 (Sized_relobj::compute_final_local_value_internal): New methods.
7758 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7759 body into private version of Sized_relobj::compute_final_local_value.
7760 Call the inline method.
7761 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7762 merged symbol value if there is one.
7763 (Symbol_value::has_output_value): New method defintiion.
7764 (Sized_relobj::Compute_final_local_value_status): New enum type.
7765 (Sized_relobj::compute_final_local_value): New methods.
7766 (Sized_relobj::compute_final_local_value_internal): New methods.
7767 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7768 and arm_cortex_a8.sh.
7769 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7770 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7772 * Makefile.in: Regenerate.
7773 * testsuite/arm_bl_out_of_range.s: Update test.
7774 * testsuite/thumb_bl_out_of_range.s: Ditto.
7775 * testsuite/thumb_blx_out_of_range.s: Ditto.
7776 * testsuite/arm_branch_out_of_range.sh: New file.
7777 * testsuite/arm_cortex_a8.sh: Ditto.
7778 * testsuite/arm_cortex_a8_b.s: Ditto.
7779 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7780 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7781 * testsuite/arm_cortex_a8_bl.s: Ditto.
7782 * testsuite/arm_cortex_a8_blx.s: Ditto.
7783 * testsuite/arm_cortex_a8_local.s: Ditto.
7784 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7785 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7787 2010-09-08 Rafael Espindola <espindola@google.com>
7789 * Makefile.am (memory_test.stdout): Run readelf with -W.
7790 * Makefile.in: Regenerate.
7791 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7794 2010-09-08 Rafael Espindola <espindola@google.com>
7796 * script-sections.cc (Script_sections::add_memory_region): Convert
7797 field precision to int.
7798 * script.cc (script_set_section_region, script_set_section_region):
7799 Convert field precision to int.
7801 2010-09-08 Rafael Espindola <espindola@google.com>
7803 * arm.cc (do_finalize_sections): Create the __exidx_start and
7804 __exdix_end symbols even when the section is missing.
7806 2010-09-08 Nick Clifton <nickc@redhat.com>
7808 * README: Remove claim that MEMORY is not supported.
7809 * expression.cc (script_exp_function_origin)
7810 (script_exp_function_length): Move from here to ...
7811 * script.cc: ... here.
7812 (script_set_section_region, script_add_memory)
7813 (script_parse_memory_attr, script_include_directive): New
7815 * script-sections.cc
7816 (class Memory_region): New class.
7817 (class Output_section_definition): Add set_memory_region,
7818 set_section_vma, set_section_lma and get_section_name methods.
7819 (class Script_Sections): Add add_memory_region,
7820 find_memory_region, find_memory_region_origin,
7821 find_memory_region_length and set_memory_region methods.
7822 Have set_section_addresses method walk the list of set memory
7824 Extend the print methos to display memory regions.
7825 * script-sections.h: Add prototypes for new methods.
7826 Add enum for MEMORY region attributes.
7827 * yyscript.y: Add support for parsing MEMORY regions.
7828 * script-c.h: Add prototypes for new functions.
7829 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7830 * testsuite/Makefile.in: Regenerate.
7831 * testsuite/memory_test.sh: New script.
7832 * testsuite/memory_test.s: New assembler source file.
7833 * testsuite/memory_test.t: New linker script.
7835 2010-08-27 Doug Kwan <dougkwan@google.com>
7837 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7838 reference override an existing dynamic weak reference.
7839 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7840 * testsuite/Makefile.in: Regenerate.
7841 * testsuite/dyn_weak_ref.sh: New file.
7842 * testsuite/dyn_weak_ref_1.c: Ditto.
7843 * testsuite/dyn_weak_ref_2.c: Ditto.
7845 2010-08-27 Ian Lance Taylor <iant@google.com>
7847 * incremental.h (class Incremental_input_entry): Add virtual
7850 2010-08-27 Ian Lance Taylor <iant@google.com>
7852 * testsuite/start_lib_test_3.c: Mark t3 as used.
7854 2010-08-27 Nick Clifton <nickc@redhat.com>
7856 * options.cc (version_script): Fix small typo in previous
7859 2010-08-25 Nick Clifton <nickc@redhat.com>
7861 * archive.cc: Formatting fixes: Remove whitespace between
7862 typename and following asterisk. Remove whitespace between
7863 function name and opening parenthesis.
7864 * archive.h: Likewise.
7866 * attributes.cc: Likewise.
7867 * attributes.h: Likewise.
7868 * common.cc: Likewise.
7869 * copy-relocs.cc: Likewise.
7870 * dirsearch.h: Likewise.
7871 * dynobj.cc: Likewise.
7872 * ehframe.cc: Likewise.
7873 * ehframe.h: Likewise.
7874 * expression.cc: Likewise.
7875 * fileread.cc: Likewise.
7876 * fileread.h: Likewise.
7878 * gold-threads.cc: Likewise.
7879 * gold.cc: Likewise.
7880 * i386.cc: Likewise.
7882 * incremental-dump.cc: Likewise.
7883 * incremental.cc: Likewise.
7884 * layout.cc: Likewise.
7885 * layout.h: Likewise.
7886 * main.cc: Likewise.
7887 * merge.cc: Likewise.
7888 * merge.h: Likewise.
7889 * object.cc: Likewise.
7890 * object.h: Likewise.
7891 * options.cc: Likewise.
7892 * options.h: Likewise.
7893 * output.cc: Likewise.
7894 * output.h: Likewise.
7895 * plugin.cc: Likewise.
7896 * plugin.h: Likewise.
7897 * powerpc.cc: Likewise.
7898 * reloc.cc: Likewise.
7899 * script-c.h: Likewise.
7900 * script-sections.cc: Likewise.
7901 * script.cc: Likewise.
7902 * stringpool.cc: Likewise.
7903 * symtab.cc: Likewise.
7904 * symtab.h: Likewise.
7905 * target.cc: Likewise.
7906 * timer.cc: Likewise.
7907 * timer.h: Likewise.
7908 * version.cc: Likewise.
7909 * x86_64.cc: Likewise.
7911 2010-08-24 Nick Clifton <nickc@redhat.com>
7914 * layout.cc (segment_precedes): Sort segments by their physical
7915 addresses, if they have been set.
7917 2010-08-23 Cary Coutant <ccoutant@google.com>
7919 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7921 (Lib_group::include_member): Unlock object after deleting its
7923 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7926 2010-08-19 Neil Vachharajani <nvachhar@google.com>
7927 Cary Coutant <ccoutant@google.com>
7929 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7930 constructor, and set_blocker.
7931 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7933 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7934 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7935 * testsuite/Makefile.am (start_lib_test): New test case.
7936 * testsuite/Makefile.in: Regenerate.
7937 * testsuite/start_lib_test_main.c: New file.
7938 * testsuite/start_lib_test_1.c: New file.
7939 * testsuite/start_lib_test_2.c: New file.
7940 * testsuite/start_lib_test_3.c: New file.
7942 2010-08-19 Ian Lance Taylor <iant@google.com>
7944 * Makefile.in: Rebuild with automake 1.11.1.
7945 * aclocal.m4: Likewise.
7946 * testsuite/Makefile.in: Likewise.
7948 2010-08-19 Ian Lance Taylor <iant@google.com>
7951 * i386.cc (class Output_data_plt_i386): Update declarations.
7952 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7953 local_ifuncs_ fields.
7954 (Target_i386::do_plt_section_for_global): New function.
7955 (Target_i386::do_plt_section_for_local): New function.
7956 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7957 parameter; change all callers. Initialize global_ifuncs_ and
7958 local_ifuncs_. If doing a static link define __rel_iplt_start and
7960 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7961 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7962 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7964 (Target_i386::make_plt_section): New function, broken out of
7965 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7966 (Target_i386::make_plt_entry): Call make_plt_section.
7967 (Target_i386::make_local_ifunc_plt_entry): New function.
7968 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7969 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7970 R_386_IRELATIVE to switch.
7971 (Target_i386::Scan::global): Likewise.
7972 (Target_i386::Relocate::relocate): Likewise.
7973 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7975 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7976 (Target_x86_64::do_plt_section_for_global): New function.
7977 (Target_x86_64::do_plt_section_for_local): New function.
7978 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7979 parameter; change all callers. If doing a static link define
7980 __rela_iplt_start and __rela_iplt_end.
7981 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7982 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7983 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7985 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7986 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7988 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7989 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7990 R_X86_64_IRELATIVE to switch.
7991 (Target_x86_64::Scan::global): Likewise.
7992 (Target_x86_64::Relocate::relocate): Likewise.
7993 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7995 * target.h (class Target): Add plt_section_for_global and
7996 plt_section_for_local functions. Add do_plt_section_for_global
7997 and do_plt_section_for_local virtual functions.
7998 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7999 clarifying comments.
8000 (Symbol::use_plt_offset): Handle IFUNC symbol.
8001 * object.cc (Sized_relobj::Sized_relobj): Initialize
8003 (Sized_relobj::local_has_plt_offset): New function.
8004 (Sized_relobj::local_plt_offset): New function.
8005 (Sized_relobj::set_local_plt_offset): New function.
8006 (Sized_relobj::do_count): Handle IFUNC symbol.
8007 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8008 a bit away from input_shndx_ field. Add set_is_func_symbol and
8009 is_ifunc_symbol functions.
8010 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8011 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8012 local_plt_offsets_ field.
8013 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8014 * output.h (class Output_section_data): Add non-const
8015 output_section function.
8016 (class Output_data_got): Update declarations.
8017 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8018 Add use_plt_offset parameter to global and local constructors.
8019 Change all callers. Change local_sym_index_ field to 31 bits.
8020 Change GSYM_CODE and CONSTANT_CODE accordingly.
8021 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8022 doing a static link don't set sh_link field.
8023 (Output_data_got::Got_entry::write): Use PLT offset if
8025 (Output_data_got::add_global_plt): New function.
8026 (Output_data_got::add_local_plt): New function.
8027 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8028 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8029 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8030 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8031 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8033 * testsuite/ifunc-sel.h: New file.
8034 * testsuite/ifuncmain1.c: New file.
8035 * testsuite/ifuncmain1vis.c: New file.
8036 * testsuite/ifuncmod1.c: New file.
8037 * testsuite/ifuncdep2.c: New file.
8038 * testsuite/ifuncmain2.c: New file.
8039 * testsuite/ifuncmain3.c: New file.
8040 * testsuite/ifuncmod3.c: New file.
8041 * testsuite/ifuncmain4.c: New file.
8042 * testsuite/ifuncmain5.c: New file.
8043 * testsuite/ifuncmod5.c: New file.
8044 * testsuite/ifuncmain6pie.c: New file.
8045 * testsuite/ifuncmod6.c: New file.
8046 * testsuite/ifuncmain7.c: New file.
8047 * configure, testsuite/Makefile.in: Rebuild.
8049 2010-08-18 Ian Lance Taylor <iant@google.com>
8052 (Output_section_incremental_inputs::write_input_files): Add cast
8053 to avoid signed/unsigned comparison warning.
8054 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8056 2010-08-12 Cary Coutant <ccoutant@google.com>
8058 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8060 2010-08-13 Ian Lance Taylor <iant@google.com>
8062 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8064 2010-08-12 Cary Coutant <ccoutant@google.com>
8065 Doug Kwan <dougkwan@google.com>
8067 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8068 defintion overrides non-weak undef, remember that the original undef
8070 * symtab.cc (Symbol_table::sized_write_global): For undef without
8071 an original weak binding, set binding to global in output.
8072 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8073 * testsuite/Makefile.in: Regenerate.
8074 * testsuite/strong_ref_weak_def.sh: New file.
8075 * testsuite/strong_ref_weak_def_1.c: Ditto.
8076 * testsuite/strong_ref_weak_def_2.c: Ditto.
8078 2010-08-12 Cary Coutant <ccoutant@google.com>
8080 * testsuite/incremental_test.sh: Rewrite.
8081 * testsuite/incremental_test_1.c: Rewrite.
8082 * testsuite/incremental_test_2.c: Rewrite.
8084 2010-08-12 Cary Coutant <ccoutant@google.com>
8086 * arm.cc (Target_arm::got_size): Add const.
8087 (Target_arm::got_entry_count): New function.
8088 (Target_arm::plt_entry_count): New function.
8089 (Target_arm::first_plt_entry_offset): New function.
8090 (Target_arm::plt_entry_size): New function.
8091 (Output_data_plt_arm::entry_count): New function.
8092 (Output_data_plt_arm::first_plt_entry_offset): New function.
8093 (Output_data_plt_arm::get_plt_entry_size): New function.
8094 * i386.cc (Target_i386::got_size): Add const.
8095 (Target_i386::got_entry_count): New function.
8096 (Target_i386::plt_entry_count): New function.
8097 (Target_i386::first_plt_entry_offset): New function.
8098 (Target_i386::plt_entry_size): New function.
8099 (Output_data_plt_i386::entry_count): New function.
8100 (Output_data_plt_i386::first_plt_entry_offset): New function.
8101 (Output_data_plt_i386::get_plt_entry_size): New function.
8102 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8103 find_incremental_inputs_sections. Dump incremental_got_plt section.
8104 * incremental.cc: Include target.h.
8105 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8106 parameter. Adjust all callers. Find incremental_got_plt section.
8107 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8109 (Output_section_incremental_inputs::set_final_data_size): Calculate
8110 size of incremental_got_plt section.
8111 (Output_section_incremental_inputs::do_write): Write the
8112 incremental_got_plt section.
8113 (Got_plt_view_info): New struct.
8114 (Local_got_offset_visitor): New class.
8115 (Global_got_offset_visitor): New class.
8116 (Global_symbol_visitor_got_plt): New class.
8117 (Output_section_incremental_inputs::write_got_plt): New function.
8118 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8119 Add parameter. Adjust all callers.
8120 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8121 (Incremental_inputs::got_plt_section): New function.
8122 (Incremental_inputs::got_plt_section_): New data member.
8123 (Incremental_got_plt_reader): New class.
8124 * layout.cc (Layout::create_incremental_info_sections): Add the
8125 incremental_got_plt section.
8126 * object.h (Got_offset_list::get_list): New function.
8127 (Got offset_list::for_all_got_offsets): New function.
8128 (Sized_relobj::local_got_offset_list): New function.
8129 * powerpc.cc (Target_powerpc::got_size): Add const.
8130 (Target_powerpc::got_entry_count): New function.
8131 (Target_powerpc::plt_entry_count): New function.
8132 (Target_powerpc::first_plt_entry_offset): New function.
8133 (Target_powerpc::plt_entry_size): New function.
8134 (Output_data_plt_powerpc::entry_count): New function.
8135 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8136 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8137 * sparc.cc (Target_sparc::got_size): Add const.
8138 (Target_sparc::got_entry_count): New function.
8139 (Target_sparc::plt_entry_count): New function.
8140 (Target_sparc::first_plt_entry_offset): New function.
8141 (Target_sparc::plt_entry_size): New function.
8142 (Output_data_plt_sparc::entry_count): New function.
8143 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8144 (Output_data_plt_sparc::get_plt_entry_size): New function.
8145 * symtab.h (Symbol::got_offset_list): New function.
8146 (Symbol_table::for_all_symbols): New function.
8147 * target.h (Sized_target::got_entry_count): New function.
8148 (Sized_target::plt_entry_count): New function.
8149 (Sized_target::plt_entry_size): New function.
8150 * x86_64.cc (Target_x86_64::got_size): Add const.
8151 (Target_x86_64::got_entry_count): New function.
8152 (Target_x86_64::plt_entry_count): New function.
8153 (Target_x86_64::first_plt_entry_offset): New function.
8154 (Target_x86_64::plt_entry_size): New function.
8155 (Output_data_plt_x86_64::entry_count): New function.
8156 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8157 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8159 2010-08-12 Cary Coutant <ccoutant@google.com>
8161 * archive.cc: Include incremental.h.
8162 (Archive::Archive): Initialize incremental_info_.
8163 (Archive::include_member): Record archive members in incremental info.
8164 (Add_archive_symbols::run): Record begin and end of an archive in
8166 (Lib_group::include_member): Record objects in incremental info.
8167 * archive.h (Incremental_archive_entry): Forward declaration.
8168 (Archive::set_incremental_info): New member function.
8169 (Archive::incremental_info): New member function.
8170 (Archive::Unused_symbol_iterator): New class.
8171 (Archive::unused_symbols_begin): New member function.
8172 (Archive::unused_symbols_end): New member function.
8173 (Archive::incremental_info_): New data member.
8174 * incremental-dump.cc (find_input_containing_global): New function.
8175 (dump_incremental_inputs): Dump new incremental info sections.
8176 * incremental.cc: Include symtab.h.
8177 (Output_section_incremental_inputs): New class.
8178 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8179 new incremental info sections.
8180 (Sized_incremental_binary::do_check_inputs): Likewise.
8181 (Incremental_inputs::report_archive): Remove.
8182 (Incremental_inputs::report_archive_begin): New function.
8183 (Incremental_inputs::report_archive_end): New function.
8184 (Incremental_inputs::report_object): New function.
8185 (Incremental_inputs::finalize_inputs): Remove.
8186 (Incremental_inputs::report_input_section): New function.
8187 (Incremental_inputs::report_script): Rewrite.
8188 (Incremental_inputs::finalize): Do nothing but finalize string table.
8189 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8190 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8191 (Incremental_inputs::create_data_sections): New function.
8192 (Incremental_inputs::relocs_entsize): New function.
8193 (Output_section_incremental_inputs::set_final_data_size): New function.
8194 (Output_section_incremental_inputs::do_write): New function.
8195 (Output_section_incremental_inputs::write_header): New function.
8196 (Output_section_incremental_inputs::write_input_files): New function.
8197 (Output_section_incremental_inputs::write_info_blocks): New function.
8198 (Output_section_incremental_inputs::write_symtab): New function.
8199 * incremental.h (Incremental_script_entry): Forward declaration.
8200 (Incremental_object_entry): Forward declaration.
8201 (Incremental_archive_entry): Forward declaration.
8202 (Incremental_inputs): Forward declaration.
8203 (Incremental_inputs_header_data): Remove.
8204 (Incremental_inputs_header): Remove.
8205 (Incremental_inputs_header_write): Remove.
8206 (Incremental_inputs_entry_data): Remove.
8207 (Incremental_inputs_entry): Remove.
8208 (Incremental_inputs_entry_write): Remove.
8209 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8210 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8211 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8212 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8214 (Incremental_input_entry): New class.
8215 (Incremental_script_entry): New class.
8216 (Incremental_object_entry): New class.
8217 (Incremental_archive_entry): New class.
8218 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8219 (Incremental_inputs::report_inputs): Remove.
8220 (Incremental_inputs::report_archive): Remove.
8221 (Incremental_inputs::report_archive_begin): New function.
8222 (Incremental_inputs::report_archive_end): New function.
8223 (Incremental_inputs::report_object): Change prototype.
8224 (Incremental_inputs::report_input_section): New function.
8225 (Incremental_inputs::report_script): Change prototype.
8226 (Incremental_inputs::get_reloc_count): New function.
8227 (Incremental_inputs::set_reloc_count): New function.
8228 (Incremental_inputs::create_data_sections): New function.
8229 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8230 (Incremental_inputs::inputs_section): New function.
8231 (Incremental_inputs::symtab_section): New function.
8232 (Incremental_inputs::relocs_section): New function.
8233 (Incremental_inputs::get_stringpool): Add const.
8234 (Incremental_inputs::command_line): Add const.
8235 (Incremental_inputs::inputs): Remove.
8236 (Incremental_inputs::command_line_key): New function.
8237 (Incremental_inputs::input_file_count): New function.
8238 (Incremental_inputs::input_files): New function.
8239 (Incremental_inputs::relocs_entsize): New function.
8240 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8241 (Incremental_inputs::finalize_inputs): Remove.
8242 (Incremental_inputs::Input_info): Remove.
8243 (Incremental_inputs::lock_): Remove.
8244 (Incremental_inputs::inputs_): Change type.
8245 (Incremental_inputs::inputs_map_): Remove.
8246 (Incremental_inputs::current_object_entry_): New data member.
8247 (Incremental_inputs::inputs_section_): New data member.
8248 (Incremental_inputs::symtab_section_): New data member.
8249 (Incremental_inputs::relocs_section_): New data member.
8250 (Incremental_inputs::reloc_count_): New data member.
8251 (Incremental_inputs_reader): New class.
8252 (Incremental_symtab_reader): New class.
8253 (Incremental_relocs_reader): New class.
8254 * layout.cc (Layout::finalize): Move finalization of incremental info
8255 and creation of incremental info sections to follow finalization of
8256 symbol table. Set offsets for postprocessing sections.
8257 (Layout::create_incremental_info_sections): Call
8258 Incremental_inputs::create_data_sections. Add incremental symtab
8259 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8260 sections to layout after input sections.
8261 * layout.h (struct Timespec): Forward declaration.
8262 (Layout::incremental_inputs): Add const.
8263 (Layout::create_incremental_info_sections): Add parameter.
8264 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8265 * object.cc: Include incremental.h.
8266 (Relobj::finalize_incremental_relocs): New function.
8267 (Sized_relobj::do_layout): Record input sections in incremental info.
8268 * object.h (Object::output_section): New function.
8269 (Object::output_section_offset): Moved from Relobj.
8270 (Object::get_incremental_reloc_base): New function.
8271 (Object::get_incremental_reloc_count): New function.
8272 (Object::do_output_section): New function.
8273 (Object::do_output_section_offset): Moved from Relobj.
8274 (Object::do_get_incremental_reloc_base): New function.
8275 (Object::do_get_incremental_reloc_count): New function.
8276 (Object::Object): Initialize new data members.
8277 (Relobj::output_section): Renamed do_output_section and moved to
8279 (Relobj::output_section_offset): Moved to Object.
8280 (Relobj::do_get_incremental_reloc_base): New function.
8281 (Relobj::do_get_incremental_reloc_count): New function.
8282 (Relobj::allocate_incremental_reloc_counts): New function.
8283 (Relobj::count_incremental_reloc): New function.
8284 (Relobj::finalize_incremental_relocs): New function.
8285 (Relobj::next_incremental_reloc_index): New function.
8286 (Relobj::reloc_counts_): New data member.
8287 (Relobj::reloc_bases_): New data member.
8288 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8289 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8290 (Sized_relobj::incremental_relocs_scan): New function.
8291 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8292 (Sized_relobj::incremental_relocs_write): New function.
8293 (Sized_relobj::incremental_relocs_write_reltype): New function.
8294 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8296 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8297 archives and object files elsewhere.
8298 (Add_symbols::run): Report object files here.
8299 (Finish_group::run): Report end of archive at end of group.
8300 * reloc.cc: Include layout.h, incremental.h.
8301 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8302 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8303 (Sized_relobj::incremental_relocs_scan): New function.
8304 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8305 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8306 (Sized_relobj::incremental_relocs_write): New function.
8307 (Sized_relobj::incremental_relocs_write_reltype): New function.
8308 * script.cc (read_input_script): Rewrite test for incremental link.
8309 Change call to Incremental_inputs::report_script.
8310 * symtab.h (Symbol_table::first_global_index): New function.
8311 (Symbol_table::output_count): New function.
8313 2010-08-12 Doug Kwan <dougkwan@google.com>
8315 * arm.cc (Target_arm::merge_object_attributes): Check command line
8316 options --no-wchar-size-warning and --no-enum-size-warning.
8317 * options.h (General_options): Add ld-compatible options
8318 --no-enum-size-warning and --no-wchar-size-warning.
8320 2010-08-04 Ian Lance Taylor <iant@google.com>
8322 * x86_64.cc (Target_x86_64::Scan::local): Use
8323 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8324 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8325 (Target_x86_64::Scan::global): Likewise.
8326 (Target_x86_64::Relocate::relocate): Likewise.
8327 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8330 2010-08-03 Cary Coutant <ccoutant@google.com>
8332 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8333 to reserve space in merged_strings vector. Keep total input size
8335 (Output_merge_string::do_print_merge_stats): Print total input size.
8336 * merge.h (Output_merge_string): Add input_size_ field.
8337 * stringpool.cc (Stringpool_template::string_length): Move
8338 implementations out of Stringpool_template class and place in
8340 * stringpool.h (string_length): Move out of Stringpool_template.
8342 2010-08-03 Ian Lance Taylor <iant@google.com>
8345 * layout.cc (relaxation_loop_body): If address of load segment is
8346 set, adjust address to include headers if possible.
8348 2010-08-03 Ian Lance Taylor <iant@google.com>
8350 * version.cc (version_string): Bump to 1.10.
8352 2010-08-03 Ian Lance Taylor <iant@google.com>
8355 * layout.h (enum Output_section_order): Define.
8356 (class Layout): Update declarations.
8357 * layout.cc (Layout::get_output_section): Add order parameter.
8358 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8359 is_first_non_relro parameters. Change all callers.
8360 (Layout::choose_output_section): Likewise.
8361 (Layout::add_output_section_data): Likewise.
8362 (Layout::make_output_section): Likewise. Set order.
8363 (Layout::default_section_order): New function.
8364 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8365 * output.cc (Output_section::Output_section): Initialize order_.
8366 Don't initialize deleted fields.
8367 (Output_segment::Output_segment): Don't initialize deleted
8369 (Output_segment::add_output_section_to_load): New function
8370 replacing add_output_section. Change all callers to call this or
8371 add_output_section_to_nonload.
8372 (Output_segment::add_output_section_to_nonload): New function.
8373 (Output_segment::remove_output_section): Rewrite.
8374 (Output_segment::add_initial_output_data): Likewise.
8375 (Output_segment::has_any_data_sections): Likewise.
8376 (Output_segment::is_first_section_relro): Likewise.
8377 (Output_segment::maximum_alignment): Likewise.
8378 (Output_segment::has_dynamic_reloc): New function replacing
8379 dynamic_reloc_count. Change all callers.
8380 (Output_segment::has_dynamic_reloc_list): New function replacing
8381 dynamic_reloc_count_list. Change all callers.
8382 (Output_segment::set_section_addresses): Rewrite.
8383 (Output_segment::set_offset): Rewrite.
8384 (Output_segment::find_first_and_last_list): Remove.
8385 (Output_segment::set_tls_offsets): Rewrite.
8386 (Output_segment::first_section_load_address): Likewise.
8387 (Output_segment::output_section_count): Likewise.
8388 (Output_segment::section_with_lowest_load_address): Likewise.
8389 (Output_segment::write_section_headers): Likewise.
8390 (Output_segment::print_sections_to_map): Likewise.
8391 * output.h (class Output_data): Remove dynamic_reloc_count_
8392 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8393 (Output_data::add_dynamic_reloc): Rewrite.
8394 (Output_data::has_dynamic_reloc): New function.
8395 (Output_data::dynamic_reloc_count): Remove.
8396 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8397 is_last_relro_, is_first_non_relro_, is_interp_,
8398 is_dynamic_linker_section_ fields. Add order and set_order
8399 functions. Remove is_relro_local, set_is_relro_local,
8400 is_last_relro, set_is_last_relro, is_first_non_relro,
8401 set_is_first_non_relro functions, is_interp, set_is_interp,
8402 is_dynamic_linker_section, and set_is_dynamic_linker_section
8404 (class Output_segment): Change Output_data_list from std::list to
8405 std:;vector. Add output_lists_ field. Remove output_data_ and
8406 output_bss_ fields. Update declarations.
8408 2010-08-02 Ian Lance Taylor <iant@google.com>
8410 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8411 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8412 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8414 2010-08-02 Ian Lance Taylor <iant@google.com>
8417 * script.cc (Script_options::Script_options): Initialize
8418 symbol_definitions_ and symbol_references_.
8419 (Script_options::add_symbol_assignment): Update
8420 symbol_definitions_ and symbol_references_.
8421 (Script_options::add_symbol_reference): New function.
8422 (script_symbol): New function.
8423 * script.h (class Script_options): Add symbol_definitions_ and
8424 symbol_references_ fields.
8425 (Script_options::referenced_const_iterator): New type.
8426 (Script_options::referenced_begin): New function.
8427 (Script_options::referenced_end): New function.
8428 (Script_options::is_referenced): New function.
8429 (Script_options::any_unreferenced): New function.
8430 * script-c.h (script_symbol): Declare.
8431 * yyscript.y (exp): Call script_symbol.
8432 * symtab.cc: Include "script.h".
8433 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8434 Change all callers. Check symbols referenced by scripts.
8435 (Symbol_table::add_undefined_symbols_from_command_line): Add
8436 layout parameter. Change all callers.
8437 (Symbol_table::do_add_undefined_symbols_from_command_line):
8438 Likewise. Break out loop body. Check symbols referenced by
8440 (Symbol_table::add_undefined_symbol_from_command_line): New
8441 function broken out of
8442 do_add_undefined_symbols_from_command_line.
8443 * symtab.h (class Symbol_table): Update declarations.
8444 * archive.cc: Include "layout.h".
8445 (Archive::should_include_member): Add layout parameter. Change
8446 all callers. Check for symbol mentioned in expression.
8447 * archive.h (class Archive): Update declaration.
8448 * object.cc (Sized_relobj::do_should_include_member): Add layout
8450 * object.h (Object::should_include_member): Add layout parameter.
8452 (Object::do_should_include_member): Add layout parameter.
8453 (class Sized_relobj): Update declaration.
8454 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8456 * dynobj.h (class Sized_dynobj): Update declaration.
8457 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8459 * plugin.h (class Sized_pluginobj): Update declaration.
8461 2010-08-02 Ian Lance Taylor <iant@google.com>
8464 * output.cc (Output_segment::set_offset): Search for the first and
8465 last sections rather than assuming that the list is in order.
8466 (Output_segment::find_first_and_last_list): New function.
8467 * output.h (class Output_segment): Update declarations.
8468 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8469 (relro_strip_test_SOURCES): New variable.
8470 (relro_strip_test_DEPENDENCIES): New variable.
8471 (relro_strip_test_LDFLAGS): New variable.
8472 (relro_strip_test_LDADD): New variable.
8473 (relro_strip_test.so): New target.
8475 2010-08-02 Ian Lance Taylor <iant@google.com>
8477 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8478 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8479 (Target_i386::got_tlsdesc_section): New function.
8480 (Target_i386::got_section): Create space for GOT entries for
8481 TLSDESC relocations.
8482 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8484 (Target_i386::Scan::global): Likewise.
8485 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8487 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8488 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8489 (Target_x86_64::got_tlsdesc_section): New function.
8490 (Target_x86_64::got_section): Create space for GOT entries for
8491 TLSDESC relocations.
8492 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8494 (Target_x86_64::Scan::global): Likewise.
8495 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8498 2010-08-02 Ian Lance Taylor <iant@google.com>
8500 * testsuite/final_layout.sh: Use dc to convert from hex to
8503 2010-07-29 Sriraman Tallam <tmsriram@google.com>
8505 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8506 paramter to the call to gold::gc_process_relocs.
8507 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8508 paramter to the call to gold::gc_process_relocs.
8509 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8510 parameter to the call to gold::gc_process_relocs.
8511 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8512 template parameter to the call to gold::gc_process_relocs.
8513 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8514 paramter to the call to gold::gc_process_relocs.
8515 * gc.h (get_embedded_addend_size): New function.
8516 (gc_process_relocs): Save the size of the reloc for use by ICF.
8517 * icf.cc (get_section_contents): Get the addend from the text section
8518 for SHT_REL relocation sections.
8519 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8520 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8521 * int_encoding.h (read_from_pointer): New overloaded function.
8522 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8523 * testsuite/icf_sht_rel_addend_test.sh: New file.
8524 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8525 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8527 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8529 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8530 * Makefile.in: Regenerate.
8531 * testsuite/Makefile.in: Regenerate.
8533 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8535 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8536 * gold/testsuite/debug_msg.cc: Likewise.
8537 * gold/testsuite/odr_violation1.cc
8538 * gold/testsuite/odr_violation2.cc
8540 2010-07-21 Cary Coutant <ccoutant@google.com>
8542 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8543 string, and length fields.
8544 (Output_merge_string::Merged_strings_list): New type.
8545 (Output_merge_string::Merged_strings_lists): New typedef.
8546 (Output_merge_string): Replace merged_strings_ with
8547 merged_strings_lists_.
8548 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8549 Merged_strings_list per input object and section. Don't store pointer
8550 to the string. Don't store length with each merged string entry.
8551 (Output_merge_string::finalize_merged_data): Loop over list of merged
8552 strings lists. Recompute length of each merged string.
8554 2010-07-15 Cary Coutant <ccoutant@google.com>
8556 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8559 2010-07-14 Ian Lance Taylor <iant@google.com>
8561 * descriptors.cc (Descriptors::open): Report correct name in error
8564 2010-07-13 Doug Kwan <dougkwan@google.com>
8566 * arm.cc (Arm_input_section::Arm_input_section): For a
8567 SHT_ARM_EXIDX section, always keeps the input sections.
8568 (Arm_input_section::set_exidx_section_link): New method.
8569 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8570 has_errors_ to false.
8571 (Arm_exidx_input_section::has_errors,
8572 Arm_exidx_input_section::set_has_errors): New methods.
8573 (Arm_exidx_input_section::has_errors_): New data member.
8574 (Arm_relobj::get_exidx_shndx_list): New method.
8575 (Arm_output_section::append_text_sections_to_list): Do not skip
8576 section without SHF_EXECINSTR.
8577 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8579 (Arm_relobj::make_exidx_input_section): Add new parameter for text
8580 section header. Make error messages more verbose. Check for
8581 a non-executable section linked to an EXIDX section.
8582 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8583 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8584 check that there is no deferred EXIDX section if we exit early.
8585 Instead of not making an EXIDX section in case of an error, make one
8586 and set the has_errors flag of it.
8587 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8588 in a relocatable link.
8589 (Target_arm::do_relax): Look for the EXIDX output section instead of
8590 assuming that it is called .ARM.exidx.
8591 (Target_arm::fix_exidx_coverage): Add a new parameter for input
8592 section list. Do not check for SHF_EXECINSTR section flags but
8593 skip any input section with errors.
8594 * output.cc (Output_section::Output_section): Initialize
8595 always_keeps_input_sections_ to false.
8596 (Output_section::add_input_section): Check for
8597 always_keeps_input_sections_.
8598 * output.h (Output_section::always_keeps_input_sections,
8599 Output_section::set_always_keeps_input_sections): New methods.
8600 (Output_section::always_keeps_input_sections): New data member.
8602 2010-07-13 Rafael Espindola <espindola@google.com>
8604 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8605 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8607 2010-07-13 Philip Herron <herron.philip@googlemail.com>
8608 Ian Lance Taylor <iant@google.com>
8610 * output.h (Output_section_lookup_maps::add_merge_section):
8611 Correct check of whether value was inserted.
8612 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8613 (Output_section_lookup_maps::add_relaxed_input_section):
8615 * arm.cc (Target_arm::got_section): Remove used local os.
8616 * i386.cc (Target_i386::got_section): Likewise.
8617 * x86_64.cc (Target_x86_64::got_section): Likewise.
8618 * sparc.cc (Target_sparc::got_section): Likewise.
8619 (Target_sparc::relocate): Remove unused local have_got_offset.
8620 * powerpc.cc (Target_powerpc::relocate): Likewise.
8622 2010-07-13 Ian Lance Taylor <iant@google.com>
8624 * compressed_output.cc (zlib_decompress): Fix signature in
8627 * archive.cc (Archive::include_member): Unlock an external member
8628 of a thin archive. Don't bother to delete an object we know is
8631 2010-07-12 Cary Coutant <ccoutant@google.com>
8633 * compressed_output.cc (zlib_decompress): New function.
8634 (get_uncompressed_size): New function.
8635 (decompress_input_section): New function.
8636 * compressed_output.h (get_uncompressed_size): New function.
8637 (decompress_input_section): New function.
8638 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8639 Handle compressed debug sections.
8640 * layout.cc (is_compressed_debug_section): New function.
8641 (Layout::output_section_name): Map compressed section names to
8643 * layout.h (is_compressed_debug_section): New function.
8644 (is_debug_info_section): Recognize compressed debug sections.
8645 * merge.cc: Include compressed_output.h.
8646 (Output_merge_data::do_add_input_section): Handle compressed
8648 (Output_merge_string::do_add_input_section): Handle compressed
8650 * object.cc: Include compressed_output.h.
8651 (Sized_relobj::Sized_relobj): Initialize new data members.
8652 (build_compressed_section_map): New function.
8653 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8654 * object.h (Object::section_is_compressed): New method.
8655 (Object::do_section_is_compressed): New method.
8656 (Sized_relobj::Compressed_section_map): New type.
8657 (Sized_relobj::do_section_is_compressed): New method.
8658 (Sized_relobj::compressed_sections_): New data member.
8659 * output.cc (Output_section::add_input_section): Handle compressed
8661 * reloc.cc: Include compressed_output.h.
8662 (Sized_relobj::write_sections): Handle compressed debug sections.
8664 2010-07-08 Cary Coutant <ccoutant@google.com>
8666 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8667 weak when resolving to a dynamic def.
8668 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8669 for weak undef/dynamic def cases. Adjust callers.
8670 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8671 undef_binding_weak_.
8672 (Symbol_table::sized_write_globals): Adjust symbol binding.
8673 (Symbol_table::sized_write_symbol): Add binding parameter.
8674 * symtab.h (Symbol::set_undef_binding): New method.
8675 (Symbol::is_undef_binding_weak): New method.
8676 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8677 (Symbol_table::should_override): Add new parameter.
8678 (Symbol_table::sized_write_symbol): Add new parameter.
8680 * testsuite/weak_undef_file1.cc: Add new test case.
8681 * testsuite/weak_undef_file2.cc: Fix header comment.
8682 * testsuite/weak_undef_test.cc: Add new test case.
8684 2010-06-29 Doug Kwan <dougkwan@google.com>
8686 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8687 Initialize USE_SYMBOL_.
8688 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8690 (Arm_reloc_property::uses_symbol_): New data member declaration.
8691 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8692 uses symbol value and symbol is undefined but not weakly undefined.
8694 2010-06-28 Rafael Espindola <espindola@google.com>
8696 * plugin.cc (Plugin::load): Use dlerror.
8698 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8700 * symtab.cc (detect_odr_violations): When reporting an ODR
8701 violation, report an object where the symbol is defined.
8703 2010-06-25 Doug Kwan <dougkwan@google.com>
8705 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8706 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8708 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8709 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8710 target hook to detect function points.
8711 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8712 * icf.h (Icf::check_section_for_function_pointers): Change type of
8713 parameter SECTION_NAME to const reference to std::string. Use
8714 target hook to determine if section may have unsafe pointers.
8715 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8718 2010-06-21 Rafael Espindola <espindola@google.com>
8720 * fileread.cc (Input_file::find_fie): New
8721 (Input_file::open): Use Input_file::find_fie.
8722 * fileread.h (Input_file::find_fie): New
8723 * plugin.cc (set_extra_library_path): New.
8724 (Plugin::load): Add set_extra_library_path to the transfer vector.
8725 (Plugin_manager::set_extra_library_path): New.
8726 (Plugin_manager::add_input_file): Use the extra search path if set.
8727 (set_extra_library_path(): New.
8728 * plugin.h (Plugin_manager): Add set_extra_library_path and
8731 2010-06-19 Cary Coutant <ccoutant@google.com>
8733 * layout.cc (gdb_sections): Add .debug_types.
8734 (lines_only_debug_sections): Likewise.
8736 2010-06-18 Rafael Espindola <espindola@google.com>
8738 * plugin.cc (add_input_file,add_input_library)
8739 (Plugin_manager::add_input_file): Make filename arguments const.
8740 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8743 2010-06-16 Doug Kwan <dougkwan@google.com>
8745 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8746 .ARM.attributes section if we have not merged any input
8747 attributes sections.
8749 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8751 * arm.cc: Allow combining objects with no EABI version
8754 2010-06-15 Rafael Espindola <espindola@google.com>
8756 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8758 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8760 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8761 (struct iovec): Correct !HAVE_READV definition.
8763 2010-06-10 Cary Coutant <ccoutant@google.com>
8765 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8766 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8768 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8771 * symtab.h (Symbol::is_placeholder): New member function.
8772 * target-reloc.h (relocate_section): Check for placeholder symbols.
8774 * testsuite/Makefile.am (plugin_test_8): New test.
8775 (plugin_test_9): New test.
8776 * testsuite/Makefile.in: Regenerate.
8778 2010-06-09 Nick Clifton <nickc@redhat.com>
8780 * yyscript.y (input_list_element): Allow strings prefixed with
8781 the '-' character. Treat these as libraries.
8782 * script.cc (script_add_library): New function. Adds a library
8783 specified by "-l<name>" found in an input script.
8784 * script-c.h: Add prototype for script_add_library.
8786 2010-06-07 Doug Kwan <dougkwan@google.com>
8788 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8789 Restrict stub-group size to be within long conditional branch
8790 range when working around cortex-A8 erratum.
8792 2010-06-07 Damien Diederen <dd@crosstwine.com>
8794 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8797 2010-06-03 Sriraman Tallam <tmsriram@google.com>
8801 (Output_section::Input_section_sort_entry::compare_section_ordering):
8802 Change to return non-zero correctly.
8803 (Output_section::Input_section_sort_section_order_index_compare
8804 ::operator()): Change to fix ambiguity in comparisons.
8806 2010-06-01 Sriraman Tallam <tmsriram@google.com>
8808 * gold.h (is_wildcard_string): New function.
8809 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8810 (Layout::layout_eh_frame): Ditto.
8811 (Layout::find_section_order_index): New method.
8812 (Layout::read_layout_from_file): New method.
8813 * layout.h (Layout::find_section_order_index): New method.
8814 (Layout::read_layout_from_file): New method.
8815 (Layout::input_section_position_): New private member.
8816 (Layout::input_section_glob_): New private member.
8817 * main.cc (main): Call read_layout_from_file here.
8818 * options.h (--section-ordering-file): New option.
8819 * output.cc (Output_section::input_section_order_specified_): New
8821 (Output_section::Output_section): Initialize new member.
8822 (Output_section::add_input_section): Add new parameter.
8823 Keep input sections when --section-ordering-file is used.
8824 (Output_section::set_final_data_size): Sort input sections when
8825 section ordering file is specified.
8826 (Output_section::Input_section_sort_entry): Add new parameter.
8828 (Output_section::Input_section_sort_entry::compare_section_ordering):
8830 (Output_section::Input_section_sort_compare::operator()): Change to
8831 consider section_order_index.
8832 (Output_section::Input_section_sort_init_fini_compare::operator()):
8833 Change to consider section_order_index.
8834 (Output_section::Input_section_sort_section_order_index_compare
8835 ::operator()): New method.
8836 (Output_section::sort_attached_input_sections): Change to sort
8837 according to section order when specified.
8838 (Output_section::add_input_section<32, true>): Add new parameter.
8839 (Output_section::add_input_section<64, true>): Add new parameter.
8840 (Output_section::add_input_section<32, false>): Add new parameter.
8841 (Output_section::add_input_section<64, false>): Add new parameter.
8842 * output.h (Output_section::add_input_section): Add new parameter.
8843 (Output_section::input_section_order_specified): New
8845 (Output_section::set_input_section_order_specified): New method.
8846 (Input_section::Input_section): Initialize section_order_index_.
8847 (Input_section::section_order_index): New method.
8848 (Input_section::set_section_order_index): New method.
8849 (Input_section::section_order_index_): New member.
8850 (Input_section::Input_section_sort_section_order_index_compare): New
8852 (Output_section::input_section_order_specified_): New member.
8853 * script-sections.cc (is_wildcard_string): Delete and move modified
8855 (Output_section_element_input::Output_section_element_input): Modify
8856 call to is_wildcard_string.
8857 (Output_section_element_input::Input_section_pattern
8858 ::Input_section_pattern): Ditto.
8859 (Output_section_element_input::Output_section_element_input): Ditto.
8860 * testsuite/Makefile.am (final_layout): New test case.
8861 * testsuite/Makefile.in: Regenerate.
8862 * testsuite/final_layout.cc: New file.
8863 * testsuite/final_layout.sh: New file.
8865 2010-06-01 Rafael Espindola <espindola@google.com>
8867 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8869 2010-06-01 Rafael Espindola <espindola@google.com>
8871 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8872 visibility of symbols.
8874 2010-05-27 Doug Kwan <dougkwan@google.com>
8876 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8877 from start of output section instead of address for a local symbol
8878 in a merged or relaxed section when doing a relocatable link.
8880 2010-05-26 Rafael Espindola <espindola@google.com>
8883 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8884 adding sections the garbage collector removed.
8885 * gold/testsuite/Makefile.am: Add test.
8886 * gold/testsuite/Makefile.in: Regenerate.
8887 * gold/testsuite/plugin_test_7.sh: New.
8888 * gold/testsuite/plugin_test_7_1.c: New.
8889 * gold/testsuite/plugin_test_7_2.c: New.
8891 2010-05-26 Rafael Espindola <espindola@google.com>
8893 * script-sections.cc (Output_section_definition::set_section_addresses):
8894 Check for --section-start.
8896 2010-05-26 Doug Kwan <dougkwan@google.com>
8898 * arm.cc (Arm_scan_relocatable_relocs): New class.
8899 (Target_arm::relocate_special_relocatable): New method.
8900 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8901 (Arm_relocate_functions::thumb_branch_common): Same.
8902 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8903 instead of Default_scan_relocatable_relocs.
8904 * target-reloc.h (relocate_for_relocatable): Let target handle
8905 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8906 * target.h (Sized_target::relocate_special_relocatable): New method.
8908 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8910 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8912 2010-05-23 Doug Kwan <dougkwan@google.com>
8914 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8916 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8917 with a direct branch, not a conditional branch, to a stub.
8918 * merge.cc (Output_merge_base::record_input_section): New method
8920 (Output_merge_data::do_add_input_section): Record input section if
8921 keeps-input-sections flag is set.
8922 (Output_merge_string::do_add_input_section): Ditto.
8923 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8924 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8926 (Output_merge_base::keeps_input_sections,
8927 Output_merge_base::set_keeps_input_sections,
8928 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8930 (Output_merge_base::Input_sections): New type declaration.
8931 (Output_merge_base::input_sections_begin,
8932 Output_merge_base::input_sections_end,
8933 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8934 (Output_merge_base::bool keeps_input_sections_,
8935 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8936 Output_merge_base::input_sections_): New data members.
8937 (Output_merge_data::do_set_keeps_input_sections): New method
8939 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8940 * output.cc (Output_section::Input_section::relobj): Move method
8941 defintion from class declaration to here and handle merge sections.
8942 (Output_section::Input_section::shndx): Ditto.
8943 (Output_section::Output_section): Remove initializations of removed
8944 data members and initialize new data member LOOKUP_MAPS_.
8945 (Output_section::add_input_section): Set keeps-input-sections flag
8946 for a newly created merge output section as appropriate. Adjust code
8947 to use Output_section_lookup_maps class.
8948 (Output_section::add_relaxed_input_section): Adjst code for lookup
8949 maps code refactoring.
8950 (Output_section::add_merge_input_section): Add a new parameter
8951 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8952 class. If adding input section to a newly created merge output
8953 section fails, remove the new merge section.
8954 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
8955 Adjust code for use of the Output_section_lookup_maps class.
8956 (Output_section::find_merge_section): Ditto.
8957 (Output_section::build_lookup_maps): New method defintion.
8958 (Output_section::find_relaxed_input_section): Adjust code to use
8959 Output_section_lookup_maps class.
8960 (Output_section::get_input_sections): Export merge sections. Adjust
8961 code to use Output_section_lookup_maps class.
8962 (Output_section:::add_script_input_section): Adjust code to use
8963 Output_section_lookup_maps class. Update lookup maps for merge
8965 (Output_section::discard_states): Use Output_section_lookup_maps.
8966 (Output_section::restore_states): Same.
8967 * output.h (Merge_section_properties): Move class defintion out of
8969 (Output_section_lookup_maps): New class.
8970 (Output_section::Input_section::is_merge_section): New method
8972 (Output_section::Input_section::relobj): Move defintion out of class
8973 defintion. Declare method only.
8974 (Output_section::Input_section::shndx): Ditto.
8975 (Output_section::Input_section::output_merge_base): New method defintion.
8976 (Output_section::Input_section::u2_.pomb): New union field.
8977 (Output_section::Merge_section_by_properties_map,
8978 Output_section::Output_section_data_by_input_section_map,
8979 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8981 (Output_section::add_merge_input_section): Add new parameter
8982 KEEPS_INPUT_SECTIONS.
8983 (Output_section::build_lookup_maps): New method declaration.
8984 (Output_section::merge_section_map_,
8985 Output_section::merge_section_by_properties_map_,
8986 Output_section::relaxed_input_section_map_,
8987 Output_section::is_relaxed_input_section_map_valid_): Remove data
8989 (Output_section::lookup_maps_): New data member.
8991 2010-05-21 Doug Kwan <dougkwan@google.com>
8994 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8995 avoid a compilation error.
8997 2010-05-19 Rafael Espindola <espindola@google.com>
8999 * script-sections.cc (Output_section_definition::allocate_to_segment):
9000 Update the phdrs_list even when the output section is NULL.
9001 * testsuite/Makefile.am: Add test.
9002 * testsuite/Makefile.in: Regenerate.
9003 * testsuite/script_test_9.cc: New.
9004 * testsuite/script_test_9.sh: New.
9005 * testsuite/script_test_9.t: New.
9007 2010-05-19 Doug Kwan <dougkwan@google.com>
9009 * arm.cc (Arm_input_section::original_size): New method.
9010 (Arm_input_section::do_addralign): Add a cast.
9011 (Arm_input_section::do_output_offset): Remove static cast.
9012 (Arm_input_section::original_addralign,
9013 Arm_input_section::original_size_): Change type to uint32_t.
9014 (Arm_input_section::init): Add safe casts for section alignment
9016 (Arm_input_section::set_final_data_size): Do not set address and
9017 offset of stub table.
9018 (Arm_output_section::fix_exidx_coverage): Change use of of
9019 Output_section::Simple_input_section to that of
9020 Output_section::Input_section.
9021 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9022 except for the first pass.
9023 * output.cc (Output_section::get_input_sections): Change type of
9024 input_sections to std::list<Input_section>.
9025 (Output_section::add_script_input_section): Rename from
9026 Output_section::add_simple_input_section. Change type of SIS
9027 parameter from Simple_input_section to Input_section.
9028 * output.h (Output_section::Simple_input_section): Remove class.
9029 (Output_section::Input_section): Change class visibility to public.
9030 (Output_section::Input_section::addralign): Use stored alignments
9031 for special input sections if set.
9032 (Output_section::Input_section::set_addralign): New method.
9033 (Output_section::get_input_sections): Change parameter type from
9034 list of Simple_input_section to list of Input_section.
9035 (Output_section::add_script_input_section): Rename from
9036 Output_section::add_simple_input_section. Change first parameter's
9037 type from Simple_input_section to Input_section and remove the
9038 second and third parameters.
9039 * script-sections.cc (Input_section::Input_section_list): Change
9040 type to list of Output_section::Input_section/
9041 (Input_section_info::Input_section_info): Change parameter type of
9042 INPUT_SECTION to Output_section::Input_section.
9043 (Input_section_info::input_section): Change return type.
9044 (Input_section_info::input_section_): Change type to
9045 Output_section::Input_section.
9046 (Output_section_element_input::set_section_addresses): Adjust code
9047 to use Output_section::Input_section instead of
9048 Output_section::Simple_input_section. Adjust code for renaming
9049 of Output_section::add_simple_input_section.
9050 (Orphan_output_section::set_section_addresses): Ditto.
9052 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9054 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9055 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9057 2010-05-18 Rafael Espindola <espindola@google.com>
9059 * options.cc (General_options::finalize): Handle -nostdlib.
9060 * options.h (nostdlib): New option.
9061 * script.cc (script_add_search_dir): Handle -nostdlib.
9063 2010-05-12 Doug Kwan <dougkwan@google.com>
9065 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9066 attributes section only if there no attributes section after merging.
9067 (Target_arm::merge_object_attributes): Move value of
9068 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
9069 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9070 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9071 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9072 and arm_attr_merge_7.stdout.
9073 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9074 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9075 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9076 arm_attr_merge_7b.o): New rules.
9077 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9079 * testsuite/Makefile.in: Regenerate.
9080 * testsuite/arm_attr_merge.sh: New file.
9081 * testsuite/arm_attr_merge_[67][ab].s: Same.
9083 2010-05-05 Nick Clifton <nickc@redhat.com>
9085 * po/es.po: Updated Spanish translation.
9087 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9089 * Makefile.am (install-exec-local): Properly install gold as
9090 default cross linker.
9091 * Makefile.in: Regenerated.
9093 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9094 Nick Clifton <nickc@redhat.com>
9096 * configure.ac (install_as_default): Define and set to false
9097 unless --enable-gold or --enable-gold=both/gold has been
9099 * configure: Regenerate.
9101 * Makefile.am (install-exec-local): Install the executable as
9102 'ld.gold'. If install_as_default is true then also install it as
9104 * Makefile.in: Regenerated.
9106 2010-04-24 Ian Lance Taylor <iant@google.com>
9108 * layout.cc (Layout::layout_reloc): In relocatable link don't
9109 combine reloc sections for grouped sections.
9111 2010-04-23 Sriraman Tallam <tmsriram@google.com>
9113 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9114 sections that are not ordinary to icf.
9115 * icf.cc (get_section_contents): Handle relocation pointing to section
9116 with no object or shndx information.
9117 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9118 * testsuite/Makefile.in: Regenerate.
9119 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9120 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9122 2010-04-22 Ian Lance Taylor <iant@google.com>
9124 * expression.cc (Expression::Expression_eval_info): Add
9125 result_alignment_pointer field.
9126 (Expression::eval_with_dot): Add result_alignment_pointer
9127 parameter. Change all callers.
9128 (Expression::eval_maybe_dot): Likewise.
9129 (class Binary_expression): Add alignment_pointer parameter to
9130 left_value and right_value. Change all callers.
9131 (BINARY_EXPRESSION): Set result alignment.
9132 (class Trinary_expression): Add alignment_pointer parameter to
9133 arg2_value and arg3_value. Change all callers.
9134 (Trinary_cond::value): Set result alignment.
9135 (Max_expression::value, Min_expression::value): Likewise.
9136 (Align_expression::value): Likewise.
9137 * script-sections.cc (class Sections_element): Add dot_alignment
9138 parameter to set_section_addresses virtual function. Update
9140 (class Output_section_element): Likewise.
9141 (Script_sections::create_segments): Add dot_alignment parameter.
9143 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9144 (Script_sections::set_phdrs_clause_addresses): Likewise.
9145 * script-sections.h: Update declarations.
9146 * script.h: Update declarations.
9147 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9149 * testsuite/script_test_3.t: Set large alignment.
9150 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9151 segment has expected alignment.
9153 2010-04-22 Nick Clifton <nickc@redhat.com>
9155 * po/gold.pot: Updated by the Translation project.
9156 * po/vi.po: Updated Vietnamese translation.
9158 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9160 * testsuite/Makefile.am (check_PROGRAMS): Add
9161 icf_virtual_function_folding_test.
9162 * testsuite/Makefile.in: Regenerated.
9164 2010-04-15 Andrew Haley <aph@redhat.com>
9166 * options.h (merge_exidx_entries): New option.
9167 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9168 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9169 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9170 (Target_arm::merge_exidx_entries): New function.
9171 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9172 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9173 to Arm_exidx_fixup constructor.
9174 Add new arg, merge_exidx_entries.
9175 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9176 Arm_output_section::fix_exidx_coverage.
9178 2010-04-18 Sriraman Tallam <tmsriram@google.com>
9180 * icf.cc (get_section_contents): Check for preemptible functions.
9181 Ignore addend when appropriate.
9182 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9184 (add_from_relobj): Check for section folded.
9185 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9186 * symtab.h (should_add_dynsym_entry): Add new parameter.
9187 * target-reloc.h (scan_relocs): Check for section folded.
9188 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9189 Check reloc types for function pointers in shared objects.
9190 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9192 (icf_preemptible_functions_test): New test case.
9193 (icf_string_merge_test): New test case.
9194 * testsuite.Makefile.in: Regenerate.
9195 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9196 bar_glob. Refactor code.
9197 * testsuite/icf_preemptible_functions_test.cc: New file.
9198 * testsuite/icf_preemptible_functions_test.sh: New file.
9199 * testsuite/icf_string_merge_test.cc: New file.
9200 * testsuite/icf_string_merge_test.sh: New file.
9201 * testsuite/icf_virtual_function_folding_test.cc: New file.
9202 * testsuite/icf_virtual_function_folding_test.sh: New file.
9204 2010-04-14 Doug Kwan <dougkwan@google.com>
9206 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9207 for local symbol recounting if we remove a section due to ICF.
9208 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9209 there are no regular objects in input.
9211 2010-04-13 Doug Kwan <dougkwan@google.com>
9213 * arm.cc (Arm_input_section::set_final_data_size): Compute
9214 accurate final data size instead of using current data size.
9216 2010-04-09 Doug Kwan <dougkwan@google.com>
9218 * layout.cc (Layout::choose_output_section): Handle script section
9220 (Layout::make_output_section_for_script): Add section type parameter.
9221 Handle script section types.
9222 * layout.h (Layout::make_output_section_for_script): Add section
9224 * output.cc (Output_section::Output_section): Initialize data member
9226 (Output_section::do_reset_address_and_file_offset): Do not set address
9227 to 0 if section is a NOLOAD section.
9228 * output.h (Output_section::is_noload): New method.
9229 (Output_section::set_is_noload): Ditto.
9230 (Output_section::is_noload_): New data member.
9231 * script-c.h (Script_section_type): New enum type.
9232 (struct Parser_output_section_header): Add new file section_type.
9233 * script-sections.cc (Sections_element::output_section_name): Add
9234 parameter for returning script section type.
9235 (Output_section_definition::output_section_name): Ditto.
9236 (Output_section_definition::section_type)P; New method.
9237 (Output_section_definiton::script_section_type_name): Ditto.
9238 (Output_section_definition::script_section_type_): New data member.
9239 (Output_section_definition::Output_section_definition): Initialize
9240 data member Output_section_definition::script_section_type_.
9241 (Output_section_definition::create_sections): Pass script section type
9242 to Layout::make_output_section_for_script.
9243 (Output_section_definition::output_section_name): Return script
9244 section type to caller.
9245 (Output_section_definition::set_section_address): Do not advance
9246 dot value and load address if section type is NOLOAD. Set address
9247 of NOLOAD sections regardless of section flags.
9248 (Output_section_definition::print): Print section type if it is
9249 not SCRIPT_SECTION_TYPE_NONE.
9250 (Output_section_definition::section_type): New method.
9251 (Output_section_definition::script_section_type_name): Ditto.
9252 (Script_sections::output_section_name): Add new parameter
9253 PSECTION_TYPE for returning script section type. Pass it to
9254 section elements. Handle discard sections.
9255 (Sort_output_sections::operator()): Handle NOLOAD sections.
9256 * script-sections.h (Script_sections::Section_type): New enum type.
9257 (Script_sections::output_section_name): Add a new parameter for
9258 returning script section type.
9259 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9261 * yyscript.y (union): Add new field SECTION_TYPE.
9262 (COPY, DSECT, INFO, NOLOAD): New tokens.
9263 (opt_address_and_section_type): Change type to output_section_header.
9264 (section_type): New non-terminal
9265 (section_header): Handle section type.
9266 (opt_address_and_section_type): Return section type value.
9268 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9270 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9271 * testsuite/plugin_common_test_2.c (foo): Likewise.
9273 2010-04-08 Doug Kwan <dougkwan@google.com>
9275 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9277 * output.cc (Output_section::add_merge_input_section): Simplify
9278 code and return status of Output_merge_base::add_input_section.
9279 Update merge section map only if Output_merge_base::add_input_section
9282 2010-04-07 Doug Kwan <dougkwan@google.com>
9284 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9285 if section is marked as containing instructions but has no mapping
9287 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9288 correct section index.
9289 (Arm_relobj::find_linked_text_section): Ditto.
9291 2010-04-07 Cary Coutant <ccoutant@google.com>
9293 * archive.cc (include_member): Destroy Read_symbols_data object before
9295 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9296 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9297 (Read_symbols_data::~Read_symbols_data) New destructor.
9298 (Section_relocs::Section_relocs) New constructor.
9299 (Section_relocs::~Section_relocs) New destructor.
9300 (Read_relocs_data::Read_relocs_data) New constructor.
9301 (Read_relocs_data::~Read_relocs_data) New destructor.
9302 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9303 pointers to NULL after deleting.
9305 2010-04-07 Doug Kwan <dougkwan@google.com>
9307 * arm.cc: Replace "endianity" with "endianness" in comments.
9308 (Arm_exidx_cantunwind): Ditto.
9309 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9310 (Arm_relobj::merge_flags_and_attributes): New method.
9311 (Arm_relobj::merge_flags_and_attributes_): New data member.
9312 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9313 (Arm_relobj::scan_sections_for_stubs): Ditto.
9314 (Arm_relobj::do_read_symbols): Check to see if we really want to
9315 merge processor-specific flags and attributes. Exit early if
9316 an object is empty except for section names and the undefined symbol.
9317 (Target_arm::do_finalize_sections): Move check for ELF format to
9318 Arm_relobj::do_read_symbols. Merge processor specific flags and
9319 attributes from a regular object only when we have determined that
9320 it is aapropriate. Do not create an .ARM.attributes section in
9321 output if there is no regular input object.
9322 (Target_arm::merge_processor_specific_flags): Check
9323 --warn-mismatch before printing any error.
9324 (Target_arm::merge_object_attributes): Ditto.
9325 * gold.cc (queue_middle_tasks): Handle the case in which there is
9326 no regular object in input.
9327 * options.cc (General_options::parse_EB): New method.
9328 (General_options::parse_EL): Same.
9329 (General_options::General_options): Initialize endianness_.
9330 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9332 (General_options::Endianness): New enum.
9333 (General_options::endianness): New method.
9334 (General_options::endianness_): New data member.
9335 * parameters.cc (Parameters::set_options): Check target endianness.
9336 (Parameters::set_target_once): Ditto.
9337 (Parameters::check_target_endianness): New method.
9338 (parameters_force_valid_target): If either -EL or -EB is specified,
9339 use it to define endianness of default target.
9340 * parameters.h (Parameters::check_target_endianness): New method
9342 * target.h (class Target): Change "endianity" to "endianness"
9345 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9347 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9348 * configure: Regenerate.
9349 * Makefile.in: Regenerate.
9350 * testsuite/Makefile.in: Regenerate.
9352 2010-04-06 Cary Coutant <ccoutant@google.com>
9355 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9356 prevailing definitions of common symbols.
9357 * testsuite/plugin_test_6.sh: New test case.
9358 * testsuite/plugin_common_test_1.c: New test case.
9359 * testsuite/plugin_common_test_2.c: New test case.
9360 * testsuite/Makefile.am (plugin_test_6): New test case.
9361 * testsuite/Makefile.in: Regenerate.
9363 2010-04-06 Nick Clifton <nickc@redhat.com>
9365 * po/vi.po: New Vietnamese translation.
9367 2010-03-30 Doug Kwan <dougkwan@google.com>
9369 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9371 2010-03-25 Doug Kwan <dougkwan@google.com>
9373 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9374 to avoid a conversion warning on a 32-bit host.
9376 2010-03-24 Ian Lance Taylor <iant@google.com>
9378 * testsuite/script_test_3.t: Add a TLS segment.
9379 * testsuite/Makefile.am (check_PROGRAMS): Add
9380 tls_phdrs_script_test.
9381 (tls_phdrs_script_test_SOURCES): Define.
9382 (tls_phdrs_script_test_DEPENDENCIES): Define.
9383 (tls_phdrs_script_test_LDFLAGS): Define.
9384 (tls_phdrs_script_test_LDADD): Define.
9385 * testsuite/Makefile.in: Rebuild.
9387 2010-03-23 Cary Coutant <ccoutant@google.com>
9389 * fileread.cc (find_or_make_view): Fix comment.
9391 2010-03-23 Ian Lance Taylor <iant@google.com>
9393 * script-sections.cc (class Orphan_section_placement): Define
9394 PLACE_TLS and PLACE_TLS_BSS.
9395 (Orphan_section_placement::Orphan_section_placement): Initialize
9397 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9398 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9399 (tls_script_test_SOURCES): Define.
9400 (tls_script_test_DEPENDENCIES): Define.
9401 (tls_script_test_LDFLAGS): Define.
9402 (tls_script_test_LDADD): Define.
9403 * testsuite/Makefile.in: Rebuild.
9405 2010-03-22 Doug Kwan <dougkwan@google.com>
9407 * arm.cc (Arm_relocate_functions::abs8,
9408 Arm_relocate_functions::abs16): Use correct check for overflow
9409 specified in the ARM ELF specs.
9410 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9411 target of a BLX instruction specially.
9412 (Reloc_stub::stub_type_for_reloc): Ditto.
9413 (Relocate::relocate): Use symbolic names instead of numeric relocation
9414 codes to report error.
9415 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9417 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9418 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9419 thumb2_blx_out_of_range.stdout
9420 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9421 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9422 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9423 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9424 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9425 thumb2_blx_in_range, thumb2_blx_in_range.o,
9426 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9427 thumb2_blx_out_of_range.o): New rules.
9428 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
9429 thumb2_blx_in_range and thumb2_blx_out_of_range.
9430 * testsuite/Makefile.in: Regenerate.
9431 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9432 * testsuite/thumb_blx_in_range.s: New file.
9433 * testsuite/thumb_blx_out_of_range.s: New file.
9435 2010-03-22 Rafael Espindola <espindola@google.com>
9437 * archive.cc (Should_include): Move to archive.h.
9438 (should_include_member): Make it a member of Archive.
9440 (Add_lib_group_symbols): New.
9441 * archive.h: Include options.h.
9442 (Archive_member): Moved from Archive.
9443 (Should_include): Moved from archive.cc.
9445 (Add_lib_group_symbols): New.
9446 * dynobj.cc (do_should_include_member): New.
9447 * dynobj.h (do_should_include_member): New.
9448 * gold.cc (queue_initial_tasks): Update call to queue.
9449 * main.cc (main): Print lib group stats.
9450 * object.cc (do_should_include_member): New.
9451 * object.h: Include archive.h.
9452 (Object::should_include_member): New.
9453 (Object::do_should_include_member): New.
9454 (Sized_relobj::do_should_include_member): New.
9455 * options.cc (General_options::parse_start_lib): New.
9456 (General_options::parse_end_lib): New.
9457 (Input_arguments::add_file): Handle lib groups.
9458 (Input_arguments::start_group): Check we are not in a lib.
9459 (Input_arguments::start_lib): New.
9460 (Input_arguments::end_lib): New.
9461 * options.h (General_options): Add start_lib and end_lib.
9462 (Input_argument::lib_): New.
9463 (Input_argument::lib): New.
9464 (Input_argument::is_lib): New.
9465 (Input_file_lib): New.
9466 (Input_arguments::in_lib_): New.
9467 (Input_arguments::in_lib): New.
9468 (Input_arguments::start_lib): New.
9469 (Input_arguments::end_lib_): New.
9470 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9471 in unused members as preempted.
9472 (Sized_pluginobj::do_should_include_member): New.
9473 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9474 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9476 (Read_symbols::do_whole_lib_group): New.
9477 (Read_symbols::do_lib_group): New.
9478 (Read_symbols::do_read_symbols): Handle lib groups.
9479 (Read_symbols::get_name): Handle lib groups.
9480 * readsyms.h (Read_symbols): Add an archive member pointer.
9481 (Read_symbols::do_whole_lib_group): New.
9482 (Read_symbols::do_lib_group): New.
9483 (Read_symbols::member_): New.
9484 * script.cc (read_input_script): Update call to queue_soon.
9486 2010-03-19 Doug Kwan <dougkwan@google.com>
9488 * arm.cc (Stub_table::Stub_table): Initialize new data members
9489 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9490 (Stub_table::add_reloc_stub): Assign stub offset and update
9491 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9492 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9494 (Stub_table::update_data_size_and_addralign): Use
9495 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9496 instead of going over all reloc stubs.
9497 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
9498 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9499 Stringpool_template::offset_ to size of Stringpool_char.
9500 (Stringpool_template::new_key_offset): Remove code to initialize
9501 Stringpool_template::offset_.
9502 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9503 Stringpool_template::offset_ to zero.
9505 2010-03-15 Doug Kwan <dougkwan@google.com>
9507 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9509 (Stringpool_template::new_key_offset): New method.
9510 (Stringpool_template::add_string): Assign offsets when adding new
9512 (Stringpool_template::set_string_offsets): Do not set string offsets
9513 when not optimizing.
9514 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9516 (Chunked_vector::clear): Clear size_.
9517 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9518 (Chunked_vector::size): Return size_.
9519 (Chunked_vector::push_back): Use size_ to find insert position.
9520 (Chunked_vector::size_): New data member.
9521 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9522 (Stringpool_template::new_key_offset): New method declaration.
9523 (Stringpool_template::offset_): New data member.
9525 2010-03-15 Rafael Espindola <espindola@google.com>
9527 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9528 Add_symbols' constructor.
9529 * readsyms.h (Add_symbols): Remove the input_group member.
9531 2010-03-10 Ian Lance Taylor <iant@google.com>
9533 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9534 target to ask whether a reference to a symbol requires a stack
9536 * target.h (Target::is_call_to_non_split): New function.
9537 (Target::do_is_call_to_non_split): Declare virtual function.
9538 * target.cc: Include "symtab.h".
9539 (Target::do_is_call_to_non_split): New function.
9540 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9542 2010-03-10 Cary Coutant <ccoutant@google.com>
9544 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9545 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9546 (File_read::open[2]): Add whole_file_view_ to list of views.
9547 (File_read::make_view): Remove test of whole_file_view_.
9548 (File_read::find_or_make_view): Create whole_file_view_ if
9550 (File_read::clear_views): Replace bool parameter with enum;
9551 adjust all callers. Don't delete views with permanent data;
9552 do delete cached views and views from archives if
9553 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9554 if clearing the corresponding view.
9555 * fileread.h (File_read::Clear_views_mode): New enum.
9556 (File_read::View::is_permanent_view): New method.
9557 (File_read::clear_views): Replace bool parameter
9558 with enum; adjust all callers.
9559 * options.h (General_options): Change keep_files_mapped option;
9560 add map_whole_files.
9561 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9563 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9566 2010-03-10 David S. Miller <davem@davemloft.net>
9568 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9570 2010-03-09 Sriraman Tallam <tmsriram@google.com>
9572 * icf.cc (get_section_contents): Add '@' marker after processing the
9575 2010-03-08 Doug Kwan <dougkwan@google.com>
9577 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9578 due to a conversion warning.
9579 (Arm_relobj::update_output_local_symbol_count): Check for local
9580 symbol with unset output index.
9582 2010-03-05 Ian Lance Taylor <iant@google.com>
9584 * options.h (class General_options): Add --spare-dynamic-tags.
9585 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9586 --spare-dynamic-tags.
9588 2010-03-05 Ian Lance Taylor <iant@google.com>
9590 * incremental.cc: Include "libiberty.h".
9592 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9594 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9595 function, is_info_ member.
9596 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9597 (Versions::Versions): Update caller.
9598 (Versions::define_base_version): Likewise.
9599 (Versions::add_def): Likewise.
9601 2010-03-03 Sriraman Tallam <tmsriram@google.com>
9603 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9604 (Scan::possible_function_pointer_reloc): New function.
9605 (Scan::local_reloc_may_be_function_pointer): Change to call
9606 possible_function_pointer_reloc.
9607 (Scan::global_reloc_may_be_function_pointer): Ditto.
9608 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9609 relocations in ".data.rel.ro._ZTV" section.
9610 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9611 * testsuite/icf_safe_so_test.cc: Ditto.
9612 * testsuite/icf_safe_test.cc: Ditto.
9613 * testsuite/icf_safe_test.sh: Ditto.
9615 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9616 Ian Lance Taylor <iant@google.com>
9618 * target-reloc.h (relocate_section): Check the symbol table index
9619 for -1U before setting the local symbol index.
9620 (scan_relocatable_relocs): If copying the relocation, record that
9621 the local symbol is required.
9622 * object.h (Symbol_value::is_output_symtab_index_set): New
9624 (Symbol_value::may_be_discarded_from_output_symtab): New
9626 (Symbol_value::has_output_symtab_entry): New function.
9627 (Symbol_value::needs_output_symtab_entry): Remove.
9628 (Symbol_value::output_symtab_index): Make sure the symbol index is
9630 (Symbol_value::set_output_symtab_index): Make sure the symbol
9631 index is not set. Make sure the new index is valid.
9632 (Symbol_value::set_must_have_output_symtab_entry): New function.
9633 (Symbol_value::has_output_dynsym_entry): New function.
9634 (Symbol_value::set_output_dynsym_index): Make sure the new index
9636 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9637 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9638 local symbol if permitted.
9639 (Sized_relobj::do_finalize_local_symbols): Call
9640 is_output_symtab_index_set rather than needs_output_symtab_entry.
9641 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9642 rather than needs_output_symtab_entry. Call
9643 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9644 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9645 is_output_symtab_index_set rather than needs_output_symtab_entry.
9646 * testsuite/discard_locals_relocatable_test.c: New file.
9647 * testsuite/discard_locals_test.sh: Test -r.
9648 * testsuite/Makefile.am (check_DATA): Add
9649 discard_locals_relocatable_test1.syms,
9650 discard_local_relocatable_test2.syms.
9651 (MOSTLYCLEANFILES): Likewise. Also add
9652 discard_locals_relocatable_test1.lout and
9653 discard_locals_relocatable_test2.out.
9654 (discard_locals_relocatable_test1.syms): New target.
9655 (discard_locals_relocatable_test.o): New target.
9656 (discard_locals_relocatable_test1.out): New target.
9657 (discard_locals_relocatable_test2.syms): New target.
9658 (discard_locals_relocatable_test2.out): New target.
9659 (various): Add missing ../ld-new dependencies.
9660 * testsuite/Makefile.in: Rebuild.
9662 2010-03-03 Nick Clifton <nickc@redhat.com>
9664 * po/fi.po: New Finnish translation.
9666 2010-03-01 Doug Kwan <dougkwan@google.com>
9668 * layout.cc (Layout::Layout): Force section types of .init_array*,
9669 .preinit_array* and .fini_array* sections.
9670 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9671 Fix check of return value of std::string::find.().
9672 (Output_section::Input_section_sort_compare::operator()): Remove
9673 comment about .init_array.
9674 (Output_section::Input_section_sort_init_fini_compare::operator()):
9676 (Output_section::sort_attached_input_sections): Handle .init_array
9677 and .fini_array specially.
9678 * output.h (Output_section::Inut_section_sort_compare): Update
9680 (Output_section::Input_section_sort_init_fini_compare): New struct.
9682 2010-02-26 Doug Kwan <dougkwan@google.com>
9684 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9685 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9686 * testsuite/debug_msg.sh: Avoid matching source line number for
9687 use of global variable undef_int.
9689 2010-02-26 Doug Kwan <dougkwan@google.com>
9691 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9692 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9693 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9694 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9695 * options.cc (General_options::General_options): Initialize member
9697 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9698 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9699 and rm_no_fix_v4bx.stdout
9700 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9701 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9702 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9703 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9704 and arm_no_fix_v4bx.
9705 * Makefile.in: Regenerate.
9706 * testsuite/arm_fix_v4bx.s: New file.
9707 * testsuite/arm_fix_v4bx.sh: Ditto.
9709 2010-02-24 Doug Kwan <dougkwan@google.com>
9711 * arm.cc (Target_arm::got_section): Make the .got section the first
9712 non RELRO section in the data segment.
9713 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9714 suffixes of section names.
9716 2010-02-24 Doug Kwan <dougkwan@google.com>
9718 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9719 flags and attributes merging if an input file is a binary file.
9720 * fileread.cc (Input_file::open): Record format of original file.
9721 * fileread.h (Input_file::Format): New enum type.
9722 (Input_file::Input_file): Initialize data member format_.
9723 (Input_file::format): New method definition.
9724 (Input_file::format_):: New data member.
9726 2010-02-24 Doug Kwan <dougkwan@google.com>
9728 * arm.cc (Arm_output_data_got): New class.
9729 (ARM_TCB_SIZE): New constant
9730 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9731 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9732 If user uses a script with a SECTIONS clause, issue only a warning
9733 for a misplaced EXIDX input section. Otherwise, issue an error.
9734 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
9736 (Target_arm::got_mode_index_entry): Handle static linking.
9737 (Target_arm::Scan::local): Ditto.
9738 (Target_arm::Scan::global): Ditto.
9739 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9740 all incorrectly implemented relocations.
9741 (Target_arm::fix_exidx_coverage): Pass layout to
9742 Arm_output_section::fix_exidx_coverage.
9743 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9744 from ".ARM.exidx." and ".ARM.extab.".
9746 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9748 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9749 section if it does not already exist.
9750 * attributes.cc (Attributes_section_data::Attributes_section_data):
9751 Don't crash if size is zero.
9753 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9754 Ian Lance Taylor <iant@google.com>
9756 * gold.cc (queue_middle_tasks): If no input files were opened,
9758 * workqueue.h (Task_function::Task_function): Assert that there is
9761 2010-02-22 Doug Kwan <dougkwan@google.com>
9763 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9764 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9765 types to avoid warnings due to different uint64_t implementations
9768 2010-02-21 Doug Kwan <dougkwan@google.com>
9770 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9771 handling of the maximum backward branch offset.
9772 (Arm_relocate_functions::thumb_branch_common): Ditto.
9773 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9774 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
9775 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
9776 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9777 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9778 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9779 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9780 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9781 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9782 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9783 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9784 thumb2_bl_out_of_range.o): New rules.
9785 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9786 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9787 thumb2_bl_out_of_range
9788 * testsuite/Makefile.in: Regenerate.
9789 * testsuite/arm_bl_in_range.s: New file.
9790 * testsuite/arm_bl_out_of_range.s: Ditto.
9791 * testsuite/arm_branch_in_range.sh: Ditto.
9792 * testsuite/arm_branch_range.t: Ditto.
9793 * testsuite/thumb2_branch_range.t: Ditto.
9794 * testsuite/thumb_bl_in_range.s: Ditto.
9795 * testsuite/thumb_bl_out_of_range.s: Ditto.
9796 * testsuite/thumb_branch_range.t: Ditto.
9798 2010-02-20 Sriraman Tallam <tmsriram@google.com>
9800 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9801 Add reloc offset information.
9802 * icf.cc (get_section_contents): Change iterators to point to the new
9803 vectors. Add reloc offset information to the contents.
9804 * icf.h (Icf::Sections_reachable_info): New typedef.
9805 (Icf::Sections_reachable_list): New typedef.
9806 (Icf::Offset_info): New typedef.
9807 (Icf::Reloc_info): New struct typedef.
9808 (Icf::Reloc_info_list): New typedef.
9809 (Icf::symbol_reloc_list): Delete method.
9810 (Icf::addend_reloc_list): Delete method.
9811 (Icf::section_reloc_list): Delete method.
9812 (Icf::reloc_info_list): New method.
9813 (Icf::reloc_info_list_): New member.
9815 2010-02-19 Doug Kwan <dougkwan@google.com>
9817 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9818 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9819 * arm.cc (Arm_relocation_functions): New forward declaration.
9820 (Target_arm::Target_arm): Initialize new data members
9821 got_mod_index_offset_ and tls_base_symbol_defined_.
9822 (Target_arm::Relocate::relocate_tls): New method.
9823 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9824 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9826 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
9827 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9828 (Target_arm::got_mod_index_offset_,
9829 Target_arm::tls_base_symbol_defined_): New data members.
9830 (Target_arm::Scan::local, Target::Scan::global,
9831 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9834 2010-02-18 Doug Kwan <dougkwan@google.com>
9836 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9837 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9838 text section as a parameter becuase some broken tools may not set
9839 the link in section header.
9840 (Target_arm::has_got_section): New method.
9841 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9842 without any mapping symbol as data only. Remove warning.
9843 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9844 link in its section header, try to discover the link by inspecting the
9845 REL31 relocation at the beginning of the section.
9846 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9848 (Target_arm::Scan::global): Treat any reference to the symbol
9849 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9851 2010-02-12 Sriraman Tallam <tmsriram@google.com>
9853 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9854 (Scan::global_reloc_may_be_function_pointer): New function.
9855 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9856 (Scan::global_reloc_may_be_function_pointer): New function.
9857 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9858 (Scan::global_reloc_may_be_function_pointer): New function.
9859 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9860 (Scan::global_reloc_may_be_function_pointer): New function.
9861 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9862 (Scan::global_reloc_may_be_function_pointer): New function.
9863 (Scan::possible_function_pointer_reloc): New function.
9864 (Target_x86_64::can_check_for_function_pointers): New function.
9865 * gc.h (gc_process_relocs): Scan relocation types to determine if
9866 function pointers were taken for targets that support it.
9867 * icf.cc (Icf::find_identical_sections): Include functions for
9868 folding in safe ICF whose pointer is not taken.
9869 * icf.h (Secn_fptr_taken_set): New typedef.
9870 (fptr_section_id_): New member.
9871 (section_has_function_pointers): New function.
9872 (set_section_has_function_pointers): New function.
9873 (check_section_for_function_pointers): New function.
9874 * options.h: Fix comment for safe ICF option.
9875 * target.h (can_check_for_function_pointers): New function.
9876 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9877 Modify icf_safe_test for X86-64.
9878 * testsuite/Makefile.in: Regenerate.
9879 * testsuite/icf_safe_so_test.cc: New file.
9880 * testsuite/icf_safe_so_test.sh: New file.
9881 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9882 (main): Change to take pointer to function kept_func_3.
9883 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9884 folding is done correctly for X86-64.
9886 2010-02-12 David S. Miller <davem@davemloft.net>
9888 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9889 is_symbolless parameter.
9890 (Output_reloc<SHT_REL>::is_symbolless): New.
9891 (Output_reloc<SHT_REL>::is_symbolless_): New.
9892 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9893 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9894 (Output_reloc<SHT_RELA>::is_symbolless): New.
9895 (Output_data_reloc::add_global): Handle is_symbolless.
9896 (Output_data_reloc::add_global_relative): Likewise.
9897 (Output_data_reloc::add_local): Likewise.
9898 (Output_data_reloc::add_local_relative): Likewise.
9899 (Output_data_reloc::add_symbolless_global_addend): New.
9900 (Output_data_reloc::add_symbolless_local_addend): New.
9901 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9903 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9904 instead of ->is_relative_
9905 (Output_reloc::write): Likewise.
9906 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9907 (Output_reloc::write_rel): Simplify.
9909 * sparc.cc (Target_sparc::Scan::local): Use
9910 ->add_symbolless_local_addend as needed.
9911 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9912 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9913 based upon relocation offset.
9915 2010-02-11 Doug Kwan <dougkwan@google.com>
9917 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9918 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9919 beginning of function.
9920 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9921 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9922 parameter is_32bit in calls to should_apply_static_reloc.
9923 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9924 (check_DATA): Add arm_abs_global.stdout.
9925 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9926 arm_abs_global.stdout): New rules.
9927 (MOSTLLYCLEANFILES): Add arm_abs_global
9928 * Makefile.in: Regenerate.
9929 * testsuite/arm_abs_global.s: New file.
9930 * testsuite/arm_abs_global.sh: Ditto.
9931 * testsuite/arm_abs_lib.s: Ditto.
9933 2010-02-11 Ian Lance Taylor <iant@google.com>
9935 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9937 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9938 Allocate_commons_task first.
9939 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9940 task, rather than symtab_lock_.
9941 (Gc_process_relocs::~Gc_process_relocs): New function.
9942 (Gc_process_relocs::is_runnable): Check this_blocker_.
9943 (Gc_process_relocs::locks): Use next_blocker_ rather than
9945 (Scan_relocs::~Scan_relocs): New function.
9946 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9948 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9950 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9951 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9952 constructor accordingly.
9953 (class Gc_process_relocs): Likewise.
9954 (class Scan_relocs): Likewise.
9955 * common.h (class Allocate_commons_task): Remove symtab_lock_
9956 field, and corresponding constructor parameter.
9957 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9959 (Allocate_commons_task::locks): Likewise.
9961 2010-02-11 Ian Lance Taylor <iant@google.com>
9963 * gold-threads.h (class Once): Define.
9964 (class Initialize_lock): Rewrite as child of Once.
9965 * gold-threads.cc (class Once_initialize): Define.
9966 (once_pointer_control): New static variable.
9967 (once_pointer, once_arg): New static variables.
9968 (c_run_once): New static function.
9969 (Once::Once, Once::run_once, Once::internal_run): New functions.
9970 (class Initialize_lock_once): Remove.
9971 (initialize_lock_control): Remove.
9972 (initialize_lock_pointer): Remove.
9973 (initialize_lock_once): Remove.
9974 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9975 (Initialize_lock::initialize): Rewrite.
9976 (Initialize_lock::do_run_once): New function.
9977 * archive.cc (Archive::interpret_header): Only clear name if it is
9979 * fileread.cc: Include "gold-threads.h"
9980 (file_counts_lock): New static variable.
9981 (file_counts_initialize_lock): Likewise.
9982 (File_read::release): Only increment counts when using --stats.
9983 Use a lock around the increment.
9984 * parameters.cc (class Set_parameters_target_once): Define.
9985 (set_parameters_target_once): New static variable.
9986 (Parameters::Parameters): Move here from parameters.h.
9987 (Parameters::set_target): Rewrite.
9988 (Parameters::set_target_once): New function.
9989 (Parameters::clear_target): Move here and rewrite.
9990 * parameters.h (class Parameters): Update declarations. Add
9991 set_parameters_target_once_ field.
9992 (Parameters::Parameters): Move to parameters.cc.
9993 (Parameters::clear_target): Likewise.
9994 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9996 (Start_group::~Start_group): New function.
9997 (Start_group::is_runnable): New function.
9998 (Start_group::locks, Start_group::run): New functions.
9999 (Finish_group::run): Change saw_undefined to size_t.
10000 * readsyms.h (class Start_group): Define.
10001 (class Finish_group): Change saw_undefined_ field to size_t.
10002 (Finish_group::Finish_group): Remove saw_undefined and
10003 this_blocker parameters. Change all callers.
10004 (Finish_group::set_saw_undefined): New function.
10005 (Finish_group::set_blocker): New function.
10006 * symtab.h (class Symbol_table): Change saw_undefined to return
10007 size_t. Change saw_undefined_ field to size_t.
10008 * target-select.cc (Set_target_once::do_run_once): New function.
10009 (Target_selector::Target_selector): Initialize set_target_once_
10010 field. Don't initialize lock_ and initialize_lock_ fields.
10011 (Target_selector::instantiate_target): Rewrite.
10012 (Target_selector::set_target): New function.
10013 * target-select.h (class Set_target_once): Define.
10014 (class Target_selector): Update declarations. Make
10015 Set_target_once a friend. Remove lock_ and initialize_lock_
10016 fields. Add set_target_once_ field.
10018 2010-02-10 Ian Lance Taylor <iant@google.com>
10020 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10021 queueing any tasks.
10022 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10023 (queue_middle_tasks): Add all blockers before queueing any tasks.
10024 (queue_final_tasks): Likewise.
10025 * token.h (Task_token::add_blockers): New function.
10026 * object.h (Input_objects::number_of_relobjs): New function.
10028 2010-02-10 Ian Lance Taylor <iant@google.com>
10030 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10031 shared, not if not position independent.
10032 * x86_64.cc (Relocate::relocate_tls): Likewise.
10033 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10034 (tls_pie_pic_test): New target.
10035 * testsuite/Makefile.in: Rebuild.
10037 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10038 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10039 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10040 * testsuite/Makefile.in: Rebuild.
10042 2010-02-09 David S. Miller <davem@davemloft.net>
10044 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10045 R_SPARC_RELATIVE using ->add_local_relative().
10046 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10048 * output.h (Output_data_dynamic::add_section_size): New method
10049 that takes two Output_data objects.
10050 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10051 entry param. Handle it in initializers.
10052 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10053 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10054 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10056 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10057 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10058 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10059 for dynrel_includes_plt.
10060 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10061 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10062 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10064 (Target_sparc::do_finalize_sections): Update to pass true for
10065 dynrel_includes_plt.
10066 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10067 output before .rela.plt
10068 (Target_powerpc::do_finalize_sections): Update to pass true for
10069 dynrel_includes_plt when 32-bit.
10071 2010-02-08 Doug Kwan <dougkwan@google.com>
10073 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10075 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10076 Arm_relobj::scan_section_for_cortex_a8_stubs,
10077 Arm_relobj::do_relocation_section): Instead of calling
10078 Output_section::output_address, use faster
10079 Arm_relobj::simple_input_section_output_address.
10081 2010-02-08 David S. Miller <davem@davemloft.net>
10083 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10084 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10085 relocation helper function.
10087 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10088 just like R_SPARC_GOT{10,13,22}.
10089 (Target_sparc::Scan::local): Likewise.
10090 (Target_sparc::Relocate:relocate): Likewise.
10092 2010-02-06 Ian Lance Taylor <iant@google.com>
10094 * configure.ac: Rewrite targetobjs duplicate removal code to use
10095 only shell constructs.
10096 * configure: Rebuild.
10098 2010-02-05 Doug Kwan <dougkwan@google.com>
10101 * arm.cc (Arm_relobj::section_is_scannable): New method.
10102 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10103 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10105 2010-02-04 Doug Kwan <dougkwan@google.com>
10108 * arm-reloc-property.cc (cstdio): Include.
10109 * configure.ac (targetobjs): Remove duplicates.
10110 * configure: Regenerate.
10111 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10112 big and little endian version for a given address size.
10114 2010-02-03 Doug Kwan <dougkwan@google.com>
10116 * arm-reloc-property.cc
10117 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10119 * arm-reloc-property.h
10120 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10121 New method definition.
10122 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10124 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10126 (GOT_PREL): Change implemented to Y.
10127 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10128 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10129 (Arm_relocate_functions::movw_abs_nc): Remove method.
10130 (Arm_relocate_functions::movt_abs): Ditto.
10131 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10132 (Arm_relocate_functions::thm_movt_abs): Ditto.
10133 (Arm_relocate_functions::movw_rel_nc): Ditto.
10134 (Arm_relocate_functions::movw_rel): Ditto.
10135 (Arm_relocate_functions::movt_rel): Ditto.
10136 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10137 (Arm_relocate_functions:thm_movw_rel): Ditto.
10138 (Arm_relocate_functions:thm_movt_rel): Ditto.
10139 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10140 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10141 New method definitions.
10142 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10143 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10144 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10145 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10146 (Target_arm::Relocate::relocate): Check for non-static or
10147 unimplemented relocation code and exit early. Change calls to
10148 Target_arm::reloc_uses_thumb_bit and
10149 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10150 instead. Refactor code to handle similar relocations to increase
10151 code sharing. Remove check for unsupported relocation code in switch
10153 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10154 relocation property table to find out size. Change error message to
10155 print out the name of a relocation code instead of the numeric value.
10156 (Target_arm::scan_reloc_for_stub): Use relocation property table
10157 instead of calling Target_arm::reloc_uses_thumb_bit().
10159 2010-02-02 Doug Kwan <dougkwan@google.com>
10161 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10162 types of relaxed input section.
10164 2010-02-02 Doug Kwan <dougkwan@google.com>
10166 * Makefile.am (HFILES): Add arm-reloc-property.h.
10168 (TARGETSOURCES): Add arm-reloc-property.cc
10169 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
10170 (libgold_a_SOURCES): $(DEFFILES)
10171 * Makefile.in: Regenerate.
10172 * arm-reloc-property.cc: New file.
10173 * arm-reloc-property.h: New file.
10174 * arm-reloc.def: New file.
10175 * arm.cc: Update comments.
10176 (arm-reloc-property.h): New included header.
10177 (arm_reloc_property_table): New global variable.
10178 (Target_arm::do_select_as_default_target): New method definition.
10179 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10180 arm-reloc-property to targ_extra_obj.
10181 * parameters.cc (set_parameters_target): Call
10182 Target::select_as_default_target().
10183 * target.h (Target::select_as_default_target): New method definition.
10184 (Target::do_select_as_default_target): Same.
10186 2010-02-01 Doug Kwan <dougkwan@google.com>
10188 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10189 first_output_text_section_.
10190 (Arm_exidx_fixup::first_output_text_section): New method definition.
10191 (Arm_exidx_fixup::first_output_text_section_): New data member.
10192 (Arm_exidx_fixup::process_exidx_section): Record the first text
10193 output section seen.
10194 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10195 and entsize in output section header.
10197 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10199 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10200 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10201 (Arm_relocate_functions::thm_alu11): New Method.
10202 (Arm_relocate_functions::thm_pc8): New Method.
10203 (Arm_relocate_functions::thm_pc12): New Method.
10204 (Target_arm::Scan::local): Handle the relocations.
10205 (Target_arm::Scan::global): Likewise.
10206 (Target_arm::Relocate::relocate): Likewise.
10207 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10209 2010-01-29 Doug Kwan <dougkwan@google.com>
10211 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10212 of relocation types as ld.
10214 2010-01-29 Doug Kwan <dougkwan@google.com>
10216 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10218 (Arm_relocate_functions::thumb_branch_common): Ditto.
10219 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10220 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10221 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10222 Arm_relocate_functions::jump24): Remove.
10223 (Target_arm::Relocate::relocate): Adjust code to call
10224 Arm_relocation_functions::arm_branch_common and
10225 Arm_relocation_functions::thumb_branch_common instead of their removed
10226 wrappers. Merge switch-cases together to reduce source code size.
10228 2010-01-29 Doug Kwan <dougkwan@google.com>
10230 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10231 output_local_symbol_count_needs_update_.
10232 (Arm_relobj::output_local_symbol_count_needs_update,
10233 Arm_relobj::set_output_local_symbol_count_needs_update,
10234 Arm_relobj::update_output_local_symbol_count): New methods.
10235 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10237 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10238 of pointed function as in a R_ARM_PREL31 relocation.
10239 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10240 for output local symbol count updating.
10241 (Target_arm::do_relax): Update output local symbol counts in objects
10243 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10245 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10247 * arm.cc: Added support for the ARM relocations:
10248 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10249 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10250 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10252 (Arm_relocate_functions::movw_rel): New method.
10253 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10254 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10256 (Arm_relocate_functions::thm_movw_rel): New method.
10257 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10259 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10261 (Target_arm::Scan::global): Likewise.
10262 (Target_arm::Relocate::relocate): Likewise.
10263 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10266 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10268 * arm.cc: Added support for ARM group relocations.
10269 (Target_arm::reloc_needs_sym_origin): New method.
10270 (Arm_relocate_functions::calc_grp_kn): New method.
10271 (Arm_relocate_functions::calc_grp_residual): New method.
10272 (Arm_relocate_functions::calc_grp_gn): New method.
10273 (Arm_relocate_functions::arm_grp_alu): New Method.
10274 (Arm_relocate_functions::arm_grp_ldr): New Method.
10275 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10276 (Arm_relocate_functions::arm_grp_ldc): New Method.
10277 (Target_arm::Scan::local): Handle the ARM group relocations.
10278 (Target_arm::Scan::global): Likewise.
10279 (Target_arm::Relocate::relocate): Likewise.
10280 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10283 2010-01-26 Doug Kwan <dougkwan@google.com>
10285 * arm.cc (set): Include.
10286 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10288 (Arm_output_section::Text_section_list): New type.
10289 (Arm_output_section::append_text_sections_to_list): New method.
10290 (Arm_output_section::fix_exidx_coverage): Ditto.
10291 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
10292 (Arm_relobj::convert_input_section_to_relaxed_section): Use
10293 Relobj::set_section_offset() instead of
10294 Sized_relobj::invalidate_section_offset().
10295 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
10296 parameter for section headers. Ignore relocation sections for
10297 unallocated sections and EXIDX sections.
10298 (Target_arm::fix_exidx_coverage): New method.
10299 (Target_arm::output_section_address_less_than): New type.
10300 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10301 linked text section instead of the EXIDX section.
10302 (Arm_output_section::create_stub_group): Add an assertion to check
10303 that this is not an EXIDX output section.
10304 (Arm_output_section::append_text_sections_to_list): New method.
10305 (Arm_output_section::fix_exidx_coverage): Ditto.
10306 (Arm_relobj::scan_sections_for_stubs): Adjust call to
10307 Arm_relobj::section_needs_reloc_stub_scanning.
10308 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10310 (Target_arm::fix_exidx_coverage): New method.
10311 * object.h (Relobj::set_output_section): New method.
10312 (Sized_relobj::invalidate_section_offset): Remove method.
10313 (Sized_relobj::do_invalidate_section_offset): Remove method.
10314 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10316 2010-01-25 Doug Kwan <dougkwan@google.com>
10318 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10319 Fix warning due to signed and unsigned comparison on a 32-bit host.
10321 2010-01-22 Doug Kwan <dougkwan@google.com>
10323 * arm.cc (Target_arm::do_relax): Record an output section for section
10324 offset adjustment it contains any stub table that has changed.
10325 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10326 offsets in an output section if necessary.
10327 * output.cc (Output_section::Output_section): Initialize
10328 section_offsets_need_adjustments_.
10329 (Output_section::add_input_section_for_script): Renamed to
10330 Output_section::add_simple_input_section.
10331 (Output_section::save_states): Add a comment.
10332 (Output_section::discard_states): New method defintion.
10333 (Output_section::adjust_section_offsets): Same.
10334 * output.h (Output_section::add_input_section_for_script): Renamed to
10335 Output_section::add_simple_input_section.
10336 (Output_section::discard_states): New method declaration.
10337 (Output_section::adjust_section_offsets): Same.
10338 (Output_section::section_offsets_need_adjustment,
10339 Output_section::set_section_offsets_need_adjustment): New method
10341 (Output_section::section_offsets_need_adjustment_): New data member.
10342 * script-sections.cc
10343 (Output_section_element_input::set_section_address): Adjust code for
10344 renaming of Output_section::add_input_section_for_script.
10345 (Orphan_output_section::set_section_address): Same.
10347 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10349 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10350 Fix_v4bx enum values .
10351 * gold/options.h (General_options): New option definitions.
10352 (General_options::fix_v4bx): New method.
10353 (General_options::Fix_v4bx): New enum.
10354 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10355 (General_options::parse_fix_v4bx_interworking): New method.
10357 2010-01-22 Doug Kwan <dougkwan@google.com>
10359 * arm.cc (Arm_exidx_fixup): New class.
10361 2010-01-21 Doug Kwan <dougkwan@google.com>
10363 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10365 (Arm_exidx_section_offset_map): New type.
10367 2010-01-21 Doug Kwan <dougkwan@google.com>
10369 * arm.cc (Arm_exidx_input_section): New class.
10370 (Arm_relobj::exidx_input_section_by_link,
10371 Arm_relobj::exidx_input_section_by_shndx,
10372 Arm_relobj::make_exidx_input_section): New methods.
10373 (read_arm_attributes_section): Remove.
10374 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10375 information about them.
10376 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10379 2010-01-20 Doug Kwan <dougkwan@google.com>
10381 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10382 Input_section_specifier to Section_id.
10383 (Target_arm::new_arm_input_section: Adjust code for change of key
10385 (Target_arm::find_arm_input_section): Ditto.
10386 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10387 (Section_id): Remove.
10388 (Garbage_collection::Section_id_hash): Remove.
10389 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10390 (Section_id): Remove.
10391 (Icf::Section_id_hash): Remove.
10392 * object.h (Section_id, Const_section_id, Section_id_hash,
10393 Const_section_id_hash): New type definitions.
10394 * output.cc (Output_section::add_relaxed_input_section): Change to
10395 use Const_section_id instead of Input_section_specifier as key type.
10396 (Output_section::add_merge_input_section): Ditto.
10397 (Output_section::build_relaxation_map): Change to use Section_id
10398 instead of Input_section_specifier as key type.
10399 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
10401 (Output_section::convert_input_sections_to_relaxed_sections): Change
10402 to use Const_section_id instead of Input_section_specifier as key type.
10403 (Output_section::find_merge_section): Ditto.
10404 (Output_section::find_relaxed_input_section): Ditto.
10405 * output.h (Input_section_specifier): Remove class.
10406 (Output_section::Output_section_data_by_input_section_map): Change
10407 key type to Const_section_id.
10408 (Output_section::Output_relaxed_input_section_by_input_section_map):
10410 (Output_section::Relaxation_map): Change key type to Section_id.
10412 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10414 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10415 (class Arm_v4bx_stub): New class.
10416 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10417 (Stub_factory::make_arm_v4bx_stub): New method.
10418 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10419 (Stub_table::empty): Handle v4bx stubs.
10420 (Stub_table::add_arm_v4bx_stub): New method.
10421 (Stub_table::find_arm_v4bx_stub): New method.
10422 (Arm_relocate_functions::v4bx): New method.
10423 (Target_arm::fix_v4bx): New method.
10424 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10425 (Stub_table::relocate_stubs): Likewise.
10426 (Stub_table::do_write): Likewise.
10427 (Stub_table::update_data_size_and_addralign): Likewise.
10428 (Stub_table::finalize_stubs): Likewise.
10429 (Target_arm::Scan::local): Likewise.
10430 (Target_arm::Scan::global): Likewise.
10431 (Target_arm::do_finalize_sections): Likewise.
10432 (Target_arm::Relocate::relocate): Likewise.
10433 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10435 (Target_arm::scan_reloc_for_stub): Likewise.
10436 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10438 2010-01-19 Ian Lance Taylor <iant@google.com>
10440 * output.cc (Output_section_headers::do_sized_write): Write large
10441 segment count to sh_info field.
10442 (Output_file_header::do_sized_write): For large segment count,
10443 write PN_XNUM to e_phnum field.
10445 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10447 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10448 (Arm_relocate_functions::thm_jump8): New function.
10449 (Arm_relocate_functions::thm_jump11): New function.
10450 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10452 (Target_arm::Scan::global): Likewise.
10453 (Target_arm::Relocate::relocate): Likewise.
10454 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10457 2010-01-14 Doug Kwan <dougkwan@google.com>
10459 * arm.cc (map, utility): Include headers.
10460 (Target_arm::apply_cortex_a8_workaround): New method.
10461 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10462 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10463 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10464 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10465 the --[no-]fix-cortex-a8 command line options.
10466 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10467 (Target_arm::relocate_stub): Use addend in instruction template.
10468 * options.h (DEFINE_bool): Set the user-set flag.
10469 (General_options): Add --[no-]-fix-cortex options.
10470 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
10471 : Update fast look-up map after conversion.
10473 2010-01-14 Sriraman Tallam <tmsriram@google.com>
10475 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10476 in the first pass of do_layout.
10478 2010-01-13 Doug Kwan <dougkwan@google.com>
10480 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10481 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10482 apparent compiler problem of not folding static constant integral
10483 data members of elfcpp::Elf_sizes<32>.
10485 2010-01-13 Doug Kwan <dougkwan@google.com>
10487 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10488 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10489 Arm_relobj::scan_section_for_cortex_a8_erratum,
10490 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10491 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10492 sections to scan for relocation stubs into a new method
10493 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10494 relocation and Cortex-A8 stub scanning.
10495 (Target_arm::do_relax): Force stubs to be after stubbed sections
10496 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
10497 the beginning of a new relaxation pass. Update a comment.
10498 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10500 2010-01-12 Ian Lance Taylor <iant@google.com>
10502 * target-reloc.h (visibility_error): New inline function.
10503 (relocate_section): Call visibility_error.
10504 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10505 (MOSTLYCLEANFILES): Likewise.
10506 (protected_4_pic.o, protected_3.err): New targets.
10507 * testsuite/protected_4.cc: New file.
10509 2010-01-12 Doug Kwan <dougkwan@google.com>
10511 * arm.cc (Cortex_a8_reloc): New class.
10512 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10513 and cortex_a8_relocs_info_.
10514 (Target_arm::fix_cortex_a8): New method definition.
10515 (Target_arm::Cortex_a8_relocs_info): New type.
10516 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10517 New data member declarations.
10518 (Target_arm::scan_reloc_for_stub): Record information about
10519 relocations for THUMB branches that might be exempted from the
10520 Cortex-A8 workaround.
10521 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10522 at the beginning of a relaxation pass.
10524 2010-01-12 Doug Kwan <dougkwan@google.com>
10526 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10527 (Arm_relobj::Mapping_symbol_position,
10528 Arm_reloj::Mapping_symbol_position_less,
10529 Arm_relobj::Mapping_symbols_info): New types.
10530 (Target_arm::is_mapping_symbol_name): New method definition.
10531 (Arm_relobj::do_count_local_symbols): Save information about mapping
10534 2010-01-11 Doug Kwan <dougkwan@google.com>
10536 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10537 Arm_relocate_functions::thumb32_branch_upper,
10538 Arm_relocate_functions::thumb32_branch_lower,
10539 Arm_relocate_functions::thumb32_cond_branch_offset,
10540 Arm_relocate_functions::thumb32_cond_branch_upper,
10541 Arm_relocate_functions::thumb32_cond_branch_lower,
10542 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10543 branch offset encoding.
10544 (Arm_relocate_functions::thumb_branch_common): Use new branch
10545 offset encoding methods to avoid code duplication.
10546 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10547 (Stub_addend_reader::operator()): Use new branch encoding method
10548 to avoid code duplication.
10550 2010-01-11 Doug Kwan <dougkwan@google.com>
10552 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10553 (Target_arm::do_finalize_sections): Define special EXIDX section
10554 symbols only if referenced.
10555 * gc.h (Garbage_collection::add_reference): New method.
10556 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10559 2010-01-11 Ian Lance Taylor <iant@google.com>
10561 * script.cc (Version_script_info::build_expression_list_lookup):
10562 Change complaing about duplicate wildcard match from error to
10565 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10567 (Version_script_info::Version_script_info): Initialize globs_,
10568 default_version_, default_is_global_, and exact_. Don't
10569 initialize globals_ or locals_.
10570 (Version_script_info::build_lookup_tables): Build local symbols
10572 (Version_script_info::unquote): New function.
10573 (Version_script_info::add_exact_match): New function.
10574 (Version_script_info::build_expression_list_lookup): Remove lookup
10575 parameter. Add is_global parameter. Change all callers. Handle
10576 wildcard pattern specially. Unquote pattern. Call
10578 (Version_script_info::get_name_to_match): New function.
10579 (Version_script_info::get_symbol_version): New function.
10580 (Version_script_info::get_symbol_version_helper): Remove.
10581 (Version_script_info::check_unmatched_names): Call unquote.
10582 * script.h (class Version_script_info): Change get_symbol_version
10583 to be non-inline and add is_global parameter; change all callers.
10584 Rewrite symbol_is_local. Update declarations. Define struct
10585 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10586 Remove globals_ and locals_ members. Add exact_, globs_,
10587 default_version_, is_global_.
10588 (Version_script_info::Glob): Remove pattern, add expression and
10589 is_global. Update constructor. Change all callers.
10590 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10592 (Versions::symbol_section_contents): If a symbol is undefined, or
10593 defined in a dynamic object, set the version index to
10595 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10597 (Symbol_table::add_from_pluginobj): Likewise.
10598 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10600 2010-01-11 Doug Kwan <dougkwan@google.com>
10602 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10603 (incremental_dump_LDADD): Add linking option for libintl.
10604 * Makefile.in: Regenerate.
10606 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10609 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10611 * testsuite/Makefile.in: Regenerated.
10613 2010-01-10 Doug Kwan <dougkwan@google.com>
10615 * options.h (DEFINE_var): Use parentheses around argument varname__
10616 in macro body to avoid any unintended subsequent substitutions.
10618 2010-01-10 Ian Lance Taylor <iant@google.com>
10620 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10621 candidates before doing symbol resolution.
10623 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10624 ODR candidates if only one is weak.
10626 2010-01-08 Ian Lance Taylor <iant@google.com>
10628 * script.cc (Version_script_info::build_expression_list_lookup):
10629 Don't warn about ambiguous version, just record the ambiguity.
10630 (Version_script_info::get_symbol_version_helper): Give error if
10631 version is ambiguous.
10633 2010-01-08 Doug Kwan <dougkwan@google.com>
10635 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
10636 prev_data_size_ and prev_addralign_. Remove initializer for
10637 deleted data member has_been_changed_.
10638 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10639 to determine if the table is empty.
10640 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10642 (Stub_table::add_reloc_stub): Define method in class definition
10643 instead of just declaring it there.
10644 (Stub_table::add_cortex_a8_stub): New method definition.
10645 (Stub_table::update_data_size_and_addralign): Ditto.
10646 (Stub_table::finalize_stubs): Ditto.
10647 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10648 (Stub_table::do_addralign_): Return address alignment in the
10649 (Stub_table::do_reset_address_and_file_offset): Define method in
10650 class definition instead of declaring it there. Set current data
10651 size to be the data size of the previous pass.
10652 (Stub_table::set_final_data_size): Use current data size as the
10654 (Stub_table::relocate_stub): Change parameter type of stub from
10655 Reloc_stub pointer to Stub pointer.
10656 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10657 (Stub_table::Cortex_a8_stub_list): New typedef.
10658 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10659 Stub_table::prev_addralign_): New data member.
10660 (Arm_relobj::Arm_relobj): Initialize data member
10661 section_has_cortex_a8_workaround_.
10662 (Arm_relobj::section_has_cortex_a8_workaround,
10663 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10665 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10667 (Target_arm::relocate_stub): Change parameter type of stub from
10668 Reloc_stub pointer to Stub pointer.
10669 (Insn_template::size, Insn_template::alignment): Handle
10670 THUMB16_SPECIAL_TYPE.
10671 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10672 Stub_table::update_data_size_and_addralign,
10673 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10675 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10676 (Stub_table::do_write): Ditto.
10677 (Target_arm::do_relax): Adjust code for changes in Stub_table.
10679 2010-01-08 Ian Lance Taylor <iant@google.com>
10682 * symtab.h (class Symbol): Remove fields is_target_special_ and
10683 has_plt_offset_. Add field is_defined_in_discarded_section_.
10684 (Symbol::is_defined_in_discarded_section): New function.
10685 (Symbol::set_is_defined_in_discarded_section): New function.
10686 (Symbol::has_plt_offset): Rewrite.
10687 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10688 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10689 Don't initialize is_target_special_ or has_plt_offset_.
10690 Initialize is_defined_in_discarded_section_.
10691 (Symbol_table::add_from_relobj): If appropriate, set
10692 is_defined_in_discarded_section.
10693 * resolve.cc (Symbol::override_base_with_special): Don't test
10694 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10695 * target-reloc.h (relocate_section): Do special handling for
10696 symbols defined in discarded sections for global symbols as well
10699 2010-01-08 Ian Lance Taylor <iant@google.com>
10701 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10702 the SHT_SYMTAB case.
10704 2010-01-08 Ian Lance Taylor <iant@google.com>
10706 * object.cc (Sized_relobj::do_layout): Don't get confused if
10707 layout_eh_frame returns NULL.
10709 2010-01-08 Ian Lance Taylor <iant@google.com>
10712 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10713 dynamic symbol table, use the normal symbol table.
10714 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10717 2010-01-08 Ian Lance Taylor <iant@google.com>
10720 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10723 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10725 * version.cc (print_version): Change to "Copyright 2010".
10727 2010-01-08 Ian Lance Taylor <iant@google.com>
10731 * i386.cc (class Target_i386): Change return type of plt_section
10733 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10734 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10735 tls_desc_rel_ field.
10736 (Output_data_plt_i386::rel_tls_desc): New function.
10737 (Target_i386::rel_tls_desc_section): New function.
10738 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10739 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10740 R_386_TLS_DESC reloc in rel_tls_desc_section.
10741 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10742 Define struct Tlsdesc_info.
10743 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10744 (Target_x86_64::do_reloc_symbol_index): New function.
10745 (Target_x86_64::add_tlsdesc_info): New function.
10746 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10747 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10748 tlsdesc_rel_ field.
10749 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10751 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10752 (Target_x86_64::rela_tlsdesc_section): New function.
10753 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10755 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10756 (Target_x86_64::do_reloc_addend): New function.
10757 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10758 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10759 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10760 (Output_reloc::type): New function.
10761 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10762 (Output_reloc::is_target_specific): New function.
10763 (Output_reloc::target_arg): New function.
10764 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10765 absolute relocs and target specific relocs.
10766 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10767 add_target_specific.
10768 (class Output_data_reloc) [SHT_RELA]: Likewise.
10769 * output.cc (Output_reloc::Output_reloc): Add four new versions
10770 for absolute relocs and target specific relocs.
10771 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10772 (Output_reloc::get_symbol_index): Likewise.
10773 (Output_reloc::local_section_offset): Check that local_sym_index_
10774 is not TARGET_CODE or 0.
10775 (Output_reloc::symbol_value): Likewise.
10776 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10778 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10779 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10781 * layout.cc (add_target_dynamic_tags): Use output section for
10782 DT_PLTRELSZ and DT_JMPREL.
10784 2010-01-07 Ian Lance Taylor <iant@google.com>
10787 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10789 (class Output_data_reloc_generic): Define.
10790 (class Output_data_reloc_base): Change base class to
10791 Output_data_reloc_generic. Change add() method to call
10792 bump_relative_reloc_count for a relative reloc. Remove
10793 sort_relocs_ field.
10794 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10796 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10797 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10799 * layout.h (class Layout): Update declaration.
10801 2010-01-07 Ian Lance Taylor <iant@google.com>
10803 * output.h (class Output_data): Add const version of
10804 output_section and do_output_section.
10805 (class Output_section_data): Add const version of
10807 (class Output_section): Likewise.
10808 * layout.cc (Layout::add_target_dynamic_tags): New function.
10809 * layout.h (class Layout): Update declarations.
10810 * arm.cc (Target_arm::do_finalize_sections): Use
10811 add_target_dynamic_tags.
10812 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10813 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10814 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10815 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10817 2010-01-07 Ian Lance Taylor <iant@google.com>
10820 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10823 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10824 Ian Lance Taylor <iant@google.com>
10827 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10828 Xindex::read_symtab_xindex.
10830 2010-01-07 Doug Kwan <dougkwan@google.com>
10832 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10833 (Insn_template::thumb16_bcond_insn): New method declaration.
10834 (Insn_template): Fix spelling.
10835 (Stub::thumb16_special): New method declaration.
10836 (Stub::do_write): Define virtual method which was previously pure
10838 (Stub::do_thumb16_special): New method declaration.
10839 (Stub::do_fixed_endian_write): New template member.
10840 (Reloc_stub::do_write): Remove.
10841 (Reloc_stub::do_fixed_endian_write): Remove.
10842 (Cortex_a8_stub): New class definition.
10843 (Stub_factory::make_cortex_a8_stub): New method definition.
10844 (Stub_factory::Stub_factory): Add missing static storage class
10845 qualifier for elf32_arm_stub_a8_veneer_blx.
10847 2010-01-07 Ian Lance Taylor <iant@google.com>
10850 * options.h (class General_options): Add --warn-unresolved-symbols
10851 and --error-unresolved-symbols.
10852 * errors.cc (Errors::undefined_symbol): Implement
10853 --warn-unresolved-symbols.
10855 * options.h (class General_options): Add -z text and -z textoff.
10856 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10858 2010-01-06 Sriraman Tallam <tmsriram@google.com>
10860 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10861 (Garbage_collection::cident_sections): New function.
10862 (Garbage_collection::add_cident_section): New function.
10863 (Garbage_collection::cident_sections_): New member.
10864 (gc_process_relocs): Add references to sections whose names are C
10866 * gold.h (cident_section_start_prefix): New constant.
10867 (cident_section_stop_prefix): New constant.
10868 (is_cident): New function.
10869 * layout.cc (Layout::define_section_symbols): Replace string constants
10870 with the newly defined constants.
10871 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10873 * testsuite/Makefile.am: Add gc_orphan_section_test.
10874 * testsuite/Makefile.in: Regenerate.
10875 * testsuite/gc_orphan_section_test.cc: New file.
10876 * testsuite/gc_orphan_section_test.sh: New file.
10878 2010-01-06 Ian Lance Taylor <iant@google.com>
10881 * options.h (class General_options): Add --warn-shared-textrel.
10882 * layout.cc (Layout::finish_dynamic_section): Implement
10883 --warn-shared-textrel.
10886 * options.h (class General_options): Add --warn-multiple-gp.
10888 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10890 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10891 $(THREADSLIB) and $(LIBDL).
10892 * Makefile.in: Rebuild.
10894 2010-01-06 Ian Lance Taylor <iant@google.com>
10897 * options.cc (General_options::parse_section_start): New function.
10898 (General_options::section_start): New function.
10899 (General_options::General_options): Initialize all members.
10900 * options.h: Include <map>
10901 (class General_options): Add --section-start. Add section_starts_
10903 * layout.cc (Layout::attach_allocated_section_to_segment): If
10904 --section-start was used, set the address of the segment. Remove
10905 local sort_sections.
10906 (Layout::relaxation_loop_body): If the address of the load segment
10907 has been set by --section-start, don't use it.
10908 * output.h (Output_segment::update_flags_for_output_section): New
10910 * output.cc (Output_segment::add_output_section): Call
10911 update_flags_for_output_section.
10913 2010-01-05 Ian Lance Taylor <iant@google.com>
10916 * options.h (class General_options): Add --undefined-version.
10917 * script.cc (struct Version_expression): Add was_matched_by_symbol
10919 (Version_script_info::matched_symbol): New function.
10920 (Version_script_info::get_symbol_version_helper): Call
10922 (Version_script_info::check_unmatched_names): New function.
10923 * script.h (class Version_script_info): Update declarations.
10924 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10926 * options.h (class General_options): Use DEFINE_bool_alias for
10927 allow_multiple_definition.
10928 * resolve.cc (Symbol_table::should_override): Don't test
10929 allow_multiple_definition.
10932 * options.h (class General_options): Add --cref.
10933 * main.cc (main): Print cref table if --cref. Don't close mapfile
10934 until after printing cref table.
10935 * cref.cc: Include "symtab.h".
10936 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10937 (Cref_table_compare::operator()): New function.
10938 (Cref_inputs::gather_cref): New function.
10939 (filecol): New static const.
10940 (Cref_inputs::print_cref): New function.
10941 (Cref::print_cref): New function.
10942 * cref.h: Include <cstdio>.
10943 (class Cref): Update declarations.
10944 * mapfile.h (Mapfile::file): New function.
10945 * object.h (class Object): Define Symbols. Declare virtual
10946 do_get_global_symbols.
10947 (Object::get_global_symbols): New function.
10948 * object.cc (Input_objects::add_object): Pass object to cref_ if
10950 (Input_objects::archive_start): Likewise.
10951 (Input_objects::archive_stop): Likewise.
10952 (Input_objects::print_cref): New function.
10953 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10954 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10956 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10958 * plugin.h (class Sized_pluginobj): Update declarations.
10960 2010-01-05 Ian Lance Taylor <iant@google.com>
10962 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10963 to is_default_version. Rename insdef to insdefault.
10964 (Symbol_table::add_from_relobj): Rename def to is_default_version
10965 and local to is_forced_local.
10966 (Symbol_table::add_from_pluginobj): Likewise.
10967 (Symbol_table::add_from_dynobj): Likewise.
10968 (Symbol_table::define_special_symbol): Rename insdef to
10971 2010-01-04 Ian Lance Taylor <iant@google.com>
10974 * options.h (class General_options): Add
10975 --allow-multiple-definition and -z muldefs.
10976 * resolve.cc (Symbol_table::should_override): Don't warn about a
10977 multiple symbol definition if --allow-multiple-definition or -z
10981 * options.h (class General_options): Add --add-needed and
10982 --copy-dt-needed-entries. Tweak --as-needed help entry.
10983 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10984 error if --copy-dt-needed-entries aka --add-needed is used and
10985 would cause a change in behaviour.
10988 * options.h (class General_options): Add -G as a short version of
10989 --shared. Add no-op options -assert, -g, and -i.
10991 2010-01-04 Sriraman Tallam <tmsriram@google.com>
10993 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10994 check for .text or .gnu.linkonce.t sections.
10995 * icf.cc (Icf::find_identical_sections): Ditto.
10996 Change the detection for mangled function name within the section
10998 * icf.h (is_section_foldable_candidate): New function.
11000 2009-12-30 Ian Lance Taylor <iant@google.com>
11003 * options.h (class General_options): Permit two dashes with
11004 --retain-symbols-file.
11006 2009-12-30 Ian Lance Taylor <iant@google.com>
11009 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11010 don't put the file header and segment headers in the text
11014 * common.cc (Sort_commons::operator()): Stabilize sort when both
11016 (Symbol_table::do_allocate_commons_list): When allocating common
11017 symbols, skip a symbol which is no longer common.
11018 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11019 an object before checking its type.
11020 * testsuite/common_test_2.c: New file.
11021 * testsuite/common_test_3.c: New file.
11022 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11023 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11024 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11025 (common_test_2_pic.o, common_test_2.so): New targets.
11026 (common_test_3_pic.o, common_test_3.so): New targets.
11027 * testsuite/Makefile.in: Rebuild.
11030 * script.cc (read_input_script): If we see a new SECTIONS clause,
11031 and we have added an input section, give an error.
11032 * layout.h (class Layout): Add have_added_input_section function.
11033 Add have_added_input_section_ field.
11034 * layout.cc (Layout::Layout): Initialize
11035 have_added_input_section_.
11036 (Layout::layout): Set have_added_input_section_.
11037 (Layout::layout_eh_frame): Likewise.
11039 2009-12-30 Ian Lance Taylor <iant@google.com>
11042 * options.h (class General_options): Add --sort-common option.
11043 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11044 * common.cc (Sort_common): Add sort_order parameter to
11045 constructor. Add sort_order_ field.
11046 (Sort_commons::operator): Check sort_order_.
11047 (Symbol_table::allocate_commons): Determine the sort order.
11048 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11049 Change all callers.
11050 (Symbol_table::do_allocate_commons_list): Likewise.
11052 2009-12-30 Ian Lance Taylor <iant@google.com>
11055 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11056 symbols from this object, don't change the visibility of an
11058 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11060 2009-12-30 Ian Lance Taylor <iant@google.com>
11063 * script.h (class Version_script_info): Define Language enum.
11064 Update declarations. Define Glob, Exact, and Lookup types. Add
11065 new fields globals_, locals_, and is_finalized_.
11066 * script.cc: Various formatting fixes.
11067 (class Parser_closure): Change language_stack_ from a vector of
11068 std::string to one of Version_script_info::Language. Adjust all
11070 (class Lazy_demangler): Remove.
11071 (struct Version_expression): Change language from std::string to
11072 Version_script_info::Language.
11073 (Version_script_info::Version_script_info): New function.
11074 (Version_script_info::~Version_script_info): Don't call clear.
11075 (Version_script_info::finalize): New function.
11076 (Version_script_info::build_lookup_tables): New function.
11077 (Version_script_info::build_expression_list_lookup): New
11079 (Version_script_info::get_symbol_version_helper): Rewrite to use
11081 (Version_script_info::print_expression_list): Adjust to use
11082 Version_script_info::Language.
11083 (script_push_lex_into_version_mode): Check that the version script
11084 has not been finalized.
11085 (version_script_push_lang): Change language string to
11086 Version_script_info::Language.
11087 * options.cc (Command_line::version_script): New function.
11088 * options.h (class General_options): Add finalize_dynamic_list
11089 function. Change version_script from declaration to definition.
11090 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11091 * testsuite/version_script.map: Remove duplicate def of foo.
11092 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11093 version_script.map.
11094 * testsuite/Makefile.in: Rebuild.
11096 2009-12-30 Ian Lance Taylor <iant@google.com>
11099 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11100 if the input symbol index is 0, make the output symbol index 0.
11102 2009-12-30 Ian Lance Taylor <iant@google.com>
11105 * options.h (class General_options): Add -x/--discard-all.
11106 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11107 --discard-all. If the local symbol needs a dynamic entry, check
11108 that before handling --discard-locals.
11110 2009-12-30 Ian Lance Taylor <iant@google.com>
11113 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11115 (Output_segment::add_output_section): Don't change the flags if
11116 the type is PT_TLS.
11119 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11120 GNU hash table if they need a dynamic value. Otherwise, don't add
11121 them if they are defined in a dynamic object or are forced local.
11123 2009-12-29 Ian Lance Taylor <iant@google.com>
11126 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11127 .gnu.hash table for a 32-bit target.
11130 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11131 regular and a dynamic object only needs a dynamic symbol table
11132 entry if it is externally visible.
11135 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11136 constructor. Add global_offset_table_ field.
11137 (Target_i386::got_section): Set global_offset_table_.
11138 (Target_i386::do_finalize_sections): Set global_offset_table_
11140 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11141 in constructor. Add global_offset_table_ field.
11142 (Target_x86_64::got_section): Set global_offset_table_.
11143 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11146 * layout.cc (Layout::Layout): Initialize increase_relro_.
11147 (Layout::get_output_section): Add is_relro, is_last_relro, and
11148 is_first_non_relro parameters. Change all callers.
11149 (Layout::choose_output_section): Likewise.
11150 (Layout::add_output_section_data): Likewise.
11151 (Layout::make_output_section): Likewise.
11152 (Layout::set_segment_offsets): Clear increase_relro when using a
11154 * layout.h (class Layout): Add increase_relro method. Add
11155 increase_relro_ field. Update declarations.
11156 * output.cc (Output_section::Output_section): Initialize
11157 is_last_relro_ and is_first_non_relro_.
11158 (Output_segment::add_output_section): Group relro sections is
11159 do_sort is true. Handle is_last_relro and is_first_non_relro.
11160 (Output_segment::maximum_alignment): Remove relro handling.
11161 (Output_segment::set_section_addresses): Add increase_relro
11162 parameter. Change all callers. Add initial alignment to align
11163 relro sections on separate page. Remove old relro handling.
11164 (Output_segment::set_section_list_addresses): Remove in_relro
11165 parameter. Change all callers.
11166 (Output_segment::set_offset): Add increase parameter. Change all
11167 callers. Remove old relro handling.
11168 * output.h (class Output_section): Add new methods: is_last_relro,
11169 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11170 Add is_last_relro_ and is_first_non_relro_ fields.
11171 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11172 Create separate .got.plt section. Call increase_relro.
11173 * x86_64.cc (Target_x86_64::got_section): Likewise.
11174 * testsuite/relro_script_test.t: Add .got.plt.
11177 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11178 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11179 (Layout::finalize): Call set_dynamic_symbol_size.
11180 (Layout::set_dynamic_symbol_size): New function.
11181 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11182 set_dynamic_symbol_size.
11185 * output.h (class Output_section): Add is_entsize_zero_ field.
11186 * output.cc (Output_section::Output_section): Initialize
11188 (Output_section::set_entsize): If two different entsizes are
11189 requested, force it to zero.
11190 (Output_section::add_input_section): Set flags for .debug_str
11191 before updating section flags. Set entsize.
11192 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11193 and SHF_STRING if all input sections have those flags.
11195 2009-12-29 Rafael Espindola <espindola@google.com>
11197 * main.cc (main): Fix the sys time reporting.
11198 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11201 2009-12-29 Sriraman Tallam <tmsriram@google.com>
11203 * options.cc (General_options::parse_version): Allow -v to exit
11204 without an error if there is nothing to link.
11206 2009-12-29 Ian Lance Taylor <iant@google.com>
11208 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11209 using a version of gcc before 4.1.
11210 * configure: Rebuild.
11212 2009-12-28 Chris Demetriou <cgd@google.com>
11214 * attributes.cc (Output_attributes_section_data::do_write): Use
11215 std::vector::front rather than std::vector::data.
11217 2009-12-28 Ian Lance Taylor <iant@google.com>
11219 * symtab.h (class Symbol_table): Add enum Defined.
11220 * resolve.cc (Symbol_table::should_override): Add defined
11221 parameter. Change all callers. Test whether object is NULL
11222 before calling a method on it.
11223 (Symbol_table::report_resolve_problem): Add defined parameter.
11224 Change all callers.
11225 (Symbol_table::should_override_with_special): Likewise.
11226 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11227 parameter. Change all callers.
11228 (Symbol_table::do_define_in_output_data): Likewise.
11229 (Symbol_table::define_in_output_segment): Likewise.
11230 (Symbol_table::do_define_in_output_segment): Likewise.
11231 (Symbol_table::define_as_constant): Likewise.
11232 (Symbol_table::do_define_as_constant): Likewise.
11233 * script.h (class Symbol_assignment): Add is_defsym parameter to
11234 constructor; change all callers.
11235 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11236 parameter. Change all callers. Add is_defsym_ field.
11237 (class Parser_closure): Add parsing_defsym parameter to
11238 constructor; change all callers. Add parsing_defsym accessor
11239 function. Add parsing_defsym_ field.
11241 2009-12-28 Ian Lance Taylor <iant@google.com>
11243 * gold.cc (queue_middle_tasks): Fix formatting.
11244 * object.cc (Relobj::is_section_name_included): Likewise.
11246 2009-12-23 Ian Lance Taylor <iant@google.com>
11248 * i386.cc (Target_i386::do_calls_non_split): Recognize
11249 -fsplit-stack prologue for a function with a static chain.
11250 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11251 -fsplit-stack prologue when using %r11.
11253 2009-12-21 Sriraman Tallam <tmsriram@google.com>
11255 * options.cc (General_options::parse_version): Make -v continue and do
11256 the link like GNU ld does.
11258 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
11260 * Makefile.am (CCFILES): Add timer.cc.
11261 (HFILES): Add timer.h.
11262 * configure.ac: Check for sysconf and times.
11263 * main.cc: include timer.h.
11264 (main): Use Timer instead of get_run_time.
11267 * workqueue.cc: include timer.h.
11268 (Workqueue::find_and_run_task):
11269 Report user, sys and wall time.
11270 * Makefile.in: Regenerate.
11271 * config.in: Regenerate.
11272 * configure: Regenerate.
11274 2009-12-16 Doug Kwan <dougkwan@google.com>
11276 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11278 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11279 relaxed input sections.
11280 * output.cc (Output_section::find_relaxed_input_section): Change
11281 return type to Output_relaxed_input_section pointer. Adjust code
11282 for new type of relaxed_input_section_map_.
11283 * output.h (Output_section::find_relaxed_input_section): Change
11284 return type to Output_relaxed_input_section pointer.
11285 (Output_section::Output_relaxed_input_section_by_input_section_map):
11287 (Output_section::relaxed_input_section_map_): Change type to
11288 Output_section::Output_relaxed_input_section_by_input_section_map.
11289 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11292 2009-12-15 Ian Lance Taylor <iant@google.com>
11294 * layout.cc (Layout::create_shstrtab): Only write out after input
11295 sections if we are compressing debug sections.
11297 2009-12-15 Ian Lance Taylor <iant@google.com>
11299 * archive.cc (Archive::add_symbols): Only look up a symbol without
11300 a version if there is, in fact, a version.
11302 2009-12-14 Ian Lance Taylor <iant@google.com>
11304 Revert -Wshadow changes, all changes from:
11305 2009-12-11 Doug Kwan <dougkwan@google.com>
11306 2009-12-11 Nick Clifton <nickc@redhat.com>
11307 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11309 2009-12-11 Doug Kwan <dougkwan@google.com>
11311 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11313 * attributes.cc (Object_attribute::size): Ditto.
11314 (Attributes_section_data::size): Ditto.
11315 (Attributes_section_data::Attributes_section_data): Ditto.
11316 (Output_attributes_section_data::do_write): Ditto.
11317 * attributes.h (Object_attribute::set_type): Ditto.
11318 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11320 2009-12-11 Nick Clifton <nickc@redhat.com>
11322 * archive.cc: Fix shadowed variable warnings.
11323 * arm.cc: Likewise.
11324 * compressed_output.cc: Likewise.
11325 * compressed_output.h: Likewise.
11326 * configure: Likewise.
11327 * dwarf_reader.cc: Likewise.
11328 * dynobj.cc: Likewise.
11329 * dynobj.h: Likewise.
11330 * ehframe.cc: Likewise.
11331 * ehframe.h: Likewise.
11332 * errors.cc: Likewise.
11333 * expression.cc: Likewise.
11334 * fileread.cc: Likewise.
11335 * fileread.h: Likewise.
11336 * freebsd.h: Likewise.
11337 * i386.cc: Likewise.
11338 * icf.cc: Likewise.
11339 * incremental.h: Likewise.
11340 * layout.cc: Likewise.
11341 * layout.h: Likewise.
11342 * mapfile.cc: Likewise.
11343 * merge.cc: Likewise.
11344 * merge.h: Likewise.
11345 * object.cc: Likewise.
11346 * object.h: Likewise.
11347 * options.h: Likewise.
11348 * output.cc: Likewise.
11349 * output.h: Likewise.
11350 * parameters.cc: Likewise.
11351 * plugin.cc: Likewise.
11352 * powerpc.cc: Likewise.
11353 * reduced_debug_output.cc: Likewise.
11354 * reduced_debug_output.h: Likewise.
11355 * reloc.cc: Likewise.
11356 * reloc.h: Likewise.
11357 * resolve.cc: Likewise.
11358 * script-sections.cc: Likewise.
11359 * script.cc: Likewise.
11360 * script.h: Likewise.
11361 * sparc.cc: Likewise.
11362 * symtab.cc: Likewise.
11363 * symtab.h: Likewise.
11364 * target-select.cc: Likewise.
11365 * target-select.h: Likewise.
11366 * token.h: Likewise.
11367 * workqueue.cc: Likewise.
11368 * workqueue.h: Likewise.
11369 * x86_64.cc: Likewise.
11371 2009-12-10 Doug Kwan <dougkwan@google.com>
11373 * arm.cc (attributes.h): New include.
11374 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11375 (Arm_relobj::~Arm_relobj): Delete object pointed by
11376 attributes_section_data_.
11377 (Arm_relobj::attributes_section_data): New method definition.
11378 (Arm_relobj::attributes_section_data_): New data member declaration.
11379 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11380 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11381 attributes_section_data_.
11382 (Arm_dynobj::attributes_section_data): New method definition.
11383 (Arm_dynobj::attributes_section_data_): New data member declaration.
11384 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11385 initialization value of may_use_blx_ to false.
11386 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
11387 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11388 object attributes to compute results instead of hard-coding.
11389 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11390 Target_arm::get_secondary_compatible_arch,
11391 Target_arm::set_secondary_compatible_arch
11392 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11393 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11394 New method declarations.
11395 (Target_arm::get_aeabi_object_attribute): New method definition.
11396 (Target_arm::attributes_section_data_): New data member declaration.
11397 (read_arm_attributes_section): New template definition.
11398 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11399 (Arm_dynobj::do_read_symbols): Ditto.
11400 (Target_arm::do_finalize_sections): Merge attributes sections from
11401 input. Check for BLX use after attributes section merging.
11402 Fix __exidx_start and __exidx_end visibility. Create an
11403 .ARM.attributes section if necessary.
11404 (Target_arm::get_secondary_compatible_arch,
11405 Target_arm::set_secondary_compatible_arch,
11406 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11407 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
11408 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
11409 New method definitions.
11411 2009-12-09 Ian Lance Taylor <iant@google.com>
11413 * plugin.cc (Plugin::load): Don't cast from void* to a function
11416 2009-12-09 Ian Lance Taylor <iant@google.com>
11418 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11419 information fields.
11421 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11423 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11424 Replace two_file_shared_1.so with two_file_shared_2.so.
11425 * testsuite/Makefile.in: Regenerated.
11427 2009-12-08 Doug Kwan <dougkwan@google.com>
11429 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11430 (HFILES): Add attributes.h and int_encoding.h.
11431 * Makefile.in: Regenerate.
11432 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11433 function definitions to int_encoding.cc
11434 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11435 prototypes to int_encoding.h
11436 * reduced_debug_output.cc (int_encoding.h): New include.
11437 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11438 function definitions to int_encoding.cc
11439 (insert_into_vector, read_from_pointer): Move template definitions to
11441 * attributes.cc: New file.
11442 * attributes.h: New file.
11443 * int_encoding.cc: New file.
11444 * int_encoding.h: New file.
11446 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
11449 * incremental-dump.cc (dump_incremental_inputs): New.
11450 (main): Use dump_incremental_inputs.
11452 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11455 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11456 checking elfcpp::STT_FUNC.
11457 (Target_i386::Relocate::relocate): Likewise.
11458 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11460 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11461 symbols from shared libraries into normal FUNC symbols.
11463 * symtab.h (Symbol): Add is_func and use it.
11465 2009-12-05 Doug Kwan <dougkwan@google.com>
11467 * arm.cc (Target_arm::arm_info): Initialize new fields
11468 attributes_section and attributes_vendor.
11469 * i386.cc (Target_i386::i386_info): Same.
11470 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11471 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11472 fields attributes_section and attributes_vendor.
11473 * sparc.cc (Target_sparc::sparc_info): Same.
11474 * target.h (Target::attributes_section, Target::attributes_vendor,
11475 Target::is_attributes_section, Target::attribute_arg_type,
11476 Target::attributes_order): New method definitions.
11477 (Target::Target_info::attributes_section,
11478 Target::Target_info::attributes_vendor): New fields.
11479 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11480 virtual method definitions.
11481 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11482 attributes_section and attributes_vendor.
11483 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11485 2009-12-05 Doug Kwan <dougkwan@google.com>
11487 * arm.cc: Update comments about interworking and stub generation.
11488 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11489 considered as non-PIC.
11490 (Arm_relocate_functions::base_abs): Fix formatting.
11491 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11492 of function to use GOT entry address instead of offset.
11493 (Target_arm::Scan::global): Issue an error if a symbol would need a
11494 PLT does not get one because it is untyped. Remove code to create
11495 dynamic symbols for relative branches.
11496 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11497 takes unsigned integer instead of boolean.
11499 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11501 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11502 (two_file_test_LDADD): Likewise.
11503 (common_test_1_LDADD): Likewise.
11504 (exception_test_LDADD) Likewise.
11505 (weak_test_LDADD): Likewise.
11506 (many_sections_test_LDADD): Likewise.
11507 (initpri1_LDADD): Likewise.
11508 (script_test_1_LDADD): Likewise.
11509 (script_test_2_LDADD): Likewise.
11510 (justsyms_LDADD): Likewise.
11511 (binary_test_LDADD): Likewise.
11512 (large_LDADD): Likewise.
11513 * testsuite/Makefile.in: Regenerated.
11515 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
11517 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11518 (Symbol_table::override_with_special): Likewise.
11519 (Symbol_table::add_from_object): Likewise.
11521 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
11523 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11524 Don't set the data_offset twice.
11526 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
11528 * testsuite/Makefile.in: Regenerate.
11530 2009-12-03 Doug Kwan <dougkwan@google.com>
11532 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11533 (Target_arm::do_finalize_sections): Add parameter for symbol table
11534 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11535 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11536 parameter for symbol table pointer.
11537 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11538 an additional parameter for a pointer to symbol table.
11539 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11540 parameter for a symbol table pointer.
11541 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11542 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11544 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11545 parameter for a symbol table pointer.
11547 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
11549 * incremental.cc (Incremental_inputs_header)
11550 (Incremental_inputs_header_write, Incremental_inputs_entry)
11551 (Incremental_inputs_entry_write): Move ...
11552 * incremental.h (Incremental_inputs_header)
11553 (Incremental_inputs_header_write, Incremental_inputs_entry)
11554 (Incremental_inputs_entry_write): here.
11556 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11558 * incremental.cc (make_sized_incremental_binary): Set the target.
11559 Error if it is incompatible.
11560 * output.h (Output_file): Add filename method.
11562 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11564 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11565 from the get_* methods.
11567 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11569 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11570 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11571 Write 0 for the data_offset of scripts.
11573 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11575 * testsuite/Makefile.am: Add the incremental_test.sh test.
11576 * testsuite/incremental_test.sh: New.
11577 * testsuite/incremental_test_1.c: New.
11578 * testsuite/incremental_test_2.c: New.
11580 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
11582 * incremental-dump.cc (main): Fix typos.
11584 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
11587 * incremental-dump.cc (main): Use llu to print 64 bit values.
11589 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11590 H.J. Lu <hongjiu.lu@intel.com>
11592 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11594 (incremental_dump_LDADD): Likewise.
11595 * Makefile.in: Regenerated.
11597 2009-11-25 Doug Kwan <dougkwan@google.com>
11601 2009-11-25 Doug Kwan <dougkwan@google.com>
11603 * arm.cc (Target_arm::Target_arm): Move method definition
11604 outside of class definition. Add code to handle
11605 --target1-rel, --target1-abs and --target2= options.
11606 (Target_arm::get_reloc_reloc_type): Change method to be
11607 non-static and const.
11608 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11609 New data member declaration.
11610 (Target_arm::Scan::local, Target_arm::Scan::global,
11611 Target_arm::Relocate::relocate,
11612 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11613 Adjust call to Target_arm::get_real_reloc_type.
11614 (Target_arm::get_real_reloc_type): Use command line options
11615 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11616 * options.h (--target1-rel, --target1-abs, --target2): New
11619 2009-11-25 Doug Kwan <dougkwan@google.com>
11621 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11622 class definition. Add code to handle --target1-rel, --target1-abs
11623 and --target2= options.
11624 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11626 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11627 member declaration.
11628 (Target_arm::Scan::local, Target_arm::Scan::global,
11629 Target_arm::Relocate::relocate,
11630 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11631 call to Target_arm::get_real_reloc_type.
11632 (Target_arm::get_real_reloc_type): Use command line options to
11633 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11634 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11637 2009-11-25 Doug Kwan <dougkwan@google.com>
11639 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11640 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11641 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11643 (Arm_relocate_functions::thm_call): Replace body with a call to
11644 Arm_relocate_functions::thumb_branch_common.
11645 (Arm_relocate_functions::thm_jump24,
11646 Arm_relocate_functions::thm_xpc22): New method definitions.
11647 (Arm_relocate_functions::thumb_branch_common): New method definition.
11648 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11650 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11651 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11653 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11655 * Makefile.am: Build incremental-dump
11656 * Makefile.in: Regenerate.
11657 * incremental-dump.cc: New.
11658 * incremental.cc (Incremental_inputs_header_data,
11659 Incremental_inputs_entry_data): Move to incremental.h
11660 * incremental.h: (Incremental_inputs_header_data,
11661 Incremental_inputs_entry_data): Move from incremental.cc
11663 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11665 * incremental.cc (Incremental_inputs_header,
11666 Incremental_inputs_header_write, Incremental_inputs_entry,
11667 Incremental_inputs_entry_write): Add a typedef with the data type.
11669 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11671 * incremental.cc (Incremental_inputs_header,
11672 Incremental_inputs_header_write, Incremental_inputs_entry,
11673 Incremental_inputs_entry_write): Update comment about which
11674 type has the filed descriptions.
11676 2009-11-15 Doug Kwan <dougkwan@google.com>
11678 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11679 (Arm_relocate_functions::arm_branch_common): Change method defintion
11680 in class definition to a method declaration and update list of formal
11682 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11683 Arm_relocation_functions::jump24): Adjust call to
11684 Arm_relocate_functions::arm_branch_common. Update list of formal
11686 (Arm_relocate_functions::xpc25): New method definition.
11687 (Arm_relocate_functions::arm_branch_common): Move method defintion
11688 out from class definition. Use stubs for mode-switching and extending
11690 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11691 specially. Change code to enable use of stubs in ARM branches.
11693 2009-11-10 Doug Kwan <dougkwan@google.com>
11695 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11696 in method declaration.
11697 (Target_arm::relocate_stub): New method declaration.
11698 (Target_arm::default_target): Change to return a pointer instead of
11700 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11701 Target_arm::default_target.
11702 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11704 (Target_arm::relocate_section): Adjust view.
11705 (Target_arm::relocate_stub): New method definition.
11707 2009-11-10 Doug Kwan <dougkwan@google.com>
11709 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11711 * incremental.cc (open_incremental_binary): Initialized local
11712 variables to avoid warnings.
11713 * object.cc (make_elf_object): Ditto.
11714 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11717 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11720 * testsuite/plugin_test.c: Include "config.h".
11722 2009-11-09 Doug Kwan <dougkwan@google.com>
11724 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11725 (arm_symbol_value): Remove.
11726 (Arm_relocate_functions::arm_branch_common,
11727 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11728 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11729 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11730 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11731 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11732 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11733 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11734 Arm_relocate_functions::thm_mobw_abs_nc,
11735 Arm_relocate_functions::thm_mov_abs,
11736 Arm_relocate_functions::movw_prel_nc,
11737 Arm_relocate_functions::thm_movt_abs,
11738 Arm_relocate_functions::movt_prel,
11739 Arm_relocate_functions::thm_movw_prel_nc,
11740 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11741 (Target_arm::Relocate::relocate): Only decompose address into two
11742 parts if relocation type uses the thumb-bit and pass the actual
11743 bit instead of a flag indicating that the thumb-bit is used. Adjust
11744 calls to methods in Arm_relocate_functions for this change.
11746 2009-11-08 Ian Lance Taylor <iant@google.com>
11749 * reloc.cc: Instantiate
11750 Sized_relobj::initialize_input_to_output_maps and
11751 Sized_relobj:free_input_to_output_maps.
11753 2009-11-06 Ian Lance Taylor <iant@google.com>
11756 * defstd.cc (in_segment): Set only_if_ref true for "end".
11758 2009-11-06 Doug Kwan <dougkwan@google.com>
11760 * arm.cc (class Reloc_stub): Correct a comment.
11761 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11762 (Target_arm::scan_section_for_stubs): New method declaration.
11763 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11764 Change methods from private to protected.
11765 (Target_arm::do_may_relax): New method definition.
11766 (Target_arm::do_relax, Target_arm::group_sections,
11767 Target_arm::scan_reloc_for_stub,
11768 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11769 (Target_arm::arm_input_section_map_): New data member declaration.
11770 (Target_arm::scan_reloc_for_stub,
11771 Target_arm::scan_reloc_section_for_stubs,
11772 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11773 Target_arm::do_relax): New method definitions.
11775 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11777 * configure.ac: Check for (struct stat)::st_mtim
11778 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11779 * config.in: Regenerate.
11780 * configure: Regenerate.
11782 2009-11-05 Ian Lance Taylor <iant@google.com>
11785 * output.cc (Output_segment::add_output_section): Add missing
11788 2009-11-04 Ian Lance Taylor <iant@google.com>
11791 * object.h (class Object): Add is_needed and set_is_needed
11792 methods. Add is_needed_ field. Make bool fields into bitfields.
11793 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11794 defined in a dynamic object and referenced by a regular object,
11795 set is_needed for the dynamic object.
11796 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11797 if the file is marked with as_needed and it is not needed.
11799 2009-11-04 Ian Lance Taylor <iant@google.com>
11802 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11803 tags if data is discarded by linker script.
11804 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11805 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11806 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11807 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11809 2009-11-04 Ian Lance Taylor <iant@google.com>
11811 * layout.cc (Layout::get_output_section): Add is_interp and
11812 is_dynamic_linker_section parameters. Change all callers.
11813 (Layout::choose_output_section): Likewise.
11814 (Layout::make_output_section): Likewise.
11815 (Layout::add_output_section_data): Add is_dynamic_linker_section
11816 parameter. Change all callers.
11817 * layout.h (class Layout): Update declarations.
11818 * output.h (class Output_section): Add is_interp, set_is_interp,
11819 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11820 Add is_interp_, is_dynamic_linker_section_ fields. Change
11821 generate_code_fills_at_write_ to a bitfield.
11822 * output.cc (Output_section::Output_sections): Initialize new
11824 (Output_segment::add_output_section): Add do_sort parameter.
11825 Change all callers.
11827 2009-11-03 Ian Lance Taylor <iant@google.com>
11830 * options.h (class General_options): Add --warn-common.
11831 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11832 merging two common symbols.
11833 (Symbol_table::should_override): Handle --warn-common when merging
11834 a common symbol with a defined symbol. Use report_resolve_problem
11835 for multiple definitions.
11836 (Symbol_table::report_resolve_problem): New function.
11837 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11839 2009-11-03 Doug Kwan <dougkwan@google.com>
11841 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11843 (Target_arm::stub_factory): New method definition.
11844 (Target_arm::new_arm_input_section,
11845 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11846 Target_arm::reloc_uses_thumb_bit): New method declarations.
11847 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
11848 New type definitions.
11849 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11850 member declarations.
11851 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11852 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11853 New method definitions.
11855 2009-11-03 Ian Lance Taylor <iant@google.com>
11857 * options.h (class General_options): Add --warn_constructors.
11859 2009-11-03 Ian Lance Taylor <iant@google.com>
11862 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11863 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11865 2009-11-03 Ian Lance Taylor <iant@google.com>
11868 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11869 --msgid-bugs-address.
11870 (install-pdf): New target.
11871 (install-data_yes): Look up one directory to find mkinstalldirs.
11873 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11875 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11878 2009-10-30 Doug Kwan <dougkwan@google.com>
11880 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11882 2009-10-30 Doug Kwan <dougkwan@google.com>
11884 * arm.cc (Stub_addend_reader): New struct template definition
11885 and partial specializations.
11886 (Stub_addend_reader::operator()): New method definition for a
11887 partially specialized template.
11889 2009-10-30 Doug Kwan <dougkwan@google.com>
11891 * arm.cc (Arm_relobj::processor_specific_flags): New method
11893 (Arm_relobj::do_read_symbols): New method declaration.
11894 (Arm_relobj::processor_specific_flags_): New data member declaration.
11895 (Arm_dynobj): New class definition.
11896 (Target_arm::do_finalize_sections): Add input_objects parameter.
11897 (Target_arm::do_adjust_elf_header): New method declaration.
11898 (Target_arm::are_eabi_versions_compatible,
11899 (Target_arm::merge_processor_specific_flags): New method declaration.
11900 (Target_arm::do_make_elf_object): New overloaded method definitions
11902 (Arm_relobj::do_read_symbols): New method definition.
11903 (Arm_dynobj::do_read_symbols): Ditto.
11904 (Target_arm::do_finalize_sections): Add input_objects parameters.
11905 Merge processor-specific flags from all input objects.
11906 (Target_arm::are_eabi_versions_compatible,
11907 Target_arm::merge_processor_specific_flags,
11908 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11909 New method definitions.
11910 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11911 Input_objects pointer type parameter.
11912 * layout.cc (Layout::finalize): Pass input objects to target's.
11913 finalize_sections function.
11914 * output.cc (Output_file_header::do_sized_write): Set ELF file
11915 header's processor-specific flags.
11916 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11917 Input_objects pointer type parameter.
11918 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11919 * target.h (Input_objects): New forward class declaration.
11920 (Target::processor_specific_flags,
11921 Target::are_processor_specific_flags_sect): New method definitions.
11922 (Target::finalize_sections): Add input_objects parameter.
11923 (Target::Target): Initialize processor_specific_flags_ and
11924 are_processor_specific_flags_set_.
11925 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11927 (Target::set_processor_specific_flags): New method definition.
11928 (Target::processor_specific_flags_,
11929 Target::are_processor_specific_flags_set_): New data member
11931 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11932 Input_objects pointer type parameter.
11934 2009-10-30 Doug Kwan <dougkwan@google.com>
11936 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11938 2009-10-28 Ian Lance Taylor <iant@google.com>
11940 * object.h (class Relobj): Drop options parameter from
11941 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11942 do_scan_relocs, do_relocate. Change all callers.
11943 (class Sized_relobj): Drop options parameters from
11944 do_gc_process_relocs, do_scan_relocs, do_relocate,
11945 do_relocate_sections, relocate_sections, emit_relocs_scan,
11946 emit_relocs_scan_reltype. Change all callers.
11947 (struct Relocate_info): Remove options field and all references to
11949 * reloc.h (class Read_relocs): Remove options constructor
11950 parameter and options_ field. Change all callers.
11951 (class Gc_process_relocs, class Scan_relocs): Likewise.
11952 (class Relocate_task): Likewise.
11953 * target-reloc.h (scan_relocs): Remove options parameter. Change
11955 (scan_relocatable_relocs): Likewise.
11956 * target.h (class Sized_target): Remove options parameter from
11957 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11959 * gc.h (gc_process_relocs): Remove options parameter. Change all
11961 * arm.cc: Update functions to remove options parameters.
11962 * i386.cc: Likewise.
11963 * powerpc.cc: Likewise.
11964 * sparc.cc: Likewise.
11965 * x86_64.cc: Likewise.
11966 * testsuite/testfile.cc: Likewise.
11968 2009-10-28 Doug Kwan <dougkwan@google.com>
11970 * arm.cc (Arm_relobj): New class definition.
11971 (Arm_relobj::scan_sections_for_stubs,
11972 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11973 New method definitions.
11975 2009-10-28 Cary Coutant <ccoutant@google.com>
11977 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11978 (Plugin::cleanup_done_): New member.
11979 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11980 (Plugin_manager::cleanup_done_): Remove.
11981 (Plugin_manager::add_input_file): Edit error message.
11982 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11983 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11985 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11987 * fileread.cc: (File_read::View::~View): Use the new
11988 data_ownership_ filed.
11989 (File_read::~File_read): Dispose the new whole_file_view_.
11990 (File_read::open): Mmap the whole file if needed.
11991 (File_read::open): Use whole_file_view_ instead of contents_.
11992 (File_read::find_view): Use whole_file_view_ if applicable.
11993 (File_read::do_read): Use whole_file_view_ instead of contents_.
11994 (File_read::make_view): Use whole_file_view_ instead of contents_,
11995 update File_read::View::View call.
11996 (File_read::find_or_make_view): Update File_read::View::View
11998 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12000 (File_read::View::Data_ownership): New enum.
12001 (File_read::View::View): Replace bool mapped_ with Data_ownership
12003 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12004 (File_read::View::data_ownership_): New field.
12005 (File_read::contents_): Remove (replaced by whole_file_view_).
12006 (File_read::whole_file_view_): New field.
12007 * options.h (class General_options): Add --keep-files-mapped.
12009 2009-10-27 Cary Coutant <ccoutant@google.com>
12011 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12012 * testsuite/Makefile.am (plugin_test_5): New test case.
12013 * testsuite/Makefile.in: Regenerate.
12015 2009-10-25 Doug Kwan <dougkwan@google.com>
12017 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12018 from private to protected to allow access by child class.
12019 (Sized_relobj::do_relocate_sections): New method declaration.
12020 (Sized_relobj::relocate_sections): Virtualize.
12021 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
12022 Sized_relobj::relocate_sections. Instantiate template explicitly
12023 for different target sizes and endianity.
12025 2009-10-24 Doug Kwan <dougkwan@google.com>
12027 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12028 (Arm_input_section::as_arm_input_section): New method.
12029 (Arm_output_section): New class definition.
12030 (Arm_output_section::create_stub_group,
12031 Arm_output_section::group_sections): New method definitions.
12033 2009-10-22 Doug Kwan <dougkwan@google.com>
12035 * arm.cc (Arm_input_section): New class definition.
12036 (Arm_input_section::init, Arm_input_section:do_write,
12037 Arm_input_section::set_final_data_size,
12038 Arm_input_section::do_reset_address_and_file_offset): New method
12041 2009-10-21 Doug Kwan <dougkwan@google.com>
12043 * arm.cc (Stub_table, Arm_input_section): New forward class
12045 (Stub_table): New class defintion.
12046 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12047 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12048 New method definition.
12050 2009-10-21 Doug Kwan <dougkwan@google.com>
12052 * arm.cc: Update copyright comments.
12053 (Target_arm): New forward class template declaration.
12054 (Arm_address): New type.
12055 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12056 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12057 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12059 (Insn_template): Same.
12060 (DEF_STUBS): New macro.
12061 (Stub_type): New enum type.
12062 (Stub_template): New class definition.
12064 (Reloc_stub): Same.
12065 (Stub_factory): Same.
12066 (Target_arm::Target_arm): Initialize may_use_blx_ and
12067 should_force_pic_veneer_.
12068 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12069 Target_arm::should_force_pic_veneer,
12070 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12071 Target_arm::using_thumb_only, Target_arm:;default_target): New
12073 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12074 New data member declarations.
12075 (Insn_template::size, Insn_template::alignment): New method defintions.
12076 (Stub_template::Stub_template): New method definition.
12077 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12078 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12079 (Stub_factory::Stub_factory): New method definition.
12080 * gold.h (string_hash): New template.
12081 * output.h (Input_section_specifier::hash_value): Use
12083 (Input_section_specifier::string_hash): Remove.
12084 * stringpool.cc (Stringpool_template::string_hash): Use
12087 2009-10-20 Doug Kwan <dougkwan@google.com>
12089 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12090 symbols of relaxed input sections.
12091 * output.h (Output_section::find_relaxed_input_section): Make
12094 2009-10-16 Doug Kwan <dougkwan@google.com>
12096 * dynobj.cc (Versions::Versions): Initialize version_script_.
12097 Only insert base version symbol definition for a shared object
12098 if version script defines any version versions.
12099 (Versions::define_base_version): New method definition.
12100 (Versions::add_def): Check that base version is not needed.
12101 (Versions::add_need): Define base version lazily.
12102 * dynobj.h (Versions::define_base_version): New method declaration.
12103 (Versions::needs_base_version_): New data member declaration.
12104 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12105 (check_DATA): Add no_version_test.stdout.
12106 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12108 * testsuite/Makefile.in: Regenerate.
12109 * testsuite/no_version_test.c: New file.
12110 * testsuite/no_version_test.sh: Ditto.
12112 2009-10-16 Doug Kwan <dougkwan@google.com>
12114 * expression.cc (class Segment_start_expression): New class definition.
12115 (Segment_start_expression::value): New method definition.
12116 (script_exp_function_segment_start): Return a new
12117 Segment_start_expression.
12118 * gold/script-c.h (script_saw_segment_start_expression): New function
12120 * script-sections.cc (Script_sections::Script_sections): Initialize
12121 SAW_SEGMENT_START_EXPRESSION_ to false.
12122 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12123 and -Tbbs options to specify section addresses if given in
12124 command line and no SEGMENT_START expression is seen in a script.
12125 * script-sections.h (Script_sections::saw_segment_start_expression,
12126 Script_sections::set_saw_segment_start_expression): New method
12128 (Script_sections::saw_segment_start_expression_): New data member
12130 * script.cc (script_saw_segment_start_expression): New function.
12131 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12132 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12133 script_test_7.sh and script_test_8.sh.
12134 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12135 script_test_8.stdout.
12136 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12137 (script_test_6, script_test_6.stdout, script_test_7,
12138 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12139 * Makefile.in: Regenerate.
12140 * testsuite/script_test_6.sh: New file.
12141 * testsuite/script_test_6.t: Same.
12142 * testsuite/script_test_7.sh: Same.
12143 * testsuite/script_test_7.t: Same.
12144 * testsuite/script_test_8.sh: Same.
12146 2009-10-16 Doug Kwan <dougkwan@google.com>
12148 * output.cc (Output_segment::set_section_list_address): Cast
12149 expressions to unsigned long long type to avoid format warnings.
12151 2009-10-15 Ian Lance Taylor <iant@google.com>
12153 * script.cc (Script_options::add_symbol_assignment): Always add a
12154 dot assignment to script_sections_.
12155 * script-sections.cc (Script_sections::add_dot_assignment):
12156 Initialize if necessary.
12158 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12159 program headers with no load segment if there is a linker script.
12161 * layout.cc (Layout::set_segment_offsets): Align the file offset
12162 to the segment aligment for -N or -n with no load segment.
12163 * output.cc (Output_segment::add_output_section): Don't crash if
12164 the first section is a TLS section.
12165 (Output_segment::set_section_list_addresses): Print an error
12166 message if the address moves backward in a linker script.
12167 * script-sections.cc
12168 (Output_section_element_input::set_section_addresses): Don't
12169 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12170 (Orphan_output_section::set_section_addresses): Likewise.
12172 2009-10-15 Doug Kwan <dougkwan@google.com>
12174 * layout.cc (Layout::finish_dynamic_section): Generate tags
12175 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12176 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12177 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12179 2009-10-14 Ian Lance Taylor <iant@google.com>
12181 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12183 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12184 data_shdr fields of relinfo.
12185 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12186 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12187 R_386_TLS_LDO_32, adjust based on section flags.
12188 (Target_i386::Relocate::fix_up_ldo): Remove.
12190 2009-10-13 Ian Lance Taylor <iant@google.com>
12192 Add support for -pie.
12193 * options.h (class General_options): Add -pie and
12195 (General_options::output_is_position_independent): Test -pie.
12196 (General_options::output_is_executable): Return true if not shared
12197 and not relocatable.
12198 (General_options::output_is_pie): Remove.
12199 * options.cc (General_options::finalize): Reject incompatible uses
12201 * gold.cc (queue_middle_tasks): A -pie link is not static.
12202 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12203 * symtab.cc (Symbol::final_value_is_known): Return false if
12204 output_is_position_independent.
12205 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12206 output_is_position_independent.
12207 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12208 output_is_position_independent.
12209 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12210 output_is_position_independent.
12211 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12213 (basic_pie_test.o, basic_pie_test): New targets.
12214 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12215 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12216 (two_file_pie_test): New target.
12217 * testsuite/Makefile.in: Rebuild.
12218 * README: Remove note saying that -pie is not supported.
12220 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12222 * options.h (class General_options): Add -init and -fini.
12223 * layout.cc (Layout::finish_dynamic_section): Emit
12224 given init and fini functions.
12226 2009-10-13 Sriraman Tallam <tmsriram@google.com>
12228 * gc.h (gc_process_relocs): Check if icf is enabled using new
12230 * gold.cc (queue_initial_tasks): Likewise.
12231 (queue_middle_tasks): Likewise.
12232 * object.cc (do_layout): Likewise.
12233 * symtab.cc (is_section_folded): Likewise.
12234 * main.cc (main): Likewise.
12235 * reloc.cc (Read_relocs::run): Likewise.
12236 (Sized_relobj::do_scan_relocs): Likewise.
12237 * icf.cc (is_function_ctor_or_dtor): New function.
12238 (Icf::find_identical_sections): Check if function is ctor or dtor when
12239 safe icf is chosen.
12240 * options.h (General_options::icf): Change option to be an enum.
12241 (Icf_status): New enum.
12242 (icf_enabled): New method.
12243 (icf_safe_folding): New method.
12244 (set_icf_status): New method.
12245 (icf_status_): New variable.
12246 * (options.cc) (General_options::finalize): Set icf_status_.
12247 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12248 icf_test and icf_keep_unique_test to use the --icf enum flag.
12249 * testsuite/icf_safe_test.sh: New file.
12250 * testsuite/icf_safe_test.cc: New file.
12252 2009-10-12 Sriraman Tallam <tmsriram@google.com>
12254 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12255 includes to gc.h and icf.h.
12256 * arm.cc: Include gc.h.
12257 * gold.cc: Likewise.
12258 * i386.cc: Likewise.
12259 * powerpc.cc: Likewise.
12260 * sparc.cc: Likewise.
12261 * x86_64.cc: Likewise.
12262 * gc.h: Include icf.h.
12264 2009-10-11 Ian Lance Taylor <iant@google.com>
12266 * plugin.cc: Include "gold.h" before other header files.
12268 2009-10-10 Chris Demetriou <cgd@google.com>
12270 * options.h (Input_file_argument::Input_file_type): New enum.
12271 (Input_file_argument::is_lib_): Replace with...
12272 (Input_file_argument::type_): New member.
12273 (Input_file_argument::Input_file_argument): Take Input_file_type
12274 'type' rather than boolean 'is_lib' as second argument.
12275 (Input_file_argument::is_lib): Use type_.
12276 (Input_file_argument::is_searched_file): New function.
12277 (Input_file_argument::may_need_search): Handle is_searched_file.
12278 * options.cc (General_options::parse_library): Support -l:filename.
12279 (General_options::parse_just_symbols): Update for Input_file_argument
12281 (Command_line::process): Likewise.
12282 * archive.cc (Archive::get_file_and_offset): Likewise.
12283 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12284 * script.cc (read_script_file, script_add_file): Likewise.
12285 * fileread.cc (Input_file::Input_file): Likewise.
12286 (Input_file::will_search_for): Handle is_searched_file.
12287 (Input_file::open): Likewise.
12288 * readsyms.cc (Read_symbols::get_name): Likewise.
12289 * testsuite/Makefile.am (searched_file_test): New test.
12290 * testsuite/Makefile.in: Regenerate.
12291 * testsuite/searched_file_test.cc: New file.
12292 * testsuite/searched_file_test_lib.cc: New file.
12294 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12295 Ian Lance Taylor <iant@google.com>
12297 * descriptor.cc: Include <cstdio> and "binary-io.h".
12298 (Descriptors::open): Open the files in binary mode always.
12299 * script.cc (Lex::get_token): Treat \r as whitespace.
12301 2009-10-09 Ian Lance Taylor <iant@google.com>
12303 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12305 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12306 Ian Lance Taylor <iant@google.com>
12308 * configure.ac: Check for readv function also.
12309 * fileread.cc (readv): Define if not HAVE_READV.
12310 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12312 * config.in: Regenerate.
12313 * configure: Regenerate.
12315 2009-10-09 Doug Kwan <dougkwan@google.com>
12317 * layout.cc (Layout::make_output_section): Call target hook to make
12318 ordinary output section.
12319 (Layout::finalize): Adjust parameter list of call the
12320 Target::may_relax().
12321 * layout.h (class Layout::section_list): New method.
12322 * merge.h (Output_merge_base::entsize): Change visibility to public.
12323 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12325 (Output_merge_string::do_is_string): New method.
12326 * object.cc (Sized_relobj::do_setup): renamed from
12327 Sized_relobj::set_up.
12328 * object.h (Sized_relobj::adjust_shndx,
12329 Sized_relobj::initializ_input_to_output_maps,
12330 Sized_relobj::free_input_to_output_maps): Change visibilities to
12332 (Sized_relobj::setup): Virtualize.
12333 (Sized_relobj::do_setup): New method declaration.
12334 (Sized_relobj::invalidate_section_offset,
12335 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12336 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12337 * options.cc (parse_int): New function.
12338 * options.h (parse_int): New declaration.
12339 (DEFINE_int): New macro.
12340 (stub_group_size): New option.
12341 * output.cc (Output_section::Output_section): Initialize memebers
12342 merge_section_map_, merge_section_by_properties_map_,
12343 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12344 (Output_section::add_input_section): Handled deferred code-fill
12345 generation and remove an old comment.
12346 (Output_section::add_relaxed_input_section): New method definition.
12347 (Output_section::add_merge_input_section): Use merge section by
12348 properties map to speed to search. Update merge section maps
12350 (Output_section::build_relaxation_map): New method definition.
12351 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12353 (Output_section::relax_input_section): Renamed to
12354 Output_section::convert_input_sections_to_relaxed_sections and change
12355 interface to take a vector of pointers to relaxed sections.
12356 (Output_section::find_merge_section,
12357 Output_section::find_relaxed_input_section): New method definitions.
12358 (Output_section::is_input_address_mapped,
12359 Output_section::output_offset, Output_section::output_address):
12360 Use output section data maps to speed up searching.
12361 (Output_section::find_starting_output_address): Add comments.
12362 (Output_section::do_write,
12363 Output_section::write_to_postprocessing_buffer): Do code-fill
12364 generation as appropriate.
12365 (Output_section::get_input_sections): Invalidate relaxed input section
12367 (Output_section::restore_states): Adjust type of checkpoint .
12368 Invalidate relaxed input section map.
12369 * output.h (Output_merge_base): New class declaration.
12370 (Input_section_specifier): New class defintion.
12371 (class Output_relaxed_input_section) Change base class to
12372 Output_section_data_build.
12373 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12374 base class initializer.
12375 (Output_section::add_relaxed_input_section): New method declaration.
12376 (Output_section::Input_section): Change visibility to protected.
12377 (Output_section::Input_section::relobj,
12378 Output_section::Input_section::shndx): Handle relaxed input sections.
12379 Output_section::input_sections) Change visibility to protected. Also
12380 define overload to return a non-const pointer.
12381 (Output_section::Merge_section_properties): New class defintion.
12382 (Output_section::Merge_section_by_properties_map,
12383 Output_section::Output_section_data_by_input_section_map,
12384 Output_section::Relaxation_map): New types.
12385 (Output_section::relax_input_section): Rename method to
12386 Output_section::convert_input_sections_to_relaxed_sections and change
12387 interface to take a vector of relaxed section pointers.
12388 (Output_section::find_merge_section,
12389 Output_section::find_relaxed_input_section,
12390 Output_section::build_relaxation_map,
12391 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12392 New method declarations.
12393 (Output_section::merge_section_map_
12394 Output_section::merge_section_by_properties_map_,
12395 Output_section::relaxed_input_section_map_,
12396 Output_section::is_relaxed_input_section_map_valid_,
12397 Output_section::generate_code_fills_at_write_): New data members.
12398 * script-sections.cc
12399 (Output_section_element_input::set_section_addresses): Call
12400 current_data_size and addralign methods of relaxed input sections.
12401 (Orphan_output_section::set_section_addresses): Call current_data_size
12402 and addralign methods of relaxed input sections.
12403 * symtab.cc (Symbol_table::compute_final_value): Extract template
12404 from the body of Symbol_table::sized_finalize_symbol.
12405 (Symbol_table::sized_finalized_symbol): Call
12406 Symbol_table::compute_final_value.
12407 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12408 (Symbol_table::compute_final_value): New templated method declaration.
12409 * target.cc (Target::do_make_output_section): New method defintion.
12410 * target.h (Target::make_output_section): New method declaration.
12411 (Target::relax): Add more parameters for input objects, symbol table
12412 and layout. Adjust call to do_relax.
12413 (Target::do_make_output_section): New method declaration.
12414 (Target::do_relax): Add parameters for input objects, symbol table
12417 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12419 * pread.c: Include stdio.h.
12421 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12423 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12426 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12428 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12429 Change read_shndx type to unsigned int.
12430 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12432 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12433 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12434 Change read_shndx type to unsigned int.
12435 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12437 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12438 * layout.cc (Layout::create_symtab_sections): Cast the result of
12439 local_symcount * symsize to off_t in the gold_assert.
12441 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12443 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12444 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12446 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12447 (Arm_relocate_functions::thm_abs5): New function.
12448 (Arm_relocate_functions::abs12): New function.
12449 (Arm_relocate_functions::abs16): New function.
12450 (Arm_relocate_functions::base_abs): New function.
12451 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12452 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12453 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12455 (Scan::global): Likewise.
12456 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12457 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12458 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12459 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12462 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12464 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12465 (Arm_relocate_functions::movt_prel): New function.
12466 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12467 (Arm_relocate_functions::thm_movt_prel): New function.
12468 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12469 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12470 (Scan::global, Relocate::relocate): Likewise.
12471 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12473 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12475 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12476 Incremental_checker.
12477 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12479 (class Incremental_inputs_header): New class.
12480 (Incremental_inputs_header_writer): Edit comment.
12481 (Incremental_inputs_entry): New class.
12482 (Incremental_inputs_entry_writer): Edit comment.
12483 (Sized_incremental_binary::do_find_incremental_inputs_section):
12484 Add *strtab_shndx parameter, fill it.
12485 (Sized_incremental_binary::do_check_inputs): New method.
12486 (Incremental_checker::can_incrementally_link_output_file): Use
12487 Sized_incremental_binary::check_inputs.
12488 (Incremental_inputs::report_command_line): Save command line in
12491 (Incremental_binary::find_incremental_inputs_section): New
12493 (Incremental_binary::do_find_incremental_inputs_section): Add
12494 strtab_shndx parameter.
12495 (Incremental_binary::do_check_inputs): New pure virtual method.
12496 (Sized_incremental_binary::do_check_inputs): Declare.
12497 (Incremental_checker::Incremental_checker): Add incremental_inputs
12498 parameter, use it to initialize incremental_inputs_.
12499 (Incremental_checker::incremental_inputs_): New field.
12500 (Incremental_checker::command_line): New method.
12501 (Incremental_checker::inputs): New method.
12502 (Incremental_checker::command_line_): New field.
12504 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12506 * incremental.cc: Include <cstdarg> and "target-select.h".
12507 (vexplain_no_incremental): New function.
12508 (explain_no_incremental): New function.
12509 (Incremental_binary::error): New method.
12510 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12512 (make_sized_incremental_binary): New function.
12513 (open_incremental_binary): New function.
12514 (can_incrementally_link_file): Add checks if output is ELF and has
12516 * incremental.h: Include "elfcpp_file.h" and "output.h".
12517 (Incremental_binary): New class.
12518 (Sized_incremental_binary): New class.
12519 (open_incremental_binary): Declare.
12520 * object.cc (is_elf_object): Use
12521 elfcpp::Elf_recognizer::is_elf_file.
12522 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12523 * output.h (Output_file::filesize): New method.
12525 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12527 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12529 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12530 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12532 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12534 (Arm_relocate_functions::movw_abs_nc): New function.
12535 (Arm_relocate_functions::movt_abs): New function.
12536 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12537 (Arm_relocate_functions::thm_movt_abs): New function.
12538 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12539 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12540 (Scan::global): Likewise.
12541 (Relocate::relocate): Likewise.
12542 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12544 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12546 * arm.cc (Arm_relocate_functions::got_prel) New function.
12547 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12548 (Relocate::relocate): Likewise.
12549 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12551 2009-10-06 Ian Lance Taylor <iant@google.com>
12553 * options.h (class General_options): Define
12554 split_stack_adjust_size parameter.
12555 * object.h (class Object): Add uses_split_stack_ and
12556 has_no_split_stack_ fields. Add uses_split_stack and
12557 has_no_split_stack accessor functions. Declare
12558 handle_split_stack_section.
12559 (class Reloc_symbol_changes): Define.
12560 (class Sized_relobj): Define Function_offsets. Declare
12561 split_stack_adjust, split_stack_adjust_reltype, and
12563 * object.cc (Object::handle_split_stack_section): New function.
12564 (Sized_relobj::do_layout): Call handle_split_stack_section.
12565 * dynobj.cc (Sized_dynobj::do_layout): Call
12566 handle_split_stack_section.
12567 * reloc.cc (Sized_relobj::relocate_sections): Call
12568 split_stack_adjust for executable sections in split_stack
12569 objects. Pass reloc_map to relocate_section.
12570 (Sized_relobj::split_stack_adjust): New function.
12571 (Sized_relobj::split_stack_adjust_reltype): New function.
12572 (Sized_relobj::find_functions): New function.
12573 * target-reloc.h: Include "object.h".
12574 (relocate_section): Add reloc_symbol_changes parameter. Change
12576 * target.h (class Target): Add calls_non_split method. Declare
12577 do_calls_non_split virtual method. Declare match_view and
12579 * target.cc: Include "elfcpp.h".
12580 (Target::do_calls_non_split): New function.
12581 (Target::match_view): New function.
12582 (Target::set_view_to_nop): New function.
12583 * gold.cc (queue_middle_tasks): Give an error if mixing
12584 split-stack and non-split-stack objects with -r.
12585 * i386.cc (Target_i386::relocate_section): Add
12586 reloc_symbol_changes parameter.
12587 (Target_i386::do_calls_non_split): New function.
12588 * x86_64.cc (Target_x86_64::relocate_section): Add
12589 reloc_symbol_changes parameter.
12590 (Target_x86_64::do_calls_non_split): New function.
12591 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12593 * powerpc.cc (Target_powerpc::relocate_section): Add
12594 reloc_symbol_changes parameter.
12595 * sparc.cc (Target_sparc::relocate_section): Add
12596 reloc_symbol_changes parameter.
12597 * configure.ac: Call AM_CONDITIONAL for the default target.
12598 * configure: Rebuild.
12599 * testsuite/Makefile.am (TEST_AS): New variable.
12600 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12601 (check_DATA): Add split_i386 and split_x86_64 files.
12602 (SPLIT_DEFSYMS): Define.
12603 (split_i386_[1234n].o): New targets.
12604 (split_i386_[124]): New targets.
12605 (split_i386_[1234r].stdout): New targets.
12606 (split_x86_64_[1234n].o): New targets.
12607 (split_x86_64_[124]): New targets.
12608 (split_x86_64_[1234r].stdout): New targets.
12609 (MOSTLYCLEANFILES): Add new executables.
12610 * testsuite/split_i386.sh: New file.
12611 * testsuite/split_x86_64.sh: New file.
12612 * testsuite/split_i386_1.s: New file.
12613 * testsuite/split_i386_2.s: New file.
12614 * testsuite/split_i386_3.s: New file.
12615 * testsuite/split_i386_4.s: New file.
12616 * testsuite/split_i386_n.s: New file.
12617 * testsuite/split_x86_64_1.s: New file.
12618 * testsuite/split_x86_64_2.s: New file.
12619 * testsuite/split_x86_64_3.s: New file.
12620 * testsuite/split_x86_64_4.s: New file.
12621 * testsuite/split_x86_64_n.s: New file.
12622 * testsuite/testfile.cc (Target_test): Update relocation_section
12624 * testsuite/Makefile.in: Rebuild.
12626 2009-10-06 Ian Lance Taylor <iant@google.com>
12628 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12629 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12630 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12631 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12632 the address on ldo_addrs_.
12633 (Target_i386::Relocate::fix_up_ldo): New function.
12635 2009-10-06 Rafael Espindola <espindola@google.com>
12637 * plugin.cc (add_input_library): New.
12638 (Plugin::load): Add add_input_library to tv.
12639 (Plugin_manager::add_input_file): Add the is_lib argument.
12640 (add_input_file): Update call to Plugin_manager::add_input_file.
12641 (add_input_library): New.
12642 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12644 2009-09-30 Doug Kwan <dougkwan@google.com>
12646 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12647 symbol and call Symbol::may_need_copy_reloc to determine if
12648 a copy reloc is needed.
12649 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12650 nocopyreloc is given in command line.
12651 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12652 given in command line.
12653 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12654 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12655 of the removed Target_i386::may_need_copy_reloc.
12656 * options.h (copyreloc): New option with default value false.
12657 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12658 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12659 instead of the removed Target_powerpc::may_need_copy_reloc.
12660 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12661 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12662 instead of the removed Target_sparc::may_need_copy_reloc.
12663 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12664 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12665 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12666 instead of the removed Target_x86_64::may_need_copy_reloc.
12668 2009-09-30 Ian Lance Taylor <iant@google.com>
12670 * object.h (class Object): Remove target_ field, and target,
12671 sized_target, and set_target methods.
12672 (Object::sized_target): Remove.
12673 (class Sized_relobj): Update declarations. Remove sized_target.
12674 * object.cc (Sized_relobj::setup): Remove target parameter.
12675 Change all callers.
12676 (Input_objects::add_object): Don't do anything with the target.
12677 (make_elf_sized_object): Add punconfigured parameter. Change all
12678 callers. Set or test parameter target.
12679 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12680 Change all callers.
12681 * parameters.cc (Parameters::set_target): Change parameter type to
12683 (Parameters::default_target): Remove.
12684 (set_parameters_target): Change parameter type to be non-const.
12685 (parameters_force_valid_target): New function.
12686 (parameters_clear_target): New function.
12687 * parameters.h (class Parameters): Update declarations. Remove
12688 default_target method. Add sized_target and clear_target
12689 methods. Change target_ to be non-const.
12690 (set_parameters_target): Update declaration.
12691 (parameters_force_valid_target): Declare.
12692 (parameters_clear_target): Declare.
12693 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12694 as NULL if we aren't searching.
12695 (Add_symbols::run): Don't check for compatible target.
12696 * fileread.cc (Input_file::open_binary): Call
12697 parameters_force_valid_target.
12698 * gold.cc (queue_middle_tasks): Likewise.
12699 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12700 set_target on object.
12701 * dynobj.h (class Sized_dynobj): Update declarations.
12702 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12703 make_elf_object returns NULL.
12704 (Archive::include_member): Don't check whether object target is
12706 * output.cc (Output_section::add_input_section): Get target from
12708 (Output_section::relax_input_section): Likewise.
12709 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12711 (Sized_relobj::do_scan_relocs): Likewise.
12712 (Sized_relobj::relocate_sections): Likewise.
12713 * resolve.cc (Symbol_table::resolve): Likewise.
12714 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12715 parameter. Change all callers.
12716 (Symbol_table::add_from_object): Get target from parameters.
12717 (Symbol_table::add_from_relobj): Don't check object target.
12718 (Symbol_table::add_from_dynobj): Likewise.
12719 (Symbol_table::define_special_symbol): Get target from
12721 * symtab.h (class Symbol_table): Update declaration.
12722 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12723 parameter. Change all callers. Clear parameter target.
12724 (Binary_test): Test target here.
12725 * testsuite/object_unittest.cc (gold_testsuite): Remove
12726 target_test_pointer parameter. Change all callers.
12727 (Object_test): Test target here.
12729 2009-09-26 Ian Lance Taylor <iant@google.com>
12731 * testsuite/initpri1.c: Don't try to use constructor priorities if
12732 compiling with gcc before 4.3.
12734 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12736 * testsuite/retain_symbols_file_test.sh (check_present): Change
12737 output file name to retain_symbols_file_test.stdout.
12738 (check_absent): Likewise.
12740 2009-09-18 Craig Silverstein <csilvers@google.com>
12742 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12743 * options.cc: Include <cerrno> and <fstream>.
12744 (General_options::finalize): Parse -retain-symbols-file tag.
12745 * options.h: New flag.
12746 (General_options): New method should_retain_symbol, new
12747 variable symbols_to_retain.
12748 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12749 should_retain_symbol map.
12750 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12751 * testsuite/Makefile.in: Regenerate.
12752 * testsuite/retain_symbols_file_test.sh: New file.
12754 2009-09-18 Nick Clifton <nickc@redhat.com>
12756 * po/es.po: Updated Spanish translation.
12758 2009-09-17 Doug Kwan <dougkwan@google.com>
12760 * debug.h (DEBUG_RELAXATION): New constant.
12761 (DEBUG_ALL): Add DEBUG_RELAXATION.
12762 (debug_string_to_enum): Add relaxation debug option.
12764 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12765 Layout::Relaxation_debug_check::read_sections,
12766 Layout::Relaxation_debug_check::read_sections): New method definitions.
12767 (Layout::Layout): Initialize data members
12768 record_output_section_data_from_scrips_,
12769 script_output_section_data_list_ and relaxation_debug_check_.
12770 (Layout::save_segments, Layout::restore_segments,
12771 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12772 Layout::relaxation_loop_body): New method definitions.
12773 (Layout::finalize): Support relaxation. Move section layout code to
12774 Layout::relaxation_loop_body.
12775 (Layout::set_asection_address_from_script): Move code for orphan
12776 section placement out.
12777 (Layout::place_orphan_sections_in_script): New method definition.
12778 * layout.h (Output_segment_headers, Output_file_header):
12779 New forward class declarations.
12780 (Layout::~Layout): Define.
12781 (Layout::new_output_section_data_from_script): New method definition.
12782 (Layout::place_orphan_sections_in_script): New method declaration.
12783 (Layout::Segment_states): New type declaration.
12784 (Layout::save_segments, Layout::restore_segments,
12785 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12786 Layout::relaxation_loop_body): New method declarations.
12787 (Layout::Output_section_data_list): New type declaration.
12788 (Layout::Relaxation_debug_check): New class definition.
12789 (Layout::record_output_section_data_from_script_,
12790 Layout::script_output_section_data_list_, Layout::segment_states_,
12791 Layout::relaxation_debug_check_): New data members.
12792 * output.cc: (Output_section_headers::do_size): New method definition.
12793 (Output_section_headers::Output_section_headers): Move size
12794 computation to Output_section_headers::do_size.
12795 (Output_segment_headers::do_size): New method definition.
12796 (Output_file_header::Output_file_header): Move size computation to
12797 Output_file_header::do_size and call it.
12798 (Output_file_header::do_size): New method definition.
12799 (Output_data_group::Output_data_group): Adjust call to
12800 Output_section_data.
12801 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12802 (Output_symtab_xindex::do_write): Add array bound check.
12803 (Output_section::Input_section::print_to_mapfile): Handle
12804 RELAXED_INPUT_SECTION_CODE.
12805 (Output_section::Output_section): Initialize data member checkpoint_.
12806 (Output_section::~Output_section): Delete checkpoint object pointed
12808 (Output_section::add_input_section): Always add an Input_section if
12810 (Output_section::add_merge_input_section): Add assert.
12811 (Output_section::relax_input_section): New method definition.
12812 (Output_section::set_final_data_size): Set load address to zero for
12813 an unallocated section.
12814 (Output_section::do_address_and_file_offset_have_reset_values):
12815 New method definition.
12816 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12817 Handle relaxed input section.
12818 (Output_section::sort_attached_input_sections): Checkpoint input
12819 section list lazily.
12820 (Output_section::get_input_sections): Change type of input_sections to
12821 list of Simple_input_section pointers. Checkpoint input section list
12822 lazily. Also handle relaxed input sections.
12823 (Output_section::add_input_section_for_script): Take a reference to
12824 a Simple_input_section object instead of Relobj pointer and section
12825 index as parameter. Handle relaxed input sections.
12826 (Output_section::save_states, Output_section::restore_states): New
12827 method definitions.
12828 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12829 (Output_data::is_data_size_fixed): New method definition.
12830 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12832 (Output_data::address_and_file_offset_have_reset_values): New method
12834 (Output_data::do_address_and_file_offset_have_reset_values): New method
12836 (Output_data::set_data_size): Check that data size is not fixed.
12837 (Output_data::fix_data_size): New method definition.
12838 (Output_data::is_data_size_fixed_): New data member.
12839 (Output_section_headers::set_final_data_size): New method definition.
12840 (Output_section_headers::do_size): New method declaration.
12841 (Output_segment_headers::set_final_data_size): New method definition.
12842 (Output_segment_headers::do_size): New method declaration.
12843 (Output_file_header::set_final_data_size)::New method definition.
12844 (Output_file_header::do_size)::New method declaration.
12845 (Output_section_data::Output_section_data): Add new parameter
12846 is_data_size_fixed and use it to fix data size.
12847 (Output_data_const::Output_data_const): Adjust call to base class
12848 constructor and fix data size.
12849 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12850 base class constructor and fix data size.
12851 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12852 base class constructor and fix data size.
12853 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12854 class constructor and fix data size.
12855 (Output_data_group::set_final_data_size): New method definition.
12856 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12857 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12858 class constructor and fix data size.
12859 (Output_relaxed_input_section): New class definition.
12860 (Output_section::Simple_input_section): New class definition.
12861 (Output_section::get_input_sections): Adjust parameter list.
12862 (Output_section::add_input_section_for_script): Same.
12863 (Output_section::save_states, Output_section::restore_states,
12864 Output_section::do_address_and_file_offset_have_reset_values,
12865 (Output_section::Input_section::Input_section): Handle
12866 RELAXED_INPUT_SECTION_CODE. Add new overload for
12867 Output_relaxed_input_section.
12868 (Output_section::Input_section::is_input_section,
12869 Output_section::Input_section::set_output_section): Handle relaxed
12871 (Output_section::Input_section::is_relaxed_input_section,
12872 Output_section::Input_section::output_section_data,
12873 Output_section::Input_section::relaxed_input_section): New method
12875 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12877 (Output_section::Input_section::u1_): Update comments.
12878 (Output_section::Input_section::u2_): Add new union member poris.
12879 (Output_section::Checkpoint_output_section): New classs definition.
12880 (Output_section::relax_input_section): New method declaration.
12881 (Output_section::checkpoint_): New data member.
12882 (Output_segment): Update comments.
12883 (Output_segment::Output_segment): Un-privatize copy constructor.
12884 (Output_segment::operator=): Un-privatize.
12885 * script-sections.cc (Output_section_element::Input_section_list):
12886 Change element type to Output_section::Simple_input_section.
12887 (Output_section_element_dot_assignment::set_section_addresses):
12888 Register output section data for relaxation clean up.
12889 (Output_data_exression::Output_data_expression): Adjust call to base
12890 constructor to fix data size.
12891 (Output_section_element_data::set_section_addresses): Register
12892 Output_data_expression object for relaxation clean up.
12893 (struct Input_section_info): Replace Relobj pointer and section index
12894 pair with Output_section::Simple_input_section and Convert struct to a
12896 (Input_section_sorter::operator()): Adjust access to
12897 Input_section_info data member to use accessors.
12898 (Output_section_element_input::set_section_addresses): Use layout
12899 parameter. Adjust code to use Output_section::Simple_input_section
12900 and Input_secction_info classes. Register filler for relaxation
12902 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12903 and section index pair with Output_section::Simple_input_section
12904 class. Adjust code accordingly.
12905 (Phdrs_element::release_segment): New method definition.
12906 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12908 (Script_sections::release_segments): New method definition.
12909 * gold/script-sections.h (Script_sections::release_segments): New
12910 method declaration.
12911 * gold/target.h (Target::may_relax, Target::relax,
12912 Target::do_may_relax, Target::do_relax): New method definitions.
12914 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12916 * arm.cc (has_signed_unsigned_overflow): New function.
12917 (Arm_relocate_functions::abs8): New function.
12918 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12919 (Target_arm::Scan::global): Likewise.
12920 (Target_arm::relocate::relocate): Likewise.
12921 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12924 2009-09-16 Cary Coutant <ccoutant@google.com>
12926 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12927 * testsuite/Makefile.in: Regenerate.
12929 2009-09-11 Nick Clifton <nickc@redhat.com>
12931 * po/gold.pot: Updated by the Translation project.
12933 2009-09-08 Cary Coutant <ccoutant@google.com>
12935 * output.cc (Output_file::open): Add execute permission to empty file.
12936 * testsuite/Makefile.am (permission_test): New test.
12937 * testsuite/Makefile.in: Regenerate.
12939 2009-09-02 Ian Lance Taylor <iant@google.com>
12941 * output.cc (Output_file::resize): Call map_no_anonymous rather
12944 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12946 * gold.cc: Include "incremental.h".
12947 (queue_initial_tasks): Call Incremental_checker methods.
12948 * incremental.cc: Include "output.h".
12949 (Incremental_checker::can_incrementally_link_output_file): New
12951 * incremental.h (Incremental_checker): New class.
12953 * output.cc (Output_file::open_for_modification): New method.
12954 (Output_file::map_anonymous): Changed return type to bool. Record
12955 map in base_ field.
12956 (Output_file::map_no_anonymous): New method, broken out of map.
12957 (Output_file::map): Use map_no_anonymous and map_anonymous.
12958 * output.h (class Output_file): Update declarations.
12960 2009-08-24 Cary Coutant <ccoutant@google.com>
12962 * options.h (Command_line::Pre_options): New class.
12963 (Command_line::pre_options): New member.
12964 * options.cc (gold::options::ready_to_register): New variable.
12965 (One_option::register_option): Do nothing if not registering options.
12966 Assert if same short option registered twice.
12967 (General_options::General_options): Turn off option registration when
12969 (Command_line::Pre_options::Pre_options): New constructor.
12971 2009-08-24 Cary Coutant <ccoutant@google.com>
12973 * options.h (General_options::no_keep_memory): Remove incorrect
12976 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12978 * Makefile.am (am__skiplex, am__skipyacc): New.
12979 * Makefile.in: Regenerate.
12981 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12983 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12984 (INCLUDES): ... this.
12985 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12986 (AM_CPPFLAGS): Renamed from ...
12987 (INCLUDE): ... this.
12988 * Makefile.in, testsuite/Makefile.in: Regenerate.
12990 * Makefile.in: Regenerate.
12991 * aclocal.m4: Likewise.
12992 * config.in: Likewise.
12993 * configure: Likewise.
12994 * testsuite/Makefile.in: Likewise.
12996 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12997 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12998 * Makefile.in: Regenerate.
12999 * testsuite/Makefile.in: Regenerate.
13001 2009-08-19 Cary Coutant <ccoutant@google.com>
13003 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13004 symbols in shared libraries overridden by hidden or internal symbols
13005 in the main program.
13007 2009-08-19 Chris Demetriou <cgd@google.com>
13009 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13010 checking source file names in error messages.
13012 2009-08-18 Doug Kwan <dougkwan@google.com>
13014 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13015 an elcpp::Ehdr as parameter. Adjust call to set_target.
13016 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13017 an elfcpp::Ehdr as parameter.
13018 * object.cc (Object::set_target): Remove the version that looks up
13019 a target and sets it.
13020 (Sized_relobj::setup): Take a Target object instead of
13021 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13022 (make_elf_sized_object): Find target and ask target to
13023 make an ELF object.
13024 * object.h: (Object::set_target): Remove the version that looks up
13025 a target and sets it.
13026 (Sized_relobj::setup): Take a Target object instead of
13027 an elfcpp:Ehdr as parameter.
13028 * target.cc: Include dynobj.h.
13029 (Target::do_make_elf_object_implementation): New.
13030 (Target::do_make_elf_object): New.
13031 * target.h (Target::make_elf_object): New template declaration.
13032 (Target::do_make_elf_object): New method declarations.
13033 (Target::do_make_elf_object_implementation): New template declaration.
13035 2009-08-14 Ian Lance Taylor <iant@google.com>
13037 * gold.h (FUNCTION_NAME): Define.
13038 (gold_unreachable): Use FUNCTION_NAME.
13040 2009-08-12 Sriraman Tallam <tmsriram@google.com>
13042 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13043 symbol in the --keep-unique list is not found.
13045 2009-08-12 Sriraman Tallam <tmsriram@google.com>
13047 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13048 been maked as --keep-unique.
13049 (Icf::unfold_section): New function.
13050 * icf.h (Icf::unfold_section): New function.
13051 * options.h (General_options::keep_unique): New option.
13052 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13053 * testsuite/Makefile.in: Regenerate.
13054 * testsuite/icf_keep_unique_test.sh: New file.
13055 * testsuite/icf_keep_unique_test.cc: New file.
13057 2009-08-12 Cary Coutant <ccoutant@google.com>
13060 * resolve.cc (Symbol_table::resolve): Check for references from
13061 dynamic objects to hidden and internal symbols.
13062 * testsuite/Makefile.am (hidden_test.sh): New test.
13063 * testsuite/Makefile.in: Regenerate.
13064 * testsuite/hidden_test.sh: New script.
13065 * testsuite/hidden_test_1.c: New test source.
13066 * testsuite/hidden_test_main.c: New test source.
13068 2009-08-11 Doug Kwan <dougkwan@google.com>
13070 * arm.cc: Update comments.
13071 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13072 segment to locate the .ARM.exidx section if present.
13074 2009-08-09 Doug Kwan <dougkwan@google.com>
13076 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13079 2009-08-07 Sriraman Tallam <tmsriram@google.com>
13080 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13083 2009-08-06 Sriraman Tallam <tmsriram@google.com>
13085 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13086 valid tls_segment only for non-debug-section relocations.
13087 * testsuite/Makefile.am: Add gc_tls_test.
13088 * testsuite/Makefile.in: Regenerate.
13089 * testsuite/gc_tls_test.cc: New file.
13090 * testsuite/gc_tls_test.sh: New file.
13092 2009-08-05 Sriraman Tallam <tmsriram@google.com>
13094 * icf.cc: New file.
13096 * Makefile.am (CCFILES): Add icf.cc.
13097 (HFILES): Add icf.h
13098 * Makefile.in: Regenerate.
13099 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13100 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13101 section, symbol and addend information for the relocs.
13102 * gold.cc (queue_middle_tasks): Call identical code folding.
13103 * gold.h: Add defines for multimap.
13104 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13105 to the call of finalize_local_symbols.
13106 * main.cc (main): Create object of class Icf.
13107 * object.cc (Sized_relobj::do_layout): Allow this function to be
13108 called twice during icf.
13109 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13110 to sections marked as identical by icf.
13111 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13113 (Sized_relobj::do_section_entsize): New function.
13114 * object.h (Object::section_entsize): New function.
13115 (Object::do_section_entsize): New pure virtual function.
13116 (Relobj::finalize_local_symbols): Add new parameter.
13117 (Relobj::do_section_entsize): New function.
13118 * options.h (General_options::icf): New option.
13119 (General_options::icf_iterations): New option.
13120 (General_options::print_icf_sections): New option.
13121 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13122 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13123 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13125 * symtab.cc (Symbol_table::is_section_folded): New function.
13126 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13127 to sections marked as identical by icf.
13128 * symtab.h (Symbol_table::set_icf): New function.
13129 (Symbol_table::icf): New function.
13130 (Symbol_table::is_section_folded): New function.
13131 (Symbol_table::icf_): New data member.
13132 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13133 * testsuite/Makefile.am: Add commands to build icf_test.
13134 * testsuite/Makefile.in: Regenerate.
13135 * testsuite/icf_test.sh: New file.
13136 * testsuite/icf_test.cc: New file.
13138 2009-07-24 Chris Demetriou <cgd@google.com>
13140 * layout.cc (is_compressible_debug_section): Fix incorrect
13141 comment about compressed section names.
13143 2009-07-20 Ian Lance Taylor <ian@airs.com>
13146 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13148 2009-07-16 Ian Lance Taylor <iant@google.com>
13151 * layout.h: #include <map>.
13152 (class Kept_section): Change from struct to class. Add accessors
13153 and setters. Add section size to Comdat_group mapping. Change
13154 Comdat_group to std::map. Add is_comdat_ field. Add
13155 linkonce_size field in union.
13156 (class Layout): Update declaration of find_or_add_kept_section.
13157 Don't declare find_kept_object.
13158 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13159 parameter. Add object, shndx, is_comdat, and is_group_name
13160 parameters. Change all callers. Adjust for new Kept_section.
13161 (Layout::find_kept_object): Remove.
13162 * object.cc (Sized_relobj::include_section_group): Update use of
13163 Kept_section. Rename secnum to shndx. Only record
13164 Kept_comdat_section if sections are the same size.
13165 (Sized_relobj::include_linkonce_section): Update use of
13166 Kept_section. Only record Kept_comdat_section if sections are the
13167 same size. Set size of linkonce section.
13168 (Sized_relobj::map_to_kept_section): Update call to
13169 get_kept_comdat_section.
13170 * object.h (class Sized_relobj): Rename fields in
13171 Kept_comdat_section to drop trailing underscores; change object
13172 field to Relobj*. Change Kept_comdat_section_table to store
13173 struct rather than pointer.
13174 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13175 Add kept_object and kept_shndx parameters. Change all callers.
13176 (Sized_relobj::get_kept_comdat_section): Change return type to
13177 bool. Add kept_object and kept_shndx parameters. Change all
13179 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13180 Layout::find_or_add_kept_section.
13182 2009-07-09 Ian Lance Taylor <iant@google.com>
13184 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13185 Reserve space in the hash table.
13187 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13189 * fileread.cc (File_read::get_mtime): New method.
13190 * fileread.h (Timespec): New structure.
13191 (File_read::get_mtime): New method.
13192 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13193 Renamed from timestamp_nsec.
13194 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13196 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
13198 (Incremental_inputs::report_archive): Save mtime; style fix.
13199 (Incremental_inputs::report_obejct): Save mtime; style fix.
13200 (Incremental_inputs::report_script): Save mtime; style fix.
13201 (Incremental_inputs::finalize_inputs): Style fix.
13202 (Incremental_inputs::finalize): Style fix.
13203 (Incremental_inputs::create_input_section_data): Store inputs
13205 * incremental.h (Incremental_inputs::report_script): Add mtime
13207 (Incremental_inputs::Input_info::Input_info): Intialize only one
13209 (Incremental_inputs::Input_info::archive): Move to nameless
13211 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13212 (Incremental_inputs::Input_info::script): Move to nameless union.
13213 (Incremental_inputs::mtime): New field.
13214 * script.cc (read_input_script): Pass file mtime to
13216 * script.h (Script_info::inputs): Style fix.
13218 2009-07-01 Ian Lance Taylor <ian@airs.com>
13220 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13223 2009-06-24 Ian Lance Taylor <iant@google.com>
13226 * layout.cc (Layout::choose_output_section): If we find an
13227 existing section, update the flags.
13228 (Layout::create_notes): New function, broken out of
13230 (Layout::finalize): Don't create note sections.
13231 (Layout::create_note): Don't crash if linker script discards
13233 (Layout::create_gold_note): Likewise.
13234 (Layout::create_build_id): Likewise. Don't set
13235 after_input_sections on the section.
13236 (Layout::create_executable_stack_info): Remove target parameter.
13238 * layout.h (class Layout): Declare create_notes. Update
13239 declaration of create_executable_stack_info.
13240 * gold.cc (queue_middle_tasks): Call create_notes.
13241 * output.cc (Output_section::update_flags_for_input_section): Move
13242 here from output.h. If SHF_ALLOC flag is newly set, mark address
13244 * output.h (Output_data::mark_address_invalid): New function.
13245 (class Output_section): Only declare, not define,
13246 update_flags_for_input_section. Remove set_flags.
13248 2009-06-24 Ian Lance Taylor <iant@google.com>
13250 * script-sections.cc (Output_section_definition::
13251 set_section_addresses): Rename shadowing local load_address to
13254 2009-06-24 Ian Lance Taylor <iant@google.com>
13257 * reloc.cc (relocate_sections): Skip empty relocation sections.
13259 2009-06-23 Ian Lance Taylor <iant@google.com>
13262 * layout.cc (Layout::create_note): Use choose_output_section
13263 rather than make_output_section.
13265 2009-06-23 Ian Lance Taylor <iant@google.com>
13268 * options.cc (General_options::parse_V): Set printed_version_.
13269 (General_options::General_options): Initialize printed_version_.
13270 * options.h (class General_options): Add printed_version_ field.
13271 * gold.cc (queue_initial_tasks): If there are no input files,
13272 don't give a fatal error if we printed the version information.
13273 (queue_middle_tasks): If using -r with a shared object, give a
13274 fatal error rather than an ordinary error.
13276 2009-06-23 Ian Lance Taylor <iant@google.com>
13279 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13280 (Layout::make_output_section): Set have_stabstr_section_ if we see
13281 a .stab*str section.
13282 (Layout::finalize): Call link_stabs_sections.
13283 (Layout::link_stabs_sections): New file.
13284 * layout.h (class Layout): Add have_stabstr_section_ field.
13285 Declare link_stabs_sections.
13287 2009-06-23 Doug Kwan <dougkwan@google.com>
13289 * Makefile.am (libgold_a_LIBADD): New.
13290 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
13291 * Makefile.in: Regenerate.
13292 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13293 * configure: Regenerate.
13294 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13295 * fileread.cc: Include sys/state.h
13296 * gold.h: Declare memmem and strndup if found missing.
13297 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13299 2009-06-23 Ian Lance Taylor <iant@google.com>
13301 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13302 * configure: Rebuild.
13304 2009-06-23 Ian Lance Taylor <iant@google.com>
13307 * object.cc (Object::section_contents): Don't try to get a view if
13308 the section has length zero.
13309 (Object::handle_gnu_warning_section): If the section is empty, use
13310 the name of the section as the warning.
13312 2009-06-23 Ian Lance Taylor <iant@google.com>
13315 * stringpool.h (class Stringpool_template): Add optimize_ field.
13316 (Stringpool_template::set_optimize): New function.
13317 * stringpool.cc (Stringpool_template::Stringpool_template):
13318 Initialize optimize_ field.
13319 (Stringpool_template::set_string_offsets): Test local optimize
13320 fild rather than parameter.
13321 * layout.cc (Layout::Layout): Call set_optimize on the section
13324 2009-06-22 Ian Lance Taylor <iant@google.com>
13327 * yyscript.y: Parse TARGET.
13328 * script.cc (script_set_target): New function.
13329 * script-c.h (script_set_target): Declare.
13330 * options.cc (General_options::string_to_object_format): Rename
13331 from string_to_object_format in anonymous namespace. Change
13333 * options.h (class General_options): Declare
13334 string_to_object_format.
13336 2009-06-22 Ian Lance Taylor <iant@google.com>
13338 * script-sections.cc (Script_sections::create_segments): Don't put
13339 program headers in a PT_LOAD segment if -n or -N.
13341 2009-06-22 Ian Lance Taylor <iant@google.com>
13344 * options.h (class General_options): Add -z lazy and -z now. Sort
13345 -z options into alphabetical order.
13346 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13348 2009-06-21 Ian Lance Taylor <iant@google.com>
13350 * layout.cc (Layout::make_output_section): Call
13351 Target::new_output_section.
13352 (Layout::attach_allocated_section_to_segment): Put large section
13353 sections in a separate load segment with the large segment flag
13355 (Layout::segment_precedes): Sort large data segments after other
13357 (align_file_offset): New static function.
13358 (Layout::set_segment_offsets): Use align_file_offset.
13359 * output.h (class Output_section): Add is_small_section_ and
13360 is_large_section_ fields.
13361 (Output_section::is_small_section): New function.
13362 (Output_section::set_is_small_section): New function.
13363 (Output_section::is_large_section): New function.
13364 (Output_section::set_is_large_section): New function.
13365 (Output_section::is_large_data_section): New function.
13366 (class Output_segment): Add is_large_data_segment_ field.
13367 (Output_segment::is_large_data_segment): New function.
13368 (Output_segment::set_is_large_data_segment): New function.
13369 * output.cc (Output_section::Output_section): Initialize new
13371 (Output_segment::Output_segment): Likewise.
13372 (Output_segment::add_output_section): Add assertion that large
13373 data sections always go in large data segments. Force small data
13374 sections to the end of the list of data sections. Force small BSS
13375 sections to the start of the list of BSS sections. For large BSS
13376 sections to the end of the list of BSS sections.
13377 * symtab.h (class Symbol): Declare is_common_shndx.
13378 (Symbol::is_defined): Check Symbol::is_common_shndx.
13379 (Symbol::is_common): Likewise.
13380 (class Symbol_table): Define enum Commons_section_type. Update
13381 declarations. Add small_commons_ and large_commons_ fields.
13382 * symtab.cc (Symbol::is_common_shndx): New function.
13383 (Symbol_table::Symbol_table): Initialize new fields.
13384 (Symbol_table::add_from_object): Put small and large common
13385 symbols in the right list.
13386 (Symbol_table::sized_finalized_symbol): Check
13387 Symbol::is_common_shndx.
13388 (Symbol_table::sized_write_globals): Likewise.
13389 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13390 common symbol lists. Don't call do_allocate_commons_list if the
13392 (Symbol_table::do_allocate_commons_list): Remove is_tls
13393 parameter. Add comons_section_type parameter. Change all
13394 callers. Handle small and large common symbols.
13395 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13396 Symbol::is_common_shndx.
13397 * resolve.cc (symbol_to_bits): Likewise.
13398 * target.h (Target::small_common_shndx): New function.
13399 (Target::small_common_section_flags): New function.
13400 (Target::large_common_shndx): New function.
13401 (Target::large_common_section_flags): New function.
13402 (Target::new_output_section): New function.
13403 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13404 small_common_section_flags, and large_common_section_flags
13406 (Target::do_new_output_section): New virtual function.
13407 * arm.cc (Target_arm::arm_info): Initialize new fields.
13408 * i386.cc (Target_i386::i386_info): Likewise.
13409 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13411 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13412 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13413 (Target_x86_64::do_new_output_section): New function.
13414 * configure.ac: Define conditional MCMODEL_MEDIUM.
13415 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13416 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13417 (large_LDFLAGS): Define.
13418 * testsuite/large.c: New file.
13419 * testsuite/testfile.cc (Target_test::test_target_info):
13420 Initialize new fields.
13421 * configure, testsuite/Makefile.in: Rebuild.
13423 2009-06-05 Doug Kwan <dougkwan@google.com>
13425 * Makefile.am (CCFILES): Add target.cc.
13426 * Makefile.in: Regenerate.
13427 * i386.cc (class Target_i386): Define new virtual method to
13428 override do_is_local_label_name in parent.
13429 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13430 local symbols if --discard-locals or -X is given.
13431 * options.h (class General_options): Declare new options
13432 '--discard-locals' and '-X' for discarding locals.
13433 * target.h (class Target): Define new methods is_local_label_name.
13434 Declare new virtual method do_is_local_label_name.
13435 * target.cc: New file.
13436 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13437 (check_SCRIPTS): Add discard_locals_test.sh.
13438 (check_DATA): Add discard_local_tests.syms.
13439 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13440 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13441 * testsuite/Makefile.in: Regenerate.
13442 * testsuite/discard_locals_test.c: New file.
13443 * testsuite/discard_locals_test.sh: Same.
13445 2009-06-05 Doug Kwan <dougkwan@google.com>
13447 * object.cc (Sized_relobj::Sized_relobj): Initialize
13448 discarded_eh_frame_shndx_ to -1U.
13449 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13451 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13452 a discarded .eh_frame section.
13453 (Sized_relobj::do_finalize_local_symbols): Ditto.
13454 * object.h (class Sized_relobj): Declare new member
13455 discarded_eh_frame_shndx_.
13456 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13457 (local_labels_test.o, local_labels_test): New rules.
13458 * testsuite/Makefile.in: Regenerate.
13460 2009-06-04 Doug Kwan <dougkwan@google.com>
13462 * layout.cc (Layout::section_name_mapping): Add mapping for
13463 special ARM sections.
13465 2009-06-03 Doug Kwan <dougkwan@google.com>
13467 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13468 (utils::has_overflow): Same.
13470 2009-06-03 Ian Lance Taylor <iant@google.com>
13472 * layout.cc (Layout::section_name_mapping): New array, replacing
13473 Layout::linkonce_mapping.
13474 (Layout::section_name_mapping_count): New variable, replacing
13475 Layout::linkonce_mapping_count.
13476 (Layout::linkonce_output_name): Remove.
13477 (Layout::output_section_name): Rewrite.
13478 * layout.h (class Layout): Rename Linkonce_mapping to
13479 Section_name_mapping, linkonce_mapping to section_name_mapping,
13480 linkonce_mapping_count to section_name_mapping_count. Don't
13481 declare linkonce_output_name.
13483 2009-06-03 Doug Kwan <dougkwan@google.com>
13485 * gold/arm.cc (namespace utils): New.
13486 (Target_arm::reloc_is_non_pic): Define new method.
13487 (class Arm_relocate_functions): New.
13488 (Target_arm::Relocate::relocate): Handle relocation types used by
13491 2009-06-03 Ian Lance Taylor <iant@google.com>
13493 * arm.cc (Target_arm::scan::global): Use || instead of |.
13495 2009-06-02 Doug Kwan <dougkwan@google.com>
13497 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13498 issued_non_pic_error_.
13499 (class Target_arm::Scan): Declare new method check_non_pic.
13500 Define new method symbol_needs_plt_entry.
13501 Declare new data member issued_non_pic_error_.
13502 (class Target_arm::Relocate): Declare new method
13503 should_apply_static_reloc.
13504 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13505 (Target_arm::Scan::check_non_pic): Define new method.
13506 (Target_arm::Scan::local): Handle a small subset of reloc types used
13508 (Target_arm::Scan::local): Same.
13509 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13511 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13513 * incremental.cc (Incremental_inputs::report_command_line): Filter
13514 out --incremental-* options.
13516 2009-05-29 Doug Kwan <dougkwan@google.com>
13518 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13520 (class Target_arm): Update comment.
13521 (Target_arm::Target_arm): Initialize new data members GOT_,
13522 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13523 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13524 and Target_arm::rel_dyn_section.
13525 Declare new_enum Target_arm::Got_type.
13526 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13528 Update commments for member do_dynsym_value.
13529 (Target_arm::got_size, Target_arm::plt_section,
13530 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13531 new methods inside class defintion.
13532 (Target_arm::got_section): Define new method.
13533 (Target_arm::rel_dyn_section): Same.
13534 (Output_data_plt_arm): New template class.
13535 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13536 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13537 (Output_data_plt_arm::add_entry): Same.
13538 (Output_data_plt_arm::first_plt_entry): Define new
13539 static data member for PLT instruction template.
13540 (Output_data_plt_arm::plt_entry): Same.
13541 (Output_data_plt_arm::do_write): Define new method.
13542 (Target_arm::make_plt_entry): Same.
13543 (Target_arm::do_finalize_sections): Same.
13544 (Target_arm::do_dynsym_value): Same.
13546 2009-05-28 Doug Kwan <dougkwan@google.com>
13548 * Makefile.am (TARGETSOURCES): Add arm.cc.
13549 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13550 * Makefile.in: Regenerate.
13551 * arm.cc: New file.
13552 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13554 2009-05-26 Doug Kwan <dougkwan@google.com>
13556 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13557 (General_options::check_excluded_libs): Strip off directories in
13558 archive name before matching like GNU ld does.
13559 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13560 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13561 (exclude_libs_test_LDFLAGS): Add linker option
13562 -Wl,--exclude-libs,libexclude_libs_test_3
13563 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13564 an explicit archive without using -l.
13565 (alt/libexclude_libs_test_3.a): New make rule.
13566 * testsuite/Makefile.in: Regenerate.
13567 * testsuite/exclude_libs_test.c : Declare lib3_default().
13569 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13570 * exclude_libs_test_3.c: New file.
13572 2009-05-26 Nick Clifton <nickc@redhat.com>
13574 * po/id.po: New Indonesian translation.
13575 * po/gold.pot: Updated template file.
13577 2009-05-22 Sriraman Tallam <tmsriram@google.com>
13579 * testsuite/Makefile.am: Add -ffunction-sections to compile
13580 gc_comdat_test files. Add -Wl,--gc-sections to build
13582 * testsuite/Makefile.in: Regenerate.
13583 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13585 2009-05-21 Sriraman Tallam <tmsriram@google.com>
13587 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13588 kept comdat section was garbage collected.
13589 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13590 * testsuite/Makefile.in: Regenerate.
13591 * testsuite/gc_comdat_test.sh: New file.
13592 * testsuite/gc_comdat_test_1.cc: New file.
13593 * testsuite/gc_comdat_test_2.cc: New file.
13595 2009-05-19 Doug Kwan <dougkwan@google.com>
13597 * archive.cc (Archive::Archive): Move constructor from archive.h
13598 to here. Initialize no_export_.
13599 (Archive::get_elf_object_for_member): Set no_export flag of object.
13600 * archive.h (Archive::Archive): Move constructor body to
13602 (Archive::no_export): New method.
13603 (Archive::no_export_): New field.
13604 * object.h (Object::Object): Initialize no_export_ to false.
13605 (Object::no_export, Object::set_no_export): New methods.
13606 (Object::no_export_): New field.
13607 * options.cc (General_options::parse_exclude_libs): New method.
13608 (General_options::check_excluded_libs) Same.
13609 * options.h (exclude_libs): New option.
13610 (General_options::check_excluded_libs): New method declaration.
13611 (General_options::excluded_libs_): New field.
13612 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13613 default or protected visibility if an object has no-export flag set.
13614 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13615 (check_SCRIPTS): Add exclude_libs_test.sh.
13616 (check_DATA): Add exclude_libs_test.syms.
13617 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13618 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13619 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13620 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13621 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13622 libexclude_libs_test_2.a): New rules.
13623 * testsuite/Makefile.in: Regenerate.
13624 * testsuite/exclude_libs_test.c: New file.
13625 * testsuite/exclude_libs_test.sh: Ditto.
13626 * testsuite/exclude_libs_test_1.c: Ditto.
13627 * testsuite/exclude_libs_test_2.c: Ditto.
13629 2009-05-15 Ian Lance Taylor <iant@google.com>
13631 * configure.ac: Check for declarations for cases where libiberty.h
13632 checks HAVE_DECL_xxx.
13633 * configure, config.in: Rebuild.
13635 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13637 * gold.h (Incremental_argument_list): Remove (invalid) forward
13639 * incremental.cc (Incremental_inputs::report_achive): New method.
13640 (Incremental_inputs::report_object): New method.
13641 (Incremental_inputs::report_script): New method.
13642 (Incremental_inputs::finalize_inputs): New method.
13643 (Incremental_inputs::finalize): Call finalize_inputs().
13644 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13645 Create inputs entries.
13646 * incremental.h (Incremental_input_type): New enum.
13647 (Incremental_inputs::Incremental_input): Initialize new fields.
13648 (Incremental_inputs::report_inputs): New method.
13649 (Incremental_inputs::report_achive): New method.
13650 (Incremental_inputs::report_object): New method.
13651 (Incremental_inputs::report_script): New method.
13652 (Incremental_inputs::finalize_inputs): New method.
13653 (Incremental_inputs::Input_info): New struct.
13654 (Incremental_inputs::Input_info_map): New typedef.
13655 (Incremental_inputs::lock_): New field.
13656 (Incremental_inputs::Inputs_): New field.
13657 (Incremental_inputs::Inputs_map): New field.
13658 * main.cc (main): Call Incremental_input::report_inputs.
13659 * options.h (Input_argument_list): Typedef moved from
13661 (Input_file_group::Files): Remove, use ::Input_argument_list.
13662 (Input_file_group::Input_argument_list): Remove, use
13663 ::Input_argument_list.
13664 * plugin.cc (Plugin_manager::add_input_file): Add error in
13666 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13668 * script.cc (read_input_script): Call
13669 Incremental_input::report_script.
13670 * script.h (Script_info): New class.
13672 2009-04-27 Ian Lance Taylor <iant@google.com>
13674 * x86_64.cc (do_adjust_output_section): Set entsize to
13677 2009-04-23 Elliott Hughes <enh@google.com>
13679 * output.cc (Output_file::close): After short writes, continue
13680 writing from the correct offset in the buffer being written.
13682 2009-04-23 Chris Demetriou <cgd@google.com>
13684 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13685 * configure: Regenerate.
13686 * config.in: Regenerate.
13687 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13688 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13690 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13692 * incremental.cc (Incremental_inputs_header_data): Renamed from
13693 Incremental_input_header_data.
13694 (Incremental_inputs_header_data::data_size): New field.
13695 (Incremental_inputs_header_data::put_input_file_count): Renamed
13696 from input_file_count.
13697 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13698 from command_line_offset.
13699 (Incremental_inputs_header_data::put_reserved): Renamed from
13701 (Incremental_inputs_entry_data): Renamed from
13702 Incremental_input_entry_data.
13703 (Incremental_inputs_entry_data::data_size): New field.
13704 (Incremental_inputs::report_command_line): New method.
13705 (Incremental_inputs::finalize): New method.
13706 (Incremental_inputs::create_incremental_inputs_data): New method.
13707 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13708 * incremental.h: New file.
13709 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
13710 (Layout::finalize): Create incremental inputs section in
13711 incremental builds.
13712 (Layout::create_incremental_info_sections): New method.
13713 * layout.h (Layout::incremental_inputs): New method.
13714 (Layout::create_incremental_info_sections): New method.
13715 (Layout::incremental_inputs_): New field.
13716 * main.cc (main): Notify Incremental_input of the command line.
13718 2009-04-01 Ian Lance Taylor <iant@google.com>
13719 Mikolaj Zalewski <mikolajz@google.com>
13721 * gold.h (reserve_unordered_map): Define, three versions, one for
13722 each version of Unordered_map.
13723 * layout.cc (Layout::Layout): Remove options parameter. Add
13724 number_of_input_files parameter. Don't initialize options_.
13725 Initialize number_of_input_files_ and resized_signatures_. Move
13726 sections_are_attached_.
13727 (Layout::layout_group): Reserve space for group_signatures_.
13728 (Layout::find_or_add_kept_section): Change name parameter to be a
13729 reference. Resize signatures_ map when it gets large enough.
13730 (Layout::layout_eh_frame): Use parameters->options() instead of
13732 (Layout::make_output_section): Likewise.
13733 (Layout::attach_allocated_section_to_segment): Likewise.
13734 (Layout::finalize, Layout::create_executable_stack): Likewise.
13735 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13736 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13737 * layout.h (class Layout): Update declarations. Remove options_
13738 field. Add number_of_input_files_ and resized_signatures_
13739 fields. Move sections_are_attached_ field.
13740 * main.cc (main): Pass number of input files to Layout
13741 constructor. Don't pass options.
13743 2009-03-30 Ian Lance Taylor <iant@google.com>
13745 * ffsll.c (ffsll): Correct implementation.
13747 2009-03-27 Ian Lance Taylor <iant@google.com>
13749 * ffsll.c: New file.
13750 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13751 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13752 * ftruncate.c (ftruncate): Declare before definition.
13753 * mremap.c (mremap): Likewise.
13754 * pread.c (pread): Likewise.
13755 * configure, Makefile.in, config.in: Rebuild.
13757 * mremap.c: New file.
13758 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13759 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13760 (mremap): Declare if HAVE_MREMAP is not defined.
13761 * configure, Makefile.in, config.in: Rebuild.
13763 2009-03-27 Cary Coutant <ccoutant@google.com>
13765 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13766 position independent.
13767 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13768 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13770 2009-03-24 Cary Coutant <ccoutant@google.com>
13772 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13774 (needs_dynamic_reloc): Likewise.
13776 2009-03-24 Ian Lance Taylor <iant@google.com>
13778 * yyscript.y (file_cmd): Recognize EXTERN.
13779 (extern_name_list, extern_name_list_body): New nonterminals.
13780 * script.cc (script_add_extern): Define.
13781 * script-c.h (script_add_extern): Declare.
13783 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
13785 * object.cc (is_elf_object): Define.
13786 * object.h (is_elf_object): Declare.
13787 * archive.cc (Archive::get_elf_object_for_member): Call
13789 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
13791 2009-03-24 Elliott Hughes <enh@google.com>
13793 * output.cc (Output_file::map_anonymous): Define.
13794 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13795 try an anonymous one. Report the size if the mmap fails.
13796 * output.h (class Output_file): Declare map_anonymous.
13798 2009-03-24 Ian Lance Taylor <iant@google.com>
13800 * target-select.cc (instantiate_target): Don't acquire the lock if
13801 the instantiated_target_ field has already been set.
13803 2009-03-23 Ian Lance Taylor <iant@google.com>
13805 * gold-threads.h (class Initialize_lock): Define.
13806 * gold-threads.cc (class Initialize_lock_once): Define.
13807 (initialize_lock_control): New static variable.
13808 (initialize_lock_pointer): New static variable.
13809 (initialize_lock_once): New static function.
13810 (Initialize_lock::Initialize_lock): Define.
13811 (Initialize_lock::initialize): Define.
13812 * target-select.h: Include "gold-threads.h".
13813 (class Target_selector): Add lock_ and initialize_lock_ fields.
13814 Don't define instantiate_target, just declare it.
13815 * target-select.cc (Target_selector::Target_selector): Initialize
13817 (Target_selector::instantiate_target): Define.
13818 * descriptors.h: Include "gold-threads.h".
13819 (class Descriptors): Add initialize_lock_ field.
13820 * descriptors.cc (Descriptors::Descriptors): Initialize new
13822 (Descriptors::open): Use initialize_lock_ field
13823 * errors.h (class Errors): Add initialize_lock_ field.
13824 * errors.cc (Errors::Errors): Initialize new field.
13825 (Errors::initialize_lock): Use initialize_lock_ field.
13826 * powerpc.cc (class Target_selector_powerpc): Remove
13827 instantiated_target_ field. In do_recognize call
13828 instantiate_target rather than do_instantiate_target. In
13829 do_instantiate_target just allocate a new target.
13830 * sparc.cc (class Target_selector_sparc): Likewise.
13832 * freebsd.h: New file.
13833 * i386.cc: Include "freebsd.h".
13834 (Target_i386): Derive from Target_freebsd rather than
13836 (Target_selector_i386): Derive from Target_selector_freebsd rather
13837 than Target_selector.
13838 * x86_64.cc: Include "freebsd.h".
13839 (Target_x86_64): Derive from Target_freebsd rather than
13841 (Target_selector_x86_64): Derive from Target_selector_freebsd
13842 rather than Target_selector.
13843 * target.h (class Target): Add adjust_elf_header and
13844 do_adjust_elf_header.
13845 * output.cc (Output_file_header:: do_sized_write): Call target
13846 adjust_elf_header routine.
13847 * configure.tgt: Set targ_osabi.
13848 * configure.ac: Define GOLD_DEFAULT_OSABI.
13849 * parameters.cc (Parameters::default_target): Pass
13850 GOLD_DEFAULT_OSABI to select_target.
13851 * target-select.h (class Target_selector): Make instantiate_target
13852 protected rather than private.
13853 * Makefile.am (HFILES): Add freebsd.h.
13854 * configure, Makefile.in, config.in: Rebuild.
13856 * merge.cc (do_add_input_section): Correct pend value. Change
13857 message about last entry not being null terminated from error to
13860 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13862 * incremental.cc: New file.
13863 * Makefile.am (CCFILES): Add incremental.cc.
13864 * Makefile.in: Rebuild.
13866 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13868 * layout.cc (Layout::output_section_name): Preserve names
13869 of '.note.' sections.
13871 2009-03-19 Ian Lance Taylor <iant@google.com>
13873 * descriptors.cc (Descriptors::open): Check that the options are
13874 valid before using them.
13876 2009-03-18 Ian Lance Taylor <iant@google.com>
13878 * script-sections.h: Include <list>.
13879 (class Script_sections): Change Sections_elements from std::vector
13880 to std::list. Typedef public Elements_iterator. Add
13881 orphan_section_placement_, data_segment_align_start_, and
13882 saw_data_segment_align_ fields. Remove data_segment_align_index_
13884 * script-sections.cc (class Orphan_section_placement): New class.
13885 (class Sections_element): Add virtual functions is_relro and
13886 orphan_section_init. Remove virtual function place_orphan_here.
13887 (class Output_section_definition): Add is_relro and
13888 orphan_section_init. Remove place_orphan_here.
13889 (class Orphan_output_section): Likewise.
13890 (Script_sections::Script_sections): Update for field changes.
13891 (Script_sections::data_segment_align): Set saw_data_segment_align_
13892 and data_segment_align_start_, not data_segment_align_index.
13893 (Script_sections::data_segment_relro_end): Check
13894 saw_data_segment_align_. Use data_segment_align_start_ rather
13895 than data_segment_align_index_.
13896 (Script_sections::place_orphan): Rewrite to use
13897 Orphan_section_placement.
13899 2009-03-17 Ian Lance Taylor <iant@google.com>
13901 * archive.cc (Archive::add_symbols): Check for a version attached
13902 to the symbol name in the archive map.
13903 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13904 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13905 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13906 (ver_test_11.a): New target.
13907 * testsuite/Makefile.in: Rebuild.
13909 * configure.ac: Check for chsize and posix_fallocate. Replace
13911 * ftruncate.c: New file, from gnulib.
13912 * output.cc (posix_fallocate): Define dummy version if not
13913 HAVE_POSIX_FALLOCATE.
13914 (Output_file::map): Call posix_fallocate rather than lseek and
13916 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13917 * configure, Makefile.in, config.in: Rebuild.
13919 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
13921 * layout.h (Layout::create_note): Add section_name parameter.
13922 * layout.cc (Layout::create_note): Likewise.
13923 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
13925 2009-03-17 Ian Lance Taylor <iant@google.com>
13927 * descriptors.cc: Include "options.h".
13928 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13929 (Descriptors::open): Always use O_CLOEXEC when opening a new
13930 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13931 then set FD_CLOEXEC.
13933 * sparc.cc (class Target_sparc): Add has_got_section.
13934 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13935 make sure we have a GOT section.
13937 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13938 (Target_sparc::Scan::local): Likewise.
13939 (Target_sparc::Scan::global): Likewise.
13940 (Target_sparc::Relocate::relocate): Likewise.
13941 (Target_sparc::Relocate::relocate_tls): Likewise.
13943 * symtab.cc (Symbol_table::define_default_version): New function,
13944 broken out of add_from_object.
13945 (Symbol_table::add_from_object): Call define_default_version.
13946 (Symbol_table::define_special_symbol): Add resolve_oldsym
13947 parameter. Change all callers. If the version for a symbol comes
13948 from a version script, resolve it with the symbol with the same
13949 name with no version. Also add the symbol without a version if
13951 (do_define_in_output_data): If resolving with oldsym, don't delete
13953 (do_define_in_output_segment): Likewise.
13954 (do_define_as_constant): Likewise.
13955 * symtab.h (class Symbol_table): Update declarations.
13957 2009-03-13 Ian Lance Taylor <iant@google.com>
13959 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13960 (Read_symbols::requeue): New function.
13961 (Read_symbols::do_read_symbols): If make_elf_object fails because
13962 the target type is not configured, and the file was searched for,
13963 issue a warning and retry with the next directory.
13964 (Add_symbols::run): If the file has an incompatible format, and
13965 it was searched for, requeue the Read_symbols task. On error,
13966 release the object.
13967 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13968 dirindex parameter to constructor. Change all callers. Declare
13969 incompatible_warning and requeue.
13970 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13971 input_argument_ and input_group_ fields. Add them to
13972 constructor. Change all callers.
13973 (class Read_script): Add dirindex_ field. Add it to constructor.
13974 Change all callers.
13975 * archive.cc (Archive::setup): Remove input_objects parameter.
13976 Change all callers.
13977 (Archive::get_file_and_offset): Likewise.
13978 (Archive::read_all_symbols): Likewise.
13979 (Archive::read_symbols): Likewise.
13980 (Archive::get_elf_object_for_member): Remove input_objects
13981 parameter. Add punconfigured parameter. Change all callers.
13982 (Archive::add_symbols): Change return type to bool. Check return
13983 value of include_member.
13984 (Archive::include_all_members): Likewise.
13985 (Archive::include_member): Change return type to bool. Return
13986 false if first included object has incompatible target. Set
13987 included_member_ field.
13988 (Add_archive_symbols::run): If add_symbols returns false, requeue
13990 * archive.h (class Archive): Add included_member_ field.
13991 Initialize it in constructor. Add input_file and searched_for
13992 methods. Update declarations.
13993 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13994 input_argument_ fields. Add them to constructor. Change all
13996 * script.cc: Include "target-select.h".
13997 (class Parser_closure): Add skip_on_incompatible_target_ and
13998 found_incompatible_target_ fields. Add
13999 skip_on_incompatible_target parameter to constructor. Change all
14000 callers. Add methods skip_on_incompatible_target,
14001 clear_skip_on_incompatible_target, found_incompatible_target, and
14002 set_found_incompatible_target.
14003 (read_input_script): Add dirindex parameter. Change all callers.
14004 If parser finds an incompatible target, requeue Read_symbols
14006 (script_set_symbol): Clear skip_on_incompatible_target in
14008 (script_add_assertion, script_parse_option): Likewise.
14009 (script_start_sections, script_add_phdr): Likewise.
14010 (script_check_output_format): New function.
14011 * script.h (read_input_script): Update declaration.
14012 * script-c.h (script_check_output_format): Declare.
14013 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14014 (ignore_cmd): Remove OUTPUT_FORMAT.
14015 * fileread.cc (Input_file::Input_file): Add explicit this.
14016 (Input_file::will_search_for): New function.
14017 (Input_file::open): Add pindex parameter. Change all callers.
14018 * fileread.h (class Input_file): Add input_file_argument method.
14019 Declare will_search_for. Update declarations.
14020 * object.cc (make_elf_object): Add punconfigured parameter.
14021 Change all callers.
14022 * object.h (class Object): Make input_file public. Add
14023 searched_for method.
14024 (make_elf_object): Update declaration.
14025 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14027 * dirsearch.h (class Dirsearch): Update declaration.
14028 * options.h (class General_options): Add --warn-search-mismatch.
14029 * parameters.cc (Parameters::is_compatible_target): New function.
14030 * parameters.h (class Parameters): Declare is_compatible_target.
14031 * workqueue.cc (Workqueue::add_blocker): New function.
14032 * workqueue.h (class Workqueue): Declare add_blocker.
14034 * fileread.cc (Input_file::open): Remove options parameter.
14035 Change all callers.
14036 (Input_file::open_binary): Likewise.
14037 * script.cc (read_input_script): Likewise.
14038 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14039 options parameter from constructor. Change all callers.
14040 (class Read_script): Likewise.
14041 * fileread.h (class Input_file): Update declarations.
14042 * script.h (read_input_script): Update declaration.
14044 2009-03-10 Nick Clifton <nickc@redhat.com>
14046 * po/es.po: New Spanish translation.
14048 2009-03-06 Cary Coutant <ccoutant@google.com>
14050 * options.cc (parse_short_option): Keep dash_z from registering itself.
14052 2009-03-03 Ian Lance Taylor <iant@google.com>
14055 * target-reloc.h (relocate_section): Pass output_section to
14057 * i386.cc (Target_i386::should_apply_static_reloc): Add
14058 output_section parameter. Change all callers.
14059 (Target_i386::Relocate::relocate): Add output_section parameter.
14060 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14061 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14062 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14063 * testsuite/two_file_shared.sh: New script.
14064 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14065 (check_DATA): Add two_file_shared.dbg.
14066 (two_file_shared.dbg): New target.
14067 * testsuite/Makefile.in: Rebuild.
14069 2009-03-01 Ian Lance Taylor <iant@google.com>
14071 * configure.ac: Check for byteswap.h.
14072 * configure: Rebuild.
14073 * config.in: Rebuild.
14075 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14077 * layout.cc (Layout::find_or_add_kept_section): New function.
14078 (Layout::add_comdat): Removed.
14079 * layout.h (struct Kept_section): Move out of class Layout.
14080 Remove trailing underscores from field names. Add group_sections
14081 field. Rename group_ field to is_group. Change all uses.
14082 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14083 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14084 comdat_groups_ field.
14085 (Sized_relobj::include_section_group): Use
14086 find_or_add_kept_section and Kept_section::group_sections.
14087 (Sized_relobj::include_linkonce_section): Likewise.
14088 * object.cc (class Sized_relobj): Don't define Comdat_group or
14089 Comdat_group_table. Remove find_comdat_group and
14090 add_comdat_group. Remove comdat_groups_ field.
14091 * plugin.cc (include_comdat_group): Use
14092 Layout::find_or_add_kept_section.
14094 2009-02-28 Ian Lance Taylor <iant@google.com>
14096 * README: --gc-sections and map files are now supported. Document
14097 some build requirements.
14100 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14101 relocatable link set the value of the section symbol to zero.
14102 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14103 relocatable link don't include the section address in the local
14106 2009-02-27 Ian Lance Taylor <iant@google.com>
14109 * options.h (class Search_directory): Add is_system_directory.
14110 (class General_options): Declare is_in_system_directory.
14111 * options.cc (get_relative_sysroot): Make static.
14112 (get_default_sysroot): Make static.
14113 (General_optoins::is_in_system_directory): New function.
14114 * fileread.cc (Input_file::is_in_system_directory): New function.
14115 * fileread.h (class Input_file): Declare is_in_system_directory.
14116 * object.h (class Object): Add is_in_system_directory.
14117 (class Input_objects): Remove system_library_directory_ field.
14118 * object.cc (Input_objects::add_object): Don't set
14119 system_library_directory_.
14120 (input_objects::found_in_system_library_directory): Remove.
14121 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14122 parameter. Change all callers.
14123 (Symbol_table::sized_write_globals): Likewise.
14124 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14125 Call Object::is_in_system_directory.
14126 * symtab.h (class Symbol_table): Update declarations.
14129 * descriptors.h (Open_descriptor): Add is_on_stack field.
14130 * descriptors.cc (Descriptors::open): If the descriptor is on the
14131 top of the stack, remove it. Initialize is_on_stack field.
14132 (Descriptors::release): Only add pod to stack if it is not on the
14134 (Descriptors::close_some_descriptor): Clear stack_next and
14135 is_on_stack fields.
14138 * output.cc (Output_section::find_starting_output_address): Rename
14139 from starting_output_address; add PADDR parameter; change return
14141 * output.h (class Output_section): Declare
14142 find_starting_output_address instead of starting_output_address.
14143 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14144 section symbol for which we can't find a merge section.
14147 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14148 hidden or internal, force the symbol to be local.
14149 * resolve.cc (Symbol::override_visibility): Define.
14150 (Symbol::override_base): Use override_visibility.
14151 (Symbol_table::resolve): Likewise.
14152 (Symbol::override_base_with_special): Likewise.
14153 (Symbol_table::override_with_special): If the visibility is hidden
14154 or internal, force the symbol to be local.
14155 * symtab.h (class Symbol): Add set_visibility and
14156 override_visibility.
14157 * testsuite/ver_test_1.sh: New file.
14158 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14159 (check_DATA): Add ver_test_1.syms.
14160 (ver_test_1.syms): New target.
14161 * testsuite/Makefile.in: Rebuild.
14163 2009-02-25 Cary Coutant <ccoutant@google.com>
14165 * layout.cc (Layout::choose_output_section): Don't rename sections
14166 when using a linker script that has a SECTIONS clause.
14167 * Makefile.in: Regenerate.
14169 * testsuite/Makefile.am (script_test_5.sh): New test case.
14170 * testsuite/Makefile.in: Regenerate.
14171 * testsuite/script_test_5.cc: New file.
14172 * testsuite/script_test_5.sh: New file.
14173 * testsuite/script_test_5.t: New file.
14175 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
14177 * archive.cc (Archive::include_member): Update calls to add_symbols.
14178 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14179 the Layout argument.
14180 * dynobj.h (do_add_symbols): Add the Layout argument.
14181 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14183 * object.h (Object::add_symbols): Add the Layout argument.
14184 (Object::do_add_symbols): Add the Layout argument.
14185 (Sized_relobj::do_add_symbols): Add the Layout argument.
14186 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14187 Unify the two versions.
14188 (Add_plugin_symbols): Remove.
14189 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14190 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14191 (Add_plugin_symbols): Remove.
14192 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14193 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14194 (Add_symbols::run): Make it work with Pulginobj.
14196 2009-02-06 Ian Lance Taylor <iant@google.com>
14198 * object.cc (Sized_relobj::do_layout): Make info message start
14199 with lower case letter.
14201 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14203 * binary.cc: Fix file comment.
14205 * options.h (enum Incremental_disposition): Define.
14206 (class General_options): Add new options: --incremental,
14207 --incremental_changed, --incremental_unchanged,
14208 --incremental_unknown. Add incremental_disposition_ and
14209 implicit_incremental_ fields.
14210 (General_options::incremental_disposition): New function.
14211 (class Position_dependent_options): Add incremental_disposition
14213 (Position_dependent_options::copy_from_options): Set incremental
14215 * options.cc (General_options::parse_incremental_changed): New
14217 (General_options::parse_incremental_unchanged): New function.
14218 (General_options::parse_incremental_unknown): New function.
14219 (General_options::General_options): Initialize new fields
14220 incremental_disposition_ and implicit_incremental_.
14221 (General_options::finalize): Check for uasge of --incremental-*
14222 without --incremental.
14224 2009-02-06 Chris Demetriou <cgd@google.com>
14226 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14227 pointer and to report location as the file name associated with
14229 (gold_undefined_symbol_at_location): New function to replace the
14230 old gold_undefined_symbol functionality.
14231 * target-reloc.h (relocate_section): Update to use
14232 gold_undefined_symbol_at_location.
14233 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14234 Call gold_undefined_symbol function rather than gold_error.
14235 * errors.h (Errors::undefined_symbol): Take location as a
14236 string, rather than calculating it from a relocation.
14237 * errors.cc (Errors::fatal): Print "fatal error:" before the
14239 (Errors::error, Errors::error_at_location): Print "error: "
14240 before the formatted message.
14241 (Errors::undefined_symbol): Take location as a string, rather
14242 than calculating it from a relocation.
14243 (gold_undefined_symbol_at_location): New function akin to
14244 old gold_undefined_symbol, calculates location from relocation.
14245 (gold_undefined_symbol): Change to take only a Symbol pointer
14246 and to report location as the file name associated with the symbol.
14247 * testsuite/debug_msg.sh: Update for changed error messages.
14248 * testsuite/undef_symbol.sh: Likewise.
14250 2009-02-04 Duncan Sands <baldrick@free.fr>
14253 * reduced_debug_output.h
14254 (Output_reduced_debug_abbrev_section::failed): Use format for
14256 (Output_reduced_debug_info_section::faild): Likewise.
14258 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14260 * script.cc (Lazy_demangler): New class.
14261 (Version_script_info::get_symbol_version_helper): Demangle a
14264 2009-01-29 Cary Coutant <ccoutant@google.com>
14266 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14268 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14270 2009-01-28 Ian Lance Taylor <iant@google.com>
14272 * version.cc (version_string): Bump to 1.9.
14274 * gold.h: Include <cstring> and <stdint.h>.
14275 * version.cc: Include <cstdio>.
14276 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14278 * reduced_debug_output.cc (insert_into_vector): Rename from
14279 Insert_into_vector; change all callers. Use Swap_unaligned to
14280 avoid aliasing issue; remove union since it is unnecessary.
14282 2009-01-27 Sriraman Tallam <tmsriram@google.com>
14284 * Makefile.am (CCFILES): Add gc.cc.
14285 (HFILES): Add gc.h.
14286 * Makefile.in: Regenerate.
14287 * gold.cc (Gc_runner): New class.
14288 (queue_initial_tasks): Call garbage collection related tasks
14289 when corresponding options are invoked.
14290 (queue_middle_gc_tasks): New function.
14291 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14292 processed early before laying out sections during garbage collection.
14293 * gold.h (queue_middle_gc_tasks): New function.
14294 (is_prefix_of): Move from "layout.cc".
14295 * i386.cc (Target_i386::gc_process_relocs): New function.
14296 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14297 * main.cc (main): Create object of class "Garbage_collection".
14298 * object.cc (Relobj::copy_symbols_data): New function.
14299 (Relobj::is_section_name_included): New function.
14300 (Sized_relobj::do_layout): Allow this function to be called twice
14301 during garbage collection and defer layout of section during the
14303 * object.h (Relobj::get_symbols_data): New function.
14304 (Relobj::is_section_name_included): New function.
14305 (Relobj::copy_symbols_data): New function.
14306 (Relobj::set_symbols_data): New function.
14307 (Relobj::get_relocs_data): New function.
14308 (Relobj::set_relocs_data): New function.
14309 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14310 (Relobj::gc_process_relocs): New function.
14311 (Relobj::do_gc_process_relocs): New pure virtual function.
14312 (Relobj::sd_): New data member.
14313 (Sized_relobj::is_output_section_offset_invalid): New function.
14314 (Sized_relobj::do_gc_process_relocs): New function.
14315 * options.h (General_options::gc_sections): Modify to not be a no-op.
14316 (General_options::print_gc_sections): New option.
14317 * plugin.cc (Plugin_finish::run): Remove function call to
14318 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14319 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14320 * reloc.cc (Read_relocs::run): Add task to process relocs and
14321 determine unreferenced sections when doing garbage collection.
14322 (Gc_process_relocs): New class.
14323 (Sized_relobj::do_gc_process_relocs): New function.
14324 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14325 sections that are garbage collected.
14326 * reloc.h (Gc_process_relocs): New class.
14327 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14328 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14329 symbols whose corresponding sections are garbage collected.
14330 (Symbol_table::Symbol_table): Add new parameter for the garbage
14332 (Symbol_table::gc_mark_undef_symbols): New function.
14333 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14334 (Symbol_table::gc_mark_dyn_syms): New function.
14335 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14337 (Symbol_table::add_from_object): Likewise.
14338 (Symbol_table::add_from_relobj): When building shared objects, do not
14339 treat externally visible symbols as garbage.
14340 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14341 table information for static and relocatable links.
14342 * symtab.h (Symbol_table::set_gc): New function.
14343 (Symbol_table::gc): New function.
14344 (Symbol_table::gc_mark_undef_symbols): New function.
14345 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14346 (Symbol_table::gc_mark_dyn_syms): New function.
14347 (Symbol_table::gc_): New data member.
14348 * target.h (Sized_target::gc_process_relocs): New pure virtual
14350 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14351 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14353 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14355 * options.h (General_options::gc_sections): Define as a no-op for now.
14356 (General_options::no_keep_memory): Ditto.
14357 (General_options::Bshareable): Define.
14358 * options.cc (General_options::finalize): Honor -Bshareable.
14360 2009-01-20 Andreas Schwab <schwab@suse.de>
14362 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14363 read the value in the contents, since we don't use it. Use the
14364 template endianness when writing.
14365 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14367 2009-01-19 Andreas Schwab <schwab@suse.de>
14369 * configure.tgt (powerpc64-*): Fix targ_obj.
14371 2009-01-15 Ian Lance Taylor <iant@google.com>
14373 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14374 local symbols when stripping all symbols.
14376 2009-01-14 Cary Coutant <ccoutant@google.com>
14378 * output.cc (Output_reloc): Add explicit instantiations.
14380 2009-01-14 Cary Coutant <ccoutant@google.com>
14382 * archive.cc (Archive::get_elf_object_for_member): Remove call
14383 to File_read::claim_for_plugin.
14384 * descriptors.cc (Descriptors::open): Remove reference to
14386 (Descriptors::claim_for_plugin): Remove.
14387 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14388 (Descriptors::is_claimed): Remove.
14389 (claim_descriptor_for_plugin): Remove.
14390 * fileread.cc (File_read::claim_for_plugin): Remove.
14391 * fileread.h (File_read::claim_for_plugin): Remove.
14392 (File_read::descriptor): Reopen descriptor if necessary.
14393 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14394 (Plugin_manager::all_symbols_read): Add task parameter. Change
14396 (Plugin_manager::get_input_file): New function.
14397 (Plugin_manager::release_input_file): New function.
14398 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14399 corresponding data member.
14400 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14401 and pass to base constructor. Change all callers.
14402 (get_input_file, release_input_file): New functions.
14403 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14404 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14405 (Plugin_manager::all_symbols_read): Add task parameter.
14406 (Plugin_manager::get_input_file): New function.
14407 (Plugin_manager::release_input_file): New function.
14408 (Plugin_manager::task_): New data member.
14409 (Pluginobj::Pluginobj): Add filesize parameter.
14410 (Pluginobj::filename): New function.
14411 (Pluginobj::descriptor): New function.
14412 (Pluginobj::filesize): New function.
14413 (Pluginobj::filesize_): New data member.
14414 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14415 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14416 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14418 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14419 with archive libraries.
14420 * testsuite/Makefile.in: Regenerate.
14421 * testsuite/plugin_test.c (struct sym_info): New type.
14422 (get_input_file, release_input_file): New static variables.
14423 (onload): Capture new transfer vector entries.
14424 (claim_file_hook): Stop reading at end of file according to filesize.
14425 Factor out parsing of readelf output into separate function.
14426 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14427 APIs and get the source file name from the symbol table. Convert
14428 source file name to corresponding object file name. Print info
14429 message when adding new input files.
14430 (parse_readelf_line): New function.
14431 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14432 * testsuite/plugin_test_2.sh: Likewise.
14433 * testsuite/plugin_test_3.sh: Likewise.
14434 * testsuite/plugin_test_4.sh: New test case.
14436 2009-01-07 Ian Lance Taylor <iant@google.com>
14438 * version.cc (version_string): Bump to 1.8.
14440 2008-12-23 Cary Coutant <ccoutant@google.com>
14442 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14443 * plugin.cc (Plugin_manager::finish): Rename as
14444 layout_deferred_objects. Move cleanup to separate function.
14445 (Plugin_manager::cleanup): New function.
14446 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14448 * plugin.h (Plugin_manager::finish): Rename as
14449 layout_deferred_objects.
14450 (Plugin_manager::cleanup): New function.
14451 (Plugin_manager::cleanup_done): New field.
14453 2008-12-23 Cary Coutant <ccoutant@google.com>
14455 * plugin.cc (is_visible_from_outside): New function.
14456 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14457 so we don't return "IR only" status for exported symbols or -r links.
14459 * testsuite/Makefile.am (plugin_test_3): New test case.
14460 * testsuite/Makefile.in: Regenerate.
14461 * testsuite/plugin_test_3.sh: New file.
14463 2008-12-22 Cary Coutant <ccoutant@google.com>
14465 * object.cc (Sized_relobj::layout_section): New function.
14466 (Sized_relobj::do_layout): Defer layout of input sections until after
14467 plugin has provided replacement files.
14468 (Sized_relobj::do_layout_deferred_sections): New function.
14469 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14470 (Relobj::layout_deferred_sections): New function.
14471 (Relobj::do_layout_deferred_sections): New function.
14472 (Sized_relobj::do_layout_deferred_sections): New function.
14473 (Sized_relobj::layout_section): New function.
14474 (Sized_relobj::Deferred_layout): New structure.
14475 (Sized_relobj::deferred_layout_): New field.
14476 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14477 Change all callers. Layout deferred sections.
14478 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14480 (Plugin_hook::run): Move code from do_plugin_hook inline.
14481 (Plugin_hook::do_plugin_hook): Remove.
14482 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14483 (Plugin_manager::finish): Renamed, was cleanup.
14484 (Plugin_manager::should_defer_layout): New function.
14485 (Plugin_manager::add_deferred_layout_object): New function.
14486 (Plugin_manager::Deferred_layout_list): New type.
14487 (Plugin_manager::deferred_layout_objects_): New field.
14488 (Plugin_hook::do_plugin_hook): Remove.
14490 2008-12-17 Ian Lance Taylor <iant@google.com>
14492 * options.h (class General_options): Add --no case for
14495 2008-12-16 Cary Coutant <ccoutant@google.com>
14497 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14499 (Plugin_manager::claim_file): Create plugin object even if
14500 plugin did not call the add_symbols callback.
14501 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14502 asking for more symbols than were added.
14503 * testsuite/Makefile.am (plugin_test_1): Add test case with
14505 (empty.syms): New target.
14506 * testsuite/Makefile.in: Regenerate.
14507 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14508 message. Don't call add_symbols if no globals.
14509 (all_symbols_read_hook): Don't provide replacement for empty
14512 2008-12-12 Ian Lance Taylor <iant@google.com>
14514 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14515 r_type == 0 for a local symbol with r_sym == 0.
14516 (scan_relocatable_relocs): Pass r_sym to
14517 local_non_section_strategy.
14518 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14521 * configure.ac: Update test for TLS descriptors: they are
14522 supported as of glibc 2.9.
14523 * configure: Rebuild.
14525 2008-12-11 Ian Lance Taylor <iant@google.com>
14528 * target-reloc.h (Default_scan_relocatable_relocs): For each
14529 function, map r_type == 0 to RELOC_DISCARD.
14531 2008-12-10 Cary Coutant <ccoutant@google.com>
14533 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14534 object to override a kept COMDAT group from a plugin object.
14536 2008-12-09 Ian Lance Taylor <iant@google.com>
14539 * yyscript.y (file_cmd): Handle INPUT.
14541 * testsuite/initpri1.c: Change all declarations to be full
14542 prototypes by adding void, to avoid compiler warnings.
14544 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
14546 * options.cc (General_options::parse_plugin_opt): New.
14547 (General_options::add_plugin): The argument now is just the filename.
14548 (General_options::add_plugin_option): New.
14549 * options.h (plugin_opt): New.
14550 (add_plugin): Change argument name.
14551 (add_plugin_option): New.
14552 * plugin.cc (Plugin::load): Don't parse the plugin option.
14553 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14554 (Plugin::add_option): New.
14555 (Plugin::args_): Change type.
14556 (Plugin::filename_): New.
14557 (Plugin_manager::add_plugin_option): New.
14558 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14559 * testsuite/Makefile.in: Regenerate.
14561 2008-12-05 Cary Coutant <ccoutant@google.com>
14563 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14564 Handle --strip-lto-sections option.
14565 * options.h (strip_lto_sections): New option.
14567 2008-12-01 Cary Coutant <ccoutant@google.com>
14569 * plugin.cc (ld_plugin_message): Change format parameter to const.
14570 Fix mismatch between new[] and delete.
14572 2008-11-14 Cary Coutant <ccoutant@google.com>
14574 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14577 2008-11-05 Craig Silverstein <csilvers@google.com>
14579 * options.cc (General_options::parse_dynamic_list): New function.
14580 * options.h (General_options): New flags dynamic_list,
14581 dynamic_list_data, dynamic_list_cpp_new, and
14582 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14583 (General_options::in_dynamic_list): New function.
14584 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14585 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14586 (Lex::can_continue_name): Likewise.
14588 (read_script_file): New parameter script_options.
14589 (read_dynamic_list): New function.
14590 (Script_options::define_dynamic_list): New function.
14591 (dynamic_list_keyword_parsecodes): New variable.
14592 (dynamic_list_keywords): New variable.
14593 * script.h (Script_options::define_dynamic_list): New function
14595 (read_dynamic_list): New function prototype.
14596 * symtab.cc (strprefix): New macro.
14597 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14598 dynamic_list_data, dynamic_list_cpp_new, and
14599 dynamic_list_cpp_typeinfo.
14600 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14601 (dynamic_list_expr): New rule.
14602 (dynamic_list_nodes): Likewise.
14603 (dynamic_list_node): Likewise.
14604 * testsuite/Makefile.am (dynamic_list): New test.
14605 * testsuite/Makefile.in: Regenerated.
14606 * testsuite/dynamic_list.t: New file.
14607 * testsuite/dynamic_list.sh: New file.
14609 2008-11-05 Craig Silverstein <csilvers@google.com>
14611 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14612 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14613 (t11_last): Likewise.
14614 * testsuite/ver_test_6.c (main): Likewise.
14616 2008-10-07 Cary Coutant <ccoutant@google.com>
14618 * options.c (General_options::finalize): Add check for -static and
14620 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14623 2008-10-02 Cary Coutant <ccoutant@google.com>
14625 * plugin.cc (make_sized_plugin_object): Fix conditional
14626 compilation to work when not all targets are enabled.
14628 2008-09-29 Cary Coutant <ccoutant@google.com>
14630 * archive.cc (Archive::get_file_and_offset): Use filename instead
14631 of name to get library path.
14632 (Archive::include_member): Unlock external member of a thin archive.
14634 * testsuite/Makefile.am (TEST_AR): New variable.
14635 (thin_archive_test_1): New test.
14636 (thin_archive_test_2): New test.
14637 * testsuite/Makefile.in: Regenerate.
14638 * testsuite/thin_archive_main.cc: New file.
14639 * testsuite/thin_archive_test_1.cc: New file.
14640 * testsuite/thin_archive_test_2.cc: New file.
14641 * testsuite/thin_archive_test_3.cc: New file.
14642 * testsuite/thin_archive_test_4.cc: New file.
14644 2008-09-29 Cary Coutant <ccoutant@google.com>
14646 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14647 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14649 (Sized_relobj::do_finalize_local_symbols): Likewise.
14650 (Sized_relobj::map_to_kept_section): Likewise.
14651 * object.h (Sized_relobj::invalid_address): New constant.
14652 (Sized_relobj::do_output_section_offset): Check for invalid_address
14654 * output.cc (Output_reloc::local_section_offset): Use constant
14655 invalid_address instead of -1U.
14656 (Output_reloc::get_address): Likewise.
14657 (Output_section::output_address): Change -1U to -1ULL.
14658 * output.h (Output_reloc::invalid_address): New constant.
14659 * reloc.cc (Sized_relobj::write_sections): Use constant
14660 invalid_address instead of -1U.
14661 (Sized_relobj::relocate_sections): Likewise.
14662 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14663 values for merge sections.
14664 * target-reloc.h (relocate_for_relocatable): Use constant
14665 invalid_address instead of -1U.
14667 2008-09-19 Cary Coutant <ccoutant@google.com>
14669 Add plugin functionality for link-time optimization (LTO).
14670 * configure.ac (plugins): Add --enable-plugins option.
14671 * configure: Regenerate.
14672 * config.in: Regenerate.
14673 * Makefile.am (LIBDL): New variable.
14674 (CCFILES): Add plugin.cc.
14675 (HFILES): Add plugin.h.
14676 (ldadd_var): Add LIBDL.
14677 * Makefile.in: Regenerate.
14679 * archive.cc: Include "plugin.h".
14680 (Archive::setup): Don't preread archive symbols when using a plugin.
14681 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14682 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14684 (Archive::include_member): Add symbols from plugin objects.
14685 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14686 * descriptors.cc (Descriptors::open): Check for file descriptors
14687 abandoned by plugins.
14688 (Descriptors::claim_for_plugin): New function.
14689 * descriptors.h (Descriptors::claim_for_plugin): New function.
14690 (Open_descriptor::is_claimed): New field.
14691 (claim_descriptor_for_plugin): New function.
14692 * fileread.cc (File_read::claim_for_plugin): New function.
14693 * fileread.h (File_read::claim_for_plugin): New function.
14694 (File_read::descriptor): New function.
14695 * gold.cc: Include "plugin.h".
14696 (queue_initial_tasks): Add task to call plugin hooks for generating
14698 * main.cc: Include "plugin.h".
14699 (main): Load plugin libraries.
14700 * object.h (Pluginobj): Declare.
14701 (Object::pluginobj): New function.
14702 (Object::do_pluginobj): New function.
14703 (Object::set_target): New function.
14704 * options.cc: Include "plugin.h".
14705 (General_options::parse_plugin): New function.
14706 (General_options::General_options): Initialize plugins_ field.
14707 (General_options::add_plugin): New function.
14708 * options.h (Plugin_manager): Declare.
14709 (General_options): Add --plugin option.
14710 (General_options::has_plugins): New function.
14711 (General_options::plugins): New function.
14712 (General_options::add_plugin): New function.
14713 (General_options::plugins_): New field.
14714 * plugin.cc: New file.
14715 * plugin.h: New file.
14716 * readsyms.cc: Include "plugin.h".
14717 (Read_symbols::do_read_symbols): Check for archive before checking
14718 for ELF file. Call plugin hooks to claim files.
14719 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14720 from a real object file; force override when processing replacement
14722 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14723 (Symbol::init_base_object): Likewise.
14724 (Symbol::init_base_output_data): Likewise.
14725 (Symbol::init_base_output_segment): Likewise.
14726 (Symbol::init_base_constant): Likewise.
14727 (Symbol::init_base_undefined): Likewise.
14728 (Symbol::output_section): Assert that object is not a plugin.
14729 (Symbol_table::add_from_pluginobj): New function.
14730 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14732 (Symbol_table::sized_write_globals): Likewise.
14733 (Symbol_table::add_from_pluginobj): Instantiate template.
14734 * symtab.h (Sized_pluginobj): Declare.
14735 (Symbol::in_real_elf): New function.
14736 (Symbol::set_in_real_elf): New function.
14737 (Symbol::in_real_elf_): New field.
14738 (Symbol_table::add_from_pluginobj): New function.
14740 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14741 (LIBDL): New variable.
14742 (LDADD): Add LIBDL.
14743 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14744 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14745 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14746 (MOSTLYCLEANFILES): Likewise.
14747 * testsuite/Makefile.in: Regenerate.
14748 * testsuite/plugin_test.c: New file.
14749 * testsuite/plugin_test_1.sh: New file.
14750 * testsuite/plugin_test_2.sh: New file.
14752 2008-09-16 Ian Lance Taylor <iant@google.com>
14754 * target-reloc.h (relocate_section): Check whether a symbol is
14755 defined by the ABI before reporting an undefined symbol error.
14756 * target.h (Target::is_defined_by_abi): Make parameter const.
14757 (Target::do_is_defined_by_abi): Likewise.
14758 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14759 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14760 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14761 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14762 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14763 * testsuite/Makefile.in: Rebuild.
14765 * fileread.cc (make_view): Add casts to avoid warning.
14767 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
14769 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14770 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14772 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
14774 * options.h (General_options::output_is_executable): New.
14775 (General_options::output_is_pie): New.
14776 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14777 for shared libraries.
14778 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14780 2008-09-11 Chris Demetriou <cgd@google.com>
14782 * options.h (origin): New -z option.
14783 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14784 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14787 2008-09-05 Cary Coutant <ccoutant@google.com>
14789 * fileread.cc (File_read::make_view): Add check for attempt to map
14790 beyond end of file.
14792 2008-09-05 Cary Coutant <ccoutant@google.com>
14794 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14795 explicit instantiations.
14797 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14800 * options.cc (General_options::finalize): Allow undefined symbols
14801 in shlibs if linking -shared.
14804 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14805 symbols as not needing a dynsym entry.
14807 2008-08-20 Craig Silverstein <csilvers@google.com>
14809 * fileread.cc (File_read::open): Do not lock the file unless it
14810 was successfully opened.
14812 2008-08-14 Cary Coutant <ccoutant@google.com>
14814 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14815 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14816 * testsuite/tls_test.cc (struct int128): 128-bit struct
14817 for testing TLS relocs with non-zero addend.
14818 (v12): New TLS variable.
14820 (t_last): Add check for v12.
14821 * testsuite/tls_test.h (t12): New function.
14822 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14824 2008-08-13 Ian Lance Taylor <iant@google.com>
14826 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14827 set tls_segment_ or relro_segment_.
14828 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14830 * output.h (Output_section::clear_is_relro): New function.
14831 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14832 sections specially even when output_data_ is empty.
14833 (Output_segment::maximum_alignment): When first section is relro,
14834 only force alignment for PT_LOAD segments.
14835 * script.cc (script_data_segment_align): New function.
14836 (script_data_segment_relro_end): New function.
14837 * script-c.h (script_data_segment_align): Declare.
14838 (script_data_segment_relro_end): Declare.
14839 * script-sections.h (class Script_sections): Declare
14840 data_segment_align and data_segment_relro_end. Add fields
14841 segment_align_index_ and saw_relro_end_.
14842 * script-sections.cc (class Sections_element): Add set_is_relro
14843 virtual function. Add new bool* parameter to place_orphan_here.
14844 Add get_output_section virtual function.
14845 (class Output_section_definition): Add set_is_relro. Add new
14846 bool* parameter to place_orphan_here. Add get_output_section.
14847 Add is_relro_ field.
14848 (Output_section_definition::Output_section_definition): Initialize
14849 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14850 and is_relro_ fields.
14851 (Output_section_definition::place_orphan_here): Add is_relro
14853 (Output_section_definition::set_section_addresses): Set relro for
14855 (Output_section_definition::alternate_constraint): Likewise.
14856 (class Orphan_output_section): Add new bool* parameter to
14857 place_orphan_here. Add get_output_section.
14858 (Orphan_output_section::place_orphan_here): Add is_relro
14860 (Script_sections::Script_sections): Initialize
14861 data_segment_align_index_ and saw_relro_end_.
14862 (Script_sections::data_segment_align): New function.
14863 (Script_sections::data_segment_relro_end): New function.
14864 (Script_sections::place_orphan): Set or clear is_relro.
14865 (Script_sections::set_section_addresses): Force alignment of first
14867 * yyscript.y (exp): Call script_data_segment_align and
14868 script_data_segment_relro_end.
14869 * testsuite/relro_script_test.t: New file.
14870 * testsuite/relro_test.cc (using_script): Declare.
14871 (t1, t2): Test using_script.
14872 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14873 (relro_script_test_SOURCES): Define.
14874 (relro_script_test_DEPENDENCIES): Define.
14875 (relro_script_test_LDFLAGS): Define.
14876 (relro_script_test_LDADD): Define.
14877 (relro_script_test.so): New target.
14878 * testsuite/Makefile.in: Rebuild.
14880 2008-08-06 Cary Coutant <ccoutant@google.com>
14882 * archive.cc (Archive::total_archives, Archive::total_members)
14883 (Archive::total_members_loaded): New variables.
14884 (Archive::setup): Add parameter. Add option to preread
14886 (Archive::read_armap): Add counter.
14887 (Archive::get_file_and_offset): New function.
14888 (Archive::get_elf_object_for_member): New function.
14889 (Archive::read_all_symbols): New function.
14890 (Archive::read_symbols): New function.
14891 (Archive::add_symbols): Add counters.
14892 (Archive::include_all_members): Use armap to find members if it's
14894 (Archive::include_member): Skip reading symbols if already read.
14895 Factored code into Archive::get_file_and_offset and
14896 Archive::get_elf_object_for_member. Changed call to
14897 Mapfile::report_include_archive_member.
14898 (Archive::print_stats): New function.
14899 * archive.h: Declare Object and Read_symbols_data classes.
14900 (Archive::Archive): Add initializers for new members.
14901 (Archive::setup): Add parameter.
14902 (Archive::print_stats): New function.
14903 (Archive::total_archives, Archive::total_members)
14904 (Archive::total_members_loaded): New variables.
14905 (Archive::get_file_and_offset): New function.
14906 (Archive::get_elf_object_for_member): New function.
14907 (Archive::read_all_symbols): New function.
14908 (Archive::read_symbols): New function.
14909 (Archive::Archive_member): New class.
14910 (Archive::members_): New member.
14911 (Archive::num_members_): New member.
14912 * main.cc: Include archive.h.
14913 (main): Call Archive::print_stats.
14914 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14915 archive parameter; member_name is now the fully-decorated name.
14916 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14917 * options.h: (General_options): Add --preread-archive-symbols option.
14918 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14921 2008-08-04 Ian Lance Taylor <iant@google.com>
14923 * symtab.h (Symbol::use_plt_offset): New function.
14924 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14925 * powerpc.cc (Relocate::relocate): Likewise.
14926 * sparc.cc (Relocate::relocate): Likewise.
14927 * x86_64.cc (Relocate::relocate): Likewise.
14928 * testsuite/weak_plt.sh: New test.
14929 * testsuite/weak_plt_main.cc: New test.
14930 * testsuite/weak_plt_shared.cc: New test.
14931 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14932 (check_PROGRAMS): Add weak_plt.
14933 (check_DATA): Add weak_plt_shared.so.
14934 (weak_plt_main_pic.o, weak_plt): New targets.
14935 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14936 * testsuite/Makefile.in: Rebuild.
14938 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14940 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14941 * testsuite/Makefile.in: Rebuild.
14943 2008-08-04 Alan Modra <amodra@bigpond.net.au>
14945 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14946 * Makefile.in: Regenerate.
14947 * po/POTFILES.in: Regenerate.
14949 2008-07-29 Ian Lance Taylor <iant@google.com>
14951 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14952 symbols before other symbols.
14953 * testsuite/script_test_2.cc (test_addr): Declare.
14954 (test_addr_alias): Declare.
14955 (main): Check that test_addr and test_addr_alias have the right
14957 * testsuite/script_test_2.t: Define test_addr_alias and
14960 2008-07-24 Ian Lance Taylor <iant@google.com>
14963 * descriptors.cc: New file.
14964 * descriptors.h: New file.
14965 * gold-threads.h (class Hold_optional_lock): New class.
14966 * fileread.cc: Include "descriptors.h".
14967 (File_read::~File_read): Release descriptor rather than closing
14969 (File_read::open) [file]: Call open_descriptor rather than open.
14970 Set is_descriptor_opened_.
14971 (File_read::open) [memory]: Assert that descriptor is not open.
14972 (File_read::reopen_descriptor): New function.
14973 (File_read::release): Release descriptor.
14974 (File_read::do_read): Make non-const. Reopen descriptor.
14975 (File_read::read): Make non-const.
14976 (File_read::make_view): Reopen descriptor.
14977 (File_read::do_readv): Likewise.
14978 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14979 Update declarations.
14980 * layout.cc: Include "descriptors.h".
14981 (Layout::create_build_id): Use open_descriptor rather than open.
14982 * output.cc: Include "descriptors.h".
14983 (Output_file::open): Use open_descriptor rather than open.
14984 * archive.cc (Archive::const_iterator): Change Archive to be
14986 (Archive::begin, Archive::end): Make non-const.
14987 (Archive::count_members): Likewise.
14988 * archive.h (class Archive): Update declarations.
14989 * object.h (Object::read): Make non-const.
14990 * Makefile.am (CCFILES): Add descriptors.cc.
14991 (HFILES): Add descriptors.h.
14992 * Makefile.in: Rebuild.
14995 * gold.h: Always include <clocale>. Add Solaris workarounds
14996 following code in binutils/sysdep.h.
14999 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15000 this->eh_frame_hdr_ is NULL before using it.
15002 * dynobj.cc (Versions::Versions): Update comment.
15004 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15005 the base version name.
15007 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15008 array size plus one.
15009 (Stringpool_template::set_string_offsets): Subtract one from key
15010 before using it as an array index.
15011 (Stringpool_template::get_offset_with_length): Likewise.
15012 (Stringpool_template::write_to_buffer): Likewise.
15013 * stringpool.h (Stringpool_template::get_offset_from_key):
15016 2008-07-23 Ian Lance Taylor <iant@google.com>
15019 * object.h (Merged_symbol_value::value): Do our best to handle a
15023 * script.cc (Version_script_info::get_versions): Don't add empty
15024 version tag to return value.
15025 (Version_script_info::get_symbol_version_helper): Change return
15026 type to bool. Add pversion parameter. Change all callers.
15027 (script_register_vers_node): Don't require a non-NULL tag.
15028 * script.h (class Version_script_info): Update declarations.
15029 (Version_script_info::get_symbol_version): Change return type to
15030 bool. Add version parameter. Change all callers.
15031 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15032 handling. Handle an empty version from a version script.
15033 (Symbol_table::define_special_symbol): Likewise.
15034 * testsuite/ver_test_10.script: New file.
15035 * testsuite/ver_test_10.sh: New file.
15036 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15037 (check_DATA): Add ver_test_10.syms.
15038 (ver_test_10.syms, ver_test_10.so): New target.
15039 * testsuite/Makefile.in: Rebuild.
15041 2008-07-23 Simon Baldwin <simonb@google.com>
15043 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15044 to zero for undefined symbols from dynamic libraries.
15046 2008-07-23 Ian Lance Taylor <iant@google.com>
15048 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15049 Change all callers.
15050 * symtab.h (class Symbol_table): Update declaration.
15051 * testsuite/ver_test_9.cc: New file.
15052 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15053 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15054 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15055 (ver_test_9.so, ver_test_9.o): New targets.
15056 * testsuite/Makefile.in: Rebuild.
15058 2008-07-22 Ian Lance Taylor <iant@google.com>
15060 * options.h (class General_options): Define --check-sections.
15061 * layout.cc (Layout::set_segment_offsets): Handle
15064 * options.h (class General_options): Define -n/--nmagic and
15066 * options.cc (General_options::finalize): For -n/--nmagic or
15067 -N/--omagic, set -static.
15068 * layout.cc (Layout::attach_allocated_section_to_segment): If
15069 -N/--omagic, don't put read-only and read-write sections in
15070 different segments.
15071 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15072 finding a read-only segment.
15073 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15074 don't set the minimum segment alignment to the common page size,
15075 and don't set the file offset to the address modulo the page size.
15076 * script-sections.cc (Script_sections::create_segments): If
15077 -n/--omagic, don't put read-only and read-write sections in
15078 different segments.
15080 * cref.cc: New file.
15081 * cref.h: New file.
15082 * options.h (class General_options): Add --print-symbol-counts.
15083 * main.cc (main): Issue defined symbol report if requested.
15084 * archive.cc (Archive::interpret_header): Make into a const member
15086 (Archive::add_symbols): Call Input_objects::archive_start and
15088 (Archive::const_iterator): Define new class.
15089 (Archive::begin, Archive::end): New functions.
15090 (Archive::include_all_members): Rewrite to use iterator.
15091 (Archive::count_members): New function.
15092 * archive.h (class Archive): Update declarations.
15093 (Archive::filename): New function.
15094 * object.cc: Include "cref.h".
15095 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15096 (Sized_relobj::do_get_global_symbol_counts): New function.
15097 (Input_objects::add_object): Add object to cross-referencer.
15098 (Input_objects::archive_start): New function.
15099 (Input_objects::archive_stop): New function.
15100 (Input_objects::print_symbol_counts): New function.
15101 * object.h: Declare Cref and Archive.
15102 (Object::get_global_symbol_counts): New function.
15103 (Object::do_get_global_symbol_counts): New pure virtual function.
15104 (class Sized_relobj): Add defined_count_ field. Update
15106 (class Input_objects): Add cref_ field. Update constructor.
15107 Update declarations.
15108 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15110 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15112 (Sized_dynobj::do_get_global_symbol_counts): New function.
15113 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15114 defined_count_. Update declarations. Define Symbols typedef.
15115 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15116 parameter. Change all callers.
15117 (Symbol_table::add_from_dynobj): Add sympointers and defined
15118 parameters. Change all callers.
15119 * symtab.h (class Symbol_table): Update declarations.
15120 * Makefile.am (CCFILES): Add cref.cc.
15121 (HFILES): Add cref.h.
15122 * Makefile.in: Rebuild.
15124 2008-07-22 Simon Baldwin <simonb@google.com>
15126 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15127 to zero when writing undefined symbols.
15129 2008-07-22 Ian Lance Taylor <iant@google.com>
15131 * output.cc (Output_section::add_input_section): Don't try to
15132 merge empty merge sections.
15134 2008-07-21 Craig Silverstein <csilvers@google.com>
15136 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15137 Include symbol version in error message.
15139 2008-07-20 Chris Demetriou <cgd@google.com>
15141 * configure.ac (gold_cv_c_random_seed): New configured variable.
15142 (RANDOM_SEED_CFLAGS): New substituted variable.
15143 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15144 * configure: Rebuild.
15145 * Makefile.in: Likewise.
15146 * testsuite/Makefile.in: Likewise.
15148 2008-07-18 Ian Lance Taylor <iant@google.com>
15150 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15151 where we see NAME/NULL and NAME/VERSION as separate symbols.
15152 * testsuite/ver_test_main.cc (main): Call t4.
15153 (t4, t4_2a): Define.
15154 * testsuite/ver_test_2.cc (t4_2): Define.
15155 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15156 * testsuite/ver_test_4.cc (t4_2a): Define.
15157 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15158 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15160 2008-07-17 Ian Lance Taylor <iant@google.com>
15162 * dynobj.cc (Versions::add_def): If we give an error about a
15163 missing version, go ahead and create the version anyhow.
15165 2008-07-10 Ian Lance Taylor <iant@google.com>
15167 Handle output sections with more than 0x7fffffff bytes.
15168 * object.h (class Relobj): Change map_to_output_ to
15169 output_sections_, and just keep a section pointer. Change all
15170 uses. Move comdat group support to Sized_relobj.
15171 (Relobj::is_section_specially_mapped): Remove.
15172 (Relobj::output_section): Remove poff parameter. Change all
15174 (Relobj::output_section_offset): New function.
15175 (Relobj::set_section_offset): Rewrite.
15176 (Relobj::map_to_output): Remove.
15177 (Relobj::output_sections): New function.
15178 (Relobj::do_output_section_offset): New pure virtual function.
15179 (Relobj::do_set_section_offset): Likewise.
15180 (class Sized_relobj): Add section_offsets_ field. Add comdat
15181 group support from Relobj. Update declarations.
15182 (Sized_relobj::get_output_section_offset): New function.
15183 (Sized_relobj::do_output_section_offset): New function.
15184 (Sized_relobj::do_set_section_offset): New function.
15185 * object.cc (Relobj::output_section_address): Remove.
15186 (Sized_relobj::Sized_relobj): Initialize new fields.
15187 (Sized_relobj::include_section_group): Cast find_kept_object to
15189 (Sized_relobj::include_linkonce_section): Likewise.
15190 (Sized_relobj::do_layout): Use separate arrays for output section
15192 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15194 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15195 output_sections and section_offsets.
15196 (Sized_relobj::write_local_symbols): Likewise.
15197 (map_to_kept_section): Compute output address directly.
15198 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15199 output_sections and section_offsets.
15200 (Sized_relobj::write_sections): Likewise.
15201 (Sized_relobj::relocate_sections): Likewise.
15202 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15203 * output.h (class Output_reloc): Update declarations. Change
15204 u2_.relobj to Sized_relobj*.
15205 (class Output_data_reloc): Change add functions to use
15207 * output.cc (Output_reloc::Output_reloc): Change relobj to
15209 (Output_reloc::local_section_offset): Change return type to
15210 Elf_Addr. Use get_output_section_offset.
15211 (Output_reloc::get_address): Likewise.
15212 (Output_section::is_input_address_mapped): Don't call
15213 is_section_specially_mapped.
15214 (Output_section::output_offset): Likewise.
15215 (Output_section::output_address): Likewise.
15216 (Output_section::starting_output_address): Likewise.
15217 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15218 parameter to Sized_relobj*.
15219 (Copy_relocs::need_copy_reloc): Likewise.
15220 (Copy_relocs::save): Likewise.
15221 * copy-relocs.h (class Copy_relocs): Update declarations.
15222 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15223 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15224 * target-reloc.h (relocate_for_relocatable): Change
15225 offset_in_output_section type to Elf_Addr. Change code that uses
15227 * layout.cc (Layout::layout): Always set *off.
15228 * mapfile.cc (Mapfile::print_input_section): Use
15229 output_section_offset.
15230 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15232 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15233 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15234 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15236 2008-07-03 Ian Lance Taylor <iant@google.com>
15238 * layout.cc (Layout::include_section): Do not discard unrecognized
15239 SHT_STRTAB sections.
15241 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15243 * script.cc (Lex::can_continue_name): Make '?' allowable in
15244 version-script names.
15245 * testsuite/version_script.map: Change glob pattern to use '?'
15247 2008-06-30 Manish Singh <yosh@gimp.org>
15250 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15253 2008-06-30 Ian Lance Taylor <iant@google.com>
15257 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15258 versions]: Don't try to read the value in the contents, since we
15259 don't use it. Use the template endianness when writing.
15261 2008-06-25 Cary Coutant <ccoutant@google.com>
15263 * fileread.cc (File_read::make_view): Assert on zero-length view.
15264 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15265 symbol table when there are no symbols to read.
15267 2008-06-23 Craig Silverstein <csilvers@google.com>
15269 * version.cc (version_string): Bump to 1.7
15271 2008-06-18 Craig Silverstein <csilvers@google.com>
15273 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15274 constant 0xFFFF to type Valtype.
15275 (Powerpc_relocate_functions::rel16_ha): Likewise.
15277 2008-06-17 Ian Lance Taylor <iant@google.com>
15279 * output.h (Output_section::Input_section): Initialize p2align_ to
15280 zero for Output_section_data constructors.
15281 (Output_section::Input_section::addralign): If not an input
15282 section, return the alignment of the Output_section_data.
15283 * testsuite/copy_test.cc: New file.
15284 * testsuite/copy_test_1.cc: New file.
15285 * testsuite/copy_test_2.cc: New file.
15286 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15287 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15288 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15289 (copy_test_1_pic.o, copy_test_1.so): New targets.
15290 (copy_test_2_pic.o, copy_test_2.so): New targets.
15291 * testsuite/Makefile.in: Rebuild.
15293 * script-sections.cc (Script_sections::place_orphan): Initialize
15294 local variable exact.
15296 2008-06-13 David Edelsohn <edelsohn@gnu.org>
15298 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15300 2008-06-12 David Edelsohn <edelsohn@gnu.org>
15301 David S. Miller <davem@davemloft.net>
15303 * powerpc.cc: New file.
15304 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15305 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15306 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15307 * Makefile.in: Rebuild.
15309 2008-06-09 Ian Lance Taylor <iant@google.com>
15311 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15313 (throwing, orig_terminate): New static variables.
15314 (terminate_handler): New static function.
15315 (t2): Set terminate handler.
15317 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15320 * binary.cc (Binary_to_elf::sized_convert): Fix .data
15323 2008-05-30 Cary Coutant <ccoutant@google.com>
15325 * archive.cc (Archive::include_all_members) Correct to step
15326 over symbol table and extended name table in thin archives.
15328 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15331 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15334 2008-05-28 Caleb Howe <cshowe@google.com>
15336 * reduced_debug_output.cc: New file.
15337 * reduced_debug_output.h: New file.
15338 * options.h (class General_options): Add --strip-debug-non-line.
15339 * options.cc (General_options::finalize): Add strip_debug_non_line
15340 to the strip heirarchy.
15341 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15343 * layout.cc: Include "reduced_debug_output.h".
15344 (Layout::Layout): Initialize new fields.
15345 (line_only_debug_sections): New static array.
15346 (is_lines_only_debug_sections): New static inline function.
15347 (Layout::include_section): Handle --strip-debug-non-line.
15348 (Layout::make_output_section): If --strip-debug-non-line, build
15349 new output sections for .debug_abbrev and .debug_info.
15350 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15351 gold. Warn about possible overflow.
15352 (read_signed_LEB_128): Likewise.
15353 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15354 (read_signed_LEB_128): Declare.
15355 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15356 (HFILES): Add reduced_debug_output.h.
15357 * Makefile.in: Rebuild.
15359 2008-05-21 Ian Lance Taylor <iant@google.com>
15361 * mapfile.cc: New file.
15362 * mapfile.h: New file.
15363 * options.h (class General_options): Add -M/--print-map and -Map.
15364 * options.cc (General_options::finalize): Make -M equivalent to
15366 * main.cc: Include <cstdio> and "mapfile.h".
15367 (main): Open mapfile if requested.
15368 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15369 constructor. Change caller.
15370 (queue_initial_tasks): Add mapfile parameter. Change caller.
15371 (queue_middle_tasks): Likewise.
15372 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15374 * archive.cc: Include "mapfile.h".
15375 (Archive::add_symbols): Add mapfile parameter. Change all
15376 callers. Pass mapfile, symbol, and reason to include_member.
15377 (Archive::include_all_members): Add mapfile parameter. Change all
15379 (Archive::include_member): Add mapfile, sym, and why parameters.
15380 Change all callers. Report inclusion to map file.
15381 * archive.h: Include "fileread.h".
15382 (class Archive): Update declarations.
15383 (Archive::file): New const method.
15384 (class Add_archive_symbols): Add mapfile_ field. Update
15385 constructor. Change all callers.
15386 * readsyms.h (class Read_symbols): Likewise.
15387 (class Finish_group): Likewise.
15388 (class Read_script): Likewise.
15389 * common.cc: Include "mapfile.h".
15390 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15392 (Symbol_table::do_allocate_commons): Likewise.
15393 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15394 symbol allocation to mapfile.
15395 * common.h (class Allocate_commons_task): Add mapfile_ field.
15396 Update constructor. Change all callers.
15397 * symtab.h (class Symbol_table): Update declarations.
15398 * layout.cc: Include "mapfile.h".
15399 (Layout_task_runner::run): Print information to mapfile.
15400 (Layout::create_gold_note): Change Output_data_fixed_space to
15401 Output_data_zero_fill.
15402 (Layout::create_build_id): Likewise.
15403 (Layout::print_to_mapfile): New function.
15404 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15405 constructor. Change caller.
15406 (class Layout): Declare print_to_mapfile.
15407 * output.cc (Output_section::Input_section::print_to_mapfile): New
15409 (Output_section::add_input_section): If producing a map, always
15410 add to input_sections_ list.
15411 (Output_section::do_print_to_mapfile): New function.
15412 (Output_segment::print_sections_to_mapfile): New function.
15413 (Output_segment::print_section_list_to_mapfile): New function.
15414 * output.h: Include "mapfile.h".
15415 (Output_data::print_to_mapfile): New function.
15416 (Output_data::do_print_to_mapfile): New virtual function.
15417 (Output_segment_headers::do_print_to_mapfile): New function.
15418 (Output_file_header::do_print_to_mapfile): New function.
15419 (Output_data_const::do_print_to_mapfile): New function.
15420 (class Output_data_const_buffer): Add map_name_ field. Update
15421 constructor. Change all callers. Add do_print_to_mapfile
15423 (class Output_data_fixed_space): Likewise.
15424 (class Output_data_space): Likewise.
15425 (class Output_data_zero_fill): New class.
15426 (Output_data_strtab::do_print_to_mapfile): New function.
15427 (Output_data_reloc_base::do_print_to_mapfile): New function.
15428 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15429 (Output_data_group::do_print_to_mapfile): New function.
15430 (Output_data_got::do_print_to_mapfile): New function.
15431 (Output_data_dynamic::do_print_to_mapfile): New function.
15432 (Output_symtab_xindex::do_print_to_mapfile): New function.
15433 (class Output_section): Declare do_print_to_mapflie. Declare
15434 print_to_mapfile in Input_section.
15435 (class Output_segment): Declare new functions.
15436 * object.h (Sized_relobj::symbol_count): New function.
15437 * script-sections.cc
15438 (Output_section_element_dot_assignment::set_section_addresses):
15439 Change Output_data_fixed_space to Output_data_zero_fill.
15440 (Output_data_expression::do_print_to_mapfile): New function.
15441 * script.cc (read_input_script): Add mapfile parameter. Change
15443 * script.h (read_input_script): Update declaration.
15444 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15445 (Eh_frame::do_print_to_mapfile): New function.
15446 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15447 (Output_merge_string::do_print_to_mapfile): New function.
15448 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15450 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15452 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15454 * Makefile.am (CCFILES): Add mapfile.cc.
15455 (HFILES): Add mapfile.h.
15456 * Makefile.in: Rebuild.
15458 2008-05-19 Ian Lance Taylor <iant@google.com>
15460 * options.h (class General_options): Add -z relro.
15461 * layout.cc (Layout::Layout): Initialize relro_segment_.
15462 (Layout::add_output_section_data): Return the output section.
15463 (Layout::make_output_section): Rcognize relro sections and mark
15464 them appropriately.
15465 (Layout::attach_allocated_section_to_segment): Put relro sections
15466 in a PT_GNU_RELRO segment.
15467 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15469 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15471 (Layout::linkonce_mapping): Map d.rel.ro.local to
15472 .data.rel.ro.local.
15473 (Layout::output_section_name): Us .data.rel.ro.local for any
15474 section which begins with that.
15475 * layout.h (class Layout): Update add_output_section_data
15476 declaration. Add relro_segment_ field.
15477 * output.cc (Output_section::Output_section): Initialize is_relro_
15478 and is_relro_local_ fields.
15479 (Output_segment::add_output_section): Group relro sections.
15480 (Output_segment::is_first_section_relro): New function.
15481 (Output_segment::maximum_alignment): If there is a relro section,
15482 align the segment to the common page size.
15483 (Output_segment::set_section_addresses): Track whether we are
15484 looking at relro sections. If the last section is a relro
15485 section, align to the common page size.
15486 (Output_segment::set_section_list_addresses): Add in_relro
15487 parameter. Change all callers. Align to the page size when
15488 moving from relro to non-relro section.
15489 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15491 * output.h (class Output_section): Add is_relro_ and
15492 is_relro_local_ fields.
15493 (Output_section::is_relro): New function.
15494 (Output_section::set_is_relro): New function.
15495 (Output_section::is_relro_local): New function.
15496 (Output_section::set_is_relro_local): New function.
15497 (class Output_segment): Update declarations.
15498 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15499 * sparc.cc (Target_sparc::got_section): Likewise.
15500 * x86_64.cc (Target_x86_64::got_section): Likewise.
15501 * testsuite/relro_test_main.cc: New file.
15502 * testsuite/relro_test.cc: New file.
15503 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15504 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15505 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15506 (relro_test.so, relro_test_pic.o): New targets.
15507 * testsuite/Makefile.in: Rebuild.
15509 2008-05-16 Ian Lance Taylor <iant@google.com>
15511 * output.cc (Output_segment::add_output_section): Remove front
15513 * output.h (class Output_segment): Remove
15514 add_initial_output_section and overloaded add_output_section.
15515 Update declaration of remaining add_output_section.
15516 * layout.cc (Layout::create_interp): Call add_output_section
15517 rather than add_initial_output_section.
15518 (Layout::finish_dynamic_section): Likewise.
15520 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15521 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15522 know the dynamic type.
15523 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15524 field. Initialize it in constructor.
15525 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15526 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15527 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15530 * output.cc (Output_reloc::get_address): Change return type to
15532 * output.h (class Output_reloc): Update get_address declaration.
15533 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15534 for section addresses.
15536 2008-05-09 Ian Lance Taylor <iant@google.com>
15539 * gold.cc (gold_nomem): Use return value of write.
15541 2008-05-08 Ian Lance Taylor <iant@google.com>
15543 * symtab.c (Symbol::init_base_output_data): Add version
15544 parameter. Change all callers.
15545 (Symbol::init_base_output_segment): Likewise.
15546 (Symbol::init_base_constant): Likewise.
15547 (Symbol::init_base_undefined): Likewise.
15548 (Sized_symbol::init_output_data): Likewise.
15549 (Sized_symbol::init_output_segment): Likewise.
15550 (Sized_symbol::init_constant): Likewise.
15551 (Sized_symbol::init_undefined): Likewise.
15552 (Symbol_table::do_define_in_output_data): If the new symbol has a
15553 version, mark it as the default.
15554 (Symbol_table::do_define_in_output_segment): Likewise.
15555 (Symbol_table::do_define_as_constant): Likewise.
15556 * symtab.h (class Symbol): Update declarations.
15557 (class Sized_symbol): Likewise.
15558 * resolve.cc (Symbol::override_version): New function.
15559 (Symbol::override_base): Call override_version.
15560 (Symbol::override_base_with_special): Likewise.
15561 * testsuite/ver_script_8.script: New file.
15562 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15563 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15564 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15565 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15567 2008-05-06 Ian Lance Taylor <iant@google.com>
15570 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15572 (class General_options): Remove existing --undefined, and add
15573 --no-undefined instead. Add new --undefined as synonym for -u.
15574 * archive.cc (Archive::add_symbols): Check whether symbol was
15576 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15577 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15578 all uses. Add IS_UNDEFINED. Update declarations to split
15579 different versions of init_base. Declare init_base_undefined.
15580 (Symbol::is_defined): Handle IS_UNDEFINED.
15581 (Symbol::is_undefined): Likewise.
15582 (Symbol::is_weak_undefined): Call is_undefined.
15583 (Symbol::is_absolute): Handle IS_CONSTANT.
15584 (class Sized_symbol): Update declarations to split different
15585 versions of init. Declare init_undefined.
15586 (class Symbol_table): Declare new functions.
15587 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15588 Change all callers.
15589 (Symbol::init_base_output_data): Likewise.
15590 (Symbol::init_base_output_segment): Likewise.
15591 (Symbol::init_base_constant): Likewise.
15592 (Symbol::init_base_undefined): New function.
15593 (Sized_symbol::init_object): Rename from init. Change all
15595 (Sized_symbol::init_output_data): Likewise.
15596 (Sized_symbol::init_output_segment): Likewise.
15597 (Sized_symbol::init_constant): Likewise.
15598 (Sized_symbol::init_undefined): New function.
15599 (Symbol_table::add_undefined_symbols_from_command_line): New
15601 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15603 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15604 (Symbol::output_section): Likewise.
15605 (Symbol::set_output_section): Likewise.
15606 (Symbol_table::sized_finalize_symbol): Likewise.
15607 (Symbol_table::sized_write_globals): Likewise.
15608 * resolve.cc (Symbol_table::should_override): Likewise.
15609 (Symbol::override_base_with_special): Likewise.
15611 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15612 symbol, change it to have default visibility.
15613 * testsuite/protected_1.cc: New file.
15614 * testsuite/protected_2.cc: New file.
15615 * testsuite/protected_3.cc: New file.
15616 * testsuite/protected_main_1.cc: New file.
15617 * testsuite/protected_main_2.cc: New file.
15618 * testsuite/protected_main_3.cc: New file.
15619 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15620 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15621 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15622 (protected_1.so): New target.
15623 (protected_1_pic.o, protected_2_pic.o): New targets.
15624 (protected_3_pic.o): New target.
15625 (check_PROGRAMS): Add protected_2.
15626 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15627 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15628 * testsuite/Makefile.in: Rebuild.
15630 * options.h (DEFINE_var): Add set_user_set_##varname__.
15631 (DEFINE_bool_alias): New macro.
15632 (class General_options): Define -Bstatic using DEFINE_bool_alias
15633 rather than DEFINE_special. Add --undefined as an alias for -z
15635 * options.cc (General_options::parse_Bstatic): Remove.
15637 * options.h (class General_options): Add --fatal-warnings.
15638 * main.cc (main): Implement --fatal-warnings.
15639 * errors.h (Errors::warning_count): New function.
15641 * options.h (class General_options): Add -Bsymbolic-functions.
15642 * symtab.h (Symbol::is_preemptible): Check for
15643 -Bsymbolic-functions.
15645 2008-05-05 Ian Lance Taylor <iant@google.com>
15647 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15648 as noVARNAME rather than no-VARNAME.
15649 (class General_options): Add option -z combreloc.
15650 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15652 (Output_reloc::sort_before) [SHT_REL]: New function.
15653 (Output_reloc::sort_before) [SHT_RELA]: New function.
15654 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15655 Sort_relocs_comparison.
15656 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15657 parameter. Change all callers.
15658 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15659 sort_relocs parameter. Change all callers.
15660 * output.cc (Output_reloc::get_address): New function, broken out
15662 (Output_reloc::write_rel): Call it.
15663 (Output_reloc::compare): New function.
15664 (Output_data_reloc_base::do_write): Optionally sort relocs.
15666 * configure.ac: If targ_extra_obj is set, link it in.
15667 * configure.tgt: Initialize all variables.
15668 (x86_64*): Set targ_extra_obj and targ_extra_size.
15669 * configure: Rebuild.
15671 * object.cc (Sized_relobj::include_section_group): Adjust section
15672 indexes read from group data. Build vector to pass to
15674 * layout.cc (Layout::layout_group): Add flags and shndxes
15675 parameters. Remove contents parameter. Change caller. Update
15676 explicit instantiations.
15677 * layout.h (class Layout): Update layout_group declaration.
15678 * output.cc (Output_data_group::Output_data_group): Add flags and
15679 input_shndxes parameters. Remove contents parameter. Change
15681 (Output_data_group::do_write): Change input_sections_ to
15683 * output.h (class Output_data_group): Update constructor
15684 declaration. Rename input_sections_ to input_shndxes_.
15685 * testsuite/many_sections_test.cc: Add template.
15687 2008-04-30 Cary Coutant <ccoutant@google.com>
15689 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15691 * layout.cc (Layout::include_section): Refactored check for debug
15693 (Layout::add_comdat): Add new parameters. Change type
15694 of signature parameter. Add object and shndx to signatures table.
15695 (Layout::find_kept_object): New function.
15696 * layout.h: Include <cstring>.
15697 (Layout::is_debug_info_section): New function.
15698 (Layout::add_comdat): Add new parameters.
15699 (Layout::find_kept_object): New function.
15700 (Layout::Kept_section): New struct.
15701 (Layout::Signatures): Change type of map range.
15702 * object.cc (Relobj::output_section_address): New function.
15703 (Sized_relobj::include_section_group): Add new parameters. Change
15704 calls to Layout::add_comdat. Change to build table of kept comdat
15705 groups and table mapping discarded sections to kept sections.
15706 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15707 (Sized_relobj::do_layout): Change calls to include_section_group and
15708 include_linkonce_section.
15709 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15710 value to zero when section is discarded.
15711 (Sized_relobj::map_to_kept_section): New function.
15712 * object.h (Relobj::output_section_address): New function.
15713 (Relobj::Comdat_group): New type.
15714 (Relobj::find_comdat_group): New function.
15715 (Relobj::Comdat_group_table): New type.
15716 (Relobj::Kept_comdat_section): New type.
15717 (Relobj::Kept_comdat_section_table): New type.
15718 (Relobj::add_comdat_group): New function.
15719 (Relobj::set_kept_comdat_section): New function.
15720 (Relobj::get_kept_comdat_section): New function.
15721 (Relobj::comdat_groups_): New field.
15722 (Relobj::kept_comdat_sections_): New field.
15723 (Symbol_value::input_value): Update comment.
15724 (Sized_relobj::map_to_kept_section) New function.
15725 (Sized_relobj::include_linkonce_section): Add new parameter.
15726 * target-reloc.h (Comdat_behavior): New type.
15727 (get_comdat_behavior): New function.
15728 (relocate_section): Add code to map a discarded section to the
15729 corresponding kept section when applying a relocation.
15731 2008-04-30 Craig Silverstein <csilvers@google.com>
15733 * dwarf_reader.cc (next_generation_count): New static var.
15734 (Addr2line_cache_entry): New struct.
15735 (addr2line_cache): New static var.
15736 (Dwarf_line_info::one_addr2line): Added caching.
15737 (Dwarf_line_info::clear_addr2line_cache): New function.
15738 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15739 cache-size parameter.
15740 (Dwarf_line_info::one_addr2line_cache): New function.
15741 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15742 new cache-size argument to one_addr2line(), and clear cache.
15744 2008-04-28 Cary Coutant <ccoutant@google.com>
15746 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15747 R_386_PC8 relocations.
15749 2008-04-23 Ian Lance Taylor <iant@google.com>
15751 * object.cc (Sized_relobj::include_section_group): Check for
15752 invalid section group.
15754 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15757 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15758 than read for file header.
15759 * archive.cc (Archive::include_member): Likewise.
15761 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
15763 * aclocal.m4: Regenerate.
15764 * configure: Regenerate.
15766 2008-04-19 Ian Lance Taylor <iant@google.com>
15768 * version.cc (version_string): Bump to 1.6.
15770 * testsuite/Makefile.am (many_sections_r_test): New target.
15771 (many_sections_r_test_SOURCES): Remove.
15772 (many_sections_r_test_DEPENDENCIES): Remove.
15773 (many_sections_r_test_LDFLAGS): Remove.
15774 (many_sections_r_test_LDADD): Remove.
15776 * object.cc (Sized_relobj::do_add_symbols): Always pass
15777 local_symbol_count_ to add_from_relobj.
15779 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15780 every thousand variables.
15781 * testsuite/Makefile.in: Rebuild.
15783 * object.cc (Xindex::initialize_symtab_xindex): New function.
15784 (Xindex::read_symtab_xindex): New function.
15785 (Xindex::sym_xindex_to_shndx): New function.
15786 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15788 (Sized_relobj::do_initialize_xindex): New function.
15789 (Sized_relobj::do_read_symbols): Adjust section links.
15790 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15791 parameter. Change all callers.
15792 (Sized_relobj::include_section_group): Adjust section links and
15793 symbol section indexes.
15794 (Sized_relobj::do_layout): Adjust section links.
15795 (Sized_relobj::do_count_local_symbols): Adjust section links and
15796 symbol section indexes.
15797 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15798 ordinary and special symbols.
15799 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15800 dynsym_xindex parameters. Change all callers. Adjust section
15801 links. Use SHN_XINDEX when needed.
15802 (Sized_relobj::get_symbol_location_info): Adjust section links.
15803 Don't get fooled by special symbols.
15804 * object.h (class Xindex): Define.
15805 (class Object): Add xindex_ parameter. Declare virtual functoin
15806 do_initialize_xindex.
15807 (Object::adjust_sym_shndx): New function.
15808 (Object::set_xindex): New protected function.
15809 (class Symbol_value): Add is_ordinary_shndx_ field.
15810 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15811 (Symbol_value::value): Assert ordinary section.
15812 (Symbol_value::initialize_input_to_output_map): Likewise.
15813 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15814 Change all callers.
15815 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15817 (class Sized_relobj): Update declarations.
15818 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15819 parameter. Change all callers.
15820 (Sized_relobj::adjust_shndx): New function.
15821 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15823 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15824 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15825 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15826 (Sized_dynobj::read_dynsym_section): Adjust section links.
15827 (Sized_dynobj::read_dynamic): Likewise.
15828 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15830 (Sized_dynobj::do_initialize_xindex): New function.
15831 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15832 do_initialize_xindex.
15833 (Sized_dynobj::adjust_shndx): New function.
15834 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15835 dynsym_xindex_ fields.
15836 (Layout::finalize): Add a call to set_section_indexes before
15837 creating the symtab sections.
15838 (Layout::set_section_indexes): Don't do anything if the section
15839 already has a section index.
15840 (Layout::create_symtab_sections): Add shnum parameter. Change
15841 caller. Create .symtab_shndx section if needed.
15842 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15844 (Layout::allocated_output_section_count): New function.
15845 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15847 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15848 fields. Update declarations.
15849 (Layout::symtab_xindex): New function.
15850 (Layout::dynsym_xindex): New function.
15851 (class Write_symbols_task): Add layout_ field.
15852 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15854 * output.cc (Output_section_headers::Output_section_headers): Add
15855 shstrtab_section parameter. Change all callers.
15856 (Output_section_headers::do_sized_write): Store overflow values
15857 for section count and section string table section index in
15858 section header zero.
15859 (Output_file_header::do_sized_write): Check for overflow of
15860 section count and section string table section index.
15861 (Output_symtab_xindex::do_write): New function.
15862 (Output_symtab_xindex::endian_do_write): New function.
15863 * output.h (class Output_section_headers): Add shstrtab_section_.
15864 Update declarations.
15865 (class Output_symtab_xindex): Define.
15866 (Output_section::has_out_shndx): New function.
15867 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15869 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15870 Change all callers.
15871 (Sized_symbol::init): Likewise.
15872 (Symbol::output_section): Check for ordinary symbol.
15873 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15874 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15876 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15877 Change all callers. Simplify handling of symbols from sections
15878 not included in the link.
15879 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15881 (Weak_alias_sorter::operator()): Assert that symbols are
15883 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15885 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15886 parameters. Change all callers.
15887 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15888 symbol distinction. Use SHN_XINDEX when needed.
15889 (Symbol_table::write_section_symbol): Add symtab_xindex
15890 parameter. Change all callers.
15891 (Symbol_table::sized_write_section_symbol): Likewise. Use
15892 SHN_XINDEX when needed.
15893 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15895 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15896 (Symbol::is_defined): Check is_ordinary.
15897 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15898 (Symbol::is_absolute, Symbol::is_common): Likewise.
15899 (class Sized_symbol): Update declarations.
15900 (class Symbol_table): Update declarations.
15901 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15902 parameters. Change all callers.
15903 (Sized_symbol::override): Likewise.
15904 (Symbol_table::override): Likewise.
15905 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15906 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15907 is_ordinary, and orig_st_shndx parameters. Change all callers.
15908 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15909 to be in an ordinary section.
15910 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15911 object and is_ordinary parameters. Change all callers.
15912 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15913 Change all callers. Don't add undefined or non-ordinary symbols
15915 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15916 Change all callers.
15917 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15919 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15920 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15921 (Sized_relobj::relocate_sections): Likewise.
15922 * target-reloc.h (scan_relocs): Adjust section symbol index.
15923 (scan_relocatable_relocs): Likewise.
15924 * i386.cc (Scan::local): Check for ordinary symbols.
15925 * sparc.cc (Scan::local): Likewise.
15926 * x86_64.cc (Scan::local): Likewise.
15927 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15928 to symbol_section_and_value.
15929 * testsuite/many_sections_test.cc: New file.
15930 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15931 (check_PROGRAMS): Add many_sections_test.
15932 (many_sections_test_SOURCES): Define.
15933 (many_sections_test_DEPENDENCIES): Define.
15934 (many_sections_test_LDFLAGS): Define.
15935 (BUILT_SOURCES): Add many_sections_define.h.
15936 (many_sections_define.h): New target.
15937 (BUILT_SOURCES): Add many_sections_check.h.
15938 (many_sections_check.h): New target.
15939 (check_PROGRAMS): Add many_sections_r_test.
15940 (many_sections_r_test_SOURCES): Define.
15941 (many_sections_r_test_DEPENDENCIES): Define.
15942 (many_sections_r_test_LDFLAGS): Define.
15943 (many_sections_r_test_LDADD): Define.
15944 (many_sections_r_test.o): New target.
15945 * testsuite/Makefile.in: Rebuild.
15947 2008-04-17 Cary Coutant <ccoutant@google.com>
15949 * errors.cc (Errors::info): New function.
15950 (gold_info): New function.
15951 * errors.h (Errors::info): New function.
15952 * gold.h (gold_info): New function.
15953 * object.cc (Input_objects::add_object): Print trace output.
15954 * options.cc (options::parse_set): New function.
15955 (General_options::parse_wrap): Deleted.
15956 (General_options::General_options): Deleted initializer.
15957 * options.h (options::String_set): New typedef.
15958 (options::parse_set): New function.
15959 (DEFINE_set): New macro.
15960 (General_options::wrap): Changed to use DEFINE_set. Changed
15961 callers of any_wrap_symbols and is_wrap_symbol.
15962 (General_options::trace, General_options::trace_symbol):
15964 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15965 (General_options::wrap_symbols_): Deleted.
15966 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15968 2008-04-17 David S. Miller <davem@davemloft.net>
15970 * options.cc (General_options::parse_V): New function.
15971 * options.h: Add entries for -V and -Qy.
15973 2008-04-17 Ian Lance Taylor <iant@google.com>
15975 * common.cc (Symbol_table::allocate_commons): Remove options
15976 parameter. Change caller.
15977 (Symbol_table::do_allocate_commons): Remove options parameter.
15978 Change caller. Just call do_allocate_commons_list twice.
15979 (Symbol_table::do_allocate_commons_list): New function, broken out
15980 of do_allocate_commons.
15981 * common.h (class Allocate_commons_task): Remove options_ field.
15982 Update constructor.
15983 * symtab.cc (Symbol_table::Symbol_table): Initialize
15985 (Symbol_table::add_from_object): Put TLS common symbols on
15987 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15988 which are IN_OUTPUT_DATA.
15989 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15990 allocate_commons and do_allocate_commons declarations. Declare
15991 do_allocate_commons_list.
15992 * gold.cc (queue_middle_tasks): Update creation of
15993 Allocate_commons_task to not pass options.
15994 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15995 (TLS_TEST_C_FLAGS): New variable.
15996 (tls_test_c_pic.o): New target.
15997 (tls_test_shared.so): Link in tls_test_c_pic.o.
15998 (tls_test_c_pic_ie.o): New target.
15999 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16000 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16001 (tls_test_c.o): New target.
16002 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16003 (tls_pic_test_LDADD): Likewise.
16004 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16005 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16006 (tls_test_c_gnu2.o): New target.
16007 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16009 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16010 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16011 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16012 * testsuite/tls_test.cc: Include "config.h".
16013 (t_last): Call t11_last.
16014 * testsuite/tls_test.h (t11, t11_last): Declare.
16015 * testsuite/tls_test_c.c: New file.
16016 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16017 * configure.ac: Check for OpenMP support.
16018 * configure, config.in, Makefile.in: Rebuild.
16019 * testsuite/Makefile.in: Rebuild.
16021 2008-04-16 Cary Coutant <ccoutant@google.com>
16023 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16024 (Target_i386::tls_base_symbol_defined_): New field.
16025 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16026 (Target_i386::Scan::global): Likewise.
16027 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16028 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16029 (Target_x86_64::tls_base_symbol_defined_): New field.
16030 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16031 (Target_x86_64::Scan::global): Likewise.
16033 2008-04-16 Cary Coutant <ccoutant@google.com>
16035 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16036 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16037 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16038 building shared libraries.
16039 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16040 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16041 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16042 * testsuite/Makefile.in: Rebuild.
16043 * testsuite/weak_undef.h: New file.
16044 * testsuite/weak_undef_file1.cc: Add extra test cases.
16045 * testsuite/weak_undef_file2.cc: Likewise.
16046 * testsuite/weak_undef_test.cc: Likewise.
16048 2008-04-16 David S. Miller <davem@davemloft.net>
16050 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16051 Add issued_non_pic_error_ field. Declare check_non_pic.
16052 (Target_sparc::Scan::check_non_pic): New function.
16053 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16054 (Target_sparc::Scan::global): Likewise.
16056 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16057 * configure: Rebuild.
16059 * options.h (DEFINE_enable): New macro.
16060 (new_dtags): New enable option.
16061 (initfirst, interpose, loadfltr, nodefaultlib,
16062 nodelete, nodlopen, nodump): New -z options.
16063 * layout.cc (Layout:finish_dynamic_section): If new
16064 dtags enabled, emit DT_RUNPATH. Also, emit a
16065 DT_FLAGS_1 containing any specified -z flags.
16067 2008-04-16 Ian Lance Taylor <iant@google.com>
16069 * copy-relocs.cc: New file.
16070 * copy-relocs.h: New file.
16071 * reloc.cc: Remove Copy_relocs code.
16072 * reloc.h: Likewise.
16073 * reloc-types.h (struct Reloc_types) [both versions]: Add
16074 get_reloc_addend_noerror.
16075 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16076 variants of add_global which take an addend which must be zero.
16077 * i386.cc: Include "copy-relocs.h".
16078 (class Target_i386): Change type of copy_relocs_ to variable,
16079 update initializer.
16080 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16081 Change all callers.
16082 (Target_i386::do_finalize_sections): Change handling of
16084 * sparc.cc: Include "copy-relocs.h".
16085 (class Target_sparc): Change type of copy_relocs_ to variable,
16086 update initializer.
16087 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16088 Change all callers.
16089 (Target_sparc::do_finalize_sections): Change handling of
16091 * x86_64.cc: Include "copy-relocs.h".
16092 (class Target_x86_64): Change type of copy_relocs_ to variable,
16093 update initializer.
16094 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16095 class. Change all callers.
16096 (Target_x86_64::do_finalize_sections): Change handling of
16098 * Makefile.am (CCFILES): Add copy-relocs.cc.
16099 (HFILES): Add copy-relocs.h.
16101 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16103 * testsuite/script_test_4.sh: Permit leading zeroes.
16105 2008-04-15 Ian Lance Taylor <iant@google.com>
16107 * script-sections.cc (Script_sections::create_segments): Use
16108 header_size_adjustment even when there is enough room for the
16110 * testsuite/script_test_4.sh: New file.
16111 * testsuite/script_test_4.t: New file.
16112 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16113 (check_DATA): Add script_test_4.stdout.
16114 (MOSTLYCLEANFILES): Likewise.
16115 (script_test_4): New target.
16116 (script_test_4.stdout): New target.
16117 * testsuite/Makefile.in: Rebuild.
16119 * sparc.cc: Add definitions for Output_data_plt_sparc class
16122 2008-04-14 David S. Miller <davem@davemloft.net>
16124 * sparc.cc: New file.
16125 * Makefile.am (TARGETSOURCES): Add sparc.cc
16126 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16127 * configure.tgt: Document targ_extra_size and
16128 targ_extra_big_endian. Add entries for sparc-* and
16130 * configure.ac: Handle targ_extra_size and
16131 targ_extra_big_endian.
16132 * Makefile.in: Rebuild.
16133 * configure: Likewise.
16134 * po/POTFILES.in: Likewise.
16135 * po/gold.pot: Likewise.
16137 2008-04-14 Ian Lance Taylor <iant@google.com>
16139 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16140 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16141 in the name/type/flags to section mapping. Don't call
16142 allocate_output_section.
16143 (Layout::choose_output_section): Change parameter from adjust_name
16144 to is_input_section. Don't permit input sections after sections
16145 are attached to segments. Don't call allocate_output_section.
16146 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16147 not write_enable_output_section.
16148 (Layout::make_output_section): Don't push to
16149 unattached_section_list_ nor call attach_to_segment. Call
16150 attach_section_to_segment if sections are attached.
16151 (Layout::attach_sections_to_segments): New function.
16152 (Layout::attach_section_to_segment): New function.
16153 (Layout::attach_allocated_section_to_segment): Rename from
16154 attach_to_segment. Remove flags parameter.
16155 (Layout::allocate_output_section): Remove function.
16156 (Layout::write_enable_output_section): Remove function.
16157 * layout.h (class Layout): Update for above changes. Add new
16158 field sections_are_attached_.
16159 * output.h (Output_section::update_flags_for_input_section): New
16161 * output.cc (Output_section::add_input_section): Call
16162 update_flags_for_input_section.
16163 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16165 2008-04-11 Cary Coutant <ccoutant@google.com>
16167 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16168 thought unnecessary.
16169 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16171 2008-04-11 Ian Lance Taylor <iant@google.com>
16173 * output.h (class Output_section_data): Remove inline definition
16175 * output.cc (Output_section_data::set_addralign): New function.
16177 2008-04-11 Cary Coutant <ccoutant@google.com>
16179 Add support for TLS descriptors for i386 and x86_64.
16180 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16181 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16182 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16184 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16185 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16186 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16188 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16189 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16190 Fix problem with initial-exec relocations.
16191 (Target_i386::Relocate::relocate_tls): Likewise.
16192 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16194 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16195 support for section-plus-offset dynamic table entries.
16196 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16197 (Output_data_dynamic::Dynamic_entry): Add support for
16198 section-plus-offset dynamic table entries.
16199 (Output_data_dynamic::Classification): Likewise.
16200 (Output_data_dynamic::classification_): Renamed offset_.
16201 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16202 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16203 (Target_x86_64::make_plt_section): New function.
16204 (Target_x86_64::reserve_tlsdesc_entries): New function.
16205 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16206 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16207 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16208 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16209 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16210 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16211 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16212 add extra PLT entry for TLS descriptors.
16213 (Output_data_plt_x86_64::got_): New field.
16214 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16215 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16217 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16219 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16220 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16221 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16222 R_386_TLS_DESC_CALL relocations.
16223 (Target_x86_64::Scan::global): Likewise.
16224 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16225 for TLS descriptors.
16226 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16227 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16228 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16229 GD-to-IE relaxation.
16230 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16231 and TLS_DESCRIPTORS.
16232 * Makefile.in: Rebuild.
16233 * configure: Rebuild.
16234 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16235 (tls_test_shared2.so): New target.
16236 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16237 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16238 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16239 (tls_shared_gd_to_ie_test_LDADD): New variable.
16240 (tls_shared_gnu2_gd_to_ie_test): New target.
16241 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16243 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16244 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16245 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16246 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16247 (tls_shared_gnu2_test): New target.
16248 (tls_test_gnu2_shared.so): New target.
16249 (tls_shared_gnu2_test_SOURCES): New variable.
16250 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16251 (tls_shared_gnu2_test_LDFLAGS): New variable.
16252 (tls_shared_gnu2_test_LDADD): New variable.
16253 * testsuite/Makefile.in: Rebuild.
16254 * testsuite/Makefile.
16256 2008-04-11 Ian Lance Taylor <iant@google.com>
16258 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16260 * testsuite/Makefile.in: Rebuild.
16262 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16264 * testsuite/script_test_2.cc (main): Adjust test.
16266 2008-04-11 David S. Miller <davem@davemloft.net>
16267 Ian Lance Taylor <iant@google.com>
16269 * options.h (General_options): Add entries for '-Y' and
16271 * options.cc (General_options:finalize): If -Y was used, add those
16272 entries to the library path instead of the default "/lib" and
16275 2008-04-11 David S. Miller <davem@davemloft.net>
16277 * testsuite/justsyms.t: Start at 0x100.
16278 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
16279 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16281 * testsuite/script_test_2.cc: Adjust string and section length
16284 2008-04-09 Ian Lance Taylor <iant@google.com>
16287 * script-sections.cc (Sections_element::allocate_to_segment): Add
16289 (Output_section_definition::allocate_to_segment): Likewise.
16290 (Orphan_output_section::allocate_to_segment): Likewise.
16291 (Script_sections::attach_sections_using_phdrs_clause): Don't
16292 propagate non-PT_LOAD segments to orphan sections.
16293 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16294 readelf rather than objdump.
16295 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16296 .interp section and PT_INTERP segment are the same size.
16297 * testsuite/Makefile.in: Rebuild.
16299 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16300 aliases for symbols defined in the same object.
16301 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16302 (weak_alias_test_SOURCES): New variable.
16303 (weak_alias_test_DEPENDENCIES): New variable.
16304 (weak_alias_test_LDFLAGS): New variable.
16305 (weak_alias_test_LDADD): New variable.
16306 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16307 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16308 (weak_alias_test_3.o): New target.
16309 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16310 * testsuite/weak_alias_test_main.cc: New file.
16311 * testsuite/weak_alias_test_1.cc: New file.
16312 * testsuite/weak_alias_test_2.cc: New file.
16313 * testsuite/weak_alias_test_3.cc: New file.
16315 2008-04-08 Ian Lance Taylor <iant@google.com>
16317 * options.h (class General_options): Add --noinhibit-exec option.
16318 * main.cc (main): Check --noinhibit-exec.
16320 * options.h (class General_options): Define --wrap as a special
16321 option. Add wrap_symbols_ field.
16322 (General_options::any_wrap_symbols): New function.
16323 (General_options::is_wrap_symbol): New function.
16324 * options.cc (General_options::parse_wrap): New function.
16325 (General_options::General_options): Initialize wrap_symbols_.
16326 * symtab.cc (Symbol_table::wrap_symbol): New function.
16327 (Symbol_table::add_from_object): Handle --wrap.
16328 * symtab.h (class Symbol_table): Declare wrap_symbol.
16329 * target.h (Target::wrap_char): New function.
16330 (Target::Target_info): Add wrap_char field.
16331 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16332 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16333 * testsuite/testfile.cc (Target_test::test_target_info):
16336 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16339 * layout.h (class Layout): Add added_eh_frame_data_ field.
16340 * layout.cc (Layout::Layout): Initialize new field.
16341 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16342 output section until we find a section we merged successfully.
16343 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16344 that the size be non-zero.
16346 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16349 2008-04-08 Craig Silverstein <csilvers@google.com>
16351 * configure.ac: Export new conditional variable HAVE_ZLIB.
16352 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16354 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16355 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16357 2008-04-07 Ian Lance Taylor <iant@google.com>
16359 * version.cc (version_string): Set to "1.5".
16361 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16362 Add issued_non_pic_error_ field. Declare check_non_pic.
16363 (Target_x86_64::Scan::check_non_pic): New function.
16364 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16365 (Target_x86_64::Scan::global): Likewise.
16367 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16368 addend parameter. Change caller. Handle merge sections.
16369 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16370 Address to Addend. Don't add in the result of
16371 local_section_offset, pass down the addend and use the returned
16373 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16374 Update declarations of local_section_offset and symbol_value.
16375 * testsuite/two_file_test_1.cc (t18): New function.
16376 * testsuite/two_file_test_2.cc (f18): New function.
16377 * testsuite/two_file_test_main.cc (main): Call t18.
16378 * testsuite/two_file_test.h (t18, f18): Declare.
16380 * configure.ac: Don't test for objdump, c++filt, or readelf.
16381 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16383 (TEST_READELF): New variable.
16384 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16385 (check_PROGRAMS): Add two_file_strip_test.
16386 (two_file_strip_test): New target.
16387 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16388 (two_file_same_shared_strip_test_SOURCES): New variable.
16389 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16390 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16391 (two_file_same_shared_strip_test_LDADD): New variable.
16392 (two_file_shared_strip.so): New target.
16393 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16394 (ver_test_5.syms, ver_test_7.syms): Likewise.
16395 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16396 (strip_test_3.stdout): Use TEST_OBJDUMP.
16397 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16399 2008-04-04 Cary Coutant <ccoutant@google.com>
16401 * symtab.h (Symbol::is_weak_undefined): New function.
16402 (Symbol::is_strong_undefined): New function.
16403 (Symbol::is_absolute): New function.
16404 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16405 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16407 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16408 (weak_undef_test): New target.
16409 * testsuite/Makefile.in: Rebuild.
16410 * testsuite/weak_undef_file1.cc: New file.
16411 * testsuite/weak_undef_file2.cc: New file.
16412 * testsuite/weak_undef_test.cc: New file.
16414 2008-04-03 Craig Silverstein <csilvers@google.com>
16416 * compressed_output.h (class Output_compressed_section): Use
16418 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16420 (zlib_compressed_suffix): Removed.
16421 (Output_compressed_section::set_final_data_size): Use unsigned
16423 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16424 Fix linker invocation.
16425 (flagstest_o_specialfile_and_compress_debug_sections):
16427 * testsuite/Makefile.in: Regenerated.
16429 2008-04-02 David S. Miller <davem@davemloft.net>
16431 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16432 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16434 2008-04-02 Craig Silverstein <csilvers@google.com>
16438 2008-04-02 Ian Lance Taylor <iant@google.com>
16440 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16441 parameters. Update for new key type to views_. Change all
16443 (File_read::read): Adjust for byteshift in returned view.
16444 (File_read::add_view): New function, broken out of
16445 find_and_make_view.
16446 (File_read::make_view): New function, broken out of
16447 find_and_make_view.
16448 (File_read::find_or_make_view): Add offset and aligned
16449 parameters. Rewrite accordingly. Change all callers.
16450 (File_read::get_view): Add offset and aligned parameters. Adjust
16451 for byteshift in return value.
16452 (File_read::get_lasting_view): Likewise.
16453 * fileread.h (class File_read): Update declarations.
16454 (class File_read::View): Add byteshift_ field. Add byteshift to
16455 constructor. Add byteshift method.
16456 * archive.h (Archive::clear_uncached_views): New function.
16457 (Archive::get_view): Add aligned parameter. Change all callers.
16458 * object.h (Object::get_view): Add aligned parameter. Change all
16460 (Object::get_lasting_view): Likewise.
16462 * fileread.cc (File_read::release): Don't call clear_views if
16463 there are multiple objects.
16464 * fileread.h (File_read::clear_uncached_views): New function.
16465 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16468 2008-03-31 Cary Coutant <ccoutant@google.com>
16470 Add thin archive support.
16471 * archive.cc (Archive::armagt): New const.
16472 (Archive::setup): Remove task parameter and calls to unlock.
16473 (Archive::unlock_nested_archives): New function.
16474 (Archive::read_header): Add nested_off parameter. Change
16476 (Archive::interpret_header): Likewise.
16477 (Archive::include_all_members): Change to handle thin
16479 (Archive::include_member): Likewise.
16480 * archive.h (Archive::Archive): Add new parameters and
16482 (Archive::armagt): New const.
16483 (Archive::setup): Remove task parameter.
16484 (Archive::unlock_nested_archives): New function.
16485 (Archive::read_header): Add nested_off parameter.
16486 (Archive::interpret_header): Likewise.
16487 (Archive::Nested_archive_table): New typedef.
16488 (Archive::is_thin_archive_): New field.
16489 (Archive::nested_archives_): New field.
16490 (Archive::options_): New field.
16491 (Archive::dirpath_): New field.
16492 (Archive::task_): New field.
16493 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16494 for thin archives. Pass additional parameters to
16495 Archive::Archive. Unlock the archive file after calling
16498 2008-03-29 Ian Lance Taylor <iant@google.com>
16500 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16501 version symbol to be local.
16502 * testsuite/ver_test_4.sh: New file.
16503 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16504 (check_DATA): Add ver_test_4.syms.
16505 (ver_test_4.syms): New target.
16506 * testsuite/Makefile.in: Rebuild.
16509 (Output_section::Input_section_sort_entry::has_priority): New
16511 (Output_section::Input_section_sort_entry::match_file_name): New
16513 (Output_section::Input_section_sort_entry::match_section_name):
16515 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16517 (Output_section::Input_section_sort_entry::match_section_file):
16519 (Output_section::Input_section_sort_compare::operator()): Rewrite
16520 using new Input_section_sort_entry functions. Sort crtbegin and
16521 crtend first. Sort sections with no priority before sections with
16523 * testsuite/initpri1.c (d3): Check j != 4.
16524 (cd5): New constructor/destructor function.
16525 (main): Check j != 2.
16527 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16528 new symbol when resolving, don't call set_is_default.
16529 * testsuite/ver_test_7.cc: New file.
16530 * testsuite/ver_test_7.sh: New file.
16531 * testsuite/Makefile.am (ver_test_7.so): New target.
16532 (ver_test_7.o): New target.
16533 (check_SCRIPTS): Add ver_test_7.sh.
16534 (check_DATA): Add ver_test_7.syms.
16535 (ver_test_7.syms): New target.
16537 2008-03-28 Ian Lance Taylor <iant@google.com>
16539 * layout.cc (Layout::layout): If we see an input section with a
16540 name that needs sorting, set the must_sort flag for the output
16542 (Layout::make_output_section): If the name of the output section
16543 indicates that it might require sorting, set the may_sort flag.
16544 * output.h (Output_section::may_sort_attached_input_sections): New
16546 (Output_section::set_may_sort_attached_input_sections): New
16548 (Output_section::must_sort_attached_input_sections): New
16550 (Output_section::set_must_sort_attached_input_sections): New
16552 (class Output_section): Declare Input_section_sort_entry. Define
16553 Input_section_sort_compare. Declare
16554 sort_attached_input_sections. Add new fields:
16555 may_sort_attached_input_sections_,
16556 must_sort_attached_input_sections_,
16557 attached_input_sections_are_sorted_.
16558 * output.cc (Output_section::Output_section): Initialize new
16560 (Output_section::add_input_section): Add an entry to
16561 input_sections_ if may_sort or must_sort are true.
16562 (Output_section::set_final_data_size): Call
16563 sort_attached_input_sections if necessary.
16564 (Output_section::Input_section_sort_entry): Define new class.
16565 (Output_section::Input_section_sort_compare::operator()): New
16567 (Output_section::sort_attached_input_sections): New function.
16568 * configure.ac: Check whether the compiler supports constructor
16569 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16570 * testsuite/initpri1.c: New file.
16571 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16572 CONSTRUCTOR_PRIORITY.
16573 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16574 (initpri1_LDFLAGS): New variable.
16575 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16577 2008-03-27 Ian Lance Taylor <iant@google.com>
16579 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16580 * testsuite/common_test_1.c: New file.
16581 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16582 (common_test_1_SOURCES): New variable.
16583 (common_test_1_DEPENDENCIES): New variable.
16584 (common_test_1_LDFLAGS): New variable.
16586 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16587 and commons_ correctly when NAME/VERSION does not override
16589 * testsuite/ver_test_6.c: New file.
16590 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16591 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16592 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16594 2008-03-26 Ian Lance Taylor <iant@google.com>
16596 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16597 of an undefined symbol from a version script.
16598 * testsuite/Makefile.am (ver_test_5.so): New target.
16599 (ver_test_5.o): New target.
16600 (check_SCRIPTS): Add ver_test_5.sh.
16601 (check_DATA): Add ver_test_5.syms.
16602 (ver_test_5.syms): New target.
16603 * testsuite/ver_test_5.cc: New file.
16604 * testsuite/ver_test_5.script: New file.
16605 * testsuite/ver_test_5.sh: New file.
16606 * Makefile.in, testsuite/Makefile.in: Rebuild.
16609 Fix problems building gold with gcc 4.3.0.
16610 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16611 (gold_error_at_location, gold_warning_at_location): Use it.
16612 * configure.ac: Check whether we can compile and use a template
16613 function with a printf attribute.
16614 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16615 when jumping over bytes.
16616 * object.cc: Instantiate Object::read_section_data.
16617 * debug.h: Include <cstring>
16618 * dwarf_reader.cc: Include <algorithm>
16619 * main.cc: Include <cstring>.
16620 * options.cc: Include <cstring>.
16621 * output.cc: Include <cstring>.
16622 * script.cc: Include <cstring>.
16623 * script.h: Include <string>.
16624 * symtab.cc: Include <cstring> and <algorithm>.
16625 * target-select.cc: Include <cstring>.
16626 * version.cc: Include <string>.
16627 * testsuite/testmain.cc: Include <cstdlib>.
16628 * configure, config.in: Rebuild.
16630 2008-03-25 Ian Lance Taylor <iant@google.com>
16632 * options.cc: Include "../bfd/bfdver.h".
16633 (options::help): Print bug reporting address.
16635 * version.cc (print_version): Adjust output for current value of
16636 BFD_VERSION_STRING.
16640 * options.cc (options::help): Print list of supported targets.
16641 * target-select.h: Include <vector>.
16642 (class Target_selector): Make machine_, size_, and is_big_endian_
16643 fields const. Add bfd_name_ and instantiated_target_ fields.
16644 (Target_selector::Target_selector): Add bfd_name parameter.
16645 (Target_selector::recognize): Make non-virtual, call
16647 (Target_selector::recognize_by_name): Make non-virtual, call
16648 do_recognize_by_name.
16649 (Target_selector::supported_names): New function.
16650 (Target_selector::bfd_name): New function.
16651 (Target_selector::do_instantiate_target): New pure virtual
16653 (Target_selector::do_recognize): New virtual function.
16654 (Target_selector::do_recognize_by_name): New virtual function.
16655 (Target_selector::instantiate_target): New private function.
16656 (supported_target_names): Declare.
16657 * target-select.cc (Target_selector::Target_selector): Update for
16658 new parameter and fields.
16659 (select_target_by_name): Check that the name matches before
16660 calling recognize_by_name.
16661 (supported_target_names): New function.
16662 * i386.cc (class Target_selector_i386): Update Target_selector
16663 constructor call. Remove recognize and recognize_by_name. Add
16664 do_instantiate_target.
16665 * x86_64.cc (class Target_selector_x86_64): Likewise.
16666 * testsuite/testfile.cc (class Target_selector_test): Update for
16667 changes to Target_selector.
16669 * README: Rewrite, with some notes on unsupported features.
16671 2008-03-24 Cary Coutant <ccoutant@google.com>
16673 * i386.cc (Target_i386::Got_type): New enum declaration.
16674 (Target_i386::Scan::local): Updated callers of Output_data_got
16676 (Target_i386::Scan::global): Likewise.
16677 (Target_i386::Relocate::relocate): Likewise.
16678 (Target_i386::Relocate::relocate_tls): Likewise.
16679 * object.h (Got_offset_list): New class.
16680 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16681 (Sized_relobj::local_got_offset): Likewise.
16682 (Sized_relobj::set_local_got_offset): Likewise.
16683 (Sized_relobj::local_has_tls_got_offset): Removed.
16684 (Sized_relobj::local_tls_got_offset): Removed.
16685 (Sized_relobj::set_local_tls_got_offset): Removed.
16686 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16687 * output.cc (Output_data_got::add_global): Added got_type parameter.
16688 (Output_data_got::add_global_with_rel): Likewise.
16689 (Output_data_got::add_global_with_rela): Likewise.
16690 (Output_data_got::add_global_pair_with_rel): New function.
16691 (Output_data_got::add_global_pair_with_rela): New function.
16692 (Output_data_got::add_local): Added got_type parameter.
16693 (Output_data_got::add_local_with_rel): Likewise.
16694 (Output_data_got::add_local_with_rela): Likewise.
16695 (Output_data_got::add_local_pair_with_rel): New function.
16696 (Output_data_got::add_local_pair_with_rela): New function.
16697 (Output_data_got::add_global_tls): Removed.
16698 (Output_data_got::add_global_tls_with_rel): Removed.
16699 (Output_data_got::add_global_tls_with_rela): Removed.
16700 (Output_data_got::add_local_tls): Removed.
16701 (Output_data_got::add_local_tls_with_rel): Removed.
16702 (Output_data_got::add_local_tls_with_rela): Removed.
16703 * output.h (Output_data_got::add_global): Added got_type parameter.
16704 (Output_data_got::add_global_with_rel): Likewise.
16705 (Output_data_got::add_global_with_rela): Likewise.
16706 (Output_data_got::add_global_pair_with_rel): New function.
16707 (Output_data_got::add_global_pair_with_rela): New function.
16708 (Output_data_got::add_local): Added got_type parameter.
16709 (Output_data_got::add_local_with_rel): Likewise.
16710 (Output_data_got::add_local_with_rela): Likewise.
16711 (Output_data_got::add_local_pair_with_rel): New function.
16712 (Output_data_got::add_local_pair_with_rela): New function.
16713 (Output_data_got::add_global_tls): Removed.
16714 (Output_data_got::add_global_tls_with_rel): Removed.
16715 (Output_data_got::add_global_tls_with_rela): Removed.
16716 (Output_data_got::add_local_tls): Removed.
16717 (Output_data_got::add_local_tls_with_rel): Removed.
16718 (Output_data_got::add_local_tls_with_rela): Removed.
16719 * resolve.cc (Symbol::override_base_with_special): Removed
16720 reference to has_got_offset_ field.
16721 * symtab.cc (Symbol::init_fields): Replaced initialization
16722 of got_offset_ with got_offsets_. Removed initialization
16724 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
16725 (Symbol::got_offset): Likewise.
16726 (Symbol::set_got_offset): Likewise.
16727 (Symbol::has_tls_got_offset): Removed.
16728 (Symbol::tls_got_offset): Removed.
16729 (Symbol::set_tls_got_offset): Removed.
16730 (Symbol::got_offset_): Removed.
16731 (Symbol::tls_mod_got_offset_): Removed.
16732 (Symbol::tls_pair_got_offset_): Removed.
16733 (Symbol::got_offsets_): New field.
16734 (Symbol::has_got_offset): Removed.
16735 (Symbol::has_tls_mod_got_offset): Removed.
16736 (Symbol::has_tls_pair_got_offset): Removed.
16737 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16738 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16740 (Target_x86_64::Scan::global): Likewise.
16741 (Target_x86_64::Relocate::relocate): Likewise.
16742 (Target_x86_64::Relocate::relocate_tls): Likewise.
16744 2008-03-25 Ben Elliston <bje@au.ibm.com>
16746 * yyscript.y: Fix spelling error in comment.
16748 2008-03-24 Ian Lance Taylor <iant@google.com>
16750 * options.h (class General_options): Define build_id option.
16751 * layout.h (class Layout): Declare write_build_id, create_note,
16752 create_build_id. Add build_id_note_ member.
16753 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16754 "libiberty.h", "md5.h", "sha1.h".
16755 (Layout::Layout): Initialize eh_frame_data_,
16756 eh_frame_hdr_section_, and build_id_note_.
16757 (Layout::finalize): Call create_build_id.
16758 (Layout::create_note): New function, broken out of
16759 Layout::create_gold_note.
16760 (Layout::create_gold_note): Call create_note.
16761 (Layout::create_build_id): New function.
16762 (Layout::write_build_id): New function.
16763 (Close_task_runner::run): Call write_build_id.
16765 * x86_64.cc: Correct license to GPLv3.
16767 2008-03-23 Ian Lance Taylor <iant@google.com>
16769 * options.cc: Include "demangle.h".
16770 (parse_optional_string): New function.
16771 (parse_long_option): Handle takes_optional_argument.
16772 (parse_short_option): Update dash_z initializer. Handle
16773 takes_optional_argument.
16774 (General_options::General_options): Initialize do_demangle_.
16775 (General_options::finalize): Set do_demangle_. Handle demangling
16777 * options.h (parse_optional_string): Declare.
16778 (struct One_option): Add optional_arg field. Update constructor.
16779 Update call constructor calls. Add takes_optional_argument
16781 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16782 (DEFINE_optional_string): Define.
16783 (General_options::demangle): Change from DEFINE_bool to
16784 DEFINE_optional_string.
16785 (General_options::no_demangle): New function.
16786 (General_options::do_demangle): New function.
16787 (General_options::set_do_demangle): New function.
16788 (General_options::execstack_status_): Move definition to end of
16790 (General_options::static_): Likewise.
16791 (General_options::do_demangle_): New field.
16792 * object.cc (big_endian>::get_symbol_location_info): Call
16793 Options::do_demangle, not Options::demangle.
16794 * symtab.cc (demangle): Likewise.
16796 2008-03-22 Ian Lance Taylor <iant@google.com>
16798 * gold.h: Include <cstddef> and <sys/types.h>
16799 * options.h: Include <cstring>.
16801 2008-03-21 Ian Lance Taylor <iant@google.com>
16803 * Added source code to GNU binutils.
16805 Copyright (C) 2008-2015 Free Software Foundation, Inc.
16807 Copying and distribution of this file, with or without modification,
16808 are permitted in any medium without royalty provided the copyright
16809 notice and this notice are preserved.
16815 version-control: never