1 2015-01-22 Han Shen <shenhan@google.com>
3 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
4 (Target_arm::do_plt_address_for_global): New method.
5 (Target_arm::do_plt_address_for_local): New method.
6 (Target_arm::rel_irelative_section): New method.
7 (Target_arm::make_data_plt): Add more parameters for plt ctor.
8 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
9 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
10 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
11 (Target_arm::Scan::check_non_pic): Add ifunc support.
12 (Target_arm::Scan::local): Add ifunc support.
13 (Target_arm::Scan::global): Add ifunc support.
14 (Target_arm::make_plt_section): New method.
15 (Target_arm::make_plt_entry): Change to call to make_plt_section.
16 (Target_arm::make_local_ifunc_plt_entry): New method.
17 (Target_arm::got_irelative_): New member.
18 (Target_arm::rel_irelative_): New member.
19 (Target_arm::got_section): Add creation for got_irelative_.
20 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
21 (Target_arm::Relocate::relocate): Properly set local ifunc address.
22 (Target_arm::do_dynsym_value): Properly set global ifunc address.
23 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
24 (Output_data_plt_arm::IRelative_data): New type.
25 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
26 (Output_data_plt_arm::add_entry): Add more parameters.
27 (Output_data_plt_arm::add_relocation): New method.
28 (Output_data_plt_arm::add_local_ifunc_entry): New method.
29 (Output_data_plt_arm::rel_irelative): New method.
30 (Output_data_plt_arm::entry_count): Modified.
31 (Output_data_plt_arm::address_for_global): New method.
32 (Output_data_plt_arm::address_for_local): New method.
33 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
34 (Output_data_plt_arm::insert_irelative_data): New method.
35 (Output_data_plt_arm::irelative_rel_): New member.
36 (Output_data_plt_arm::got_): New member.
37 (Output_data_plt_arm::got_irelative_): New member.
38 (Output_data_plt_arm::irelative_count_): New member.
39 (Output_data_plt_arm::IRelative_data_vec): New typedef.
40 (Output_data_plt_arm::irelative_data_vec_): New member.
41 (Output_data_plt_arm::do_write): Write out irelative entries.
42 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
43 more parameters to ctor.
44 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
45 more parameters to ctor.
46 * output.h (Output_data_reloc::add_local_relative): New method.
47 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
49 2015-01-29 Alan Modra <amodra@gmail.com>
51 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
52 and GOT_TLSGD to LE optimization.
54 2015-01-28 Cary Coutant <ccoutant@google.com>
56 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
57 for undef TLS symbols.
58 (Target_x86_64::Relocate::relocate_tls): Likewise.
59 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
61 2015-01-25 Cary Coutant <ccoutant@google.com>
63 * output.cc (Output_segment::set_section_addresses): Fix calculation
64 of size of relro segment.
66 2015-01-22 Alan Modra <amodra@gmail.com>
68 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
69 condition for need of ifunc plt entry.
70 (Target_powerpc::Scan::global <got relocs>): Likewise.
72 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
74 * mips.cc (reloc_high): Add r_sym.
75 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
76 reloc_high constructor.
77 (Mips_relocate_functions::relgot16_local): Likewise.
78 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
79 r_type to decide whether LO16 matches HI16.
80 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
81 rello16 and relgot16_local.
83 2015-01-09 Cary Coutant <ccoutant@google.com>
85 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
86 unless alignment is larger than page size.
88 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
89 Cary Coutant <ccoutant@google.com>
92 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
93 (DEFAULT_TARGET_X32): Set for x32.
94 * x86_64.cc (cmp_insn_32): New.
95 (lea_r10_insn_32): Likewise.
96 (lea_r11_insn_32): Likewise.
97 (cmp_insn_64): Likewise.
98 (lea_r10_insn_64): Likewise.
99 (lea_r11_insn_64): Likewise.
100 (Target_x86_64<size>::do_calls_non_split): Handle x32.
101 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
102 (check_DATA): Add split_x32 files.
103 (split_x32_[1234n].o): New targets.
104 (split_x32_[124]): New targets.
105 (split_x32_[1234r].stdout): New targets.
106 * testsuite/split_x32.sh: New file.
107 * testsuite/split_x32_1.s: Likewise.
108 * testsuite/split_x32_2.s: Likewise.
109 * testsuite/split_x32_3.s: Likewise.
110 * testsuite/split_x32_4.s: Likewise.
111 * testsuite/split_x32_n.s: Likewise.
112 * configure: Regenerated.
113 * testsuite/Makefile.in: Likewise.
115 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
118 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
121 2015-01-02 Alan Modra <amodra@gmail.com>
123 * version.cc (print_version): Just print current year.
124 * dwp.cc (print_version): Likewise.
126 2015-01-01 Alan Modra <amodra@gmail.com>
128 Update year range in copyright notice of all files.
130 2014-12-25 Alan Modra <amodra@gmail.com>
132 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
134 (Target_arm::merge_object_attributes, ): Likewise.
136 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
138 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
139 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
140 AEABI_VFP_args_vfp to check that.
141 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
142 value and replace hardcoded values by enum values.
144 2014-12-22 Cary Coutant <ccoutant@google.com>
146 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
148 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
151 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
152 to "return i * i * 3;".
154 2014-12-16 Cary Coutant <ccoutant@google.com>
156 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
157 (Mapfile::print_output_data): Use current_data_size() to avoid
158 assert for sections requiring postprocessing; if address is not valid,
160 (Mapfile::print_output_section): Use current_data_size(); print note
161 that addresses and sizes are before compression.
163 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
165 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
166 Cast current_group_size to unsigned long when reporting error.
168 2014-12-10 Jing Yu <jingyu@google.com>
170 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
171 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
172 Update error message.
173 (Target_aarch64::do_relax): Use absolute value of option
174 stub_group_size. Replace local variable with class member
177 2014-12-04 Alan Modra <amodra@gmail.com>
179 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
180 addend of PLTREL24 reloc when not generating a plt stub. Make
181 max_branch_offset an "Address".
182 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
183 (Target_powerpc::Relocate::relocate): Likewise.
185 2014-12-04 Alan Modra <amodra@gmail.com>
188 * symtab.cc (Symbol::set_undefined): Remove assertion.
189 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
190 on symbols defined in discarded sections, instead return false.
191 Rearrange params, update all callers.
192 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
193 branches to syms in discarded sections.
194 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
195 undefined and flag as discarded.
196 (Target_powerpc::Relocate::relocate): Localize variable.
198 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
201 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
202 * testsuite/Makefile.in: Regenerated.
204 2014-12-03 Alan Modra <amodra@gmail.com>
207 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
208 when adding dynamic relocations against section symbols.
210 2014-12-01 Dimitry Ivanov <dimitry@google.com>
212 * layout.cc (Layout::finish_dynamic_section): When '-z global'
213 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
214 * options.h (General_options): New -z option (global).
216 2014-12-01 Cary Coutant <ccoutant@google.com>
219 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
221 (Layout::create_executable_stack_info): Warn when -z noexecstack is
222 given but some inputs require executable stack.
224 2014-11-26 Cary Coutant <ccoutant@google.com>
226 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
227 .debug_str_offsets; strip .debug_gnu_pubnames and
229 (lines_only_debug_sections): Strip all four new sections.
231 2014-11-26 Jing Yu <jingyu@google.com>
233 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
234 register to be x0 when to relax TLSDESC_LD64_LO12.
236 2014-11-26 Alan Modra <amodra@gmail.com>
238 * powerpc.cc (struct Stub_table_owner): New.
239 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
240 unsigned int vector. Update all references.
241 (powerpc_relobj::set_stub_table): Take an unsigned int param
242 rather than a Stub_table. Update callers.
243 (Powerpc_relobj::clear_stub_table): New function.
244 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
245 stub_group_size_ vars.
246 (Target_powerpc::new_stub_table): Delete.
247 (max_branch_delta): New function, extracted from..
248 (Target_powerpc::Relocate::relocate): ..here..
249 (Target_powerpc::Branch_info::make_stub): ..and here. Return
250 status on whether stub created successfully.
251 (Stub_control::Stub_control): Add "no_size_errors" param. Move
253 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
254 reduce on relax failure.
255 (Target_powerpc::group_sections): Add "no_size_errors" param.
256 Use stub_group_size_. Set up group info in a temp vector,
257 before building Stub_table vector. Account for input sections
258 possibly already converted to relaxed sections.
259 (Stub_table::init): Delete. Merge into..
260 (Stub_table::Stub_table): ..here.
261 (Stub_table::can_reach_stub): New function.
262 (Stub_table::add_plt_call_entry): Add "from" parameter and
263 return true iff stub could be reached.
264 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
266 (Stub_table::clear_stubs): Add "all" param.
268 2014-11-26 Alan Modra <amodra@gmail.com>
270 * powerpc.cc (Stub_control::set_output_and_owner): New function.
271 (Target_powerpc::group_sections): Use it.
273 2014-11-25 Cary Coutant <ccoutant@google.com>
275 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
276 (Binary_to_elf::write_symbol): Add st_size parameter.
277 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
279 2014-11-25 Cary Coutant <ccoutant@google.com>
282 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
283 (Sized_relobj_file::do_layout): Handle deferred sections properly
284 during GC pass 1. Don't add reloc sections to deferred list twice.
285 * object.h (Sized_relobj_file::is_deferred_layout): New function.
286 (Sized_relobj_file::is_deferred_layout_): New data member.
288 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
291 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
292 Check PC-relative offset overflow in PLT entry.
294 2014-11-21 Alan Modra <amodra@gmail.com>
296 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
299 2014-11-20 Alan Modra <amodra@gmail.com>
301 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
302 from --stub-group-size parameter divided by 1024.
303 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
304 template parameter. Update all uses.
305 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
306 has_stub_value. Set for long branches. Don't report overflow for
307 branch to undefined weak symbols. Print info message on
308 overflowing branch to stub.
310 2014-11-20 Alan Modra <amodra@gmail.com>
312 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
314 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
316 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
317 entry for R_X86_64_GOTPLT64.
318 (Target_x86_64<size>::Relocate::relocate): Update comments for
321 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
323 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
324 * plugin.h: add lock definition
326 2014-10-29 Han Shen <shenhan@google.com>
327 Jing Yu <jingyu@google.com>
329 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
330 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
331 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
333 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
335 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
336 (Target_aarch64::tls_ld_to_le): New method.
337 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
339 (Output_data_plt_aarch64::irelative_rel_): New data member.
340 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
341 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
342 (Output_data_plt_aarch64::add_relocation): New method.
343 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
344 offset. Add got_irelative size to got size.
345 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
346 type string with the new typename.
347 (AArch64_relocate_functions::update_adr): Replace parameter x with
349 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
350 (AArch64_relocate_functions::reloc_common): New method.
351 (AArch64_relocate_funcsions::rela_general): Extract common part out
352 into reloc_common method.
353 (AArch64_relocate_functions::rela_general): Likewise.
354 (AArch64_relocate_functions::pcrela_general): Likewise.
355 (AArch64_relocate_functions::adr): New method.
356 (AArch64_relocate_functions::adrp): Calculate immed before calling
358 (AArch64_relocate_functions::adrp): Likewise.
359 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
360 comparing x to 0. Calculate immed from ~x when x < 0.
361 (Target_aarch64::optimize_tls_reloc): Add new cases for
362 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
363 TLSLD_MOVW_DTPREL_G0_NC.
364 (Target_aarch64::possible_function_pointer_reloc): Implement this
366 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
368 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
369 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
370 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
371 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
372 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
373 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
374 (Target_aarch64::make_plt_entry): Call add_entry with two more
376 (Target_aarch64::make_local_ifunc_plt_entry): New method.
377 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
378 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
379 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
380 (Target_aarch64::Relocate::relocate_tls): Add cases for
381 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
382 TLSLD_MOVW_DTPREL_G0_NC.
383 * testsuite/icf_safe_so_test.cc: Correct test comment.
384 * testsuite/icf_safe_test.sh: Add AArch64 arch.
386 2014-10-22 Alan Modra <amodra@gmail.com>
388 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
391 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
393 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
395 2014-10-17 Cary Coutant <ccoutant@google.com>
397 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
398 Add "typename" keyword.
400 2014-10-15 Han Shen <shenhan@google.com>
401 Jing Yu <jingyu@google.com>
403 Patch for gold aarch64 backend to support relaxation.
404 * aarch64-reloc.def: Change format.
405 * aarch64.cc (class Reloc_stub): New class.
406 (class Stub_table): New class.
407 (class AArch64_relobj): New class.
408 (class AArch64_input_section): New class.
409 (class AArch64_output_section): New class.
410 (Target_aarch64::new_stub_table): New method.
411 (Target_aarch64::new_aarch64_input_section): New method.
412 (Target_aarch64::find_aarch64_input_section): New method.
413 (Target_aarch64::scan_section_for_stubs): New method.
414 (Target_aarch64::scan_reloc_section_for_stubs): New method.
415 (Target_aarch64::relocate_stub): New method.
416 (Target_aarch64::current_target): New method.
417 (Target_aarch64::do_make_elf_object): New method.
418 (Target_aarch64::do_may_relax): New method.
419 (Target_aarch64::do_relax): New method.
420 (Target_aarch64::group_sections): New method.
421 (Target_aarch64::scan_reloc_for_stub): New method.
422 (Target_aarch64::do_make_output_section): New method.
423 (Target_aarch64::stub_tables_): New data member.
424 (Target_aarch64::aarch64_input_section_map_): New data member.
425 (AArch64_relocate_functions::maybe_apply_stub): New method.
427 2014-09-30 Cary Coutant <ccoutant@google.com>
430 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
432 2014-09-30 Kito Cheng <kito@0xlab.org>
435 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
436 hash table before sysv-style hash table.
438 2014-09-29 Sriraman Tallam <tmsriram@google.com>
440 * options.h (--pic-executable): Add negative to alias to -no-pie.
442 2014-09-26 Cary Coutant <ccoutant@google.com>
445 * object.cc (Sized_relobj_file): Compute value of section symbols
446 for TLS sections the same as TLS symbols.
448 2014-09-25 Cary Coutant <ccoutant@google.com>
451 * resolve.cc (Symbol_table::resolve): Override common placeholder
452 symbols, but adjust sizes.
453 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
454 symbols to common lists.
456 2014-09-24 Alan Modra <amodra@gmail.com>
458 * po/POTFILES.in: Regenerate.
460 2014-09-23 Taiju Tsuiki <tzik@google.com>
461 Cary Coutant <ccoutant@google.com>
464 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
465 on input_sections_blocker.
466 * layout.cc (Write_sections_task::locks): Unblock
467 input_sections_blocker_.
468 * layout.h (Write_sections_task::Write_sections_task): Add
469 input_sections_blocker.
470 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
472 * testsuite/Makefile.in: Regenerate.
474 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
476 * testsuite/Makefile.am (plugin_test_10): New test.
477 * testsuite/Makefile.in: Regenerate
478 * testsuite/plugin_common_test_2.c (c1): Align to 8.
479 * testsuite/plugin_test_10.sh: New file.
481 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
483 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
484 * resolve.cc (Symbol_table::resolve): Don't override common symbols
485 during the replacement phase.
487 2014-09-17 Han Shen <shenhan@google.com>
488 Jing Yu <jingyu@google.com>
490 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
491 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
492 * aarch64.cc (Target_aarch64): Add data members
493 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
494 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
496 (Target_aarch64::do_reloc_symbol_index): New method.
497 (Target_aarch64::do_reloc_addend): New method.
498 (Target_aarch64::add_tlsdesc_info): New method.
499 (Target_aarch64::do_dynsym_value): New method.
500 (Target_aarch64::do_make_data_plt): Add new parameters: got,
501 got_irelative. Pass them to Output_data_plt_aarch64_standard.
502 (Target_aarch64::make_data_plt): Add new parameters: got,
503 got_irelative. Pass them to do_make_data_plt.
504 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
505 (Target_aarch64::Relocate:tls_gd_to_le): New method.
506 (Target_aarch64::Relocate:tls_ie_to_le): New method.
507 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
508 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
509 (Target_aarch64::got_tlsdesc_section): New method.
510 (Target_aarch64::make_local_ifunc_plt_entry): New method.
511 (Target_aarch64::define_tls_base_symbol): New method.
512 (Target_aarch64::reserve_tlsdesc_entries): New method.
513 (Target_aarch64::got_mod_index_entry): New method.
514 (Target_aarch64::rela_tlsdesc_section): New method.
515 (Target_aarch64::rela_irelative_section): New method.
516 (Target_aarch64::Tlsdesc_info): New struct.
517 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
518 relocations and tlsdesc relocations.
519 (Target_aarch64::optimize_tls_reloc): Implement method.
520 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
521 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
523 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
524 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
525 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
526 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
527 (Output_data_plt_aarch64::rela_tlsdesc): New method.
528 (Output_data_plt_aarch64::rela_irelative): New method.
529 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
530 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
531 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
532 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
533 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
534 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
535 (Output_data_plt_aarch64_standard): New member variables:
536 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
537 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
538 New parameter: got, got_irelative.
539 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
540 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
541 (Output_data_plt_aarch64::do_write): Replace got_address with
542 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
543 (AArch64_relocate_functions::update_movnz): New method.
544 (AArch64_relocate_functions): Correct format.
545 (AArch64_relocate_functions::movnz): New method.
546 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
547 before the switch. Add new cases to switch.
548 Check ie_to_le relaxation on tlsie relocations. Add code handling
550 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
551 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
552 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
553 Call reloc_name_in_error_message to print unsupported reloc.
554 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
556 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
557 relocs. Fill in some more dynamic tags.
558 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
559 Skip call tls_get_addr when tlsgd is relaxed.
560 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
561 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
562 tlsdesc->ie relaxation.
564 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
566 * mips.cc (Target_mips_nacl): New class.
567 (Target_selector_mips_nacl): New class.
568 (target_selector_mips32): Rename from target_selector_mips32be and use
569 Target_selector_mips_nacl instead of Target_selector_mips.
570 (target_selector_mips32el): Rename from target_selector_mips32 and use
571 Target_selector_mips_nacl instead of Target_selector_mips.
572 (target_selector_mips64): Rename from target_selector_mips64be and use
573 Target_selector_mips_nacl instead of Target_selector_mips.
574 (target_selector_mips64el): Rename from target_selector_mips64 and use
575 Target_selector_mips_nacl instead of Target_selector_mips.
576 (Target_mips::mips_info): Add const attribute.
578 2014-09-02 Cary Coutant <ccoutant@google.com>
580 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
581 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
582 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
583 (Sized_incr_dynobj::do_section_name): Likewise.
584 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
585 (Sized_incr_dynobj::do_section_name): Likewise.
586 * object.h (Object::section_name): Likewise.
587 (Object::do_section_name): Likewise.
588 (Sized_relobj_file::do_section_name): Likewise.
589 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
590 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
592 2014-09-02 Cary Coutant <ccoutant@google.com>
595 * ehframe.cc (Fde::write): Add output_offset parameter.
596 (Cie::write): Likewise.
597 (Eh_frame::set_final_data_size): Account for offset within output
599 (Eh_frame::do_sized_write): Likewise.
600 * ehframe.h (Fde::write): Add output_offset parameter.
601 (Cie::write): Likewise.
602 * output.cc (Output_section::Input_section_sort_entry): Remove
603 section_has_name_; add output_section_name parameter. Use
604 output section name for non-input sections.
605 (Output_section::Input_section_sort_entry::section_has_name): Remove.
606 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
607 (Output_section::Input_section_sort_compare): Remove logic for
608 sections without names.
609 (Output_section::Input_section_sort_init_fini_compare): Likewise.
610 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
612 (Output_section::Input_section_sort_section_name_compare): Likewise.
614 2014-08-29 Han Shen <shenhan@google.com>
615 Jing Yu <jingyu@google.com>
617 * aarch64-reloc-property.cc
618 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
619 reference reloc property in the table.
620 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
622 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
623 2 new overloaded methods.
624 (Output_data_got_aarch64::do_write): Add code to write out
626 (class Output_data_got_aarch64::Static_reloc): New class to wrap
628 (Output_data_got_aarch64::static_relocs): New vector to
630 (Target_aarch64::TCB_SIZE): New const static memeber.
631 (Target_aarch64::tcb_size): New method.
632 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
633 (Target_aarch64::Relocate::relocate_tls): New method.
634 (Target_aarch64::Scan::local): Add code handling new reloc types.
635 (Target_aarch64::Scan::global): Add code handling new reloc types.
637 2014-08-13 Sriraman Tallam <tmsriram@google.com>
639 * options.h (-no-pie): Add option.
641 2014-08-08 Jing Yu <jingyu@google.com>
642 Han Shen <shenhan@google.com>
644 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
645 (DEFFILES): add aarch64-reloc.def.
646 (TARGETSOURCES): Add aarch64-reloc-property.cc.
647 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
648 * Makefile.in: Regenerate.
649 * aarch64-reloc-property.cc: New file.
650 * aarch64-reloc-property.h: New file.
651 * aarch64-reloc.def: New file.
652 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
653 with tab to make the format consistent.
654 (Output_data_got_aarch64::symbol_table_): New method.
655 (Target_aarch64::do_plt_address_for_global): New method.
656 (Target_aarch64::do_plt_address_for_local): New method.
657 (Target_aarch64::do_select_as_default_target): New method.
658 (Target_aarch64::do_make_data_plt): New method.
659 (Target_aarch64::make_data_plt): New method.
660 (Output_data_plt_aarch64::has_irelative_section): New method.
661 (Output_data_plt_aarch64::address_for_global): New method.
662 (Output_data_plt_aarch64::address_for_local): New method.
663 (Output_data_plt_aarch64::irelative_rel_): New parameter.
664 (Output_data_plt_aarch64::add_entry): Implement contents.
665 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
666 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
667 the got_pov entry to plt0.
668 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
670 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
671 (AArch64_howto): New struct.
672 (aarch64_howto[]): New static const array.
673 (AArch64_relocate_functions): New class.
674 (Target_aarch64::Scan::get_reference_flags): Remove method.
675 (Target_aarch64::Scan::local): Implement to support a few relocations.
676 (Target_aarch64::Scan::global): Implement to support a few relocations.
677 (Target_aarch64::make_plt_section): Implement contents.
678 (Target_aarch64::make_plt_entry): Implement contents.
679 (Target_aarch64::do_finalize_sections): Implement contents.
680 (Target_aarch64::Relocate::relocate): Implement a few relocations.
681 (Target_aarch64::relocate_section): Implement contents.
683 2014-08-06 Alan Modra <amodra@gmail.com>
685 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
687 2014-08-06 Alan Modra <amodra@gmail.com>
690 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
692 2014-07-21 Sriraman Tallam <tmsriram@google.com>
694 * object.cc (Relobj::is_section_name_included): Add
695 ".rodata.nptl_version" to not garbage collect this section.
697 2014-07-08 Cary Coutant <ccoutant@google.com>
699 * expression.cc (struct Expression::Expression_eval_info): Add
700 new fields type_pointer, vis_pointer, and nonvis_pointer.
701 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
702 nonvis_pointer parameters. Adjust all calls.
703 (Symbol_expression::value): Update type, visibility, and nonvis bits
705 * script.cc (Symbol_assignment::sized_finalize): Update type,
706 visibility, and remaining st_other bits for new symbol.
707 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
708 vis_pointer, and nonvis_pointer parameters.
709 * symtab.h (Symbol::set_type): New method.
711 * testsuite/Makefile.am (defsym_test): New test.
712 * testsuite/Makefile.in: Regenerate.
713 * testsuite/defsym_test.c: New file.
714 * testsuite/defsym_test.sh: New file.
716 2014-07-08 Cary Coutant <ccoutant@google.com>
719 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
720 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
721 (Sized_dynobj::base_read_symbols): ...new method.
722 * object.h (Sized_relobj_file::base_read_symbols): New method.
723 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
724 (Sized_relobj_file::base_read_symbols): ...new method.
725 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
726 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
727 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
729 2014-07-04 Alan Modra <amodra@gmail.com>
731 * po/POTFILES.in: Regenerate.
733 2014-07-02 Jing Yu <jingyu@google.com>
735 * aarch64.cc: New file
736 * Makefile.am (TARGETSOURCES): Add aarch64.cc
737 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
738 * Makefile.in: Regenerate.
739 * configure.tgt: Add entries for aarch64*.
740 * configure.ac: Likewise.
741 * configure: Likewise.
743 2014-06-27 Alan Modra <amodra@gmail.com>
745 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
747 2014-06-24 Cary Coutant <ccoutant@google.com>
749 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
751 (Dwo_file::sized_read_unit_index): Likewise.
753 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
756 * Makefile.am (TARGETSOURCES): Add mips.cc
757 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
758 * configure.tgt: Add entries for mips*.
759 * configure.ac: Likewise.
760 * Makefile.in: Regenerate.
761 * configure: Likewise.
763 2014-06-09 Cary Coutant <ccoutant@google.com>
765 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
766 unit_length is within section bounds.
768 2014-06-09 Cary Coutant <ccoutant@google.com>
771 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
774 2014-06-07 Alan Modra <amodra@gmail.com>
776 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
778 2014-06-06 Cary Coutant <ccoutant@google.com>
780 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
781 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
782 (Dwarf_pubnames_table::read_header): Likewise.
783 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
786 2014-06-05 Joel Brobecker <brobecker@adacore.com>
788 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
789 * Makefile.in, configure: Regenerate.
791 2014-06-03 Alan Modra <amodra@gmail.com>
793 * powerpc.cc (addis_12_2): Define.
794 (Stub_table::do_write): Support fusion on ELFv2 stubs.
796 2014-06-03 Alan Modra <amodra@gmail.com>
798 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
801 2014-06-02 Alan Modra <amodra@gmail.com>
803 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
804 Only ignore relocs on ELFv1.
805 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
807 2014-05-30 Cary Coutant <ccoutant@google.com>
809 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
810 * testsuite/Makefile.in: Regenerate.
811 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
813 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
816 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
817 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
819 2014-05-15 Alan Modra <amodra@gmail.com>
821 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
822 Compare FDE contents with DW_CFA_nop rather than 0.
824 2014-05-13 Sriraman Tallam <tmsriram@google.com>
826 * symtab.h (may_need_copy_reloc): Remove check for position independent
828 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
829 position independence before pc absolute may_need_copy_reloc call.
830 Add check for executable output befor pc relative may_need_copy_reloc
836 * powerpc.cc: Add check for no position independence before
837 may_need_copy_reloc calls.
838 * testsuite/pie_copyrelocs_test.cc: New file.
839 * testsuite/pie_copyrelocs_shared_test.cc: New file.
840 * Makefile.am (pie_copyrelocs_test): New test.
841 * Makefile.in: Regenerate.
843 2014-05-08 Martin Liška <mliska@suse.cz>
845 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
847 2014-05-06 Cary Coutant <ccoutant@google.com>
850 * i386.cc (Output_data_got_plt_i386): New class.
851 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
852 parameter. Change all callers.
853 (Output_data_plt_i386::layout_): Remove.
854 (Output_data_plt_i386::got_plt_): Change type.
855 (Target_i386::got_plt_): Change type. Change all references.
856 (Target_i386::got_section): Create instance of new class.
857 (Output_data_got_plt_i386::do_write): New function.
858 * x86_64.cc (Output_data_got_plt_x86_64): New class.
859 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
860 parameter. Change all callers.
861 (Output_data_plt_x86_64::layout_): Remove.
862 (Output_data_plt_x86_64::got_plt_): Change type.
863 (Target_x86_64::got_plt_): Change type. Change all references.
864 (Target_x86_64::got_section): Create instance of new class.
865 (Output_data_got_plt_x86_64::do_write): New function.
866 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
867 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
870 2014-05-05 Cary Coutant <ccoutant@google.com>
872 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
873 if we have pubnames/pubtypes.
875 2014-05-02 Cary Coutant <ccoutant@google.com>
877 * defstd.cc (in_segment): Define __ehdr_start here...
878 * layout.cc (Layout::finalize): ...Instead of here. Set the
879 output segment when known.
880 * resolve.cc (Symbol::override_base_with_special): Remember
881 the original binding.
882 * symtab.cc (Symbol::set_output_segment): New function.
883 (Symbol::set_undefined): New function.
884 * symtab.h (Symbol::is_weak_undefined): Check original undef
886 (Symbol::is_strong_undefined): New function.
887 (Symbol::set_output_segment): New function.
888 (Symbol::set_undefined): New function.
889 * target-reloc.h (is_strong_undefined): Remove.
890 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
891 Check for hidden undefs.
892 (relocate_section): Call Symbol::is_strong_undefined.
894 * testsuite/Makefile.am (ehdr_start_test_1)
895 (ehdr_start_test_2, ehdr_start_test_3)
896 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
897 * testsuite/Makefile.in: Regenerate.
898 * testsuite/ehdr_start_def.cc: New source file.
899 * testsuite/ehdr_start_test.cc: New source file.
900 * testsuite/ehdr_start_test.t: New linker script.
901 * testsuite/ehdr_start_test_4.sh: New shell script.
903 2014-04-23 Cary Coutant <ccoutant@google.com>
906 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
908 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
910 * layout.cc (Layout::include_section): Allow a target to decide
911 whether to include a section.
912 * target.h (Target::should_include_section): New function.
913 (Target::do_should_include_section): New function.
915 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
917 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
919 (Copy_relocs::emit): ... here.
920 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
921 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
922 (Copy_reloc_entry::entries_): Change from private to protected.
924 2014-04-02 Sriraman Tallam <tmsriram@google.com>
926 * icf.cc (get_section_contents): Replace copies of reloc
927 vectors with const references.
929 2014-04-02 Cary Coutant <ccoutant@google.com>
931 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
932 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
933 * configure: Regenerate.
934 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
935 -fno-use-linker-plugin.
936 (LINK1, CXXLINK1): Add it to the link command.
937 * testsuite/Makefile.in: Regenerate.
939 2014-03-12 Alan Modra <amodra@gmail.com>
941 * Makefile.in: Regenerate.
943 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
945 * symtab.h (Symbol::set_nonvis): New function.
947 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
949 * symtab.cc (Sized_symbol<32>::init_output_data):
950 Instantiate the template.
951 (Sized_symbol<64>::init_output_data): Likewise.
953 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
955 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
956 adjust dynamic symbol value.
957 * target.h (Target::adjust_dyn_symbol): New function.
958 (Target::do_adjust_dyn_symbol): New function.
960 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
962 * output.cc (Output_data_dynamic::Dynamic_entry::write):
963 Get the value of DYNAMIC_CUSTOM dynamic entry.
964 * output.h (Output_data_dynamic::add_custom): New function.
965 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
967 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
968 * target.h (Target::dynamic_tag_custom_value): New function.
969 (Target::do_dynamic_tag_custom_value): New function.
971 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
973 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
975 * target.h (Target::has_custom_set_dynsym_indexes): New function.
976 (Target::do_has_custom_set_dynsym_indexes): New function.
977 (Target::set_dynsym_indexes): New function.
978 (Target::do_set_dynsym_indexes): New function.
980 2014-03-07 Alan Modra <amodra@gmail.com>
982 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
983 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
984 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
985 (Powerpc_relocate_functions::has_overflow_bitfield,
986 overflowed): Use the above.
987 (Target_powerpc::Relocate::relocate): Correct overflow checking
988 for a number of relocations. Modify overflow test for 16-bit
989 fields in instructions to signed/unsigned according to whether
990 the field takes a signed or unsigned value.
992 2014-03-05 Alan Modra <amodra@gmail.com>
994 Update copyright years.
996 2014-03-05 Alan Modra <amodra@gmail.com>
998 * powerpc.cc (Target_powerpc::Scan::local, global): Support
999 R_PPC64_ADDR64_LOCAL.
1000 (Target_powerpc::Relocate::relocate): Likewise.
1002 2014-03-03 Alan Modra <amodra@gmail.com>
1004 * dwp.cc (print_version): Update copyright year to current.
1006 2014-02-10 Alan Modra <amodra@gmail.com>
1008 * po/gold.pot: Regenerate.
1010 2014-02-06 Cary Coutant <ccoutant@google.com>
1012 Fix problem where -u is ignored when a weak undef is seen.
1014 * archive.cc (Library_base::should_include_member): Reorder
1015 code to check for -u option if a weak undef has already been seen.
1016 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1017 * testsuite/Makefile.in: Regenerate.
1018 * testsuite/weak_undef_file3.cc: New file.
1019 * testsuite/weak_undef_file4.cc: New file.
1020 * testsuite/weak_undef_test_2.cc: New file.
1022 2014-02-05 Cary Coutant <ccoutant@google.com>
1024 Fix issues with gold undefined symbol diagnostics.
1027 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1029 * target-reloc.h (is_strong_undefined): New function.
1030 (relocate_section): Move undef vtable symbol check from here.
1031 Check for is_strong_undefined.
1033 2014-02-05 Cary Coutant <ccoutant@google.com>
1035 Fix problems with the --dynamic-list option.
1038 * options.cc (General_options::parse_dynamic_list):
1039 Set have_dynamic_list_.
1040 (General_options::General_options): Initialize have_dynamic_list_.
1041 (General_options::finalize): Turn off -Bsymbolic and
1042 -Bsymbolic-functions if --dynamic-list provided.
1043 * options.h (General_options::have_dynamic_list): New function.
1044 (General_options::have_dynamic_list_): New data member.
1045 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1049 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1050 in --dynamic-list, mark it.
1052 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1053 (dynamic_list_2): New test case.
1054 * testsuite/Makefile.in: Regenerate.
1055 * testsuite/dynamic_list_2.cc: New file.
1056 * testsuite/dynamic_list_2.t: New file.
1057 * testsuite/dynamic_list_lib1.cc: New file.
1058 * testsuite/dynamic_list_lib2.cc: New file.
1059 * testsuite/gc_dynamic_list_test.c: New file.
1060 * testsuite/gc_dynamic_list_test.sh: New file.
1061 * testsuite/gc_dynamic_list_test.t: New file.
1063 2014-01-28 Cary Coutant <ccoutant@google.com>
1065 Add .gdb_index version 7 support.
1067 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1068 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1070 (Dwarf_ranges_table::read_ranges_table): Likewise.
1071 (Dwarf_pubnames_table::read_section): Check for GNU-style
1072 sections, and for compressed debug sections.
1073 (Dwarf_pubnames_table::read_header): Compute end address of table.
1074 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1075 for end of list by offset, not by offset == 0.
1076 (Dwarf_info_reader::do_read_string_table): Check for compressed
1078 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1079 Initialize new data members.
1080 (Dwarf_pubnames_table::next_name): return flag_byte.
1081 (Dwarf_pubnames_table::end_of_table_): New data member.
1082 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1083 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1084 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1085 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1086 read skeleton type unit DIEs.
1087 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1088 (Gdb_index::do_write): Write flag_byte.
1089 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1090 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1091 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1092 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1094 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1096 * version.cc (print_version): Update copyright year to 2014.
1098 2013-12-19 Dimitry Andric <dimitry@andric.com>
1100 * stringpool.cc (Stringpool_template::reserve): Add
1101 HAVE_UNORDERED_MAP case.
1102 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1104 2013-12-18 Cary Coutant <ccoutant@google.com>
1106 * configure.ac: Check for <unordered_set> and <unordered_map>.
1107 * config.in: Regenerate.
1108 * configure: Regenerate.
1109 * system.h: Use <unordered_set> and <unordered_map> if available.
1111 2013-12-10 Roland McGrath <mcgrathr@google.com>
1113 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1114 with $(INSTALL_PROGRAM_ENV).
1115 * Makefile.in: Regenerate.
1117 2013-11-22 Cary Coutant <ccoutant@google.com>
1119 * configure.ac: Add check for which library is needed for
1121 * configure: Regenerate.
1123 2013-11-22 Cary Coutant <ccoutant@google.com>
1125 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1127 * testsuite/Makefile.in: Regenerate.
1129 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1131 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1132 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1133 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1134 (Target_x86_64<size>::Scan::local): Likewise.
1135 (Target_x86_64<size>::Scan::global): Likewise.
1136 (Target_x86_64<size>::Relocate::relocate): Likewise.
1137 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1139 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1142 * testsuite/Makefile.am (check_PROGRAMS): Add
1143 exception_x86_64_bnd_test.
1144 (exception_x86_64_bnd_test_SOURCES): New macro.
1145 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1146 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1147 (exception_x86_64_bnd_test_LDADD): Likewise.
1148 (exception_x86_64_bnd_1.o): New rule.
1149 (exception_x86_64_bnd_2.o): Likewise.
1150 * testsuite/Makefile.in: Regenerated.
1152 2013-11-15 Alan Modra <amodra@gmail.com>
1154 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1156 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1157 Only call ppc64_local_entry_offset for 64-bit. Restrict
1158 symval_for_branch lookup to ELFv1.
1159 (Stub_table::add_plt_call_entry): Use unsigned int off.
1160 (Output_data_glink::Address, invalid_address): New.
1161 (Output_data_glink::add_eh_frame): Move out of line. Add
1163 (Output_data_glink::add_global_entry, find_global_entry,
1164 global_entry_address): New functions.
1165 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1166 ge_size): New variables.
1167 (Output_data_glink::set_final_data_size): Add global entry
1169 (Output_data_glink::do_write): Write global entry stubs.
1170 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1171 parameter. Return true for ELFv2. Adjust callers.
1172 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1173 ELFv1. Similarly for ifunc and dynamic relocation processing
1174 specific to ELFv1. Recognize that symbols are defined on
1175 their plt entries for ELFv2.
1176 (Target_powerpc::symval_for_branch): Assert if called for
1178 (Target_powerpc::Relocate::relocate): Use global entry plt
1179 stub for symbol value if such exists on ELFv2.
1180 (Target_powerpc::Relocate::relocate): Don't call
1181 symval_for_branch when ELFv2. Do adjust for local entry
1183 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1185 (Target_powerpc::do_plt_address_for_global): Similarly.
1187 2013-11-14 Cary Coutant <ccoutant@google.com>
1189 Revert patch -- this did not fix the problem, and there is
1192 2013-11-14 Cary Coutant <ccoutant@google.com>
1195 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1196 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1197 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1198 updating fde_offsets_.
1199 (Eh_frame_hdr::lock_): New data member.
1201 2013-11-14 Cary Coutant <ccoutant@google.com>
1203 * dwp.cc (Dwo_file_entry): New type.
1204 (File_list): Use Dwo_file_entry.
1205 (Dwo_file::verify): New function.
1206 (Dwo_file::verify_dwo_list): New function.
1207 (Dwo_file::sized_verify_dwo_list): New function.
1208 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1210 (Dwp_options): New enum type.
1211 (dwp_options): Add --verify-only.
1214 * dwp.h (gold_info): Add declaration.
1216 2013-11-14 Cary Coutant <ccoutant@google.com>
1219 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1220 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1221 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1222 updating fde_offsets_.
1223 (Eh_frame_hdr::lock_): New data member.
1225 2013-11-06 Cary Coutant <ccoutant@google.com>
1228 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1229 before reloc sections.
1231 2013-11-04 Alan Modra <amodra@gmail.com>
1233 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1234 (Symbol::needs_dynamic_reloc): Test new flag.
1235 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1236 (Target_powerpc::Scan::get_reference_flags): Add target param.
1237 Return FUNC_DESC_ABI for 64-bit ELFv1.
1238 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1240 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1241 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1243 2013-10-31 Cary Coutant <ccoutant@google.com>
1245 Restore support for dwp v2 DWARF package file format.
1247 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1248 tu_length parameter. Adjust all callers.
1249 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1250 * dwp.cc: Include dwarf.h.
1251 (Section_bounds): New struct type.
1252 (Unit_set): New struct type.
1253 (Dwo_file::Dwo_file): Initialize new data member.
1254 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1255 Combine and rename to...
1256 (Dwo_file::read_unit_index): ...this.
1257 (Dwo_file::sized_read_compunit_index)
1258 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1259 (Dwo_file::sized_read_unit_index): ...this.
1260 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1261 parameters; add section_id parameter.
1262 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1263 (Dwo_file::add_unit_set): ...this.
1264 (Dwo_file::shndx_map_): Remove.
1265 (Dwo_file::sect_offsets_): New data member.
1266 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1267 (Dwp_output_file::add_section): Rename to...
1268 (Dwp_output_file::add_contribution): ...this.
1269 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1270 (Dwp_output_file::add_tu_set): Likewise.
1271 (Dwp_output_file::Contribution): New type.
1272 (Dwp_output_file::Section::contributions): New data member.
1273 (Dwp_output_file::Cu_or_tu_set): Remove.
1274 (Dwp_output_file::Section::Section): New ctor.
1275 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1276 (Dwp_output_file::Dwp_index::Section_table): New type.
1277 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1278 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1280 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1281 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1282 (Dwp_output_file::Dwp_index::section_table): New member function.
1283 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1284 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1285 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1286 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1287 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1288 (Dwp_output_file::Dwp_index::section_table_): New data member.
1289 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1290 (Dwp_output_file::add_output_section): New member function.
1291 (Dwp_output_file::write_new_section): New member function.
1292 (Dwp_output_file::write_contributions): New member function.
1293 (Dwp_output_file::section_id_map_): New data member.
1294 (class Dwo_id_info_reader): Remove.
1295 (class Unit_reader): New class.
1296 (get_dwarf_section_name): New function.
1297 (Dwo_file::read_executable): Adjust initializations of class data.
1298 (Dwo_file::read): Add support for v2 package file format.
1299 (Dwo_file::read_unit_index): Likewise.
1300 (Dwo_file::sized_read_unit_index): Likewise.
1301 (Dwo_file::copy_section): Likewise.
1302 (Dwo_file::add_unit_set): Likewise.
1303 (Dwp_output_file::add_output_section): Likewise.
1304 (Dwp_output_file::add_contribution): Likewise.
1305 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1307 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1309 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1311 (Dwp_output_file::initialize): Remove unused function.
1312 (Dwp_output_file::finalize): Add support for v2 package file format.
1313 (Dwp_output_file::write_index): Likewise.
1314 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1317 2013-10-31 Cary Coutant <ccoutant@google.com>
1319 * configure.ac: Fix check for -fmerge-constants.
1320 * configure.ac: Regenerate.
1322 2013-10-30 Roland McGrath <mcgrathr@google.com>
1324 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1325 Correct 9-byte nop sequence to match what the assembler generates.
1327 2013-10-30 Alan Modra <amodra@gmail.com>
1329 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1330 ppc64_local_entry_offset, ppc64_local_entry_offset,
1331 do_read_symbols): New functions.
1332 (Powerpc_relobj::e_flags_, st_other_): New vars.
1333 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1334 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1335 (Powerpc_relobj::e_flags_): New var.
1336 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1337 and adjust for ELFv2.
1338 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1339 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1340 (Powerpc_dynobj::do_find_special_sections): Likewise.
1341 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1342 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1343 to ELFv2 local entry.
1344 (Target_powerpc::do_relax): No thread safe barriers needed for
1346 (Output_data_plt_powerpc::initial_plt_entry_size_,
1347 plt_entry_size): Delete. Replace all uses with
1348 first_plt_entry_offset() and plt_entry_size().
1349 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1350 reserved_size parm. Update callers.
1351 (Output_data_plt_powerpc::entry_count): Update.
1352 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1353 and use Target_powerpc::first_plt_entry_offset().
1354 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1355 rename to plt_entry_size.
1356 (Output_data_plt_powerpc::add_ifunc_entry,
1357 add_local_ifunc_entry): Adjust reloc for ELFv2.
1358 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1359 (glink_eh_frame_fde_64v2): New.
1360 (Stub_table::plt_call_size): Support ELFv2 sizing.
1361 (Output_data_glink::add_eh_frame): Use the new FDE.
1362 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1363 (Stub_table::do_write): Write ELFv2 stubs and glink.
1364 (Target_powerpc::Relocate::relocate): Replaces nop after call
1365 with ld 2,24(1) and adjust local offset destination for ELFv2.
1367 2013-10-30 Alan Modra <amodra@gmail.com>
1369 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1370 (Target_powerpc::Scan::global, local): Likewise.
1371 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1372 on all ppc64 @h and @ha relocs.
1374 2013-10-14 Alan Modra <amodra@gmail.com>
1376 * output.h (Output_data_got::add_constant): Tidy.
1377 (Output_data_got::add_constant_pair): New function.
1378 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1379 methods used so as to first call reserve_ent().
1381 2013-10-11 Roland McGrath <mcgrathr@google.com>
1383 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1384 add_got_entry and add_got_entry_pair.
1386 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1387 (HAVE_PUBNAMES): Likewise.
1388 * configure: Regenerate.
1390 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1391 * testsuite/Makefile.in: Regenerate.
1393 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1394 Remove const from declaration.
1395 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1396 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1397 * output.h (Output_file_header): Remove const from member target_
1398 and corresponding constructor argument.
1399 * output.cc (Output_file_header::Output_file_header): Update prototype.
1400 (Output_file_header::do_sized_write): Use this->target_ in place
1401 of parameters()->target().
1403 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1405 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1406 * configure: Regenerate.
1407 * Makefile.in: Regenerate.
1408 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1409 * testsuite/merge_string_literals_2.c: Likewise.
1410 * testsuite/Makefile.am
1411 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1412 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1413 literal -fmerge-constants.
1414 * testsuite/Makefile.in: Regenerate.
1416 * i386.cc (Target_i386): Remove unused member dynbss_.
1417 * arm.cc (Target_arm): Likewise.
1418 * powerpc.cc (Target_powerpc): Likewise.
1419 * sparc.cc (Target_sparc): Likewise.
1420 * tilegx.cc (Target_tilegx): Likewise.
1421 * x86_64.cc (Target_x86_64): Likewise.
1422 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1423 type_signature_, type_offset_.
1424 * plugin.h (Plugin_hook): Remove unused member layout_.
1425 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1427 (Read_member): Remove unused members input_objects_, symtab_,
1429 (Check_library): Remove unused member symtab_.
1430 * archive.h (Lib_group): Remove unused member lib_.
1431 * archive.cc (Lib_group::Lib_group): Update initializer.
1432 * incremental.h (Incremental_binary): Remove unused member target_.
1433 (Incremental_script_entry): Removed unused member script_.
1434 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1435 * icf.h (Icf): Remove unused member num_tracked_relocs.
1437 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1438 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1440 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1442 * archive.h: Use struct rather than class for forward declaration
1443 of Read_symbols_data.
1445 2013-10-07 Cary Coutant <ccoutant@google.com>
1448 * testsuite/Makefile.am (icf_test): Fix dependencies.
1449 (icf_safe_test): Likewise.
1450 (icf_safe_so_test): Likewise.
1451 (large_symbol_alignment): Add empty _LDADD rule.
1452 * testsuite/Makefile.in: Regenerate.
1454 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1457 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1458 relocation for R_X86_64_32 on x32.
1460 2013-08-27 Roland McGrath <mcgrathr@google.com>
1462 * output.cc (Output_segment::set_section_addresses): Take new
1463 Target* argument. If target->isolate_execinstr() and the segment
1464 is executable and starts at a target->abi_pagesize() boundary,
1465 pad its end out to a target->abi_pagesize() boundary with code fill.
1466 * output.h (Output_segment::set_section_addresses): Update decl.
1467 * layout.h (Layout::check_output_data_for_reset_values): Take new
1468 argument RELAX_OUTPUTS.
1469 (Layout): New member relax_output_list_.
1470 (Layout::add_relax_output): New method.
1471 * layout.cc (Layout::Layout): Update constructor.
1472 (Layout::reset_relax_output): New method.
1473 (Layout::clean_up_after_relaxation): Call it.
1474 (Layout::prepare_for_relaxation): Update caller.
1475 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1476 Call reset_relax_output before re-processing segments for
1477 isolate_execinstr case.
1478 (Layout::write_data): Handle relax_output_list_.
1479 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1480 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1482 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1485 * object.h: Fix typos.
1487 2013-08-16 Roland McGrath <mcgrathr@google.com>
1489 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1490 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1492 2013-08-07 Cary Coutant <ccoutant@google.com>
1494 Revert support for v2 DWP files:
1496 2013-03-01 Cary Coutant <ccoutant@google.com>
1498 Add dwp support for v2 DWARF package file format.
1499 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1500 tu_length parameter. Adjust all callers.
1501 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1502 * dwp.cc: Include dwarf.h.
1503 (Section_bounds): New struct type.
1504 (Unit_set): New struct type.
1505 (Dwo_file::Dwo_file): Initialize new data member.
1506 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1507 Combine and rename to...
1508 (Dwo_file::read_unit_index): ...this.
1509 (Dwo_file::sized_read_compunit_index)
1510 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1511 (Dwo_file::sized_read_unit_index): ...this.
1512 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1513 parameters; add section_id parameter.
1514 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1515 (Dwo_file::add_unit_set): ...this.
1516 (Dwo_file::shndx_map_): Remove.
1517 (Dwo_file::sect_offsets_): New data member.
1518 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1519 (Dwp_output_file::add_section): Rename to...
1520 (Dwp_output_file::add_contribution): ...this.
1521 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1522 (Dwp_output_file::add_tu_set): Likewise.
1523 (Dwp_output_file::Contribution): New type.
1524 (Dwp_output_file::Section::contributions): New data member.
1525 (Dwp_output_file::Cu_or_tu_set): Remove.
1526 (Dwp_output_file::Section::Section): New ctor.
1527 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1528 (Dwp_output_file::Dwp_index::Section_table): New type.
1529 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1530 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1532 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1533 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1534 (Dwp_output_file::Dwp_index::section_table): New member function.
1535 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1536 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1537 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1538 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1539 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1540 (Dwp_output_file::Dwp_index::section_table_): New data member.
1541 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1542 (Dwp_output_file::add_output_section): New member function.
1543 (Dwp_output_file::write_new_section): New member function.
1544 (Dwp_output_file::write_contributions): New member function.
1545 (Dwp_output_file::section_id_map_): New data member.
1546 (class Dwo_id_info_reader): Remove.
1547 (class Unit_reader): New class.
1548 (get_dwarf_section_name): New function.
1549 (Dwo_file::read_executable): Adjust initializations of class data.
1550 (Dwo_file::read): Add support for v2 package file format.
1551 (Dwo_file::read_unit_index): Likewise.
1552 (Dwo_file::sized_read_unit_index): Likewise.
1553 (Dwo_file::copy_section): Likewise.
1554 (Dwo_file::add_unit_set): Likewise.
1555 (Dwp_output_file::add_output_section): Likewise.
1556 (Dwp_output_file::add_contribution): Likewise.
1557 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1559 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1561 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1563 (Dwp_output_file::initialize): Remove unused function.
1564 (Dwp_output_file::finalize): Add support for v2 package file format.
1565 (Dwp_output_file::write_index): Likewise.
1566 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1569 2013-07-31 Cary Coutant <ccoutant@google.com>
1571 * object.cc (Sized_relobj::do_output_section_address): New function.
1572 (Sized_relobj): Instantiate explicitly.
1573 * object.h (Object::output_section_address): New function.
1574 (Object::do_output_section_address): New function.
1575 (Sized_relobj::do_output_section_address): New function.
1576 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1578 2013-07-30 Cary Coutant <ccoutant@google.com>
1579 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1581 * parameters.cc (Parameters::entry): Return target-specific entry
1583 * target.h (Target::entry_symbol_name): New function.
1584 (Target_info::entry_symbol_name): New data member.
1586 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1587 * i386.cc (Target_i386::i386_info): Likewise.
1588 (Target_i386_nacl::i386_nacl_info): Likewise.
1589 * sparc.cc (Target_sparc::sparc_info): Likewise.
1590 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1591 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1592 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1593 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1595 2013-07-22 Sterling Augustine <saugustine@google.com>
1597 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1598 Convert parameter shndx to local variable. Add parameters symtab
1599 and symtab_size. Scan over section names. Find relocation
1600 section corresponding to current section. Create and initialize
1601 reloc_mapper_ and reloc_type_.
1602 (Dwarf_pubnames_table::read_header): Add assertion. Change
1603 unit_length to off_t. Initialize member unit_length_. Fill in field
1605 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1606 Initialize new fields unit_length_ and cu_offset_.
1607 (Dwarf_pubnames_table::read_section): Update prototype.
1608 (Dwarf_pubnames_table::cu_offset): New member function.
1609 (Dwarf_pubnames_table::subsection_size): Likewise.
1610 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1612 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1613 member functions public.
1614 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1615 Update comment. Rework logic. Move repeated parts to...
1616 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1617 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1618 pubtypes_table_, and stmt_list_offset.
1619 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1620 Gdb_index::find_pubtype_offset,
1621 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1622 (Gdb_index::pubnames_read): Update prototype and rework logic.
1623 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1625 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1626 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1627 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1628 Gdb_index::map_pubtable_to_dies):
1630 (Gdb_index::pubnames_read): Update declaration.
1631 (Gdb_index::Pubname_offset_map): New type.
1632 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1633 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1634 Gdb_index::stmt_list_offset): Declare.
1635 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1636 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1637 Gdb_index::pubtypes_offset_): Remove.
1639 2013-07-19 Roland McGrath <mcgrathr@google.com>
1641 * options.h (General_options): Add -Trodata-segment option.
1642 * parameters.cc (Parameters::check_rodata_segment): New function.
1643 (Parameters::set_target_once): Call it.
1644 * parameters.h (Parameters): Declare it (private member function).
1645 * layout.cc (load_seg_unusable_for_headers): New function, broken
1646 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1647 then validate rodata segment rather than text segment.
1648 (relaxation_loop_body): Call that.
1649 (is_text_segment): New function. Don't admit a non-executable
1650 segment if TARGET->isolate_execinstr().
1651 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1653 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
1656 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1657 * nacl.h (Sniff_file::View::View): Request aligned view.
1659 2013-07-11 Cary Coutant <ccoutant@google.com>
1661 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1662 correct BRLT entry size.
1664 2013-07-03 Alan Modra <amodra@gmail.com>
1666 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1669 2013-07-01 Cary Coutant <ccoutant@google.com>
1671 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1673 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1674 (Dwarf_ranges_table::lookup_reloc): New function.
1675 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1677 (Dwarf_ranges_table::lookup_reloc): New function.
1678 (Dwarf_ranges_table::reloc_type_): New data member.
1680 2013-06-27 Jing Yu <jingyu@google.com>
1683 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1685 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1686 (Target_powerpc::do_relax): Call the above.
1688 2013-06-27 Cary Coutant <ccoutant@google.com>
1690 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1691 on garbage collected .opd section.
1693 2013-06-27 Alan Modra <amodra@gmail.com>
1695 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1697 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1698 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1700 2013-06-14 Cary Coutant <ccoutant@google.com>
1702 * resolve.cc (Symbol::override_base): Don't override st_type
1703 from plugin placeholder symbols.
1704 (Symbol_table::resolve): Likewise.
1705 (Symbol_table::should_override): Don't complain about TLS mismatch
1706 if the TO symbol is a plugin placeholder.
1707 * testsuite/Makefile.am (plugin_test_tls): New test.
1708 * testsuite/Makefile.in: Regenerate.
1709 * testsuite/plugin_test_tls.sh: New test script.
1710 * testsuite/two_file_test_2_tls.cc: New test source.
1711 * testsuite/two_file_test_tls.cc: New test source.
1713 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1715 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1716 the maximum segment alignment is larger than the page size.
1717 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1718 correctly aligns the symbols with large alignemnt.
1719 * testsuite/Makefile.in: Regenerate.
1720 * testsuite/large_symbol_alignment.cc: New file.
1722 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1723 Sriraman Tallam <tmsriram@google.com>
1725 * options.h (sort_section): New option.
1726 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1727 Rename from Input_section_sort_section_name_special_ordering_compare.
1728 (Input_section_sort_section_name_compare): New struct.
1729 * output.cc (Output_section::Input_section_sort_section_name_compare::
1730 operator()): New function.
1731 (Output_section::sort_attached_input_sections): Use new sort function
1732 for .text if --sort-section=name is specified.
1733 * layout.cc (Layout::make_output_section):
1734 Add sorting by name when --sort-section=name is specified.
1735 * testsuite/Makefile.am (text_section_grouping): Test option
1736 --sort-section=name.
1737 * testsuite/Makefile.in: Regenerate.
1738 * testsuite/section_sorting_name.cc: New file.
1739 * testsuite/section_sorting_name.sh: New file.
1741 2013-05-21 Cary Coutant <ccoutant@google.com>
1743 * symtab.h (Symbol::is_cxx_vtable): New function.
1744 * target-reloc.h (relocate_section): Check for vtable symbol.
1745 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1746 * testsuite/Makefile.in: Regenerate.
1747 * testsuite/missing_key_func.cc: New test source.
1748 * testsuite/missing_key_func.sh: New test script.
1750 2013-05-21 Cary Coutant <ccoutant@google.com>
1752 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1753 type of enclosing symbol.
1754 (Relocate_info::location): Check symbol type when describing symbol.
1755 * object.h (Symbol_location_info): Remove unused line_number;
1756 add enclosing_symbol_type.
1757 * testsuite/debug_msg.sh: Adjust expected output.
1759 2013-05-13 Cary Coutant <ccoutant@google.com>
1761 * configure.ac: Export DEFAULT_TARGET.
1762 * configure: Regenerate.
1763 * Makefile.in: Regenerate.
1764 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1765 * testsuite/Makefile.in: Regenerate.
1766 * testsuite/debug_msg.sh: Delete duplicate tests.
1767 Don't check undef_int error message match for powerpc where the
1768 source file and line number aren't available.
1770 2013-05-10 Roland McGrath <mcgrathr@google.com>
1772 * options.h (General_options): Add --rosegment-gap option.
1773 * options.cc (finalize): --rosegment-gap implies --rosegment.
1774 * layout.cc (set_segment_offsets): Let user option override
1775 target->rosegment_gap().
1777 2013-05-10 Roland McGrath <mcgrathr@google.com>
1779 * options.h (General_options): Remove leading space from help
1780 messages for -nostdlib and --rosegment.
1782 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1785 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1787 2013-05-03 Alan Modra <amodra@gmail.com>
1789 * merge.cc (Output_merge_string::do_add_input_section): Correct
1790 scan for number of strings. Rename vars to avoid shadowing.
1791 Include missing terminator in input_size_.
1793 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1795 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1796 Restore empty string handling.
1798 2013-05-01 Cary Coutant <ccoutant@google.com>
1800 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1801 uninitialized warning.
1803 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1805 * output.cc (Output_section::add_merge_input_section): Allow
1806 to merge sections if the alignment is more than character size.
1807 * merge.h (Output_merge_string::Output_merge_string): Remove
1809 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1810 only not-null strings. Check the alignment of strings.
1812 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1813 alignment as the argument.
1814 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1815 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1816 Align non-zero length strings according to the addralign_.
1817 (Stringpool_template<Stringpool_char>::set_string_offsets):
1818 Updating offsets according to the given alignment.
1819 * testsuite/Makefile.am (text_section_grouping): Test if string
1820 literals are getting merged.
1821 * testsuite/Makefile.in: Regenerate.
1822 * testsuite/merge_string_literals_1.c: New file.
1823 * testsuite/merge_string_literals_2.c: Ditto.
1824 * testsuite/merge_string_literals.sh: Ditto.
1826 2013-04-26 Ian Lance Taylor <iant@google.com>
1828 * target-reloc.h (relocate_section): If the reloc offset is out of
1829 range, pass VIEW as NULL to relocate.relocate.
1830 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1831 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1832 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1833 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1834 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1835 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1837 2013-04-26 Geoff Pike <gpike@chromium.org>
1839 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1840 * layout.cc (Hash_task): New class.
1841 (Layout::queue_build_id_tasks): New function.
1842 (Layout::write_build_id): Handle single-thread portion of build ID
1843 computation. (In some cases, all of it is single-threaded.) Replace
1844 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1845 functionality in fewer lines of code.
1846 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1847 * options.h (General_options): make "--build-id" default to tree
1848 rather than sha1. Add two new options related to --build-id=tree:
1849 --build-id-chunk-size-for-treehash and
1850 --build-id-min-file-size-for-treehash.
1851 * Makefile.am: add testing of --build-id=tree and related new options
1852 (these tests will be invoked by "make check").
1853 * Makefile.in: Regenerate.
1855 2013-04-25 Alan Modra <amodra@gmail.com>
1857 * configure.tgt: Add powerpcle and powerpc64le.
1859 2013-04-22 Alan Modra <amodra@gmail.com>
1862 * layout.cc (Layout::segment_precedes): Allow more than one
1863 segment with the same type and flags.
1865 2013-04-15 Cary Coutant <ccoutant@google.com>
1867 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1868 allocate space in file for BSS sections.
1870 2013-04-15 Cary Coutant <ccoutant@google.com>
1872 * script-sections.cc (Orphan_output_section): Reset address
1873 to zero after each orphaned section for relocatable links.
1875 2013-04-15 Cary Coutant <ccoutant@google.com>
1877 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1878 section starting address for relocatable link.
1879 * testsuite/Makefile.am (script_test_11): New test.
1880 * testsuite/Makefile.in: Regenerate.
1881 * testsuite/script_test_11.c: New source file.
1882 * testsuite/script_test_11.t: New linker script.
1884 2013-04-13 Alan Modra <amodra@gmail.com>
1886 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1887 owner when sections are not adjacent and exceed group size.
1888 (Target_powerpc::group_sections): Handle corner case.
1889 (Target_powerpc::Branch_info::make_stub): Handle case where
1890 stub table doesn't exist due to branches in non-exec sections.
1891 (Target_powerpc::Relocate::relocate): Likewise.
1893 2013-04-11 Alan Modra <amodra@gmail.com>
1896 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1897 .branch_lt to match bfd ld. Adjust comments throughout file.
1899 2013-04-04 Ian Lance Taylor <iant@google.com>
1902 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1903 sections before checking whether they are included in the link.
1905 2013-03-29 Sriraman Tallam <tmsriram@google.com>
1907 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1908 object before calling the plugin claim_file handler. Pass the elf
1909 object of the archive to the plugin. Delete the elf object if the
1910 plugin claims the file.
1912 2013-03-21 Alan Modra <amodra@gmail.com>
1914 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1915 segment when omagic.
1917 2013-03-21 Alan Modra <amodra@gmail.com>
1919 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1921 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1922 uninitialized" warning.
1924 2013-03-20 Alan Modra <amodra@gmail.com>
1926 * symtab.h (Symbol::clear_version): New function.
1927 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1928 is_needed by weak references. Clear version for symbols defined
1929 in as-needed objects that are not needed.
1931 2013-03-15 Alan Modra <amodra@gmail.com>
1933 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1934 static and public. Add report_err param. Return false for data refs.
1935 (Target_powerpc::rela_dyn_section): New overloaded function.
1936 (Target_powerpc::plt_, iplt_): Elucidate.
1937 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1938 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1939 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1940 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1941 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1942 push_branch and make_plt_entry for ifunc syms when
1943 reloc_needs_plt_for_ifunc.
1944 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1945 for ifunc unless reloc_needs_plt_for_ifunc.
1947 2013-03-15 Alan Modra <amodra@gmail.com>
1949 * gc.h (gc_process_relocs): Don't look through function descriptors.
1950 * icf.cc (get_section_contents): Do so here instead.
1952 2013-03-13 Alan Modra <amodra@gmail.com>
1954 * powerpc.cc (is_branch_reloc): Forward declare.
1955 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1956 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1957 false for 64-bit, true for 32-bit non-branch relocs.
1958 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1959 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1961 (icf_safe_test): Generate linker map file as well as nm output.
1962 (icf_safe_so_test): Likewise.
1963 * testsuite/Makefile.in: Regenerate.
1964 * testsuite/icf_test.sh: Parse linker map file to determine
1966 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1967 * testsuite/icf_safe_so_test.sh: Likewise.
1968 (X86_32_or_ARM_specific_safe_fold): Merge into..
1969 (arch_specific_safe_fold): ..this.
1970 (X86_64_specific_safe_fold): Delete unused function.
1972 2013-03-12 Alan Modra <amodra@gmail.com>
1974 * gc.h (gc_process_relocs): Look through function descriptors
1975 to determine shndx, symvalue and addend used by ICF. Tidy
1976 variable duplication.
1978 2013-03-11 Alan Modra <amodra@gmail.com>
1980 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1981 * layout.cc (Layout_task_runner::run): ..to here.
1982 * symtab.h (struct Symbol_location): Extract from..
1983 (class Symbol_table): ..here.
1984 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1985 * target.h (class Target): Add function_location and
1986 do_function_location functions.
1987 (class Sized_target): Add do_function_location.
1988 * object.h (class Sized_relobj_file): Move find_shdr..
1989 (class Object): ..to here.
1990 * object.cc: Likewise. Update to suit. Instantiate.
1991 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1992 * powerpc.cc (class Powerpc_dynobj): New.
1993 (Target_powerpc::do_function_location): New function.
1994 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1995 (Powerpc_dynobj::do_read_symbols): New function.
1996 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1998 2013-03-08 Ian Lance Taylor <iant@google.com>
2000 * options.cc (General_options::string_to_object_format): Accept
2003 2013-03-08 Alan Modra <amodra@gmail.com>
2005 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2006 pointer to Post_fde.
2007 (struct Post_fde): Move definition to here..
2008 * ehframe.cc (struct Post_fde): ..from here.
2009 (Cie::write): Don't alloc Post_fde.
2010 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2012 2013-03-07 Alan Modra <amodra@gmail.com>
2014 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2015 relocation referencing .LC0.
2016 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2018 2013-03-07 Alan Modra <amodra@gmail.com>
2020 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2021 always_inline. Add assembly for powerpc to avoid GOT.
2023 2013-03-07 Alan Modra <amodra@gmail.com>
2025 * testsuite/script_test_10.sh: Don't test .bss section
2028 2013-03-06 Alan Modra <amodra@gmail.com>
2030 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2031 (Target_powerpc::symval_for_branch): Add symtab param. Update
2032 all callers. Handle folded sections.
2033 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2035 (Global_symbol_visitor_opd::operator()): Likewise.
2037 2013-03-04 Alan Modra <amodra@gmail.com>
2039 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2040 * testsuite/Makefile.in: Regenerate.
2042 2013-03-01 Cary Coutant <ccoutant@google.com>
2044 Add dwp support for v2 DWARF package file format.
2045 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2046 tu_length parameter. Adjust all callers.
2047 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2048 * dwp.cc: Include dwarf.h.
2049 (Section_bounds): New struct type.
2050 (Unit_set): New struct type.
2051 (Dwo_file::Dwo_file): Initialize new data member.
2052 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2053 Combine and rename to...
2054 (Dwo_file::read_unit_index): ...this.
2055 (Dwo_file::sized_read_compunit_index)
2056 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2057 (Dwo_file::sized_read_unit_index): ...this.
2058 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2059 parameters; add section_id parameter.
2060 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2061 (Dwo_file::add_unit_set): ...this.
2062 (Dwo_file::shndx_map_): Remove.
2063 (Dwo_file::sect_offsets_): New data member.
2064 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2065 (Dwp_output_file::add_section): Rename to...
2066 (Dwp_output_file::add_contribution): ...this.
2067 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2068 (Dwp_output_file::add_tu_set): Likewise.
2069 (Dwp_output_file::Contribution): New type.
2070 (Dwp_output_file::Section::contributions): New data member.
2071 (Dwp_output_file::Cu_or_tu_set): Remove.
2072 (Dwp_output_file::Section::Section): New ctor.
2073 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2074 (Dwp_output_file::Dwp_index::Section_table): New type.
2075 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2076 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2078 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2079 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2080 (Dwp_output_file::Dwp_index::section_table): New member function.
2081 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2082 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2083 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2084 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2085 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2086 (Dwp_output_file::Dwp_index::section_table_): New data member.
2087 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2088 (Dwp_output_file::add_output_section): New member function.
2089 (Dwp_output_file::write_new_section): New member function.
2090 (Dwp_output_file::write_contributions): New member function.
2091 (Dwp_output_file::section_id_map_): New data member.
2092 (class Dwo_id_info_reader): Remove.
2093 (class Unit_reader): New class.
2094 (get_dwarf_section_name): New function.
2095 (Dwo_file::read_executable): Adjust initializations of class data.
2096 (Dwo_file::read): Add support for v2 package file format.
2097 (Dwo_file::read_unit_index): Likewise.
2098 (Dwo_file::sized_read_unit_index): Likewise.
2099 (Dwo_file::copy_section): Likewise.
2100 (Dwo_file::add_unit_set): Likewise.
2101 (Dwp_output_file::add_output_section): Likewise.
2102 (Dwp_output_file::add_contribution): Likewise.
2103 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2105 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2107 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2109 (Dwp_output_file::initialize): Remove unused function.
2110 (Dwp_output_file::finalize): Add support for v2 package file format.
2111 (Dwp_output_file::write_index): Likewise.
2112 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2115 2013-03-01 Cary Coutant <ccoutant@google.com>
2117 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2118 function into class definition in header file.
2119 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2120 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2122 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2124 2013-02-28 Alan Modra <amodra@gmail.com>
2126 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2127 * target.cc (Target::do_plt_fde_location): New function.
2128 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2129 accessor function, and constructor param.
2130 (struct Post_fde, Post_fdes): Declare.
2131 (Cie::write): Add post_fdes param.
2132 * ehframe.cc (Fde::write): Use plt_fde_location.
2133 (struct Post_fde): Define.
2134 (Cie::write): Stash FDEs added post merge mapping.
2135 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2136 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2137 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2139 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2140 (Target_powerpc::has_glink): New function.
2141 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2142 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2143 glink_eh_frame_fde_32, default_fde): New data.
2144 (Stub_table::eh_frame_added_): New var.
2145 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2147 (Stub_table::add_eh_frame): New function.
2148 (Output_data_glink::add_eh_frame): New function.
2149 (Target_powerpc::make_glink_section): Call add_eh_frame.
2151 2013-02-15 Ian Lance Taylor <iant@google.com>
2153 * options.h (DEFINE_uint64_alias): Define.
2154 (class General_options): Add -Ttext-segment as an alias for
2157 2013-02-15 Alan Modra <amodra@gmail.com>
2159 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2160 (Stub_table::do_write): ..here, two places.
2161 (Stub_table::plt_call_size): Use it here too.
2163 2013-02-11 Ian Lance Taylor <iant@google.com>
2165 * descriptors.cc (Descriptors::close_all): New function.
2166 * descriptors.h (class Descriptors): Declare close_all.
2167 (close_all_descriptors): New inline function.
2168 * plugin.cc: Include "descriptors.h".
2169 (Plugin_manager::cleanup): Call close_all_descriptors.
2171 2013-02-06 Alan Modra <amodra@gmail.com>
2173 * README: Update coding style link.
2175 2013-01-28 Cary Coutant <ccoutant@google.com>
2177 * dwp.cc (File_list): New typedef.
2178 (Dwo_name_info_reader): New class.
2179 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2180 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2181 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2182 (Dwo_file::read_executable): New function.
2183 (Dwo_file::read): Move common setup code to ...
2184 (Dwo_file::make_object): ... here.
2185 (dwp_options): Add --exec/-e.
2189 2013-01-24 Sriraman Tallam <tmsriram@google.com>
2191 * layout.cc (Layout::layout): Check for option text_reorder.
2192 (Layout::make_output_section): Ditto.
2193 * options.h (text_reorder): New option.
2194 * output.cc (Input_section_sort_compare): Remove special ordering
2197 Input_section_sort_section_name_special_ordering_compare::
2198 operator()): New function.
2199 (Output_section::sort_attached_input_sections): Use new sort function
2201 * output.h (Input_section_sort_section_name_special_ordering_compare):
2203 * testsuite/Makefile.am (text_section_grouping): Test option
2205 * testsuite/Makefile.in: Regenerate.
2206 * testsuite/text_section_grouping.sh: Check order of functions without
2207 default text reordering.
2209 2013-01-18 Mike Frysinger <vapier@gentoo.org>
2211 * options.h (General_options): Change default to true for new_dtags.
2213 2013-01-18 Mike Frysinger <vapier@gentoo.org>
2215 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2216 when enable_new_dtags is false. Only add DT_RUNPATH when
2217 enable_new_dtags is true.
2219 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2221 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2222 used in declaration and definition consistent.
2223 (Target_powerpc::symval_for_branch): Ditto.
2225 2013-01-16 Sriraman Tallam <tmsriram@google.com>
2227 * testsuite/plugin_final_layout.cc: Fix comment.
2229 2013-01-16 Sriraman Tallam <tmsriram@google.com>
2231 * layout.cc (Layout::layout): Do not do default sorting for
2232 text sections when section ordering is specified.
2233 (make_output_section): Ditto.
2234 * testsuite/plugin_final_layout.cc: Name the function sections
2235 to catch reordering issues.
2237 2013-01-15 Alan Modra <amodra@gmail.com>
2239 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2242 2013-01-15 Alan Modra <amodra@gmail.com>
2244 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2245 * testsuite/Makefile.in: Regenerate.
2247 2013-01-14 Alan Modra <amodra@gmail.com>
2249 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2250 * testsuite/Makefile.in: Regenerate.
2252 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2255 Fix mingw gold build with plugins enabled
2256 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2257 * configure.ac: Export DLOPEN_LIBS and add headers check.
2258 * plugin.cc: Handle non-dlfcn case.
2259 * Makefile.in: Regenerate.
2260 * config.in: Regenerate.
2261 * configure: Regenerate.
2262 * testsuite/Makefile.in: Regenerate.
2264 2013-01-09 Sriraman Tallam <tmsriram@google.com>
2266 * output.h (sort_attached_input_sections): Change to be public.
2267 * script-sections.cc
2268 (Output_section_definition::set_section_addresses): Sort
2269 attached input sections according to section order before linker
2270 script assigns section addresses.
2271 (Orphan_output_section::set_section_addresses): Sort
2272 attached input sections according to section order before linker
2273 script assigns section addresses.
2274 * Makefile.am (final_layout.sh): Use a simple linker script to
2275 check if section ordering still works.
2276 * Makefile.in: Regenerate.
2278 2013-01-09 Ben Cheng <bccheng@google.com>
2280 * arm.cc (Target_arm::attributes_accept_div): New function.
2281 (Target_arm::attributes_forbid_div): New function.
2282 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2283 attribute using the same new functions as what bfd/elf32_arm.c
2286 2013-01-07 Cary Coutant <ccoutant@google.com>
2289 * output.cc (Output_section::add_input_section): For incremental
2290 updates, don't track input sections that are allocated from patch
2293 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2294 Ian Lance Taylor <iant@google.com>
2297 * configure.ac (--enable-ld): Removed.
2298 (install_as_default): Set to yes only for --enable-gold=default
2300 * configure: Regenerated.
2302 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2304 * options.h (General_options): Add -fuse-ld= for GCC linker
2305 option compatibility.
2307 2013-01-04 Cary Coutant <ccoutant@google.com>
2309 * configure.ac: Fix typo restoring CXXFLAGS.
2310 * configure: Regenerate.
2312 2013-01-04 Cary Coutant <ccoutant@google.com>
2314 * testsuite/Makefile.am (CXXLINK_S): New macro.
2315 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2316 * testsuite/Makefile.in: Regenerate.
2318 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2320 * version.cc (print_version): Update copyright year to 2013.
2322 2012-12-20 Ian Lance Taylor <iant@google.com>
2324 * layout.cc (Layout::special_ordering_of_input_section): New
2326 (Layout::layout): If input section requires special ordering, must
2327 sort input sections.
2328 (Layout::make_output_section): May sort .text input sections.
2329 (Layout::is_section_name_prefix_grouped): Remove.
2330 * layout.h (class Layout): Declare
2331 special_ordering_of_input_section. Don't declare
2332 is_section_name_prefix_grouped.
2333 * output.cc (Output_section::add_input_section): Revert last
2335 (Output_section::Input_section_sort::match_file_name): Don't crash
2336 if called on output section data.
2337 (Output_section::Input_section_sort_compare): Sort based on
2339 (Output_section::Input_section_sort_section_order_index_compare):
2341 (Output_section::sort_attached_input_sections): Likewise.
2343 2012-12-18 Sriraman Tallam <tmsriram@google.com>
2345 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
2346 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2347 * output.cc (Output_section::add_input_section): Check if section
2348 name contains special prefix. Keep input sections to sort such
2350 (Output_section::Input_section_sort_section_order_index_compare
2351 ::operator()): Group sections according to prefixes.
2352 (Output_section::sort_attached_input_sections): Add condition to
2353 Input_section_entry constructor call.
2354 * testsuite/Makefile.am (text_section_grouping): New test.
2355 * testsuite/Makefile.in: Regenerate.
2356 * testsuite/text_section_grouping.cc: New file.
2357 * testsuite/text_section_grouping.sh: New file.
2359 2012-12-17 Nick Clifton <nickc@redhat.com>
2361 * Makefile.am: Add copyright notice.
2364 * configure.ac: Likewise.
2365 * ftruncate.c: Likewise.
2366 * Makefile.in: Regenerate.
2368 2012-12-14 Cary Coutant <ccoutant@google.com>
2370 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2371 --no-as-needed flag.
2372 (exception_separate_shared_12_test): Likewise.
2373 (incremental_copy_test): Likewise.
2374 * testsuite/Makefile.in: Regenerate.
2376 2012-12-14 Cary Coutant <ccoutant@google.com>
2378 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2379 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2381 2012-12-12 Alan Modra <amodra@gmail.com>
2383 * powerpc.cc (class Track_tls): New.
2384 (class Relocate, class Scan): Inherit Track_tls.
2385 (Target_powerpc::Scan::local, global): Track tls optimization
2386 and avoid creating plt entry for __tls_get_addr if all uses
2388 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2390 2012-12-12 Alan Modra <amodra@gmail.com>
2392 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2393 Replace no_toc_optimize with toc_optimize.
2394 * output.h (Output_section::input_sections): Provide non-const variant.
2395 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2396 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2398 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2399 (class Sort_toc_sections): New.
2400 (Target_powerpc::do_finalize_sections): Sort toc sections.
2401 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2403 2012-12-10 Roland McGrath <mcgrathr@google.com>
2405 * testsuite/binary_unittest.cc (read_all): New function.
2406 (Sized_binary_test): Use it instead of ::read.
2407 * fileread.cc (do_read): Don't assume pread always reads the whole
2408 amount in a single call.
2410 2012-12-10 Alan Modra <amodra@gmail.com>
2412 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2413 Set EM_PPC64 or EM_PPC here.
2414 (Target_selector_powerpc::do_recognize): Delete.
2416 2012-12-10 Alan Modra <amodra@gmail.com>
2418 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2420 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2422 2012-12-07 Roland McGrath <mcgrathr@google.com>
2424 * testsuite/binary_unittest.cc (Sized_binary_test):
2425 Use open_descriptor rather than ::open.
2427 2012-12-07 Alan Modra <amodra@gmail.com>
2429 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2430 typedef and invalid_address constant.
2431 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2432 instantiate constants.
2434 2012-12-06 Roland McGrath <mcgrathr@google.com>
2436 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2437 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2438 * aclocal.m4: Regenerate.
2439 * configure: Regenerate.
2440 * Makefile.in: Regenerate.
2441 * testsuite/Makefile.in: Regenerate.
2443 2012-12-07 Alan Modra <amodra@gmail.com>
2445 * options.h (General_options): Add no_toc_optimize.
2446 * powerpc.cc (ok_lo_toc_insn): New function.
2447 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2449 2012-12-06 Alan Modra <amodra@gmail.com>
2451 * options.h (General_options): Add plt_align, plt_static_chain,
2452 plt_thread_safe. Update stub_group_size help text.
2453 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2454 for new plt_thread_safe_ var.
2455 (use_plt_offset): Correct comments.
2456 (Target_powerpc::do_relax): Look for thread creation symbols to
2457 determine default plt_thread_safe value. Clear plt call stubs
2458 as well as branch stubs each iteration.
2459 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2461 (l, hi, ha, write_insn): Move earlier.
2462 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2463 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2465 (Stub_table::update_size): Adjust.
2466 (Stub_table::prev_size, set_prev_size): Delete.
2467 (Stub_table::stub_align): Let --plt-align affect result.
2468 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2469 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2470 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2471 (Stub_table::do_write): Support more stub variants.
2473 2012-12-04 Alan Modra <amodra@gmail.com>
2475 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2476 (Target_powerpc::do_define_standard_symbols): New function.
2478 2012-12-03 Alan Modra <amodra@gmail.com>
2480 * output.h: Formatting, whitespace.
2482 2012-12-03 Alan Modra <amodra@gmail.com>
2484 * layout.h (Layout::get_executable_sections): Declare.
2485 * layout.cc (Layout::get_executable_sections): New function.
2486 * arm.cc (Target_arm::group_sections): Use it.
2487 (Arm_output_section::group_sections): Delete now redundant test.
2488 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2489 param to handle relative relocs.
2490 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2491 (Output_data_reloc::add_absolute): Adjust.
2492 (Output_data_reloc::add_relative): New function.
2493 (Output_data::reset_data_size): New function.
2494 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2495 (Output_section::set_addralign): New function.
2496 (Output_section::checkpoint_set_addralign): New function.
2497 (Output_section::clear_section_offsets_need_adjustment): New function.
2498 (Output_section::input_sections): Make public.
2499 * powerpc.cc (class Output_data_brlt_powerpc): New.
2500 (class Stub_table, class Stub_control): New.
2501 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2502 stub_table_, set_stub_table, stub_table): New vectors and accessor
2504 (Target_powerpc::do_may_relax, do_relax, push_branch,
2505 new_stub_table, stub_tables, brlt_section, group_sections,
2506 add_branch_lookup_table, find_branch_lookup_table,
2507 write_branch_lookup_table, make_brlt_section): New functions.
2508 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2509 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2510 branch_info_): New vars.
2511 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2512 make call stubs here.
2513 (Output_data_glink): Remove all call stub handling from this class.
2514 (Target_powerpc::Scan::local, global): Save interesting branch
2515 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2516 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2517 functions on final link.
2518 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2519 Handle long branch destinations too.
2520 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2521 do_plt_address_for_local): Adjust lookup of plt call stubs.
2523 2012-11-30 Alan Modra <amodra@gmail.com>
2525 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2526 relocs against protected symbols when building 32-bit shared libs.
2528 2012-11-30 Alan Modra <amodra@gmail.com>
2530 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2531 param. Call got_section() to make .got. Update all callers
2532 and their callers and so on.
2534 2012-11-30 Alan Modra <amodra@gmail.com>
2536 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2537 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2538 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2539 value if it already exists.
2541 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2544 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2546 2012-11-14 Roland McGrath <mcgrathr@google.com>
2548 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2549 than bfc instruction for data sandboxing.
2551 2012-11-08 Alan Modra <amodra@gmail.com>
2553 * po/POTFILES.in: Regenerate.
2555 2012-11-05 Alan Modra <amodra@gmail.com>
2557 * configure.ac: Apply 2012-09-10 change to config.in here.
2558 * configure: Regenerate.
2560 2012-11-05 Alan Modra <amodra@gmail.com>
2562 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2563 (struct Opd_ent): Use "Address" rather than "Offset".
2564 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2565 (Target_powerpc::got_section): Make public.
2566 (Target_powerpc::scan_relocs): Move code setting symbols..
2567 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2568 Create _SDA_BASE_ only when referenced.
2570 2012-11-02 Roland McGrath <mcgrathr@google.com>
2572 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2575 2012-11-01 Roland McGrath <mcgrathr@google.com>
2577 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2578 for offset_in_output_section parameter.
2579 (Sized_target::relocate_special_relocatable): Likewise.
2580 * arm.cc (Target_arm::relocate_relocs): Likewise.
2581 (Target_arm::relocate_special_relocatable): Likewise.
2582 * i386.cc (Target_i386::relocate_relocs): Likewise.
2583 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2584 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2585 * target-reloc.h (relocate_relocs): Likewise.
2586 * testsuite/testfile.cc (Target_test): Likewise.
2587 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2588 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2590 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2591 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2593 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2594 parameter, which is unused in the [!F_SETFD] case.
2596 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2597 SYMNDX to off_t before comparing it to this->data_size().
2598 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2599 * incremental.cc (Output_section_incremental_inputs::do_write):
2600 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2602 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2604 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2606 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2607 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2610 2012-10-29 Cary Coutant <ccoutant@google.com>
2612 * dwp.cc (usage): Add file and exit status parameters;
2613 add --help and --version options.
2614 (print_version): New function.
2615 (main): Add --help and --version options.
2617 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2619 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2620 final_layout_sequence.txt.
2621 * testsuite/Makefile.in: Regenerated.
2623 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2625 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2626 COMPILE generated by automake.
2628 (CXXCOMPILE1): Likewise.
2629 (CXXLINK1): Likewise.
2630 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2632 (CXXCOMPILE): Likewise.
2633 (CXXLINK): Likewise.
2634 * testsuite/Makefile.in: Regenerated.
2636 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2638 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2639 on bad fwrite return.
2641 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2643 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2646 2012-10-23 Cary Coutant <ccoutant@google.com>
2648 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2649 * testsuite/Makefile.in: Regenerate.
2650 * testsuite/dwp_test.h: New source file.
2651 * testsuite/dwp_test_1.cc: New source file.
2652 * testsuite/dwp_test_1.s: New source file.
2653 * testsuite/dwp_test_1.sh: New source file.
2654 * testsuite/dwp_test_1b.cc: New source file.
2655 * testsuite/dwp_test_1b.s: New source file.
2656 * testsuite/dwp_test_2.cc: New source file.
2657 * testsuite/dwp_test_2.s: New source file.
2658 * testsuite/dwp_test_2.sh: New source file.
2659 * testsuite/dwp_test_main.cc: New source file.
2660 * testsuite/dwp_test_main.s: New source file.
2662 2012-10-23 Cary Coutant <ccoutant@google.com>
2664 * dwp.h: New header file.
2665 * dwp.cc: New source file.
2666 * gold.h: Move shared declarations to system.h.
2667 * system.h: New header file.
2668 * Makefile.am: Add dwp.
2669 * Makefile.in: Regenerate.
2671 2012-10-23 Cary Coutant <ccoutant@google.com>
2673 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2674 Dwarf_info_reader::read_from_pointer.
2675 (Dwarf_pubnames_table::read_header): Likewise.
2676 (Dwarf_pubnames_table::next_name): Likewise.
2677 (Dwarf_die::read_attributes): Likewise.
2678 (Dwarf_die::skip_attributes): Likewise.
2679 (Dwarf_info_reader::read_from_pointer): New function template.
2680 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2681 (Dwarf_pubnames_table): Likewise.
2682 (Dwarf_info_reader::read_from_pointer): New function template.
2683 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2684 Dwarf_pubnames_table ctor.
2686 2012-10-23 Cary Coutant <ccoutant@google.com>
2688 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2690 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2692 (Dwarf_info_reader::set_abbrev_shndx): New method.
2693 (Dwarf_info_reader::abbrev_shndx_): New data member.
2695 2012-10-23 Cary Coutant <ccoutant@google.com>
2697 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2698 from object, not parameters.
2699 (Dwarf_info_reader::parse): Likewise.
2700 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2701 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2702 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2705 2012-10-23 Cary Coutant <ccoutant@google.com>
2707 * fileread.cc (Input_file::Input_file): New constructor.
2708 * fileread.h (class Input_file): Add new constructor.
2710 2012-10-18 Alan Modra <amodra@gmail.com>
2713 * object.cc (Relobj::is_section_name_included): Also match
2714 .sdata personality section.
2716 2012-10-18 Alan Modra <amodra@gmail.com>
2718 * target-reloc.h (class Default_comdat_behavior): New, package up..
2719 (get_comdat_behaviour): ..this.
2720 (relocate_section): Add Relocate_comdat_behavior template arg,
2721 adjust code to suit.
2722 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2723 (Target_arm::scan_reloc_section): Likewise.
2724 * i386.cc (Target_i386::relocate_section): Likewise.
2725 * sparc.cc (Target_sparc::relocate_section): Likewise.
2726 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2727 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2728 * powerpc.cc (class Relocate_comdat_behavior): New.
2729 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2730 gold::relocate_section with new template arg.
2732 2012-10-18 Alan Modra <amodra@gmail.com>
2734 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2735 dynamic relocs for GOT_TPREL got entries, without symbol if
2737 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2738 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2739 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2741 2012-10-17 Alan Modra <amodra@gmail.com>
2744 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2746 2012-10-16 Sriraman Tallam <tmsriram@google.com>
2748 * layout.cc (Layout::include_section): Keep sections marked
2749 SHF_EXCLUDE when doing relocatable links.
2751 2012-10-16 Alan Modra <amodra@gmail.com>
2753 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2754 (Target_powerpc::do_finalize_sections): Call it.
2755 (Output_data_save_res): New class and supporting functions.
2756 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2757 normal symbols defined in object files.
2759 2012-10-12 Alan Modra <amodra@gmail.com>
2761 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2762 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2763 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2764 section if scan_opd_relocs not yet called.
2765 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2767 2012-10-12 Alan Modra <amodra@gmail.com>
2769 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2770 add_local_ifunc_entry): Revert last change.
2771 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2773 2012-10-05 Alan Modra <amodra@gmail.com>
2775 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2776 do_plt_address_for_global): New functions.
2777 (Output_data_got_powerpc::do_write): Don't segfault when linking
2779 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2780 add_local_ifunc_entry): Return true on adding entry..
2781 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2782 glink->add_entry call. Remove unused symtab param. Adjust calls.
2783 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2784 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2785 set up symbols here.
2786 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2787 syms here. Do so even when no .iplt. Don't segfault when linking
2789 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2790 new variants without reloc param.
2791 (Glink_sym_ent::Glink_sym_ent): Likewise.
2792 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2793 reloc when refs will resolve to plt call stub.
2794 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2795 R_PPC_PLTREL24 to resolve locally.
2796 (Target_powerpc::Scan::global): Correct ifunc handling.
2797 (Target_powerpc::Relocate::relocate): Correct local sym glink
2798 lookup. Don't destroy "value" when we have a plt call stub,
2799 and when checking plt call validity.
2800 (Target_powerpc::do_dynsym_value): Simplify.
2802 2012-10-05 Alan Modra <amodra@gmail.com>
2804 * i386.cc (Output_data_plt_i386::address_for_global,
2805 address_for_local): Add plt offset to returned value. Adjust uses.
2806 * sparc.cc (Output_data_plt_sparc::address_for_global,
2807 address_for_local): Likewise.
2808 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2809 address_for_local): Likewise.
2810 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2811 address_for_local): Likewise.
2812 * target.h (Target::plt_address_for_global, plt_address_for_local):
2814 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2815 (Output_data_got::Got_entry::write): Nor here.
2816 * output.h: Comment fix.
2818 2012-10-02 Jiong Wang <jiwang@tilera.com>
2820 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2821 global_offset_table_ value for larget got.
2822 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2824 2012-09-29 Alan Modra <amodra@gmail.com>
2826 * powerpc.cc (Target_powerpc::iplt_): New output section.
2827 (Target_powerpc::iplt_section, make_iplt_section,
2828 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2829 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2830 Target_powerpc::plt_entry_count): Count iplt entries too.
2831 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2832 reloc section in constructor. New params.
2833 (Target_powerpc::make_plt_section): Create reloc section here instead.
2834 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2836 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2837 (Output_data_glink::add_entry, find_entry): New functions to
2838 deal with local syms.
2839 (Glink_sym_ent): Add support for local syms.
2840 (Output_data_glink::do_write): Handle ifunc plt entries.
2841 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2842 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2843 (Target_powerpc::Relocate::relocate): Likewise.
2844 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2846 2012-09-25 Alan Modra <amodra@gmail.com>
2848 * object.h (Sized_relobj_file::adjust_local_symbol,
2849 do_adjust_local_symbol): New functions.
2850 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2851 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2852 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2853 and irregular opd entry spacing.
2854 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2855 (Global_symbol_visitor_opd): New functor.
2856 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2857 on deleted opd entries.
2859 2012-09-15 Jiong Wang <jiwang@tilera.com>
2861 * tilegx.cc: New file.
2862 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2863 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2864 * configure.tgt: Add entries for tilegx*.
2865 * configure.ac: Likewise.
2866 * Makefile.in: Rebuild.
2867 * configure: Likewise.
2868 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2871 2012-09-13 Alan Modra <amodra@gmail.com>
2873 * target-reloc.h (scan_relocs): Call scan.local for relocs
2874 against symbols in discarded sections. Pass is_discarded
2876 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2877 Add is_discarded param.
2878 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2879 is_discarded to flag opd entry as discarded. Don't emit dyn
2880 relocs on such entries.
2881 (Target_powerpc::Scan::global): Similarly detect and handle
2883 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2884 opd_ent_. Update all uses.
2885 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2886 (Target_powerpc::relocate_section): Zero out discarded opd
2889 2012-09-12 Ian Lance Taylor <iant@google.com>
2892 * output.cc: Rename Output_data_got template parameter from size
2893 to got_size for all functions. Compile all variants of
2895 (Output_data_got::Got_entry::write): Correct use of size for
2896 symbol value. Use local_is_tls rather than casting to
2898 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2899 (class Sized_relobj_file): Add do_local_is_tls.
2900 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2902 2012-09-11 Alan Modra <amodra@gmail.com>
2905 * layout.cc (Layout::set_segment_offsets): When using
2906 common-page-size alignment, ensure we are on a new max-page-size
2908 * output.cc (Output_segment::set_section_addresses): Use
2909 abi_pagesize, not common_pagesize for relro boundary.
2910 (Output_segment::set_offset): Likewise.
2912 2012-09-11 Alan Modra <amodra@gmail.com>
2914 * output.h (Output_data_got::add_global_tls, add_local_tls,
2915 add_local_tls_pair): New functions.
2916 (Output_data_got::add_local_pair_with_rel): Remove second
2917 reloc param. Expand comment.
2918 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2919 use_plt_or_tls_offset_, similarly for constructor param.
2920 (Output_data_got::Got_entry::write): Add got_index param.
2921 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2922 add_local_tls_pair): New functions.
2923 (Output_data_got::Got_entry::write): Handle tls symbols
2924 with use_plt_or_tls_offset_ set specially.
2925 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2926 (Output_data_got::do_write): Replace iterator with index, pass
2927 index to entry write function.
2928 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2929 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2930 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2932 * i386.cc (Target_i386::Scan::local): Likewise.
2933 * sparc.cc (Target_sparc::Scan::local): Likewise.
2934 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2935 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2936 do_tls_offset_for_global): New functions.
2937 (Target_powerpc::Scan::local): Correct TLS relocations and got
2939 (Target_powerpc::Scan::global): Don't emit unnecessary
2940 dynamic relocations on TLS GOT entries.
2942 2012-09-10 Matthias Klose <doko@ubuntu.com>
2944 * config.in: Disable sanity check for kfreebsd.
2946 2012-09-10 Sterling Augustine <saugustine@google.com>
2948 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2949 (Gdb_index::pubtypes_read): New parameter.
2950 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2952 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2955 2012-09-09 Alan Modra <amodra@gmail.com>
2957 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2958 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2959 * gc.h (gc_process_relocs): Call target gc_add_reference.
2960 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2961 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2962 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2964 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2965 to cater for when we don't need code offset. Update use.
2966 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2967 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2968 set_opd_valid): New functions.
2969 (Target_powerpc::do_gc_add_reference): New function.
2970 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2972 (Target_powerpc::do_gc_mark_symbol): New function.
2974 2012-09-06 Cary Coutant <ccoutant@google.com>
2976 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2977 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2978 (Dwarf_die::skip_attributes): Likewise.
2979 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2980 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2982 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2984 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2986 * testsuite/script_test_3.t: Add .got.plt output section
2988 * testsuite/script_test_4.t: Likewise.
2990 2012-09-05 Alan Modra <amodra@gmail.com>
2992 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2993 update all uses and lose "enum" when using type.
2995 2012-09-05 Alan Modra <amodra@gmail.com>
2997 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2998 * configure: Regenerate.
2999 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3000 (plugin_final_layout.stdout): Likewise.
3001 (memory_test): Set page sizes to 0x1000.
3002 * testsuite/Makefile.in: Regenerate.
3003 * testsuite/discard_locals_test.sh: Add FIXME comment.
3004 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3005 * testsuite/pr14265.t: Add .got output section statement.
3006 * testsuite/script_test_2.t: Likewise.
3007 * testsuite/script_test_3.t: Likewise.
3008 * testsuite/script_test_4.t: Likewise.
3009 * testsuite/script_test_5.t: Likewise.
3010 * testsuite/script_test_6.t: Likewise.
3011 * testsuite/script_test_7.t: Likewise.
3012 * testsuite/script_test_9.t: Likewise.
3014 2012-09-05 Alan Modra <amodra@gmail.com>
3016 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3017 (Powerpc_relocate_functions::Status): New typedef.
3018 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3019 (Target_powerpc::Scan::local): Handle REL64.
3020 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3021 for REL32 and REL64.
3022 (Target_powerpc::symval_for_branch): New function, extracted from..
3023 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3024 checks. Report overflow errors.
3026 2012-09-05 Alan Modra <amodra@gmail.com>
3028 * object.h (Sized_relobj_file::emit_relocs): Delete.
3029 (Sized_relobj_file::emit_relocs_reltype): Delete.
3030 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3031 relocate_relocs for --emit-relocs.
3032 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3033 * output.h: Update comment.
3034 (Output_segment::first_section): New function.
3035 (Output_segment::first_section_load_address): Use first_section.
3036 * output.cc (Output_segment::first_section): New function extracted..
3037 (Output_segment::first_section_load_address): ..from here. Delete.
3038 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3039 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3040 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3041 adjust call to target.h function.
3042 * i386.cc (Target_i386): Likewise.
3043 * sparc.cc (Target_sparc): Likewise.
3044 * x86_64.cc (Target_x86_64): Likewise.
3045 * powerpc.cc (Target_powerpc): Likewise.
3046 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3047 first tls section has section symbol for optimised local dynamic
3049 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3050 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3052 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3053 Rename to relocate_relocs. Update error message.
3055 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3057 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3060 2012-08-31 Alan Modra <amodra@gmail.com>
3062 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3063 (Powerpc_relobj::toc_base_offset): New stub function.
3064 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3065 got_mod_index_offset to tlsld_got_offset. Update all refs.
3066 (Target_powerpc::Relocate::enum skip_tls): New.
3067 (Target_powerpc::call_tls_get_addr_): New var.
3068 (Target_powerpc::is_branch_reloc): Move to file scope.
3069 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3070 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3072 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3073 (powerpc_info): Correct common_pagesize for ppc64.
3074 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3075 (Powerpc_relocate_functions): Add overflow check enums and functions.
3076 Add non-shift version of rela, rela_ua. Delete all rel public
3077 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3078 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3079 addr16_ha3, addr14 functions.
3080 (Output_data_got_powerpc::add_constant_pair): New function.
3081 (Output_data_got_powerpc::got_base_offset): Likewise.
3082 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3083 (instruction constants): Sort, add some more.
3084 (Output_data_glink::do_write): Add and use Address typedef. Use
3085 object->toc_base_offset() stub for 64-bit.
3086 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3087 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3088 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3089 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3090 Always treat .opd relocs as against locally defined symbol.
3091 Correct condition for RELATIVE relocs.
3092 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3093 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3094 for 32-bit syms with a plt entry. Correct ppc64 toc base
3095 calculations. Handle TLS relocs, and more. Add overflow
3096 checking and adjust for Powerpc_relocate_functions changes.
3097 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3098 Reinstate --emit-relocs code with FIXME.
3100 2012-08-30 Alan Modra <amodra@gmail.com>
3102 * layout.cc (Layout::set_segment_offsets): Set p_align to
3103 abi_pagesize, not common_pagesize.
3104 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3105 to determine whether file header can go in segment.
3107 2012-08-30 Alan Modra <amodra@gmail.com>
3109 * output.h (Output_reloc::Output_reloc <output section>): Add
3110 is_relative param. Adjust calls.
3111 (Output_reloc::add_output_section_relative): New functions.
3112 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3114 (Output_reloc::symbol_value): Handle SECTION_CODE.
3116 2012-08-24 Sriraman Tallam <tmsriram@google.com>
3118 * gold.cc (queue_middle_tasks): Call layout again when unique
3119 segments for sections is desired.
3120 * layout.cc (Layout::Layout): Initialize new members.
3121 (Layout::get_output_section_flags): New function.
3122 (Layout::choose_output_section): Call get_output_section_flags.
3123 (Layout::layout): Make output section for mapping to a unique segment.
3124 (Layout::insert_section_segment_map): New function.
3125 (Layout::attach_allocated_section_to_segment): Make unique segment for
3126 output sections marked so.
3127 (Layout::segment_precedes): Check for unique segments when sorting.
3128 * layout.h (Layout::Unique_segment_info): New struct.
3129 (Layout::Section_segment_map): New typedef.
3130 (Layout::insert_section_segment_map): New function.
3131 (Layout::get_output_section_flags): New function.
3132 (Layout::is_unique_segment_for_sections_specified): New function.
3133 (Layout::set_unique_segment_for_sections_specified): New function.
3134 (Layout::unique_segment_for_sections_specified_): New member.
3135 (Layout::section_segment_map_): New member.
3136 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3137 Rename is_gc_pass_one to is_pass_one.
3138 Rename is_gc_pass_two to is_pass_two.
3139 Rename is_gc_or_icf to is_two_pass.
3140 Check for which pass based on whether symbols data is present.
3141 Make it two pass when unique segments for sections is desired.
3142 * output.cc (Output_section::Output_section): Initialize new
3144 * output.h (Output_section::is_unique_segment): New function.
3145 (Output_section::set_is_unique_segment): New function.
3146 (Output_section::is_unique_segment_): New member.
3147 (Output_section::extra_segment_flags): New function.
3148 (Output_section::set_extra_segment_flags): New function.
3149 (Output_section::extra_segment_flags_): New member.
3150 (Output_section::segment_alignment): New function.
3151 (Output_section::set_segment_alignment): New function.
3152 (Output_section::segment_alignment_): New member.
3153 (Output_segment::Output_segment): Initialize is_unique_segment_.
3154 (Output_segment::is_unique_segment): New function.
3155 (Output_segment::set_is_unique_segment): New function.
3156 (Output_segment::is_unique_segment_): New member.
3157 * plugin.cc (allow_unique_segment_for_sections): New function.
3158 (unique_segment_for_sections): New function.
3159 (Plugin::load): Add new functions to transfer vector.
3160 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3161 * Makefile.in: Regenerate.
3162 * testsuite/plugin_final_layout.sh: Check if unique segment
3163 functionality works.
3164 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3166 (allow_unique_segment_for_sections): New global.
3167 (unique_segment_for_sections): New global.
3168 (claim_file_hook): Call allow_unique_segment_for_sections.
3169 (all_symbols_read_hook): Call unique_segment_for_sections.
3171 2012-08-22 Cary Coutant <ccoutant@google.com>
3173 * layout.cc (Layout::include_section): Don't assert on GROUP
3174 sections with --emit-relocs.
3176 2012-08-21 Cary Coutant <ccoutant@google.com>
3178 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3179 if --export-dynamic-symbol names an undef symbol.
3181 2012-08-18 Alan Modra <amodra@gmail.com>
3183 * powerpc.cc: Formatting and white space.
3184 (Powerpc_relobj): Rename got2_section_ to special_.
3185 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3186 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3187 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3188 (Target_powerpc): Add Address typedef and invalid_address. Use
3190 (Target_powerpc::is_branch_reloc): New function.
3191 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3192 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3193 for dst_mask, value and addend.
3194 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3195 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3196 (Output_data_glink::do_write): Correct toc base. Don't try to use
3197 uint16_t for 24-bit offset. Use get_output_section_offset and
3199 (Target_powerpc::Scan::local): Handle more relocs.
3200 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3201 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3202 Plug in toc restoring insn after plt calls. Translate branches
3203 to function descriptor symbols to corresponding entry point.
3204 (Target_powerpc::relocate_for_relocatable): Check return from
3205 get_output_section_offset.
3206 * symtab.h: Comment typo.
3208 2012-08-14 Ian Lance Taylor <iant@google.com>
3210 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3211 unsupported_relocal_local to call unsupported_reloc_global.
3213 2012-08-14 Nick Clifton <nickc@redhat.com>
3216 * script-sections.cc (Sections_element::output_section_name): Add
3217 keep return parameter.
3218 (Output_section_element::match_name): Add keep return parameter.
3219 Return the value of the keep_ member.
3220 * script-sections.h (class Output_section): Update
3221 output_section_name prototype.
3222 * layout.cc (Layout::keep_input_section): New public member
3224 (Layout::choose_output_section): Pass keep parameter to
3225 output_section_name.
3226 * layout.h (class Layout): Add keep_input_section.
3227 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3229 * testsuite/Makefile.am: Add a test.
3230 * testsuite/Makefile.in: Regenerate.
3231 * testsuite/pr14265.c: Source file for the test.
3232 * testsuite/pr14265.t: Linker script for the test.
3233 * testsuite/pr14265.sh: Shell script for the test.
3235 2012-08-14 Alan Modra <amodra@gmail.com>
3237 * target.h (Target::output_section_name): New function.
3238 (Target::do_output_section_name): New function.
3239 * layout.cc (Layout::choose_output_section): Call the above.
3240 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3242 2012-08-14 Alan Modra <amodra@gmail.com>
3244 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3245 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3246 for replace_constant call.
3247 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3248 (Output_data_glink::do_print_to_mapfile): New function.
3249 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3250 (Target_powerpc::Relocate::relocate): Likewise.
3252 2012-08-14 Alan Modra <amodra@gmail.com>
3254 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3255 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3256 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3257 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3258 all references to shndx_. Handle special case for R_PPC_PLTREL24
3260 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3261 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3262 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3264 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3265 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3267 2012-08-12 Alan Modra <amodra@gmail.com>
3269 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3270 (glink insn constants): Use uint32_t.
3271 (Output_data_glink::add_entry): Use insert, not [] operator.
3273 2012-08-11 Alan Modra <amodra@gmail.com>
3275 * object.h (Sized_relobj_file::find_shdr): New function.
3276 (Sized_relobj_file::find_special_sections): New function.
3277 * object.cc (Sized_relobj_file::find_shdr): New function.
3278 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3279 (Sized_relobj_file::find_special_sections): New function, split out..
3280 (Sized_relobj_file::do_read_symbols): ..from here.
3281 * output.h (Output_data_got::replace_constant): New function.
3282 (Output_data_got::num_entries): New function.
3283 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3284 (Output_data_got::got_offset): Protected rather than private.
3285 (Output_data_got::replace_got_entry): New function.
3286 * output.cc (Output_data_got::replace_got_entry): New function.
3287 * powerpc.cc (class Powerpc_relobj): New.
3288 (class Powerpc_relocate_functions): Delete all psymval variants or
3289 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3290 Implement _ha functions using corresponding _hi function.
3291 (Powerpc_relobj::find_special_sections): New function.
3292 (Target_powerpc::do_make_elf_object): New function.
3293 (class Output_data_got_powerpc): New.
3294 (class Output_data_glink): New.
3295 (class Powerpc_scan_relocatable_reloc): New.
3296 Many more changes througout file.
3298 2012-08-09 Nick Clifton <nickc@redhat.com>
3300 * po/vi.po: Updated Vietnamese translation.
3302 2012-08-07 Ian Lance Taylor <iant@google.com>
3304 * layout.cc (Layout::add_target_dynamic_tags): If
3305 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3308 2012-07-30 Nick Clifton <nickc@redhat.com>
3310 * po/gold.pot: Updated template.
3311 * po/es.po: Updated Spanish translation.
3313 2012-07-18 Cary Coutant <ccoutant@google.com>
3316 * configure.ac: Add check for -gpubnames support.
3317 * configure: Regenerate.
3318 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3319 support; force -gno-pubnames.
3320 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3322 (gdb_index_test_4): New test.
3323 * testsuite/Makefile.in: Regenerate.
3324 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3325 * testsuite/gdb_index_test_2.sh: Likewise.
3326 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3327 * testsuite/gdb_index_test_4.sh: New script.
3328 * testsuite/gdb_index_test_comm.sh: New script with common code;
3329 don't look for space after colon.
3331 2012-07-16 Sriraman Tallam <tmsriram@google.com>
3333 * gold.cc (queue_middle_tasks): Update function order only after
3334 deferred objects due to plugins are processed.
3336 2012-07-11 Ian Lance Taylor <iant@google.com>
3338 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3339 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3340 (Target_arm::scan_reloc_for_stub): Likewise.
3341 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3342 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3343 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3344 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3345 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3347 2012-07-10 Dodji Seketeli <dodji@redhat.com>
3348 Ian Lance Taylor <iant@google.com>
3351 * configure.ac: Test whether std::tr1::hash<off_t> works.
3352 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3354 * output.h (class Output_fill): Add virtual destructor.
3355 * configure, config.in: Rebuild.
3357 2012-06-22 Roland McGrath <mcgrathr@google.com>
3359 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3361 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3363 * plugin.cc (Plugin::load): Handle position independent executables.
3365 2012-06-06 Cary Coutant <ccoutant@google.com>
3367 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3369 (lines_only_debug_sections): Likewise.
3370 (gdb_fast_lookup_sections): New static array.
3371 (is_gdb_debug_section): Rename formal parameter.
3372 (is_lines_only_debug_section): Likewise.
3373 (is_gdb_fast_lookup_section): New function.
3374 (Layout::include_section): Check for ".zdebug_" prefix; pass
3375 section name suffix to is_gdb_debug_section, et al.; check for
3376 fast-lookup sections when building .gdb_index.
3377 * options.h (--strip-debug-gdb): Update GDB version number.
3379 2012-06-06 Cary Coutant <ccoutant@google.com>
3381 * configure.ac: Add check for fallocate.
3382 * configure: Regenerate.
3383 * config.in: Regenerate.
3385 * options.h (class General_options): Add --mmap-output-file and
3386 --posix-fallocate options.
3387 * output.cc: (posix_fallocate): Remove; replace with...
3388 (gold_fallocate): New function.
3389 (Output_file::map_no_anonymous): Call gold_fallocate.
3390 (Output_file::map): Check --mmap-output-file option.
3392 2012-06-05 Jing Yu <jingyu@google.com>
3394 * gold.h (textdomain): Add do {} to empty while(0).
3395 (bindtextdomain): Likewise.
3397 2012-06-04 Cary Coutant <ccoutant@google.com>
3399 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3402 2012-05-25 Sriraman Tallam <tmsriram@google.com>
3404 * symtab.cc (Symbol_table::define_special_symbol):
3405 Initialize *poldsym to prevent uninitialized variable errors.
3407 2012-05-23 Cary Coutant <ccoutant@google.com>
3409 * layout.cc (Layout::section_name_mapping): Add rules to handle
3410 exact match on .data.rel.ro.local or .data.rel.ro.
3411 (Layout::output_section_name): Check for exact matches.
3413 2012-05-23 Cary Coutant <ccoutant@google.com>
3415 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3418 2012-05-22 Cary Coutant <ccoutant@google.com>
3420 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3421 object before exporting symbol.
3423 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3425 * testsuite/tls_test.cc: Include "config.h" first.
3426 * testsuite/tls_test_c.c: Likewise.
3428 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
3429 Nick Clifton <nickc@redhat.com>
3432 * configure.in: Add check that sysdep.h has been included before
3433 any system header files.
3434 * configure: Regenerate.
3435 * config.in: Regenerate.
3437 2012-05-14 Cary Coutant <ccoutant@google.com>
3439 * layout.cc (Layout::make_output_section): Mark .tdata section
3441 * testsuite/relro_test.cc: Add a TLS variable.
3443 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3446 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3447 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3450 2012-05-08 Cary Coutant <ccoutant@google.com>
3452 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3453 (lines_only_debug_sections): Likewise.
3455 2012-05-02 Roland McGrath <mcgrathr@google.com>
3457 * nacl.cc: New file.
3459 * Makefile.am (CCFILES, HFILES): Add them.
3460 * Makefile.in: Regenerate.
3461 * i386.cc (Output_data_plt_i386_nacl): New class.
3462 (Output_data_plt_i386_nacl_exec): New class.
3463 (Output_data_plt_i386_nacl_dyn): New class.
3464 (Target_i386_nacl): New class.
3465 (Target_selector_i386_nacl): New class.
3466 (target_selector_i386): Use it instead of Target_selector_i386.
3467 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3468 (Target_x86_64_nacl): New class.
3469 (Target_selector_x86_64_nacl): New class.
3470 (target_selector_x86_64, target_selector_x32): Use it instead of
3471 Target_selector_x86_64.
3472 * arm.cc (Output_data_plt_arm_nacl): New class.
3473 (Target_arm_nacl): New class.
3474 (Target_selector_arm_nacl): New class.
3475 (target_selector_arm, target_selector_armbe): Use it instead of
3476 Target_selector_arm.
3478 * target-select.cc (select_target): Take new Input_file* and off_t
3479 arguments, pass them on to recognize method of selector.
3480 * object.cc (make_elf_sized_object): Update caller.
3481 * parameters.cc (parameters_force_valid_target): Likewise.
3482 * incremental.cc (make_sized_incremental_binary): Likewise.
3483 * target-select.h: Update decl.
3484 (Target_selector::recognize): Take new Input_file* argument,
3485 pass it on to do_recognize.
3486 (Target_selector::do_recognize): Take new Input_file* argument.
3487 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3488 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3489 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3490 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3492 * target.h (Target::Target_info): New members isolate_execinstr
3494 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3495 * arm.cc (Target_arm::arm_info): Update initializer.
3496 * i386.cc (Target_i386::i386_info): Likewise.
3497 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3498 * sparc.cc (Target_sparc::sparc_info): Likewise.
3499 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3500 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3501 * layout.cc (Layout::attach_allocated_section_to_segment):
3502 Take new const Target* argument. If target->isolate_execinstr(), act
3504 (Layout::find_first_load_seg): Take new const Target* argument;
3505 if target->isolate_execinstr(), reject PF_X segments.
3506 (Layout::relaxation_loop_body): Update caller.
3507 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3508 reset file offset to zero when we hit LOAD_SEG, and then do a second
3509 loop over the segments before LOAD_SEG to reassign offsets after
3510 addresses have been determined. Handle target->rosegment_gap().
3511 (Layout::attach_section_to_segment): Take new const Target* argument;
3512 pass it to attach_allocated_section_to_segment.
3513 (Layout::make_output_section): Update caller.
3514 (Layout::attach_sections_to_segments): Take new const Target* argument;
3515 pass it to attach_section_to_segment.
3516 * gold.cc (queue_middle_tasks): Update caller.
3517 * layout.h (Layout): Update method decls with new arguments.
3519 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3520 Target_info pointer to use.
3521 (Target_arm::do_make_data_plt): New virtual method.
3522 (Target_arm::make_data_plt): New method that calls it.
3523 (Target_arm::make_plt_entry): Use it.
3524 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3525 for the section alignment.
3526 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3528 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3529 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3531 (Output_data_plt_arm::get_plt_entry_size): Call it.
3532 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3533 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3534 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3536 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3537 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3538 method instead of sizeof(plt_entry).
3539 (Output_data_plt_arm::add_entry): Likewise.
3540 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3541 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3543 (Target_arm::plt_entry_size): Likewise.
3544 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3546 (Output_data_plt_arm_standard): ... here, new class.
3547 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3548 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3549 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3551 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3552 Take additional argument for the PLT entry size.
3553 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3554 Use get_plt_entry_size method rather than plt_entry_size variable.
3555 (Output_data_plt_x86_64::reserve_slot): Likewise.
3556 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3557 (Output_data_plt_x86_64::add_entry): Likewise.
3558 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3559 (Output_data_plt_x86_64::address_for_global): Likewise.
3560 (Output_data_plt_x86_64::address_for_local): Likewise.
3561 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3562 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3563 Make method non-static.
3564 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3566 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3567 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3568 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3569 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3571 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3572 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3574 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3575 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3577 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3578 (Output_data_plt_x86_64::plt_entry_size)
3579 (Output_data_plt_x86_64::first_plt_entry)
3580 (Output_data_plt_x86_64::plt_entry)
3581 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3582 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3583 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3584 (Output_data_plt_x86_64_standard): ... here, new class.
3585 (Target_x86_64::Target_x86_64): Take optional argument for the
3586 Target_info pointer to use.
3587 (Target_x86_64::do_make_data_plt): New virtual method.
3588 (Target_x86_64::make_data_plt): New method to call it.
3589 (Target_x86_64::init_got_plt_for_update): Use that.
3590 Call this->plt_->add_eh_frame method here.
3591 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3592 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3593 rather than static method.
3594 (Target_x86_64::plt_entry_size): Likewise.
3595 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3596 rather than plt_entry_size variable. Move guts of PLT filling to...
3597 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3598 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3599 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3601 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3602 additional argument for the section alignment.
3603 Don't do add_eh_frame_for_plt here.
3604 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3605 non-static. Use get_plt_entry_size method rather than plt_entry_size
3607 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3609 (Output_data_plt_i386::get_plt_entry_size): Call it.
3610 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3611 (Output_data_plt_i386::add_eh_frame): New method to call it.
3612 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3614 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3615 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3617 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3618 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3619 method instead of plt_entry_size.
3620 (Output_data_plt_i386::plt_entry_size)
3621 (Output_data_plt_i386::plt_eh_frame_fde_size)
3622 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3623 (Output_data_plt_i386_standard): ... here, new class.
3624 (Output_data_plt_i386_exec): New class.
3625 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3626 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3627 (Output_data_plt_i386::exec_plt_entry): Move to ...
3628 (Output_data_plt_i386_exec::plt_entry): ... here.
3629 (Output_data_plt_i386_dyn): New class.
3630 (Output_data_plt_i386::first_plt_entry): Move to ...
3631 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3632 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3633 (Output_data_plt_i386_dyn::plt_entry): ... here.
3634 (Target_i386::Target_i386): Take optional argument for the Target_info
3636 (Target_i386::do_make_data_plt): New virtual method.
3637 (Target_i386::make_data_plt): New method to call it.
3638 (Target_i386::make_plt_section): Use that.
3639 Call this->plt_->add_eh_frame method here.
3640 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3641 rather than plt_entry_size variable.
3642 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3643 (Output_data_plt_i386::address_for_local): Likewise.
3644 (Output_data_plt_i386::do_write): Likewise.
3645 Move guts of PLT filling to...
3646 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3647 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3648 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3649 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3651 2012-05-01 Cary Coutant <ccoutant@google.com>
3653 * dwarf_reader.cc (Dwarf_die::read_attributes)
3654 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3655 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3656 * reduced_debug_output.cc
3657 (Output_reduced_debug_info_section::get_die_end): Remove
3658 DW_FORM_GNU_ref_index. Add default case.
3660 2012-04-26 Mark Wielaard <mjw@redhat.com>
3662 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3663 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3664 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3665 DW_AT_high_pc as offset from DW_AT_low_pc.
3667 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3668 * testsuite/Makefile.in: Regenerate.
3669 * testsuite/gdb_index_test_3.c: New test source file.
3670 * testsuite/gdb_index_test_3.sh: New test source file.
3672 2012-04-25 Ian Lance Taylor <iant@google.com>
3674 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3676 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3677 as a class, not a struct.
3678 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3679 (Target_arm::apply_cortex_a8_workaround): Likewise.
3680 * gc.h: Declare Reloc_types as a struct, not a class.
3681 * object.h: Declare Symbols_data as a struct.
3682 * reloc.h: Declare Read_relocs_data as a struct.
3683 * target.h: Declare Relocate_info as a struct.
3685 2012-04-24 David S. Miller <davem@davemloft.net>
3687 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3688 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3691 2012-04-24 Cary Coutant <ccoutant@google.com>
3693 * incremental-dump.cc (find_input_containing_global): Replace
3694 magic number with symbolic constant.
3695 (dump_incremental_inputs): Update version number.
3696 * incremental.cc (Output_section_incremental_inputs): Update version
3697 number; import symbolic constants from Incremental_inputs_reader.
3698 (Incremental_inputs::create_data_sections): Align relocations
3699 section correctly for 64-bit targets.
3700 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3701 constants; add padding.
3702 (Output_section_incremental_inputs::write_header): Add assert for
3704 (Output_section_incremental_inputs::write_input_files): Add assert
3705 for input_entry_size.
3706 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3707 add assert for object_info_size, input_section_entry_size,
3708 global_sym_entry_size.
3709 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3710 for data structure sizes; use them.
3711 (Incremental_input_entry_reader): Import symbolic constants from
3712 Incremental_inputs_reader; use them.
3714 2012-04-23 David S. Miller <davem@davemloft.net>
3716 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3718 (Target_sparc::Target_sparc): Initialize new fields.
3719 (Target_sparc::do_make_elf_object): New function.
3720 (Target_sparc::do_adjust_elf_header): New function.
3722 2012-04-23 Cary Coutant <ccoutant@google.com>
3724 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3725 CU range table of gdb index.
3727 2012-04-20 David S. Miller <davem@davemloft.net>
3729 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3732 2012-04-16 David S. Miller <davem@davemloft.net>
3734 * sparc.cc (Target_sparc::got_address): New function.
3735 (Sparc_relocate_functions::gdop_hix22): New function.
3736 (Sparc_relocate_functions::gdop_lox10): New function.
3737 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3739 (Target_sparc::Scan::local): Likewise if the global symbol is not
3740 preemptible and is not IFUNC.
3741 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3742 transformations for local and non-preemptible non-IFUNC global
3745 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3746 writing out 64-bit part of ranges.
3748 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3749 -fpic and -fpie respectively.
3750 * Makefile.in: Regenerate.
3752 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3753 (Target_sparc::Target_sparc): Initialize new field.
3754 (Target_sparc::do_plt_section_for_global): New function.
3755 (Target_sparc::do_plt_section_for_local): New function.
3756 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3757 (Target_sparc::make_plt_section): New function, broken out of
3758 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3759 (Target_sparc::make_plt_entry): Call make_plt_section.
3760 (Target_sparc::make_local_ifunc_plt_entry): New function.
3761 (Target_sparc::rela_ifunc_section): New function.
3762 (Target_sparc::plt_section): Remove const.
3763 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3764 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3765 and ifunc_count_ fields.
3766 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3767 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3768 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3769 (Output_data_plt_sparc::rela_ifunc): New function.
3770 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3771 (Output_data_plt_sparc::has_ifunc_section): New function.
3772 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3773 (Output_data_plt_sparc::address_for_global): New function.
3774 (Output_data_plt_sparc::address_for_local): New function.
3775 (Output_data_plt_sparc::plt_index_to_offset): New function.
3776 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3778 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3780 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3781 R_SPARC_JMP_IREL to switch.
3782 (Target_sparc::Scan::check_non_pic): Likewise.
3783 (Target_sparc::Scan::local): Handle IFUNC symbols.
3784 (Target_sparc::Scan::local): Likewise.
3785 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3786 and plt_address_for_local.
3787 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3788 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3790 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3791 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3792 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3793 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3795 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3796 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3798 * sparc.cc (Target_sparc::Scan::global): Likewise.
3799 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3801 2012-04-16 Cary Coutant <ccoutant@google.com>
3803 * archive.cc (Library_base::should_include_member): Check for
3804 --export-dynamic-symbol.
3805 * options.h (class General_options): Add --export-dynamic-symbol.
3806 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3807 --export-dynamic-symbol.
3808 (Symbol_table::gc_mark_undef_symbols): Likewise.
3809 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3811 2012-04-12 David S. Miller <davem@davemloft.net>
3813 * sparc.cc (Reloc::wdisp10): New relocation method.
3814 (Reloc::h34): Likewise.
3815 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3816 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3818 (Target_sparc::Scan::local): Likewise.
3819 (Target_sparc::Scan::global): Likewise.
3820 (Target_sparc::Relocate::relocate): Likewise.
3822 2012-04-09 Cary Coutant <ccoutant@google.com>
3824 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3827 2012-04-06 Ian Lance Taylor <iant@google.com>
3829 * timer.cc: #include <unistd.h>.
3831 2012-04-06 Roland McGrath <mcgrathr@google.com>
3833 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3834 * config.in: Regenerate.
3835 * configure: Regenerate.
3837 2012-04-05 Nick Clifton <nickc@redhat.com>
3839 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3840 (AM_LC_MESSAGES): Add.
3841 * aclocal.m4: Regenerate.
3842 * config.in: Regenerate.
3843 * configure: Regenerate.
3845 2012-03-21 Cary Coutant <ccoutant@google.com>
3847 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3848 * Makefile.in: Regenerate.
3849 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3850 (Sized_elf_reloc_mapper::symbol_section): New function.
3851 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3852 (make_elf_reloc_mapper): New function.
3853 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3854 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3855 (Dwarf_abbrev_table::do_get_abbrev): New function.
3856 (Dwarf_ranges_table::read_ranges_table): New function.
3857 (Dwarf_ranges_table::read_range_list): New function.
3858 (Dwarf_pubnames_table::read_section): New function.
3859 (Dwarf_pubnames_table::read_header): New function.
3860 (Dwarf_pubnames_table::next_name): New function.
3861 (Dwarf_die::Dwarf_die): New function.
3862 (Dwarf_die::read_attributes): New function.
3863 (Dwarf_die::skip_attributes): New function.
3864 (Dwarf_die::set_name): New function.
3865 (Dwarf_die::set_linkage_name): New function.
3866 (Dwarf_die::attribute): New function.
3867 (Dwarf_die::string_attribute): New function.
3868 (Dwarf_die::int_attribute): New function.
3869 (Dwarf_die::uint_attribute): New function.
3870 (Dwarf_die::ref_attribute): New function.
3871 (Dwarf_die::child_offset): New function.
3872 (Dwarf_die::sibling_offset): New function.
3873 (Dwarf_info_reader::check_buffer): New function.
3874 (Dwarf_info_reader::parse): New function.
3875 (Dwarf_info_reader::do_parse): New function.
3876 (Dwarf_info_reader::do_read_string_table): New function.
3877 (Dwarf_info_reader::lookup_reloc): New function.
3878 (Dwarf_info_reader::get_string): New function.
3879 (Dwarf_info_reader::visit_compilation_unit): New function.
3880 (Dwarf_info_reader::visit_type_unit): New function.
3881 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3882 Sized_elf_reloc_mapper.
3883 (Sized_dwarf_line_info::symbol_section): Remove function.
3884 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3885 (Sized_dwarf_line_info::read_line_mappings): Remove object
3886 parameter, adjust callers.
3887 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3888 * dwarf_reader.h: Include <sys/types.h>.
3889 (class Track_relocs): Remove forward declaration.
3890 (class Elf_reloc_mapper): New class.
3891 (class Sized_elf_reloc_mapper): New class.
3892 (class Dwarf_abbrev_table): New class.
3893 (class Dwarf_range_list): New class.
3894 (class Dwarf_ranges_table): New class.
3895 (class Dwarf_pubnames_table): New class.
3896 (class Dwarf_die): New class.
3897 (class Dwarf_info_reader): New class.
3898 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3899 (Sized_dwarf_line_info::symbol_section): Remove member function.
3900 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3902 * gdb-index.cc: New source file.
3903 * gdb-index.h: New source file.
3904 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3905 and .debug_types sections, call Layout::add_to_gdb_index.
3906 (Sized_relobj_incr::do_section_name): Implement.
3907 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3908 return type; Implement.
3909 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3911 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3912 parameter list and return type.
3913 (Sized_incr_dynobj::do_section_contents): Likewise.
3914 * layout.cc: Include gdb-index.h.
3915 (Layout::Layout): Initialize gdb_index_data_.
3916 (Layout::init_fixed_output_section): Check for .gdb_index section.
3917 (Layout::add_to_gdb_index): New function. Instantiate.
3918 * layout.h: Add forward declaration for class Gdb_index.
3919 (Layout::add_to_gdb_index): New member function.
3920 (Layout::gdb_index_data_): New data member.
3921 * main.cc: Include gdb-index.h.
3922 (main): Print statistics for gdb index.
3923 * object.cc (Object::section_contents): Move code into
3924 do_section_contents.
3925 (need_decompressed_section): Check for sections needed when building
3927 (build_compressed_section_map): Likewise.
3928 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3930 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3931 sections; call Layout::add_to_gdb_index.
3932 (Sized_relobj_file::do_decompressed_section_contents): Call
3933 do_section_contents directly.
3934 * object.h (Object::do_section_contents): Adjust parameter list and
3936 (Object::do_decompressed_section_contents): Call do_section_contents
3938 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3940 * options.h (class General_options): Add --gdb-index option.
3941 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3942 list and return type.
3943 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3944 * reloc.h (Track_relocs::checkpoint): New function.
3945 (Track_relocs::reset): New function.
3947 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3949 * testsuite/Makefile.in: Regenerate.
3950 * testsuite/gdb_index_test.cc: New test source file.
3951 * testsuite/gdb_index_test_1.sh: New test source file.
3952 * testsuite/gdb_index_test_2.sh: New test source file.
3954 2012-03-19 Doug Kwan <dougkwan@google.com>
3956 * arm.cc (Target_arm::do_define_standard_symbols): New method.
3957 (Target_arm::do_finalize_sections): Remove code which defines
3958 __exidx_start and __exidx_end. Make symbol table parameter
3959 anonymous as it is not used.
3960 * gold.cc (queue_middle_tasks): Call target hook to define any
3961 target-specific symbols.
3962 * target.h (Target::define_standard_symbols): New method.
3963 (Target::do_define_standard_symbols): Same.
3964 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3965 * testsuite/Makefile.in: Regenerate.
3966 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3968 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3969 relocations are generated for __exidx_start and __exidx_end.
3971 2012-03-16 Doug Kwan <dougkwan@google.com>
3973 * testsuite/Makefile.am: Disable test initpri3b.
3974 * testsuite/Makefile.in: Regenerate.
3976 2012-03-15 Doug Kwan <dougkwan@google.com>
3978 * arm.cc (Target_arm::got_section): Make .got section read-only
3981 2012-03-15 Ian Lance Taylor <iant@google.com>
3984 * layout.cc (Layout::make_output_section): Correctly mark
3985 SHT_INIT_ARRAY, et. al., as relro.
3987 2012-03-14 Doug Kwan <dougkwan@google.com>
3989 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3990 dynamic relocations for protected symbols in shared objects.
3992 2012-03-13 Ian Lance Taylor <iant@google.com>
3994 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3995 keep the larger alignment.
3997 2012-03-12 Cary Coutant <ccoutant@google.com>
3999 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4000 handling of DW_LNE_define_file.
4002 2012-03-12 Cary Coutant <ccoutant@google.com>
4004 * reduced_debug_output.cc
4005 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4008 2012-02-29 Cary Coutant <ccoutant@google.com>
4010 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4012 2012-02-29 Cary Coutant <ccoutant@google.com>
4014 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4015 Call Object::decompressed_section_contents.
4016 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4018 (Sized_dwarf_line_info::buffer_start_): New data member.
4019 * merge.cc (Output_merge_data::do_add_input_section): Call
4020 Object::decompressed_section_contents.
4021 (Output_merge_string::do_add_input_section): Likewise.
4022 * object.cc (need_decompressed_section): New function.
4023 (build_compressed_section_map): Decompress sections needed later.
4024 (Sized_relobj_file::do_decompressed_section_contents): New function.
4025 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4026 * object.h (Object::decompressed_section_contents): New function.
4027 (Object::discard_decompressed_sections): New function.
4028 (Object::do_decompressed_section_contents): New function.
4029 (Object::do_discard_decompressed_sections): New function.
4030 (Compressed_section_info): New type.
4031 (Compressed_section_map): Include decompressed section contents.
4032 (Sized_relobj_file::do_decompressed_section_contents): New function.
4033 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4035 2012-02-16 Cary Coutant <ccoutant@google.com>
4037 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4038 * testsuite/Makefile.in: Regenerate.
4040 2012-02-14 Cary Coutant <ccoutant@google.com>
4042 * options.cc (General_options::finalize): Disallow -pie and -static.
4044 2012-02-03 Doug Kwan <dougkwan@google.com>
4046 * arm.cc (Arm_relocate_functions::abs8,
4047 Arm_relocate_functions::abs16): Use
4048 Bits::has_signed_unsigned_overflow32.
4049 (Arm_relocate_functions::thm_abs8): Correct range of
4051 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4054 2012-02-02 Doug Kwan <dougkwan@google.com>
4056 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4057 position independent outputs, not just shared objects.
4059 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4061 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4062 * configure: Regenerated.
4064 2012-01-27 Ian Lance Taylor <iant@google.com>
4066 * reloc.h (Bits): New class with static functions, copied from
4067 namespace utils in arm.cc.
4068 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4071 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4073 * incremental.cc (write_info_blocks): Correct relocation offset.
4075 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4077 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4078 (Relocate::tls_gd_to_le): Likewise.
4080 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4082 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4084 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4086 * configure.ac: Check if -mcmodel=medium works.
4087 * configure: Regenerated.
4089 2012-01-24 Cary Coutant <ccoutant@google.com>
4091 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4093 (read_unsigned_LEB_128_x): ... this new function.
4094 (read_signed_LEB_128): Replaced with inline definition and ...
4095 (read_signed_LEB_128_x): ... this new function.
4096 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4097 (read_unsigned_LEB_128): Add inline definition.
4098 (read_signed_LEB_128_x): New function.
4099 (read_signed_LEB_128): Add inline definition.
4100 * testsuite/Makefile.am (leb128_unittest): New unit test.
4101 * testsuite/Makefile.in: Regenerate.
4102 * testsuite/leb128_unittest.cc: New unit test.
4104 2012-01-23 Ian Lance Taylor <iant@google.com>
4107 * i386.cc (Target_i386::do_code_fill): When using a jmp
4108 instruction, pad with nop instructions.
4109 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4111 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4113 * x86_64.cc (gc_process_relocs): Add typename on types used in
4115 (scan_relocs): Likewise.
4116 (relocate_section): Likewise.
4117 (apply_relocation): Likewise.
4119 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4121 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4122 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4125 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4127 * x86_64.cc: Initial support for x32.
4129 2012-01-03 Cary Coutant <ccoutant@google.com>
4131 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4132 Use abstract base class for GOT.
4133 * gold/output.h (class Output_data_got_base): New abstract base class.
4134 (class Output_data_got): Derive from new base class, adjust ctors.
4135 (Output_data_got::reserve_slot): Make virtual; rename to
4136 do_reserve_slot; Adjust callers.
4137 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4138 pointer to abstract base class.
4139 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4141 2011-12-18 Ian Lance Taylor <iant@google.com>
4143 * object.h (Relobj::local_symbol_value): New function.
4144 (Relobj::local_plt_offset): New function.
4145 (Relobj::local_has_got_offset): New function.
4146 (Relobj::local_got_offset): New function.
4147 (Relobj::set_local_got_offset): New function.
4148 (Relobj::do_local_symbol_value): New pure virtual function.
4149 (Relobj::do_local_plt_offset): Likewise.
4150 (Relobj::do_local_has_got_offset): Likewise.
4151 (Relobj::do_local_got_offset): Likewise.
4152 (Relobj::do_set_local_got_offset): Likewise.
4153 (Sized_relobj::do_local_has_got_offset): Rename from
4154 local_has_got_offset.
4155 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4156 (Sized_relobj::do_set_local_got_offset): Rename from
4157 set_local_got_offset.
4158 (Sized_relobj_file::do_local_plt_offset): Rename from
4160 (Sized_relobj_file::do_local_symbol_value): New function.
4161 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4163 * output.cc (Output_data_got::Got_entry::write): Change object to
4164 Relobj. Use local_symbol_value.
4165 (Output_data_got::add_global_with_rel): Change rel_dyn to
4166 Output_data_reloc_generic*. Use add_global_generic.
4167 (Output_data_got::add_global_with_rela): Remove. Change all
4168 callers to use add_global_with_rel.
4169 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4170 Output_data_reloc_generic*. Use add_global_generic.
4171 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4172 callers to use add_global_pair_with_rel.
4173 (Output_data_got::add_local): Change object to Relobj*.
4174 (Output_data_got::add_local_plt): Likewise.
4175 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4176 change rel_dyn to Output_data_reloc_generic*. Use
4178 (Output_data_got::add_local_with_rela): Remove. Change all
4179 callers to use all_local_with_rel.
4180 (Output_data_got::add_local_pair_with_rel): Change object to
4181 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4182 add_output_section_generic.
4183 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4184 callers to use add_local_pair_with_rel.
4185 (Output_data_got::reserve_local): Change object to Relobj*.
4186 * output.h: (class Output_data_reloc_generic): Add pure virtual
4187 declarations for add_global_generic, add_local_generic,
4188 add_output_section_generic.
4189 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4190 functions for Output_data_reloc_generic. Update declarations for
4191 changes listed in output.cc.
4192 (class Output_data_got): Change template parameter to got_size.
4193 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4194 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4196 (Sized_relobj_incr::do_local_plt_offset): New function.
4197 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4200 2011-12-17 Cary Coutant <ccoutant@google.com>
4202 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4203 * resolve.cc (Symbol_table::resolve): Likewise.
4204 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4206 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4208 2011-12-16 Ian Lance Taylor <iant@google.com>
4210 * output.h (Output_data_reloc_generic::add): Only call
4211 add_dynamic_reloc if this is a dynamic reloc section.
4213 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4216 * target-reloc.h (apply_relocation): Replace <64, false> with
4219 2011-11-25 Nick Clifton <nickc@redhat.com>
4221 * po/it.po: New Italian translation.
4223 2011-11-17 Sterling Augustine <saugustine@google.com>
4225 * script.cc (script_include_directive): Implement.
4226 (read_script_file): New local variables name and search_path. Update
4227 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4228 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4229 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4231 2011-11-11 Sterling Augustine <saugustine@google.com>
4233 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4234 (file_or_sections_cmd): Likewise.
4236 2011-11-11 Doug Kwan <dougkwan@google.com>
4238 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4239 if --just-symbols is given.
4241 2011-11-10 Doug Kwan <dougkwan@google.com>
4244 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4245 when processing data relocs.
4246 * reloc.h (Relocate_functions::rel_unaligned): New method.
4247 (Relocate_functions::pcrel_unaligned): Ditto.
4248 (Relocate_functions::rel32_unaligned): Ditto.
4249 (Relocate_functions::pcrel32_unaligned): Ditto.
4251 2011-11-09 Doug Kwan <dougkwan@google.com>
4254 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4255 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4256 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4257 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4258 (Relocate_functions::rel_unaligned): New.
4259 (Relocate_functions::rel32_unaligned): New.
4260 * target-reloc.h (relocate_for_relocatable): Add code to handle
4261 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4262 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4263 arm_unaligned_reloc_r): New targets.
4264 * testsuite/Makefile.in: Regenerate.
4265 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4268 2011-11-02 Ian Lance Taylor <iant@google.com>
4270 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4272 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4273 * options.cc (General_options::finalize): Use library search path
4274 from configure script if specified. If not native and no sysroot,
4275 only search TOOLLIBDIR.
4276 * options.h (Search_directory::Search_directory): Change name to
4278 (General_options::add_to_library_path_with_sysroot): Change arg to
4280 * configure, Makefile.in, config.in: Rebuild.
4282 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4284 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4285 we are working around the ARM1176 Erratum.
4286 * options.h (General_options::fix_arm1176): Add option.
4287 * testsuite/Makefile.am: Add testcases, and keep current ones
4289 * testsuite/Makefile.in: Regenerate.
4290 * testsuite/arm_fix_1176.s: New file.
4291 * testsuite/arm_fix_1176.sh: Likewise.
4293 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4295 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4297 (Target_arm::may_use_blx): Remove method.
4298 (Target_arm::set_may_use_blx): Likewise.
4299 (Target_arm::may_use_v4t_interworking): New method.
4300 (Target_arm::may_use_v5t_interworking): Likewise.
4301 (Target_arm::may_use_blx_): Remove member variable.
4302 (Arm_relocate_functions::arm_branch_common): Check for v5T
4304 (Arm_relocate_functions::thumb_branch_common): Likewise.
4305 (Reloc_stub::stub_type_for_reloc): Likewise.
4306 (Target_arm::do_finalize_sections): Correct interworking checks.
4307 * testsuite/Makefile.am: Add new tests.
4308 * testsuite/Makefile.in: Regenerate.
4309 * testsuite/arm_farcall_arm_arm.s: New test.
4310 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4311 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4312 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4313 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4314 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4315 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4316 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4318 2011-10-31 Cary Coutant <ccoutant@google.com>
4321 * expression.cc (Expression::eval_with_dot): Add
4322 is_section_dot_assignment parameter.
4323 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4324 absolute and assigning to dot within a section.
4325 * script-sections.cc
4326 (Output_section_element_assignment::set_section_addresses): Pass
4327 dot_section to set_if_absolute.
4328 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4329 as is_section_dot_assignment flag to eval_with_dot.
4330 (Output_section_element_dot_assignment::set_section_addresses):
4332 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4333 parameter. Also set value if relative to dot_section; set the
4334 symbol's output_section.
4335 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4336 parameter. Adjust all callers.
4337 (Expression::eval_maybe_dot): Likewise.
4338 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4340 * testsuite/script_test_2.t: Test assignment of an absolute value
4341 to dot within an output section element.
4343 2011-10-31 Cary Coutant <ccoutant@google.com>
4345 * options.h (class General_options): Add --[no-]gnu-unique options.
4346 * symtab.cc (Symbol_table::sized_write_globals): Convert
4347 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4349 2011-10-31 Cary Coutant <ccoutant@google.com>
4352 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4353 unnecessary assertion.
4354 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4356 2011-10-31 Sriraman Tallam <tmsriram@google.com>
4358 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4360 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4362 Change to just keep the section associated with symbol.
4363 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4364 they are externally visible and --export-dynamic is turned on.
4365 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4367 2011-10-19 Ian Lance Taylor <iant@google.com>
4370 * script-sections.cc
4371 (Output_section_element_dot_assignment::needs_output_section): New
4374 2011-10-19 Ian Lance Taylor <iant@google.com>
4377 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4378 --section-start option was seen.
4379 * options.h (General_options::any_section_start): New function.
4381 2011-10-18 David S. Miller <davem@davemloft.net>
4384 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4385 member to track relocation locations that have moved during TLS
4386 reloc optimizations.
4387 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4388 (Target_sparc::Relocate::relocate): Adjust view down by 4
4389 bytes if it matches reloc_adjust_addr_.
4390 (Target_sparc::Relocate::relocate_tls): Always move the
4391 __tls_get_addr call delay slot instruction forward 4 bytes when
4392 performing relaxation.
4394 2011-10-18 Cary Coutant <ccoutant@google.com>
4396 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4397 (Output_file::map_no_anonymous): Check for non-zero
4398 return code from posix_fallocate.
4400 2011-10-17 Cary Coutant <ccoutant@google.com>
4403 * plugin.cc (is_visible_from_outside): Check for symbols
4404 referenced from dynamic objects.
4405 * resolve.cc (Symbol_table::resolve): Don't count references
4406 from dynamic objects as references from real ELF files.
4407 * testsuite/plugin_test_2.sh: Adjust expected result.
4409 2011-10-17 Cary Coutant <ccoutant@google.com>
4411 * gold.cc: Include timer.h.
4412 (queue_middle_tasks): Stamp time.
4413 (queue_final_tasks): Likewise.
4414 * main.cc (main): Store timer in parameters. Print timers
4416 * parameters.cc (Parameters::Parameters): Initialize timer_.
4417 (Parameters::set_timer): New function.
4418 (set_parameters_timer): New function.
4419 * parameters.h (Parameters::set_timer): New function.
4420 (Parameters::timer): New function.
4421 (Parameters::timer_): New data member.
4422 (set_parameters_timer): New function.
4423 * timer.cc (Timer::stamp): New function.
4424 (Timer::get_pass_time): New function.
4425 * timer.h (Timer::stamp): New function.
4426 (Timer::get_pass_time): New function.
4427 (Timer::pass_times_): New data member.
4429 2011-10-17 Cary Coutant <ccoutant@google.com>
4431 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4432 task for members of lib groups.
4434 2011-10-17 Cary Coutant <ccoutant@google.com>
4437 * fileread.cc (File_read::find_view): Add assert.
4438 (File_read::make_view): Move bounds check (replace with assert)...
4439 (File_read::find_or_make_view): ... to here.
4441 2011-10-12 Cary Coutant <ccoutant@google.com>
4443 * output.cc (Output_file::open_base_file): Handle case where
4444 ::read returns less than requested size.
4446 2011-10-10 Cary Coutant <ccoutant@google.com>
4448 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
4449 Initialize defined_count_.
4450 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4451 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4452 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4453 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4454 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4455 * incremental.h (Sized_relobj_incr::defined_count_): New data
4457 (Sized_incr_dynobj::defined_count_): New data member.
4458 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
4459 Return zeroes instead of internal error.
4461 2011-10-10 Cary Coutant <ccoutant@google.com>
4464 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
4465 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4466 * output.h (class Output_reloc): Add use_plt_offset flag.
4467 (Output_reloc::type_): Adjust size of bit field.
4468 (Output_reloc::use_plt_offset_): New bit field.
4469 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4470 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4471 flag. Adjust all callers.
4472 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
4473 creating RELATIVE relocations.
4475 2011-10-10 Nick Clifton <nickc@redhat.com>
4477 * po/es.po: Updated Spanish translation.
4478 * po/fi.po: Updated Finnish translation.
4480 2011-10-03 Diego Novillo <dnovillo@google.com>
4482 * options.cc (parse_uint): Fix dereference of RETVAL.
4484 2011-09-29 Sriraman Tallam <tmsriram@google.com>
4486 * layout.h (section_order_map_): New member.
4487 (get_section_order_map): New member function.
4488 * output.cc (Output_section::add_input_section): Check for patterns
4489 only when --section-ordering-file is specified.
4490 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4491 output_sections have been formed.
4492 * layout.cc (Layout_Layout): Initialize section_order_map_.
4493 * plugin.cc (update_section_order): Store order in order_map. Do not
4495 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4496 * testsuite/Makefile.in: Regenerate.
4497 * testsuite/plugin_section_order.c: New file.
4498 * testsuite/plugin_final_layout.cc: New file.
4499 * testsuite/plugin_final_layout.sh: New file.
4501 2011-09-29 Cary Coutant <ccoutant@google.com>
4503 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4505 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
4506 symbols during incremental update.
4507 (Symbol_table::add_from_dynobj): Likewise.
4509 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4510 Ian Lance Taylor <iant@google.com>
4512 * symtab.cc (Symbol_table::define_special_symbol): Always
4513 canonicalize version string.
4515 2011-09-26 Cary Coutant <ccoutant@google.com>
4517 * gold.cc (queue_initial_tasks): Move option checks ...
4518 * options.cc (General_options::finalize): ... to here. Disable
4519 some options; make others fatal.
4521 2011-09-26 Cary Coutant <ccoutant@google.com>
4524 * plugin.cc (get_symbols_v2): New function.
4525 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4526 (is_referenced_from_outside): New function.
4527 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4528 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4529 (get_symbols): Pass version parameter.
4530 (get_symbols_v2): New function.
4531 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4533 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4534 (onload): Add LDPT_GET_SYMBOLS_V2.
4535 (all_symbols_read_hook): Use get_symbols_v2; check for
4536 LDPR_PREVAILING_DEF_IRONLY_EXP.
4537 * testsuite/plugin_test_3.sh: Update expected results.
4539 2011-09-23 Simon Baldwin <simonb@google.com>
4541 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4542 configuration options.
4543 * configure: Regenerate.
4544 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4545 * Makefile.in: Regenerate.
4546 * testsuite/Makefile.in: Regenerate.
4548 2011-09-19 Sriraman Tallam <tmsriram@google.com>
4550 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4552 2011-09-19 Cary Coutant <ccoutant@google.com>
4554 * incremental.cc (can_incremental_update): Fix typo in comment.
4555 * incremental.h (can_incremental_update): Likewise.
4557 2011-09-18 Cary Coutant <ccoutant@google.com>
4559 * incremental.cc (can_incremental_update): New function.
4560 * incremental.h (can_incremental_update): New function.
4561 * layout.cc (Layout::init_fixed_output_section): Call it.
4562 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4563 * object.cc (Sized_relobj_file::do_layout): Call
4564 can_incremental_update.
4566 2011-09-13 Cary Coutant <ccoutant@google.com>
4568 * configure.ac: Check for glibc support for gnu_indirect_function
4569 support with static linking, setting automake conditional
4571 * Makefile.in: Regenerate.
4572 * configure: Regenerate.
4574 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4575 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4577 * testsuite/Makefile.in: Regenerate.
4579 2011-09-13 Cary Coutant <ccoutant@google.com>
4581 * incremental.cc (Sized_relobj_incr::do_layout): Call
4582 report_comdat_group for kept comdat sections.
4583 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4584 * testsuite/Makefile.in: Regenerate.
4585 * testsuite/incr_comdat_test_1.cc: New source file.
4586 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4587 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4588 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4590 2011-09-13 Ian Lance Taylor <iant@google.com>
4592 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4593 variable external_symbols_offset.
4595 2011-09-12 Ian Lance Taylor <iant@google.com>
4597 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4598 triggered if object has no symbols.
4600 2011-09-09 David S. Miller <davem@davemloft.net>
4602 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4603 (Output_fill_debug_line::do_write): Likewise.
4605 2011-08-29 Cary Coutant <ccoutant@google.com>
4607 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4608 casts to match formatting specs.
4609 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4611 2011-08-26 Cary Coutant <ccoutant@google.com>
4613 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4614 remaining hole size when allocating.
4615 (Layout::make_output_section): Set fill methods for debug sections.
4616 * layout.h (Free_list::Free_list_node): Move from private to
4618 (Free_list::set_min_hole_size): New function.
4619 (Free_list::begin, Free_list::end): New functions.
4620 (Free_list::min_hole_): New data member.
4621 * output.cc: Include dwarf.h.
4622 (Output_fill_debug_info::do_minimum_hole_size): New function.
4623 (Output_fill_debug_info::do_write): New function.
4624 (Output_fill_debug_line::do_minimum_hole_size): New function.
4625 (Output_fill_debug_line::do_write): New function.
4626 (Output_section::Output_section): Initialize new data member.
4627 (Output_section::set_final_data_size): Ensure patch space is larger
4628 than minimum hole size.
4629 (Output_section::do_write): Fill holes in debug sections.
4630 * output.h (Output_fill): New class.
4631 (Output_fill_debug_info): New class.
4632 (Output_fill_debug_line): New class.
4633 (Output_section::set_free_space_fill): New function.
4634 (Output_section::free_space_fill_): New data member.
4635 * testsuite/Makefile.am (incremental_test_3): Add
4636 --incremental-patch option.
4637 (incremental_test_4): Likewise.
4638 (incremental_test_5): Likewise.
4639 (incremental_test_6): Likewise.
4640 (incremental_copy_test): Likewise.
4641 (incremental_common_test_1): Likewise.
4642 * testsuite/Makefile.in: Regenerate.
4644 2011-08-26 Nick Clifton <nickc@redhat.com>
4646 * po/es.po: Updated Spanish translation.
4648 2011-08-01 Cary Coutant <ccoutant@google.com>
4650 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4651 * gold/testsuite/Makefile.in: Regenerate.
4652 * gold/testsuite/justsyms_exec.c: New source file.
4653 * gold/testsuite/justsyms_lib.c: New source file.
4655 2011-08-01 Cary Coutant <ccoutant@google.com>
4657 * layout.cc (Layout::set_segment_offsets): Don't realign text
4658 segment if -Ttext was specified.
4659 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4661 * object.h (Sized_relobj_file::e_type): New function.
4662 (Sized_relobj_file::e_type_): New data member.
4663 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4664 base address for ET_EXEC files.
4665 * target.cc (Target::do_make_elf_object_implementation): Allow
4666 ET_EXEC files with --just-symbols option.
4668 2011-07-28 Cary Coutant <ccoutant@google.com>
4670 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4671 Add thread_number parameter.
4672 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4673 * workqueue-threads.cc
4674 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4675 current thread if its thread number is greater than desired thread
4677 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4678 Add thread_number parameter.
4679 (Workqueue::should_cancel_thread): Likewise.
4680 (Workqueue::find_runnable_or_wait): Pass thread_number to
4681 should_cancel_thread.
4682 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4685 2011-07-22 Sriraman Tallam <tmsriram@google.com>
4687 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4688 only after checking if it cannot be forced local.
4689 * symtab.h (is_externally_visible): Check if the symbol is not forced
4692 2011-07-15 Ian Lance Taylor <iant@google.com>
4694 * options.h (class General_options): Add --print-output-format.
4695 Move -EL next to -EB, for better --help output.
4696 * target-select.cc: Include <cstdio>, "options.h", and
4698 (Target_selector::do_target_bfd_name): New function.
4699 (print_output_format): New function.
4700 * target-select.h (class Target_selector): Update declarations.
4701 (Target_selector::target_bfd_name): New function.
4702 (print_output_format): Declare.
4703 * main.cc: Include "target-select.h".
4704 (main): Handle --print-output-format.
4705 * gold.cc: Include "target-select.h".
4706 (queue_initial_tasks): Handle --print-output-format when there are
4708 * parameters.cc (parameters_force_valid_target): Give a better
4709 error message if -EB/-EL does not match target.
4710 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4713 2011-07-15 Ian Lance Taylor <iant@google.com>
4715 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4716 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4717 (Output_data_plt_i386::do_write): Write address of .dynamic
4718 section to first entry in .got.plt section.
4719 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4720 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4722 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4723 section to first entry in .got.plt section.
4724 * layout.h (Layout::dynamic_section): New function.
4726 2011-07-13 Sriraman Tallam <tmsriram@google.com>
4728 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4730 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4731 input_section_position_, and input_section_glob_.
4732 (read_layout_from_file): Call function section_ordering_specified.
4733 * layout.h (is_section_ordering_specified): New function.
4734 (section_ordering_specified): New function.
4735 (section_ordering_specified_): New boolean member.
4736 * main.cc(main): Call load_plugins after layout object is defined.
4737 * output.cc (Output_section::add_input_section): Use
4738 function section_ordering_specified to check if section ordering is
4740 * output.cc (Output_section::add_relaxed_input_section): Use
4741 function section_ordering_specified to check if section ordering is
4743 (Output_section::update_section_layout): New function.
4744 (Output_section::sort_attached_input_sections): Check if input section
4746 * output.h (Output_section::update_section_layout): New function.
4747 * plugin.cc (get_section_count): New function.
4748 (get_section_type): New function.
4749 (get_section_name): New function.
4750 (get_section_contents): New function.
4751 (update_section_order): New function.
4752 (allow_section_ordering): New function.
4753 (Plugin::load): Add the new interfaces to the transfer vector.
4754 (Plugin_manager::load_plugins): New parameter.
4755 (Plugin_manager::all_symbols_read): New parameter.
4756 (Plugin_manager::claim_file): New parameter. Save the elf object for
4758 (Plugin_manager::get_elf_object): New function.
4759 (Plugin_manager::get_view): Change to directly use the bool to check
4760 if get_view is called from claim_file_hook.
4761 * plugin.h (input_objects): New function
4762 (Plugin__manager::load_plugins): New parameter.
4763 (Plugin_manager::claim_file): New parameter.
4764 (Plugin_manager::get_elf_object): New function.
4765 (Plugin_manager::in_claim_file_handler): New function.
4766 (Plugin_manager::in_claim_file_handler_): New member.
4767 (layout): New function.
4768 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4769 handler with an extra parameter. Make the elf object before calling
4771 * testsuite/plugin_test.c (get_section_count): New function pointer.
4772 (get_section_type): New function pointer.
4773 (get_section_name): New function pointer.
4774 (get_section_contents): New function pointer.
4775 (update_section_order): New function pointer.
4776 (allow_section_ordering): New function pointer.
4777 (onload): Check if the new interfaces exist.
4779 2011-07-13 Ian Lance Taylor <iant@google.com>
4781 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4783 * x86_64.cc (Target_x86_64::got_section): Likewise.
4784 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4785 (relro_now_test_SOURCES): New variable.
4786 (relro_now_test_DEPENDENCIES): New variable.
4787 (relro_now_test_LDFLAGS): New variable.
4788 (relro_now_test_LDADD): New variable.
4789 (relro_now_test.so): New target.
4790 * testsuite/Makefile.in: Rebuild.
4792 2011-07-12 Ian Lance Taylor <iant@google.com>
4795 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4796 GLOB_DAT relocation rather than a RELATIVE relocation for a
4797 protected symbol when creating a shared library.
4798 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4799 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4800 * testsuite/protected_main_1.cc (main): Test that protected
4801 function has same address.
4803 2011-07-11 Ian Lance Taylor <iant@google.com>
4806 * options.h (class General_options): Add -Bgroup.
4807 * options.cc (General_options::finalize): If -Bgroup is set,
4808 default to --unresolved-symbols=report-all.
4809 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4810 * target-reloc.h (issue_undefined_symbol_error): Handle
4811 --unresolved-symbols=report-all.
4813 2011-07-08 Ian Lance Taylor <iant@google.com>
4816 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4817 if linker script discards key sections.
4818 (Layout::create_dynamic_symtab): Likewise.
4819 (Layout::assign_local_dynsym_offsets): Likewise.
4820 (Layout::sized_create_version_sections): Likewise.
4821 (Layout::create_interp): Likewise.
4822 (Layout::finish_dynamic_section): Likewise.
4823 (Layout::set_dynamic_symbol_size): Likewise.
4825 2011-07-08 Ian Lance Taylor <iant@google.com>
4828 * options.h (class General_options): Add --unresolved-symbols.
4829 * target-reloc.h (issue_undefined_symbol_error): Check
4830 --unresolved-symbols. Add comments.
4832 2011-07-08 Ian Lance Taylor <iant@google.com>
4834 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4835 expression more complex.
4837 2011-07-08 Ian Lance Taylor <iant@google.com>
4840 * target-reloc.h (issue_undefined_symbol_error): New inline
4841 function, broken out of relocate_section.
4842 (relocate_section): Call issue_undefined_symbol_error.
4843 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4844 there is no TLS segment if we are about to issue an undefined
4846 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4848 2011-07-08 Ian Lance Taylor <iant@google.com>
4851 * resolve.cc (Symbol_table::should_override): Add fromtype
4852 parameter. Change all callers. Give error when linking together
4853 TLS and non-TLS symbol.
4854 (Symbol_table::should_override_with_special): Add fromtype
4855 parameter. Change all callers.
4856 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4857 there is no TLS segment if we have reported some errors.
4858 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4860 2011-07-08 Ian Lance Taylor <iant@google.com>
4863 * target.h (Target::plt_address_for_global): New function.
4864 (Target::plt_address_for_local): New function.
4865 (Target::plt_section_for_global): Remove.
4866 (Target::plt_section_for_local): Remove.
4867 (Target::do_plt_address_for_global): New virtual function.
4868 (Target::do_plt_address_for_local): New virtual function.
4869 (Target::do_plt_section_for_global): Remove.
4870 (Target::do_plt_section_for_local): Remove.
4871 (Target::register_global_plt_entry): Add Symbol_table and Layout
4873 * output.cc (Output_data_got::Got_entry::write): Use
4874 plt_address_for_global and plt_address_for_local.
4875 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4876 address of output section.
4877 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4878 got_irelative_, and irelative_count_ fields. Update
4880 (Output_data_plt_i386::has_irelative_section): New function.
4881 (Output_data_plt_i386::entry_count): Add irelative_count_.
4882 (Output_data_plt_i386::set_final_data_size): Likewise.
4883 (class Target_i386): Add got_irelative_ and rel_irelative_
4884 fields. Update declarations.
4885 (Target_i386::Target_i386): Initialize new fields.
4886 (Target_i386::do_plt_address_for_global): New function replacing
4887 do_plt_section_for_global.
4888 (Target_i386::do_plt_address_for_local): New function replacing
4889 do_plt_section_for_local.
4890 (Target_i386::got_section): Create got_irelative_.
4891 (Target_i386::rel_irelative_section): New function.
4892 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4893 fields. Don't define __rel_iplt_{start,end}.
4894 (Output_data_plt_i386::add_entry): Add symtab and layout
4895 parameters. Change all callers. Use different PLT and GOT for
4897 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4898 layout parameters. Change all callers. Use different PLT and
4900 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4901 (Output_data_plt_i386::rel_irelative): New function.
4902 (Output_data_plt_i386::address_for_global): New function.
4903 (Output_data_plt_i386::address_for_local): New function.
4904 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4905 IRELATIVE GOT when changing IFUNC GOT entries.
4906 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4908 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4909 if we didn't create an IRELATIVE GOT.
4910 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4911 plt_address_for_local.
4912 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4913 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4914 got_irelative_, and irelative_count_ fields. Update
4916 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4917 Initialize new fields. Remove symtab parameter. Change all
4919 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4921 (Output_data_plt_x86_64::has_irelative_section): New function.
4922 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4923 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4924 fields. Update declarations.
4925 (Target_x86_64::Target_x86_64): Initialize new fields.
4926 (Target_x86_64::do_plt_address_for_global): New function replacing
4927 do_plt_section_for_global.
4928 (Target_x86_64::do_plt_address_for_local): New function replacing
4929 do_plt_section_for_local.
4930 (Target_x86_64::got_section): Create got_irelative_.
4931 (Target_x86_64::rela_irelative_section): New function.
4932 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4933 all callers. Don't create __rel_iplt_{start,end}.
4934 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4935 parameters. Change all callers. Use different PLT and GOT for
4937 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4938 layout parameters. Change all callers. Use different PLT and
4940 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4941 parameters. Change all callers. Use different PLT and GOT for
4943 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4944 (Output_data_plt_x86_64::rela_irelative): New function.
4945 (Output_data_plt_x86_64::address_for_global): New function.
4946 (Output_data_plt_x86_64::address_for_local): New function.
4947 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4948 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4949 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4950 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4952 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4954 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4955 symbols if we didn't create an IRELATIVE GOT.
4956 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4957 plt_address_for_local.
4958 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4959 * testsuite/ifuncvar1.c: New test file.
4960 * testsuite/ifuncvar2.c: New test file.
4961 * testsuite/ifuncvar3.c: New test file.
4962 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4963 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4964 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4965 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4966 * testsuite/Makefile.in: Rebuild.
4968 2011-07-07 Cary Coutant <ccoutant@google.com>
4970 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4971 (two_file_test_1_ndebug.o): Likewise.
4972 (two_file_test_1b_ndebug.o): Likewise.
4973 (two_file_test_2_ndebug.o): Likewise.
4974 (two_file_test_main_ndebug.o): Likewise.
4975 (incremental_test_2): Link with no-debug versions.
4977 2011-07-06 Cary Coutant <ccoutant@google.com>
4979 * gold/incremental.cc
4980 (Output_section_incremental_inputs::write_info_blocks): Check for
4981 hidden and internal symbols.
4983 2011-07-06 Cary Coutant <ccoutant@google.com>
4985 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4986 Check disposition for startup file.
4987 (Incremental_inputs::report_command_line): Ignore
4988 --incremental-startup-unchanged option.
4989 * options.cc (General_options::parse_incremental_startup_unchanged):
4991 (General_options::General_options): Initialize new data member.
4992 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4993 (General_options): Add --incremental-startup-unchanged option.
4994 (General_options::incremental_startup_disposition): New function.
4995 (General_options::incremental_startup_disposition_): New data member.
4997 2011-07-06 Cary Coutant <ccoutant@google.com>
4999 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5000 input file index to Script_info ctor.
5001 (Sized_incremental_binary::do_file_has_changed): Find the
5002 command-line argument for files named in scripts.
5003 * incremental.h (Script_info::Script_info): New ctor
5004 with input file index.
5005 (Script_info::input_file_index): New function.
5006 (Script_info::input_file_index_): New data member.
5007 (Incremental_binary::get_library): Add const.
5008 (Incremental_binary::get_script_info): Add const.
5009 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5010 * testsuite/Makefile.am (incremental_test_5): New test case.
5011 (incremental_test_6): New test case.
5012 * testsuite/Makefile.in: Regenerate.
5014 2011-07-06 Cary Coutant <ccoutant@google.com>
5016 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5017 debug output when command lines differ.
5019 2011-07-06 Cary Coutant <ccoutant@google.com>
5021 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5022 --incremental-patch option.
5023 * layout.cc (Free_list::allocate): Extend allocation beyond original
5025 (Layout::make_output_section): Mark sections that should get
5027 * options.cc (parse_percent): New function.
5028 * options.h (parse_percent): New function.
5029 (DEFINE_percent): New macro.
5030 (General_options): Add --incremental-patch option.
5031 * output.cc (Output_section::Output_section): Initialize new data
5033 (Output_section::add_input_section): Print section name when out
5035 (Output_section::add_output_section_data): Likewise.
5036 (Output_section::set_final_data_size): Add patch space when
5037 doing --incremental-full.
5038 (Output_section::do_reset_address_and_file_offset): Remove patch
5040 (Output_segment::set_section_list_addresses): Print debug output
5041 only if --incremental-update.
5042 * output.h (Output_section::set_is_patch_space_allowed): New function.
5043 (Output_section::is_patch_space_allowed_): New data member.
5044 (Output_section::patch_space_): New data member.
5045 * parameters.cc (Parameters::incremental_full): New function.
5046 * parameters.h (Parameters::incremental_full): New function
5047 * testsuite/Makefile.am (incremental_test_2): Add test for
5048 --incremental-patch option.
5049 * testsuite/Makefile.in: Regenerate.
5050 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5051 (t18): Remove function body.
5053 2011-07-05 Doug Kwan <dougkwan@google.com>
5056 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5057 Arm_Address type for relocation result.
5058 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5060 (Arm_relocate_functions::abs32): Use unaligned access.
5061 (Arm_relocate_functions::rel32): Ditto.
5062 (Arm_relocate_functions::prel31): Ditto.
5063 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5064 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5065 static data relocations.
5066 * testsuite/Makefile.in: Regnerate.
5067 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5069 2011-07-05 Ian Lance Taylor <iant@google.com>
5072 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5073 symbols if necessary.
5074 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5076 2011-07-05 Ian Lance Taylor <iant@google.com>
5079 * resolve.cc (Symbol::override_base_with_special): Simply override
5080 version with special symbol version, ignoring previous version.
5082 2011-07-05 Ian Lance Taylor <iant@google.com>
5084 * object.cc (Sized_relobj_file::include_section_group): Add
5085 information to comment about signature location.
5087 2011-07-02 Ian Lance Taylor <iant@google.com>
5090 * options.h (class General_options): Add -f and -F.
5091 * options.cc (General_options::finalize): Fatal error if -f/-F
5092 are used without -shared.
5093 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5095 2011-07-02 Ian Lance Taylor <iant@google.com>
5097 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5099 2011-07-01 Ian Lance Taylor <iant@google.com>
5103 * resolve.cc (Symbol::override_base_with_special): Don't override
5104 the version if the overriding symbol has a different name.
5105 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5106 all callers. If we give an error about an undefined version,
5107 define the base version if necessary.
5108 * dynobj.h (class Versions): Update declaration.
5109 * testsuite/weak_alias_test_5.cc: New file.
5110 * testsuite/weak_alias_test.script: New file.
5111 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5112 and versioned_alias have the right value, and call t2.
5113 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5114 weak_alias_test_5.so.
5115 (weak_alias_test_LDADD): Likewise.
5116 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5117 * testsuite/Makefile.in: Rebuild.
5119 2011-07-01 Ian Lance Taylor <iant@google.com>
5122 * options.h (class General_options): Support -z notext.
5123 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5125 (two_file_shared_nonpic.so): Likewise.
5126 (two_file_shared_mixed.so): Likewise.
5127 (two_file_shared_mixed_1.so): Likewise.
5128 (weak_undef_lib_nonpic.so): Likewise.
5129 (alt/weak_undef_lib_nonpic.so): Likewise.
5130 (tls_test_shared_nonpic.so): Likewise.
5131 * testsuite/Makefile.in: Rebuild.
5133 2011-07-01 Ian Lance Taylor <iant@google.com>
5136 * configure.ac: Test whether static linking works, setting
5137 the automake conditional HAVE_STATIC.
5138 * testsuite/Makefile.am: Disable tests using -static if
5139 HAVE_STATIC is not true.
5140 * configure, testsuite/Makefile.in: Rebuild.
5142 2011-07-01 Ian Lance Taylor <iant@google.com>
5145 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5146 Assert if we see DW_EH_PE_indirect.
5147 * target.h (Target::ehframe_datarel_base): New function.
5148 (Target::do_ehframe_datarel_base): New target function.
5149 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5150 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5153 2011-07-01 Ian Lance Taylor <iant@google.com>
5156 * options.h (class General_options): Add
5157 --ld-generated-unwind-info.
5158 * ehframe.cc (Fde::write): Add address parameter. Change all
5159 callers. If associated with PLT, fill in address and size.
5160 (Cie::set_output_offset): Only add merge mapping if there is an
5162 (Cie::write): Add address parameter. Change all callers.
5163 (Eh_frame::add_ehframe_for_plt): New function.
5164 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5165 input_offset_ fields into union u_, with new plt field.
5166 (Fde::Fde): Adjust for new union field.
5167 (Fde::Fde) [Output_data version]: New constructor.
5168 (Fde::add_mapping): Only add merge mapping if there is an object.
5169 (class Cie): Update declarations.
5170 (class Eh_frame): Declare add_ehframe_for_plt.
5171 * layout.cc (Layout::layout_eh_frame): Break out code into
5172 make_eh_frame_section, and call it.
5173 (Layout::make_eh_frame_section): New function.
5174 (Layout::add_eh_frame_for_plt): New function.
5175 * layout.h (class Layout): Update declarations.
5176 * merge.cc (Merge_map::add_mapping): Add assertion.
5177 * i386.cc: Include "dwarf.h".
5178 (class Output_data_plt_i386): Make first_plt_entry,
5179 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5180 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5181 and plt_eh_frame_fde.
5182 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5183 boundary. Call add_eh_frame_for_plt if appropriate.
5184 * x86_64.cc: Include "dwarf.h".
5185 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5186 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5187 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5188 and plt_eh_frame_fde.
5189 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5192 2011-06-29 Ian Lance Taylor <iant@google.com>
5195 * object.cc (Sized_relobj_file::layout_section): Change shdr
5196 parameter to be const.
5197 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5199 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5200 appropriate. Call layout_eh_frame_section.
5201 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5203 * object.h (class Sized_relobj_file): Update declarations.
5205 2011-06-29 Ian Lance Taylor <iant@google.com>
5208 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5210 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5212 2011-06-29 Ian Lance Taylor <iant@google.com>
5215 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5217 * layout.cc (Layout::layout_eh_frame): Likewise.
5219 2011-06-29 Ian Lance Taylor <iant@google.com>
5222 * layout.cc (Layout::symtab_section_shndx): New function.
5223 * layout.h (class Layout): Declare symtab_section_shndx.
5224 * output.cc (Output_section::write_header): Call it.
5226 2011-06-29 Ian Lance Taylor <iant@google.com>
5229 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5230 symbols which are not used in a relocation.
5232 2011-06-28 Ian Lance Taylor <iant@google.com>
5235 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5236 script create indistinguishable segments.
5237 (Layout::set_segment_offsets): Use stable_sort when sorting
5238 segments. Pass this to Compare_segments constructor.
5239 * layout.h (class Layout): Make segment_precedes non-static.
5240 (class Compare_segments): Change from struct to class. Add
5241 layout_ field. Add constructor.
5242 * script-sections.cc
5243 (Script_sections::attach_sections_using_phdrs_clause): Rename
5244 local orphan to is_orphan. Don't report failure to put empty
5245 section in segment. On attachment failure, report name of
5246 section, and attach to first PT_LOAD segment.
5248 2011-06-28 Ian Lance Taylor <iant@google.com>
5251 * target-select.cc (Target_selector::Target_selector): Add
5252 emulation parameter. Change all callers.
5253 (select_target_by_bfd_name): Rename from select_target_by_name.
5255 (select_target_by_emulation): New function.
5256 (supported_emulation_names): New function.
5257 * target-select.h (class Target_selector): Add emulation_ field.
5258 Update declarations.
5259 (Target_selector::recognize_by_bfd_name): Rename from
5260 recognize_by_name. Change all callers.
5261 (Target_selector::supported_bfd_names): Rename from
5262 supported_names. Change all callers.
5263 (Target_selector::recognize_by_emulation): New function.
5264 (Target_selector::supported_emulations): New function.
5265 (Target_selector::emulation): New function.
5266 (Target_selector::do_recognize_by_bfd_name): Rename from
5267 do_recognize_by_name. Change all callers.
5268 (Target_selector::do_supported_bfd_names): Rename from
5269 do_supported_names. Change all callers.
5270 (Target_selector::do_recognize_by_emulation): New function.
5271 (Target_selector::do_supported_emulations): New function.
5272 (select_target_by_bfd_name): Change name in declaration.
5273 (select_target_by_emulation): Declare.
5274 (supported_emulation_names): Declare.
5275 * parameters.cc (parameters_force_valid_target): Try to find
5276 target based on emulation from -m option.
5277 * options.h (class General_options): Change doc string for -m.
5278 * options.cc (help): Print emulations.
5279 (General_options::parse_V): Likewise.
5280 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5281 Add emulation parameter. Change all callers.
5283 2011-06-28 Ian Lance Taylor <iant@google.com>
5285 * target.h (class Target): Add osabi_ field.
5286 (Target::osabi): New function.
5287 (Target::set_osabi): New function.
5288 (Target::Target): Initialize osabi_.
5289 (Target::do_adjust_elf_header): Make pure virtual.
5290 (Sized_target::do_adjust_elf_header): Declare.
5291 * target.cc (Sized_target::do_adjust_elf_header): New function.
5292 (class Sized_target): Instantiate all versions.
5293 * freebsd.h (class Target_freebsd): Remove.
5294 (Target_selector_freebsd::do_recognize): Call set_osabi on
5296 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5297 (Target_selector_freebsd::set_osabi): Remove.
5298 * i386.cc (class Target_i386): Inherit from Sized_target rather
5299 than Target_freebsd.
5300 * x86_64.cc (class Target_x86_64): Likewise.
5302 2011-06-28 Ian Lance Taylor <iant@google.com>
5304 * target.h (Target::can_check_for_function_pointers): Rewrite.
5306 (Target::can_icf_inline_merge_sections): Likewise.
5307 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5308 (Target::Target_info): Add can_icf_inline_merge_sections field.
5309 (Target::do_can_check_for_function_pointers): New virtual
5311 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5312 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5313 from can_check_for_function_pointers, move in file.
5314 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5315 section_may_have_icf_unsafe_poineters, move in file.
5316 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5317 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5318 Rename from can_check_for_function_pointers, move in file.
5319 (Target_i386::can_icf_inline_merge_sections): Remove.
5320 (Target_i386::i386_info): Initialize
5321 can_icf_inline_merge_sections.
5322 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5323 Initialize can_icf_inline_merge_sections.
5324 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5325 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5326 Rename from can_check_for_function_pointers, move in file.
5327 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5328 (Target_x86_64::x86_64_info): Initialize
5329 can_icf_inline_merge_sections.
5330 * testsuite/testfile.cc (Target_test::test_target_info):
5332 * icf.cc (get_section_contents): Correct formatting.
5334 2011-06-27 Ian Lance Taylor <iant@google.com>
5336 * symtab.cc (Symbol::versioned_name): New function.
5337 (Symbol_table::add_to_final_symtab): Use versioned_name when
5339 (Symbol_table::sized_write_symbol): Likewise.
5340 * symtab.h (class Symbol): Declare versioned_name.
5341 * stringpool.h (class Stringpool_template): Add variant of add
5342 which takes a std::basic_string.
5343 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5344 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5345 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5346 (ver_test_12.o): New target.
5347 * testsuite/Makefile.in: Rebuild.
5349 2011-06-27 Doug Kwan <dougkwan@google.com>
5351 * arm.cc (Arm_relocate_functions::thm_jump8,
5352 Arm_relocate_functions::thm_jump11): Use a wider signed
5353 type to compute offset.
5354 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5356 * testsuite/Makefile.in: Regenerate.
5357 * testsuite/arm_branch_in_range.sh: Check test results of
5358 arm_thm_jump11 and arm_thm_jump8.
5359 * testsuite/arm_thm_jump11.s: New test source file.
5360 * testsuite/arm_thm_jump11.t: New linker script.
5361 * testsuite/arm_thm_jump8.s: New test source file.
5362 * testsuite/arm_thm_jump8.t: New linker script.
5364 2011-06-24 Ian Lance Taylor <iant@google.com>
5366 * layout.cc: Include "object.h".
5367 (ctors_sections_in_init_array): New static variable.
5368 (Layout::is_ctors_in_init_array): New function.
5369 (Layout::layout): Add entry to ctors_sections_in_init_array if
5371 * layout.h (class Layout): Declare is_ctors_in_init_array.
5372 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5373 is_ctors_reverse_view is set.
5374 (Sized_relobj_file::write_sections): Add layout parameter. Change
5375 all callers. Set is_ctors_reverse_view field of View_size.
5376 (Sized_relobj_file::reverse_words): New function.
5377 * object.h (Sized_relobj_file::View_size): Add
5378 is_ctors_reverse_view field.
5379 (class Sized_relobj_file): Update declarations.
5380 * testsuite/initpri3.c: New test.
5381 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5383 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5384 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5385 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5386 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5387 * testsuite/Makefile.in: Rebuild.
5389 2011-06-24 Cary Coutant <ccoutant@google.com>
5391 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5392 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5393 (debug_msg_cdebug.err): New targets.
5394 * testsuite/Makefile.in: Regenerate.
5395 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5396 Fix checks for link with shared library.
5398 2011-06-24 Doug Kwan <dougkwan@google.com>
5400 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5401 skip empty text sections.
5402 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5404 2011-06-22 Ian Lance Taylor <iant@google.com>
5407 * options.h (class General_options): Add --ctors-in-init-array.
5408 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5409 friends as SHT_PROGBITS for merging sections.
5410 (Layout::layout): Remove special handling of .init_array and
5411 friends. Don't sort if doing relocatable link. Sort for .ctors
5412 and .dtors if ctors_in_init_array.
5413 (Layout::make_output_section): Force correct section types for
5414 .init_array and friends. Don't sort if doing relocatable link,
5415 Don't sort .ctors and .dtors if ctors_in_init_array.
5416 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5417 (Layout::output_section_name): Add relobj parameter. Change all
5418 callers. Handle .ctors. and .dtors. in code rather than table.
5419 Handle .ctors and .dtors if ctors_in_init_array.
5420 (Layout::match_file_name): New function, moved from output.cc.
5421 * layout.h (class Layout): Update declarations.
5422 * output.cc: Include "layout.h".
5423 (Input_section_sort_entry::get_priority): New function.
5424 (Input_section_sort_entry::match_file_name): Just call
5425 Layout::match_file_name.
5426 (Output_section::Input_section_sort_init_fini_compare::operator()):
5427 Handle .ctors and .dtors. Sort by explicit priority rather than
5429 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5430 * testsuite/initpri2.c: New test.
5431 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5432 (check_PROGRAMS): Add initpri2.
5433 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5434 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5435 * configure, testsuite/Makefile.in: Rebuild.
5437 2011-06-19 Ian Lance Taylor <iant@google.com>
5440 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5441 .interp section to a PT_INTERP segment even if we have seen a
5442 --dynamic-linker option. Don't do it if we have seen a PHDRS
5443 clause in a linker script.
5444 (Layout::finalize): Don't create a .interp section if we've
5445 already create a PT_INTERP segment.
5446 (Layout::create_interp): Always call choose_output_section (revert
5447 patch of 2011-06-17). Don't create PT_INTERP segment.
5448 * script-sections.cc
5449 (Script_sections::create_note_and_tls_segments): Add a .interp
5450 section to a PT_INTERP segment even if we have seen a
5451 --dynamic-linker option.
5453 2011-06-18 Ian Lance Taylor <iant@google.com>
5455 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5456 merely because a non-PT_LOAD segment has a dynamic reloc.
5458 2011-06-18 Ian Lance Taylor <iant@google.com>
5460 * layout.cc (Layout::finish_dynamic_section): Don't create
5461 DT_FLAGS entry if not needed.
5463 2011-06-18 Ian Lance Taylor <iant@google.com>
5466 * layout.cc (Layout::layout_eh_frame): Correct handling of
5467 writable .eh_frame section.
5469 2011-06-17 Ian Lance Taylor <iant@google.com>
5472 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5473 symbol is redefined with the exact same object and value.
5475 2011-06-17 Ian Lance Taylor <iant@google.com>
5478 * layout.h (class Layout): Add interp_segment_ field.
5479 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5480 (Layout::attach_allocated_section_to_segment): If making shared
5481 library, put .interp section in PT_INTERP segment.
5482 (Layout::finalize): Also call create_interp if -dynamic-linker
5484 (Layout::create_interp): Assert that there is no PT_INTERP
5485 segment. If not using a SECTIONS clause, use make_output_section.
5486 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5487 * script-sections.cc
5488 (Script_sections::create_note_and_tls_segments): If making shared
5489 library, put .interp section in PT_INTERP segment.
5491 2011-06-17 Ian Lance Taylor <iant@google.com>
5493 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5494 when making a shared library.
5496 2011-06-17 Ian Lance Taylor <iant@google.com>
5498 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5499 parameter. Change all callers. Don't issue warning about PC32
5500 against locally defined symbol.
5502 2011-06-16 Ian Lance Taylor <iant@google.com>
5504 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5505 occurs in same object.
5507 2011-06-14 Alan Modra <amodra@gmail.com>
5509 * po/POTFILES.in: Regenerate.
5511 2011-06-09 Ian Lance Taylor <iant@google.com>
5513 * script-sections.cc
5514 (Orphan_output_section::set_section_addresses): For a relocatable
5515 link set address to 0.
5517 2011-06-09 Cary Coutant <ccoutant@google.com>
5520 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5521 used with --compress-debug-sections.
5522 * gold/object.cc (Sized_relobj_file::do_layout): Report
5523 uncompressed size of compressed input sections.
5525 2011-06-08 Cary Coutant <ccoutant@google.com>
5528 * testsuite/two_file_test_2_v1.cc: Change initialization of
5529 v2 to keep it in .data.
5531 2011-06-07 Cary Coutant <ccoutant@google.com>
5533 * common.cc (Symbol_table::do_allocate_commons_list): Call
5535 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5536 (Errors::fallback): New function.
5537 (gold_fallback): New function.
5538 * errors.h (Errors::fallback): New function.
5539 * gold.cc (gold_exit): Change status parameter to enum; adjust
5541 (queue_initial_tasks): Call gold_fallback.
5542 * gold.h: Include cstdlib.
5543 (Exit_status): New enum type.
5544 (gold_exit): Change status parameter to enum.
5545 (gold_fallback): New function.
5546 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5547 (Layout::create_symtab_sections): Likewise.
5548 (Layout::create_shdrs): Likewise.
5549 * main.cc (main): Adjust call to gold_exit.
5550 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5551 (Output_data_got::add_got_entry_pair): Likewise.
5552 (Output_section::add_input_section): Likewise.
5553 (Output_section::add_output_section_data): Likewise.
5554 (Output_segment::set_section_list_addresses): Likewise.
5555 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5557 2011-06-07 Cary Coutant <ccoutant@google.com>
5559 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5560 for incremental links.
5561 * output.cc (Output_segment::set_section_list_addresses): Remove
5562 FIXME and test for TLS or BSS.
5564 2011-06-07 Cary Coutant <ccoutant@google.com>
5566 * testsuite/Makefile.am: Add incremental_copy_test,
5567 incremental_common_test_1.
5568 * testsuite/Makefile.in: Regenerate.
5569 * testsuite/common_test_1_v1.c: New source file.
5570 * testsuite/common_test_1_v2.c: New source file.
5571 * testsuite/copy_test_v1.cc: New source file.
5573 2011-06-07 Cary Coutant <ccoutant@google.com>
5575 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5576 update, allocate common from bss section's free list.
5577 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5578 linker-defined symbols.
5579 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5580 Skip GOT and PLT entries that are no longer referenced.
5581 (Output_section_incremental_inputs::write_info_blocks): Mark
5582 linker-defined symbols.
5583 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5584 * output.cc (Output_section::allocate): New function.
5585 * output.h (Output_section::allocate): New function.
5586 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5587 linker-defined symbols.
5588 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5589 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5590 (Symbol::init_base_output_data): Likewise.
5591 (Symbol::init_base_output_segment): Likewise.
5592 (Symbol::init_base_constant): Likewise.
5593 (Sized_symbol::init_output_data): Likewise.
5594 (Sized_symbol::init_output_segment): Likewise.
5595 (Sized_symbol::init_constant): Likewise.
5596 (Symbol_table::do_define_in_output_data): Likewise.
5597 (Symbol_table::do_define_in_output_segment): Likewise.
5598 (Symbol_table::do_define_as_constant): Likewise.
5599 * symtab.h (Symbol::is_predefined): New function.
5600 (Symbol::init_base_output_data): Add is_predefined parameter.
5601 (Symbol::init_base_output_segment): Likewise.
5602 (Symbol::init_base_constant): Likewise.
5603 (Symbol::is_predefined_): New data member.
5604 (Sized_symbol::init_output_data): Add is_predefined parameter.
5605 (Sized_symbol::init_output_segment): Likewise.
5606 (Sized_symbol::init_constant): Likewise.
5607 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5609 2011-06-07 Cary Coutant <ccoutant@google.com>
5611 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5612 instead of emit_copy_reloc.
5613 (Copy_relocs::emit_copy_reloc): Refactor.
5614 (Copy_relocs::make_copy_reloc): New function.
5615 (Copy_relocs::add_copy_reloc): Remove.
5616 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5618 (Copy_relocs::make_copy_reloc): New function.
5619 (Copy_relocs::add_copy_reloc): Remove.
5620 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5621 unchanged input files.
5622 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5623 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5624 Reserve BSS space for COPY relocations.
5625 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5626 (Output_section_incremental_inputs::write_info_blocks): Record
5627 whether a symbol is copied from a shared object.
5628 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5629 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5630 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5631 (Incremental_input_entry_reader::get_output_symbol_index): Add
5633 (Incremental_binary::emit_copy_relocs): New function.
5634 (Incremental_binary::do_emit_copy_relocs): New function.
5635 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5637 (Sized_incremental_binary::add_copy_reloc): New function.
5638 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5639 (Sized_incremental_binary::Copy_reloc): New struct.
5640 (Sized_incremental_binary::Copy_relocs): New typedef.
5641 (Sized_incremental_binary::copy_relocs_): New data member.
5642 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5643 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5644 * target.h (Sized_target::emit_copy_reloc): New function.
5645 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5647 2011-06-02 Cary Coutant <ccoutant@google.com>
5650 * gold/archive.cc (Archive::Archive): Initialize new data member.
5651 (Archive::include_all_members): Return if archive has already been
5653 * gold/archive.h (Archive::include_all_members_): New data member.
5655 2011-06-02 Nick Clifton <nickc@redhat.com>
5657 * dynobj.h: Fix spelling mistake in comment.
5658 * output.cc: Likewise.
5660 2011-05-31 Doug Kwan <dougkwan@google.com>
5664 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
5665 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5666 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5667 redundant arm_exidx_test.so.
5668 * testsuite/Makefile.in: Regenerate.
5669 (check_SCRIPTS): Add pr12826.sh
5670 (check_DATA): Add pr12826.stdout
5671 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5672 * testsuite/pr12826.sh: New file.
5673 * testsuite/pr12826_1.s: Ditto.
5674 * testsuite/pr12826_1.s: Ditto.
5676 2011-05-30 Ian Lance Taylor <iant@google.com>
5678 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5681 2011-05-29 Ian Lance Taylor <iant@google.com>
5684 * testsuite/Makefile.am: Use different file name for two_file_test
5685 temporary file for each incremental test.
5686 * testsuite/Makefile.in: Rebuild.
5688 2011-05-29 Ian Lance Taylor <iant@google.com>
5690 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5691 binary input file is empty.
5693 2011-05-27 Ian Lance Taylor <iant@google.com>
5695 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5696 (ver_test_9.so): Likewise.
5697 * testsuite/Makefile.in: Rebuild.
5699 2011-05-26 Cary Coutant <ccoutant@google.com>
5701 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5702 * incremental.cc (Incremental_inputs::report_input_section): Fix
5703 comment, indentation.
5704 (Incremental_inputs::report_comdat_group): New function.
5705 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5706 of data for incremental input file entry.
5707 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5708 group count, COMDAT group signatures.
5709 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5710 an unchanged input file.
5711 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5712 Initialize new data member.
5713 (Incremental_object_entry::add_comdat_group): New function.
5714 (Incremental_object_entry::get_comdat_group_count): New function.
5715 (Incremental_object_entry::get_comdat_signature_key): New function.
5716 (Incremental_object_entry::groups_): New data member.
5717 (Incremental_inputs::report_comdat_group): New function.
5718 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5719 data for incremental input file entry.
5720 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5721 (Incremental_input_entry_reader::get_input_section): Adjust size of
5722 data for incremental input file entry.
5723 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5724 (Incremental_input_entry_reader::get_comdat_group_signature): New
5726 * object.cc (Sized_relobj::include_section_group): Report kept
5727 COMDAT groups for incremental links.
5729 2011-05-24 David Meyer <pdox@google.com>
5731 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5732 with name parameter. Add found_name parameter.
5733 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5734 * dirsearch.h (class Dirsearch): Update declaration.
5736 2011-05-24 Ian Lance Taylor <iant@google.com>
5738 * archive.cc (Library_base::should_include_member): Pull in object
5739 from archive if it defines the entry symbol.
5740 * parameters.cc (Parameters::entry): New function.
5741 * parameters.h (class Parameters): Declare entry.
5742 * output.h (class Output_file_header): Remove entry_ field.
5743 * output.cc (Output_file_header::Output_file_header): Remove entry
5744 parameter. Change all callers.
5745 (Output_file_header::entry): Use parameters->entry.
5746 * gold.cc (queue_middle_tasks): Likewise.
5747 * plugin.cc (Plugin_hook::run): Likewise.
5749 2011-05-24 Cary Coutant <ccoutant@google.com>
5751 * gold.cc (queue_initial_tasks): Pass incremental base filename
5752 to Output_file::open_base_file; don't print error message.
5753 * incremental-dump.cc (main): Adjust call to
5754 Output_file::open_for_modification.
5755 * incremental-dump.cc (main): Likewise.
5756 * incremental.cc (Incremental_inputs::report_command_line):
5757 Ignore --incremental-base option when comparing command lines.
5758 Ignore parameter when given as separate argument.
5759 * options.h (class General_options): Add --incremental-base.
5760 * output.cc (Output_file::Output_file):
5761 (Output_file::open_base_file): Add base_name and writable parameters;
5762 read base file into new file; print error message here.
5763 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5765 * output.h (Output_file::open_for_modification): Rename to...
5766 (Output_file::open_base_file): ...this; add base_name and
5767 writable parameters; adjust all callers.
5768 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5770 * testsuite/Makefile.am (incremental_test_4): Test
5772 * testsuite/Makefile.in: Regenerate.
5774 2011-05-24 Cary Coutant <ccoutant@google.com>
5776 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5778 * testsuite/Makefile.in: Regenerate.
5779 * testsuite/two_file_test_1_v1.cc: New test source file.
5780 * testsuite/two_file_test_1b_v1.cc: New test source file.
5781 * testsuite/two_file_test_2_v1.cc: New test source file.
5783 2011-05-24 Cary Coutant <ccoutant@google.com>
5785 * dynobj.h (Dynobj::do_dynobj): New function.
5786 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5787 flag and soname for shared objects.
5788 * incremental.cc (Incremental_inputs::report_object): Make
5789 either Incremental_object_entry or Incremental_dynobj_entry; add
5790 soname to string table.
5791 (Incremental_inputs::report_input_section): Add assertion.
5792 (Output_section_incremental_inputs::set_final_data_size): Adjust
5793 type of input file entry for shared libraries; adjust size of
5794 shared library info entry.
5795 (Output_section_incremental_inputs::write_input_files): Write
5796 as_needed flag for shared libraries.
5797 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5798 of input file entry for shared libraries; write soname.
5799 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5800 soname from incremental info.
5801 * incremental.h (enum Incremental_input_flags): Add
5802 INCREMENTAL_INPUT_AS_NEEDED.
5803 (Incremental_input_entry::Incremental_input_entry): Initialize new
5805 (Incremental_input_entry::set_as_needed): New function.
5806 (Incremental_input_entry::as_needed): New function.
5807 (Incremental_input_entry::do_dynobj_entry): New function.
5808 (Incremental_input_entry::as_needed_): New data member.
5809 (Incremental_object_entry::Incremental_object_entry): Don't check
5811 (Incremental_object_entry::do_type): Likewise.
5812 (class Incremental_dynobj_entry): New class.
5813 (Incremental_input_entry_reader::as_needed): New function.
5814 (Incremental_input_entry_reader::get_soname): New function.
5815 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5816 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5817 size of shared library info entry.
5818 * layout.cc (Layout::finish_dynamic_section): Don't test for
5819 incremental link when adding DT_NEEDED entries.
5820 * object.h (Object::Object): Initialize new data member.
5821 (Object::dynobj): New function.
5822 (Object::set_as_needed): New function.
5823 (Object::as_needed): New function.
5824 (Object::do_dynobj): New function.
5825 (Object::as_needed_): New data member.
5827 2011-05-24 Cary Coutant <ccoutant@google.com>
5829 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5830 info; adjust display of GOT entries.
5831 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5832 vector of input objects; remove file_status_.
5833 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5834 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5835 got_plt reader; call target hooks to reserve GOT entries.
5836 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5837 of input file info header and GOT info entry.
5838 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5840 (Got_plt_view_info::got_descriptor): Remove.
5841 (Got_plt_view_info::sym_index): New data member.
5842 (Got_plt_view_info::input_index): New data member.
5843 (Local_got_offset_visitor::visit): Write input file index.
5844 (Global_got_offset_visitor::visit): Write 0 for input file index.
5845 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5846 with sym_index and input_index.
5847 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5848 incremental info GOT entry; replace got_descriptor with input_index.
5849 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5850 map from input file index to object.
5851 (Sized_relobj_incr::do_layout): Replace direct data member reference
5852 with accessor function.
5853 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5854 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5855 Adjust size of input file info header.
5856 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5857 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5858 (Incremental_input_entry_reader::get_input_section): Adjust size of
5859 input file info header.
5860 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5861 of incremental info GOT entry.
5862 (Incremental_got_plt_reader::get_got_desc): Remove.
5863 (Incremental_got_plt_reader::get_got_symndx): New function.
5864 (Incremental_got_plt_reader::get_got_input_index): New function.
5865 (Sized_incremental_binary::Sized_incremental_binary): Remove
5866 file_status_; add input_objects_.
5867 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5868 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5869 (Sized_incremental_binary::file_is_unchanged): Remove.
5870 (Sized_incremental_binary::set_input_object): New function.
5871 (Sized_incremental_binary::input_object): New function.
5872 (Sized_incremental_binary::file_status_): Remove.
5873 (Sized_incremental_binary::input_objects_): New data member.
5874 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5876 (Sized_relobj_incr::invalid_address): Move to base class.
5877 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5879 (Sized_relobj_incr::do_output_section_offset): Likewise.
5880 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5881 (Sized_relobj_incr::section_offsets_): Likewise.
5882 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5884 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5885 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5886 with accessor function.
5887 (Sized_relobj_file::do_layout): Likewise.
5888 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5889 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5890 (Sized_relobj_file::compute_final_local_value): Replace refs to
5891 section_offsets_ with accessor function.
5892 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5893 * object.h (Relobj::Relobj): Initialize new data members.
5894 (Relobj::add_dyn_reloc): New function.
5895 (Relobj::first_dyn_reloc): New function.
5896 (Relobj::dyn_reloc_count): New function.
5897 (Relobj::first_dyn_reloc_): New data member.
5898 (Relobj::dyn_reloc_count_): New data member.
5899 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5901 (Sized_relobj::Address): New typedef.
5902 (Sized_relobj::invalid_address): Move here from child class.
5903 (Sized_relobj::Sized_relobj): Initialize new data members.
5904 (Sized_relobj::sized_relobj): New function.
5905 (Sized_relobj::is_output_section_offset_invalid): Move here from
5907 (Sized_relobj::get_output_section_offset): Likewise.
5908 (Sized_relobj::local_has_got_offset): Likewise.
5909 (Sized_relobj::local_got_offset): Likewise.
5910 (Sized_relobj::set_local_got_offset): Likewise.
5911 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5912 (Sized_relobj::clear_got_offsets): New function.
5913 (Sized_relobj::section_offsets): Move here from child class.
5914 (Sized_relobj::do_output_section_offset): Likewise.
5915 (Sized_relobj::do_set_section_offset): Likewise.
5916 (Sized_relobj::Local_got_offsets): Likewise.
5917 (Sized_relobj::local_got_offsets_): Likewise.
5918 (Sized_relobj::section_offsets_): Likewise.
5919 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5921 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5923 (Sized_relobj_file::sized_relobj): New function
5924 (Sized_relobj_file::local_has_got_offset): Move to base class.
5925 (Sized_relobj_file::local_got_offset): Likewise.
5926 (Sized_relobj_file::set_local_got_offset): Likewise.
5927 (Sized_relobj_file::get_output_section_offset): Likewise.
5928 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5929 (Sized_relobj_file::do_output_section_offset): Likewise.
5930 (Sized_relobj_file::do_set_section_offset): Likewise.
5931 (Sized_relobj_file::Local_got_offsets): Likewise.
5932 (Sized_relobj_file::local_got_offsets_): Likewise.
5933 (Sized_relobj_file::section_offsets_): Likewise.
5934 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5936 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5937 (Output_reloc::get_symbol_index): Likewise.
5938 (Output_reloc::local_section_offset): Likewise.
5939 (Output_reloc::get_address): Likewise.
5940 (Output_reloc::symbol_value): Likewise.
5941 (Output_data_got::reserve_slot): Move to class definition.
5942 (Output_data_got::reserve_local): New function.
5943 (Output_data_got::reserve_slot_for_global): Remove.
5944 (Output_data_got::reserve_global): New function.
5945 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5946 (all constructors, two instantiations).
5947 (Output_reloc::get_relobj): New function (two instantiations).
5948 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5949 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5950 (Output_data_reloc::add_global): Adjust type of relobj.
5951 (Output_data_reloc::add_global_relative): Likewise.
5952 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5953 (Output_data_reloc::add_local): Likewise.
5954 (Output_data_reloc::add_local_relative): Likewise.
5955 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5956 (Output_data_reloc::add_local_section): Likewise.
5957 (Output_data_reloc::add_output_section): Likewise.
5958 (Output_data_reloc::add_absolute): Likewise.
5959 (Output_data_reloc::add_target_specific): Likewise.
5960 (Output_data_got::reserve_slot): Move definition here.
5961 (Output_data_got::reserve_local): New function.
5962 (Output_data_got::reserve_global): New function.
5963 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5964 section_offsets_ with accessor function.
5965 (Sized_relobj_file::write_sections): Likewise.
5966 (Sized_relobj_file::do_relocate_sections): Likewise.
5967 * target.h (Sized_target::reserve_local_got_entry): New function.
5968 (Sized_target::reserve_global_got_entry): New function.
5969 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5970 (Target_x86_64::reserve_global_got_entry): New function.
5971 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5973 2011-05-23 Cary Coutant <ccoutant@google.com>
5975 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5976 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5977 bit when checking got_type.
5978 * incremental.cc (Sized_incremental_binary::setup_readers):
5979 Store symbol table and string table locations; initialize bit vector
5980 of file status flags.
5981 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5983 (Sized_incremental_binary::do_process_got_plt): New function.
5984 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5985 (Output_section_incremental_inputs::set_final_data_size): Record
5986 file index for each input file.
5987 (Output_section_incremental_inputs::write_got_plt): Store file index
5988 instead of input entry offset for each GOT entry.
5990 (Incremental_input_entry::Incremental_input_entry): Initialize new
5992 (Incremental_input_entry::set_offset): Store file index.
5993 (Incremental_input_entry::get_file_index): New function.
5994 (Incremental_input_entry::file_index_): New data member.
5995 (Incremental_binary::process_got_plt): New function.
5996 (Incremental_binary::do_process_got_plt): New function.
5997 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5999 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6000 (Sized_incremental_binary::set_file_is_unchanged): New function.
6001 (Sized_incremental_binary::file_is_unchanged): New function.
6002 (Sized_incremental_binary::do_process_got_plt): New function.
6003 (Sized_incremental_binary::file_status_): New data member.
6004 (Sized_incremental_binary::main_symtab_loc_): New data member.
6005 (Sized_incremental_binary::main_strtab_loc_): New data member.
6006 * output.cc (Output_data_got::Got_entry::write): Add case
6008 (Output_data_got::add_global): Call add_got_entry.
6009 (Output_data_got::add_global_plt): Likewise.
6010 (Output_data_got::add_global_with_rel): Likewise.
6011 (Output_data_got::add_global_with_rela): Likewise.
6012 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6013 (Output_data_got::add_global_pair_with_rela): Likewise.
6014 (Output_data_got::add_local): Call add_got_entry.
6015 (Output_data_got::add_local_plt): Likewise.
6016 (Output_data_got::add_local_with_rel): Likewise.
6017 (Output_data_got::add_local_with_rela): Likewise.
6018 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6019 (Output_data_got::add_local_pair_with_rela): Likewise.
6020 (Output_data_got::reserve_slot): New function.
6021 (Output_data_got::reserve_slot_for_global): New function.
6022 (Output_data_got::add_got_entry): New function.
6023 (Output_data_got::add_got_entry_pair): New function.
6024 (Output_section::add_output_section_data): Edit FIXME.
6026 (Output_section_data_build::Output_section_data_build): New
6027 constructor with size parameter.
6028 (Output_data_space::Output_data_space): Likewise.
6029 (Output_data_got::Output_data_got): Initialize new data member; new
6030 constructor with size parameter.
6031 (Output_data_got::add_constant): Call add_got_entry.
6032 (Output_data_got::reserve_slot): New function.
6033 (Output_data_got::reserve_slot_for_global): New function.
6034 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6035 (Output_data_got::add_got_entry): New function.
6036 (Output_data_got::add_got_entry_pair): New function.
6037 (Output_data_got::free_list_): New data member.
6038 * target.h (Sized_target::init_got_plt_for_update): New function.
6039 (Sized_target::register_global_plt_entry): New function.
6040 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6041 Initialize new data member; call init; add constructor with PLT count.
6042 (Output_data_plt_x86_64::init): New function.
6043 (Output_data_plt_x86_64::add_relocation): New function.
6044 (Output_data_plt_x86_64::reserve_slot): New function.
6045 (Output_data_plt_x86_64::free_list_): New data member.
6046 (Target_x86_64::init_got_plt_for_update): New function.
6047 (Target_x86_64::register_global_plt_entry): New function.
6048 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6049 incremental updates.
6050 (Output_data_plt_x86_64::add_relocation): New function.
6051 * testsuite/object_unittest.cc (Object_test): Set default options.
6053 2011-05-16 Ian Lance Taylor <iant@google.com>
6055 * options.h (class General_options): Make -i a synonym for -r.
6057 2011-05-16 Ian Lance Taylor <iant@google.com>
6059 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6061 2011-05-10 Cary Coutant <ccoutant@google.com>
6063 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6066 2011-05-06 Ian Lance Taylor <iant@google.com>
6068 * layout.cc (Layout::layout): If the output section flags change,
6069 update the ordering.
6071 2011-04-25 Cary Coutant <ccoutant@google.com>
6073 * incremental-dump.cc (dump_incremental_inputs): Print local
6074 symbol info for each input file.
6076 (Output_section_incremental_inputs::set_final_data_size): Add local
6077 symbol info to input file entries in incremental info.
6078 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6079 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6080 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6081 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6083 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6084 (Sized_incr_relobj::do_relocate): Write the local symbols.
6085 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6086 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6087 Adjust size of input file header.
6088 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6089 (Incremental_inputs_reader::get_local_symbol_count): New function.
6090 (Incremental_inputs_reader::get_input_section): Adjust size of input
6092 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6093 (Sized_incr_relobj::This): New typedef.
6094 (Sized_incr_relobj::sym_size): New const data member.
6095 (Sized_incr_relobj::Local_symbol): New struct.
6096 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6097 (Sized_incr_relobj::do_local_symbol_offset): New function.
6098 (Sized_incr_relobj::local_symbol_count_): New data member.
6099 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6100 (Sized_incr_relobj::local_symbol_index_): New data member.
6101 (Sized_incr_relobj::local_symbol_offset_): New data member.
6102 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6103 (Sized_incr_relobj::local_symbols_): New data member.
6104 * object.h (Relobj::output_local_symbol_count): New function.
6105 (Relobj::local_symbol_offset): New function.
6106 (Relobj::do_output_local_symbol_count): New function.
6107 (Relobj::do_local_symbol_offset): New function.
6108 (Sized_relobj::do_output_local_symbol_count): New function.
6109 (Sized_relobj::do_local_symbol_offset): New function.
6111 2011-04-22 Vladimir Simonov <sv@sw.ru>
6113 * descriptors.cc (set_close_on_exec): New function.
6114 (Descriptors::open): Use set_close_on_exec.
6115 * output.cc (S_ISLNK): Define if not defined.
6117 2011-04-22 Cary Coutant <ccoutant@google.com>
6119 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6121 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6122 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6123 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6125 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6126 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6127 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6129 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6131 (Incremental_binary::apply_incremental_relocs): New function.
6132 (Incremental_binary::do_apply_incremental_relocs): New function.
6133 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6135 (Sized_incremental_binary::add_global_symbol): New function.
6136 (Sized_incremental_binary::global_symbol): New function.
6137 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6138 (Sized_incremental_binary::symbol_map_): New data member.
6139 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6140 * target.h (Sized_target::apply_relocation): New function.
6141 * target-reloc.h (apply_relocation): New function.
6142 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6144 2011-04-22 Doug Kwan <dougkwan@google.com>
6146 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6147 flag of a SHT_ARM_EXIDX section.
6148 * testsuite/Makefile.am (arm_exidx_test): New test rules.
6149 * testsuite/Makefile.in: Regenerate.
6150 * testsuite/arm_exidx_test.s: New file.
6151 * testsuite/arm_exidx_test.sh: Same.
6153 2011-04-20 Cary Coutant <ccoutant@google.com>
6156 * archive.h (Incremental_archive_entry::Archive_member):
6157 Initialize arg_serial_ (second constructor).
6159 2011-04-17 Ian Lance Taylor <iant@google.com>
6161 * object.cc (Relocate_info::location): Simplify location string.
6162 * errors.cc (Errors::error_at_location): Don't print program
6164 (Errors::warning_at_location): Likewise.
6165 (Errors::undefined_symbol): Likewise.
6166 * testsuite/debug_msg.sh: Update accordingly.
6168 2011-04-14 Cary Coutant <ccoutant@google.com>
6170 * gold/layout.cc (Layout::symtab_section_offset): New function.
6171 * gold/layout.h (Layout::symtab_section_offset): New function.
6172 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6174 2011-04-12 Ian Lance Taylor <iant@google.com>
6176 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6177 with MREMAP_MAYMOVE.
6178 * output.h (class Output_file): Add map_is_allocated_ field.
6179 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6180 not available, provide stubs. If mremap is not available, #define
6182 (MREMAP_MAYMOVE): Define if not defined.
6183 (Output_file::Output_file): Initialize map_is_allocated_.
6184 (Output_file::resize): Check map_is_allocated_.
6185 (Output_file::map_anonymous): If mmap fails, use malloc.
6186 (Output_file::unmap): Don't do anything for an anonymous map.
6187 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6188 is not available, provide stubs.
6189 (File_read::View::~View): Use free rather than delete[].
6190 (File_read::make_view): Use malloc rather than new[]. If mmap
6192 (File_read::find_or_make_view): Use malloc rather than new[].
6193 * gold.h: Remove HAVE_REMAP code.
6194 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6195 exists. Rename mremap to gold_mremap. If mmap is not available
6197 * configure, config.in: Rebuild.
6199 2011-04-11 Ian Lance Taylor <iant@google.com>
6201 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6202 initialize local variable v.
6204 2011-04-11 Cary Coutant <ccoutant@google.com>
6206 * archive.cc (Archive::include_member): Adjust call to
6208 (Add_archive_symbols::run): Track argument serial numbers.
6209 (Lib_group::include_member): Likewise.
6210 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6211 * archive.h (Incremental_archive_entry::Archive_member):
6212 Initialize arg_serial_.
6213 (Archive_member::arg_serial_): New data member.
6214 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6215 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6217 (Sized_dynobj::do_for_all_local_got_entries): New function.
6218 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6220 * fileread.cc (get_mtime): New function.
6221 * fileread.h (get_mtime): New function.
6222 * gold.cc (queue_initial_tasks): Check for incremental update.
6223 (process_incremental_input): New function.
6224 (queue_middle_tasks): Don't force valid target for incremental
6226 * incremental-dump.cc (find_input_containing_global): Adjust
6227 size of symbol info entry.
6228 (dump_incremental_inputs): Dump argument serial number and
6229 in_system_directory flag; bias shndx by 1; print symbol names
6230 when dumping per-file symbol lists; use new symbol info readers.
6232 (Output_section_incremental_inputs:update_data_size): New function.
6233 (Sized_incremental_binary::setup_readers): Setup input readers
6234 for each input file; build maps for files added from libraries
6236 (Sized_incremental_binary::check_input_args): New function.
6237 (Sized_incremental_binary::do_check_inputs): Build map of argument
6238 serial numbers to input arguments.
6239 (Sized_incremental_binary::do_file_has_changed): Rename
6240 do_file_is_unchanged to this; compare file modification times.
6241 (Sized_incremental_binary::do_init_layout): New function.
6242 (Sized_incremental_binary::do_reserve_layout): New function.
6243 (Sized_incremental_binary::do_get_input_reader): Remove.
6244 (Sized_incremental_binary::get_symtab_view): New function.
6245 (Incremental_checker::can_incrementally_link_output_file): Remove.
6246 (Incremental_inputs::report_command_line): Exclude --debug options.
6247 (Incremental_inputs::report_archive_begin): Add parameter; track
6248 argument serial numbers; don't put input file entry for archive
6249 before archive members.
6250 (Incremental_inputs::report_archive_end): Put input file entry
6251 for archive after archive members.
6252 (Incremental_inputs::report_object): Add parameter; track argument
6253 serial numbers and in_system_directory flag.
6254 (Incremental_inputs::report_script): Add parameter; track argument
6256 (Output_section_incremental_inputs::set_final_data_size): Adjust
6257 size of symbol info entry; check for forwarding symbols.
6258 (Output_section_incremental_inputs::write_input_files): Write
6259 in_system_directory flag and argument serial number.
6260 (Output_section_incremental_inputs::write_info_blocks): Map section
6261 indices between incremental info and original input file; store
6262 input section index for each symbol.
6263 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6264 change operator() to visit().
6265 (class Global_got_offset_visitor): Likewise.
6266 (class Global_symbol_visitor_got_plt):
6267 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6269 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6270 (Sized_incr_relobj::do_read_symbols): New function.
6271 (Sized_incr_relobj::do_layout): New function.
6272 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6273 (Sized_incr_relobj::do_add_symbols): New function.
6274 (Sized_incr_relobj::do_should_include_member): New function.
6275 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6276 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6277 (Sized_incr_relobj::do_section_size): New function.
6278 (Sized_incr_relobj::do_section_name): New function.
6279 (Sized_incr_relobj::do_section_contents): New function.
6280 (Sized_incr_relobj::do_section_flags): New function.
6281 (Sized_incr_relobj::do_section_entsize): New function.
6282 (Sized_incr_relobj::do_section_address): New function.
6283 (Sized_incr_relobj::do_section_type): New function.
6284 (Sized_incr_relobj::do_section_link): New function.
6285 (Sized_incr_relobj::do_section_info): New function.
6286 (Sized_incr_relobj::do_section_addralign): New function.
6287 (Sized_incr_relobj::do_initialize_xindex): New function.
6288 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6289 (Sized_incr_relobj::do_read_relocs): New function.
6290 (Sized_incr_relobj::do_gc_process_relocs): New function.
6291 (Sized_incr_relobj::do_scan_relocs): New function.
6292 (Sized_incr_relobj::do_count_local_symbols): New function.
6293 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6294 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6295 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6296 (Sized_incr_relobj::do_relocate): New function.
6297 (Sized_incr_relobj::do_set_section_offset): New function.
6298 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6299 (Sized_incr_dynobj::do_read_symbols): New function.
6300 (Sized_incr_dynobj::do_layout): New function.
6301 (Sized_incr_dynobj::do_add_symbols): New function.
6302 (Sized_incr_dynobj::do_should_include_member): New function.
6303 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6304 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6305 (Sized_incr_dynobj::do_section_size): New function.
6306 (Sized_incr_dynobj::do_section_name): New function.
6307 (Sized_incr_dynobj::do_section_contents): New function.
6308 (Sized_incr_dynobj::do_section_flags): New function.
6309 (Sized_incr_dynobj::do_section_entsize): New function.
6310 (Sized_incr_dynobj::do_section_address): New function.
6311 (Sized_incr_dynobj::do_section_type): New function.
6312 (Sized_incr_dynobj::do_section_link): New function.
6313 (Sized_incr_dynobj::do_section_info): New function.
6314 (Sized_incr_dynobj::do_section_addralign): New function.
6315 (Sized_incr_dynobj::do_initialize_xindex): New function.
6316 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6317 (make_sized_incremental_object): New function.
6318 (Incremental_library::copy_unused_symbols): New function.
6319 (Incremental_library::do_for_all_unused_symbols): New function.
6320 * incremental.h (enum Incremental_input_flags): New type.
6321 (class Incremental_checker): Remove.
6322 (Incremental_input_entry::Incremental_input_entry): Add argument
6324 (Incremental_input_entry::arg_serial): New function.
6325 (Incremental_input_entry::set_is_in_system_directory): New function.
6326 (Incremental_input_entry::is_in_system_directory): New function.
6327 (Incremental_input_entry::arg_serial_): New data member.
6328 (Incremental_input_entry::is_in_system_directory_): New data member.
6329 (class Script_info): Move here from script.h.
6330 (Script_info::Script_info): Add filename parameter.
6331 (Script_info::filename): New function.
6332 (Script_info::filename_): New data member.
6333 (Incremental_script_entry::Incremental_script_entry): Add argument
6335 (Incremental_object_entry::Incremental_object_entry): Likewise.
6336 (Incremental_object_entry::add_input_section): Build list of input
6337 sections with map to original shndx.
6338 (Incremental_object_entry::get_input_section_index): New function.
6339 (Incremental_object_entry::shndx_): New data member.
6340 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6341 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6342 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6344 (Incremental_inputs::report_archive_begin): Likewise.
6345 (Incremental_inputs::report_object): Likewise.
6346 (Incremental_inputs::report_script): Likewise.
6347 (class Incremental_global_symbol_reader): New class.
6348 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6349 and store flags and input file type.
6350 (Incremental_input_entry_reader::arg_serial): New function.
6351 (Incremental_input_entry_reader::type): Extract type from flags.
6352 (Incremental_input_entry_reader::is_in_system_directory): New function.
6353 (Incremental_input_entry_reader::get_input_section_count): Call
6354 accessor function for type.
6355 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6356 function for type; adjust size of global symbol entry.
6357 (Incremental_input_entry_reader::get_global_symbol_count): Call
6358 accessor function for type.
6359 (Incremental_input_entry_reader::get_object_count): Likewise.
6360 (Incremental_input_entry_reader::get_object_offset): Likewise.
6361 (Incremental_input_entry_reader::get_member_count): Likewise.
6362 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6363 (Incremental_input_entry_reader::get_member_offset): Likewise.
6364 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6365 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6366 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6367 (Incremental_input_entry_reader::get_global_symbol_reader): New
6369 (Incremental_input_entry_reader::get_output_symbol_index): New
6371 (Incremental_input_entry_reader::type_): Remove.
6372 (Incremental_input_entry_reader::flags_): New data member.
6373 (Incremental_inputs_reader::input_file_offset): New function.
6374 (Incremental_inputs_reader::input_file_index): New function.
6375 (Incremental_inputs_reader::input_file): Call input_file_offset.
6376 (Incremental_inputs_reader::input_file_at_offset): New function.
6377 (Incremental_relocs_reader::get_r_type): Reformat.
6378 (Incremental_relocs_reader::get_r_shndx): Reformat.
6379 (Incremental_relocs_reader::get_r_offset): Reformat.
6380 (Incremental_relocs_reader::data): New function.
6381 (Incremental_binary::Incremental_binary): Initialize new data members.
6382 (Incremental_binary::check_inputs): Add cmdline parameter.
6383 (Incremental_binary::file_is_unchanged): Remove.
6384 (Input_reader::arg_serial): New function.
6385 (Input_reader::get_unused_symbol_count): New function.
6386 (Input_reader::get_unused_symbol): New function.
6387 (Input_reader::do_arg_serial): New function.
6388 (Input_reader::do_get_unused_symbol_count): New function.
6389 (Input_reader::do_get_unused_symbol): New function.
6390 (Incremental_binary::input_file_count): New function.
6391 (Incremental_binary::get_input_reader): Change signature to use
6392 index instead of filename.
6393 (Incremental_binary::file_has_changed): New function.
6394 (Incremental_binary::get_input_argument): New function.
6395 (Incremental_binary::get_library): New function.
6396 (Incremental_binary::get_script_info): New function.
6397 (Incremental_binary::init_layout): New function.
6398 (Incremental_binary::reserve_layout): New function.
6399 (Incremental_binary::output_file): New function.
6400 (Incremental_binary::do_check_inputs): New function.
6401 (Incremental_binary::do_file_is_unchanged): Remove.
6402 (Incremental_binary::do_file_has_changed): New function.
6403 (Incremental_binary::do_init_layout): New function.
6404 (Incremental_binary::do_reserve_layout): New function.
6405 (Incremental_binary::do_input_file_count): New function.
6406 (Incremental_binary::do_get_input_reader): Change signature.
6407 (Incremental_binary::input_args_map_): New data member.
6408 (Incremental_binary::library_map_): New data member.
6409 (Incremental_binary::script_map_): New data member.
6410 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6412 (Sized_incremental_binary::output_section): New function.
6413 (Sized_incremental_binary::inputs_reader): Add const.
6414 (Sized_incremental_binary::symtab_reader): Add const.
6415 (Sized_incremental_binary::relocs_reader): Add const.
6416 (Sized_incremental_binary::got_plt_reader): Add const.
6417 (Sized_incremental_binary::get_symtab_view): New function.
6418 (Sized_incremental_binary::Inputs_reader): New typedef.
6419 (Sized_incremental_binary::Input_entry_reader): New typedef.
6420 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6421 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6422 (Sized_incremental_binary::do_file_has_changed): New function.
6423 (Sized_incremental_binary::do_init_layout): New function.
6424 (Sized_incremental_binary::do_reserve_layout): New function.
6425 (Sized_input_reader::Inputs_reader): Remove.
6426 (Sized_input_reader::Input_entry_reader): Remove.
6427 (Sized_input_reader::do_arg_serial): New function.
6428 (Sized_input_reader::do_get_unused_symbol_count): New function.
6429 (Sized_input_reader::do_get_unused_symbol): New function.
6430 (Sized_incremental_binary::do_input_file_count): New function.
6431 (Sized_incremental_binary::do_get_input_reader): Change signature;
6432 use index instead of filename.
6433 (Sized_incremental_binary::section_map_): New data member.
6434 (Sized_incremental_binary::input_entry_readers_): New data member.
6435 (class Sized_incr_relobj): New class.
6436 (class Sized_incr_dynobj): New class.
6437 (make_sized_incremental_object): New function.
6438 (class Incremental_library): New class.
6439 * layout.cc (Free_list::num_lists): New static data member.
6440 (Free_list::num_nodes): New static data member.
6441 (Free_list::num_removes): New static data member.
6442 (Free_list::num_remove_visits): New static data member.
6443 (Free_list::num_allocates): New static data member.
6444 (Free_list::num_allocate_visits): New static data member.
6445 (Free_list::init): New function.
6446 (Free_list::remove): New function.
6447 (Free_list::allocate): New function.
6448 (Free_list::dump): New function.
6449 (Free_list::print_stats): New function.
6450 (Layout_task_runner::run): Resize output file for incremental updates.
6451 (Layout::Layout): Initialize new data members.
6452 (Layout::set_incremental_base): New function.
6453 (Layout::init_fixed_output_section): New function.
6454 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6455 incremental updates.
6456 (Layout::create_gold_note): Do not create gold note section for
6457 incremental updates.
6458 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6459 for incremental updates.
6460 (Layout::set_section_offsets): For incremental updates, allocate space
6462 (Layout::create_symtab_sections): Layout with offsets relative to
6463 start of section; for incremental updates, allocate space from free
6465 (Layout::create_shdrs): For incremental updates, allocate space from
6467 (Layout::finish_dynamic_section): For incremental updates, do not
6468 check --as-needed (fixed in subsequent patch).
6469 * layout.h (class Free_list): New class.
6470 (Layout::set_incremental_base): New function.
6471 (Layout::incremental_base): New function.
6472 (Layout::init_fixed_output_section): New function.
6473 (Layout::allocate): New function.
6474 (Layout::incremental_base_): New data member.
6475 (Layout::free_list_): New data member.
6476 * main.cc (main): Print Free_list statistics.
6477 * object.cc (Relobj::finalize_incremental_relocs): Add
6478 clear_counts parameter; clear counts only when clear_counts is set.
6479 (Sized_relobj::Sized_relobj): Initialize new base class.
6480 (Sized_relobj::do_layout): Don't report special sections.
6481 (Sized_relobj::do_for_all_local_got_entries): New function.
6482 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6483 symtab_off to all symbol table offsets.
6484 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6485 * object.h (class Got_offset_list): Move to top of file.
6486 (Object::Object): Allow case where input_file == NULL.
6487 (Object::~Object): Likewise.
6488 (Object::input_file): Assert that input_file != NULL.
6489 (Object::lock): Allow case where input_file == NULL.
6490 (Object::unlock): Likewise.
6491 (Object::is_locked): Likewise.
6492 (Object::token): Likewise.
6493 (Object::release): Likewise.
6494 (Object::is_incremental): New function.
6495 (Object::get_mtime): New function.
6496 (Object::for_all_local_got_entries): New function.
6497 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6498 (Object::set_is_in_system_directory): New function.
6499 (Object::is_in_system_directory): New function.
6500 (Object::do_is_incremental): New function.
6501 (Object::do_get_mtime): New function.
6502 (Object::do_for_all_local_got_entries): New function.
6503 (Object::is_in_system_directory_): New data member.
6504 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6505 (class Sized_relobj_base): New class.
6506 (class Sized_relobj): Derive from Sized_relobj_base.
6507 (class Sized_relobj::Symbols): Redeclare from base class.
6508 (class Sized_relobj::local_got_offset_list): Remove.
6509 (class Sized_relobj::Output_sections): Redeclare from base class.
6510 (class Sized_relobj::do_for_all_local_got_entries): New function.
6511 (class Sized_relobj::write_local_symbols): Add offset parameter.
6512 (class Sized_relobj::local_symbol_offset_): Update comment.
6513 (class Sized_relobj::local_dynsym_offset_): Update comment.
6514 * options.cc (Input_arguments::add_file): Remove const.
6515 * options.h (Input_file_argument::Input_file_argument):
6516 Initialize arg_serial_ (all constructors).
6517 (Input_file_argument::set_arg_serial): New function.
6518 (Input_file_argument::arg_serial): New function.
6519 (Input_file_argument::arg_serial_): New data member.
6520 (Input_arguments::Input_arguments): Initialize file_count_.
6521 (Input_arguments::add_file): Remove const.
6522 (Input_arguments::number_of_input_files): New function.
6523 (Input_arguments::file_count_): New data member.
6524 (Command_line::number_of_input_files): Call
6525 Input_arguments::number_of_input_files.
6526 * output.cc (Output_segment_headers::Output_segment_headers):
6528 (Output_section::Input_section::current_data_size): New function.
6529 (Output_section::Output_section): Initialize new data members.
6530 (Output_section::add_input_section): Don't do merge sections for
6531 an incremental link; allocate space from free list for an
6533 (Output_section::add_output_section_data): Allocate space from
6534 free list for an incremental update.
6535 (Output_section::update_data_size): New function.
6536 (Output_section::set_fixed_layout): New function.
6537 (Output_section::reserve): New function.
6538 (Output_segment::set_section_addresses): Remove const.
6539 (Output_segment::set_section_list_addresses): Remove const; allocate
6540 space from free list for an incremental update.
6541 (Output_segment::set_offset): Adjust size of RELRO segment for an
6543 * output.h (Output_data::current_data_size): Move here from
6545 (Output_data::pre_finalize_data_size): New function.
6546 (Output_data::update_data_size): New function.
6547 (Output_section_headers::update_data_size): new function.
6548 (Output_section_data_build::current_data_size): Move to Output_data.
6549 (Output_data_strtab::update_data_size): New function.
6550 (Output_section::current_data_size): Move to Output_data.
6551 (Output_section::set_fixed_layout): New function.
6552 (Output_section::has_fixed_layout): New function.
6553 (Output_section::reserve): New function.
6554 (Output_section::update_data_size): New function.
6555 (Output_section::has_fixed_layout_): New data member.
6556 (Output_section::free_list_): New data member.
6557 (Output_segment::set_section_addresses): Remove const.
6558 (Output_segment::set_section_list_addresses): Remove const.
6559 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6561 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6563 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6564 parameter when calling Add_symbols constructor; store argument
6565 serial number for members of a lib group.
6566 (Add_symbols::locks): Allow case where token == NULL.
6567 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6568 (Read_member::~Read_member): New function.
6569 (Read_member::is_runnable): New function.
6570 (Read_member::locks): New function.
6571 (Read_member::run): New function.
6572 (Check_script::~Check_script): New function.
6573 (Check_script::is_runnable): New function.
6574 (Check_script::locks): New function.
6575 (Check_script::run): New function.
6576 (Check_library::~Check_library): New function.
6577 (Check_library::is_runnable): New function.
6578 (Check_library::locks): New function.
6579 (Check_library::run): New function.
6580 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6581 (Add_symbols::library_): New data member.
6582 (class Read_member): New class.
6583 (class Check_script): New class.
6584 (class Check_library): New class.
6585 * reloc.cc (Read_relocs::is_runnable): Allow case where
6587 (Read_relocs::locks): Likewise.
6588 (Scan_relocs::locks): Likewise.
6589 (Relocate_task::locks): Likewise.
6590 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6592 (Sized_relobj::incremental_relocs_scan): Fix comment.
6593 (Sized_relobj::do_relocate): Pass output file offset to
6594 write_local_symbols.
6595 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6596 from class declaration.
6597 * script.cc (read_input_script): Allocate Script_info; pass
6598 argument serial number to report_script.
6599 * script.h (class Script_info): Move to incremental.h.
6600 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6601 * symtab.h (Symbol_table::add_from_incrobj): New function.
6602 (Symbol_table::set_file_offset): New function.
6604 2011-04-05 Cary Coutant <ccoutant@google.com>
6606 * incremental-dump.cc (dump_incremental_inputs): Change signature
6607 to take a Sized_incremental_binary; change caller. Use readers
6608 in Sized_incremental_binary.
6610 (Sized_incremental_binary::find_incremental_inputs_sections):
6611 Rename do_find_incremental_inputs_sections to this.
6612 (Sized_incremental_binary::setup_readers): New function.
6613 (Sized_incremental_binary::do_check_inputs): Check
6614 has_incremental_info_ flag; move setup code to setup_readers;
6616 (Sized_incremental_binary::do_file_is_unchanged): New function.
6617 (Sized_incremental_binary::do_get_input_reader): New function.
6618 * incremental.h (class Incremental_binary): Move to end of file.
6619 (Incremental_binary::file_is_unchanged): New function.
6620 (Incremental_binary::do_file_is_unchanged): New function.
6621 (Incremental_binary::Input_reader): New class.
6622 (Incremental_binary::get_input_reader): New function.
6623 (class Sized_incremental_binary): Move to end of file.
6624 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6625 input section reader classes.
6626 (Sized_incremental_binary::has_incremental_info): New function.
6627 (Sized_incremental_binary::inputs_reader): New function.
6628 (Sized_incremental_binary::symtab_reader): New function.
6629 (Sized_incremental_binary::relocs_reader): New function.
6630 (Sized_incremental_binary::got_plt_reader): New function.
6631 (Sized_incremental_binary::do_file_is_unchanged): New function.
6632 (Sized_incremental_binary::Sized_input_reader): New class.
6633 (Sized_incremental_binary::get_input_reader): New function.
6634 (Sized_incremental_binary::find_incremental_inputs_sections):
6635 Rename do_find_incremental_inputs_sections to this.
6636 (Sized_incremental_binary::setup_readers): New function.
6637 (Sized_incremental_binary::has_incremental_info_): New data member.
6638 (Sized_incremental_binary::inputs_reader_): New data member.
6639 (Sized_incremental_binary::symtab_reader_): New data member.
6640 (Sized_incremental_binary::relocs_reader_): New data member.
6641 (Sized_incremental_binary::got_plt_reader_): New data member.
6642 (Sized_incremental_binary::current_input_file_): New data member.
6644 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6647 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6650 2011-03-30 Cary Coutant <ccoutant@google.com>
6652 * archive.cc (Archive::include_member): Adjust call to report_object.
6653 (Add_archive_symbols::run): Add script_info to call to
6654 report_archive_begin.
6655 (Lib_group::include_member): Adjust call to report_object.
6656 (Add_lib_group_symbols::run): Adjust call to report_object.
6657 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6658 blocks. Add object count for script input files.
6659 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6660 script_info parameter; change all callers.
6661 (Incremental_inputs::report_object): Add script_info parameter;
6663 (Incremental_inputs::report_script): Store backpointer to
6664 incremental info entry.
6665 (Output_section_incremental_inputs::set_final_data_size): Record
6666 additional information for scripts.
6667 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6668 * incremental.h (Incremental_script_entry::add_object): New function.
6669 (Incremental_script_entry::get_object_count): New function.
6670 (Incremental_script_entry::get_object): New function.
6671 (Incremental_script_entry::objects_): New data member; adjust
6673 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6674 (Incremental_inputs::report_object): Add script_info parameter.
6675 (Incremental_inputs_reader::get_object_count): New function.
6676 (Incremental_inputs_reader::get_object_offset): New function.
6677 * options.cc (Input_arguments::add_file): Return reference to
6679 * options.h (Input_argument::set_script_info): New function.
6680 (Input_argument::script_info): New function.
6681 (Input_argument::script_info_): New data member; adjust all
6683 (Input_file_group::add_file): Return reference to new input argument.
6684 (Input_file_lib::add_file): Likewise.
6685 (Input_arguments::add_file): Likewise.
6686 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6687 * script.cc (Parser_closure::Parser_closure): Add script_info
6688 parameter; adjust all callers.
6689 (Parser_closure::script_info): New function.
6690 (Parser_closure::script_info_): New data member.
6691 (read_input_script): Report scripts earlier to incremental info.
6692 (script_add_file): Set script_info in Input_argument.
6693 (script_add_library): Likewise.
6694 * script.h (Script_options::Script_info): Rewrite class.
6696 2011-03-29 Cary Coutant <ccoutant@google.com>
6698 * archive.cc (Library_base::should_include_member): Move
6699 method here from class Archive.
6700 (Archive::Archive): Initialize base class.
6701 (Archive::should_include_member): Move to base class.
6702 (Archive::do_for_all_unused_symbols): New function.
6703 (Add_archive_symbols::run): Remove redundant access to
6705 (Lib_group::Lib_group): Initialize base class.
6706 (Lib_group::do_filename): New function.
6707 (Lib_group::include_member): Pass pointer to Lib_group to
6709 (Lib_group::do_for_all_unused_symbols): New function.
6710 (Add_lib_group_symbols::run): Report archive information for
6712 * archive.h (class Library_base): New base class.
6713 (class Archive): Derive from Library_base.
6714 (Archive::filename): Move to base class.
6715 (Archive::set_incremental_info): Likewise.
6716 (Archive::incremental_info): Likewise.
6717 (Archive::Should_include): Likewise.
6718 (Archive::should_include_member): Likewise.
6719 (Archive::Armap_entry): Remove.
6720 (Archive::Unused_symbol_iterator): Remove.
6721 (Archive::unused_symbols_begin): Remove.
6722 (Archive::unused_symbols_end): Remove.
6723 (Archive::do_filename): New function.
6724 (Archive::do_get_mtime): New function.
6725 (Archive::do_for_all_unused_symbols): New function.
6726 (Archive::task_): Move to base class.
6727 (Archive::incremental_info_): Likewise.
6728 (class Lib_group): Derive from Library_base.
6729 (Lib_group::do_filename): New function.
6730 (Lib_group::do_get_mtime): New function.
6731 (Lib_group::do_for_all_unused_symbols): New function.
6732 (Lib_group::task_): Move to base class.
6733 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6735 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6737 * incremental.cc (Incremental_inputs::report_archive_begin):
6738 Use Library_base; call library's get_mtime; add incremental inputs
6739 entry before members.
6740 (class Unused_symbol_visitor): New class.
6741 (Incremental_inputs::report_archive_end): Use Library_base; use
6742 visitor class to record unused symbols; don't add incremental inputs
6743 entry after members.
6744 (Incremental_inputs::report_object): Use Library_base.
6746 (Incremental_archive_entry::Incremental_archive_entry): Remove
6747 unused Archive parameter.
6748 (Incremental_inputs::report_archive_begin): Use Library_base.
6749 (Incremental_inputs::report_archive_end): Likewise.
6750 (Incremental_inputs::report_object): Likewise.
6751 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6753 * object.h (Object::for_all_global_symbols): New function.
6754 (Object::do_for_all_global_symbols): New function.
6755 (Sized_relobj::do_for_all_global_symbols): New function.
6756 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6758 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6761 2011-03-27 Ian Lance Taylor <iant@google.com>
6763 * archive.cc (Archive::interpret_header): Return -1 if something
6764 goes wrong. Change callers accordingly.
6766 2011-03-25 Cary Coutant <ccoutant@google.com>
6768 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6769 * testsuite/Makefile.in: Regenerate.
6771 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
6773 * plugin.cc (get_view): New.
6774 (Plugin::load): Pass get_view to the plugin.
6775 (Plugin_manager::get_view): New.
6777 2011-03-21 Ian Lance Taylor <iant@google.com>
6779 * testsuite/final_layout.sh: Rewrite to not use dc.
6780 * testsuite/relro_test.sh: Fail if dc is not present.
6782 2011-03-21 Sriraman Tallam <tmsriram@google.com>
6784 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6786 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6787 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6789 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6790 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6792 2011-03-14 Ian Lance Taylor <iant@google.com>
6794 * script-sections.cc (Sort_output_sections::script_compare):
6795 Rename from is_before, change return type.
6796 (Sort_output_sections::operator()): Adjust accordingly.
6798 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6801 * testsuite/odr_violation2.cc: Add comment to make all error line
6802 numbers double digits.
6803 * testsuite/debug_msg.sh: Adjust expected errors.
6805 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6807 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6808 but mark earlier ones as non-canonical
6809 (offset_to_iterator): Update search target and example
6810 (do_addr2line): Return extra lines in a vector*
6811 (format_file_lineno): Extract from do_addr2line
6812 (one_addr2line): Add vector* out-param
6813 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6814 when a lineno entry appeared last for its instruction
6815 (Dwarf_line_info): Add vector* out-param
6816 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6817 * symtab.cc (Odr_violation_compare): Include the lineno in the
6819 (linenos_from_loc): New. Combine the canonical line for an
6820 address with its other lines.
6821 (True_if_intersect): New. Helper functor to make
6822 std::set_intersection a query.
6823 (detect_odr_violations): Compare sets of lines instead of just
6824 one line for each function. This became less deterministic, but
6825 has fewer false positives.
6826 * symtab.h: Declarations.
6827 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6828 mix an optimized and non-optimized object in the same binary
6829 (odr_violation2.so): Same.
6830 * testsuite/Makefile.in: Regenerate from Makefile.am.
6831 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6832 * testsuite/debug_msg.sh: Update line numbers and add
6834 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6835 non-optimized context.
6836 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6837 isn't inlined, and use OdrDerived in an optimized context.
6838 * testsuite/odr_header1.h: Defines OdrDerived, where
6839 optimization will change the
6840 first-instruction-in-the-destructor's file and line number.
6841 * testsuite/odr_header2.h: Defines OdrBase.
6843 2011-03-09 Ian Lance Taylor <iant@google.com>
6845 * fileread.cc (File_read::clear_views): Don't delete the whole
6848 2011-03-08 Ian Lance Taylor <iant@google.com>
6851 * fileread.cc: #include <climits>.
6852 (GOLD_IOV_MAX): Define.
6853 (File_read::read_multiple): Limit number of entries by iov_max.
6854 * fileread.h (class File_read): Always set max_readv_entries to
6857 2011-03-07 Ian Lance Taylor <iant@google.com>
6860 * options.h (class General_options): Add -dy and -dn.
6862 2011-03-02 Cary Coutant <ccoutant@google.com>
6864 * testsuite/script_test_9.t: Add TLS segment.
6866 2011-03-02 Simon Baldwin <simonb@google.com>
6868 * configure.ac: Add check for gnu_indirect_function support in
6869 the toolchain building binutils.
6870 * configure: Rebuild.
6872 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
6874 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6875 plugin only symbols.
6876 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6877 in plugin files as not needed in the symbol table.
6879 2011-02-11 Sriraman Tallam <tmsriram@google.com>
6881 * output.cc (Output_section::add_input_section): Delay fill
6882 generation for section ordering.
6884 2011-02-09 Ian Lance Taylor <iant@google.com>
6887 * object.h (class Sized_relobj): Remove clear_local_symbols.
6888 * reloc.cc (Sized_relobj::do_relocate): Don't call
6889 clear_local_symbols.
6891 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
6893 * plugin.cc (is_visible_from_outside): Return true for symbols
6896 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6898 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6901 2011-02-02 Sriraman Tallam <tmsriram@google.com>
6903 * icf.h (is_section_foldable_candidate): Change type of parameter
6905 * icf.cc (Icf::find_identical_sections): Change type of local variable
6906 section_name to be std::string.
6907 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6909 2011-01-25 Ian Lance Taylor <iant@google.com>
6911 * script.cc (script_add_extern): Rewrite to use
6912 add_symbol_reference.
6914 2011-01-25 Doug Kwan <dougkwan@google.com>
6916 * icf.cc (get_section_contents): Always lock section's object.
6918 2011-01-24 Ian Lance Taylor <iant@google.com>
6920 * options.h (class General_options): Accept
6921 --no-detect-odr-violations.
6923 2011-01-24 Ian Lance Taylor <iant@google.com>
6925 * version.cc (version_string): Bump to 1.11.
6927 2011-01-24 Ian Lance Taylor <iant@google.com>
6929 * plugin.cc (class Plugin_rescan): Define new class.
6930 (Plugin_manager::claim_file): Set any_claimed_.
6931 (Plugin_manager::save_archive): New function.
6932 (Plugin_manager::save_input_group): New function.
6933 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6935 (Plugin_manager::new_undefined_symbol): New function.
6936 (Plugin_manager::rescan): New function.
6937 (Plugin_manager::rescannable_defines): New function.
6938 (Plugin_manager::add_input_file): Set any_added_.
6939 * plugin.h (class Plugin_manager): define new fields rescannable_,
6940 undefined_symbols_, any_claimed_, and any_added_. Declare
6941 Plugin_rescan as friend. Declare new functions.
6942 (Plugin_manager::Rescannable): Define type.
6943 (Plugin_manager::Rescannable_list): Define type.
6944 (Plugin_manager::Undefined_symbol_list): Define type.
6945 (Plugin_manager::Plugin_manager): Initialize new fields.
6946 * archive.cc (Archive::defines_symbol): New function.
6947 (Add_archive_symbols::run): Pass archive to plugins if any.
6948 * archive.h (class Archive): Declare defines_symbol.
6949 * readsyms.cc (Input_group::~Input_group): New function.
6950 (Finish_group::run): Pass input_group to plugins if any.
6951 * readsyms.h (class Input_group): Declare destructor.
6952 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6955 2011-01-10 Ian Lance Taylor <iant@google.com>
6957 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6959 (Layout::set_segment_offsets): Reset increase_relro before calling
6960 set_section_addresses a second time.
6962 2011-01-04 Cary Coutant <ccoutant@google.com>
6964 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6965 sections before NOBITS sections.
6967 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6969 * version.cc (print_version): Update copyright to 2011.
6971 2010-12-23 Cary Coutant <ccoutant@google.com>
6973 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6974 of OS to this->add. Add OD parameter to second form of the function.
6976 2010-12-20 Ian Lance Taylor <iant@google.com>
6978 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6979 second of two consecutive entries with same offset.
6981 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6983 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6984 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6985 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6986 to avoid unneeded links against $(LDADD).
6987 * testsuite/Makefile.in: Regenerate.
6989 2010-12-15 Ian Lance Taylor <iant@google.com>
6992 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6993 for R_X86_64_32 and R_X86_64_PC32.
6994 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6995 ver_matching_def_pic.o.
6996 (ver_matching_def_pic.o): New target.
6998 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7000 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7001 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7002 Move definition before File_read::View member definitions.
7003 (File_read::View::~View): Initialize and hold lock before
7004 updating current_mapped_bytes.
7006 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7008 * dwarf_reader.cc: Remove outdated comment.
7009 * gold-threads.cc: Fix typo in error message.
7010 * archive.cc: Fix typos in comments.
7011 * archive.h: Likewise.
7012 * arm-reloc-property.cc: Likewise.
7013 * arm-reloc-property.h: Likewise.
7014 * arm-reloc.def: Likewise.
7016 * attributes.h: Likewise.
7017 * cref.cc: Likewise.
7018 * ehframe.cc: Likewise.
7019 * fileread.h: Likewise.
7021 * i386.cc: Likewise.
7023 * incremental.h: Likewise.
7024 * int_encoding.cc: Likewise.
7025 * layout.h: Likewise.
7026 * main.cc: Likewise.
7027 * merge.h: Likewise.
7028 * object.cc: Likewise.
7029 * object.h: Likewise.
7030 * options.cc: Likewise.
7031 * readsyms.cc: Likewise.
7032 * reduced_debug_output.cc: Likewise.
7033 * reloc.cc: Likewise.
7034 * script-sections.cc: Likewise.
7035 * sparc.cc: Likewise.
7036 * symtab.h: Likewise.
7037 * target-reloc.h: Likewise.
7038 * target.cc: Likewise.
7039 * target.h: Likewise.
7040 * timer.cc: Likewise.
7041 * timer.h: Likewise.
7042 * x86_64.cc: Likewise.
7044 2010-12-09 Cary Coutant <ccoutant@google.com>
7046 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7048 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7049 parameter; change all callers.
7050 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7051 * options.h (warn_execstack): New option.
7053 2010-12-07 Doug Kwan <dougkwan@google.com>
7055 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7056 like function call relocations.
7058 2010-12-07 Ian Lance Taylor <iant@google.com>
7060 * archive.cc (Archive::get_elf_object_for_member): Permit
7061 punconfigured to be NULL.
7062 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7063 (Archive::include_member): Pass NULL to get_elf_object_for_member
7064 if we searched for the archive and this is the first included
7067 2010-12-01 Ian Lance Taylor <iant@google.com>
7069 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7070 track_relocs_type_ field.
7071 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7072 Set track_relocs_type_.
7073 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7074 contents when using RELA relocs.
7075 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7077 * reloc.cc (Track_relocs::next_addend): New function.
7078 * reloc.h (class Track_relocs): Declare next_addend.
7080 2010-12-01 Ian Lance Taylor <iant@google.com>
7082 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7085 2010-12-01 Ian Lance Taylor <iant@google.com>
7087 * README: Update compilers known to work and fail.
7089 2010-11-23 Matthias Klose <doko@ubuntu.com>
7091 * configure.in: For --enable-gold, handle value `default' instead of
7092 `both*'. Always install ld as ld.bfd, install as ld if gold is
7094 * configure: Regenerate.
7096 2010-11-18 Doug Kwan <dougkwan@google.com>
7098 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7099 and right_alignment to be zero. Store result alignment only if it is
7100 greater than existing alignment.
7102 2010-11-16 Cary Coutant <ccoutant@google.com>
7105 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7106 Check for ".zdebug_line".
7108 2010-11-16 Doug Kwan <dougkwan@google.com>
7109 Cary Coutant <ccoutant@google.com>
7111 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7112 by reference; adjust all callers.
7113 * output.cc (Output_segment::set_section_addresses): Adjust references
7114 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7116 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7117 end at page boundary.
7119 2010-11-16 Cary Coutant <ccoutant@google.com>
7122 * layout.cc (Layout::choose_output_section): Transform names of
7123 compressed sections even when using a script with a SECTIONS clause.
7124 (Layout::output_section_name): Remove code to transform
7125 compressed debug section names.
7126 * output.cc (Output_section::add_input_section): Use uncompressed
7127 section size when tracking input sections.
7129 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7131 * symtab.h (Symbol::NON_PIC_REF): Remove.
7132 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7133 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7134 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7135 (Symbol::use_plt_offset): Take a flags argument and pass it
7136 directly to needs_dynamic_reloc. Restrict check for undefined
7137 weak symbols to function calls.
7138 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7139 (Target_arm::Scan::global): Use it.
7140 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7141 (Target_arm::Relocate::relocate): Likewise.
7142 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7143 parameter with an r_type parameter. Use get_reference_flags
7145 (Target_arm::Relocate::relocate): Update accordingly.
7146 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7147 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7148 (Target_i386::Scan::global): Likewise.
7149 (Target_i386::Relocate::relocate): Likewise.
7150 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7151 parameter with an r_type parameter. Use get_reference_flags
7153 (Target_i386::Relocate::relocate): Update accordingly.
7154 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7155 (Target_powerpc::Scan::global): Use it.
7156 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7157 (Target_powerpc::Relocate::relocate): Likewise.
7158 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7159 (Target_sparc::Scan::global): Use it.
7160 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7161 (Target_sparc::Relocate::relocate): Likewise.
7162 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7163 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7164 (Target_x86_64::Scan::global): Likewise.
7165 (Target_x86_64::Relocate::relocate): Likewise.
7167 2010-11-08 Doug Kwan <dougkwan@google.com>
7168 Cary Coutant <ccoutant@google.com>
7170 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7171 (Arm_exidx_merge_section::section_contents_): New data member.
7172 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7173 (Arm_input_section::~Arm_input_section): De-allocate memory.
7174 (Arm_input_section::original_contents_): New data member.
7175 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7176 in parameters instead of calling Object::section_contents without
7178 (Arm_output_section::group_section): New parameter TASK. Pass it
7179 to callees that need locking objects.
7180 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7181 to lock EXIDX input sections. Fix a formatting issue. Call
7182 Arm_exidx_merged_section::build_contents to create merged section
7184 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7185 to lock object of stub table owner.
7186 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7187 TEXT_SIZE to initialize data member TEXT_SIZE_.
7188 (Arm_exidx_input_section::addralign): Fix typo in comment.
7189 (Arm_exidx_input_section::text_size): New method.
7190 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7191 that require locking objects. Lock objects before scanning for stubs
7192 and updating local symbols.
7193 (Arm_input_section<big_endian>::init): Copy contents of original
7195 (Arm_input_section<big_endian>::do_write): Use saved contents of
7196 original input section instead of calling Object::section_contents
7198 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7199 size without calling Object::section_size().
7200 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7201 for size. Allocate a buffer for merged EXIDX entries.
7202 (Arm_exidx_merged_section::build_contents): New method.
7203 (Arm_exidx_merged_section::do_write): Move merge section contents
7204 building code to Arm_exidx_merged_section::build_contetns. Write
7205 out contetns in buffer instead of building it on the fly.
7206 (Arm_relobj::make_exidx_input_section): Also pass text section size
7207 to Arm_exidx_input_section constructor.
7208 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7209 (Arm_dynobj::do_read_symbols): Fix memory leak.
7210 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7211 * target.h: (class Task): Add forward declaration.
7212 (Target::relax): Add new parameter TASK and pass it to
7214 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7216 2010-11-05 Cary Coutant <ccoutant@google.com>
7219 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7220 object when reading from the file.
7221 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7223 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7224 when reading section contents.
7225 (get_section_contents): Likewise.
7226 (icf::find_identical_sections): Likewise.
7227 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7228 object when reading from the file.
7229 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7230 the object when doing deferred section layout.
7232 2010-11-03 Nick Clifton <nickc@redhat.com>
7235 * script.h (class Symbol_assignment: name): New member. Returns
7236 the name of the symbol.
7237 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7238 Returns true if the given symbol name is on the list of
7239 assignments wating to be processed.
7240 * archive.cc (should_incldue_member): If the symbol is undefined,
7241 check to see if it is on the list of symbols pending assignment.
7243 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7245 * script-sections.cc (Script_sections::find_memory_region): Check
7246 for a NULL output section pointer.
7248 2010-10-29 Doug Kwan <dougkwan@google.com>
7250 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7251 Output_section::add_relaxed_input_section.
7252 * output.cc (Output_section::add_relaxed_input_section): Add new
7253 arguments LAYOUT and NAME. Set section order index.
7254 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7255 Copy section order index.
7256 * output.h (Output_section::add_relaxed_input_section): Add new
7257 arguments LAYOUT and NAME.
7259 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7261 * testsuite/Makefile.am: Move gcctestdir/ld rule to
7262 NATIVE_OR_CROSS_LINKER.
7263 * testsuite/Makefile.in: Regenerate.
7265 2010-10-20 Doug Kwan <dougkwan@google.com>
7267 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7268 without SHF_LINK_ORDER flags.
7269 * layout.cc (Layout::choose_output_section): Do not filter
7270 SHF_LINK_ORDER flag in a relocatable link.
7272 2010-10-17 Cary Coutant <ccoutant@google.com>
7274 * output.h (Output_segment::set_section_addresses): Change function
7275 signature. Update all callers.
7276 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7278 (Output_segment::set_section_addresses): Align after last TLS
7279 section. Add padding before last relro section instead of after.
7281 2010-10-17 Doug Kwan <dougkwan@google.com>
7283 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7284 GOT output section to be writable.
7286 2010-10-14 Cary Coutant <ccoutant@google.com>
7288 * debug.h (DEBUG_INCREMENTAL): New flag.
7289 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7290 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7292 * incremental.cc (report_command_line): Ignore all forms of
7294 * layout.cc (Layout::Layout): Check parameters for incremental link
7296 * options.cc (General_options::parse_incremental): New function.
7297 (General_options::parse_no_incremental): New function.
7298 (General_options::parse_incremental_full): New function.
7299 (General_options::parse_incremental_update): New function.
7300 (General_options::incremental_mode_): New data member.
7301 (General_options::finalize): Check incremental_mode_.
7302 * options.h (General_options): Update help text for --incremental.
7303 Add --no-incremental, --incremental-full, --incremental-update.
7304 (General_options::Incremental_mode): New enum type.
7305 (General_options::incremental_mode): New function.
7306 (General_options::incremental_mode_): New data member.
7307 * parameters.cc (Parameters::incremental_mode_): New data member.
7308 (Parameters::set_options): Set incremental_mode_.
7309 (Parameters::set_incremental_full): New function.
7310 (Parameters::incremental): New function.
7311 (Parameters::incremental_update): New function.
7312 (set_parameters_incremental_full): New function.
7313 * parameters.h (Parameters::set_incremental_full): New function.
7314 (Parameters::incremental): New function.
7315 (Parameters::incremental_update): New function.
7316 (Parameters::incremental_mode_): New data member.
7317 (set_parameters_incremental_full): New function.
7318 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7319 incremental link mode.
7320 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7321 (Sized_relobj::do_relocate_sections): Likewise.
7322 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7324 * testsuite/Makefile.in: Regenerate.
7325 * testsuite/incremental_test.sh: Filter all forms of --incremental.
7327 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7329 * script-sections.h (class Script_sections): Make
7330 Sections_elements typedef public.
7331 * script-sections.cc (class Sort_output_sections): Add elements_
7332 field. Add constructor which sets it; change all callers.
7333 (Sort_output_sections::is_before): New function.
7334 (Sort_output_sections::operator()): Call is_before.
7335 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7337 * testsuite/script_test_10.sh: New test. Test script section
7339 * testsuite/script_test_10.t: Likewise.
7340 * testsuite/script_test_10.s: Likewise.
7341 * testsuite/Makefile.am: Wrap the cross linker tests and the
7342 common tests into NATIVE_OR_CROSS_LINKER.
7343 (check_SCRIPTS): Add script_test_10.sh.
7344 (check_DATA): Add script_test_10.stdout.
7345 (script_test_10.o, script_test_10): New targets.
7346 (script_test_10.stdout): New target.
7347 * configure, testsuite/Makefile.in: Regenerate.
7349 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7351 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7352 error for the deprecated relocations.
7353 (Target_arm::Scan::global): Likewise.
7354 (Target_arm::Relocate::relocate): Likewise.
7356 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7358 * fileread.cc (Input_file::find_file): Initialize *found_name
7359 and *namep when using the fallback search for case 4.
7361 2010-10-11 Cary Coutant <ccoutant@google.com>
7363 * options.h (class General_options): Redefine -z lazy as an alias for
7364 the negation of -z now.
7366 2010-10-11 Ian Lance Taylor <iant@google.com>
7368 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7371 2010-10-06 Nick Clifton <nickc@redhat.com>
7373 * script-sections.cc(class Memory_region): Remove
7374 current_lma_offset_ field. Rename current_vma_offset_ to
7375 current_offset_. Add last_section_ field.
7376 (Memory_region::get_current_vma_address): Rename to
7377 get_current_address.
7378 (Memory_region::get_current_lma_address): Delete.
7379 (Memory_region::increment_vma_offset): Rename to
7381 (Memory_region::increment_lma_offset): Delete.
7382 (Memory_region::attributes_compatible): New method. Returns
7383 true if the provided section is compatible with the region.
7384 (Memory_region::get_last_section): New method. Returns the last
7385 section to use the region.
7386 (Memory_region::set_last_section): New method. Stores the last
7387 section to use the region.
7388 (Script_sections::block_in_region): New method. Returns true if
7389 a block of memory is contained within a region.
7390 (Script_sections::find_memory_region): New method. Locates a
7391 memory region to be used to set a VMA or LMA address.
7392 (Output_section_definition::set_section_addresses): Add code to
7393 check for addresses set by memory regions.
7394 (Output_segment::set_section_addresses): Remove memory region
7396 (Script_sections::create_segment): Add a warning if a header
7397 segment is created outside of any region.
7398 * script-sections.h (class Script_sections): Add prototypes for
7399 find_memory_region and block_in_region methods.
7400 * testsuite/memory_test.s: Use .long instead of .word.
7401 * testsuite/memory_test.t: Add some more output sections.
7402 * testsuite/memory_test.sh: Update expected output.
7404 2010-10-02 Doug Kwan <dougkwan@google.com>
7406 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7407 defintion to symtab.h
7408 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7409 declaration to defintion.
7411 2010-10-01 Nick Clifton <nickc@redhat.com>
7413 * expression.cc (eval): Replace dummy argument with NULL.
7414 (eval_maybe_dot): Check for a NULL result section pointer.
7415 (Symbol_expression::value): Likewise.
7416 (Dot_expression::value): Likewise.
7417 (BINARY_EXPRESSION): Likewise.
7418 (Max_expression::value): Likewise.
7419 (Min_expression::value): Likewise.
7420 (Absolute_expression::value): Likewise.
7421 (Addr_expression::value_from_output_section): Likewise.
7422 (Loaddddr_expression::value_from_output_section): Likewise.
7423 (Segment_start_expression::value): Likewise.
7424 * script-sections.cc
7425 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7427 (Sections_elememt_dot_assignment::set_section_addresses):
7429 (Output_data_expression::do_write_to_buffer): Likewise.
7430 (Output_section_definition::finalize_symbols): Likewise.
7431 (Output_section_definition::set_section_addresses): Likewise.
7433 2010-09-30 Doug Kwan <dougkwan@google.com>
7435 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7437 2010-09-28 Sriraman Tallam <tmsriram@google.com>
7439 * target.h (Target::can_icf_inline_merge_sections): New virtual
7441 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7443 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7445 * icf.cc (get_section_contents): Inline merge sections only when
7448 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7450 * configure: Regenerate.
7452 2010-09-17 Ian Lance Taylor <iant@google.com>
7454 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
7455 * testsuite/Makefile.am (memory_test.o): New target.
7456 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7458 * testsuite/Makefile.in: Rebuild.
7460 2010-09-17 Doug Kwan <dougkwan@google.com>
7462 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7463 defintion if relocation uses GOT entries of the symbol.
7464 * testsuite/icf_safe_test.sh: Fix test.
7465 * testsuite/icf_safe_so_test.sh: Fix test.
7467 2010-09-16 Cary Coutant <ccoutant@google.com>
7469 * script_sections.cc (class Memory_region): Remove "NULL" from
7470 vector initializations.
7472 2010-09-15 Cary Coutant <ccoutant@google.com>
7474 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7475 Resolve forwarding symbols.
7477 2010-09-15 Doug Kwan <dougkwan@google.com>
7479 * gold/testsuite/script_test_3.t: Add ARM special sections.
7480 * gold/testsuite/script_test_4.t: Same.
7481 * gold/testsuite/script_test_5.t: Same.
7482 * gold/testsuite/script_test_6.t: Same.
7483 * gold/testsuite/script_test_7.t: Same.
7484 * gold/testsuite/script_test_7.t: Same.
7485 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7487 2010-09-14 Cary Coutant <ccoutant@google.com>
7489 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7490 (Target_x86_64::Relocate::relocate_tls): Replace check for
7491 saw_tls_block_reloc_ with test for executable section.
7493 2010-09-12 Cary Coutant <ccoutant@google.com>
7495 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7496 position-independent executables to shared libraries need dynamic
7498 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7499 position-independent executables.
7500 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7501 * testsuite/Makefile.in: Regenerate.
7503 2010-09-10 Nick Clifton <nickc@redhat.com>
7506 * testsuite/memory_test.t: Discard any sections that are not
7509 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7512 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7513 "This::" to work around a bug in gcc 4.2.
7515 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7517 2010-09-09 Rafael Espindola <espindola@google.com>
7519 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7520 sections with different PF_X flags in the same segment.
7521 (Layout::find_first_load_seg): Search all segments to find the first
7523 * options.h (rosegment): New.
7525 2010-09-08 Rafael Espindola <espindola@google.com>
7527 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
7529 2010-09-08 Doug Kwan <dougkwan@google.com>
7531 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7532 (Arm_relobj::do_relocate_sections): Add new parameter for output
7533 file to match the parent.
7534 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7535 of local symbols instead of input values. Update code to track
7536 changes in gold::relocate_section.
7537 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7538 (Sized_relobj::compute_final_local_value_internal): New methods.
7539 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7540 body into private version of Sized_relobj::compute_final_local_value.
7541 Call the inline method.
7542 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7543 merged symbol value if there is one.
7544 (Symbol_value::has_output_value): New method defintiion.
7545 (Sized_relobj::Compute_final_local_value_status): New enum type.
7546 (Sized_relobj::compute_final_local_value): New methods.
7547 (Sized_relobj::compute_final_local_value_internal): New methods.
7548 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7549 and arm_cortex_a8.sh.
7550 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7551 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7553 * Makefile.in: Regenerate.
7554 * testsuite/arm_bl_out_of_range.s: Update test.
7555 * testsuite/thumb_bl_out_of_range.s: Ditto.
7556 * testsuite/thumb_blx_out_of_range.s: Ditto.
7557 * testsuite/arm_branch_out_of_range.sh: New file.
7558 * testsuite/arm_cortex_a8.sh: Ditto.
7559 * testsuite/arm_cortex_a8_b.s: Ditto.
7560 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7561 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7562 * testsuite/arm_cortex_a8_bl.s: Ditto.
7563 * testsuite/arm_cortex_a8_blx.s: Ditto.
7564 * testsuite/arm_cortex_a8_local.s: Ditto.
7565 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7566 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7568 2010-09-08 Rafael Espindola <espindola@google.com>
7570 * Makefile.am (memory_test.stdout): Run readelf with -W.
7571 * Makefile.in: Regenerate.
7572 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7575 2010-09-08 Rafael Espindola <espindola@google.com>
7577 * script-sections.cc (Script_sections::add_memory_region): Convert
7578 field precision to int.
7579 * script.cc (script_set_section_region, script_set_section_region):
7580 Convert field precision to int.
7582 2010-09-08 Rafael Espindola <espindola@google.com>
7584 * arm.cc (do_finalize_sections): Create the __exidx_start and
7585 __exdix_end symbols even when the section is missing.
7587 2010-09-08 Nick Clifton <nickc@redhat.com>
7589 * README: Remove claim that MEMORY is not supported.
7590 * expression.cc (script_exp_function_origin)
7591 (script_exp_function_length): Move from here to ...
7592 * script.cc: ... here.
7593 (script_set_section_region, script_add_memory)
7594 (script_parse_memory_attr, script_include_directive): New
7596 * script-sections.cc
7597 (class Memory_region): New class.
7598 (class Output_section_definition): Add set_memory_region,
7599 set_section_vma, set_section_lma and get_section_name methods.
7600 (class Script_Sections): Add add_memory_region,
7601 find_memory_region, find_memory_region_origin,
7602 find_memory_region_length and set_memory_region methods.
7603 Have set_section_addresses method walk the list of set memory
7605 Extend the print methos to display memory regions.
7606 * script-sections.h: Add prototypes for new methods.
7607 Add enum for MEMORY region attributes.
7608 * yyscript.y: Add support for parsing MEMORY regions.
7609 * script-c.h: Add prototypes for new functions.
7610 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7611 * testsuite/Makefile.in: Regenerate.
7612 * testsuite/memory_test.sh: New script.
7613 * testsuite/memory_test.s: New assembler source file.
7614 * testsuite/memory_test.t: New linker script.
7616 2010-08-27 Doug Kwan <dougkwan@google.com>
7618 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7619 reference override an existing dynamic weak reference.
7620 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7621 * testsuite/Makefile.in: Regenerate.
7622 * testsuite/dyn_weak_ref.sh: New file.
7623 * testsuite/dyn_weak_ref_1.c: Ditto.
7624 * testsuite/dyn_weak_ref_2.c: Ditto.
7626 2010-08-27 Ian Lance Taylor <iant@google.com>
7628 * incremental.h (class Incremental_input_entry): Add virtual
7631 2010-08-27 Ian Lance Taylor <iant@google.com>
7633 * testsuite/start_lib_test_3.c: Mark t3 as used.
7635 2010-08-27 Nick Clifton <nickc@redhat.com>
7637 * options.cc (version_script): Fix small typo in previous
7640 2010-08-25 Nick Clifton <nickc@redhat.com>
7642 * archive.cc: Formatting fixes: Remove whitespace between
7643 typename and following asterisk. Remove whitespace between
7644 function name and opening parenthesis.
7645 * archive.h: Likewise.
7647 * attributes.cc: Likewise.
7648 * attributes.h: Likewise.
7649 * common.cc: Likewise.
7650 * copy-relocs.cc: Likewise.
7651 * dirsearch.h: Likewise.
7652 * dynobj.cc: Likewise.
7653 * ehframe.cc: Likewise.
7654 * ehframe.h: Likewise.
7655 * expression.cc: Likewise.
7656 * fileread.cc: Likewise.
7657 * fileread.h: Likewise.
7659 * gold-threads.cc: Likewise.
7660 * gold.cc: Likewise.
7661 * i386.cc: Likewise.
7663 * incremental-dump.cc: Likewise.
7664 * incremental.cc: Likewise.
7665 * layout.cc: Likewise.
7666 * layout.h: Likewise.
7667 * main.cc: Likewise.
7668 * merge.cc: Likewise.
7669 * merge.h: Likewise.
7670 * object.cc: Likewise.
7671 * object.h: Likewise.
7672 * options.cc: Likewise.
7673 * options.h: Likewise.
7674 * output.cc: Likewise.
7675 * output.h: Likewise.
7676 * plugin.cc: Likewise.
7677 * plugin.h: Likewise.
7678 * powerpc.cc: Likewise.
7679 * reloc.cc: Likewise.
7680 * script-c.h: Likewise.
7681 * script-sections.cc: Likewise.
7682 * script.cc: Likewise.
7683 * stringpool.cc: Likewise.
7684 * symtab.cc: Likewise.
7685 * symtab.h: Likewise.
7686 * target.cc: Likewise.
7687 * timer.cc: Likewise.
7688 * timer.h: Likewise.
7689 * version.cc: Likewise.
7690 * x86_64.cc: Likewise.
7692 2010-08-24 Nick Clifton <nickc@redhat.com>
7695 * layout.cc (segment_precedes): Sort segments by their physical
7696 addresses, if they have been set.
7698 2010-08-23 Cary Coutant <ccoutant@google.com>
7700 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7702 (Lib_group::include_member): Unlock object after deleting its
7704 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7707 2010-08-19 Neil Vachharajani <nvachhar@google.com>
7708 Cary Coutant <ccoutant@google.com>
7710 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7711 constructor, and set_blocker.
7712 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7714 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7715 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7716 * testsuite/Makefile.am (start_lib_test): New test case.
7717 * testsuite/Makefile.in: Regenerate.
7718 * testsuite/start_lib_test_main.c: New file.
7719 * testsuite/start_lib_test_1.c: New file.
7720 * testsuite/start_lib_test_2.c: New file.
7721 * testsuite/start_lib_test_3.c: New file.
7723 2010-08-19 Ian Lance Taylor <iant@google.com>
7725 * Makefile.in: Rebuild with automake 1.11.1.
7726 * aclocal.m4: Likewise.
7727 * testsuite/Makefile.in: Likewise.
7729 2010-08-19 Ian Lance Taylor <iant@google.com>
7732 * i386.cc (class Output_data_plt_i386): Update declarations.
7733 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7734 local_ifuncs_ fields.
7735 (Target_i386::do_plt_section_for_global): New function.
7736 (Target_i386::do_plt_section_for_local): New function.
7737 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7738 parameter; change all callers. Initialize global_ifuncs_ and
7739 local_ifuncs_. If doing a static link define __rel_iplt_start and
7741 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7742 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7743 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7745 (Target_i386::make_plt_section): New function, broken out of
7746 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7747 (Target_i386::make_plt_entry): Call make_plt_section.
7748 (Target_i386::make_local_ifunc_plt_entry): New function.
7749 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7750 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7751 R_386_IRELATIVE to switch.
7752 (Target_i386::Scan::global): Likewise.
7753 (Target_i386::Relocate::relocate): Likewise.
7754 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7756 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7757 (Target_x86_64::do_plt_section_for_global): New function.
7758 (Target_x86_64::do_plt_section_for_local): New function.
7759 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7760 parameter; change all callers. If doing a static link define
7761 __rela_iplt_start and __rela_iplt_end.
7762 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7763 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7764 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7766 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7767 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7769 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7770 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7771 R_X86_64_IRELATIVE to switch.
7772 (Target_x86_64::Scan::global): Likewise.
7773 (Target_x86_64::Relocate::relocate): Likewise.
7774 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7776 * target.h (class Target): Add plt_section_for_global and
7777 plt_section_for_local functions. Add do_plt_section_for_global
7778 and do_plt_section_for_local virtual functions.
7779 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7780 clarifying comments.
7781 (Symbol::use_plt_offset): Handle IFUNC symbol.
7782 * object.cc (Sized_relobj::Sized_relobj): Initialize
7784 (Sized_relobj::local_has_plt_offset): New function.
7785 (Sized_relobj::local_plt_offset): New function.
7786 (Sized_relobj::set_local_plt_offset): New function.
7787 (Sized_relobj::do_count): Handle IFUNC symbol.
7788 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7789 a bit away from input_shndx_ field. Add set_is_func_symbol and
7790 is_ifunc_symbol functions.
7791 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7792 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7793 local_plt_offsets_ field.
7794 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7795 * output.h (class Output_section_data): Add non-const
7796 output_section function.
7797 (class Output_data_got): Update declarations.
7798 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7799 Add use_plt_offset parameter to global and local constructors.
7800 Change all callers. Change local_sym_index_ field to 31 bits.
7801 Change GSYM_CODE and CONSTANT_CODE accordingly.
7802 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7803 doing a static link don't set sh_link field.
7804 (Output_data_got::Got_entry::write): Use PLT offset if
7806 (Output_data_got::add_global_plt): New function.
7807 (Output_data_got::add_local_plt): New function.
7808 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7809 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7810 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7811 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7812 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7814 * testsuite/ifunc-sel.h: New file.
7815 * testsuite/ifuncmain1.c: New file.
7816 * testsuite/ifuncmain1vis.c: New file.
7817 * testsuite/ifuncmod1.c: New file.
7818 * testsuite/ifuncdep2.c: New file.
7819 * testsuite/ifuncmain2.c: New file.
7820 * testsuite/ifuncmain3.c: New file.
7821 * testsuite/ifuncmod3.c: New file.
7822 * testsuite/ifuncmain4.c: New file.
7823 * testsuite/ifuncmain5.c: New file.
7824 * testsuite/ifuncmod5.c: New file.
7825 * testsuite/ifuncmain6pie.c: New file.
7826 * testsuite/ifuncmod6.c: New file.
7827 * testsuite/ifuncmain7.c: New file.
7828 * configure, testsuite/Makefile.in: Rebuild.
7830 2010-08-18 Ian Lance Taylor <iant@google.com>
7833 (Output_section_incremental_inputs::write_input_files): Add cast
7834 to avoid signed/unsigned comparison warning.
7835 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7837 2010-08-12 Cary Coutant <ccoutant@google.com>
7839 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7841 2010-08-13 Ian Lance Taylor <iant@google.com>
7843 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7845 2010-08-12 Cary Coutant <ccoutant@google.com>
7846 Doug Kwan <dougkwan@google.com>
7848 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7849 defintion overrides non-weak undef, remember that the original undef
7851 * symtab.cc (Symbol_table::sized_write_global): For undef without
7852 an original weak binding, set binding to global in output.
7853 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7854 * testsuite/Makefile.in: Regenerate.
7855 * testsuite/strong_ref_weak_def.sh: New file.
7856 * testsuite/strong_ref_weak_def_1.c: Ditto.
7857 * testsuite/strong_ref_weak_def_2.c: Ditto.
7859 2010-08-12 Cary Coutant <ccoutant@google.com>
7861 * testsuite/incremental_test.sh: Rewrite.
7862 * testsuite/incremental_test_1.c: Rewrite.
7863 * testsuite/incremental_test_2.c: Rewrite.
7865 2010-08-12 Cary Coutant <ccoutant@google.com>
7867 * arm.cc (Target_arm::got_size): Add const.
7868 (Target_arm::got_entry_count): New function.
7869 (Target_arm::plt_entry_count): New function.
7870 (Target_arm::first_plt_entry_offset): New function.
7871 (Target_arm::plt_entry_size): New function.
7872 (Output_data_plt_arm::entry_count): New function.
7873 (Output_data_plt_arm::first_plt_entry_offset): New function.
7874 (Output_data_plt_arm::get_plt_entry_size): New function.
7875 * i386.cc (Target_i386::got_size): Add const.
7876 (Target_i386::got_entry_count): New function.
7877 (Target_i386::plt_entry_count): New function.
7878 (Target_i386::first_plt_entry_offset): New function.
7879 (Target_i386::plt_entry_size): New function.
7880 (Output_data_plt_i386::entry_count): New function.
7881 (Output_data_plt_i386::first_plt_entry_offset): New function.
7882 (Output_data_plt_i386::get_plt_entry_size): New function.
7883 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7884 find_incremental_inputs_sections. Dump incremental_got_plt section.
7885 * incremental.cc: Include target.h.
7886 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7887 parameter. Adjust all callers. Find incremental_got_plt section.
7888 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7890 (Output_section_incremental_inputs::set_final_data_size): Calculate
7891 size of incremental_got_plt section.
7892 (Output_section_incremental_inputs::do_write): Write the
7893 incremental_got_plt section.
7894 (Got_plt_view_info): New struct.
7895 (Local_got_offset_visitor): New class.
7896 (Global_got_offset_visitor): New class.
7897 (Global_symbol_visitor_got_plt): New class.
7898 (Output_section_incremental_inputs::write_got_plt): New function.
7899 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7900 Add parameter. Adjust all callers.
7901 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7902 (Incremental_inputs::got_plt_section): New function.
7903 (Incremental_inputs::got_plt_section_): New data member.
7904 (Incremental_got_plt_reader): New class.
7905 * layout.cc (Layout::create_incremental_info_sections): Add the
7906 incremental_got_plt section.
7907 * object.h (Got_offset_list::get_list): New function.
7908 (Got offset_list::for_all_got_offsets): New function.
7909 (Sized_relobj::local_got_offset_list): New function.
7910 * powerpc.cc (Target_powerpc::got_size): Add const.
7911 (Target_powerpc::got_entry_count): New function.
7912 (Target_powerpc::plt_entry_count): New function.
7913 (Target_powerpc::first_plt_entry_offset): New function.
7914 (Target_powerpc::plt_entry_size): New function.
7915 (Output_data_plt_powerpc::entry_count): New function.
7916 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7917 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7918 * sparc.cc (Target_sparc::got_size): Add const.
7919 (Target_sparc::got_entry_count): New function.
7920 (Target_sparc::plt_entry_count): New function.
7921 (Target_sparc::first_plt_entry_offset): New function.
7922 (Target_sparc::plt_entry_size): New function.
7923 (Output_data_plt_sparc::entry_count): New function.
7924 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7925 (Output_data_plt_sparc::get_plt_entry_size): New function.
7926 * symtab.h (Symbol::got_offset_list): New function.
7927 (Symbol_table::for_all_symbols): New function.
7928 * target.h (Sized_target::got_entry_count): New function.
7929 (Sized_target::plt_entry_count): New function.
7930 (Sized_target::plt_entry_size): New function.
7931 * x86_64.cc (Target_x86_64::got_size): Add const.
7932 (Target_x86_64::got_entry_count): New function.
7933 (Target_x86_64::plt_entry_count): New function.
7934 (Target_x86_64::first_plt_entry_offset): New function.
7935 (Target_x86_64::plt_entry_size): New function.
7936 (Output_data_plt_x86_64::entry_count): New function.
7937 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7938 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7940 2010-08-12 Cary Coutant <ccoutant@google.com>
7942 * archive.cc: Include incremental.h.
7943 (Archive::Archive): Initialize incremental_info_.
7944 (Archive::include_member): Record archive members in incremental info.
7945 (Add_archive_symbols::run): Record begin and end of an archive in
7947 (Lib_group::include_member): Record objects in incremental info.
7948 * archive.h (Incremental_archive_entry): Forward declaration.
7949 (Archive::set_incremental_info): New member function.
7950 (Archive::incremental_info): New member function.
7951 (Archive::Unused_symbol_iterator): New class.
7952 (Archive::unused_symbols_begin): New member function.
7953 (Archive::unused_symbols_end): New member function.
7954 (Archive::incremental_info_): New data member.
7955 * incremental-dump.cc (find_input_containing_global): New function.
7956 (dump_incremental_inputs): Dump new incremental info sections.
7957 * incremental.cc: Include symtab.h.
7958 (Output_section_incremental_inputs): New class.
7959 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7960 new incremental info sections.
7961 (Sized_incremental_binary::do_check_inputs): Likewise.
7962 (Incremental_inputs::report_archive): Remove.
7963 (Incremental_inputs::report_archive_begin): New function.
7964 (Incremental_inputs::report_archive_end): New function.
7965 (Incremental_inputs::report_object): New function.
7966 (Incremental_inputs::finalize_inputs): Remove.
7967 (Incremental_inputs::report_input_section): New function.
7968 (Incremental_inputs::report_script): Rewrite.
7969 (Incremental_inputs::finalize): Do nothing but finalize string table.
7970 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7971 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7972 (Incremental_inputs::create_data_sections): New function.
7973 (Incremental_inputs::relocs_entsize): New function.
7974 (Output_section_incremental_inputs::set_final_data_size): New function.
7975 (Output_section_incremental_inputs::do_write): New function.
7976 (Output_section_incremental_inputs::write_header): New function.
7977 (Output_section_incremental_inputs::write_input_files): New function.
7978 (Output_section_incremental_inputs::write_info_blocks): New function.
7979 (Output_section_incremental_inputs::write_symtab): New function.
7980 * incremental.h (Incremental_script_entry): Forward declaration.
7981 (Incremental_object_entry): Forward declaration.
7982 (Incremental_archive_entry): Forward declaration.
7983 (Incremental_inputs): Forward declaration.
7984 (Incremental_inputs_header_data): Remove.
7985 (Incremental_inputs_header): Remove.
7986 (Incremental_inputs_header_write): Remove.
7987 (Incremental_inputs_entry_data): Remove.
7988 (Incremental_inputs_entry): Remove.
7989 (Incremental_inputs_entry_write): Remove.
7990 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7991 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7992 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7993 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7995 (Incremental_input_entry): New class.
7996 (Incremental_script_entry): New class.
7997 (Incremental_object_entry): New class.
7998 (Incremental_archive_entry): New class.
7999 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8000 (Incremental_inputs::report_inputs): Remove.
8001 (Incremental_inputs::report_archive): Remove.
8002 (Incremental_inputs::report_archive_begin): New function.
8003 (Incremental_inputs::report_archive_end): New function.
8004 (Incremental_inputs::report_object): Change prototype.
8005 (Incremental_inputs::report_input_section): New function.
8006 (Incremental_inputs::report_script): Change prototype.
8007 (Incremental_inputs::get_reloc_count): New function.
8008 (Incremental_inputs::set_reloc_count): New function.
8009 (Incremental_inputs::create_data_sections): New function.
8010 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8011 (Incremental_inputs::inputs_section): New function.
8012 (Incremental_inputs::symtab_section): New function.
8013 (Incremental_inputs::relocs_section): New function.
8014 (Incremental_inputs::get_stringpool): Add const.
8015 (Incremental_inputs::command_line): Add const.
8016 (Incremental_inputs::inputs): Remove.
8017 (Incremental_inputs::command_line_key): New function.
8018 (Incremental_inputs::input_file_count): New function.
8019 (Incremental_inputs::input_files): New function.
8020 (Incremental_inputs::relocs_entsize): New function.
8021 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8022 (Incremental_inputs::finalize_inputs): Remove.
8023 (Incremental_inputs::Input_info): Remove.
8024 (Incremental_inputs::lock_): Remove.
8025 (Incremental_inputs::inputs_): Change type.
8026 (Incremental_inputs::inputs_map_): Remove.
8027 (Incremental_inputs::current_object_entry_): New data member.
8028 (Incremental_inputs::inputs_section_): New data member.
8029 (Incremental_inputs::symtab_section_): New data member.
8030 (Incremental_inputs::relocs_section_): New data member.
8031 (Incremental_inputs::reloc_count_): New data member.
8032 (Incremental_inputs_reader): New class.
8033 (Incremental_symtab_reader): New class.
8034 (Incremental_relocs_reader): New class.
8035 * layout.cc (Layout::finalize): Move finalization of incremental info
8036 and creation of incremental info sections to follow finalization of
8037 symbol table. Set offsets for postprocessing sections.
8038 (Layout::create_incremental_info_sections): Call
8039 Incremental_inputs::create_data_sections. Add incremental symtab
8040 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8041 sections to layout after input sections.
8042 * layout.h (struct Timespec): Forward declaration.
8043 (Layout::incremental_inputs): Add const.
8044 (Layout::create_incremental_info_sections): Add parameter.
8045 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8046 * object.cc: Include incremental.h.
8047 (Relobj::finalize_incremental_relocs): New function.
8048 (Sized_relobj::do_layout): Record input sections in incremental info.
8049 * object.h (Object::output_section): New function.
8050 (Object::output_section_offset): Moved from Relobj.
8051 (Object::get_incremental_reloc_base): New function.
8052 (Object::get_incremental_reloc_count): New function.
8053 (Object::do_output_section): New function.
8054 (Object::do_output_section_offset): Moved from Relobj.
8055 (Object::do_get_incremental_reloc_base): New function.
8056 (Object::do_get_incremental_reloc_count): New function.
8057 (Object::Object): Initialize new data members.
8058 (Relobj::output_section): Renamed do_output_section and moved to
8060 (Relobj::output_section_offset): Moved to Object.
8061 (Relobj::do_get_incremental_reloc_base): New function.
8062 (Relobj::do_get_incremental_reloc_count): New function.
8063 (Relobj::allocate_incremental_reloc_counts): New function.
8064 (Relobj::count_incremental_reloc): New function.
8065 (Relobj::finalize_incremental_relocs): New function.
8066 (Relobj::next_incremental_reloc_index): New function.
8067 (Relobj::reloc_counts_): New data member.
8068 (Relobj::reloc_bases_): New data member.
8069 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8070 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8071 (Sized_relobj::incremental_relocs_scan): New function.
8072 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8073 (Sized_relobj::incremental_relocs_write): New function.
8074 (Sized_relobj::incremental_relocs_write_reltype): New function.
8075 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8077 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8078 archives and object files elsewhere.
8079 (Add_symbols::run): Report object files here.
8080 (Finish_group::run): Report end of archive at end of group.
8081 * reloc.cc: Include layout.h, incremental.h.
8082 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8083 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8084 (Sized_relobj::incremental_relocs_scan): New function.
8085 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8086 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8087 (Sized_relobj::incremental_relocs_write): New function.
8088 (Sized_relobj::incremental_relocs_write_reltype): New function.
8089 * script.cc (read_input_script): Rewrite test for incremental link.
8090 Change call to Incremental_inputs::report_script.
8091 * symtab.h (Symbol_table::first_global_index): New function.
8092 (Symbol_table::output_count): New function.
8094 2010-08-12 Doug Kwan <dougkwan@google.com>
8096 * arm.cc (Target_arm::merge_object_attributes): Check command line
8097 options --no-wchar-size-warning and --no-enum-size-warning.
8098 * options.h (General_options): Add ld-compatible options
8099 --no-enum-size-warning and --no-wchar-size-warning.
8101 2010-08-04 Ian Lance Taylor <iant@google.com>
8103 * x86_64.cc (Target_x86_64::Scan::local): Use
8104 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8105 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8106 (Target_x86_64::Scan::global): Likewise.
8107 (Target_x86_64::Relocate::relocate): Likewise.
8108 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8111 2010-08-03 Cary Coutant <ccoutant@google.com>
8113 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8114 to reserve space in merged_strings vector. Keep total input size
8116 (Output_merge_string::do_print_merge_stats): Print total input size.
8117 * merge.h (Output_merge_string): Add input_size_ field.
8118 * stringpool.cc (Stringpool_template::string_length): Move
8119 implementations out of Stringpool_template class and place in
8121 * stringpool.h (string_length): Move out of Stringpool_template.
8123 2010-08-03 Ian Lance Taylor <iant@google.com>
8126 * layout.cc (relaxation_loop_body): If address of load segment is
8127 set, adjust address to include headers if possible.
8129 2010-08-03 Ian Lance Taylor <iant@google.com>
8131 * version.cc (version_string): Bump to 1.10.
8133 2010-08-03 Ian Lance Taylor <iant@google.com>
8136 * layout.h (enum Output_section_order): Define.
8137 (class Layout): Update declarations.
8138 * layout.cc (Layout::get_output_section): Add order parameter.
8139 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8140 is_first_non_relro parameters. Change all callers.
8141 (Layout::choose_output_section): Likewise.
8142 (Layout::add_output_section_data): Likewise.
8143 (Layout::make_output_section): Likewise. Set order.
8144 (Layout::default_section_order): New function.
8145 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8146 * output.cc (Output_section::Output_section): Initialize order_.
8147 Don't initialize deleted fields.
8148 (Output_segment::Output_segment): Don't initialize deleted
8150 (Output_segment::add_output_section_to_load): New function
8151 replacing add_output_section. Change all callers to call this or
8152 add_output_section_to_nonload.
8153 (Output_segment::add_output_section_to_nonload): New function.
8154 (Output_segment::remove_output_section): Rewrite.
8155 (Output_segment::add_initial_output_data): Likewise.
8156 (Output_segment::has_any_data_sections): Likewise.
8157 (Output_segment::is_first_section_relro): Likewise.
8158 (Output_segment::maximum_alignment): Likewise.
8159 (Output_segment::has_dynamic_reloc): New function replacing
8160 dynamic_reloc_count. Change all callers.
8161 (Output_segment::has_dynamic_reloc_list): New function replacing
8162 dynamic_reloc_count_list. Change all callers.
8163 (Output_segment::set_section_addresses): Rewrite.
8164 (Output_segment::set_offset): Rewrite.
8165 (Output_segment::find_first_and_last_list): Remove.
8166 (Output_segment::set_tls_offsets): Rewrite.
8167 (Output_segment::first_section_load_address): Likewise.
8168 (Output_segment::output_section_count): Likewise.
8169 (Output_segment::section_with_lowest_load_address): Likewise.
8170 (Output_segment::write_section_headers): Likewise.
8171 (Output_segment::print_sections_to_map): Likewise.
8172 * output.h (class Output_data): Remove dynamic_reloc_count_
8173 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8174 (Output_data::add_dynamic_reloc): Rewrite.
8175 (Output_data::has_dynamic_reloc): New function.
8176 (Output_data::dynamic_reloc_count): Remove.
8177 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8178 is_last_relro_, is_first_non_relro_, is_interp_,
8179 is_dynamic_linker_section_ fields. Add order and set_order
8180 functions. Remove is_relro_local, set_is_relro_local,
8181 is_last_relro, set_is_last_relro, is_first_non_relro,
8182 set_is_first_non_relro functions, is_interp, set_is_interp,
8183 is_dynamic_linker_section, and set_is_dynamic_linker_section
8185 (class Output_segment): Change Output_data_list from std::list to
8186 std:;vector. Add output_lists_ field. Remove output_data_ and
8187 output_bss_ fields. Update declarations.
8189 2010-08-02 Ian Lance Taylor <iant@google.com>
8191 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8192 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8193 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8195 2010-08-02 Ian Lance Taylor <iant@google.com>
8198 * script.cc (Script_options::Script_options): Initialize
8199 symbol_definitions_ and symbol_references_.
8200 (Script_options::add_symbol_assignment): Update
8201 symbol_definitions_ and symbol_references_.
8202 (Script_options::add_symbol_reference): New function.
8203 (script_symbol): New function.
8204 * script.h (class Script_options): Add symbol_definitions_ and
8205 symbol_references_ fields.
8206 (Script_options::referenced_const_iterator): New type.
8207 (Script_options::referenced_begin): New function.
8208 (Script_options::referenced_end): New function.
8209 (Script_options::is_referenced): New function.
8210 (Script_options::any_unreferenced): New function.
8211 * script-c.h (script_symbol): Declare.
8212 * yyscript.y (exp): Call script_symbol.
8213 * symtab.cc: Include "script.h".
8214 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8215 Change all callers. Check symbols referenced by scripts.
8216 (Symbol_table::add_undefined_symbols_from_command_line): Add
8217 layout parameter. Change all callers.
8218 (Symbol_table::do_add_undefined_symbols_from_command_line):
8219 Likewise. Break out loop body. Check symbols referenced by
8221 (Symbol_table::add_undefined_symbol_from_command_line): New
8222 function broken out of
8223 do_add_undefined_symbols_from_command_line.
8224 * symtab.h (class Symbol_table): Update declarations.
8225 * archive.cc: Include "layout.h".
8226 (Archive::should_include_member): Add layout parameter. Change
8227 all callers. Check for symbol mentioned in expression.
8228 * archive.h (class Archive): Update declaration.
8229 * object.cc (Sized_relobj::do_should_include_member): Add layout
8231 * object.h (Object::should_include_member): Add layout parameter.
8233 (Object::do_should_include_member): Add layout parameter.
8234 (class Sized_relobj): Update declaration.
8235 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8237 * dynobj.h (class Sized_dynobj): Update declaration.
8238 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8240 * plugin.h (class Sized_pluginobj): Update declaration.
8242 2010-08-02 Ian Lance Taylor <iant@google.com>
8245 * output.cc (Output_segment::set_offset): Search for the first and
8246 last sections rather than assuming that the list is in order.
8247 (Output_segment::find_first_and_last_list): New function.
8248 * output.h (class Output_segment): Update declarations.
8249 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8250 (relro_strip_test_SOURCES): New variable.
8251 (relro_strip_test_DEPENDENCIES): New variable.
8252 (relro_strip_test_LDFLAGS): New variable.
8253 (relro_strip_test_LDADD): New variable.
8254 (relro_strip_test.so): New target.
8256 2010-08-02 Ian Lance Taylor <iant@google.com>
8258 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8259 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8260 (Target_i386::got_tlsdesc_section): New function.
8261 (Target_i386::got_section): Create space for GOT entries for
8262 TLSDESC relocations.
8263 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8265 (Target_i386::Scan::global): Likewise.
8266 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8268 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8269 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8270 (Target_x86_64::got_tlsdesc_section): New function.
8271 (Target_x86_64::got_section): Create space for GOT entries for
8272 TLSDESC relocations.
8273 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8275 (Target_x86_64::Scan::global): Likewise.
8276 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8279 2010-08-02 Ian Lance Taylor <iant@google.com>
8281 * testsuite/final_layout.sh: Use dc to convert from hex to
8284 2010-07-29 Sriraman Tallam <tmsriram@google.com>
8286 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8287 paramter to the call to gold::gc_process_relocs.
8288 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8289 paramter to the call to gold::gc_process_relocs.
8290 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8291 parameter to the call to gold::gc_process_relocs.
8292 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8293 template parameter to the call to gold::gc_process_relocs.
8294 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8295 paramter to the call to gold::gc_process_relocs.
8296 * gc.h (get_embedded_addend_size): New function.
8297 (gc_process_relocs): Save the size of the reloc for use by ICF.
8298 * icf.cc (get_section_contents): Get the addend from the text section
8299 for SHT_REL relocation sections.
8300 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8301 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8302 * int_encoding.h (read_from_pointer): New overloaded function.
8303 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8304 * testsuite/icf_sht_rel_addend_test.sh: New file.
8305 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8306 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8308 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8310 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8311 * Makefile.in: Regenerate.
8312 * testsuite/Makefile.in: Regenerate.
8314 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8316 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8317 * gold/testsuite/debug_msg.cc: Likewise.
8318 * gold/testsuite/odr_violation1.cc
8319 * gold/testsuite/odr_violation2.cc
8321 2010-07-21 Cary Coutant <ccoutant@google.com>
8323 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8324 string, and length fields.
8325 (Output_merge_string::Merged_strings_list): New type.
8326 (Output_merge_string::Merged_strings_lists): New typedef.
8327 (Output_merge_string): Replace merged_strings_ with
8328 merged_strings_lists_.
8329 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8330 Merged_strings_list per input object and section. Don't store pointer
8331 to the string. Don't store length with each merged string entry.
8332 (Output_merge_string::finalize_merged_data): Loop over list of merged
8333 strings lists. Recompute length of each merged string.
8335 2010-07-15 Cary Coutant <ccoutant@google.com>
8337 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8340 2010-07-14 Ian Lance Taylor <iant@google.com>
8342 * descriptors.cc (Descriptors::open): Report correct name in error
8345 2010-07-13 Doug Kwan <dougkwan@google.com>
8347 * arm.cc (Arm_input_section::Arm_input_section): For a
8348 SHT_ARM_EXIDX section, always keeps the input sections.
8349 (Arm_input_section::set_exidx_section_link): New method.
8350 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8351 has_errors_ to false.
8352 (Arm_exidx_input_section::has_errors,
8353 Arm_exidx_input_section::set_has_errors): New methods.
8354 (Arm_exidx_input_section::has_errors_): New data member.
8355 (Arm_relobj::get_exidx_shndx_list): New method.
8356 (Arm_output_section::append_text_sections_to_list): Do not skip
8357 section without SHF_EXECINSTR.
8358 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8360 (Arm_relobj::make_exidx_input_section): Add new parameter for text
8361 section header. Make error messages more verbose. Check for
8362 a non-executable section linked to an EXIDX section.
8363 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8364 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8365 check that there is no deferred EXIDX section if we exit early.
8366 Instead of not making an EXIDX section in case of an error, make one
8367 and set the has_errors flag of it.
8368 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8369 in a relocatable link.
8370 (Target_arm::do_relax): Look for the EXIDX output section instead of
8371 assuming that it is called .ARM.exidx.
8372 (Target_arm::fix_exidx_coverage): Add a new parameter for input
8373 section list. Do not check for SHF_EXECINSTR section flags but
8374 skip any input section with errors.
8375 * output.cc (Output_section::Output_section): Initialize
8376 always_keeps_input_sections_ to false.
8377 (Output_section::add_input_section): Check for
8378 always_keeps_input_sections_.
8379 * output.h (Output_section::always_keeps_input_sections,
8380 Output_section::set_always_keeps_input_sections): New methods.
8381 (Output_section::always_keeps_input_sections): New data member.
8383 2010-07-13 Rafael Espindola <espindola@google.com>
8385 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8386 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8388 2010-07-13 Philip Herron <herron.philip@googlemail.com>
8389 Ian Lance Taylor <iant@google.com>
8391 * output.h (Output_section_lookup_maps::add_merge_section):
8392 Correct check of whether value was inserted.
8393 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8394 (Output_section_lookup_maps::add_relaxed_input_section):
8396 * arm.cc (Target_arm::got_section): Remove used local os.
8397 * i386.cc (Target_i386::got_section): Likewise.
8398 * x86_64.cc (Target_x86_64::got_section): Likewise.
8399 * sparc.cc (Target_sparc::got_section): Likewise.
8400 (Target_sparc::relocate): Remove unused local have_got_offset.
8401 * powerpc.cc (Target_powerpc::relocate): Likewise.
8403 2010-07-13 Ian Lance Taylor <iant@google.com>
8405 * compressed_output.cc (zlib_decompress): Fix signature in
8408 * archive.cc (Archive::include_member): Unlock an external member
8409 of a thin archive. Don't bother to delete an object we know is
8412 2010-07-12 Cary Coutant <ccoutant@google.com>
8414 * compressed_output.cc (zlib_decompress): New function.
8415 (get_uncompressed_size): New function.
8416 (decompress_input_section): New function.
8417 * compressed_output.h (get_uncompressed_size): New function.
8418 (decompress_input_section): New function.
8419 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8420 Handle compressed debug sections.
8421 * layout.cc (is_compressed_debug_section): New function.
8422 (Layout::output_section_name): Map compressed section names to
8424 * layout.h (is_compressed_debug_section): New function.
8425 (is_debug_info_section): Recognize compressed debug sections.
8426 * merge.cc: Include compressed_output.h.
8427 (Output_merge_data::do_add_input_section): Handle compressed
8429 (Output_merge_string::do_add_input_section): Handle compressed
8431 * object.cc: Include compressed_output.h.
8432 (Sized_relobj::Sized_relobj): Initialize new data members.
8433 (build_compressed_section_map): New function.
8434 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8435 * object.h (Object::section_is_compressed): New method.
8436 (Object::do_section_is_compressed): New method.
8437 (Sized_relobj::Compressed_section_map): New type.
8438 (Sized_relobj::do_section_is_compressed): New method.
8439 (Sized_relobj::compressed_sections_): New data member.
8440 * output.cc (Output_section::add_input_section): Handle compressed
8442 * reloc.cc: Include compressed_output.h.
8443 (Sized_relobj::write_sections): Handle compressed debug sections.
8445 2010-07-08 Cary Coutant <ccoutant@google.com>
8447 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8448 weak when resolving to a dynamic def.
8449 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8450 for weak undef/dynamic def cases. Adjust callers.
8451 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8452 undef_binding_weak_.
8453 (Symbol_table::sized_write_globals): Adjust symbol binding.
8454 (Symbol_table::sized_write_symbol): Add binding parameter.
8455 * symtab.h (Symbol::set_undef_binding): New method.
8456 (Symbol::is_undef_binding_weak): New method.
8457 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8458 (Symbol_table::should_override): Add new parameter.
8459 (Symbol_table::sized_write_symbol): Add new parameter.
8461 * testsuite/weak_undef_file1.cc: Add new test case.
8462 * testsuite/weak_undef_file2.cc: Fix header comment.
8463 * testsuite/weak_undef_test.cc: Add new test case.
8465 2010-06-29 Doug Kwan <dougkwan@google.com>
8467 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8468 Initialize USE_SYMBOL_.
8469 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8471 (Arm_reloc_property::uses_symbol_): New data member declaration.
8472 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8473 uses symbol value and symbol is undefined but not weakly undefined.
8475 2010-06-28 Rafael Espindola <espindola@google.com>
8477 * plugin.cc (Plugin::load): Use dlerror.
8479 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8481 * symtab.cc (detect_odr_violations): When reporting an ODR
8482 violation, report an object where the symbol is defined.
8484 2010-06-25 Doug Kwan <dougkwan@google.com>
8486 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8487 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8489 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8490 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8491 target hook to detect function points.
8492 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8493 * icf.h (Icf::check_section_for_function_pointers): Change type of
8494 parameter SECTION_NAME to const reference to std::string. Use
8495 target hook to determine if section may have unsafe pointers.
8496 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8499 2010-06-21 Rafael Espindola <espindola@google.com>
8501 * fileread.cc (Input_file::find_fie): New
8502 (Input_file::open): Use Input_file::find_fie.
8503 * fileread.h (Input_file::find_fie): New
8504 * plugin.cc (set_extra_library_path): New.
8505 (Plugin::load): Add set_extra_library_path to the transfer vector.
8506 (Plugin_manager::set_extra_library_path): New.
8507 (Plugin_manager::add_input_file): Use the extra search path if set.
8508 (set_extra_library_path(): New.
8509 * plugin.h (Plugin_manager): Add set_extra_library_path and
8512 2010-06-19 Cary Coutant <ccoutant@google.com>
8514 * layout.cc (gdb_sections): Add .debug_types.
8515 (lines_only_debug_sections): Likewise.
8517 2010-06-18 Rafael Espindola <espindola@google.com>
8519 * plugin.cc (add_input_file,add_input_library)
8520 (Plugin_manager::add_input_file): Make filename arguments const.
8521 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8524 2010-06-16 Doug Kwan <dougkwan@google.com>
8526 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8527 .ARM.attributes section if we have not merged any input
8528 attributes sections.
8530 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8532 * arm.cc: Allow combining objects with no EABI version
8535 2010-06-15 Rafael Espindola <espindola@google.com>
8537 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8539 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8541 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8542 (struct iovec): Correct !HAVE_READV definition.
8544 2010-06-10 Cary Coutant <ccoutant@google.com>
8546 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8547 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8549 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8552 * symtab.h (Symbol::is_placeholder): New member function.
8553 * target-reloc.h (relocate_section): Check for placeholder symbols.
8555 * testsuite/Makefile.am (plugin_test_8): New test.
8556 (plugin_test_9): New test.
8557 * testsuite/Makefile.in: Regenerate.
8559 2010-06-09 Nick Clifton <nickc@redhat.com>
8561 * yyscript.y (input_list_element): Allow strings prefixed with
8562 the '-' character. Treat these as libraries.
8563 * script.cc (script_add_library): New function. Adds a library
8564 specified by "-l<name>" found in an input script.
8565 * script-c.h: Add prototype for script_add_library.
8567 2010-06-07 Doug Kwan <dougkwan@google.com>
8569 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8570 Restrict stub-group size to be within long conditional branch
8571 range when working around cortex-A8 erratum.
8573 2010-06-07 Damien Diederen <dd@crosstwine.com>
8575 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8578 2010-06-03 Sriraman Tallam <tmsriram@google.com>
8582 (Output_section::Input_section_sort_entry::compare_section_ordering):
8583 Change to return non-zero correctly.
8584 (Output_section::Input_section_sort_section_order_index_compare
8585 ::operator()): Change to fix ambiguity in comparisons.
8587 2010-06-01 Sriraman Tallam <tmsriram@google.com>
8589 * gold.h (is_wildcard_string): New function.
8590 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8591 (Layout::layout_eh_frame): Ditto.
8592 (Layout::find_section_order_index): New method.
8593 (Layout::read_layout_from_file): New method.
8594 * layout.h (Layout::find_section_order_index): New method.
8595 (Layout::read_layout_from_file): New method.
8596 (Layout::input_section_position_): New private member.
8597 (Layout::input_section_glob_): New private member.
8598 * main.cc (main): Call read_layout_from_file here.
8599 * options.h (--section-ordering-file): New option.
8600 * output.cc (Output_section::input_section_order_specified_): New
8602 (Output_section::Output_section): Initialize new member.
8603 (Output_section::add_input_section): Add new parameter.
8604 Keep input sections when --section-ordering-file is used.
8605 (Output_section::set_final_data_size): Sort input sections when
8606 section ordering file is specified.
8607 (Output_section::Input_section_sort_entry): Add new parameter.
8609 (Output_section::Input_section_sort_entry::compare_section_ordering):
8611 (Output_section::Input_section_sort_compare::operator()): Change to
8612 consider section_order_index.
8613 (Output_section::Input_section_sort_init_fini_compare::operator()):
8614 Change to consider section_order_index.
8615 (Output_section::Input_section_sort_section_order_index_compare
8616 ::operator()): New method.
8617 (Output_section::sort_attached_input_sections): Change to sort
8618 according to section order when specified.
8619 (Output_section::add_input_section<32, true>): Add new parameter.
8620 (Output_section::add_input_section<64, true>): Add new parameter.
8621 (Output_section::add_input_section<32, false>): Add new parameter.
8622 (Output_section::add_input_section<64, false>): Add new parameter.
8623 * output.h (Output_section::add_input_section): Add new parameter.
8624 (Output_section::input_section_order_specified): New
8626 (Output_section::set_input_section_order_specified): New method.
8627 (Input_section::Input_section): Initialize section_order_index_.
8628 (Input_section::section_order_index): New method.
8629 (Input_section::set_section_order_index): New method.
8630 (Input_section::section_order_index_): New member.
8631 (Input_section::Input_section_sort_section_order_index_compare): New
8633 (Output_section::input_section_order_specified_): New member.
8634 * script-sections.cc (is_wildcard_string): Delete and move modified
8636 (Output_section_element_input::Output_section_element_input): Modify
8637 call to is_wildcard_string.
8638 (Output_section_element_input::Input_section_pattern
8639 ::Input_section_pattern): Ditto.
8640 (Output_section_element_input::Output_section_element_input): Ditto.
8641 * testsuite/Makefile.am (final_layout): New test case.
8642 * testsuite/Makefile.in: Regenerate.
8643 * testsuite/final_layout.cc: New file.
8644 * testsuite/final_layout.sh: New file.
8646 2010-06-01 Rafael Espindola <espindola@google.com>
8648 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8650 2010-06-01 Rafael Espindola <espindola@google.com>
8652 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8653 visibility of symbols.
8655 2010-05-27 Doug Kwan <dougkwan@google.com>
8657 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8658 from start of output section instead of address for a local symbol
8659 in a merged or relaxed section when doing a relocatable link.
8661 2010-05-26 Rafael Espindola <espindola@google.com>
8664 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8665 adding sections the garbage collector removed.
8666 * gold/testsuite/Makefile.am: Add test.
8667 * gold/testsuite/Makefile.in: Regenerate.
8668 * gold/testsuite/plugin_test_7.sh: New.
8669 * gold/testsuite/plugin_test_7_1.c: New.
8670 * gold/testsuite/plugin_test_7_2.c: New.
8672 2010-05-26 Rafael Espindola <espindola@google.com>
8674 * script-sections.cc (Output_section_definition::set_section_addresses):
8675 Check for --section-start.
8677 2010-05-26 Doug Kwan <dougkwan@google.com>
8679 * arm.cc (Arm_scan_relocatable_relocs): New class.
8680 (Target_arm::relocate_special_relocatable): New method.
8681 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8682 (Arm_relocate_functions::thumb_branch_common): Same.
8683 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8684 instead of Default_scan_relocatable_relocs.
8685 * target-reloc.h (relocate_for_relocatable): Let target handle
8686 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8687 * target.h (Sized_target::relocate_special_relocatable): New method.
8689 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8691 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8693 2010-05-23 Doug Kwan <dougkwan@google.com>
8695 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8697 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8698 with a direct branch, not a conditional branch, to a stub.
8699 * merge.cc (Output_merge_base::record_input_section): New method
8701 (Output_merge_data::do_add_input_section): Record input section if
8702 keeps-input-sections flag is set.
8703 (Output_merge_string::do_add_input_section): Ditto.
8704 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8705 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8707 (Output_merge_base::keeps_input_sections,
8708 Output_merge_base::set_keeps_input_sections,
8709 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8711 (Output_merge_base::Input_sections): New type declaration.
8712 (Output_merge_base::input_sections_begin,
8713 Output_merge_base::input_sections_end,
8714 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8715 (Output_merge_base::bool keeps_input_sections_,
8716 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8717 Output_merge_base::input_sections_): New data members.
8718 (Output_merge_data::do_set_keeps_input_sections): New method
8720 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8721 * output.cc (Output_section::Input_section::relobj): Move method
8722 defintion from class declaration to here and handle merge sections.
8723 (Output_section::Input_section::shndx): Ditto.
8724 (Output_section::Output_section): Remove initializations of removed
8725 data members and initialize new data member LOOKUP_MAPS_.
8726 (Output_section::add_input_section): Set keeps-input-sections flag
8727 for a newly created merge output section as appropriate. Adjust code
8728 to use Output_section_lookup_maps class.
8729 (Output_section::add_relaxed_input_section): Adjst code for lookup
8730 maps code refactoring.
8731 (Output_section::add_merge_input_section): Add a new parameter
8732 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8733 class. If adding input section to a newly created merge output
8734 section fails, remove the new merge section.
8735 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
8736 Adjust code for use of the Output_section_lookup_maps class.
8737 (Output_section::find_merge_section): Ditto.
8738 (Output_section::build_lookup_maps): New method defintion.
8739 (Output_section::find_relaxed_input_section): Adjust code to use
8740 Output_section_lookup_maps class.
8741 (Output_section::get_input_sections): Export merge sections. Adjust
8742 code to use Output_section_lookup_maps class.
8743 (Output_section:::add_script_input_section): Adjust code to use
8744 Output_section_lookup_maps class. Update lookup maps for merge
8746 (Output_section::discard_states): Use Output_section_lookup_maps.
8747 (Output_section::restore_states): Same.
8748 * output.h (Merge_section_properties): Move class defintion out of
8750 (Output_section_lookup_maps): New class.
8751 (Output_section::Input_section::is_merge_section): New method
8753 (Output_section::Input_section::relobj): Move defintion out of class
8754 defintion. Declare method only.
8755 (Output_section::Input_section::shndx): Ditto.
8756 (Output_section::Input_section::output_merge_base): New method defintion.
8757 (Output_section::Input_section::u2_.pomb): New union field.
8758 (Output_section::Merge_section_by_properties_map,
8759 Output_section::Output_section_data_by_input_section_map,
8760 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8762 (Output_section::add_merge_input_section): Add new parameter
8763 KEEPS_INPUT_SECTIONS.
8764 (Output_section::build_lookup_maps): New method declaration.
8765 (Output_section::merge_section_map_,
8766 Output_section::merge_section_by_properties_map_,
8767 Output_section::relaxed_input_section_map_,
8768 Output_section::is_relaxed_input_section_map_valid_): Remove data
8770 (Output_section::lookup_maps_): New data member.
8772 2010-05-21 Doug Kwan <dougkwan@google.com>
8775 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8776 avoid a compilation error.
8778 2010-05-19 Rafael Espindola <espindola@google.com>
8780 * script-sections.cc (Output_section_definition::allocate_to_segment):
8781 Update the phdrs_list even when the output section is NULL.
8782 * testsuite/Makefile.am: Add test.
8783 * testsuite/Makefile.in: Regenerate.
8784 * testsuite/script_test_9.cc: New.
8785 * testsuite/script_test_9.sh: New.
8786 * testsuite/script_test_9.t: New.
8788 2010-05-19 Doug Kwan <dougkwan@google.com>
8790 * arm.cc (Arm_input_section::original_size): New method.
8791 (Arm_input_section::do_addralign): Add a cast.
8792 (Arm_input_section::do_output_offset): Remove static cast.
8793 (Arm_input_section::original_addralign,
8794 Arm_input_section::original_size_): Change type to uint32_t.
8795 (Arm_input_section::init): Add safe casts for section alignment
8797 (Arm_input_section::set_final_data_size): Do not set address and
8798 offset of stub table.
8799 (Arm_output_section::fix_exidx_coverage): Change use of of
8800 Output_section::Simple_input_section to that of
8801 Output_section::Input_section.
8802 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8803 except for the first pass.
8804 * output.cc (Output_section::get_input_sections): Change type of
8805 input_sections to std::list<Input_section>.
8806 (Output_section::add_script_input_section): Rename from
8807 Output_section::add_simple_input_section. Change type of SIS
8808 parameter from Simple_input_section to Input_section.
8809 * output.h (Output_section::Simple_input_section): Remove class.
8810 (Output_section::Input_section): Change class visibility to public.
8811 (Output_section::Input_section::addralign): Use stored alignments
8812 for special input sections if set.
8813 (Output_section::Input_section::set_addralign): New method.
8814 (Output_section::get_input_sections): Change parameter type from
8815 list of Simple_input_section to list of Input_section.
8816 (Output_section::add_script_input_section): Rename from
8817 Output_section::add_simple_input_section. Change first parameter's
8818 type from Simple_input_section to Input_section and remove the
8819 second and third parameters.
8820 * script-sections.cc (Input_section::Input_section_list): Change
8821 type to list of Output_section::Input_section/
8822 (Input_section_info::Input_section_info): Change parameter type of
8823 INPUT_SECTION to Output_section::Input_section.
8824 (Input_section_info::input_section): Change return type.
8825 (Input_section_info::input_section_): Change type to
8826 Output_section::Input_section.
8827 (Output_section_element_input::set_section_addresses): Adjust code
8828 to use Output_section::Input_section instead of
8829 Output_section::Simple_input_section. Adjust code for renaming
8830 of Output_section::add_simple_input_section.
8831 (Orphan_output_section::set_section_addresses): Ditto.
8833 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8835 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8836 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8838 2010-05-18 Rafael Espindola <espindola@google.com>
8840 * options.cc (General_options::finalize): Handle -nostdlib.
8841 * options.h (nostdlib): New option.
8842 * script.cc (script_add_search_dir): Handle -nostdlib.
8844 2010-05-12 Doug Kwan <dougkwan@google.com>
8846 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8847 attributes section only if there no attributes section after merging.
8848 (Target_arm::merge_object_attributes): Move value of
8849 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
8850 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8851 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8852 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8853 and arm_attr_merge_7.stdout.
8854 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8855 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8856 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8857 arm_attr_merge_7b.o): New rules.
8858 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8860 * testsuite/Makefile.in: Regenerate.
8861 * testsuite/arm_attr_merge.sh: New file.
8862 * testsuite/arm_attr_merge_[67][ab].s: Same.
8864 2010-05-05 Nick Clifton <nickc@redhat.com>
8866 * po/es.po: Updated Spanish translation.
8868 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8870 * Makefile.am (install-exec-local): Properly install gold as
8871 default cross linker.
8872 * Makefile.in: Regenerated.
8874 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8875 Nick Clifton <nickc@redhat.com>
8877 * configure.ac (install_as_default): Define and set to false
8878 unless --enable-gold or --enable-gold=both/gold has been
8880 * configure: Regenerate.
8882 * Makefile.am (install-exec-local): Install the executable as
8883 'ld.gold'. If install_as_default is true then also install it as
8885 * Makefile.in: Regenerated.
8887 2010-04-24 Ian Lance Taylor <iant@google.com>
8889 * layout.cc (Layout::layout_reloc): In relocatable link don't
8890 combine reloc sections for grouped sections.
8892 2010-04-23 Sriraman Tallam <tmsriram@google.com>
8894 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8895 sections that are not ordinary to icf.
8896 * icf.cc (get_section_contents): Handle relocation pointing to section
8897 with no object or shndx information.
8898 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8899 * testsuite/Makefile.in: Regenerate.
8900 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8901 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8903 2010-04-22 Ian Lance Taylor <iant@google.com>
8905 * expression.cc (Expression::Expression_eval_info): Add
8906 result_alignment_pointer field.
8907 (Expression::eval_with_dot): Add result_alignment_pointer
8908 parameter. Change all callers.
8909 (Expression::eval_maybe_dot): Likewise.
8910 (class Binary_expression): Add alignment_pointer parameter to
8911 left_value and right_value. Change all callers.
8912 (BINARY_EXPRESSION): Set result alignment.
8913 (class Trinary_expression): Add alignment_pointer parameter to
8914 arg2_value and arg3_value. Change all callers.
8915 (Trinary_cond::value): Set result alignment.
8916 (Max_expression::value, Min_expression::value): Likewise.
8917 (Align_expression::value): Likewise.
8918 * script-sections.cc (class Sections_element): Add dot_alignment
8919 parameter to set_section_addresses virtual function. Update
8921 (class Output_section_element): Likewise.
8922 (Script_sections::create_segments): Add dot_alignment parameter.
8924 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8925 (Script_sections::set_phdrs_clause_addresses): Likewise.
8926 * script-sections.h: Update declarations.
8927 * script.h: Update declarations.
8928 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8930 * testsuite/script_test_3.t: Set large alignment.
8931 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8932 segment has expected alignment.
8934 2010-04-22 Nick Clifton <nickc@redhat.com>
8936 * po/gold.pot: Updated by the Translation project.
8937 * po/vi.po: Updated Vietnamese translation.
8939 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8941 * testsuite/Makefile.am (check_PROGRAMS): Add
8942 icf_virtual_function_folding_test.
8943 * testsuite/Makefile.in: Regenerated.
8945 2010-04-15 Andrew Haley <aph@redhat.com>
8947 * options.h (merge_exidx_entries): New option.
8948 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8949 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8950 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8951 (Target_arm::merge_exidx_entries): New function.
8952 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8953 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8954 to Arm_exidx_fixup constructor.
8955 Add new arg, merge_exidx_entries.
8956 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8957 Arm_output_section::fix_exidx_coverage.
8959 2010-04-18 Sriraman Tallam <tmsriram@google.com>
8961 * icf.cc (get_section_contents): Check for preemptible functions.
8962 Ignore addend when appropriate.
8963 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8965 (add_from_relobj): Check for section folded.
8966 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8967 * symtab.h (should_add_dynsym_entry): Add new parameter.
8968 * target-reloc.h (scan_relocs): Check for section folded.
8969 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8970 Check reloc types for function pointers in shared objects.
8971 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8973 (icf_preemptible_functions_test): New test case.
8974 (icf_string_merge_test): New test case.
8975 * testsuite.Makefile.in: Regenerate.
8976 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8977 bar_glob. Refactor code.
8978 * testsuite/icf_preemptible_functions_test.cc: New file.
8979 * testsuite/icf_preemptible_functions_test.sh: New file.
8980 * testsuite/icf_string_merge_test.cc: New file.
8981 * testsuite/icf_string_merge_test.sh: New file.
8982 * testsuite/icf_virtual_function_folding_test.cc: New file.
8983 * testsuite/icf_virtual_function_folding_test.sh: New file.
8985 2010-04-14 Doug Kwan <dougkwan@google.com>
8987 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8988 for local symbol recounting if we remove a section due to ICF.
8989 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8990 there are no regular objects in input.
8992 2010-04-13 Doug Kwan <dougkwan@google.com>
8994 * arm.cc (Arm_input_section::set_final_data_size): Compute
8995 accurate final data size instead of using current data size.
8997 2010-04-09 Doug Kwan <dougkwan@google.com>
8999 * layout.cc (Layout::choose_output_section): Handle script section
9001 (Layout::make_output_section_for_script): Add section type parameter.
9002 Handle script section types.
9003 * layout.h (Layout::make_output_section_for_script): Add section
9005 * output.cc (Output_section::Output_section): Initialize data member
9007 (Output_section::do_reset_address_and_file_offset): Do not set address
9008 to 0 if section is a NOLOAD section.
9009 * output.h (Output_section::is_noload): New method.
9010 (Output_section::set_is_noload): Ditto.
9011 (Output_section::is_noload_): New data member.
9012 * script-c.h (Script_section_type): New enum type.
9013 (struct Parser_output_section_header): Add new file section_type.
9014 * script-sections.cc (Sections_element::output_section_name): Add
9015 parameter for returning script section type.
9016 (Output_section_definition::output_section_name): Ditto.
9017 (Output_section_definition::section_type)P; New method.
9018 (Output_section_definiton::script_section_type_name): Ditto.
9019 (Output_section_definition::script_section_type_): New data member.
9020 (Output_section_definition::Output_section_definition): Initialize
9021 data member Output_section_definition::script_section_type_.
9022 (Output_section_definition::create_sections): Pass script section type
9023 to Layout::make_output_section_for_script.
9024 (Output_section_definition::output_section_name): Return script
9025 section type to caller.
9026 (Output_section_definition::set_section_address): Do not advance
9027 dot value and load address if section type is NOLOAD. Set address
9028 of NOLOAD sections regardless of section flags.
9029 (Output_section_definition::print): Print section type if it is
9030 not SCRIPT_SECTION_TYPE_NONE.
9031 (Output_section_definition::section_type): New method.
9032 (Output_section_definition::script_section_type_name): Ditto.
9033 (Script_sections::output_section_name): Add new parameter
9034 PSECTION_TYPE for returning script section type. Pass it to
9035 section elements. Handle discard sections.
9036 (Sort_output_sections::operator()): Handle NOLOAD sections.
9037 * script-sections.h (Script_sections::Section_type): New enum type.
9038 (Script_sections::output_section_name): Add a new parameter for
9039 returning script section type.
9040 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9042 * yyscript.y (union): Add new field SECTION_TYPE.
9043 (COPY, DSECT, INFO, NOLOAD): New tokens.
9044 (opt_address_and_section_type): Change type to output_section_header.
9045 (section_type): New non-terminal
9046 (section_header): Handle section type.
9047 (opt_address_and_section_type): Return section type value.
9049 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9051 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9052 * testsuite/plugin_common_test_2.c (foo): Likewise.
9054 2010-04-08 Doug Kwan <dougkwan@google.com>
9056 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9058 * output.cc (Output_section::add_merge_input_section): Simplify
9059 code and return status of Output_merge_base::add_input_section.
9060 Update merge section map only if Output_merge_base::add_input_section
9063 2010-04-07 Doug Kwan <dougkwan@google.com>
9065 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9066 if section is marked as containing instructions but has no mapping
9068 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9069 correct section index.
9070 (Arm_relobj::find_linked_text_section): Ditto.
9072 2010-04-07 Cary Coutant <ccoutant@google.com>
9074 * archive.cc (include_member): Destroy Read_symbols_data object before
9076 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9077 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9078 (Read_symbols_data::~Read_symbols_data) New destructor.
9079 (Section_relocs::Section_relocs) New constructor.
9080 (Section_relocs::~Section_relocs) New destructor.
9081 (Read_relocs_data::Read_relocs_data) New constructor.
9082 (Read_relocs_data::~Read_relocs_data) New destructor.
9083 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9084 pointers to NULL after deleting.
9086 2010-04-07 Doug Kwan <dougkwan@google.com>
9088 * arm.cc: Replace "endianity" with "endianness" in comments.
9089 (Arm_exidx_cantunwind): Ditto.
9090 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9091 (Arm_relobj::merge_flags_and_attributes): New method.
9092 (Arm_relobj::merge_flags_and_attributes_): New data member.
9093 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9094 (Arm_relobj::scan_sections_for_stubs): Ditto.
9095 (Arm_relobj::do_read_symbols): Check to see if we really want to
9096 merge processor-specific flags and attributes. Exit early if
9097 an object is empty except for section names and the undefined symbol.
9098 (Target_arm::do_finalize_sections): Move check for ELF format to
9099 Arm_relobj::do_read_symbols. Merge processor specific flags and
9100 attributes from a regular object only when we have determined that
9101 it is aapropriate. Do not create an .ARM.attributes section in
9102 output if there is no regular input object.
9103 (Target_arm::merge_processor_specific_flags): Check
9104 --warn-mismatch before printing any error.
9105 (Target_arm::merge_object_attributes): Ditto.
9106 * gold.cc (queue_middle_tasks): Handle the case in which there is
9107 no regular object in input.
9108 * options.cc (General_options::parse_EB): New method.
9109 (General_options::parse_EL): Same.
9110 (General_options::General_options): Initialize endianness_.
9111 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9113 (General_options::Endianness): New enum.
9114 (General_options::endianness): New method.
9115 (General_options::endianness_): New data member.
9116 * parameters.cc (Parameters::set_options): Check target endianness.
9117 (Parameters::set_target_once): Ditto.
9118 (Parameters::check_target_endianness): New method.
9119 (parameters_force_valid_target): If either -EL or -EB is specified,
9120 use it to define endianness of default target.
9121 * parameters.h (Parameters::check_target_endianness): New method
9123 * target.h (class Target): Change "endianity" to "endianness"
9126 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9128 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9129 * configure: Regenerate.
9130 * Makefile.in: Regenerate.
9131 * testsuite/Makefile.in: Regenerate.
9133 2010-04-06 Cary Coutant <ccoutant@google.com>
9136 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9137 prevailing definitions of common symbols.
9138 * testsuite/plugin_test_6.sh: New test case.
9139 * testsuite/plugin_common_test_1.c: New test case.
9140 * testsuite/plugin_common_test_2.c: New test case.
9141 * testsuite/Makefile.am (plugin_test_6): New test case.
9142 * testsuite/Makefile.in: Regenerate.
9144 2010-04-06 Nick Clifton <nickc@redhat.com>
9146 * po/vi.po: New Vietnamese translation.
9148 2010-03-30 Doug Kwan <dougkwan@google.com>
9150 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9152 2010-03-25 Doug Kwan <dougkwan@google.com>
9154 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9155 to avoid a conversion warning on a 32-bit host.
9157 2010-03-24 Ian Lance Taylor <iant@google.com>
9159 * testsuite/script_test_3.t: Add a TLS segment.
9160 * testsuite/Makefile.am (check_PROGRAMS): Add
9161 tls_phdrs_script_test.
9162 (tls_phdrs_script_test_SOURCES): Define.
9163 (tls_phdrs_script_test_DEPENDENCIES): Define.
9164 (tls_phdrs_script_test_LDFLAGS): Define.
9165 (tls_phdrs_script_test_LDADD): Define.
9166 * testsuite/Makefile.in: Rebuild.
9168 2010-03-23 Cary Coutant <ccoutant@google.com>
9170 * fileread.cc (find_or_make_view): Fix comment.
9172 2010-03-23 Ian Lance Taylor <iant@google.com>
9174 * script-sections.cc (class Orphan_section_placement): Define
9175 PLACE_TLS and PLACE_TLS_BSS.
9176 (Orphan_section_placement::Orphan_section_placement): Initialize
9178 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9179 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9180 (tls_script_test_SOURCES): Define.
9181 (tls_script_test_DEPENDENCIES): Define.
9182 (tls_script_test_LDFLAGS): Define.
9183 (tls_script_test_LDADD): Define.
9184 * testsuite/Makefile.in: Rebuild.
9186 2010-03-22 Doug Kwan <dougkwan@google.com>
9188 * arm.cc (Arm_relocate_functions::abs8,
9189 Arm_relocate_functions::abs16): Use correct check for overflow
9190 specified in the ARM ELF specs.
9191 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9192 target of a BLX instruction specially.
9193 (Reloc_stub::stub_type_for_reloc): Ditto.
9194 (Relocate::relocate): Use symbolic names instead of numeric relocation
9195 codes to report error.
9196 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9198 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9199 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9200 thumb2_blx_out_of_range.stdout
9201 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9202 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9203 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9204 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9205 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9206 thumb2_blx_in_range, thumb2_blx_in_range.o,
9207 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9208 thumb2_blx_out_of_range.o): New rules.
9209 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
9210 thumb2_blx_in_range and thumb2_blx_out_of_range.
9211 * testsuite/Makefile.in: Regenerate.
9212 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9213 * testsuite/thumb_blx_in_range.s: New file.
9214 * testsuite/thumb_blx_out_of_range.s: New file.
9216 2010-03-22 Rafael Espindola <espindola@google.com>
9218 * archive.cc (Should_include): Move to archive.h.
9219 (should_include_member): Make it a member of Archive.
9221 (Add_lib_group_symbols): New.
9222 * archive.h: Include options.h.
9223 (Archive_member): Moved from Archive.
9224 (Should_include): Moved from archive.cc.
9226 (Add_lib_group_symbols): New.
9227 * dynobj.cc (do_should_include_member): New.
9228 * dynobj.h (do_should_include_member): New.
9229 * gold.cc (queue_initial_tasks): Update call to queue.
9230 * main.cc (main): Print lib group stats.
9231 * object.cc (do_should_include_member): New.
9232 * object.h: Include archive.h.
9233 (Object::should_include_member): New.
9234 (Object::do_should_include_member): New.
9235 (Sized_relobj::do_should_include_member): New.
9236 * options.cc (General_options::parse_start_lib): New.
9237 (General_options::parse_end_lib): New.
9238 (Input_arguments::add_file): Handle lib groups.
9239 (Input_arguments::start_group): Check we are not in a lib.
9240 (Input_arguments::start_lib): New.
9241 (Input_arguments::end_lib): New.
9242 * options.h (General_options): Add start_lib and end_lib.
9243 (Input_argument::lib_): New.
9244 (Input_argument::lib): New.
9245 (Input_argument::is_lib): New.
9246 (Input_file_lib): New.
9247 (Input_arguments::in_lib_): New.
9248 (Input_arguments::in_lib): New.
9249 (Input_arguments::start_lib): New.
9250 (Input_arguments::end_lib_): New.
9251 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9252 in unused members as preempted.
9253 (Sized_pluginobj::do_should_include_member): New.
9254 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9255 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9257 (Read_symbols::do_whole_lib_group): New.
9258 (Read_symbols::do_lib_group): New.
9259 (Read_symbols::do_read_symbols): Handle lib groups.
9260 (Read_symbols::get_name): Handle lib groups.
9261 * readsyms.h (Read_symbols): Add an archive member pointer.
9262 (Read_symbols::do_whole_lib_group): New.
9263 (Read_symbols::do_lib_group): New.
9264 (Read_symbols::member_): New.
9265 * script.cc (read_input_script): Update call to queue_soon.
9267 2010-03-19 Doug Kwan <dougkwan@google.com>
9269 * arm.cc (Stub_table::Stub_table): Initialize new data members
9270 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9271 (Stub_table::add_reloc_stub): Assign stub offset and update
9272 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9273 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9275 (Stub_table::update_data_size_and_addralign): Use
9276 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9277 instead of going over all reloc stubs.
9278 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
9279 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9280 Stringpool_template::offset_ to size of Stringpool_char.
9281 (Stringpool_template::new_key_offset): Remove code to initialize
9282 Stringpool_template::offset_.
9283 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9284 Stringpool_template::offset_ to zero.
9286 2010-03-15 Doug Kwan <dougkwan@google.com>
9288 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9290 (Stringpool_template::new_key_offset): New method.
9291 (Stringpool_template::add_string): Assign offsets when adding new
9293 (Stringpool_template::set_string_offsets): Do not set string offsets
9294 when not optimizing.
9295 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9297 (Chunked_vector::clear): Clear size_.
9298 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9299 (Chunked_vector::size): Return size_.
9300 (Chunked_vector::push_back): Use size_ to find insert position.
9301 (Chunked_vector::size_): New data member.
9302 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9303 (Stringpool_template::new_key_offset): New method declaration.
9304 (Stringpool_template::offset_): New data member.
9306 2010-03-15 Rafael Espindola <espindola@google.com>
9308 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9309 Add_symbols' constructor.
9310 * readsyms.h (Add_symbols): Remove the input_group member.
9312 2010-03-10 Ian Lance Taylor <iant@google.com>
9314 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9315 target to ask whether a reference to a symbol requires a stack
9317 * target.h (Target::is_call_to_non_split): New function.
9318 (Target::do_is_call_to_non_split): Declare virtual function.
9319 * target.cc: Include "symtab.h".
9320 (Target::do_is_call_to_non_split): New function.
9321 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9323 2010-03-10 Cary Coutant <ccoutant@google.com>
9325 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9326 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9327 (File_read::open[2]): Add whole_file_view_ to list of views.
9328 (File_read::make_view): Remove test of whole_file_view_.
9329 (File_read::find_or_make_view): Create whole_file_view_ if
9331 (File_read::clear_views): Replace bool parameter with enum;
9332 adjust all callers. Don't delete views with permanent data;
9333 do delete cached views and views from archives if
9334 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9335 if clearing the corresponding view.
9336 * fileread.h (File_read::Clear_views_mode): New enum.
9337 (File_read::View::is_permanent_view): New method.
9338 (File_read::clear_views): Replace bool parameter
9339 with enum; adjust all callers.
9340 * options.h (General_options): Change keep_files_mapped option;
9341 add map_whole_files.
9342 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9344 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9347 2010-03-10 David S. Miller <davem@davemloft.net>
9349 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9351 2010-03-09 Sriraman Tallam <tmsriram@google.com>
9353 * icf.cc (get_section_contents): Add '@' marker after processing the
9356 2010-03-08 Doug Kwan <dougkwan@google.com>
9358 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9359 due to a conversion warning.
9360 (Arm_relobj::update_output_local_symbol_count): Check for local
9361 symbol with unset output index.
9363 2010-03-05 Ian Lance Taylor <iant@google.com>
9365 * options.h (class General_options): Add --spare-dynamic-tags.
9366 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9367 --spare-dynamic-tags.
9369 2010-03-05 Ian Lance Taylor <iant@google.com>
9371 * incremental.cc: Include "libiberty.h".
9373 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9375 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9376 function, is_info_ member.
9377 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9378 (Versions::Versions): Update caller.
9379 (Versions::define_base_version): Likewise.
9380 (Versions::add_def): Likewise.
9382 2010-03-03 Sriraman Tallam <tmsriram@google.com>
9384 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9385 (Scan::possible_function_pointer_reloc): New function.
9386 (Scan::local_reloc_may_be_function_pointer): Change to call
9387 possible_function_pointer_reloc.
9388 (Scan::global_reloc_may_be_function_pointer): Ditto.
9389 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9390 relocations in ".data.rel.ro._ZTV" section.
9391 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9392 * testsuite/icf_safe_so_test.cc: Ditto.
9393 * testsuite/icf_safe_test.cc: Ditto.
9394 * testsuite/icf_safe_test.sh: Ditto.
9396 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9397 Ian Lance Taylor <iant@google.com>
9399 * target-reloc.h (relocate_section): Check the symbol table index
9400 for -1U before setting the local symbol index.
9401 (scan_relocatable_relocs): If copying the relocation, record that
9402 the local symbol is required.
9403 * object.h (Symbol_value::is_output_symtab_index_set): New
9405 (Symbol_value::may_be_discarded_from_output_symtab): New
9407 (Symbol_value::has_output_symtab_entry): New function.
9408 (Symbol_value::needs_output_symtab_entry): Remove.
9409 (Symbol_value::output_symtab_index): Make sure the symbol index is
9411 (Symbol_value::set_output_symtab_index): Make sure the symbol
9412 index is not set. Make sure the new index is valid.
9413 (Symbol_value::set_must_have_output_symtab_entry): New function.
9414 (Symbol_value::has_output_dynsym_entry): New function.
9415 (Symbol_value::set_output_dynsym_index): Make sure the new index
9417 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9418 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9419 local symbol if permitted.
9420 (Sized_relobj::do_finalize_local_symbols): Call
9421 is_output_symtab_index_set rather than needs_output_symtab_entry.
9422 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9423 rather than needs_output_symtab_entry. Call
9424 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9425 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9426 is_output_symtab_index_set rather than needs_output_symtab_entry.
9427 * testsuite/discard_locals_relocatable_test.c: New file.
9428 * testsuite/discard_locals_test.sh: Test -r.
9429 * testsuite/Makefile.am (check_DATA): Add
9430 discard_locals_relocatable_test1.syms,
9431 discard_local_relocatable_test2.syms.
9432 (MOSTLYCLEANFILES): Likewise. Also add
9433 discard_locals_relocatable_test1.lout and
9434 discard_locals_relocatable_test2.out.
9435 (discard_locals_relocatable_test1.syms): New target.
9436 (discard_locals_relocatable_test.o): New target.
9437 (discard_locals_relocatable_test1.out): New target.
9438 (discard_locals_relocatable_test2.syms): New target.
9439 (discard_locals_relocatable_test2.out): New target.
9440 (various): Add missing ../ld-new dependencies.
9441 * testsuite/Makefile.in: Rebuild.
9443 2010-03-03 Nick Clifton <nickc@redhat.com>
9445 * po/fi.po: New Finnish translation.
9447 2010-03-01 Doug Kwan <dougkwan@google.com>
9449 * layout.cc (Layout::Layout): Force section types of .init_array*,
9450 .preinit_array* and .fini_array* sections.
9451 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9452 Fix check of return value of std::string::find.().
9453 (Output_section::Input_section_sort_compare::operator()): Remove
9454 comment about .init_array.
9455 (Output_section::Input_section_sort_init_fini_compare::operator()):
9457 (Output_section::sort_attached_input_sections): Handle .init_array
9458 and .fini_array specially.
9459 * output.h (Output_section::Inut_section_sort_compare): Update
9461 (Output_section::Input_section_sort_init_fini_compare): New struct.
9463 2010-02-26 Doug Kwan <dougkwan@google.com>
9465 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9466 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9467 * testsuite/debug_msg.sh: Avoid matching source line number for
9468 use of global variable undef_int.
9470 2010-02-26 Doug Kwan <dougkwan@google.com>
9472 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9473 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9474 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9475 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9476 * options.cc (General_options::General_options): Initialize member
9478 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9479 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9480 and rm_no_fix_v4bx.stdout
9481 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9482 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9483 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9484 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9485 and arm_no_fix_v4bx.
9486 * Makefile.in: Regenerate.
9487 * testsuite/arm_fix_v4bx.s: New file.
9488 * testsuite/arm_fix_v4bx.sh: Ditto.
9490 2010-02-24 Doug Kwan <dougkwan@google.com>
9492 * arm.cc (Target_arm::got_section): Make the .got section the first
9493 non RELRO section in the data segment.
9494 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9495 suffixes of section names.
9497 2010-02-24 Doug Kwan <dougkwan@google.com>
9499 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9500 flags and attributes merging if an input file is a binary file.
9501 * fileread.cc (Input_file::open): Record format of original file.
9502 * fileread.h (Input_file::Format): New enum type.
9503 (Input_file::Input_file): Initialize data member format_.
9504 (Input_file::format): New method definition.
9505 (Input_file::format_):: New data member.
9507 2010-02-24 Doug Kwan <dougkwan@google.com>
9509 * arm.cc (Arm_output_data_got): New class.
9510 (ARM_TCB_SIZE): New constant
9511 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9512 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9513 If user uses a script with a SECTIONS clause, issue only a warning
9514 for a misplaced EXIDX input section. Otherwise, issue an error.
9515 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
9517 (Target_arm::got_mode_index_entry): Handle static linking.
9518 (Target_arm::Scan::local): Ditto.
9519 (Target_arm::Scan::global): Ditto.
9520 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9521 all incorrectly implemented relocations.
9522 (Target_arm::fix_exidx_coverage): Pass layout to
9523 Arm_output_section::fix_exidx_coverage.
9524 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9525 from ".ARM.exidx." and ".ARM.extab.".
9527 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9529 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9530 section if it does not already exist.
9531 * attributes.cc (Attributes_section_data::Attributes_section_data):
9532 Don't crash if size is zero.
9534 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9535 Ian Lance Taylor <iant@google.com>
9537 * gold.cc (queue_middle_tasks): If no input files were opened,
9539 * workqueue.h (Task_function::Task_function): Assert that there is
9542 2010-02-22 Doug Kwan <dougkwan@google.com>
9544 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9545 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9546 types to avoid warnings due to different uint64_t implementations
9549 2010-02-21 Doug Kwan <dougkwan@google.com>
9551 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9552 handling of the maximum backward branch offset.
9553 (Arm_relocate_functions::thumb_branch_common): Ditto.
9554 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9555 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
9556 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
9557 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9558 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9559 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9560 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9561 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9562 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9563 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9564 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9565 thumb2_bl_out_of_range.o): New rules.
9566 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9567 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9568 thumb2_bl_out_of_range
9569 * testsuite/Makefile.in: Regenerate.
9570 * testsuite/arm_bl_in_range.s: New file.
9571 * testsuite/arm_bl_out_of_range.s: Ditto.
9572 * testsuite/arm_branch_in_range.sh: Ditto.
9573 * testsuite/arm_branch_range.t: Ditto.
9574 * testsuite/thumb2_branch_range.t: Ditto.
9575 * testsuite/thumb_bl_in_range.s: Ditto.
9576 * testsuite/thumb_bl_out_of_range.s: Ditto.
9577 * testsuite/thumb_branch_range.t: Ditto.
9579 2010-02-20 Sriraman Tallam <tmsriram@google.com>
9581 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9582 Add reloc offset information.
9583 * icf.cc (get_section_contents): Change iterators to point to the new
9584 vectors. Add reloc offset information to the contents.
9585 * icf.h (Icf::Sections_reachable_info): New typedef.
9586 (Icf::Sections_reachable_list): New typedef.
9587 (Icf::Offset_info): New typedef.
9588 (Icf::Reloc_info): New struct typedef.
9589 (Icf::Reloc_info_list): New typedef.
9590 (Icf::symbol_reloc_list): Delete method.
9591 (Icf::addend_reloc_list): Delete method.
9592 (Icf::section_reloc_list): Delete method.
9593 (Icf::reloc_info_list): New method.
9594 (Icf::reloc_info_list_): New member.
9596 2010-02-19 Doug Kwan <dougkwan@google.com>
9598 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9599 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9600 * arm.cc (Arm_relocation_functions): New forward declaration.
9601 (Target_arm::Target_arm): Initialize new data members
9602 got_mod_index_offset_ and tls_base_symbol_defined_.
9603 (Target_arm::Relocate::relocate_tls): New method.
9604 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9605 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9607 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
9608 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9609 (Target_arm::got_mod_index_offset_,
9610 Target_arm::tls_base_symbol_defined_): New data members.
9611 (Target_arm::Scan::local, Target::Scan::global,
9612 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9615 2010-02-18 Doug Kwan <dougkwan@google.com>
9617 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9618 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9619 text section as a parameter becuase some broken tools may not set
9620 the link in section header.
9621 (Target_arm::has_got_section): New method.
9622 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9623 without any mapping symbol as data only. Remove warning.
9624 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9625 link in its section header, try to discover the link by inspecting the
9626 REL31 relocation at the beginning of the section.
9627 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9629 (Target_arm::Scan::global): Treat any reference to the symbol
9630 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9632 2010-02-12 Sriraman Tallam <tmsriram@google.com>
9634 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9635 (Scan::global_reloc_may_be_function_pointer): New function.
9636 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9637 (Scan::global_reloc_may_be_function_pointer): New function.
9638 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9639 (Scan::global_reloc_may_be_function_pointer): New function.
9640 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9641 (Scan::global_reloc_may_be_function_pointer): New function.
9642 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9643 (Scan::global_reloc_may_be_function_pointer): New function.
9644 (Scan::possible_function_pointer_reloc): New function.
9645 (Target_x86_64::can_check_for_function_pointers): New function.
9646 * gc.h (gc_process_relocs): Scan relocation types to determine if
9647 function pointers were taken for targets that support it.
9648 * icf.cc (Icf::find_identical_sections): Include functions for
9649 folding in safe ICF whose pointer is not taken.
9650 * icf.h (Secn_fptr_taken_set): New typedef.
9651 (fptr_section_id_): New member.
9652 (section_has_function_pointers): New function.
9653 (set_section_has_function_pointers): New function.
9654 (check_section_for_function_pointers): New function.
9655 * options.h: Fix comment for safe ICF option.
9656 * target.h (can_check_for_function_pointers): New function.
9657 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9658 Modify icf_safe_test for X86-64.
9659 * testsuite/Makefile.in: Regenerate.
9660 * testsuite/icf_safe_so_test.cc: New file.
9661 * testsuite/icf_safe_so_test.sh: New file.
9662 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9663 (main): Change to take pointer to function kept_func_3.
9664 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9665 folding is done correctly for X86-64.
9667 2010-02-12 David S. Miller <davem@davemloft.net>
9669 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9670 is_symbolless parameter.
9671 (Output_reloc<SHT_REL>::is_symbolless): New.
9672 (Output_reloc<SHT_REL>::is_symbolless_): New.
9673 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9674 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9675 (Output_reloc<SHT_RELA>::is_symbolless): New.
9676 (Output_data_reloc::add_global): Handle is_symbolless.
9677 (Output_data_reloc::add_global_relative): Likewise.
9678 (Output_data_reloc::add_local): Likewise.
9679 (Output_data_reloc::add_local_relative): Likewise.
9680 (Output_data_reloc::add_symbolless_global_addend): New.
9681 (Output_data_reloc::add_symbolless_local_addend): New.
9682 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9684 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9685 instead of ->is_relative_
9686 (Output_reloc::write): Likewise.
9687 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9688 (Output_reloc::write_rel): Simplify.
9690 * sparc.cc (Target_sparc::Scan::local): Use
9691 ->add_symbolless_local_addend as needed.
9692 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9693 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9694 based upon relocation offset.
9696 2010-02-11 Doug Kwan <dougkwan@google.com>
9698 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9699 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9700 beginning of function.
9701 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9702 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9703 parameter is_32bit in calls to should_apply_static_reloc.
9704 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9705 (check_DATA): Add arm_abs_global.stdout.
9706 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9707 arm_abs_global.stdout): New rules.
9708 (MOSTLLYCLEANFILES): Add arm_abs_global
9709 * Makefile.in: Regenerate.
9710 * testsuite/arm_abs_global.s: New file.
9711 * testsuite/arm_abs_global.sh: Ditto.
9712 * testsuite/arm_abs_lib.s: Ditto.
9714 2010-02-11 Ian Lance Taylor <iant@google.com>
9716 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9718 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9719 Allocate_commons_task first.
9720 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9721 task, rather than symtab_lock_.
9722 (Gc_process_relocs::~Gc_process_relocs): New function.
9723 (Gc_process_relocs::is_runnable): Check this_blocker_.
9724 (Gc_process_relocs::locks): Use next_blocker_ rather than
9726 (Scan_relocs::~Scan_relocs): New function.
9727 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9729 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9731 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9732 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9733 constructor accordingly.
9734 (class Gc_process_relocs): Likewise.
9735 (class Scan_relocs): Likewise.
9736 * common.h (class Allocate_commons_task): Remove symtab_lock_
9737 field, and corresponding constructor parameter.
9738 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9740 (Allocate_commons_task::locks): Likewise.
9742 2010-02-11 Ian Lance Taylor <iant@google.com>
9744 * gold-threads.h (class Once): Define.
9745 (class Initialize_lock): Rewrite as child of Once.
9746 * gold-threads.cc (class Once_initialize): Define.
9747 (once_pointer_control): New static variable.
9748 (once_pointer, once_arg): New static variables.
9749 (c_run_once): New static function.
9750 (Once::Once, Once::run_once, Once::internal_run): New functions.
9751 (class Initialize_lock_once): Remove.
9752 (initialize_lock_control): Remove.
9753 (initialize_lock_pointer): Remove.
9754 (initialize_lock_once): Remove.
9755 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9756 (Initialize_lock::initialize): Rewrite.
9757 (Initialize_lock::do_run_once): New function.
9758 * archive.cc (Archive::interpret_header): Only clear name if it is
9760 * fileread.cc: Include "gold-threads.h"
9761 (file_counts_lock): New static variable.
9762 (file_counts_initialize_lock): Likewise.
9763 (File_read::release): Only increment counts when using --stats.
9764 Use a lock around the increment.
9765 * parameters.cc (class Set_parameters_target_once): Define.
9766 (set_parameters_target_once): New static variable.
9767 (Parameters::Parameters): Move here from parameters.h.
9768 (Parameters::set_target): Rewrite.
9769 (Parameters::set_target_once): New function.
9770 (Parameters::clear_target): Move here and rewrite.
9771 * parameters.h (class Parameters): Update declarations. Add
9772 set_parameters_target_once_ field.
9773 (Parameters::Parameters): Move to parameters.cc.
9774 (Parameters::clear_target): Likewise.
9775 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9777 (Start_group::~Start_group): New function.
9778 (Start_group::is_runnable): New function.
9779 (Start_group::locks, Start_group::run): New functions.
9780 (Finish_group::run): Change saw_undefined to size_t.
9781 * readsyms.h (class Start_group): Define.
9782 (class Finish_group): Change saw_undefined_ field to size_t.
9783 (Finish_group::Finish_group): Remove saw_undefined and
9784 this_blocker parameters. Change all callers.
9785 (Finish_group::set_saw_undefined): New function.
9786 (Finish_group::set_blocker): New function.
9787 * symtab.h (class Symbol_table): Change saw_undefined to return
9788 size_t. Change saw_undefined_ field to size_t.
9789 * target-select.cc (Set_target_once::do_run_once): New function.
9790 (Target_selector::Target_selector): Initialize set_target_once_
9791 field. Don't initialize lock_ and initialize_lock_ fields.
9792 (Target_selector::instantiate_target): Rewrite.
9793 (Target_selector::set_target): New function.
9794 * target-select.h (class Set_target_once): Define.
9795 (class Target_selector): Update declarations. Make
9796 Set_target_once a friend. Remove lock_ and initialize_lock_
9797 fields. Add set_target_once_ field.
9799 2010-02-10 Ian Lance Taylor <iant@google.com>
9801 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9803 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9804 (queue_middle_tasks): Add all blockers before queueing any tasks.
9805 (queue_final_tasks): Likewise.
9806 * token.h (Task_token::add_blockers): New function.
9807 * object.h (Input_objects::number_of_relobjs): New function.
9809 2010-02-10 Ian Lance Taylor <iant@google.com>
9811 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9812 shared, not if not position independent.
9813 * x86_64.cc (Relocate::relocate_tls): Likewise.
9814 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9815 (tls_pie_pic_test): New target.
9816 * testsuite/Makefile.in: Rebuild.
9818 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9819 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9820 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9821 * testsuite/Makefile.in: Rebuild.
9823 2010-02-09 David S. Miller <davem@davemloft.net>
9825 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9826 R_SPARC_RELATIVE using ->add_local_relative().
9827 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9829 * output.h (Output_data_dynamic::add_section_size): New method
9830 that takes two Output_data objects.
9831 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9832 entry param. Handle it in initializers.
9833 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9834 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9835 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9837 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9838 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9839 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9840 for dynrel_includes_plt.
9841 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9842 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9843 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9845 (Target_sparc::do_finalize_sections): Update to pass true for
9846 dynrel_includes_plt.
9847 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9848 output before .rela.plt
9849 (Target_powerpc::do_finalize_sections): Update to pass true for
9850 dynrel_includes_plt when 32-bit.
9852 2010-02-08 Doug Kwan <dougkwan@google.com>
9854 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9856 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9857 Arm_relobj::scan_section_for_cortex_a8_stubs,
9858 Arm_relobj::do_relocation_section): Instead of calling
9859 Output_section::output_address, use faster
9860 Arm_relobj::simple_input_section_output_address.
9862 2010-02-08 David S. Miller <davem@davemloft.net>
9864 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9865 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9866 relocation helper function.
9868 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9869 just like R_SPARC_GOT{10,13,22}.
9870 (Target_sparc::Scan::local): Likewise.
9871 (Target_sparc::Relocate:relocate): Likewise.
9873 2010-02-06 Ian Lance Taylor <iant@google.com>
9875 * configure.ac: Rewrite targetobjs duplicate removal code to use
9876 only shell constructs.
9877 * configure: Rebuild.
9879 2010-02-05 Doug Kwan <dougkwan@google.com>
9882 * arm.cc (Arm_relobj::section_is_scannable): New method.
9883 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9884 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9886 2010-02-04 Doug Kwan <dougkwan@google.com>
9889 * arm-reloc-property.cc (cstdio): Include.
9890 * configure.ac (targetobjs): Remove duplicates.
9891 * configure: Regenerate.
9892 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9893 big and little endian version for a given address size.
9895 2010-02-03 Doug Kwan <dougkwan@google.com>
9897 * arm-reloc-property.cc
9898 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9900 * arm-reloc-property.h
9901 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9902 New method definition.
9903 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9905 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9907 (GOT_PREL): Change implemented to Y.
9908 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9909 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9910 (Arm_relocate_functions::movw_abs_nc): Remove method.
9911 (Arm_relocate_functions::movt_abs): Ditto.
9912 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9913 (Arm_relocate_functions::thm_movt_abs): Ditto.
9914 (Arm_relocate_functions::movw_rel_nc): Ditto.
9915 (Arm_relocate_functions::movw_rel): Ditto.
9916 (Arm_relocate_functions::movt_rel): Ditto.
9917 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9918 (Arm_relocate_functions:thm_movw_rel): Ditto.
9919 (Arm_relocate_functions:thm_movt_rel): Ditto.
9920 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9921 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9922 New method definitions.
9923 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9924 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9925 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9926 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9927 (Target_arm::Relocate::relocate): Check for non-static or
9928 unimplemented relocation code and exit early. Change calls to
9929 Target_arm::reloc_uses_thumb_bit and
9930 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9931 instead. Refactor code to handle similar relocations to increase
9932 code sharing. Remove check for unsupported relocation code in switch
9934 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9935 relocation property table to find out size. Change error message to
9936 print out the name of a relocation code instead of the numeric value.
9937 (Target_arm::scan_reloc_for_stub): Use relocation property table
9938 instead of calling Target_arm::reloc_uses_thumb_bit().
9940 2010-02-02 Doug Kwan <dougkwan@google.com>
9942 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9943 types of relaxed input section.
9945 2010-02-02 Doug Kwan <dougkwan@google.com>
9947 * Makefile.am (HFILES): Add arm-reloc-property.h.
9949 (TARGETSOURCES): Add arm-reloc-property.cc
9950 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
9951 (libgold_a_SOURCES): $(DEFFILES)
9952 * Makefile.in: Regenerate.
9953 * arm-reloc-property.cc: New file.
9954 * arm-reloc-property.h: New file.
9955 * arm-reloc.def: New file.
9956 * arm.cc: Update comments.
9957 (arm-reloc-property.h): New included header.
9958 (arm_reloc_property_table): New global variable.
9959 (Target_arm::do_select_as_default_target): New method definition.
9960 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9961 arm-reloc-property to targ_extra_obj.
9962 * parameters.cc (set_parameters_target): Call
9963 Target::select_as_default_target().
9964 * target.h (Target::select_as_default_target): New method definition.
9965 (Target::do_select_as_default_target): Same.
9967 2010-02-01 Doug Kwan <dougkwan@google.com>
9969 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9970 first_output_text_section_.
9971 (Arm_exidx_fixup::first_output_text_section): New method definition.
9972 (Arm_exidx_fixup::first_output_text_section_): New data member.
9973 (Arm_exidx_fixup::process_exidx_section): Record the first text
9974 output section seen.
9975 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9976 and entsize in output section header.
9978 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9980 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9981 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9982 (Arm_relocate_functions::thm_alu11): New Method.
9983 (Arm_relocate_functions::thm_pc8): New Method.
9984 (Arm_relocate_functions::thm_pc12): New Method.
9985 (Target_arm::Scan::local): Handle the relocations.
9986 (Target_arm::Scan::global): Likewise.
9987 (Target_arm::Relocate::relocate): Likewise.
9988 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9990 2010-01-29 Doug Kwan <dougkwan@google.com>
9992 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9993 of relocation types as ld.
9995 2010-01-29 Doug Kwan <dougkwan@google.com>
9997 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9999 (Arm_relocate_functions::thumb_branch_common): Ditto.
10000 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10001 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10002 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10003 Arm_relocate_functions::jump24): Remove.
10004 (Target_arm::Relocate::relocate): Adjust code to call
10005 Arm_relocation_functions::arm_branch_common and
10006 Arm_relocation_functions::thumb_branch_common instead of their removed
10007 wrappers. Merge switch-cases together to reduce source code size.
10009 2010-01-29 Doug Kwan <dougkwan@google.com>
10011 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10012 output_local_symbol_count_needs_update_.
10013 (Arm_relobj::output_local_symbol_count_needs_update,
10014 Arm_relobj::set_output_local_symbol_count_needs_update,
10015 Arm_relobj::update_output_local_symbol_count): New methods.
10016 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10018 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10019 of pointed function as in a R_ARM_PREL31 relocation.
10020 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10021 for output local symbol count updating.
10022 (Target_arm::do_relax): Update output local symbol counts in objects
10024 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10026 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10028 * arm.cc: Added support for the ARM relocations:
10029 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10030 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10031 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10033 (Arm_relocate_functions::movw_rel): New method.
10034 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10035 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10037 (Arm_relocate_functions::thm_movw_rel): New method.
10038 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10040 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10042 (Target_arm::Scan::global): Likewise.
10043 (Target_arm::Relocate::relocate): Likewise.
10044 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10047 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10049 * arm.cc: Added support for ARM group relocations.
10050 (Target_arm::reloc_needs_sym_origin): New method.
10051 (Arm_relocate_functions::calc_grp_kn): New method.
10052 (Arm_relocate_functions::calc_grp_residual): New method.
10053 (Arm_relocate_functions::calc_grp_gn): New method.
10054 (Arm_relocate_functions::arm_grp_alu): New Method.
10055 (Arm_relocate_functions::arm_grp_ldr): New Method.
10056 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10057 (Arm_relocate_functions::arm_grp_ldc): New Method.
10058 (Target_arm::Scan::local): Handle the ARM group relocations.
10059 (Target_arm::Scan::global): Likewise.
10060 (Target_arm::Relocate::relocate): Likewise.
10061 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10064 2010-01-26 Doug Kwan <dougkwan@google.com>
10066 * arm.cc (set): Include.
10067 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10069 (Arm_output_section::Text_section_list): New type.
10070 (Arm_output_section::append_text_sections_to_list): New method.
10071 (Arm_output_section::fix_exidx_coverage): Ditto.
10072 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
10073 (Arm_relobj::convert_input_section_to_relaxed_section): Use
10074 Relobj::set_section_offset() instead of
10075 Sized_relobj::invalidate_section_offset().
10076 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
10077 parameter for section headers. Ignore relocation sections for
10078 unallocated sections and EXIDX sections.
10079 (Target_arm::fix_exidx_coverage): New method.
10080 (Target_arm::output_section_address_less_than): New type.
10081 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10082 linked text section instead of the EXIDX section.
10083 (Arm_output_section::create_stub_group): Add an assertion to check
10084 that this is not an EXIDX output section.
10085 (Arm_output_section::append_text_sections_to_list): New method.
10086 (Arm_output_section::fix_exidx_coverage): Ditto.
10087 (Arm_relobj::scan_sections_for_stubs): Adjust call to
10088 Arm_relobj::section_needs_reloc_stub_scanning.
10089 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10091 (Target_arm::fix_exidx_coverage): New method.
10092 * object.h (Relobj::set_output_section): New method.
10093 (Sized_relobj::invalidate_section_offset): Remove method.
10094 (Sized_relobj::do_invalidate_section_offset): Remove method.
10095 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10097 2010-01-25 Doug Kwan <dougkwan@google.com>
10099 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10100 Fix warning due to signed and unsigned comparison on a 32-bit host.
10102 2010-01-22 Doug Kwan <dougkwan@google.com>
10104 * arm.cc (Target_arm::do_relax): Record an output section for section
10105 offset adjustment it contains any stub table that has changed.
10106 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10107 offsets in an output section if necessary.
10108 * output.cc (Output_section::Output_section): Initialize
10109 section_offsets_need_adjustments_.
10110 (Output_section::add_input_section_for_script): Renamed to
10111 Output_section::add_simple_input_section.
10112 (Output_section::save_states): Add a comment.
10113 (Output_section::discard_states): New method defintion.
10114 (Output_section::adjust_section_offsets): Same.
10115 * output.h (Output_section::add_input_section_for_script): Renamed to
10116 Output_section::add_simple_input_section.
10117 (Output_section::discard_states): New method declaration.
10118 (Output_section::adjust_section_offsets): Same.
10119 (Output_section::section_offsets_need_adjustment,
10120 Output_section::set_section_offsets_need_adjustment): New method
10122 (Output_section::section_offsets_need_adjustment_): New data member.
10123 * script-sections.cc
10124 (Output_section_element_input::set_section_address): Adjust code for
10125 renaming of Output_section::add_input_section_for_script.
10126 (Orphan_output_section::set_section_address): Same.
10128 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10130 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10131 Fix_v4bx enum values .
10132 * gold/options.h (General_options): New option definitions.
10133 (General_options::fix_v4bx): New method.
10134 (General_options::Fix_v4bx): New enum.
10135 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10136 (General_options::parse_fix_v4bx_interworking): New method.
10138 2010-01-22 Doug Kwan <dougkwan@google.com>
10140 * arm.cc (Arm_exidx_fixup): New class.
10142 2010-01-21 Doug Kwan <dougkwan@google.com>
10144 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10146 (Arm_exidx_section_offset_map): New type.
10148 2010-01-21 Doug Kwan <dougkwan@google.com>
10150 * arm.cc (Arm_exidx_input_section): New class.
10151 (Arm_relobj::exidx_input_section_by_link,
10152 Arm_relobj::exidx_input_section_by_shndx,
10153 Arm_relobj::make_exidx_input_section): New methods.
10154 (read_arm_attributes_section): Remove.
10155 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10156 information about them.
10157 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10160 2010-01-20 Doug Kwan <dougkwan@google.com>
10162 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10163 Input_section_specifier to Section_id.
10164 (Target_arm::new_arm_input_section: Adjust code for change of key
10166 (Target_arm::find_arm_input_section): Ditto.
10167 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10168 (Section_id): Remove.
10169 (Garbage_collection::Section_id_hash): Remove.
10170 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10171 (Section_id): Remove.
10172 (Icf::Section_id_hash): Remove.
10173 * object.h (Section_id, Const_section_id, Section_id_hash,
10174 Const_section_id_hash): New type definitions.
10175 * output.cc (Output_section::add_relaxed_input_section): Change to
10176 use Const_section_id instead of Input_section_specifier as key type.
10177 (Output_section::add_merge_input_section): Ditto.
10178 (Output_section::build_relaxation_map): Change to use Section_id
10179 instead of Input_section_specifier as key type.
10180 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
10182 (Output_section::convert_input_sections_to_relaxed_sections): Change
10183 to use Const_section_id instead of Input_section_specifier as key type.
10184 (Output_section::find_merge_section): Ditto.
10185 (Output_section::find_relaxed_input_section): Ditto.
10186 * output.h (Input_section_specifier): Remove class.
10187 (Output_section::Output_section_data_by_input_section_map): Change
10188 key type to Const_section_id.
10189 (Output_section::Output_relaxed_input_section_by_input_section_map):
10191 (Output_section::Relaxation_map): Change key type to Section_id.
10193 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10195 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10196 (class Arm_v4bx_stub): New class.
10197 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10198 (Stub_factory::make_arm_v4bx_stub): New method.
10199 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10200 (Stub_table::empty): Handle v4bx stubs.
10201 (Stub_table::add_arm_v4bx_stub): New method.
10202 (Stub_table::find_arm_v4bx_stub): New method.
10203 (Arm_relocate_functions::v4bx): New method.
10204 (Target_arm::fix_v4bx): New method.
10205 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10206 (Stub_table::relocate_stubs): Likewise.
10207 (Stub_table::do_write): Likewise.
10208 (Stub_table::update_data_size_and_addralign): Likewise.
10209 (Stub_table::finalize_stubs): Likewise.
10210 (Target_arm::Scan::local): Likewise.
10211 (Target_arm::Scan::global): Likewise.
10212 (Target_arm::do_finalize_sections): Likewise.
10213 (Target_arm::Relocate::relocate): Likewise.
10214 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10216 (Target_arm::scan_reloc_for_stub): Likewise.
10217 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10219 2010-01-19 Ian Lance Taylor <iant@google.com>
10221 * output.cc (Output_section_headers::do_sized_write): Write large
10222 segment count to sh_info field.
10223 (Output_file_header::do_sized_write): For large segment count,
10224 write PN_XNUM to e_phnum field.
10226 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10228 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10229 (Arm_relocate_functions::thm_jump8): New function.
10230 (Arm_relocate_functions::thm_jump11): New function.
10231 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10233 (Target_arm::Scan::global): Likewise.
10234 (Target_arm::Relocate::relocate): Likewise.
10235 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10238 2010-01-14 Doug Kwan <dougkwan@google.com>
10240 * arm.cc (map, utility): Include headers.
10241 (Target_arm::apply_cortex_a8_workaround): New method.
10242 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10243 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10244 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10245 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10246 the --[no-]fix-cortex-a8 command line options.
10247 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10248 (Target_arm::relocate_stub): Use addend in instruction template.
10249 * options.h (DEFINE_bool): Set the user-set flag.
10250 (General_options): Add --[no-]-fix-cortex options.
10251 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
10252 : Update fast look-up map after conversion.
10254 2010-01-14 Sriraman Tallam <tmsriram@google.com>
10256 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10257 in the first pass of do_layout.
10259 2010-01-13 Doug Kwan <dougkwan@google.com>
10261 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10262 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10263 apparent compiler problem of not folding static constant integral
10264 data members of elfcpp::Elf_sizes<32>.
10266 2010-01-13 Doug Kwan <dougkwan@google.com>
10268 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10269 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10270 Arm_relobj::scan_section_for_cortex_a8_erratum,
10271 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10272 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10273 sections to scan for relocation stubs into a new method
10274 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10275 relocation and Cortex-A8 stub scanning.
10276 (Target_arm::do_relax): Force stubs to be after stubbed sections
10277 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
10278 the beginning of a new relaxation pass. Update a comment.
10279 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10281 2010-01-12 Ian Lance Taylor <iant@google.com>
10283 * target-reloc.h (visibility_error): New inline function.
10284 (relocate_section): Call visibility_error.
10285 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10286 (MOSTLYCLEANFILES): Likewise.
10287 (protected_4_pic.o, protected_3.err): New targets.
10288 * testsuite/protected_4.cc: New file.
10290 2010-01-12 Doug Kwan <dougkwan@google.com>
10292 * arm.cc (Cortex_a8_reloc): New class.
10293 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10294 and cortex_a8_relocs_info_.
10295 (Target_arm::fix_cortex_a8): New method definition.
10296 (Target_arm::Cortex_a8_relocs_info): New type.
10297 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10298 New data member declarations.
10299 (Target_arm::scan_reloc_for_stub): Record information about
10300 relocations for THUMB branches that might be exempted from the
10301 Cortex-A8 workaround.
10302 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10303 at the beginning of a relaxation pass.
10305 2010-01-12 Doug Kwan <dougkwan@google.com>
10307 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10308 (Arm_relobj::Mapping_symbol_position,
10309 Arm_reloj::Mapping_symbol_position_less,
10310 Arm_relobj::Mapping_symbols_info): New types.
10311 (Target_arm::is_mapping_symbol_name): New method definition.
10312 (Arm_relobj::do_count_local_symbols): Save information about mapping
10315 2010-01-11 Doug Kwan <dougkwan@google.com>
10317 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10318 Arm_relocate_functions::thumb32_branch_upper,
10319 Arm_relocate_functions::thumb32_branch_lower,
10320 Arm_relocate_functions::thumb32_cond_branch_offset,
10321 Arm_relocate_functions::thumb32_cond_branch_upper,
10322 Arm_relocate_functions::thumb32_cond_branch_lower,
10323 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10324 branch offset encoding.
10325 (Arm_relocate_functions::thumb_branch_common): Use new branch
10326 offset encoding methods to avoid code duplication.
10327 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10328 (Stub_addend_reader::operator()): Use new branch encoding method
10329 to avoid code duplication.
10331 2010-01-11 Doug Kwan <dougkwan@google.com>
10333 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10334 (Target_arm::do_finalize_sections): Define special EXIDX section
10335 symbols only if referenced.
10336 * gc.h (Garbage_collection::add_reference): New method.
10337 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10340 2010-01-11 Ian Lance Taylor <iant@google.com>
10342 * script.cc (Version_script_info::build_expression_list_lookup):
10343 Change complaing about duplicate wildcard match from error to
10346 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10348 (Version_script_info::Version_script_info): Initialize globs_,
10349 default_version_, default_is_global_, and exact_. Don't
10350 initialize globals_ or locals_.
10351 (Version_script_info::build_lookup_tables): Build local symbols
10353 (Version_script_info::unquote): New function.
10354 (Version_script_info::add_exact_match): New function.
10355 (Version_script_info::build_expression_list_lookup): Remove lookup
10356 parameter. Add is_global parameter. Change all callers. Handle
10357 wildcard pattern specially. Unquote pattern. Call
10359 (Version_script_info::get_name_to_match): New function.
10360 (Version_script_info::get_symbol_version): New function.
10361 (Version_script_info::get_symbol_version_helper): Remove.
10362 (Version_script_info::check_unmatched_names): Call unquote.
10363 * script.h (class Version_script_info): Change get_symbol_version
10364 to be non-inline and add is_global parameter; change all callers.
10365 Rewrite symbol_is_local. Update declarations. Define struct
10366 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10367 Remove globals_ and locals_ members. Add exact_, globs_,
10368 default_version_, is_global_.
10369 (Version_script_info::Glob): Remove pattern, add expression and
10370 is_global. Update constructor. Change all callers.
10371 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10373 (Versions::symbol_section_contents): If a symbol is undefined, or
10374 defined in a dynamic object, set the version index to
10376 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10378 (Symbol_table::add_from_pluginobj): Likewise.
10379 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10381 2010-01-11 Doug Kwan <dougkwan@google.com>
10383 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10384 (incremental_dump_LDADD): Add linking option for libintl.
10385 * Makefile.in: Regenerate.
10387 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10390 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10392 * testsuite/Makefile.in: Regenerated.
10394 2010-01-10 Doug Kwan <dougkwan@google.com>
10396 * options.h (DEFINE_var): Use parentheses around argument varname__
10397 in macro body to avoid any unintended subsequent substitutions.
10399 2010-01-10 Ian Lance Taylor <iant@google.com>
10401 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10402 candidates before doing symbol resolution.
10404 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10405 ODR candidates if only one is weak.
10407 2010-01-08 Ian Lance Taylor <iant@google.com>
10409 * script.cc (Version_script_info::build_expression_list_lookup):
10410 Don't warn about ambiguous version, just record the ambiguity.
10411 (Version_script_info::get_symbol_version_helper): Give error if
10412 version is ambiguous.
10414 2010-01-08 Doug Kwan <dougkwan@google.com>
10416 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
10417 prev_data_size_ and prev_addralign_. Remove initializer for
10418 deleted data member has_been_changed_.
10419 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10420 to determine if the table is empty.
10421 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10423 (Stub_table::add_reloc_stub): Define method in class definition
10424 instead of just declaring it there.
10425 (Stub_table::add_cortex_a8_stub): New method definition.
10426 (Stub_table::update_data_size_and_addralign): Ditto.
10427 (Stub_table::finalize_stubs): Ditto.
10428 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10429 (Stub_table::do_addralign_): Return address alignment in the
10430 (Stub_table::do_reset_address_and_file_offset): Define method in
10431 class definition instead of declaring it there. Set current data
10432 size to be the data size of the previous pass.
10433 (Stub_table::set_final_data_size): Use current data size as the
10435 (Stub_table::relocate_stub): Change parameter type of stub from
10436 Reloc_stub pointer to Stub pointer.
10437 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10438 (Stub_table::Cortex_a8_stub_list): New typedef.
10439 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10440 Stub_table::prev_addralign_): New data member.
10441 (Arm_relobj::Arm_relobj): Initialize data member
10442 section_has_cortex_a8_workaround_.
10443 (Arm_relobj::section_has_cortex_a8_workaround,
10444 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10446 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10448 (Target_arm::relocate_stub): Change parameter type of stub from
10449 Reloc_stub pointer to Stub pointer.
10450 (Insn_template::size, Insn_template::alignment): Handle
10451 THUMB16_SPECIAL_TYPE.
10452 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10453 Stub_table::update_data_size_and_addralign,
10454 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10456 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10457 (Stub_table::do_write): Ditto.
10458 (Target_arm::do_relax): Adjust code for changes in Stub_table.
10460 2010-01-08 Ian Lance Taylor <iant@google.com>
10463 * symtab.h (class Symbol): Remove fields is_target_special_ and
10464 has_plt_offset_. Add field is_defined_in_discarded_section_.
10465 (Symbol::is_defined_in_discarded_section): New function.
10466 (Symbol::set_is_defined_in_discarded_section): New function.
10467 (Symbol::has_plt_offset): Rewrite.
10468 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10469 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10470 Don't initialize is_target_special_ or has_plt_offset_.
10471 Initialize is_defined_in_discarded_section_.
10472 (Symbol_table::add_from_relobj): If appropriate, set
10473 is_defined_in_discarded_section.
10474 * resolve.cc (Symbol::override_base_with_special): Don't test
10475 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10476 * target-reloc.h (relocate_section): Do special handling for
10477 symbols defined in discarded sections for global symbols as well
10480 2010-01-08 Ian Lance Taylor <iant@google.com>
10482 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10483 the SHT_SYMTAB case.
10485 2010-01-08 Ian Lance Taylor <iant@google.com>
10487 * object.cc (Sized_relobj::do_layout): Don't get confused if
10488 layout_eh_frame returns NULL.
10490 2010-01-08 Ian Lance Taylor <iant@google.com>
10493 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10494 dynamic symbol table, use the normal symbol table.
10495 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10498 2010-01-08 Ian Lance Taylor <iant@google.com>
10501 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10504 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10506 * version.cc (print_version): Change to "Copyright 2010".
10508 2010-01-08 Ian Lance Taylor <iant@google.com>
10512 * i386.cc (class Target_i386): Change return type of plt_section
10514 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10515 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10516 tls_desc_rel_ field.
10517 (Output_data_plt_i386::rel_tls_desc): New function.
10518 (Target_i386::rel_tls_desc_section): New function.
10519 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10520 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10521 R_386_TLS_DESC reloc in rel_tls_desc_section.
10522 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10523 Define struct Tlsdesc_info.
10524 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10525 (Target_x86_64::do_reloc_symbol_index): New function.
10526 (Target_x86_64::add_tlsdesc_info): New function.
10527 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10528 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10529 tlsdesc_rel_ field.
10530 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10532 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10533 (Target_x86_64::rela_tlsdesc_section): New function.
10534 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10536 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10537 (Target_x86_64::do_reloc_addend): New function.
10538 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10539 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10540 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10541 (Output_reloc::type): New function.
10542 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10543 (Output_reloc::is_target_specific): New function.
10544 (Output_reloc::target_arg): New function.
10545 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10546 absolute relocs and target specific relocs.
10547 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10548 add_target_specific.
10549 (class Output_data_reloc) [SHT_RELA]: Likewise.
10550 * output.cc (Output_reloc::Output_reloc): Add four new versions
10551 for absolute relocs and target specific relocs.
10552 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10553 (Output_reloc::get_symbol_index): Likewise.
10554 (Output_reloc::local_section_offset): Check that local_sym_index_
10555 is not TARGET_CODE or 0.
10556 (Output_reloc::symbol_value): Likewise.
10557 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10559 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10560 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10562 * layout.cc (add_target_dynamic_tags): Use output section for
10563 DT_PLTRELSZ and DT_JMPREL.
10565 2010-01-07 Ian Lance Taylor <iant@google.com>
10568 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10570 (class Output_data_reloc_generic): Define.
10571 (class Output_data_reloc_base): Change base class to
10572 Output_data_reloc_generic. Change add() method to call
10573 bump_relative_reloc_count for a relative reloc. Remove
10574 sort_relocs_ field.
10575 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10577 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10578 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10580 * layout.h (class Layout): Update declaration.
10582 2010-01-07 Ian Lance Taylor <iant@google.com>
10584 * output.h (class Output_data): Add const version of
10585 output_section and do_output_section.
10586 (class Output_section_data): Add const version of
10588 (class Output_section): Likewise.
10589 * layout.cc (Layout::add_target_dynamic_tags): New function.
10590 * layout.h (class Layout): Update declarations.
10591 * arm.cc (Target_arm::do_finalize_sections): Use
10592 add_target_dynamic_tags.
10593 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10594 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10595 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10596 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10598 2010-01-07 Ian Lance Taylor <iant@google.com>
10601 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10604 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10605 Ian Lance Taylor <iant@google.com>
10608 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10609 Xindex::read_symtab_xindex.
10611 2010-01-07 Doug Kwan <dougkwan@google.com>
10613 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10614 (Insn_template::thumb16_bcond_insn): New method declaration.
10615 (Insn_template): Fix spelling.
10616 (Stub::thumb16_special): New method declaration.
10617 (Stub::do_write): Define virtual method which was previously pure
10619 (Stub::do_thumb16_special): New method declaration.
10620 (Stub::do_fixed_endian_write): New template member.
10621 (Reloc_stub::do_write): Remove.
10622 (Reloc_stub::do_fixed_endian_write): Remove.
10623 (Cortex_a8_stub): New class definition.
10624 (Stub_factory::make_cortex_a8_stub): New method definition.
10625 (Stub_factory::Stub_factory): Add missing static storage class
10626 qualifier for elf32_arm_stub_a8_veneer_blx.
10628 2010-01-07 Ian Lance Taylor <iant@google.com>
10631 * options.h (class General_options): Add --warn-unresolved-symbols
10632 and --error-unresolved-symbols.
10633 * errors.cc (Errors::undefined_symbol): Implement
10634 --warn-unresolved-symbols.
10636 * options.h (class General_options): Add -z text and -z textoff.
10637 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10639 2010-01-06 Sriraman Tallam <tmsriram@google.com>
10641 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10642 (Garbage_collection::cident_sections): New function.
10643 (Garbage_collection::add_cident_section): New function.
10644 (Garbage_collection::cident_sections_): New member.
10645 (gc_process_relocs): Add references to sections whose names are C
10647 * gold.h (cident_section_start_prefix): New constant.
10648 (cident_section_stop_prefix): New constant.
10649 (is_cident): New function.
10650 * layout.cc (Layout::define_section_symbols): Replace string constants
10651 with the newly defined constants.
10652 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10654 * testsuite/Makefile.am: Add gc_orphan_section_test.
10655 * testsuite/Makefile.in: Regenerate.
10656 * testsuite/gc_orphan_section_test.cc: New file.
10657 * testsuite/gc_orphan_section_test.sh: New file.
10659 2010-01-06 Ian Lance Taylor <iant@google.com>
10662 * options.h (class General_options): Add --warn-shared-textrel.
10663 * layout.cc (Layout::finish_dynamic_section): Implement
10664 --warn-shared-textrel.
10667 * options.h (class General_options): Add --warn-multiple-gp.
10669 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10671 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10672 $(THREADSLIB) and $(LIBDL).
10673 * Makefile.in: Rebuild.
10675 2010-01-06 Ian Lance Taylor <iant@google.com>
10678 * options.cc (General_options::parse_section_start): New function.
10679 (General_options::section_start): New function.
10680 (General_options::General_options): Initialize all members.
10681 * options.h: Include <map>
10682 (class General_options): Add --section-start. Add section_starts_
10684 * layout.cc (Layout::attach_allocated_section_to_segment): If
10685 --section-start was used, set the address of the segment. Remove
10686 local sort_sections.
10687 (Layout::relaxation_loop_body): If the address of the load segment
10688 has been set by --section-start, don't use it.
10689 * output.h (Output_segment::update_flags_for_output_section): New
10691 * output.cc (Output_segment::add_output_section): Call
10692 update_flags_for_output_section.
10694 2010-01-05 Ian Lance Taylor <iant@google.com>
10697 * options.h (class General_options): Add --undefined-version.
10698 * script.cc (struct Version_expression): Add was_matched_by_symbol
10700 (Version_script_info::matched_symbol): New function.
10701 (Version_script_info::get_symbol_version_helper): Call
10703 (Version_script_info::check_unmatched_names): New function.
10704 * script.h (class Version_script_info): Update declarations.
10705 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10707 * options.h (class General_options): Use DEFINE_bool_alias for
10708 allow_multiple_definition.
10709 * resolve.cc (Symbol_table::should_override): Don't test
10710 allow_multiple_definition.
10713 * options.h (class General_options): Add --cref.
10714 * main.cc (main): Print cref table if --cref. Don't close mapfile
10715 until after printing cref table.
10716 * cref.cc: Include "symtab.h".
10717 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10718 (Cref_table_compare::operator()): New function.
10719 (Cref_inputs::gather_cref): New function.
10720 (filecol): New static const.
10721 (Cref_inputs::print_cref): New function.
10722 (Cref::print_cref): New function.
10723 * cref.h: Include <cstdio>.
10724 (class Cref): Update declarations.
10725 * mapfile.h (Mapfile::file): New function.
10726 * object.h (class Object): Define Symbols. Declare virtual
10727 do_get_global_symbols.
10728 (Object::get_global_symbols): New function.
10729 * object.cc (Input_objects::add_object): Pass object to cref_ if
10731 (Input_objects::archive_start): Likewise.
10732 (Input_objects::archive_stop): Likewise.
10733 (Input_objects::print_cref): New function.
10734 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10735 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10737 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10739 * plugin.h (class Sized_pluginobj): Update declarations.
10741 2010-01-05 Ian Lance Taylor <iant@google.com>
10743 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10744 to is_default_version. Rename insdef to insdefault.
10745 (Symbol_table::add_from_relobj): Rename def to is_default_version
10746 and local to is_forced_local.
10747 (Symbol_table::add_from_pluginobj): Likewise.
10748 (Symbol_table::add_from_dynobj): Likewise.
10749 (Symbol_table::define_special_symbol): Rename insdef to
10752 2010-01-04 Ian Lance Taylor <iant@google.com>
10755 * options.h (class General_options): Add
10756 --allow-multiple-definition and -z muldefs.
10757 * resolve.cc (Symbol_table::should_override): Don't warn about a
10758 multiple symbol definition if --allow-multiple-definition or -z
10762 * options.h (class General_options): Add --add-needed and
10763 --copy-dt-needed-entries. Tweak --as-needed help entry.
10764 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10765 error if --copy-dt-needed-entries aka --add-needed is used and
10766 would cause a change in behaviour.
10769 * options.h (class General_options): Add -G as a short version of
10770 --shared. Add no-op options -assert, -g, and -i.
10772 2010-01-04 Sriraman Tallam <tmsriram@google.com>
10774 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10775 check for .text or .gnu.linkonce.t sections.
10776 * icf.cc (Icf::find_identical_sections): Ditto.
10777 Change the detection for mangled function name within the section
10779 * icf.h (is_section_foldable_candidate): New function.
10781 2009-12-30 Ian Lance Taylor <iant@google.com>
10784 * options.h (class General_options): Permit two dashes with
10785 --retain-symbols-file.
10787 2009-12-30 Ian Lance Taylor <iant@google.com>
10790 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10791 don't put the file header and segment headers in the text
10795 * common.cc (Sort_commons::operator()): Stabilize sort when both
10797 (Symbol_table::do_allocate_commons_list): When allocating common
10798 symbols, skip a symbol which is no longer common.
10799 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10800 an object before checking its type.
10801 * testsuite/common_test_2.c: New file.
10802 * testsuite/common_test_3.c: New file.
10803 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10804 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10805 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10806 (common_test_2_pic.o, common_test_2.so): New targets.
10807 (common_test_3_pic.o, common_test_3.so): New targets.
10808 * testsuite/Makefile.in: Rebuild.
10811 * script.cc (read_input_script): If we see a new SECTIONS clause,
10812 and we have added an input section, give an error.
10813 * layout.h (class Layout): Add have_added_input_section function.
10814 Add have_added_input_section_ field.
10815 * layout.cc (Layout::Layout): Initialize
10816 have_added_input_section_.
10817 (Layout::layout): Set have_added_input_section_.
10818 (Layout::layout_eh_frame): Likewise.
10820 2009-12-30 Ian Lance Taylor <iant@google.com>
10823 * options.h (class General_options): Add --sort-common option.
10824 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10825 * common.cc (Sort_common): Add sort_order parameter to
10826 constructor. Add sort_order_ field.
10827 (Sort_commons::operator): Check sort_order_.
10828 (Symbol_table::allocate_commons): Determine the sort order.
10829 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10830 Change all callers.
10831 (Symbol_table::do_allocate_commons_list): Likewise.
10833 2009-12-30 Ian Lance Taylor <iant@google.com>
10836 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10837 symbols from this object, don't change the visibility of an
10839 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10841 2009-12-30 Ian Lance Taylor <iant@google.com>
10844 * script.h (class Version_script_info): Define Language enum.
10845 Update declarations. Define Glob, Exact, and Lookup types. Add
10846 new fields globals_, locals_, and is_finalized_.
10847 * script.cc: Various formatting fixes.
10848 (class Parser_closure): Change language_stack_ from a vector of
10849 std::string to one of Version_script_info::Language. Adjust all
10851 (class Lazy_demangler): Remove.
10852 (struct Version_expression): Change language from std::string to
10853 Version_script_info::Language.
10854 (Version_script_info::Version_script_info): New function.
10855 (Version_script_info::~Version_script_info): Don't call clear.
10856 (Version_script_info::finalize): New function.
10857 (Version_script_info::build_lookup_tables): New function.
10858 (Version_script_info::build_expression_list_lookup): New
10860 (Version_script_info::get_symbol_version_helper): Rewrite to use
10862 (Version_script_info::print_expression_list): Adjust to use
10863 Version_script_info::Language.
10864 (script_push_lex_into_version_mode): Check that the version script
10865 has not been finalized.
10866 (version_script_push_lang): Change language string to
10867 Version_script_info::Language.
10868 * options.cc (Command_line::version_script): New function.
10869 * options.h (class General_options): Add finalize_dynamic_list
10870 function. Change version_script from declaration to definition.
10871 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10872 * testsuite/version_script.map: Remove duplicate def of foo.
10873 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10874 version_script.map.
10875 * testsuite/Makefile.in: Rebuild.
10877 2009-12-30 Ian Lance Taylor <iant@google.com>
10880 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10881 if the input symbol index is 0, make the output symbol index 0.
10883 2009-12-30 Ian Lance Taylor <iant@google.com>
10886 * options.h (class General_options): Add -x/--discard-all.
10887 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10888 --discard-all. If the local symbol needs a dynamic entry, check
10889 that before handling --discard-locals.
10891 2009-12-30 Ian Lance Taylor <iant@google.com>
10894 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10896 (Output_segment::add_output_section): Don't change the flags if
10897 the type is PT_TLS.
10900 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10901 GNU hash table if they need a dynamic value. Otherwise, don't add
10902 them if they are defined in a dynamic object or are forced local.
10904 2009-12-29 Ian Lance Taylor <iant@google.com>
10907 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10908 .gnu.hash table for a 32-bit target.
10911 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10912 regular and a dynamic object only needs a dynamic symbol table
10913 entry if it is externally visible.
10916 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10917 constructor. Add global_offset_table_ field.
10918 (Target_i386::got_section): Set global_offset_table_.
10919 (Target_i386::do_finalize_sections): Set global_offset_table_
10921 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10922 in constructor. Add global_offset_table_ field.
10923 (Target_x86_64::got_section): Set global_offset_table_.
10924 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10927 * layout.cc (Layout::Layout): Initialize increase_relro_.
10928 (Layout::get_output_section): Add is_relro, is_last_relro, and
10929 is_first_non_relro parameters. Change all callers.
10930 (Layout::choose_output_section): Likewise.
10931 (Layout::add_output_section_data): Likewise.
10932 (Layout::make_output_section): Likewise.
10933 (Layout::set_segment_offsets): Clear increase_relro when using a
10935 * layout.h (class Layout): Add increase_relro method. Add
10936 increase_relro_ field. Update declarations.
10937 * output.cc (Output_section::Output_section): Initialize
10938 is_last_relro_ and is_first_non_relro_.
10939 (Output_segment::add_output_section): Group relro sections is
10940 do_sort is true. Handle is_last_relro and is_first_non_relro.
10941 (Output_segment::maximum_alignment): Remove relro handling.
10942 (Output_segment::set_section_addresses): Add increase_relro
10943 parameter. Change all callers. Add initial alignment to align
10944 relro sections on separate page. Remove old relro handling.
10945 (Output_segment::set_section_list_addresses): Remove in_relro
10946 parameter. Change all callers.
10947 (Output_segment::set_offset): Add increase parameter. Change all
10948 callers. Remove old relro handling.
10949 * output.h (class Output_section): Add new methods: is_last_relro,
10950 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10951 Add is_last_relro_ and is_first_non_relro_ fields.
10952 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10953 Create separate .got.plt section. Call increase_relro.
10954 * x86_64.cc (Target_x86_64::got_section): Likewise.
10955 * testsuite/relro_script_test.t: Add .got.plt.
10958 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10959 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10960 (Layout::finalize): Call set_dynamic_symbol_size.
10961 (Layout::set_dynamic_symbol_size): New function.
10962 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10963 set_dynamic_symbol_size.
10966 * output.h (class Output_section): Add is_entsize_zero_ field.
10967 * output.cc (Output_section::Output_section): Initialize
10969 (Output_section::set_entsize): If two different entsizes are
10970 requested, force it to zero.
10971 (Output_section::add_input_section): Set flags for .debug_str
10972 before updating section flags. Set entsize.
10973 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10974 and SHF_STRING if all input sections have those flags.
10976 2009-12-29 Rafael Espindola <espindola@google.com>
10978 * main.cc (main): Fix the sys time reporting.
10979 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10982 2009-12-29 Sriraman Tallam <tmsriram@google.com>
10984 * options.cc (General_options::parse_version): Allow -v to exit
10985 without an error if there is nothing to link.
10987 2009-12-29 Ian Lance Taylor <iant@google.com>
10989 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10990 using a version of gcc before 4.1.
10991 * configure: Rebuild.
10993 2009-12-28 Chris Demetriou <cgd@google.com>
10995 * attributes.cc (Output_attributes_section_data::do_write): Use
10996 std::vector::front rather than std::vector::data.
10998 2009-12-28 Ian Lance Taylor <iant@google.com>
11000 * symtab.h (class Symbol_table): Add enum Defined.
11001 * resolve.cc (Symbol_table::should_override): Add defined
11002 parameter. Change all callers. Test whether object is NULL
11003 before calling a method on it.
11004 (Symbol_table::report_resolve_problem): Add defined parameter.
11005 Change all callers.
11006 (Symbol_table::should_override_with_special): Likewise.
11007 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11008 parameter. Change all callers.
11009 (Symbol_table::do_define_in_output_data): Likewise.
11010 (Symbol_table::define_in_output_segment): Likewise.
11011 (Symbol_table::do_define_in_output_segment): Likewise.
11012 (Symbol_table::define_as_constant): Likewise.
11013 (Symbol_table::do_define_as_constant): Likewise.
11014 * script.h (class Symbol_assignment): Add is_defsym parameter to
11015 constructor; change all callers.
11016 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11017 parameter. Change all callers. Add is_defsym_ field.
11018 (class Parser_closure): Add parsing_defsym parameter to
11019 constructor; change all callers. Add parsing_defsym accessor
11020 function. Add parsing_defsym_ field.
11022 2009-12-28 Ian Lance Taylor <iant@google.com>
11024 * gold.cc (queue_middle_tasks): Fix formatting.
11025 * object.cc (Relobj::is_section_name_included): Likewise.
11027 2009-12-23 Ian Lance Taylor <iant@google.com>
11029 * i386.cc (Target_i386::do_calls_non_split): Recognize
11030 -fsplit-stack prologue for a function with a static chain.
11031 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11032 -fsplit-stack prologue when using %r11.
11034 2009-12-21 Sriraman Tallam <tmsriram@google.com>
11036 * options.cc (General_options::parse_version): Make -v continue and do
11037 the link like GNU ld does.
11039 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
11041 * Makefile.am (CCFILES): Add timer.cc.
11042 (HFILES): Add timer.h.
11043 * configure.ac: Check for sysconf and times.
11044 * main.cc: include timer.h.
11045 (main): Use Timer instead of get_run_time.
11048 * workqueue.cc: include timer.h.
11049 (Workqueue::find_and_run_task):
11050 Report user, sys and wall time.
11051 * Makefile.in: Regenerate.
11052 * config.in: Regenerate.
11053 * configure: Regenerate.
11055 2009-12-16 Doug Kwan <dougkwan@google.com>
11057 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11059 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11060 relaxed input sections.
11061 * output.cc (Output_section::find_relaxed_input_section): Change
11062 return type to Output_relaxed_input_section pointer. Adjust code
11063 for new type of relaxed_input_section_map_.
11064 * output.h (Output_section::find_relaxed_input_section): Change
11065 return type to Output_relaxed_input_section pointer.
11066 (Output_section::Output_relaxed_input_section_by_input_section_map):
11068 (Output_section::relaxed_input_section_map_): Change type to
11069 Output_section::Output_relaxed_input_section_by_input_section_map.
11070 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11073 2009-12-15 Ian Lance Taylor <iant@google.com>
11075 * layout.cc (Layout::create_shstrtab): Only write out after input
11076 sections if we are compressing debug sections.
11078 2009-12-15 Ian Lance Taylor <iant@google.com>
11080 * archive.cc (Archive::add_symbols): Only look up a symbol without
11081 a version if there is, in fact, a version.
11083 2009-12-14 Ian Lance Taylor <iant@google.com>
11085 Revert -Wshadow changes, all changes from:
11086 2009-12-11 Doug Kwan <dougkwan@google.com>
11087 2009-12-11 Nick Clifton <nickc@redhat.com>
11088 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11090 2009-12-11 Doug Kwan <dougkwan@google.com>
11092 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11094 * attributes.cc (Object_attribute::size): Ditto.
11095 (Attributes_section_data::size): Ditto.
11096 (Attributes_section_data::Attributes_section_data): Ditto.
11097 (Output_attributes_section_data::do_write): Ditto.
11098 * attributes.h (Object_attribute::set_type): Ditto.
11099 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11101 2009-12-11 Nick Clifton <nickc@redhat.com>
11103 * archive.cc: Fix shadowed variable warnings.
11104 * arm.cc: Likewise.
11105 * compressed_output.cc: Likewise.
11106 * compressed_output.h: Likewise.
11107 * configure: Likewise.
11108 * dwarf_reader.cc: Likewise.
11109 * dynobj.cc: Likewise.
11110 * dynobj.h: Likewise.
11111 * ehframe.cc: Likewise.
11112 * ehframe.h: Likewise.
11113 * errors.cc: Likewise.
11114 * expression.cc: Likewise.
11115 * fileread.cc: Likewise.
11116 * fileread.h: Likewise.
11117 * freebsd.h: Likewise.
11118 * i386.cc: Likewise.
11119 * icf.cc: Likewise.
11120 * incremental.h: Likewise.
11121 * layout.cc: Likewise.
11122 * layout.h: Likewise.
11123 * mapfile.cc: Likewise.
11124 * merge.cc: Likewise.
11125 * merge.h: Likewise.
11126 * object.cc: Likewise.
11127 * object.h: Likewise.
11128 * options.h: Likewise.
11129 * output.cc: Likewise.
11130 * output.h: Likewise.
11131 * parameters.cc: Likewise.
11132 * plugin.cc: Likewise.
11133 * powerpc.cc: Likewise.
11134 * reduced_debug_output.cc: Likewise.
11135 * reduced_debug_output.h: Likewise.
11136 * reloc.cc: Likewise.
11137 * reloc.h: Likewise.
11138 * resolve.cc: Likewise.
11139 * script-sections.cc: Likewise.
11140 * script.cc: Likewise.
11141 * script.h: Likewise.
11142 * sparc.cc: Likewise.
11143 * symtab.cc: Likewise.
11144 * symtab.h: Likewise.
11145 * target-select.cc: Likewise.
11146 * target-select.h: Likewise.
11147 * token.h: Likewise.
11148 * workqueue.cc: Likewise.
11149 * workqueue.h: Likewise.
11150 * x86_64.cc: Likewise.
11152 2009-12-10 Doug Kwan <dougkwan@google.com>
11154 * arm.cc (attributes.h): New include.
11155 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11156 (Arm_relobj::~Arm_relobj): Delete object pointed by
11157 attributes_section_data_.
11158 (Arm_relobj::attributes_section_data): New method definition.
11159 (Arm_relobj::attributes_section_data_): New data member declaration.
11160 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11161 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11162 attributes_section_data_.
11163 (Arm_dynobj::attributes_section_data): New method definition.
11164 (Arm_dynobj::attributes_section_data_): New data member declaration.
11165 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11166 initialization value of may_use_blx_ to false.
11167 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
11168 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11169 object attributes to compute results instead of hard-coding.
11170 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11171 Target_arm::get_secondary_compatible_arch,
11172 Target_arm::set_secondary_compatible_arch
11173 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11174 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11175 New method declarations.
11176 (Target_arm::get_aeabi_object_attribute): New method definition.
11177 (Target_arm::attributes_section_data_): New data member declaration.
11178 (read_arm_attributes_section): New template definition.
11179 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11180 (Arm_dynobj::do_read_symbols): Ditto.
11181 (Target_arm::do_finalize_sections): Merge attributes sections from
11182 input. Check for BLX use after attributes section merging.
11183 Fix __exidx_start and __exidx_end visibility. Create an
11184 .ARM.attributes section if necessary.
11185 (Target_arm::get_secondary_compatible_arch,
11186 Target_arm::set_secondary_compatible_arch,
11187 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11188 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
11189 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
11190 New method definitions.
11192 2009-12-09 Ian Lance Taylor <iant@google.com>
11194 * plugin.cc (Plugin::load): Don't cast from void* to a function
11197 2009-12-09 Ian Lance Taylor <iant@google.com>
11199 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11200 information fields.
11202 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11204 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11205 Replace two_file_shared_1.so with two_file_shared_2.so.
11206 * testsuite/Makefile.in: Regenerated.
11208 2009-12-08 Doug Kwan <dougkwan@google.com>
11210 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11211 (HFILES): Add attributes.h and int_encoding.h.
11212 * Makefile.in: Regenerate.
11213 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11214 function definitions to int_encoding.cc
11215 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11216 prototypes to int_encoding.h
11217 * reduced_debug_output.cc (int_encoding.h): New include.
11218 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11219 function definitions to int_encoding.cc
11220 (insert_into_vector, read_from_pointer): Move template definitions to
11222 * attributes.cc: New file.
11223 * attributes.h: New file.
11224 * int_encoding.cc: New file.
11225 * int_encoding.h: New file.
11227 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
11230 * incremental-dump.cc (dump_incremental_inputs): New.
11231 (main): Use dump_incremental_inputs.
11233 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11236 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11237 checking elfcpp::STT_FUNC.
11238 (Target_i386::Relocate::relocate): Likewise.
11239 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11241 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11242 symbols from shared libraries into normal FUNC symbols.
11244 * symtab.h (Symbol): Add is_func and use it.
11246 2009-12-05 Doug Kwan <dougkwan@google.com>
11248 * arm.cc (Target_arm::arm_info): Initialize new fields
11249 attributes_section and attributes_vendor.
11250 * i386.cc (Target_i386::i386_info): Same.
11251 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11252 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11253 fields attributes_section and attributes_vendor.
11254 * sparc.cc (Target_sparc::sparc_info): Same.
11255 * target.h (Target::attributes_section, Target::attributes_vendor,
11256 Target::is_attributes_section, Target::attribute_arg_type,
11257 Target::attributes_order): New method definitions.
11258 (Target::Target_info::attributes_section,
11259 Target::Target_info::attributes_vendor): New fields.
11260 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11261 virtual method definitions.
11262 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11263 attributes_section and attributes_vendor.
11264 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11266 2009-12-05 Doug Kwan <dougkwan@google.com>
11268 * arm.cc: Update comments about interworking and stub generation.
11269 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11270 considered as non-PIC.
11271 (Arm_relocate_functions::base_abs): Fix formatting.
11272 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11273 of function to use GOT entry address instead of offset.
11274 (Target_arm::Scan::global): Issue an error if a symbol would need a
11275 PLT does not get one because it is untyped. Remove code to create
11276 dynamic symbols for relative branches.
11277 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11278 takes unsigned integer instead of boolean.
11280 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11282 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11283 (two_file_test_LDADD): Likewise.
11284 (common_test_1_LDADD): Likewise.
11285 (exception_test_LDADD) Likewise.
11286 (weak_test_LDADD): Likewise.
11287 (many_sections_test_LDADD): Likewise.
11288 (initpri1_LDADD): Likewise.
11289 (script_test_1_LDADD): Likewise.
11290 (script_test_2_LDADD): Likewise.
11291 (justsyms_LDADD): Likewise.
11292 (binary_test_LDADD): Likewise.
11293 (large_LDADD): Likewise.
11294 * testsuite/Makefile.in: Regenerated.
11296 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
11298 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11299 (Symbol_table::override_with_special): Likewise.
11300 (Symbol_table::add_from_object): Likewise.
11302 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
11304 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11305 Don't set the data_offset twice.
11307 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
11309 * testsuite/Makefile.in: Regenerate.
11311 2009-12-03 Doug Kwan <dougkwan@google.com>
11313 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11314 (Target_arm::do_finalize_sections): Add parameter for symbol table
11315 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11316 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11317 parameter for symbol table pointer.
11318 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11319 an additional parameter for a pointer to symbol table.
11320 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11321 parameter for a symbol table pointer.
11322 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11323 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11325 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11326 parameter for a symbol table pointer.
11328 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
11330 * incremental.cc (Incremental_inputs_header)
11331 (Incremental_inputs_header_write, Incremental_inputs_entry)
11332 (Incremental_inputs_entry_write): Move ...
11333 * incremental.h (Incremental_inputs_header)
11334 (Incremental_inputs_header_write, Incremental_inputs_entry)
11335 (Incremental_inputs_entry_write): here.
11337 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11339 * incremental.cc (make_sized_incremental_binary): Set the target.
11340 Error if it is incompatible.
11341 * output.h (Output_file): Add filename method.
11343 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11345 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11346 from the get_* methods.
11348 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11350 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11351 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11352 Write 0 for the data_offset of scripts.
11354 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11356 * testsuite/Makefile.am: Add the incremental_test.sh test.
11357 * testsuite/incremental_test.sh: New.
11358 * testsuite/incremental_test_1.c: New.
11359 * testsuite/incremental_test_2.c: New.
11361 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
11363 * incremental-dump.cc (main): Fix typos.
11365 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
11368 * incremental-dump.cc (main): Use llu to print 64 bit values.
11370 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11371 H.J. Lu <hongjiu.lu@intel.com>
11373 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11375 (incremental_dump_LDADD): Likewise.
11376 * Makefile.in: Regenerated.
11378 2009-11-25 Doug Kwan <dougkwan@google.com>
11382 2009-11-25 Doug Kwan <dougkwan@google.com>
11384 * arm.cc (Target_arm::Target_arm): Move method definition
11385 outside of class definition. Add code to handle
11386 --target1-rel, --target1-abs and --target2= options.
11387 (Target_arm::get_reloc_reloc_type): Change method to be
11388 non-static and const.
11389 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11390 New data member declaration.
11391 (Target_arm::Scan::local, Target_arm::Scan::global,
11392 Target_arm::Relocate::relocate,
11393 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11394 Adjust call to Target_arm::get_real_reloc_type.
11395 (Target_arm::get_real_reloc_type): Use command line options
11396 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11397 * options.h (--target1-rel, --target1-abs, --target2): New
11400 2009-11-25 Doug Kwan <dougkwan@google.com>
11402 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11403 class definition. Add code to handle --target1-rel, --target1-abs
11404 and --target2= options.
11405 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11407 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11408 member declaration.
11409 (Target_arm::Scan::local, Target_arm::Scan::global,
11410 Target_arm::Relocate::relocate,
11411 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11412 call to Target_arm::get_real_reloc_type.
11413 (Target_arm::get_real_reloc_type): Use command line options to
11414 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11415 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11418 2009-11-25 Doug Kwan <dougkwan@google.com>
11420 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11421 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11422 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11424 (Arm_relocate_functions::thm_call): Replace body with a call to
11425 Arm_relocate_functions::thumb_branch_common.
11426 (Arm_relocate_functions::thm_jump24,
11427 Arm_relocate_functions::thm_xpc22): New method definitions.
11428 (Arm_relocate_functions::thumb_branch_common): New method definition.
11429 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11431 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11432 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11434 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11436 * Makefile.am: Build incremental-dump
11437 * Makefile.in: Regenerate.
11438 * incremental-dump.cc: New.
11439 * incremental.cc (Incremental_inputs_header_data,
11440 Incremental_inputs_entry_data): Move to incremental.h
11441 * incremental.h: (Incremental_inputs_header_data,
11442 Incremental_inputs_entry_data): Move from incremental.cc
11444 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11446 * incremental.cc (Incremental_inputs_header,
11447 Incremental_inputs_header_write, Incremental_inputs_entry,
11448 Incremental_inputs_entry_write): Add a typedef with the data type.
11450 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11452 * incremental.cc (Incremental_inputs_header,
11453 Incremental_inputs_header_write, Incremental_inputs_entry,
11454 Incremental_inputs_entry_write): Update comment about which
11455 type has the filed descriptions.
11457 2009-11-15 Doug Kwan <dougkwan@google.com>
11459 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11460 (Arm_relocate_functions::arm_branch_common): Change method defintion
11461 in class definition to a method declaration and update list of formal
11463 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11464 Arm_relocation_functions::jump24): Adjust call to
11465 Arm_relocate_functions::arm_branch_common. Update list of formal
11467 (Arm_relocate_functions::xpc25): New method definition.
11468 (Arm_relocate_functions::arm_branch_common): Move method defintion
11469 out from class definition. Use stubs for mode-switching and extending
11471 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11472 specially. Change code to enable use of stubs in ARM branches.
11474 2009-11-10 Doug Kwan <dougkwan@google.com>
11476 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11477 in method declaration.
11478 (Target_arm::relocate_stub): New method declaration.
11479 (Target_arm::default_target): Change to return a pointer instead of
11481 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11482 Target_arm::default_target.
11483 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11485 (Target_arm::relocate_section): Adjust view.
11486 (Target_arm::relocate_stub): New method definition.
11488 2009-11-10 Doug Kwan <dougkwan@google.com>
11490 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11492 * incremental.cc (open_incremental_binary): Initialized local
11493 variables to avoid warnings.
11494 * object.cc (make_elf_object): Ditto.
11495 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11498 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11501 * testsuite/plugin_test.c: Include "config.h".
11503 2009-11-09 Doug Kwan <dougkwan@google.com>
11505 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11506 (arm_symbol_value): Remove.
11507 (Arm_relocate_functions::arm_branch_common,
11508 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11509 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11510 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11511 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11512 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11513 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11514 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11515 Arm_relocate_functions::thm_mobw_abs_nc,
11516 Arm_relocate_functions::thm_mov_abs,
11517 Arm_relocate_functions::movw_prel_nc,
11518 Arm_relocate_functions::thm_movt_abs,
11519 Arm_relocate_functions::movt_prel,
11520 Arm_relocate_functions::thm_movw_prel_nc,
11521 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11522 (Target_arm::Relocate::relocate): Only decompose address into two
11523 parts if relocation type uses the thumb-bit and pass the actual
11524 bit instead of a flag indicating that the thumb-bit is used. Adjust
11525 calls to methods in Arm_relocate_functions for this change.
11527 2009-11-08 Ian Lance Taylor <iant@google.com>
11530 * reloc.cc: Instantiate
11531 Sized_relobj::initialize_input_to_output_maps and
11532 Sized_relobj:free_input_to_output_maps.
11534 2009-11-06 Ian Lance Taylor <iant@google.com>
11537 * defstd.cc (in_segment): Set only_if_ref true for "end".
11539 2009-11-06 Doug Kwan <dougkwan@google.com>
11541 * arm.cc (class Reloc_stub): Correct a comment.
11542 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11543 (Target_arm::scan_section_for_stubs): New method declaration.
11544 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11545 Change methods from private to protected.
11546 (Target_arm::do_may_relax): New method definition.
11547 (Target_arm::do_relax, Target_arm::group_sections,
11548 Target_arm::scan_reloc_for_stub,
11549 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11550 (Target_arm::arm_input_section_map_): New data member declaration.
11551 (Target_arm::scan_reloc_for_stub,
11552 Target_arm::scan_reloc_section_for_stubs,
11553 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11554 Target_arm::do_relax): New method definitions.
11556 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11558 * configure.ac: Check for (struct stat)::st_mtim
11559 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11560 * config.in: Regenerate.
11561 * configure: Regenerate.
11563 2009-11-05 Ian Lance Taylor <iant@google.com>
11566 * output.cc (Output_segment::add_output_section): Add missing
11569 2009-11-04 Ian Lance Taylor <iant@google.com>
11572 * object.h (class Object): Add is_needed and set_is_needed
11573 methods. Add is_needed_ field. Make bool fields into bitfields.
11574 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11575 defined in a dynamic object and referenced by a regular object,
11576 set is_needed for the dynamic object.
11577 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11578 if the file is marked with as_needed and it is not needed.
11580 2009-11-04 Ian Lance Taylor <iant@google.com>
11583 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11584 tags if data is discarded by linker script.
11585 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11586 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11587 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11588 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11590 2009-11-04 Ian Lance Taylor <iant@google.com>
11592 * layout.cc (Layout::get_output_section): Add is_interp and
11593 is_dynamic_linker_section parameters. Change all callers.
11594 (Layout::choose_output_section): Likewise.
11595 (Layout::make_output_section): Likewise.
11596 (Layout::add_output_section_data): Add is_dynamic_linker_section
11597 parameter. Change all callers.
11598 * layout.h (class Layout): Update declarations.
11599 * output.h (class Output_section): Add is_interp, set_is_interp,
11600 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11601 Add is_interp_, is_dynamic_linker_section_ fields. Change
11602 generate_code_fills_at_write_ to a bitfield.
11603 * output.cc (Output_section::Output_sections): Initialize new
11605 (Output_segment::add_output_section): Add do_sort parameter.
11606 Change all callers.
11608 2009-11-03 Ian Lance Taylor <iant@google.com>
11611 * options.h (class General_options): Add --warn-common.
11612 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11613 merging two common symbols.
11614 (Symbol_table::should_override): Handle --warn-common when merging
11615 a common symbol with a defined symbol. Use report_resolve_problem
11616 for multiple definitions.
11617 (Symbol_table::report_resolve_problem): New function.
11618 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11620 2009-11-03 Doug Kwan <dougkwan@google.com>
11622 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11624 (Target_arm::stub_factory): New method definition.
11625 (Target_arm::new_arm_input_section,
11626 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11627 Target_arm::reloc_uses_thumb_bit): New method declarations.
11628 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
11629 New type definitions.
11630 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11631 member declarations.
11632 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11633 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11634 New method definitions.
11636 2009-11-03 Ian Lance Taylor <iant@google.com>
11638 * options.h (class General_options): Add --warn_constructors.
11640 2009-11-03 Ian Lance Taylor <iant@google.com>
11643 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11644 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11646 2009-11-03 Ian Lance Taylor <iant@google.com>
11649 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11650 --msgid-bugs-address.
11651 (install-pdf): New target.
11652 (install-data_yes): Look up one directory to find mkinstalldirs.
11654 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11656 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11659 2009-10-30 Doug Kwan <dougkwan@google.com>
11661 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11663 2009-10-30 Doug Kwan <dougkwan@google.com>
11665 * arm.cc (Stub_addend_reader): New struct template definition
11666 and partial specializations.
11667 (Stub_addend_reader::operator()): New method definition for a
11668 partially specialized template.
11670 2009-10-30 Doug Kwan <dougkwan@google.com>
11672 * arm.cc (Arm_relobj::processor_specific_flags): New method
11674 (Arm_relobj::do_read_symbols): New method declaration.
11675 (Arm_relobj::processor_specific_flags_): New data member declaration.
11676 (Arm_dynobj): New class definition.
11677 (Target_arm::do_finalize_sections): Add input_objects parameter.
11678 (Target_arm::do_adjust_elf_header): New method declaration.
11679 (Target_arm::are_eabi_versions_compatible,
11680 (Target_arm::merge_processor_specific_flags): New method declaration.
11681 (Target_arm::do_make_elf_object): New overloaded method definitions
11683 (Arm_relobj::do_read_symbols): New method definition.
11684 (Arm_dynobj::do_read_symbols): Ditto.
11685 (Target_arm::do_finalize_sections): Add input_objects parameters.
11686 Merge processor-specific flags from all input objects.
11687 (Target_arm::are_eabi_versions_compatible,
11688 Target_arm::merge_processor_specific_flags,
11689 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11690 New method definitions.
11691 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11692 Input_objects pointer type parameter.
11693 * layout.cc (Layout::finalize): Pass input objects to target's.
11694 finalize_sections function.
11695 * output.cc (Output_file_header::do_sized_write): Set ELF file
11696 header's processor-specific flags.
11697 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11698 Input_objects pointer type parameter.
11699 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11700 * target.h (Input_objects): New forward class declaration.
11701 (Target::processor_specific_flags,
11702 Target::are_processor_specific_flags_sect): New method definitions.
11703 (Target::finalize_sections): Add input_objects parameter.
11704 (Target::Target): Initialize processor_specific_flags_ and
11705 are_processor_specific_flags_set_.
11706 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11708 (Target::set_processor_specific_flags): New method definition.
11709 (Target::processor_specific_flags_,
11710 Target::are_processor_specific_flags_set_): New data member
11712 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11713 Input_objects pointer type parameter.
11715 2009-10-30 Doug Kwan <dougkwan@google.com>
11717 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11719 2009-10-28 Ian Lance Taylor <iant@google.com>
11721 * object.h (class Relobj): Drop options parameter from
11722 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11723 do_scan_relocs, do_relocate. Change all callers.
11724 (class Sized_relobj): Drop options parameters from
11725 do_gc_process_relocs, do_scan_relocs, do_relocate,
11726 do_relocate_sections, relocate_sections, emit_relocs_scan,
11727 emit_relocs_scan_reltype. Change all callers.
11728 (struct Relocate_info): Remove options field and all references to
11730 * reloc.h (class Read_relocs): Remove options constructor
11731 parameter and options_ field. Change all callers.
11732 (class Gc_process_relocs, class Scan_relocs): Likewise.
11733 (class Relocate_task): Likewise.
11734 * target-reloc.h (scan_relocs): Remove options parameter. Change
11736 (scan_relocatable_relocs): Likewise.
11737 * target.h (class Sized_target): Remove options parameter from
11738 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11740 * gc.h (gc_process_relocs): Remove options parameter. Change all
11742 * arm.cc: Update functions to remove options parameters.
11743 * i386.cc: Likewise.
11744 * powerpc.cc: Likewise.
11745 * sparc.cc: Likewise.
11746 * x86_64.cc: Likewise.
11747 * testsuite/testfile.cc: Likewise.
11749 2009-10-28 Doug Kwan <dougkwan@google.com>
11751 * arm.cc (Arm_relobj): New class definition.
11752 (Arm_relobj::scan_sections_for_stubs,
11753 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11754 New method definitions.
11756 2009-10-28 Cary Coutant <ccoutant@google.com>
11758 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11759 (Plugin::cleanup_done_): New member.
11760 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11761 (Plugin_manager::cleanup_done_): Remove.
11762 (Plugin_manager::add_input_file): Edit error message.
11763 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11764 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11766 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11768 * fileread.cc: (File_read::View::~View): Use the new
11769 data_ownership_ filed.
11770 (File_read::~File_read): Dispose the new whole_file_view_.
11771 (File_read::open): Mmap the whole file if needed.
11772 (File_read::open): Use whole_file_view_ instead of contents_.
11773 (File_read::find_view): Use whole_file_view_ if applicable.
11774 (File_read::do_read): Use whole_file_view_ instead of contents_.
11775 (File_read::make_view): Use whole_file_view_ instead of contents_,
11776 update File_read::View::View call.
11777 (File_read::find_or_make_view): Update File_read::View::View
11779 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11781 (File_read::View::Data_ownership): New enum.
11782 (File_read::View::View): Replace bool mapped_ with Data_ownership
11784 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11785 (File_read::View::data_ownership_): New field.
11786 (File_read::contents_): Remove (replaced by whole_file_view_).
11787 (File_read::whole_file_view_): New field.
11788 * options.h (class General_options): Add --keep-files-mapped.
11790 2009-10-27 Cary Coutant <ccoutant@google.com>
11792 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11793 * testsuite/Makefile.am (plugin_test_5): New test case.
11794 * testsuite/Makefile.in: Regenerate.
11796 2009-10-25 Doug Kwan <dougkwan@google.com>
11798 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11799 from private to protected to allow access by child class.
11800 (Sized_relobj::do_relocate_sections): New method declaration.
11801 (Sized_relobj::relocate_sections): Virtualize.
11802 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
11803 Sized_relobj::relocate_sections. Instantiate template explicitly
11804 for different target sizes and endianity.
11806 2009-10-24 Doug Kwan <dougkwan@google.com>
11808 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11809 (Arm_input_section::as_arm_input_section): New method.
11810 (Arm_output_section): New class definition.
11811 (Arm_output_section::create_stub_group,
11812 Arm_output_section::group_sections): New method definitions.
11814 2009-10-22 Doug Kwan <dougkwan@google.com>
11816 * arm.cc (Arm_input_section): New class definition.
11817 (Arm_input_section::init, Arm_input_section:do_write,
11818 Arm_input_section::set_final_data_size,
11819 Arm_input_section::do_reset_address_and_file_offset): New method
11822 2009-10-21 Doug Kwan <dougkwan@google.com>
11824 * arm.cc (Stub_table, Arm_input_section): New forward class
11826 (Stub_table): New class defintion.
11827 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11828 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11829 New method definition.
11831 2009-10-21 Doug Kwan <dougkwan@google.com>
11833 * arm.cc: Update copyright comments.
11834 (Target_arm): New forward class template declaration.
11835 (Arm_address): New type.
11836 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11837 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11838 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11840 (Insn_template): Same.
11841 (DEF_STUBS): New macro.
11842 (Stub_type): New enum type.
11843 (Stub_template): New class definition.
11845 (Reloc_stub): Same.
11846 (Stub_factory): Same.
11847 (Target_arm::Target_arm): Initialize may_use_blx_ and
11848 should_force_pic_veneer_.
11849 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11850 Target_arm::should_force_pic_veneer,
11851 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11852 Target_arm::using_thumb_only, Target_arm:;default_target): New
11854 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11855 New data member declarations.
11856 (Insn_template::size, Insn_template::alignment): New method defintions.
11857 (Stub_template::Stub_template): New method definition.
11858 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11859 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11860 (Stub_factory::Stub_factory): New method definition.
11861 * gold.h (string_hash): New template.
11862 * output.h (Input_section_specifier::hash_value): Use
11864 (Input_section_specifier::string_hash): Remove.
11865 * stringpool.cc (Stringpool_template::string_hash): Use
11868 2009-10-20 Doug Kwan <dougkwan@google.com>
11870 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11871 symbols of relaxed input sections.
11872 * output.h (Output_section::find_relaxed_input_section): Make
11875 2009-10-16 Doug Kwan <dougkwan@google.com>
11877 * dynobj.cc (Versions::Versions): Initialize version_script_.
11878 Only insert base version symbol definition for a shared object
11879 if version script defines any version versions.
11880 (Versions::define_base_version): New method definition.
11881 (Versions::add_def): Check that base version is not needed.
11882 (Versions::add_need): Define base version lazily.
11883 * dynobj.h (Versions::define_base_version): New method declaration.
11884 (Versions::needs_base_version_): New data member declaration.
11885 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11886 (check_DATA): Add no_version_test.stdout.
11887 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11889 * testsuite/Makefile.in: Regenerate.
11890 * testsuite/no_version_test.c: New file.
11891 * testsuite/no_version_test.sh: Ditto.
11893 2009-10-16 Doug Kwan <dougkwan@google.com>
11895 * expression.cc (class Segment_start_expression): New class definition.
11896 (Segment_start_expression::value): New method definition.
11897 (script_exp_function_segment_start): Return a new
11898 Segment_start_expression.
11899 * gold/script-c.h (script_saw_segment_start_expression): New function
11901 * script-sections.cc (Script_sections::Script_sections): Initialize
11902 SAW_SEGMENT_START_EXPRESSION_ to false.
11903 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11904 and -Tbbs options to specify section addresses if given in
11905 command line and no SEGMENT_START expression is seen in a script.
11906 * script-sections.h (Script_sections::saw_segment_start_expression,
11907 Script_sections::set_saw_segment_start_expression): New method
11909 (Script_sections::saw_segment_start_expression_): New data member
11911 * script.cc (script_saw_segment_start_expression): New function.
11912 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11913 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11914 script_test_7.sh and script_test_8.sh.
11915 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11916 script_test_8.stdout.
11917 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11918 (script_test_6, script_test_6.stdout, script_test_7,
11919 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11920 * Makefile.in: Regenerate.
11921 * testsuite/script_test_6.sh: New file.
11922 * testsuite/script_test_6.t: Same.
11923 * testsuite/script_test_7.sh: Same.
11924 * testsuite/script_test_7.t: Same.
11925 * testsuite/script_test_8.sh: Same.
11927 2009-10-16 Doug Kwan <dougkwan@google.com>
11929 * output.cc (Output_segment::set_section_list_address): Cast
11930 expressions to unsigned long long type to avoid format warnings.
11932 2009-10-15 Ian Lance Taylor <iant@google.com>
11934 * script.cc (Script_options::add_symbol_assignment): Always add a
11935 dot assignment to script_sections_.
11936 * script-sections.cc (Script_sections::add_dot_assignment):
11937 Initialize if necessary.
11939 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11940 program headers with no load segment if there is a linker script.
11942 * layout.cc (Layout::set_segment_offsets): Align the file offset
11943 to the segment aligment for -N or -n with no load segment.
11944 * output.cc (Output_segment::add_output_section): Don't crash if
11945 the first section is a TLS section.
11946 (Output_segment::set_section_list_addresses): Print an error
11947 message if the address moves backward in a linker script.
11948 * script-sections.cc
11949 (Output_section_element_input::set_section_addresses): Don't
11950 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11951 (Orphan_output_section::set_section_addresses): Likewise.
11953 2009-10-15 Doug Kwan <dougkwan@google.com>
11955 * layout.cc (Layout::finish_dynamic_section): Generate tags
11956 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11957 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11958 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11960 2009-10-14 Ian Lance Taylor <iant@google.com>
11962 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11964 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11965 data_shdr fields of relinfo.
11966 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11967 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11968 R_386_TLS_LDO_32, adjust based on section flags.
11969 (Target_i386::Relocate::fix_up_ldo): Remove.
11971 2009-10-13 Ian Lance Taylor <iant@google.com>
11973 Add support for -pie.
11974 * options.h (class General_options): Add -pie and
11976 (General_options::output_is_position_independent): Test -pie.
11977 (General_options::output_is_executable): Return true if not shared
11978 and not relocatable.
11979 (General_options::output_is_pie): Remove.
11980 * options.cc (General_options::finalize): Reject incompatible uses
11982 * gold.cc (queue_middle_tasks): A -pie link is not static.
11983 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11984 * symtab.cc (Symbol::final_value_is_known): Return false if
11985 output_is_position_independent.
11986 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11987 output_is_position_independent.
11988 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11989 output_is_position_independent.
11990 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11991 output_is_position_independent.
11992 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11994 (basic_pie_test.o, basic_pie_test): New targets.
11995 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11996 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11997 (two_file_pie_test): New target.
11998 * testsuite/Makefile.in: Rebuild.
11999 * README: Remove note saying that -pie is not supported.
12001 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12003 * options.h (class General_options): Add -init and -fini.
12004 * layout.cc (Layout::finish_dynamic_section): Emit
12005 given init and fini functions.
12007 2009-10-13 Sriraman Tallam <tmsriram@google.com>
12009 * gc.h (gc_process_relocs): Check if icf is enabled using new
12011 * gold.cc (queue_initial_tasks): Likewise.
12012 (queue_middle_tasks): Likewise.
12013 * object.cc (do_layout): Likewise.
12014 * symtab.cc (is_section_folded): Likewise.
12015 * main.cc (main): Likewise.
12016 * reloc.cc (Read_relocs::run): Likewise.
12017 (Sized_relobj::do_scan_relocs): Likewise.
12018 * icf.cc (is_function_ctor_or_dtor): New function.
12019 (Icf::find_identical_sections): Check if function is ctor or dtor when
12020 safe icf is chosen.
12021 * options.h (General_options::icf): Change option to be an enum.
12022 (Icf_status): New enum.
12023 (icf_enabled): New method.
12024 (icf_safe_folding): New method.
12025 (set_icf_status): New method.
12026 (icf_status_): New variable.
12027 * (options.cc) (General_options::finalize): Set icf_status_.
12028 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12029 icf_test and icf_keep_unique_test to use the --icf enum flag.
12030 * testsuite/icf_safe_test.sh: New file.
12031 * testsuite/icf_safe_test.cc: New file.
12033 2009-10-12 Sriraman Tallam <tmsriram@google.com>
12035 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12036 includes to gc.h and icf.h.
12037 * arm.cc: Include gc.h.
12038 * gold.cc: Likewise.
12039 * i386.cc: Likewise.
12040 * powerpc.cc: Likewise.
12041 * sparc.cc: Likewise.
12042 * x86_64.cc: Likewise.
12043 * gc.h: Include icf.h.
12045 2009-10-11 Ian Lance Taylor <iant@google.com>
12047 * plugin.cc: Include "gold.h" before other header files.
12049 2009-10-10 Chris Demetriou <cgd@google.com>
12051 * options.h (Input_file_argument::Input_file_type): New enum.
12052 (Input_file_argument::is_lib_): Replace with...
12053 (Input_file_argument::type_): New member.
12054 (Input_file_argument::Input_file_argument): Take Input_file_type
12055 'type' rather than boolean 'is_lib' as second argument.
12056 (Input_file_argument::is_lib): Use type_.
12057 (Input_file_argument::is_searched_file): New function.
12058 (Input_file_argument::may_need_search): Handle is_searched_file.
12059 * options.cc (General_options::parse_library): Support -l:filename.
12060 (General_options::parse_just_symbols): Update for Input_file_argument
12062 (Command_line::process): Likewise.
12063 * archive.cc (Archive::get_file_and_offset): Likewise.
12064 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12065 * script.cc (read_script_file, script_add_file): Likewise.
12066 * fileread.cc (Input_file::Input_file): Likewise.
12067 (Input_file::will_search_for): Handle is_searched_file.
12068 (Input_file::open): Likewise.
12069 * readsyms.cc (Read_symbols::get_name): Likewise.
12070 * testsuite/Makefile.am (searched_file_test): New test.
12071 * testsuite/Makefile.in: Regenerate.
12072 * testsuite/searched_file_test.cc: New file.
12073 * testsuite/searched_file_test_lib.cc: New file.
12075 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12076 Ian Lance Taylor <iant@google.com>
12078 * descriptor.cc: Include <cstdio> and "binary-io.h".
12079 (Descriptors::open): Open the files in binary mode always.
12080 * script.cc (Lex::get_token): Treat \r as whitespace.
12082 2009-10-09 Ian Lance Taylor <iant@google.com>
12084 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12086 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12087 Ian Lance Taylor <iant@google.com>
12089 * configure.ac: Check for readv function also.
12090 * fileread.cc (readv): Define if not HAVE_READV.
12091 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12093 * config.in: Regenerate.
12094 * configure: Regenerate.
12096 2009-10-09 Doug Kwan <dougkwan@google.com>
12098 * layout.cc (Layout::make_output_section): Call target hook to make
12099 ordinary output section.
12100 (Layout::finalize): Adjust parameter list of call the
12101 Target::may_relax().
12102 * layout.h (class Layout::section_list): New method.
12103 * merge.h (Output_merge_base::entsize): Change visibility to public.
12104 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12106 (Output_merge_string::do_is_string): New method.
12107 * object.cc (Sized_relobj::do_setup): renamed from
12108 Sized_relobj::set_up.
12109 * object.h (Sized_relobj::adjust_shndx,
12110 Sized_relobj::initializ_input_to_output_maps,
12111 Sized_relobj::free_input_to_output_maps): Change visibilities to
12113 (Sized_relobj::setup): Virtualize.
12114 (Sized_relobj::do_setup): New method declaration.
12115 (Sized_relobj::invalidate_section_offset,
12116 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12117 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12118 * options.cc (parse_int): New function.
12119 * options.h (parse_int): New declaration.
12120 (DEFINE_int): New macro.
12121 (stub_group_size): New option.
12122 * output.cc (Output_section::Output_section): Initialize memebers
12123 merge_section_map_, merge_section_by_properties_map_,
12124 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12125 (Output_section::add_input_section): Handled deferred code-fill
12126 generation and remove an old comment.
12127 (Output_section::add_relaxed_input_section): New method definition.
12128 (Output_section::add_merge_input_section): Use merge section by
12129 properties map to speed to search. Update merge section maps
12131 (Output_section::build_relaxation_map): New method definition.
12132 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12134 (Output_section::relax_input_section): Renamed to
12135 Output_section::convert_input_sections_to_relaxed_sections and change
12136 interface to take a vector of pointers to relaxed sections.
12137 (Output_section::find_merge_section,
12138 Output_section::find_relaxed_input_section): New method definitions.
12139 (Output_section::is_input_address_mapped,
12140 Output_section::output_offset, Output_section::output_address):
12141 Use output section data maps to speed up searching.
12142 (Output_section::find_starting_output_address): Add comments.
12143 (Output_section::do_write,
12144 Output_section::write_to_postprocessing_buffer): Do code-fill
12145 generation as appropriate.
12146 (Output_section::get_input_sections): Invalidate relaxed input section
12148 (Output_section::restore_states): Adjust type of checkpoint .
12149 Invalidate relaxed input section map.
12150 * output.h (Output_merge_base): New class declaration.
12151 (Input_section_specifier): New class defintion.
12152 (class Output_relaxed_input_section) Change base class to
12153 Output_section_data_build.
12154 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12155 base class initializer.
12156 (Output_section::add_relaxed_input_section): New method declaration.
12157 (Output_section::Input_section): Change visibility to protected.
12158 (Output_section::Input_section::relobj,
12159 Output_section::Input_section::shndx): Handle relaxed input sections.
12160 Output_section::input_sections) Change visibility to protected. Also
12161 define overload to return a non-const pointer.
12162 (Output_section::Merge_section_properties): New class defintion.
12163 (Output_section::Merge_section_by_properties_map,
12164 Output_section::Output_section_data_by_input_section_map,
12165 Output_section::Relaxation_map): New types.
12166 (Output_section::relax_input_section): Rename method to
12167 Output_section::convert_input_sections_to_relaxed_sections and change
12168 interface to take a vector of relaxed section pointers.
12169 (Output_section::find_merge_section,
12170 Output_section::find_relaxed_input_section,
12171 Output_section::build_relaxation_map,
12172 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12173 New method declarations.
12174 (Output_section::merge_section_map_
12175 Output_section::merge_section_by_properties_map_,
12176 Output_section::relaxed_input_section_map_,
12177 Output_section::is_relaxed_input_section_map_valid_,
12178 Output_section::generate_code_fills_at_write_): New data members.
12179 * script-sections.cc
12180 (Output_section_element_input::set_section_addresses): Call
12181 current_data_size and addralign methods of relaxed input sections.
12182 (Orphan_output_section::set_section_addresses): Call current_data_size
12183 and addralign methods of relaxed input sections.
12184 * symtab.cc (Symbol_table::compute_final_value): Extract template
12185 from the body of Symbol_table::sized_finalize_symbol.
12186 (Symbol_table::sized_finalized_symbol): Call
12187 Symbol_table::compute_final_value.
12188 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12189 (Symbol_table::compute_final_value): New templated method declaration.
12190 * target.cc (Target::do_make_output_section): New method defintion.
12191 * target.h (Target::make_output_section): New method declaration.
12192 (Target::relax): Add more parameters for input objects, symbol table
12193 and layout. Adjust call to do_relax.
12194 (Target::do_make_output_section): New method declaration.
12195 (Target::do_relax): Add parameters for input objects, symbol table
12198 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12200 * pread.c: Include stdio.h.
12202 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12204 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12207 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12209 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12210 Change read_shndx type to unsigned int.
12211 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12213 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12214 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12215 Change read_shndx type to unsigned int.
12216 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12218 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12219 * layout.cc (Layout::create_symtab_sections): Cast the result of
12220 local_symcount * symsize to off_t in the gold_assert.
12222 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12224 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12225 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12227 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12228 (Arm_relocate_functions::thm_abs5): New function.
12229 (Arm_relocate_functions::abs12): New function.
12230 (Arm_relocate_functions::abs16): New function.
12231 (Arm_relocate_functions::base_abs): New function.
12232 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12233 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12234 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12236 (Scan::global): Likewise.
12237 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12238 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12239 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12240 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12243 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12245 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12246 (Arm_relocate_functions::movt_prel): New function.
12247 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12248 (Arm_relocate_functions::thm_movt_prel): New function.
12249 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12250 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12251 (Scan::global, Relocate::relocate): Likewise.
12252 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12254 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12256 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12257 Incremental_checker.
12258 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12260 (class Incremental_inputs_header): New class.
12261 (Incremental_inputs_header_writer): Edit comment.
12262 (Incremental_inputs_entry): New class.
12263 (Incremental_inputs_entry_writer): Edit comment.
12264 (Sized_incremental_binary::do_find_incremental_inputs_section):
12265 Add *strtab_shndx parameter, fill it.
12266 (Sized_incremental_binary::do_check_inputs): New method.
12267 (Incremental_checker::can_incrementally_link_output_file): Use
12268 Sized_incremental_binary::check_inputs.
12269 (Incremental_inputs::report_command_line): Save command line in
12272 (Incremental_binary::find_incremental_inputs_section): New
12274 (Incremental_binary::do_find_incremental_inputs_section): Add
12275 strtab_shndx parameter.
12276 (Incremental_binary::do_check_inputs): New pure virtual method.
12277 (Sized_incremental_binary::do_check_inputs): Declare.
12278 (Incremental_checker::Incremental_checker): Add incremental_inputs
12279 parameter, use it to initialize incremental_inputs_.
12280 (Incremental_checker::incremental_inputs_): New field.
12281 (Incremental_checker::command_line): New method.
12282 (Incremental_checker::inputs): New method.
12283 (Incremental_checker::command_line_): New field.
12285 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12287 * incremental.cc: Include <cstdarg> and "target-select.h".
12288 (vexplain_no_incremental): New function.
12289 (explain_no_incremental): New function.
12290 (Incremental_binary::error): New method.
12291 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12293 (make_sized_incremental_binary): New function.
12294 (open_incremental_binary): New function.
12295 (can_incrementally_link_file): Add checks if output is ELF and has
12297 * incremental.h: Include "elfcpp_file.h" and "output.h".
12298 (Incremental_binary): New class.
12299 (Sized_incremental_binary): New class.
12300 (open_incremental_binary): Declare.
12301 * object.cc (is_elf_object): Use
12302 elfcpp::Elf_recognizer::is_elf_file.
12303 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12304 * output.h (Output_file::filesize): New method.
12306 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12308 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12310 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12311 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12313 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12315 (Arm_relocate_functions::movw_abs_nc): New function.
12316 (Arm_relocate_functions::movt_abs): New function.
12317 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12318 (Arm_relocate_functions::thm_movt_abs): New function.
12319 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12320 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12321 (Scan::global): Likewise.
12322 (Relocate::relocate): Likewise.
12323 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12325 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12327 * arm.cc (Arm_relocate_functions::got_prel) New function.
12328 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12329 (Relocate::relocate): Likewise.
12330 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12332 2009-10-06 Ian Lance Taylor <iant@google.com>
12334 * options.h (class General_options): Define
12335 split_stack_adjust_size parameter.
12336 * object.h (class Object): Add uses_split_stack_ and
12337 has_no_split_stack_ fields. Add uses_split_stack and
12338 has_no_split_stack accessor functions. Declare
12339 handle_split_stack_section.
12340 (class Reloc_symbol_changes): Define.
12341 (class Sized_relobj): Define Function_offsets. Declare
12342 split_stack_adjust, split_stack_adjust_reltype, and
12344 * object.cc (Object::handle_split_stack_section): New function.
12345 (Sized_relobj::do_layout): Call handle_split_stack_section.
12346 * dynobj.cc (Sized_dynobj::do_layout): Call
12347 handle_split_stack_section.
12348 * reloc.cc (Sized_relobj::relocate_sections): Call
12349 split_stack_adjust for executable sections in split_stack
12350 objects. Pass reloc_map to relocate_section.
12351 (Sized_relobj::split_stack_adjust): New function.
12352 (Sized_relobj::split_stack_adjust_reltype): New function.
12353 (Sized_relobj::find_functions): New function.
12354 * target-reloc.h: Include "object.h".
12355 (relocate_section): Add reloc_symbol_changes parameter. Change
12357 * target.h (class Target): Add calls_non_split method. Declare
12358 do_calls_non_split virtual method. Declare match_view and
12360 * target.cc: Include "elfcpp.h".
12361 (Target::do_calls_non_split): New function.
12362 (Target::match_view): New function.
12363 (Target::set_view_to_nop): New function.
12364 * gold.cc (queue_middle_tasks): Give an error if mixing
12365 split-stack and non-split-stack objects with -r.
12366 * i386.cc (Target_i386::relocate_section): Add
12367 reloc_symbol_changes parameter.
12368 (Target_i386::do_calls_non_split): New function.
12369 * x86_64.cc (Target_x86_64::relocate_section): Add
12370 reloc_symbol_changes parameter.
12371 (Target_x86_64::do_calls_non_split): New function.
12372 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12374 * powerpc.cc (Target_powerpc::relocate_section): Add
12375 reloc_symbol_changes parameter.
12376 * sparc.cc (Target_sparc::relocate_section): Add
12377 reloc_symbol_changes parameter.
12378 * configure.ac: Call AM_CONDITIONAL for the default target.
12379 * configure: Rebuild.
12380 * testsuite/Makefile.am (TEST_AS): New variable.
12381 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12382 (check_DATA): Add split_i386 and split_x86_64 files.
12383 (SPLIT_DEFSYMS): Define.
12384 (split_i386_[1234n].o): New targets.
12385 (split_i386_[124]): New targets.
12386 (split_i386_[1234r].stdout): New targets.
12387 (split_x86_64_[1234n].o): New targets.
12388 (split_x86_64_[124]): New targets.
12389 (split_x86_64_[1234r].stdout): New targets.
12390 (MOSTLYCLEANFILES): Add new executables.
12391 * testsuite/split_i386.sh: New file.
12392 * testsuite/split_x86_64.sh: New file.
12393 * testsuite/split_i386_1.s: New file.
12394 * testsuite/split_i386_2.s: New file.
12395 * testsuite/split_i386_3.s: New file.
12396 * testsuite/split_i386_4.s: New file.
12397 * testsuite/split_i386_n.s: New file.
12398 * testsuite/split_x86_64_1.s: New file.
12399 * testsuite/split_x86_64_2.s: New file.
12400 * testsuite/split_x86_64_3.s: New file.
12401 * testsuite/split_x86_64_4.s: New file.
12402 * testsuite/split_x86_64_n.s: New file.
12403 * testsuite/testfile.cc (Target_test): Update relocation_section
12405 * testsuite/Makefile.in: Rebuild.
12407 2009-10-06 Ian Lance Taylor <iant@google.com>
12409 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12410 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12411 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12412 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12413 the address on ldo_addrs_.
12414 (Target_i386::Relocate::fix_up_ldo): New function.
12416 2009-10-06 Rafael Espindola <espindola@google.com>
12418 * plugin.cc (add_input_library): New.
12419 (Plugin::load): Add add_input_library to tv.
12420 (Plugin_manager::add_input_file): Add the is_lib argument.
12421 (add_input_file): Update call to Plugin_manager::add_input_file.
12422 (add_input_library): New.
12423 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12425 2009-09-30 Doug Kwan <dougkwan@google.com>
12427 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12428 symbol and call Symbol::may_need_copy_reloc to determine if
12429 a copy reloc is needed.
12430 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12431 nocopyreloc is given in command line.
12432 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12433 given in command line.
12434 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12435 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12436 of the removed Target_i386::may_need_copy_reloc.
12437 * options.h (copyreloc): New option with default value false.
12438 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12439 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12440 instead of the removed Target_powerpc::may_need_copy_reloc.
12441 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12442 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12443 instead of the removed Target_sparc::may_need_copy_reloc.
12444 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12445 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12446 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12447 instead of the removed Target_x86_64::may_need_copy_reloc.
12449 2009-09-30 Ian Lance Taylor <iant@google.com>
12451 * object.h (class Object): Remove target_ field, and target,
12452 sized_target, and set_target methods.
12453 (Object::sized_target): Remove.
12454 (class Sized_relobj): Update declarations. Remove sized_target.
12455 * object.cc (Sized_relobj::setup): Remove target parameter.
12456 Change all callers.
12457 (Input_objects::add_object): Don't do anything with the target.
12458 (make_elf_sized_object): Add punconfigured parameter. Change all
12459 callers. Set or test parameter target.
12460 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12461 Change all callers.
12462 * parameters.cc (Parameters::set_target): Change parameter type to
12464 (Parameters::default_target): Remove.
12465 (set_parameters_target): Change parameter type to be non-const.
12466 (parameters_force_valid_target): New function.
12467 (parameters_clear_target): New function.
12468 * parameters.h (class Parameters): Update declarations. Remove
12469 default_target method. Add sized_target and clear_target
12470 methods. Change target_ to be non-const.
12471 (set_parameters_target): Update declaration.
12472 (parameters_force_valid_target): Declare.
12473 (parameters_clear_target): Declare.
12474 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12475 as NULL if we aren't searching.
12476 (Add_symbols::run): Don't check for compatible target.
12477 * fileread.cc (Input_file::open_binary): Call
12478 parameters_force_valid_target.
12479 * gold.cc (queue_middle_tasks): Likewise.
12480 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12481 set_target on object.
12482 * dynobj.h (class Sized_dynobj): Update declarations.
12483 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12484 make_elf_object returns NULL.
12485 (Archive::include_member): Don't check whether object target is
12487 * output.cc (Output_section::add_input_section): Get target from
12489 (Output_section::relax_input_section): Likewise.
12490 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12492 (Sized_relobj::do_scan_relocs): Likewise.
12493 (Sized_relobj::relocate_sections): Likewise.
12494 * resolve.cc (Symbol_table::resolve): Likewise.
12495 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12496 parameter. Change all callers.
12497 (Symbol_table::add_from_object): Get target from parameters.
12498 (Symbol_table::add_from_relobj): Don't check object target.
12499 (Symbol_table::add_from_dynobj): Likewise.
12500 (Symbol_table::define_special_symbol): Get target from
12502 * symtab.h (class Symbol_table): Update declaration.
12503 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12504 parameter. Change all callers. Clear parameter target.
12505 (Binary_test): Test target here.
12506 * testsuite/object_unittest.cc (gold_testsuite): Remove
12507 target_test_pointer parameter. Change all callers.
12508 (Object_test): Test target here.
12510 2009-09-26 Ian Lance Taylor <iant@google.com>
12512 * testsuite/initpri1.c: Don't try to use constructor priorities if
12513 compiling with gcc before 4.3.
12515 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12517 * testsuite/retain_symbols_file_test.sh (check_present): Change
12518 output file name to retain_symbols_file_test.stdout.
12519 (check_absent): Likewise.
12521 2009-09-18 Craig Silverstein <csilvers@google.com>
12523 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12524 * options.cc: Include <cerrno> and <fstream>.
12525 (General_options::finalize): Parse -retain-symbols-file tag.
12526 * options.h: New flag.
12527 (General_options): New method should_retain_symbol, new
12528 variable symbols_to_retain.
12529 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12530 should_retain_symbol map.
12531 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12532 * testsuite/Makefile.in: Regenerate.
12533 * testsuite/retain_symbols_file_test.sh: New file.
12535 2009-09-18 Nick Clifton <nickc@redhat.com>
12537 * po/es.po: Updated Spanish translation.
12539 2009-09-17 Doug Kwan <dougkwan@google.com>
12541 * debug.h (DEBUG_RELAXATION): New constant.
12542 (DEBUG_ALL): Add DEBUG_RELAXATION.
12543 (debug_string_to_enum): Add relaxation debug option.
12545 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12546 Layout::Relaxation_debug_check::read_sections,
12547 Layout::Relaxation_debug_check::read_sections): New method definitions.
12548 (Layout::Layout): Initialize data members
12549 record_output_section_data_from_scrips_,
12550 script_output_section_data_list_ and relaxation_debug_check_.
12551 (Layout::save_segments, Layout::restore_segments,
12552 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12553 Layout::relaxation_loop_body): New method definitions.
12554 (Layout::finalize): Support relaxation. Move section layout code to
12555 Layout::relaxation_loop_body.
12556 (Layout::set_asection_address_from_script): Move code for orphan
12557 section placement out.
12558 (Layout::place_orphan_sections_in_script): New method definition.
12559 * layout.h (Output_segment_headers, Output_file_header):
12560 New forward class declarations.
12561 (Layout::~Layout): Define.
12562 (Layout::new_output_section_data_from_script): New method definition.
12563 (Layout::place_orphan_sections_in_script): New method declaration.
12564 (Layout::Segment_states): New type declaration.
12565 (Layout::save_segments, Layout::restore_segments,
12566 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12567 Layout::relaxation_loop_body): New method declarations.
12568 (Layout::Output_section_data_list): New type declaration.
12569 (Layout::Relaxation_debug_check): New class definition.
12570 (Layout::record_output_section_data_from_script_,
12571 Layout::script_output_section_data_list_, Layout::segment_states_,
12572 Layout::relaxation_debug_check_): New data members.
12573 * output.cc: (Output_section_headers::do_size): New method definition.
12574 (Output_section_headers::Output_section_headers): Move size
12575 computation to Output_section_headers::do_size.
12576 (Output_segment_headers::do_size): New method definition.
12577 (Output_file_header::Output_file_header): Move size computation to
12578 Output_file_header::do_size and call it.
12579 (Output_file_header::do_size): New method definition.
12580 (Output_data_group::Output_data_group): Adjust call to
12581 Output_section_data.
12582 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12583 (Output_symtab_xindex::do_write): Add array bound check.
12584 (Output_section::Input_section::print_to_mapfile): Handle
12585 RELAXED_INPUT_SECTION_CODE.
12586 (Output_section::Output_section): Initialize data member checkpoint_.
12587 (Output_section::~Output_section): Delete checkpoint object pointed
12589 (Output_section::add_input_section): Always add an Input_section if
12591 (Output_section::add_merge_input_section): Add assert.
12592 (Output_section::relax_input_section): New method definition.
12593 (Output_section::set_final_data_size): Set load address to zero for
12594 an unallocated section.
12595 (Output_section::do_address_and_file_offset_have_reset_values):
12596 New method definition.
12597 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12598 Handle relaxed input section.
12599 (Output_section::sort_attached_input_sections): Checkpoint input
12600 section list lazily.
12601 (Output_section::get_input_sections): Change type of input_sections to
12602 list of Simple_input_section pointers. Checkpoint input section list
12603 lazily. Also handle relaxed input sections.
12604 (Output_section::add_input_section_for_script): Take a reference to
12605 a Simple_input_section object instead of Relobj pointer and section
12606 index as parameter. Handle relaxed input sections.
12607 (Output_section::save_states, Output_section::restore_states): New
12608 method definitions.
12609 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12610 (Output_data::is_data_size_fixed): New method definition.
12611 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12613 (Output_data::address_and_file_offset_have_reset_values): New method
12615 (Output_data::do_address_and_file_offset_have_reset_values): New method
12617 (Output_data::set_data_size): Check that data size is not fixed.
12618 (Output_data::fix_data_size): New method definition.
12619 (Output_data::is_data_size_fixed_): New data member.
12620 (Output_section_headers::set_final_data_size): New method definition.
12621 (Output_section_headers::do_size): New method declaration.
12622 (Output_segment_headers::set_final_data_size): New method definition.
12623 (Output_segment_headers::do_size): New method declaration.
12624 (Output_file_header::set_final_data_size)::New method definition.
12625 (Output_file_header::do_size)::New method declaration.
12626 (Output_section_data::Output_section_data): Add new parameter
12627 is_data_size_fixed and use it to fix data size.
12628 (Output_data_const::Output_data_const): Adjust call to base class
12629 constructor and fix data size.
12630 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12631 base class constructor and fix data size.
12632 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12633 base class constructor and fix data size.
12634 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12635 class constructor and fix data size.
12636 (Output_data_group::set_final_data_size): New method definition.
12637 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12638 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12639 class constructor and fix data size.
12640 (Output_relaxed_input_section): New class definition.
12641 (Output_section::Simple_input_section): New class definition.
12642 (Output_section::get_input_sections): Adjust parameter list.
12643 (Output_section::add_input_section_for_script): Same.
12644 (Output_section::save_states, Output_section::restore_states,
12645 Output_section::do_address_and_file_offset_have_reset_values,
12646 (Output_section::Input_section::Input_section): Handle
12647 RELAXED_INPUT_SECTION_CODE. Add new overload for
12648 Output_relaxed_input_section.
12649 (Output_section::Input_section::is_input_section,
12650 Output_section::Input_section::set_output_section): Handle relaxed
12652 (Output_section::Input_section::is_relaxed_input_section,
12653 Output_section::Input_section::output_section_data,
12654 Output_section::Input_section::relaxed_input_section): New method
12656 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12658 (Output_section::Input_section::u1_): Update comments.
12659 (Output_section::Input_section::u2_): Add new union member poris.
12660 (Output_section::Checkpoint_output_section): New classs definition.
12661 (Output_section::relax_input_section): New method declaration.
12662 (Output_section::checkpoint_): New data member.
12663 (Output_segment): Update comments.
12664 (Output_segment::Output_segment): Un-privatize copy constructor.
12665 (Output_segment::operator=): Un-privatize.
12666 * script-sections.cc (Output_section_element::Input_section_list):
12667 Change element type to Output_section::Simple_input_section.
12668 (Output_section_element_dot_assignment::set_section_addresses):
12669 Register output section data for relaxation clean up.
12670 (Output_data_exression::Output_data_expression): Adjust call to base
12671 constructor to fix data size.
12672 (Output_section_element_data::set_section_addresses): Register
12673 Output_data_expression object for relaxation clean up.
12674 (struct Input_section_info): Replace Relobj pointer and section index
12675 pair with Output_section::Simple_input_section and Convert struct to a
12677 (Input_section_sorter::operator()): Adjust access to
12678 Input_section_info data member to use accessors.
12679 (Output_section_element_input::set_section_addresses): Use layout
12680 parameter. Adjust code to use Output_section::Simple_input_section
12681 and Input_secction_info classes. Register filler for relaxation
12683 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12684 and section index pair with Output_section::Simple_input_section
12685 class. Adjust code accordingly.
12686 (Phdrs_element::release_segment): New method definition.
12687 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12689 (Script_sections::release_segments): New method definition.
12690 * gold/script-sections.h (Script_sections::release_segments): New
12691 method declaration.
12692 * gold/target.h (Target::may_relax, Target::relax,
12693 Target::do_may_relax, Target::do_relax): New method definitions.
12695 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12697 * arm.cc (has_signed_unsigned_overflow): New function.
12698 (Arm_relocate_functions::abs8): New function.
12699 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12700 (Target_arm::Scan::global): Likewise.
12701 (Target_arm::relocate::relocate): Likewise.
12702 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12705 2009-09-16 Cary Coutant <ccoutant@google.com>
12707 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12708 * testsuite/Makefile.in: Regenerate.
12710 2009-09-11 Nick Clifton <nickc@redhat.com>
12712 * po/gold.pot: Updated by the Translation project.
12714 2009-09-08 Cary Coutant <ccoutant@google.com>
12716 * output.cc (Output_file::open): Add execute permission to empty file.
12717 * testsuite/Makefile.am (permission_test): New test.
12718 * testsuite/Makefile.in: Regenerate.
12720 2009-09-02 Ian Lance Taylor <iant@google.com>
12722 * output.cc (Output_file::resize): Call map_no_anonymous rather
12725 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12727 * gold.cc: Include "incremental.h".
12728 (queue_initial_tasks): Call Incremental_checker methods.
12729 * incremental.cc: Include "output.h".
12730 (Incremental_checker::can_incrementally_link_output_file): New
12732 * incremental.h (Incremental_checker): New class.
12734 * output.cc (Output_file::open_for_modification): New method.
12735 (Output_file::map_anonymous): Changed return type to bool. Record
12736 map in base_ field.
12737 (Output_file::map_no_anonymous): New method, broken out of map.
12738 (Output_file::map): Use map_no_anonymous and map_anonymous.
12739 * output.h (class Output_file): Update declarations.
12741 2009-08-24 Cary Coutant <ccoutant@google.com>
12743 * options.h (Command_line::Pre_options): New class.
12744 (Command_line::pre_options): New member.
12745 * options.cc (gold::options::ready_to_register): New variable.
12746 (One_option::register_option): Do nothing if not registering options.
12747 Assert if same short option registered twice.
12748 (General_options::General_options): Turn off option registration when
12750 (Command_line::Pre_options::Pre_options): New constructor.
12752 2009-08-24 Cary Coutant <ccoutant@google.com>
12754 * options.h (General_options::no_keep_memory): Remove incorrect
12757 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12759 * Makefile.am (am__skiplex, am__skipyacc): New.
12760 * Makefile.in: Regenerate.
12762 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12764 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12765 (INCLUDES): ... this.
12766 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12767 (AM_CPPFLAGS): Renamed from ...
12768 (INCLUDE): ... this.
12769 * Makefile.in, testsuite/Makefile.in: Regenerate.
12771 * Makefile.in: Regenerate.
12772 * aclocal.m4: Likewise.
12773 * config.in: Likewise.
12774 * configure: Likewise.
12775 * testsuite/Makefile.in: Likewise.
12777 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12778 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12779 * Makefile.in: Regenerate.
12780 * testsuite/Makefile.in: Regenerate.
12782 2009-08-19 Cary Coutant <ccoutant@google.com>
12784 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12785 symbols in shared libraries overridden by hidden or internal symbols
12786 in the main program.
12788 2009-08-19 Chris Demetriou <cgd@google.com>
12790 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12791 checking source file names in error messages.
12793 2009-08-18 Doug Kwan <dougkwan@google.com>
12795 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12796 an elcpp::Ehdr as parameter. Adjust call to set_target.
12797 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12798 an elfcpp::Ehdr as parameter.
12799 * object.cc (Object::set_target): Remove the version that looks up
12800 a target and sets it.
12801 (Sized_relobj::setup): Take a Target object instead of
12802 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12803 (make_elf_sized_object): Find target and ask target to
12804 make an ELF object.
12805 * object.h: (Object::set_target): Remove the version that looks up
12806 a target and sets it.
12807 (Sized_relobj::setup): Take a Target object instead of
12808 an elfcpp:Ehdr as parameter.
12809 * target.cc: Include dynobj.h.
12810 (Target::do_make_elf_object_implementation): New.
12811 (Target::do_make_elf_object): New.
12812 * target.h (Target::make_elf_object): New template declaration.
12813 (Target::do_make_elf_object): New method declarations.
12814 (Target::do_make_elf_object_implementation): New template declaration.
12816 2009-08-14 Ian Lance Taylor <iant@google.com>
12818 * gold.h (FUNCTION_NAME): Define.
12819 (gold_unreachable): Use FUNCTION_NAME.
12821 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12823 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12824 symbol in the --keep-unique list is not found.
12826 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12828 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12829 been maked as --keep-unique.
12830 (Icf::unfold_section): New function.
12831 * icf.h (Icf::unfold_section): New function.
12832 * options.h (General_options::keep_unique): New option.
12833 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12834 * testsuite/Makefile.in: Regenerate.
12835 * testsuite/icf_keep_unique_test.sh: New file.
12836 * testsuite/icf_keep_unique_test.cc: New file.
12838 2009-08-12 Cary Coutant <ccoutant@google.com>
12841 * resolve.cc (Symbol_table::resolve): Check for references from
12842 dynamic objects to hidden and internal symbols.
12843 * testsuite/Makefile.am (hidden_test.sh): New test.
12844 * testsuite/Makefile.in: Regenerate.
12845 * testsuite/hidden_test.sh: New script.
12846 * testsuite/hidden_test_1.c: New test source.
12847 * testsuite/hidden_test_main.c: New test source.
12849 2009-08-11 Doug Kwan <dougkwan@google.com>
12851 * arm.cc: Update comments.
12852 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12853 segment to locate the .ARM.exidx section if present.
12855 2009-08-09 Doug Kwan <dougkwan@google.com>
12857 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12860 2009-08-07 Sriraman Tallam <tmsriram@google.com>
12861 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12864 2009-08-06 Sriraman Tallam <tmsriram@google.com>
12866 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12867 valid tls_segment only for non-debug-section relocations.
12868 * testsuite/Makefile.am: Add gc_tls_test.
12869 * testsuite/Makefile.in: Regenerate.
12870 * testsuite/gc_tls_test.cc: New file.
12871 * testsuite/gc_tls_test.sh: New file.
12873 2009-08-05 Sriraman Tallam <tmsriram@google.com>
12875 * icf.cc: New file.
12877 * Makefile.am (CCFILES): Add icf.cc.
12878 (HFILES): Add icf.h
12879 * Makefile.in: Regenerate.
12880 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12881 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12882 section, symbol and addend information for the relocs.
12883 * gold.cc (queue_middle_tasks): Call identical code folding.
12884 * gold.h: Add defines for multimap.
12885 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12886 to the call of finalize_local_symbols.
12887 * main.cc (main): Create object of class Icf.
12888 * object.cc (Sized_relobj::do_layout): Allow this function to be
12889 called twice during icf.
12890 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12891 to sections marked as identical by icf.
12892 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12894 (Sized_relobj::do_section_entsize): New function.
12895 * object.h (Object::section_entsize): New function.
12896 (Object::do_section_entsize): New pure virtual function.
12897 (Relobj::finalize_local_symbols): Add new parameter.
12898 (Relobj::do_section_entsize): New function.
12899 * options.h (General_options::icf): New option.
12900 (General_options::icf_iterations): New option.
12901 (General_options::print_icf_sections): New option.
12902 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12903 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12904 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12906 * symtab.cc (Symbol_table::is_section_folded): New function.
12907 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12908 to sections marked as identical by icf.
12909 * symtab.h (Symbol_table::set_icf): New function.
12910 (Symbol_table::icf): New function.
12911 (Symbol_table::is_section_folded): New function.
12912 (Symbol_table::icf_): New data member.
12913 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12914 * testsuite/Makefile.am: Add commands to build icf_test.
12915 * testsuite/Makefile.in: Regenerate.
12916 * testsuite/icf_test.sh: New file.
12917 * testsuite/icf_test.cc: New file.
12919 2009-07-24 Chris Demetriou <cgd@google.com>
12921 * layout.cc (is_compressible_debug_section): Fix incorrect
12922 comment about compressed section names.
12924 2009-07-20 Ian Lance Taylor <ian@airs.com>
12927 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12929 2009-07-16 Ian Lance Taylor <iant@google.com>
12932 * layout.h: #include <map>.
12933 (class Kept_section): Change from struct to class. Add accessors
12934 and setters. Add section size to Comdat_group mapping. Change
12935 Comdat_group to std::map. Add is_comdat_ field. Add
12936 linkonce_size field in union.
12937 (class Layout): Update declaration of find_or_add_kept_section.
12938 Don't declare find_kept_object.
12939 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12940 parameter. Add object, shndx, is_comdat, and is_group_name
12941 parameters. Change all callers. Adjust for new Kept_section.
12942 (Layout::find_kept_object): Remove.
12943 * object.cc (Sized_relobj::include_section_group): Update use of
12944 Kept_section. Rename secnum to shndx. Only record
12945 Kept_comdat_section if sections are the same size.
12946 (Sized_relobj::include_linkonce_section): Update use of
12947 Kept_section. Only record Kept_comdat_section if sections are the
12948 same size. Set size of linkonce section.
12949 (Sized_relobj::map_to_kept_section): Update call to
12950 get_kept_comdat_section.
12951 * object.h (class Sized_relobj): Rename fields in
12952 Kept_comdat_section to drop trailing underscores; change object
12953 field to Relobj*. Change Kept_comdat_section_table to store
12954 struct rather than pointer.
12955 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12956 Add kept_object and kept_shndx parameters. Change all callers.
12957 (Sized_relobj::get_kept_comdat_section): Change return type to
12958 bool. Add kept_object and kept_shndx parameters. Change all
12960 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12961 Layout::find_or_add_kept_section.
12963 2009-07-09 Ian Lance Taylor <iant@google.com>
12965 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12966 Reserve space in the hash table.
12968 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12970 * fileread.cc (File_read::get_mtime): New method.
12971 * fileread.h (Timespec): New structure.
12972 (File_read::get_mtime): New method.
12973 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12974 Renamed from timestamp_nsec.
12975 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12977 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
12979 (Incremental_inputs::report_archive): Save mtime; style fix.
12980 (Incremental_inputs::report_obejct): Save mtime; style fix.
12981 (Incremental_inputs::report_script): Save mtime; style fix.
12982 (Incremental_inputs::finalize_inputs): Style fix.
12983 (Incremental_inputs::finalize): Style fix.
12984 (Incremental_inputs::create_input_section_data): Store inputs
12986 * incremental.h (Incremental_inputs::report_script): Add mtime
12988 (Incremental_inputs::Input_info::Input_info): Intialize only one
12990 (Incremental_inputs::Input_info::archive): Move to nameless
12992 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12993 (Incremental_inputs::Input_info::script): Move to nameless union.
12994 (Incremental_inputs::mtime): New field.
12995 * script.cc (read_input_script): Pass file mtime to
12997 * script.h (Script_info::inputs): Style fix.
12999 2009-07-01 Ian Lance Taylor <ian@airs.com>
13001 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13004 2009-06-24 Ian Lance Taylor <iant@google.com>
13007 * layout.cc (Layout::choose_output_section): If we find an
13008 existing section, update the flags.
13009 (Layout::create_notes): New function, broken out of
13011 (Layout::finalize): Don't create note sections.
13012 (Layout::create_note): Don't crash if linker script discards
13014 (Layout::create_gold_note): Likewise.
13015 (Layout::create_build_id): Likewise. Don't set
13016 after_input_sections on the section.
13017 (Layout::create_executable_stack_info): Remove target parameter.
13019 * layout.h (class Layout): Declare create_notes. Update
13020 declaration of create_executable_stack_info.
13021 * gold.cc (queue_middle_tasks): Call create_notes.
13022 * output.cc (Output_section::update_flags_for_input_section): Move
13023 here from output.h. If SHF_ALLOC flag is newly set, mark address
13025 * output.h (Output_data::mark_address_invalid): New function.
13026 (class Output_section): Only declare, not define,
13027 update_flags_for_input_section. Remove set_flags.
13029 2009-06-24 Ian Lance Taylor <iant@google.com>
13031 * script-sections.cc (Output_section_definition::
13032 set_section_addresses): Rename shadowing local load_address to
13035 2009-06-24 Ian Lance Taylor <iant@google.com>
13038 * reloc.cc (relocate_sections): Skip empty relocation sections.
13040 2009-06-23 Ian Lance Taylor <iant@google.com>
13043 * layout.cc (Layout::create_note): Use choose_output_section
13044 rather than make_output_section.
13046 2009-06-23 Ian Lance Taylor <iant@google.com>
13049 * options.cc (General_options::parse_V): Set printed_version_.
13050 (General_options::General_options): Initialize printed_version_.
13051 * options.h (class General_options): Add printed_version_ field.
13052 * gold.cc (queue_initial_tasks): If there are no input files,
13053 don't give a fatal error if we printed the version information.
13054 (queue_middle_tasks): If using -r with a shared object, give a
13055 fatal error rather than an ordinary error.
13057 2009-06-23 Ian Lance Taylor <iant@google.com>
13060 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13061 (Layout::make_output_section): Set have_stabstr_section_ if we see
13062 a .stab*str section.
13063 (Layout::finalize): Call link_stabs_sections.
13064 (Layout::link_stabs_sections): New file.
13065 * layout.h (class Layout): Add have_stabstr_section_ field.
13066 Declare link_stabs_sections.
13068 2009-06-23 Doug Kwan <dougkwan@google.com>
13070 * Makefile.am (libgold_a_LIBADD): New.
13071 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
13072 * Makefile.in: Regenerate.
13073 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13074 * configure: Regenerate.
13075 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13076 * fileread.cc: Include sys/state.h
13077 * gold.h: Declare memmem and strndup if found missing.
13078 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13080 2009-06-23 Ian Lance Taylor <iant@google.com>
13082 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13083 * configure: Rebuild.
13085 2009-06-23 Ian Lance Taylor <iant@google.com>
13088 * object.cc (Object::section_contents): Don't try to get a view if
13089 the section has length zero.
13090 (Object::handle_gnu_warning_section): If the section is empty, use
13091 the name of the section as the warning.
13093 2009-06-23 Ian Lance Taylor <iant@google.com>
13096 * stringpool.h (class Stringpool_template): Add optimize_ field.
13097 (Stringpool_template::set_optimize): New function.
13098 * stringpool.cc (Stringpool_template::Stringpool_template):
13099 Initialize optimize_ field.
13100 (Stringpool_template::set_string_offsets): Test local optimize
13101 fild rather than parameter.
13102 * layout.cc (Layout::Layout): Call set_optimize on the section
13105 2009-06-22 Ian Lance Taylor <iant@google.com>
13108 * yyscript.y: Parse TARGET.
13109 * script.cc (script_set_target): New function.
13110 * script-c.h (script_set_target): Declare.
13111 * options.cc (General_options::string_to_object_format): Rename
13112 from string_to_object_format in anonymous namespace. Change
13114 * options.h (class General_options): Declare
13115 string_to_object_format.
13117 2009-06-22 Ian Lance Taylor <iant@google.com>
13119 * script-sections.cc (Script_sections::create_segments): Don't put
13120 program headers in a PT_LOAD segment if -n or -N.
13122 2009-06-22 Ian Lance Taylor <iant@google.com>
13125 * options.h (class General_options): Add -z lazy and -z now. Sort
13126 -z options into alphabetical order.
13127 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13129 2009-06-21 Ian Lance Taylor <iant@google.com>
13131 * layout.cc (Layout::make_output_section): Call
13132 Target::new_output_section.
13133 (Layout::attach_allocated_section_to_segment): Put large section
13134 sections in a separate load segment with the large segment flag
13136 (Layout::segment_precedes): Sort large data segments after other
13138 (align_file_offset): New static function.
13139 (Layout::set_segment_offsets): Use align_file_offset.
13140 * output.h (class Output_section): Add is_small_section_ and
13141 is_large_section_ fields.
13142 (Output_section::is_small_section): New function.
13143 (Output_section::set_is_small_section): New function.
13144 (Output_section::is_large_section): New function.
13145 (Output_section::set_is_large_section): New function.
13146 (Output_section::is_large_data_section): New function.
13147 (class Output_segment): Add is_large_data_segment_ field.
13148 (Output_segment::is_large_data_segment): New function.
13149 (Output_segment::set_is_large_data_segment): New function.
13150 * output.cc (Output_section::Output_section): Initialize new
13152 (Output_segment::Output_segment): Likewise.
13153 (Output_segment::add_output_section): Add assertion that large
13154 data sections always go in large data segments. Force small data
13155 sections to the end of the list of data sections. Force small BSS
13156 sections to the start of the list of BSS sections. For large BSS
13157 sections to the end of the list of BSS sections.
13158 * symtab.h (class Symbol): Declare is_common_shndx.
13159 (Symbol::is_defined): Check Symbol::is_common_shndx.
13160 (Symbol::is_common): Likewise.
13161 (class Symbol_table): Define enum Commons_section_type. Update
13162 declarations. Add small_commons_ and large_commons_ fields.
13163 * symtab.cc (Symbol::is_common_shndx): New function.
13164 (Symbol_table::Symbol_table): Initialize new fields.
13165 (Symbol_table::add_from_object): Put small and large common
13166 symbols in the right list.
13167 (Symbol_table::sized_finalized_symbol): Check
13168 Symbol::is_common_shndx.
13169 (Symbol_table::sized_write_globals): Likewise.
13170 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13171 common symbol lists. Don't call do_allocate_commons_list if the
13173 (Symbol_table::do_allocate_commons_list): Remove is_tls
13174 parameter. Add comons_section_type parameter. Change all
13175 callers. Handle small and large common symbols.
13176 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13177 Symbol::is_common_shndx.
13178 * resolve.cc (symbol_to_bits): Likewise.
13179 * target.h (Target::small_common_shndx): New function.
13180 (Target::small_common_section_flags): New function.
13181 (Target::large_common_shndx): New function.
13182 (Target::large_common_section_flags): New function.
13183 (Target::new_output_section): New function.
13184 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13185 small_common_section_flags, and large_common_section_flags
13187 (Target::do_new_output_section): New virtual function.
13188 * arm.cc (Target_arm::arm_info): Initialize new fields.
13189 * i386.cc (Target_i386::i386_info): Likewise.
13190 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13192 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13193 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13194 (Target_x86_64::do_new_output_section): New function.
13195 * configure.ac: Define conditional MCMODEL_MEDIUM.
13196 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13197 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13198 (large_LDFLAGS): Define.
13199 * testsuite/large.c: New file.
13200 * testsuite/testfile.cc (Target_test::test_target_info):
13201 Initialize new fields.
13202 * configure, testsuite/Makefile.in: Rebuild.
13204 2009-06-05 Doug Kwan <dougkwan@google.com>
13206 * Makefile.am (CCFILES): Add target.cc.
13207 * Makefile.in: Regenerate.
13208 * i386.cc (class Target_i386): Define new virtual method to
13209 override do_is_local_label_name in parent.
13210 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13211 local symbols if --discard-locals or -X is given.
13212 * options.h (class General_options): Declare new options
13213 '--discard-locals' and '-X' for discarding locals.
13214 * target.h (class Target): Define new methods is_local_label_name.
13215 Declare new virtual method do_is_local_label_name.
13216 * target.cc: New file.
13217 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13218 (check_SCRIPTS): Add discard_locals_test.sh.
13219 (check_DATA): Add discard_local_tests.syms.
13220 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13221 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13222 * testsuite/Makefile.in: Regenerate.
13223 * testsuite/discard_locals_test.c: New file.
13224 * testsuite/discard_locals_test.sh: Same.
13226 2009-06-05 Doug Kwan <dougkwan@google.com>
13228 * object.cc (Sized_relobj::Sized_relobj): Initialize
13229 discarded_eh_frame_shndx_ to -1U.
13230 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13232 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13233 a discarded .eh_frame section.
13234 (Sized_relobj::do_finalize_local_symbols): Ditto.
13235 * object.h (class Sized_relobj): Declare new member
13236 discarded_eh_frame_shndx_.
13237 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13238 (local_labels_test.o, local_labels_test): New rules.
13239 * testsuite/Makefile.in: Regenerate.
13241 2009-06-04 Doug Kwan <dougkwan@google.com>
13243 * layout.cc (Layout::section_name_mapping): Add mapping for
13244 special ARM sections.
13246 2009-06-03 Doug Kwan <dougkwan@google.com>
13248 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13249 (utils::has_overflow): Same.
13251 2009-06-03 Ian Lance Taylor <iant@google.com>
13253 * layout.cc (Layout::section_name_mapping): New array, replacing
13254 Layout::linkonce_mapping.
13255 (Layout::section_name_mapping_count): New variable, replacing
13256 Layout::linkonce_mapping_count.
13257 (Layout::linkonce_output_name): Remove.
13258 (Layout::output_section_name): Rewrite.
13259 * layout.h (class Layout): Rename Linkonce_mapping to
13260 Section_name_mapping, linkonce_mapping to section_name_mapping,
13261 linkonce_mapping_count to section_name_mapping_count. Don't
13262 declare linkonce_output_name.
13264 2009-06-03 Doug Kwan <dougkwan@google.com>
13266 * gold/arm.cc (namespace utils): New.
13267 (Target_arm::reloc_is_non_pic): Define new method.
13268 (class Arm_relocate_functions): New.
13269 (Target_arm::Relocate::relocate): Handle relocation types used by
13272 2009-06-03 Ian Lance Taylor <iant@google.com>
13274 * arm.cc (Target_arm::scan::global): Use || instead of |.
13276 2009-06-02 Doug Kwan <dougkwan@google.com>
13278 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13279 issued_non_pic_error_.
13280 (class Target_arm::Scan): Declare new method check_non_pic.
13281 Define new method symbol_needs_plt_entry.
13282 Declare new data member issued_non_pic_error_.
13283 (class Target_arm::Relocate): Declare new method
13284 should_apply_static_reloc.
13285 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13286 (Target_arm::Scan::check_non_pic): Define new method.
13287 (Target_arm::Scan::local): Handle a small subset of reloc types used
13289 (Target_arm::Scan::local): Same.
13290 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13292 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13294 * incremental.cc (Incremental_inputs::report_command_line): Filter
13295 out --incremental-* options.
13297 2009-05-29 Doug Kwan <dougkwan@google.com>
13299 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13301 (class Target_arm): Update comment.
13302 (Target_arm::Target_arm): Initialize new data members GOT_,
13303 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13304 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13305 and Target_arm::rel_dyn_section.
13306 Declare new_enum Target_arm::Got_type.
13307 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13309 Update commments for member do_dynsym_value.
13310 (Target_arm::got_size, Target_arm::plt_section,
13311 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13312 new methods inside class defintion.
13313 (Target_arm::got_section): Define new method.
13314 (Target_arm::rel_dyn_section): Same.
13315 (Output_data_plt_arm): New template class.
13316 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13317 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13318 (Output_data_plt_arm::add_entry): Same.
13319 (Output_data_plt_arm::first_plt_entry): Define new
13320 static data member for PLT instruction template.
13321 (Output_data_plt_arm::plt_entry): Same.
13322 (Output_data_plt_arm::do_write): Define new method.
13323 (Target_arm::make_plt_entry): Same.
13324 (Target_arm::do_finalize_sections): Same.
13325 (Target_arm::do_dynsym_value): Same.
13327 2009-05-28 Doug Kwan <dougkwan@google.com>
13329 * Makefile.am (TARGETSOURCES): Add arm.cc.
13330 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13331 * Makefile.in: Regenerate.
13332 * arm.cc: New file.
13333 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13335 2009-05-26 Doug Kwan <dougkwan@google.com>
13337 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13338 (General_options::check_excluded_libs): Strip off directories in
13339 archive name before matching like GNU ld does.
13340 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13341 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13342 (exclude_libs_test_LDFLAGS): Add linker option
13343 -Wl,--exclude-libs,libexclude_libs_test_3
13344 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13345 an explicit archive without using -l.
13346 (alt/libexclude_libs_test_3.a): New make rule.
13347 * testsuite/Makefile.in: Regenerate.
13348 * testsuite/exclude_libs_test.c : Declare lib3_default().
13350 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13351 * exclude_libs_test_3.c: New file.
13353 2009-05-26 Nick Clifton <nickc@redhat.com>
13355 * po/id.po: New Indonesian translation.
13356 * po/gold.pot: Updated template file.
13358 2009-05-22 Sriraman Tallam <tmsriram@google.com>
13360 * testsuite/Makefile.am: Add -ffunction-sections to compile
13361 gc_comdat_test files. Add -Wl,--gc-sections to build
13363 * testsuite/Makefile.in: Regenerate.
13364 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13366 2009-05-21 Sriraman Tallam <tmsriram@google.com>
13368 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13369 kept comdat section was garbage collected.
13370 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13371 * testsuite/Makefile.in: Regenerate.
13372 * testsuite/gc_comdat_test.sh: New file.
13373 * testsuite/gc_comdat_test_1.cc: New file.
13374 * testsuite/gc_comdat_test_2.cc: New file.
13376 2009-05-19 Doug Kwan <dougkwan@google.com>
13378 * archive.cc (Archive::Archive): Move constructor from archive.h
13379 to here. Initialize no_export_.
13380 (Archive::get_elf_object_for_member): Set no_export flag of object.
13381 * archive.h (Archive::Archive): Move constructor body to
13383 (Archive::no_export): New method.
13384 (Archive::no_export_): New field.
13385 * object.h (Object::Object): Initialize no_export_ to false.
13386 (Object::no_export, Object::set_no_export): New methods.
13387 (Object::no_export_): New field.
13388 * options.cc (General_options::parse_exclude_libs): New method.
13389 (General_options::check_excluded_libs) Same.
13390 * options.h (exclude_libs): New option.
13391 (General_options::check_excluded_libs): New method declaration.
13392 (General_options::excluded_libs_): New field.
13393 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13394 default or protected visibility if an object has no-export flag set.
13395 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13396 (check_SCRIPTS): Add exclude_libs_test.sh.
13397 (check_DATA): Add exclude_libs_test.syms.
13398 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13399 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13400 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13401 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13402 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13403 libexclude_libs_test_2.a): New rules.
13404 * testsuite/Makefile.in: Regenerate.
13405 * testsuite/exclude_libs_test.c: New file.
13406 * testsuite/exclude_libs_test.sh: Ditto.
13407 * testsuite/exclude_libs_test_1.c: Ditto.
13408 * testsuite/exclude_libs_test_2.c: Ditto.
13410 2009-05-15 Ian Lance Taylor <iant@google.com>
13412 * configure.ac: Check for declarations for cases where libiberty.h
13413 checks HAVE_DECL_xxx.
13414 * configure, config.in: Rebuild.
13416 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13418 * gold.h (Incremental_argument_list): Remove (invalid) forward
13420 * incremental.cc (Incremental_inputs::report_achive): New method.
13421 (Incremental_inputs::report_object): New method.
13422 (Incremental_inputs::report_script): New method.
13423 (Incremental_inputs::finalize_inputs): New method.
13424 (Incremental_inputs::finalize): Call finalize_inputs().
13425 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13426 Create inputs entries.
13427 * incremental.h (Incremental_input_type): New enum.
13428 (Incremental_inputs::Incremental_input): Initialize new fields.
13429 (Incremental_inputs::report_inputs): New method.
13430 (Incremental_inputs::report_achive): New method.
13431 (Incremental_inputs::report_object): New method.
13432 (Incremental_inputs::report_script): New method.
13433 (Incremental_inputs::finalize_inputs): New method.
13434 (Incremental_inputs::Input_info): New struct.
13435 (Incremental_inputs::Input_info_map): New typedef.
13436 (Incremental_inputs::lock_): New field.
13437 (Incremental_inputs::Inputs_): New field.
13438 (Incremental_inputs::Inputs_map): New field.
13439 * main.cc (main): Call Incremental_input::report_inputs.
13440 * options.h (Input_argument_list): Typedef moved from
13442 (Input_file_group::Files): Remove, use ::Input_argument_list.
13443 (Input_file_group::Input_argument_list): Remove, use
13444 ::Input_argument_list.
13445 * plugin.cc (Plugin_manager::add_input_file): Add error in
13447 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13449 * script.cc (read_input_script): Call
13450 Incremental_input::report_script.
13451 * script.h (Script_info): New class.
13453 2009-04-27 Ian Lance Taylor <iant@google.com>
13455 * x86_64.cc (do_adjust_output_section): Set entsize to
13458 2009-04-23 Elliott Hughes <enh@google.com>
13460 * output.cc (Output_file::close): After short writes, continue
13461 writing from the correct offset in the buffer being written.
13463 2009-04-23 Chris Demetriou <cgd@google.com>
13465 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13466 * configure: Regenerate.
13467 * config.in: Regenerate.
13468 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13469 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13471 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13473 * incremental.cc (Incremental_inputs_header_data): Renamed from
13474 Incremental_input_header_data.
13475 (Incremental_inputs_header_data::data_size): New field.
13476 (Incremental_inputs_header_data::put_input_file_count): Renamed
13477 from input_file_count.
13478 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13479 from command_line_offset.
13480 (Incremental_inputs_header_data::put_reserved): Renamed from
13482 (Incremental_inputs_entry_data): Renamed from
13483 Incremental_input_entry_data.
13484 (Incremental_inputs_entry_data::data_size): New field.
13485 (Incremental_inputs::report_command_line): New method.
13486 (Incremental_inputs::finalize): New method.
13487 (Incremental_inputs::create_incremental_inputs_data): New method.
13488 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13489 * incremental.h: New file.
13490 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
13491 (Layout::finalize): Create incremental inputs section in
13492 incremental builds.
13493 (Layout::create_incremental_info_sections): New method.
13494 * layout.h (Layout::incremental_inputs): New method.
13495 (Layout::create_incremental_info_sections): New method.
13496 (Layout::incremental_inputs_): New field.
13497 * main.cc (main): Notify Incremental_input of the command line.
13499 2009-04-01 Ian Lance Taylor <iant@google.com>
13500 Mikolaj Zalewski <mikolajz@google.com>
13502 * gold.h (reserve_unordered_map): Define, three versions, one for
13503 each version of Unordered_map.
13504 * layout.cc (Layout::Layout): Remove options parameter. Add
13505 number_of_input_files parameter. Don't initialize options_.
13506 Initialize number_of_input_files_ and resized_signatures_. Move
13507 sections_are_attached_.
13508 (Layout::layout_group): Reserve space for group_signatures_.
13509 (Layout::find_or_add_kept_section): Change name parameter to be a
13510 reference. Resize signatures_ map when it gets large enough.
13511 (Layout::layout_eh_frame): Use parameters->options() instead of
13513 (Layout::make_output_section): Likewise.
13514 (Layout::attach_allocated_section_to_segment): Likewise.
13515 (Layout::finalize, Layout::create_executable_stack): Likewise.
13516 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13517 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13518 * layout.h (class Layout): Update declarations. Remove options_
13519 field. Add number_of_input_files_ and resized_signatures_
13520 fields. Move sections_are_attached_ field.
13521 * main.cc (main): Pass number of input files to Layout
13522 constructor. Don't pass options.
13524 2009-03-30 Ian Lance Taylor <iant@google.com>
13526 * ffsll.c (ffsll): Correct implementation.
13528 2009-03-27 Ian Lance Taylor <iant@google.com>
13530 * ffsll.c: New file.
13531 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13532 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13533 * ftruncate.c (ftruncate): Declare before definition.
13534 * mremap.c (mremap): Likewise.
13535 * pread.c (pread): Likewise.
13536 * configure, Makefile.in, config.in: Rebuild.
13538 * mremap.c: New file.
13539 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13540 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13541 (mremap): Declare if HAVE_MREMAP is not defined.
13542 * configure, Makefile.in, config.in: Rebuild.
13544 2009-03-27 Cary Coutant <ccoutant@google.com>
13546 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13547 position independent.
13548 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13549 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13551 2009-03-24 Cary Coutant <ccoutant@google.com>
13553 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13555 (needs_dynamic_reloc): Likewise.
13557 2009-03-24 Ian Lance Taylor <iant@google.com>
13559 * yyscript.y (file_cmd): Recognize EXTERN.
13560 (extern_name_list, extern_name_list_body): New nonterminals.
13561 * script.cc (script_add_extern): Define.
13562 * script-c.h (script_add_extern): Declare.
13564 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
13566 * object.cc (is_elf_object): Define.
13567 * object.h (is_elf_object): Declare.
13568 * archive.cc (Archive::get_elf_object_for_member): Call
13570 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
13572 2009-03-24 Elliott Hughes <enh@google.com>
13574 * output.cc (Output_file::map_anonymous): Define.
13575 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13576 try an anonymous one. Report the size if the mmap fails.
13577 * output.h (class Output_file): Declare map_anonymous.
13579 2009-03-24 Ian Lance Taylor <iant@google.com>
13581 * target-select.cc (instantiate_target): Don't acquire the lock if
13582 the instantiated_target_ field has already been set.
13584 2009-03-23 Ian Lance Taylor <iant@google.com>
13586 * gold-threads.h (class Initialize_lock): Define.
13587 * gold-threads.cc (class Initialize_lock_once): Define.
13588 (initialize_lock_control): New static variable.
13589 (initialize_lock_pointer): New static variable.
13590 (initialize_lock_once): New static function.
13591 (Initialize_lock::Initialize_lock): Define.
13592 (Initialize_lock::initialize): Define.
13593 * target-select.h: Include "gold-threads.h".
13594 (class Target_selector): Add lock_ and initialize_lock_ fields.
13595 Don't define instantiate_target, just declare it.
13596 * target-select.cc (Target_selector::Target_selector): Initialize
13598 (Target_selector::instantiate_target): Define.
13599 * descriptors.h: Include "gold-threads.h".
13600 (class Descriptors): Add initialize_lock_ field.
13601 * descriptors.cc (Descriptors::Descriptors): Initialize new
13603 (Descriptors::open): Use initialize_lock_ field
13604 * errors.h (class Errors): Add initialize_lock_ field.
13605 * errors.cc (Errors::Errors): Initialize new field.
13606 (Errors::initialize_lock): Use initialize_lock_ field.
13607 * powerpc.cc (class Target_selector_powerpc): Remove
13608 instantiated_target_ field. In do_recognize call
13609 instantiate_target rather than do_instantiate_target. In
13610 do_instantiate_target just allocate a new target.
13611 * sparc.cc (class Target_selector_sparc): Likewise.
13613 * freebsd.h: New file.
13614 * i386.cc: Include "freebsd.h".
13615 (Target_i386): Derive from Target_freebsd rather than
13617 (Target_selector_i386): Derive from Target_selector_freebsd rather
13618 than Target_selector.
13619 * x86_64.cc: Include "freebsd.h".
13620 (Target_x86_64): Derive from Target_freebsd rather than
13622 (Target_selector_x86_64): Derive from Target_selector_freebsd
13623 rather than Target_selector.
13624 * target.h (class Target): Add adjust_elf_header and
13625 do_adjust_elf_header.
13626 * output.cc (Output_file_header:: do_sized_write): Call target
13627 adjust_elf_header routine.
13628 * configure.tgt: Set targ_osabi.
13629 * configure.ac: Define GOLD_DEFAULT_OSABI.
13630 * parameters.cc (Parameters::default_target): Pass
13631 GOLD_DEFAULT_OSABI to select_target.
13632 * target-select.h (class Target_selector): Make instantiate_target
13633 protected rather than private.
13634 * Makefile.am (HFILES): Add freebsd.h.
13635 * configure, Makefile.in, config.in: Rebuild.
13637 * merge.cc (do_add_input_section): Correct pend value. Change
13638 message about last entry not being null terminated from error to
13641 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13643 * incremental.cc: New file.
13644 * Makefile.am (CCFILES): Add incremental.cc.
13645 * Makefile.in: Rebuild.
13647 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13649 * layout.cc (Layout::output_section_name): Preserve names
13650 of '.note.' sections.
13652 2009-03-19 Ian Lance Taylor <iant@google.com>
13654 * descriptors.cc (Descriptors::open): Check that the options are
13655 valid before using them.
13657 2009-03-18 Ian Lance Taylor <iant@google.com>
13659 * script-sections.h: Include <list>.
13660 (class Script_sections): Change Sections_elements from std::vector
13661 to std::list. Typedef public Elements_iterator. Add
13662 orphan_section_placement_, data_segment_align_start_, and
13663 saw_data_segment_align_ fields. Remove data_segment_align_index_
13665 * script-sections.cc (class Orphan_section_placement): New class.
13666 (class Sections_element): Add virtual functions is_relro and
13667 orphan_section_init. Remove virtual function place_orphan_here.
13668 (class Output_section_definition): Add is_relro and
13669 orphan_section_init. Remove place_orphan_here.
13670 (class Orphan_output_section): Likewise.
13671 (Script_sections::Script_sections): Update for field changes.
13672 (Script_sections::data_segment_align): Set saw_data_segment_align_
13673 and data_segment_align_start_, not data_segment_align_index.
13674 (Script_sections::data_segment_relro_end): Check
13675 saw_data_segment_align_. Use data_segment_align_start_ rather
13676 than data_segment_align_index_.
13677 (Script_sections::place_orphan): Rewrite to use
13678 Orphan_section_placement.
13680 2009-03-17 Ian Lance Taylor <iant@google.com>
13682 * archive.cc (Archive::add_symbols): Check for a version attached
13683 to the symbol name in the archive map.
13684 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13685 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13686 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13687 (ver_test_11.a): New target.
13688 * testsuite/Makefile.in: Rebuild.
13690 * configure.ac: Check for chsize and posix_fallocate. Replace
13692 * ftruncate.c: New file, from gnulib.
13693 * output.cc (posix_fallocate): Define dummy version if not
13694 HAVE_POSIX_FALLOCATE.
13695 (Output_file::map): Call posix_fallocate rather than lseek and
13697 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13698 * configure, Makefile.in, config.in: Rebuild.
13700 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
13702 * layout.h (Layout::create_note): Add section_name parameter.
13703 * layout.cc (Layout::create_note): Likewise.
13704 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
13706 2009-03-17 Ian Lance Taylor <iant@google.com>
13708 * descriptors.cc: Include "options.h".
13709 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13710 (Descriptors::open): Always use O_CLOEXEC when opening a new
13711 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13712 then set FD_CLOEXEC.
13714 * sparc.cc (class Target_sparc): Add has_got_section.
13715 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13716 make sure we have a GOT section.
13718 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13719 (Target_sparc::Scan::local): Likewise.
13720 (Target_sparc::Scan::global): Likewise.
13721 (Target_sparc::Relocate::relocate): Likewise.
13722 (Target_sparc::Relocate::relocate_tls): Likewise.
13724 * symtab.cc (Symbol_table::define_default_version): New function,
13725 broken out of add_from_object.
13726 (Symbol_table::add_from_object): Call define_default_version.
13727 (Symbol_table::define_special_symbol): Add resolve_oldsym
13728 parameter. Change all callers. If the version for a symbol comes
13729 from a version script, resolve it with the symbol with the same
13730 name with no version. Also add the symbol without a version if
13732 (do_define_in_output_data): If resolving with oldsym, don't delete
13734 (do_define_in_output_segment): Likewise.
13735 (do_define_as_constant): Likewise.
13736 * symtab.h (class Symbol_table): Update declarations.
13738 2009-03-13 Ian Lance Taylor <iant@google.com>
13740 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13741 (Read_symbols::requeue): New function.
13742 (Read_symbols::do_read_symbols): If make_elf_object fails because
13743 the target type is not configured, and the file was searched for,
13744 issue a warning and retry with the next directory.
13745 (Add_symbols::run): If the file has an incompatible format, and
13746 it was searched for, requeue the Read_symbols task. On error,
13747 release the object.
13748 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13749 dirindex parameter to constructor. Change all callers. Declare
13750 incompatible_warning and requeue.
13751 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13752 input_argument_ and input_group_ fields. Add them to
13753 constructor. Change all callers.
13754 (class Read_script): Add dirindex_ field. Add it to constructor.
13755 Change all callers.
13756 * archive.cc (Archive::setup): Remove input_objects parameter.
13757 Change all callers.
13758 (Archive::get_file_and_offset): Likewise.
13759 (Archive::read_all_symbols): Likewise.
13760 (Archive::read_symbols): Likewise.
13761 (Archive::get_elf_object_for_member): Remove input_objects
13762 parameter. Add punconfigured parameter. Change all callers.
13763 (Archive::add_symbols): Change return type to bool. Check return
13764 value of include_member.
13765 (Archive::include_all_members): Likewise.
13766 (Archive::include_member): Change return type to bool. Return
13767 false if first included object has incompatible target. Set
13768 included_member_ field.
13769 (Add_archive_symbols::run): If add_symbols returns false, requeue
13771 * archive.h (class Archive): Add included_member_ field.
13772 Initialize it in constructor. Add input_file and searched_for
13773 methods. Update declarations.
13774 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13775 input_argument_ fields. Add them to constructor. Change all
13777 * script.cc: Include "target-select.h".
13778 (class Parser_closure): Add skip_on_incompatible_target_ and
13779 found_incompatible_target_ fields. Add
13780 skip_on_incompatible_target parameter to constructor. Change all
13781 callers. Add methods skip_on_incompatible_target,
13782 clear_skip_on_incompatible_target, found_incompatible_target, and
13783 set_found_incompatible_target.
13784 (read_input_script): Add dirindex parameter. Change all callers.
13785 If parser finds an incompatible target, requeue Read_symbols
13787 (script_set_symbol): Clear skip_on_incompatible_target in
13789 (script_add_assertion, script_parse_option): Likewise.
13790 (script_start_sections, script_add_phdr): Likewise.
13791 (script_check_output_format): New function.
13792 * script.h (read_input_script): Update declaration.
13793 * script-c.h (script_check_output_format): Declare.
13794 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13795 (ignore_cmd): Remove OUTPUT_FORMAT.
13796 * fileread.cc (Input_file::Input_file): Add explicit this.
13797 (Input_file::will_search_for): New function.
13798 (Input_file::open): Add pindex parameter. Change all callers.
13799 * fileread.h (class Input_file): Add input_file_argument method.
13800 Declare will_search_for. Update declarations.
13801 * object.cc (make_elf_object): Add punconfigured parameter.
13802 Change all callers.
13803 * object.h (class Object): Make input_file public. Add
13804 searched_for method.
13805 (make_elf_object): Update declaration.
13806 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13808 * dirsearch.h (class Dirsearch): Update declaration.
13809 * options.h (class General_options): Add --warn-search-mismatch.
13810 * parameters.cc (Parameters::is_compatible_target): New function.
13811 * parameters.h (class Parameters): Declare is_compatible_target.
13812 * workqueue.cc (Workqueue::add_blocker): New function.
13813 * workqueue.h (class Workqueue): Declare add_blocker.
13815 * fileread.cc (Input_file::open): Remove options parameter.
13816 Change all callers.
13817 (Input_file::open_binary): Likewise.
13818 * script.cc (read_input_script): Likewise.
13819 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13820 options parameter from constructor. Change all callers.
13821 (class Read_script): Likewise.
13822 * fileread.h (class Input_file): Update declarations.
13823 * script.h (read_input_script): Update declaration.
13825 2009-03-10 Nick Clifton <nickc@redhat.com>
13827 * po/es.po: New Spanish translation.
13829 2009-03-06 Cary Coutant <ccoutant@google.com>
13831 * options.cc (parse_short_option): Keep dash_z from registering itself.
13833 2009-03-03 Ian Lance Taylor <iant@google.com>
13836 * target-reloc.h (relocate_section): Pass output_section to
13838 * i386.cc (Target_i386::should_apply_static_reloc): Add
13839 output_section parameter. Change all callers.
13840 (Target_i386::Relocate::relocate): Add output_section parameter.
13841 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13842 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13843 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13844 * testsuite/two_file_shared.sh: New script.
13845 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13846 (check_DATA): Add two_file_shared.dbg.
13847 (two_file_shared.dbg): New target.
13848 * testsuite/Makefile.in: Rebuild.
13850 2009-03-01 Ian Lance Taylor <iant@google.com>
13852 * configure.ac: Check for byteswap.h.
13853 * configure: Rebuild.
13854 * config.in: Rebuild.
13856 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13858 * layout.cc (Layout::find_or_add_kept_section): New function.
13859 (Layout::add_comdat): Removed.
13860 * layout.h (struct Kept_section): Move out of class Layout.
13861 Remove trailing underscores from field names. Add group_sections
13862 field. Rename group_ field to is_group. Change all uses.
13863 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13864 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13865 comdat_groups_ field.
13866 (Sized_relobj::include_section_group): Use
13867 find_or_add_kept_section and Kept_section::group_sections.
13868 (Sized_relobj::include_linkonce_section): Likewise.
13869 * object.cc (class Sized_relobj): Don't define Comdat_group or
13870 Comdat_group_table. Remove find_comdat_group and
13871 add_comdat_group. Remove comdat_groups_ field.
13872 * plugin.cc (include_comdat_group): Use
13873 Layout::find_or_add_kept_section.
13875 2009-02-28 Ian Lance Taylor <iant@google.com>
13877 * README: --gc-sections and map files are now supported. Document
13878 some build requirements.
13881 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13882 relocatable link set the value of the section symbol to zero.
13883 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13884 relocatable link don't include the section address in the local
13887 2009-02-27 Ian Lance Taylor <iant@google.com>
13890 * options.h (class Search_directory): Add is_system_directory.
13891 (class General_options): Declare is_in_system_directory.
13892 * options.cc (get_relative_sysroot): Make static.
13893 (get_default_sysroot): Make static.
13894 (General_optoins::is_in_system_directory): New function.
13895 * fileread.cc (Input_file::is_in_system_directory): New function.
13896 * fileread.h (class Input_file): Declare is_in_system_directory.
13897 * object.h (class Object): Add is_in_system_directory.
13898 (class Input_objects): Remove system_library_directory_ field.
13899 * object.cc (Input_objects::add_object): Don't set
13900 system_library_directory_.
13901 (input_objects::found_in_system_library_directory): Remove.
13902 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13903 parameter. Change all callers.
13904 (Symbol_table::sized_write_globals): Likewise.
13905 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13906 Call Object::is_in_system_directory.
13907 * symtab.h (class Symbol_table): Update declarations.
13910 * descriptors.h (Open_descriptor): Add is_on_stack field.
13911 * descriptors.cc (Descriptors::open): If the descriptor is on the
13912 top of the stack, remove it. Initialize is_on_stack field.
13913 (Descriptors::release): Only add pod to stack if it is not on the
13915 (Descriptors::close_some_descriptor): Clear stack_next and
13916 is_on_stack fields.
13919 * output.cc (Output_section::find_starting_output_address): Rename
13920 from starting_output_address; add PADDR parameter; change return
13922 * output.h (class Output_section): Declare
13923 find_starting_output_address instead of starting_output_address.
13924 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13925 section symbol for which we can't find a merge section.
13928 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13929 hidden or internal, force the symbol to be local.
13930 * resolve.cc (Symbol::override_visibility): Define.
13931 (Symbol::override_base): Use override_visibility.
13932 (Symbol_table::resolve): Likewise.
13933 (Symbol::override_base_with_special): Likewise.
13934 (Symbol_table::override_with_special): If the visibility is hidden
13935 or internal, force the symbol to be local.
13936 * symtab.h (class Symbol): Add set_visibility and
13937 override_visibility.
13938 * testsuite/ver_test_1.sh: New file.
13939 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13940 (check_DATA): Add ver_test_1.syms.
13941 (ver_test_1.syms): New target.
13942 * testsuite/Makefile.in: Rebuild.
13944 2009-02-25 Cary Coutant <ccoutant@google.com>
13946 * layout.cc (Layout::choose_output_section): Don't rename sections
13947 when using a linker script that has a SECTIONS clause.
13948 * Makefile.in: Regenerate.
13950 * testsuite/Makefile.am (script_test_5.sh): New test case.
13951 * testsuite/Makefile.in: Regenerate.
13952 * testsuite/script_test_5.cc: New file.
13953 * testsuite/script_test_5.sh: New file.
13954 * testsuite/script_test_5.t: New file.
13956 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
13958 * archive.cc (Archive::include_member): Update calls to add_symbols.
13959 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13960 the Layout argument.
13961 * dynobj.h (do_add_symbols): Add the Layout argument.
13962 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13964 * object.h (Object::add_symbols): Add the Layout argument.
13965 (Object::do_add_symbols): Add the Layout argument.
13966 (Sized_relobj::do_add_symbols): Add the Layout argument.
13967 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13968 Unify the two versions.
13969 (Add_plugin_symbols): Remove.
13970 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13971 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13972 (Add_plugin_symbols): Remove.
13973 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13974 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13975 (Add_symbols::run): Make it work with Pulginobj.
13977 2009-02-06 Ian Lance Taylor <iant@google.com>
13979 * object.cc (Sized_relobj::do_layout): Make info message start
13980 with lower case letter.
13982 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13984 * binary.cc: Fix file comment.
13986 * options.h (enum Incremental_disposition): Define.
13987 (class General_options): Add new options: --incremental,
13988 --incremental_changed, --incremental_unchanged,
13989 --incremental_unknown. Add incremental_disposition_ and
13990 implicit_incremental_ fields.
13991 (General_options::incremental_disposition): New function.
13992 (class Position_dependent_options): Add incremental_disposition
13994 (Position_dependent_options::copy_from_options): Set incremental
13996 * options.cc (General_options::parse_incremental_changed): New
13998 (General_options::parse_incremental_unchanged): New function.
13999 (General_options::parse_incremental_unknown): New function.
14000 (General_options::General_options): Initialize new fields
14001 incremental_disposition_ and implicit_incremental_.
14002 (General_options::finalize): Check for uasge of --incremental-*
14003 without --incremental.
14005 2009-02-06 Chris Demetriou <cgd@google.com>
14007 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14008 pointer and to report location as the file name associated with
14010 (gold_undefined_symbol_at_location): New function to replace the
14011 old gold_undefined_symbol functionality.
14012 * target-reloc.h (relocate_section): Update to use
14013 gold_undefined_symbol_at_location.
14014 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14015 Call gold_undefined_symbol function rather than gold_error.
14016 * errors.h (Errors::undefined_symbol): Take location as a
14017 string, rather than calculating it from a relocation.
14018 * errors.cc (Errors::fatal): Print "fatal error:" before the
14020 (Errors::error, Errors::error_at_location): Print "error: "
14021 before the formatted message.
14022 (Errors::undefined_symbol): Take location as a string, rather
14023 than calculating it from a relocation.
14024 (gold_undefined_symbol_at_location): New function akin to
14025 old gold_undefined_symbol, calculates location from relocation.
14026 (gold_undefined_symbol): Change to take only a Symbol pointer
14027 and to report location as the file name associated with the symbol.
14028 * testsuite/debug_msg.sh: Update for changed error messages.
14029 * testsuite/undef_symbol.sh: Likewise.
14031 2009-02-04 Duncan Sands <baldrick@free.fr>
14034 * reduced_debug_output.h
14035 (Output_reduced_debug_abbrev_section::failed): Use format for
14037 (Output_reduced_debug_info_section::faild): Likewise.
14039 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14041 * script.cc (Lazy_demangler): New class.
14042 (Version_script_info::get_symbol_version_helper): Demangle a
14045 2009-01-29 Cary Coutant <ccoutant@google.com>
14047 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14049 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14051 2009-01-28 Ian Lance Taylor <iant@google.com>
14053 * version.cc (version_string): Bump to 1.9.
14055 * gold.h: Include <cstring> and <stdint.h>.
14056 * version.cc: Include <cstdio>.
14057 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14059 * reduced_debug_output.cc (insert_into_vector): Rename from
14060 Insert_into_vector; change all callers. Use Swap_unaligned to
14061 avoid aliasing issue; remove union since it is unnecessary.
14063 2009-01-27 Sriraman Tallam <tmsriram@google.com>
14065 * Makefile.am (CCFILES): Add gc.cc.
14066 (HFILES): Add gc.h.
14067 * Makefile.in: Regenerate.
14068 * gold.cc (Gc_runner): New class.
14069 (queue_initial_tasks): Call garbage collection related tasks
14070 when corresponding options are invoked.
14071 (queue_middle_gc_tasks): New function.
14072 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14073 processed early before laying out sections during garbage collection.
14074 * gold.h (queue_middle_gc_tasks): New function.
14075 (is_prefix_of): Move from "layout.cc".
14076 * i386.cc (Target_i386::gc_process_relocs): New function.
14077 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14078 * main.cc (main): Create object of class "Garbage_collection".
14079 * object.cc (Relobj::copy_symbols_data): New function.
14080 (Relobj::is_section_name_included): New function.
14081 (Sized_relobj::do_layout): Allow this function to be called twice
14082 during garbage collection and defer layout of section during the
14084 * object.h (Relobj::get_symbols_data): New function.
14085 (Relobj::is_section_name_included): New function.
14086 (Relobj::copy_symbols_data): New function.
14087 (Relobj::set_symbols_data): New function.
14088 (Relobj::get_relocs_data): New function.
14089 (Relobj::set_relocs_data): New function.
14090 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14091 (Relobj::gc_process_relocs): New function.
14092 (Relobj::do_gc_process_relocs): New pure virtual function.
14093 (Relobj::sd_): New data member.
14094 (Sized_relobj::is_output_section_offset_invalid): New function.
14095 (Sized_relobj::do_gc_process_relocs): New function.
14096 * options.h (General_options::gc_sections): Modify to not be a no-op.
14097 (General_options::print_gc_sections): New option.
14098 * plugin.cc (Plugin_finish::run): Remove function call to
14099 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14100 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14101 * reloc.cc (Read_relocs::run): Add task to process relocs and
14102 determine unreferenced sections when doing garbage collection.
14103 (Gc_process_relocs): New class.
14104 (Sized_relobj::do_gc_process_relocs): New function.
14105 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14106 sections that are garbage collected.
14107 * reloc.h (Gc_process_relocs): New class.
14108 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14109 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14110 symbols whose corresponding sections are garbage collected.
14111 (Symbol_table::Symbol_table): Add new parameter for the garbage
14113 (Symbol_table::gc_mark_undef_symbols): New function.
14114 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14115 (Symbol_table::gc_mark_dyn_syms): New function.
14116 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14118 (Symbol_table::add_from_object): Likewise.
14119 (Symbol_table::add_from_relobj): When building shared objects, do not
14120 treat externally visible symbols as garbage.
14121 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14122 table information for static and relocatable links.
14123 * symtab.h (Symbol_table::set_gc): New function.
14124 (Symbol_table::gc): New function.
14125 (Symbol_table::gc_mark_undef_symbols): New function.
14126 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14127 (Symbol_table::gc_mark_dyn_syms): New function.
14128 (Symbol_table::gc_): New data member.
14129 * target.h (Sized_target::gc_process_relocs): New pure virtual
14131 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14132 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14134 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14136 * options.h (General_options::gc_sections): Define as a no-op for now.
14137 (General_options::no_keep_memory): Ditto.
14138 (General_options::Bshareable): Define.
14139 * options.cc (General_options::finalize): Honor -Bshareable.
14141 2009-01-20 Andreas Schwab <schwab@suse.de>
14143 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14144 read the value in the contents, since we don't use it. Use the
14145 template endianness when writing.
14146 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14148 2009-01-19 Andreas Schwab <schwab@suse.de>
14150 * configure.tgt (powerpc64-*): Fix targ_obj.
14152 2009-01-15 Ian Lance Taylor <iant@google.com>
14154 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14155 local symbols when stripping all symbols.
14157 2009-01-14 Cary Coutant <ccoutant@google.com>
14159 * output.cc (Output_reloc): Add explicit instantiations.
14161 2009-01-14 Cary Coutant <ccoutant@google.com>
14163 * archive.cc (Archive::get_elf_object_for_member): Remove call
14164 to File_read::claim_for_plugin.
14165 * descriptors.cc (Descriptors::open): Remove reference to
14167 (Descriptors::claim_for_plugin): Remove.
14168 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14169 (Descriptors::is_claimed): Remove.
14170 (claim_descriptor_for_plugin): Remove.
14171 * fileread.cc (File_read::claim_for_plugin): Remove.
14172 * fileread.h (File_read::claim_for_plugin): Remove.
14173 (File_read::descriptor): Reopen descriptor if necessary.
14174 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14175 (Plugin_manager::all_symbols_read): Add task parameter. Change
14177 (Plugin_manager::get_input_file): New function.
14178 (Plugin_manager::release_input_file): New function.
14179 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14180 corresponding data member.
14181 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14182 and pass to base constructor. Change all callers.
14183 (get_input_file, release_input_file): New functions.
14184 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14185 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14186 (Plugin_manager::all_symbols_read): Add task parameter.
14187 (Plugin_manager::get_input_file): New function.
14188 (Plugin_manager::release_input_file): New function.
14189 (Plugin_manager::task_): New data member.
14190 (Pluginobj::Pluginobj): Add filesize parameter.
14191 (Pluginobj::filename): New function.
14192 (Pluginobj::descriptor): New function.
14193 (Pluginobj::filesize): New function.
14194 (Pluginobj::filesize_): New data member.
14195 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14196 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14197 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14199 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14200 with archive libraries.
14201 * testsuite/Makefile.in: Regenerate.
14202 * testsuite/plugin_test.c (struct sym_info): New type.
14203 (get_input_file, release_input_file): New static variables.
14204 (onload): Capture new transfer vector entries.
14205 (claim_file_hook): Stop reading at end of file according to filesize.
14206 Factor out parsing of readelf output into separate function.
14207 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14208 APIs and get the source file name from the symbol table. Convert
14209 source file name to corresponding object file name. Print info
14210 message when adding new input files.
14211 (parse_readelf_line): New function.
14212 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14213 * testsuite/plugin_test_2.sh: Likewise.
14214 * testsuite/plugin_test_3.sh: Likewise.
14215 * testsuite/plugin_test_4.sh: New test case.
14217 2009-01-07 Ian Lance Taylor <iant@google.com>
14219 * version.cc (version_string): Bump to 1.8.
14221 2008-12-23 Cary Coutant <ccoutant@google.com>
14223 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14224 * plugin.cc (Plugin_manager::finish): Rename as
14225 layout_deferred_objects. Move cleanup to separate function.
14226 (Plugin_manager::cleanup): New function.
14227 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14229 * plugin.h (Plugin_manager::finish): Rename as
14230 layout_deferred_objects.
14231 (Plugin_manager::cleanup): New function.
14232 (Plugin_manager::cleanup_done): New field.
14234 2008-12-23 Cary Coutant <ccoutant@google.com>
14236 * plugin.cc (is_visible_from_outside): New function.
14237 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14238 so we don't return "IR only" status for exported symbols or -r links.
14240 * testsuite/Makefile.am (plugin_test_3): New test case.
14241 * testsuite/Makefile.in: Regenerate.
14242 * testsuite/plugin_test_3.sh: New file.
14244 2008-12-22 Cary Coutant <ccoutant@google.com>
14246 * object.cc (Sized_relobj::layout_section): New function.
14247 (Sized_relobj::do_layout): Defer layout of input sections until after
14248 plugin has provided replacement files.
14249 (Sized_relobj::do_layout_deferred_sections): New function.
14250 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14251 (Relobj::layout_deferred_sections): New function.
14252 (Relobj::do_layout_deferred_sections): New function.
14253 (Sized_relobj::do_layout_deferred_sections): New function.
14254 (Sized_relobj::layout_section): New function.
14255 (Sized_relobj::Deferred_layout): New structure.
14256 (Sized_relobj::deferred_layout_): New field.
14257 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14258 Change all callers. Layout deferred sections.
14259 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14261 (Plugin_hook::run): Move code from do_plugin_hook inline.
14262 (Plugin_hook::do_plugin_hook): Remove.
14263 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14264 (Plugin_manager::finish): Renamed, was cleanup.
14265 (Plugin_manager::should_defer_layout): New function.
14266 (Plugin_manager::add_deferred_layout_object): New function.
14267 (Plugin_manager::Deferred_layout_list): New type.
14268 (Plugin_manager::deferred_layout_objects_): New field.
14269 (Plugin_hook::do_plugin_hook): Remove.
14271 2008-12-17 Ian Lance Taylor <iant@google.com>
14273 * options.h (class General_options): Add --no case for
14276 2008-12-16 Cary Coutant <ccoutant@google.com>
14278 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14280 (Plugin_manager::claim_file): Create plugin object even if
14281 plugin did not call the add_symbols callback.
14282 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14283 asking for more symbols than were added.
14284 * testsuite/Makefile.am (plugin_test_1): Add test case with
14286 (empty.syms): New target.
14287 * testsuite/Makefile.in: Regenerate.
14288 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14289 message. Don't call add_symbols if no globals.
14290 (all_symbols_read_hook): Don't provide replacement for empty
14293 2008-12-12 Ian Lance Taylor <iant@google.com>
14295 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14296 r_type == 0 for a local symbol with r_sym == 0.
14297 (scan_relocatable_relocs): Pass r_sym to
14298 local_non_section_strategy.
14299 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14302 * configure.ac: Update test for TLS descriptors: they are
14303 supported as of glibc 2.9.
14304 * configure: Rebuild.
14306 2008-12-11 Ian Lance Taylor <iant@google.com>
14309 * target-reloc.h (Default_scan_relocatable_relocs): For each
14310 function, map r_type == 0 to RELOC_DISCARD.
14312 2008-12-10 Cary Coutant <ccoutant@google.com>
14314 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14315 object to override a kept COMDAT group from a plugin object.
14317 2008-12-09 Ian Lance Taylor <iant@google.com>
14320 * yyscript.y (file_cmd): Handle INPUT.
14322 * testsuite/initpri1.c: Change all declarations to be full
14323 prototypes by adding void, to avoid compiler warnings.
14325 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
14327 * options.cc (General_options::parse_plugin_opt): New.
14328 (General_options::add_plugin): The argument now is just the filename.
14329 (General_options::add_plugin_option): New.
14330 * options.h (plugin_opt): New.
14331 (add_plugin): Change argument name.
14332 (add_plugin_option): New.
14333 * plugin.cc (Plugin::load): Don't parse the plugin option.
14334 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14335 (Plugin::add_option): New.
14336 (Plugin::args_): Change type.
14337 (Plugin::filename_): New.
14338 (Plugin_manager::add_plugin_option): New.
14339 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14340 * testsuite/Makefile.in: Regenerate.
14342 2008-12-05 Cary Coutant <ccoutant@google.com>
14344 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14345 Handle --strip-lto-sections option.
14346 * options.h (strip_lto_sections): New option.
14348 2008-12-01 Cary Coutant <ccoutant@google.com>
14350 * plugin.cc (ld_plugin_message): Change format parameter to const.
14351 Fix mismatch between new[] and delete.
14353 2008-11-14 Cary Coutant <ccoutant@google.com>
14355 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14358 2008-11-05 Craig Silverstein <csilvers@google.com>
14360 * options.cc (General_options::parse_dynamic_list): New function.
14361 * options.h (General_options): New flags dynamic_list,
14362 dynamic_list_data, dynamic_list_cpp_new, and
14363 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14364 (General_options::in_dynamic_list): New function.
14365 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14366 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14367 (Lex::can_continue_name): Likewise.
14369 (read_script_file): New parameter script_options.
14370 (read_dynamic_list): New function.
14371 (Script_options::define_dynamic_list): New function.
14372 (dynamic_list_keyword_parsecodes): New variable.
14373 (dynamic_list_keywords): New variable.
14374 * script.h (Script_options::define_dynamic_list): New function
14376 (read_dynamic_list): New function prototype.
14377 * symtab.cc (strprefix): New macro.
14378 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14379 dynamic_list_data, dynamic_list_cpp_new, and
14380 dynamic_list_cpp_typeinfo.
14381 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14382 (dynamic_list_expr): New rule.
14383 (dynamic_list_nodes): Likewise.
14384 (dynamic_list_node): Likewise.
14385 * testsuite/Makefile.am (dynamic_list): New test.
14386 * testsuite/Makefile.in: Regenerated.
14387 * testsuite/dynamic_list.t: New file.
14388 * testsuite/dynamic_list.sh: New file.
14390 2008-11-05 Craig Silverstein <csilvers@google.com>
14392 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14393 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14394 (t11_last): Likewise.
14395 * testsuite/ver_test_6.c (main): Likewise.
14397 2008-10-07 Cary Coutant <ccoutant@google.com>
14399 * options.c (General_options::finalize): Add check for -static and
14401 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14404 2008-10-02 Cary Coutant <ccoutant@google.com>
14406 * plugin.cc (make_sized_plugin_object): Fix conditional
14407 compilation to work when not all targets are enabled.
14409 2008-09-29 Cary Coutant <ccoutant@google.com>
14411 * archive.cc (Archive::get_file_and_offset): Use filename instead
14412 of name to get library path.
14413 (Archive::include_member): Unlock external member of a thin archive.
14415 * testsuite/Makefile.am (TEST_AR): New variable.
14416 (thin_archive_test_1): New test.
14417 (thin_archive_test_2): New test.
14418 * testsuite/Makefile.in: Regenerate.
14419 * testsuite/thin_archive_main.cc: New file.
14420 * testsuite/thin_archive_test_1.cc: New file.
14421 * testsuite/thin_archive_test_2.cc: New file.
14422 * testsuite/thin_archive_test_3.cc: New file.
14423 * testsuite/thin_archive_test_4.cc: New file.
14425 2008-09-29 Cary Coutant <ccoutant@google.com>
14427 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14428 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14430 (Sized_relobj::do_finalize_local_symbols): Likewise.
14431 (Sized_relobj::map_to_kept_section): Likewise.
14432 * object.h (Sized_relobj::invalid_address): New constant.
14433 (Sized_relobj::do_output_section_offset): Check for invalid_address
14435 * output.cc (Output_reloc::local_section_offset): Use constant
14436 invalid_address instead of -1U.
14437 (Output_reloc::get_address): Likewise.
14438 (Output_section::output_address): Change -1U to -1ULL.
14439 * output.h (Output_reloc::invalid_address): New constant.
14440 * reloc.cc (Sized_relobj::write_sections): Use constant
14441 invalid_address instead of -1U.
14442 (Sized_relobj::relocate_sections): Likewise.
14443 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14444 values for merge sections.
14445 * target-reloc.h (relocate_for_relocatable): Use constant
14446 invalid_address instead of -1U.
14448 2008-09-19 Cary Coutant <ccoutant@google.com>
14450 Add plugin functionality for link-time optimization (LTO).
14451 * configure.ac (plugins): Add --enable-plugins option.
14452 * configure: Regenerate.
14453 * config.in: Regenerate.
14454 * Makefile.am (LIBDL): New variable.
14455 (CCFILES): Add plugin.cc.
14456 (HFILES): Add plugin.h.
14457 (ldadd_var): Add LIBDL.
14458 * Makefile.in: Regenerate.
14460 * archive.cc: Include "plugin.h".
14461 (Archive::setup): Don't preread archive symbols when using a plugin.
14462 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14463 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14465 (Archive::include_member): Add symbols from plugin objects.
14466 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14467 * descriptors.cc (Descriptors::open): Check for file descriptors
14468 abandoned by plugins.
14469 (Descriptors::claim_for_plugin): New function.
14470 * descriptors.h (Descriptors::claim_for_plugin): New function.
14471 (Open_descriptor::is_claimed): New field.
14472 (claim_descriptor_for_plugin): New function.
14473 * fileread.cc (File_read::claim_for_plugin): New function.
14474 * fileread.h (File_read::claim_for_plugin): New function.
14475 (File_read::descriptor): New function.
14476 * gold.cc: Include "plugin.h".
14477 (queue_initial_tasks): Add task to call plugin hooks for generating
14479 * main.cc: Include "plugin.h".
14480 (main): Load plugin libraries.
14481 * object.h (Pluginobj): Declare.
14482 (Object::pluginobj): New function.
14483 (Object::do_pluginobj): New function.
14484 (Object::set_target): New function.
14485 * options.cc: Include "plugin.h".
14486 (General_options::parse_plugin): New function.
14487 (General_options::General_options): Initialize plugins_ field.
14488 (General_options::add_plugin): New function.
14489 * options.h (Plugin_manager): Declare.
14490 (General_options): Add --plugin option.
14491 (General_options::has_plugins): New function.
14492 (General_options::plugins): New function.
14493 (General_options::add_plugin): New function.
14494 (General_options::plugins_): New field.
14495 * plugin.cc: New file.
14496 * plugin.h: New file.
14497 * readsyms.cc: Include "plugin.h".
14498 (Read_symbols::do_read_symbols): Check for archive before checking
14499 for ELF file. Call plugin hooks to claim files.
14500 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14501 from a real object file; force override when processing replacement
14503 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14504 (Symbol::init_base_object): Likewise.
14505 (Symbol::init_base_output_data): Likewise.
14506 (Symbol::init_base_output_segment): Likewise.
14507 (Symbol::init_base_constant): Likewise.
14508 (Symbol::init_base_undefined): Likewise.
14509 (Symbol::output_section): Assert that object is not a plugin.
14510 (Symbol_table::add_from_pluginobj): New function.
14511 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14513 (Symbol_table::sized_write_globals): Likewise.
14514 (Symbol_table::add_from_pluginobj): Instantiate template.
14515 * symtab.h (Sized_pluginobj): Declare.
14516 (Symbol::in_real_elf): New function.
14517 (Symbol::set_in_real_elf): New function.
14518 (Symbol::in_real_elf_): New field.
14519 (Symbol_table::add_from_pluginobj): New function.
14521 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14522 (LIBDL): New variable.
14523 (LDADD): Add LIBDL.
14524 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14525 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14526 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14527 (MOSTLYCLEANFILES): Likewise.
14528 * testsuite/Makefile.in: Regenerate.
14529 * testsuite/plugin_test.c: New file.
14530 * testsuite/plugin_test_1.sh: New file.
14531 * testsuite/plugin_test_2.sh: New file.
14533 2008-09-16 Ian Lance Taylor <iant@google.com>
14535 * target-reloc.h (relocate_section): Check whether a symbol is
14536 defined by the ABI before reporting an undefined symbol error.
14537 * target.h (Target::is_defined_by_abi): Make parameter const.
14538 (Target::do_is_defined_by_abi): Likewise.
14539 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14540 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14541 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14542 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14543 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14544 * testsuite/Makefile.in: Rebuild.
14546 * fileread.cc (make_view): Add casts to avoid warning.
14548 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
14550 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14551 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14553 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
14555 * options.h (General_options::output_is_executable): New.
14556 (General_options::output_is_pie): New.
14557 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14558 for shared libraries.
14559 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14561 2008-09-11 Chris Demetriou <cgd@google.com>
14563 * options.h (origin): New -z option.
14564 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14565 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14568 2008-09-05 Cary Coutant <ccoutant@google.com>
14570 * fileread.cc (File_read::make_view): Add check for attempt to map
14571 beyond end of file.
14573 2008-09-05 Cary Coutant <ccoutant@google.com>
14575 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14576 explicit instantiations.
14578 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14581 * options.cc (General_options::finalize): Allow undefined symbols
14582 in shlibs if linking -shared.
14585 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14586 symbols as not needing a dynsym entry.
14588 2008-08-20 Craig Silverstein <csilvers@google.com>
14590 * fileread.cc (File_read::open): Do not lock the file unless it
14591 was successfully opened.
14593 2008-08-14 Cary Coutant <ccoutant@google.com>
14595 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14596 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14597 * testsuite/tls_test.cc (struct int128): 128-bit struct
14598 for testing TLS relocs with non-zero addend.
14599 (v12): New TLS variable.
14601 (t_last): Add check for v12.
14602 * testsuite/tls_test.h (t12): New function.
14603 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14605 2008-08-13 Ian Lance Taylor <iant@google.com>
14607 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14608 set tls_segment_ or relro_segment_.
14609 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14611 * output.h (Output_section::clear_is_relro): New function.
14612 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14613 sections specially even when output_data_ is empty.
14614 (Output_segment::maximum_alignment): When first section is relro,
14615 only force alignment for PT_LOAD segments.
14616 * script.cc (script_data_segment_align): New function.
14617 (script_data_segment_relro_end): New function.
14618 * script-c.h (script_data_segment_align): Declare.
14619 (script_data_segment_relro_end): Declare.
14620 * script-sections.h (class Script_sections): Declare
14621 data_segment_align and data_segment_relro_end. Add fields
14622 segment_align_index_ and saw_relro_end_.
14623 * script-sections.cc (class Sections_element): Add set_is_relro
14624 virtual function. Add new bool* parameter to place_orphan_here.
14625 Add get_output_section virtual function.
14626 (class Output_section_definition): Add set_is_relro. Add new
14627 bool* parameter to place_orphan_here. Add get_output_section.
14628 Add is_relro_ field.
14629 (Output_section_definition::Output_section_definition): Initialize
14630 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14631 and is_relro_ fields.
14632 (Output_section_definition::place_orphan_here): Add is_relro
14634 (Output_section_definition::set_section_addresses): Set relro for
14636 (Output_section_definition::alternate_constraint): Likewise.
14637 (class Orphan_output_section): Add new bool* parameter to
14638 place_orphan_here. Add get_output_section.
14639 (Orphan_output_section::place_orphan_here): Add is_relro
14641 (Script_sections::Script_sections): Initialize
14642 data_segment_align_index_ and saw_relro_end_.
14643 (Script_sections::data_segment_align): New function.
14644 (Script_sections::data_segment_relro_end): New function.
14645 (Script_sections::place_orphan): Set or clear is_relro.
14646 (Script_sections::set_section_addresses): Force alignment of first
14648 * yyscript.y (exp): Call script_data_segment_align and
14649 script_data_segment_relro_end.
14650 * testsuite/relro_script_test.t: New file.
14651 * testsuite/relro_test.cc (using_script): Declare.
14652 (t1, t2): Test using_script.
14653 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14654 (relro_script_test_SOURCES): Define.
14655 (relro_script_test_DEPENDENCIES): Define.
14656 (relro_script_test_LDFLAGS): Define.
14657 (relro_script_test_LDADD): Define.
14658 (relro_script_test.so): New target.
14659 * testsuite/Makefile.in: Rebuild.
14661 2008-08-06 Cary Coutant <ccoutant@google.com>
14663 * archive.cc (Archive::total_archives, Archive::total_members)
14664 (Archive::total_members_loaded): New variables.
14665 (Archive::setup): Add parameter. Add option to preread
14667 (Archive::read_armap): Add counter.
14668 (Archive::get_file_and_offset): New function.
14669 (Archive::get_elf_object_for_member): New function.
14670 (Archive::read_all_symbols): New function.
14671 (Archive::read_symbols): New function.
14672 (Archive::add_symbols): Add counters.
14673 (Archive::include_all_members): Use armap to find members if it's
14675 (Archive::include_member): Skip reading symbols if already read.
14676 Factored code into Archive::get_file_and_offset and
14677 Archive::get_elf_object_for_member. Changed call to
14678 Mapfile::report_include_archive_member.
14679 (Archive::print_stats): New function.
14680 * archive.h: Declare Object and Read_symbols_data classes.
14681 (Archive::Archive): Add initializers for new members.
14682 (Archive::setup): Add parameter.
14683 (Archive::print_stats): New function.
14684 (Archive::total_archives, Archive::total_members)
14685 (Archive::total_members_loaded): New variables.
14686 (Archive::get_file_and_offset): New function.
14687 (Archive::get_elf_object_for_member): New function.
14688 (Archive::read_all_symbols): New function.
14689 (Archive::read_symbols): New function.
14690 (Archive::Archive_member): New class.
14691 (Archive::members_): New member.
14692 (Archive::num_members_): New member.
14693 * main.cc: Include archive.h.
14694 (main): Call Archive::print_stats.
14695 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14696 archive parameter; member_name is now the fully-decorated name.
14697 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14698 * options.h: (General_options): Add --preread-archive-symbols option.
14699 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14702 2008-08-04 Ian Lance Taylor <iant@google.com>
14704 * symtab.h (Symbol::use_plt_offset): New function.
14705 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14706 * powerpc.cc (Relocate::relocate): Likewise.
14707 * sparc.cc (Relocate::relocate): Likewise.
14708 * x86_64.cc (Relocate::relocate): Likewise.
14709 * testsuite/weak_plt.sh: New test.
14710 * testsuite/weak_plt_main.cc: New test.
14711 * testsuite/weak_plt_shared.cc: New test.
14712 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14713 (check_PROGRAMS): Add weak_plt.
14714 (check_DATA): Add weak_plt_shared.so.
14715 (weak_plt_main_pic.o, weak_plt): New targets.
14716 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14717 * testsuite/Makefile.in: Rebuild.
14719 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14721 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14722 * testsuite/Makefile.in: Rebuild.
14724 2008-08-04 Alan Modra <amodra@bigpond.net.au>
14726 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14727 * Makefile.in: Regenerate.
14728 * po/POTFILES.in: Regenerate.
14730 2008-07-29 Ian Lance Taylor <iant@google.com>
14732 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14733 symbols before other symbols.
14734 * testsuite/script_test_2.cc (test_addr): Declare.
14735 (test_addr_alias): Declare.
14736 (main): Check that test_addr and test_addr_alias have the right
14738 * testsuite/script_test_2.t: Define test_addr_alias and
14741 2008-07-24 Ian Lance Taylor <iant@google.com>
14744 * descriptors.cc: New file.
14745 * descriptors.h: New file.
14746 * gold-threads.h (class Hold_optional_lock): New class.
14747 * fileread.cc: Include "descriptors.h".
14748 (File_read::~File_read): Release descriptor rather than closing
14750 (File_read::open) [file]: Call open_descriptor rather than open.
14751 Set is_descriptor_opened_.
14752 (File_read::open) [memory]: Assert that descriptor is not open.
14753 (File_read::reopen_descriptor): New function.
14754 (File_read::release): Release descriptor.
14755 (File_read::do_read): Make non-const. Reopen descriptor.
14756 (File_read::read): Make non-const.
14757 (File_read::make_view): Reopen descriptor.
14758 (File_read::do_readv): Likewise.
14759 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14760 Update declarations.
14761 * layout.cc: Include "descriptors.h".
14762 (Layout::create_build_id): Use open_descriptor rather than open.
14763 * output.cc: Include "descriptors.h".
14764 (Output_file::open): Use open_descriptor rather than open.
14765 * archive.cc (Archive::const_iterator): Change Archive to be
14767 (Archive::begin, Archive::end): Make non-const.
14768 (Archive::count_members): Likewise.
14769 * archive.h (class Archive): Update declarations.
14770 * object.h (Object::read): Make non-const.
14771 * Makefile.am (CCFILES): Add descriptors.cc.
14772 (HFILES): Add descriptors.h.
14773 * Makefile.in: Rebuild.
14776 * gold.h: Always include <clocale>. Add Solaris workarounds
14777 following code in binutils/sysdep.h.
14780 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14781 this->eh_frame_hdr_ is NULL before using it.
14783 * dynobj.cc (Versions::Versions): Update comment.
14785 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14786 the base version name.
14788 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14789 array size plus one.
14790 (Stringpool_template::set_string_offsets): Subtract one from key
14791 before using it as an array index.
14792 (Stringpool_template::get_offset_with_length): Likewise.
14793 (Stringpool_template::write_to_buffer): Likewise.
14794 * stringpool.h (Stringpool_template::get_offset_from_key):
14797 2008-07-23 Ian Lance Taylor <iant@google.com>
14800 * object.h (Merged_symbol_value::value): Do our best to handle a
14804 * script.cc (Version_script_info::get_versions): Don't add empty
14805 version tag to return value.
14806 (Version_script_info::get_symbol_version_helper): Change return
14807 type to bool. Add pversion parameter. Change all callers.
14808 (script_register_vers_node): Don't require a non-NULL tag.
14809 * script.h (class Version_script_info): Update declarations.
14810 (Version_script_info::get_symbol_version): Change return type to
14811 bool. Add version parameter. Change all callers.
14812 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14813 handling. Handle an empty version from a version script.
14814 (Symbol_table::define_special_symbol): Likewise.
14815 * testsuite/ver_test_10.script: New file.
14816 * testsuite/ver_test_10.sh: New file.
14817 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14818 (check_DATA): Add ver_test_10.syms.
14819 (ver_test_10.syms, ver_test_10.so): New target.
14820 * testsuite/Makefile.in: Rebuild.
14822 2008-07-23 Simon Baldwin <simonb@google.com>
14824 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14825 to zero for undefined symbols from dynamic libraries.
14827 2008-07-23 Ian Lance Taylor <iant@google.com>
14829 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14830 Change all callers.
14831 * symtab.h (class Symbol_table): Update declaration.
14832 * testsuite/ver_test_9.cc: New file.
14833 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14834 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14835 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14836 (ver_test_9.so, ver_test_9.o): New targets.
14837 * testsuite/Makefile.in: Rebuild.
14839 2008-07-22 Ian Lance Taylor <iant@google.com>
14841 * options.h (class General_options): Define --check-sections.
14842 * layout.cc (Layout::set_segment_offsets): Handle
14845 * options.h (class General_options): Define -n/--nmagic and
14847 * options.cc (General_options::finalize): For -n/--nmagic or
14848 -N/--omagic, set -static.
14849 * layout.cc (Layout::attach_allocated_section_to_segment): If
14850 -N/--omagic, don't put read-only and read-write sections in
14851 different segments.
14852 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14853 finding a read-only segment.
14854 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14855 don't set the minimum segment alignment to the common page size,
14856 and don't set the file offset to the address modulo the page size.
14857 * script-sections.cc (Script_sections::create_segments): If
14858 -n/--omagic, don't put read-only and read-write sections in
14859 different segments.
14861 * cref.cc: New file.
14862 * cref.h: New file.
14863 * options.h (class General_options): Add --print-symbol-counts.
14864 * main.cc (main): Issue defined symbol report if requested.
14865 * archive.cc (Archive::interpret_header): Make into a const member
14867 (Archive::add_symbols): Call Input_objects::archive_start and
14869 (Archive::const_iterator): Define new class.
14870 (Archive::begin, Archive::end): New functions.
14871 (Archive::include_all_members): Rewrite to use iterator.
14872 (Archive::count_members): New function.
14873 * archive.h (class Archive): Update declarations.
14874 (Archive::filename): New function.
14875 * object.cc: Include "cref.h".
14876 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14877 (Sized_relobj::do_get_global_symbol_counts): New function.
14878 (Input_objects::add_object): Add object to cross-referencer.
14879 (Input_objects::archive_start): New function.
14880 (Input_objects::archive_stop): New function.
14881 (Input_objects::print_symbol_counts): New function.
14882 * object.h: Declare Cref and Archive.
14883 (Object::get_global_symbol_counts): New function.
14884 (Object::do_get_global_symbol_counts): New pure virtual function.
14885 (class Sized_relobj): Add defined_count_ field. Update
14887 (class Input_objects): Add cref_ field. Update constructor.
14888 Update declarations.
14889 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14891 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14893 (Sized_dynobj::do_get_global_symbol_counts): New function.
14894 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14895 defined_count_. Update declarations. Define Symbols typedef.
14896 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14897 parameter. Change all callers.
14898 (Symbol_table::add_from_dynobj): Add sympointers and defined
14899 parameters. Change all callers.
14900 * symtab.h (class Symbol_table): Update declarations.
14901 * Makefile.am (CCFILES): Add cref.cc.
14902 (HFILES): Add cref.h.
14903 * Makefile.in: Rebuild.
14905 2008-07-22 Simon Baldwin <simonb@google.com>
14907 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14908 to zero when writing undefined symbols.
14910 2008-07-22 Ian Lance Taylor <iant@google.com>
14912 * output.cc (Output_section::add_input_section): Don't try to
14913 merge empty merge sections.
14915 2008-07-21 Craig Silverstein <csilvers@google.com>
14917 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14918 Include symbol version in error message.
14920 2008-07-20 Chris Demetriou <cgd@google.com>
14922 * configure.ac (gold_cv_c_random_seed): New configured variable.
14923 (RANDOM_SEED_CFLAGS): New substituted variable.
14924 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14925 * configure: Rebuild.
14926 * Makefile.in: Likewise.
14927 * testsuite/Makefile.in: Likewise.
14929 2008-07-18 Ian Lance Taylor <iant@google.com>
14931 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14932 where we see NAME/NULL and NAME/VERSION as separate symbols.
14933 * testsuite/ver_test_main.cc (main): Call t4.
14934 (t4, t4_2a): Define.
14935 * testsuite/ver_test_2.cc (t4_2): Define.
14936 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14937 * testsuite/ver_test_4.cc (t4_2a): Define.
14938 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14939 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14941 2008-07-17 Ian Lance Taylor <iant@google.com>
14943 * dynobj.cc (Versions::add_def): If we give an error about a
14944 missing version, go ahead and create the version anyhow.
14946 2008-07-10 Ian Lance Taylor <iant@google.com>
14948 Handle output sections with more than 0x7fffffff bytes.
14949 * object.h (class Relobj): Change map_to_output_ to
14950 output_sections_, and just keep a section pointer. Change all
14951 uses. Move comdat group support to Sized_relobj.
14952 (Relobj::is_section_specially_mapped): Remove.
14953 (Relobj::output_section): Remove poff parameter. Change all
14955 (Relobj::output_section_offset): New function.
14956 (Relobj::set_section_offset): Rewrite.
14957 (Relobj::map_to_output): Remove.
14958 (Relobj::output_sections): New function.
14959 (Relobj::do_output_section_offset): New pure virtual function.
14960 (Relobj::do_set_section_offset): Likewise.
14961 (class Sized_relobj): Add section_offsets_ field. Add comdat
14962 group support from Relobj. Update declarations.
14963 (Sized_relobj::get_output_section_offset): New function.
14964 (Sized_relobj::do_output_section_offset): New function.
14965 (Sized_relobj::do_set_section_offset): New function.
14966 * object.cc (Relobj::output_section_address): Remove.
14967 (Sized_relobj::Sized_relobj): Initialize new fields.
14968 (Sized_relobj::include_section_group): Cast find_kept_object to
14970 (Sized_relobj::include_linkonce_section): Likewise.
14971 (Sized_relobj::do_layout): Use separate arrays for output section
14973 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14975 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14976 output_sections and section_offsets.
14977 (Sized_relobj::write_local_symbols): Likewise.
14978 (map_to_kept_section): Compute output address directly.
14979 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14980 output_sections and section_offsets.
14981 (Sized_relobj::write_sections): Likewise.
14982 (Sized_relobj::relocate_sections): Likewise.
14983 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14984 * output.h (class Output_reloc): Update declarations. Change
14985 u2_.relobj to Sized_relobj*.
14986 (class Output_data_reloc): Change add functions to use
14988 * output.cc (Output_reloc::Output_reloc): Change relobj to
14990 (Output_reloc::local_section_offset): Change return type to
14991 Elf_Addr. Use get_output_section_offset.
14992 (Output_reloc::get_address): Likewise.
14993 (Output_section::is_input_address_mapped): Don't call
14994 is_section_specially_mapped.
14995 (Output_section::output_offset): Likewise.
14996 (Output_section::output_address): Likewise.
14997 (Output_section::starting_output_address): Likewise.
14998 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14999 parameter to Sized_relobj*.
15000 (Copy_relocs::need_copy_reloc): Likewise.
15001 (Copy_relocs::save): Likewise.
15002 * copy-relocs.h (class Copy_relocs): Update declarations.
15003 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15004 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15005 * target-reloc.h (relocate_for_relocatable): Change
15006 offset_in_output_section type to Elf_Addr. Change code that uses
15008 * layout.cc (Layout::layout): Always set *off.
15009 * mapfile.cc (Mapfile::print_input_section): Use
15010 output_section_offset.
15011 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15013 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15014 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15015 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15017 2008-07-03 Ian Lance Taylor <iant@google.com>
15019 * layout.cc (Layout::include_section): Do not discard unrecognized
15020 SHT_STRTAB sections.
15022 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15024 * script.cc (Lex::can_continue_name): Make '?' allowable in
15025 version-script names.
15026 * testsuite/version_script.map: Change glob pattern to use '?'
15028 2008-06-30 Manish Singh <yosh@gimp.org>
15031 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15034 2008-06-30 Ian Lance Taylor <iant@google.com>
15038 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15039 versions]: Don't try to read the value in the contents, since we
15040 don't use it. Use the template endianness when writing.
15042 2008-06-25 Cary Coutant <ccoutant@google.com>
15044 * fileread.cc (File_read::make_view): Assert on zero-length view.
15045 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15046 symbol table when there are no symbols to read.
15048 2008-06-23 Craig Silverstein <csilvers@google.com>
15050 * version.cc (version_string): Bump to 1.7
15052 2008-06-18 Craig Silverstein <csilvers@google.com>
15054 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15055 constant 0xFFFF to type Valtype.
15056 (Powerpc_relocate_functions::rel16_ha): Likewise.
15058 2008-06-17 Ian Lance Taylor <iant@google.com>
15060 * output.h (Output_section::Input_section): Initialize p2align_ to
15061 zero for Output_section_data constructors.
15062 (Output_section::Input_section::addralign): If not an input
15063 section, return the alignment of the Output_section_data.
15064 * testsuite/copy_test.cc: New file.
15065 * testsuite/copy_test_1.cc: New file.
15066 * testsuite/copy_test_2.cc: New file.
15067 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15068 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15069 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15070 (copy_test_1_pic.o, copy_test_1.so): New targets.
15071 (copy_test_2_pic.o, copy_test_2.so): New targets.
15072 * testsuite/Makefile.in: Rebuild.
15074 * script-sections.cc (Script_sections::place_orphan): Initialize
15075 local variable exact.
15077 2008-06-13 David Edelsohn <edelsohn@gnu.org>
15079 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15081 2008-06-12 David Edelsohn <edelsohn@gnu.org>
15082 David S. Miller <davem@davemloft.net>
15084 * powerpc.cc: New file.
15085 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15086 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15087 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15088 * Makefile.in: Rebuild.
15090 2008-06-09 Ian Lance Taylor <iant@google.com>
15092 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15094 (throwing, orig_terminate): New static variables.
15095 (terminate_handler): New static function.
15096 (t2): Set terminate handler.
15098 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15101 * binary.cc (Binary_to_elf::sized_convert): Fix .data
15104 2008-05-30 Cary Coutant <ccoutant@google.com>
15106 * archive.cc (Archive::include_all_members) Correct to step
15107 over symbol table and extended name table in thin archives.
15109 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15112 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15115 2008-05-28 Caleb Howe <cshowe@google.com>
15117 * reduced_debug_output.cc: New file.
15118 * reduced_debug_output.h: New file.
15119 * options.h (class General_options): Add --strip-debug-non-line.
15120 * options.cc (General_options::finalize): Add strip_debug_non_line
15121 to the strip heirarchy.
15122 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15124 * layout.cc: Include "reduced_debug_output.h".
15125 (Layout::Layout): Initialize new fields.
15126 (line_only_debug_sections): New static array.
15127 (is_lines_only_debug_sections): New static inline function.
15128 (Layout::include_section): Handle --strip-debug-non-line.
15129 (Layout::make_output_section): If --strip-debug-non-line, build
15130 new output sections for .debug_abbrev and .debug_info.
15131 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15132 gold. Warn about possible overflow.
15133 (read_signed_LEB_128): Likewise.
15134 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15135 (read_signed_LEB_128): Declare.
15136 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15137 (HFILES): Add reduced_debug_output.h.
15138 * Makefile.in: Rebuild.
15140 2008-05-21 Ian Lance Taylor <iant@google.com>
15142 * mapfile.cc: New file.
15143 * mapfile.h: New file.
15144 * options.h (class General_options): Add -M/--print-map and -Map.
15145 * options.cc (General_options::finalize): Make -M equivalent to
15147 * main.cc: Include <cstdio> and "mapfile.h".
15148 (main): Open mapfile if requested.
15149 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15150 constructor. Change caller.
15151 (queue_initial_tasks): Add mapfile parameter. Change caller.
15152 (queue_middle_tasks): Likewise.
15153 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15155 * archive.cc: Include "mapfile.h".
15156 (Archive::add_symbols): Add mapfile parameter. Change all
15157 callers. Pass mapfile, symbol, and reason to include_member.
15158 (Archive::include_all_members): Add mapfile parameter. Change all
15160 (Archive::include_member): Add mapfile, sym, and why parameters.
15161 Change all callers. Report inclusion to map file.
15162 * archive.h: Include "fileread.h".
15163 (class Archive): Update declarations.
15164 (Archive::file): New const method.
15165 (class Add_archive_symbols): Add mapfile_ field. Update
15166 constructor. Change all callers.
15167 * readsyms.h (class Read_symbols): Likewise.
15168 (class Finish_group): Likewise.
15169 (class Read_script): Likewise.
15170 * common.cc: Include "mapfile.h".
15171 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15173 (Symbol_table::do_allocate_commons): Likewise.
15174 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15175 symbol allocation to mapfile.
15176 * common.h (class Allocate_commons_task): Add mapfile_ field.
15177 Update constructor. Change all callers.
15178 * symtab.h (class Symbol_table): Update declarations.
15179 * layout.cc: Include "mapfile.h".
15180 (Layout_task_runner::run): Print information to mapfile.
15181 (Layout::create_gold_note): Change Output_data_fixed_space to
15182 Output_data_zero_fill.
15183 (Layout::create_build_id): Likewise.
15184 (Layout::print_to_mapfile): New function.
15185 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15186 constructor. Change caller.
15187 (class Layout): Declare print_to_mapfile.
15188 * output.cc (Output_section::Input_section::print_to_mapfile): New
15190 (Output_section::add_input_section): If producing a map, always
15191 add to input_sections_ list.
15192 (Output_section::do_print_to_mapfile): New function.
15193 (Output_segment::print_sections_to_mapfile): New function.
15194 (Output_segment::print_section_list_to_mapfile): New function.
15195 * output.h: Include "mapfile.h".
15196 (Output_data::print_to_mapfile): New function.
15197 (Output_data::do_print_to_mapfile): New virtual function.
15198 (Output_segment_headers::do_print_to_mapfile): New function.
15199 (Output_file_header::do_print_to_mapfile): New function.
15200 (Output_data_const::do_print_to_mapfile): New function.
15201 (class Output_data_const_buffer): Add map_name_ field. Update
15202 constructor. Change all callers. Add do_print_to_mapfile
15204 (class Output_data_fixed_space): Likewise.
15205 (class Output_data_space): Likewise.
15206 (class Output_data_zero_fill): New class.
15207 (Output_data_strtab::do_print_to_mapfile): New function.
15208 (Output_data_reloc_base::do_print_to_mapfile): New function.
15209 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15210 (Output_data_group::do_print_to_mapfile): New function.
15211 (Output_data_got::do_print_to_mapfile): New function.
15212 (Output_data_dynamic::do_print_to_mapfile): New function.
15213 (Output_symtab_xindex::do_print_to_mapfile): New function.
15214 (class Output_section): Declare do_print_to_mapflie. Declare
15215 print_to_mapfile in Input_section.
15216 (class Output_segment): Declare new functions.
15217 * object.h (Sized_relobj::symbol_count): New function.
15218 * script-sections.cc
15219 (Output_section_element_dot_assignment::set_section_addresses):
15220 Change Output_data_fixed_space to Output_data_zero_fill.
15221 (Output_data_expression::do_print_to_mapfile): New function.
15222 * script.cc (read_input_script): Add mapfile parameter. Change
15224 * script.h (read_input_script): Update declaration.
15225 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15226 (Eh_frame::do_print_to_mapfile): New function.
15227 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15228 (Output_merge_string::do_print_to_mapfile): New function.
15229 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15231 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15233 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15235 * Makefile.am (CCFILES): Add mapfile.cc.
15236 (HFILES): Add mapfile.h.
15237 * Makefile.in: Rebuild.
15239 2008-05-19 Ian Lance Taylor <iant@google.com>
15241 * options.h (class General_options): Add -z relro.
15242 * layout.cc (Layout::Layout): Initialize relro_segment_.
15243 (Layout::add_output_section_data): Return the output section.
15244 (Layout::make_output_section): Rcognize relro sections and mark
15245 them appropriately.
15246 (Layout::attach_allocated_section_to_segment): Put relro sections
15247 in a PT_GNU_RELRO segment.
15248 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15250 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15252 (Layout::linkonce_mapping): Map d.rel.ro.local to
15253 .data.rel.ro.local.
15254 (Layout::output_section_name): Us .data.rel.ro.local for any
15255 section which begins with that.
15256 * layout.h (class Layout): Update add_output_section_data
15257 declaration. Add relro_segment_ field.
15258 * output.cc (Output_section::Output_section): Initialize is_relro_
15259 and is_relro_local_ fields.
15260 (Output_segment::add_output_section): Group relro sections.
15261 (Output_segment::is_first_section_relro): New function.
15262 (Output_segment::maximum_alignment): If there is a relro section,
15263 align the segment to the common page size.
15264 (Output_segment::set_section_addresses): Track whether we are
15265 looking at relro sections. If the last section is a relro
15266 section, align to the common page size.
15267 (Output_segment::set_section_list_addresses): Add in_relro
15268 parameter. Change all callers. Align to the page size when
15269 moving from relro to non-relro section.
15270 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15272 * output.h (class Output_section): Add is_relro_ and
15273 is_relro_local_ fields.
15274 (Output_section::is_relro): New function.
15275 (Output_section::set_is_relro): New function.
15276 (Output_section::is_relro_local): New function.
15277 (Output_section::set_is_relro_local): New function.
15278 (class Output_segment): Update declarations.
15279 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15280 * sparc.cc (Target_sparc::got_section): Likewise.
15281 * x86_64.cc (Target_x86_64::got_section): Likewise.
15282 * testsuite/relro_test_main.cc: New file.
15283 * testsuite/relro_test.cc: New file.
15284 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15285 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15286 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15287 (relro_test.so, relro_test_pic.o): New targets.
15288 * testsuite/Makefile.in: Rebuild.
15290 2008-05-16 Ian Lance Taylor <iant@google.com>
15292 * output.cc (Output_segment::add_output_section): Remove front
15294 * output.h (class Output_segment): Remove
15295 add_initial_output_section and overloaded add_output_section.
15296 Update declaration of remaining add_output_section.
15297 * layout.cc (Layout::create_interp): Call add_output_section
15298 rather than add_initial_output_section.
15299 (Layout::finish_dynamic_section): Likewise.
15301 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15302 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15303 know the dynamic type.
15304 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15305 field. Initialize it in constructor.
15306 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15307 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15308 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15311 * output.cc (Output_reloc::get_address): Change return type to
15313 * output.h (class Output_reloc): Update get_address declaration.
15314 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15315 for section addresses.
15317 2008-05-09 Ian Lance Taylor <iant@google.com>
15320 * gold.cc (gold_nomem): Use return value of write.
15322 2008-05-08 Ian Lance Taylor <iant@google.com>
15324 * symtab.c (Symbol::init_base_output_data): Add version
15325 parameter. Change all callers.
15326 (Symbol::init_base_output_segment): Likewise.
15327 (Symbol::init_base_constant): Likewise.
15328 (Symbol::init_base_undefined): Likewise.
15329 (Sized_symbol::init_output_data): Likewise.
15330 (Sized_symbol::init_output_segment): Likewise.
15331 (Sized_symbol::init_constant): Likewise.
15332 (Sized_symbol::init_undefined): Likewise.
15333 (Symbol_table::do_define_in_output_data): If the new symbol has a
15334 version, mark it as the default.
15335 (Symbol_table::do_define_in_output_segment): Likewise.
15336 (Symbol_table::do_define_as_constant): Likewise.
15337 * symtab.h (class Symbol): Update declarations.
15338 (class Sized_symbol): Likewise.
15339 * resolve.cc (Symbol::override_version): New function.
15340 (Symbol::override_base): Call override_version.
15341 (Symbol::override_base_with_special): Likewise.
15342 * testsuite/ver_script_8.script: New file.
15343 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15344 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15345 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15346 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15348 2008-05-06 Ian Lance Taylor <iant@google.com>
15351 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15353 (class General_options): Remove existing --undefined, and add
15354 --no-undefined instead. Add new --undefined as synonym for -u.
15355 * archive.cc (Archive::add_symbols): Check whether symbol was
15357 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15358 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15359 all uses. Add IS_UNDEFINED. Update declarations to split
15360 different versions of init_base. Declare init_base_undefined.
15361 (Symbol::is_defined): Handle IS_UNDEFINED.
15362 (Symbol::is_undefined): Likewise.
15363 (Symbol::is_weak_undefined): Call is_undefined.
15364 (Symbol::is_absolute): Handle IS_CONSTANT.
15365 (class Sized_symbol): Update declarations to split different
15366 versions of init. Declare init_undefined.
15367 (class Symbol_table): Declare new functions.
15368 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15369 Change all callers.
15370 (Symbol::init_base_output_data): Likewise.
15371 (Symbol::init_base_output_segment): Likewise.
15372 (Symbol::init_base_constant): Likewise.
15373 (Symbol::init_base_undefined): New function.
15374 (Sized_symbol::init_object): Rename from init. Change all
15376 (Sized_symbol::init_output_data): Likewise.
15377 (Sized_symbol::init_output_segment): Likewise.
15378 (Sized_symbol::init_constant): Likewise.
15379 (Sized_symbol::init_undefined): New function.
15380 (Symbol_table::add_undefined_symbols_from_command_line): New
15382 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15384 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15385 (Symbol::output_section): Likewise.
15386 (Symbol::set_output_section): Likewise.
15387 (Symbol_table::sized_finalize_symbol): Likewise.
15388 (Symbol_table::sized_write_globals): Likewise.
15389 * resolve.cc (Symbol_table::should_override): Likewise.
15390 (Symbol::override_base_with_special): Likewise.
15392 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15393 symbol, change it to have default visibility.
15394 * testsuite/protected_1.cc: New file.
15395 * testsuite/protected_2.cc: New file.
15396 * testsuite/protected_3.cc: New file.
15397 * testsuite/protected_main_1.cc: New file.
15398 * testsuite/protected_main_2.cc: New file.
15399 * testsuite/protected_main_3.cc: New file.
15400 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15401 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15402 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15403 (protected_1.so): New target.
15404 (protected_1_pic.o, protected_2_pic.o): New targets.
15405 (protected_3_pic.o): New target.
15406 (check_PROGRAMS): Add protected_2.
15407 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15408 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15409 * testsuite/Makefile.in: Rebuild.
15411 * options.h (DEFINE_var): Add set_user_set_##varname__.
15412 (DEFINE_bool_alias): New macro.
15413 (class General_options): Define -Bstatic using DEFINE_bool_alias
15414 rather than DEFINE_special. Add --undefined as an alias for -z
15416 * options.cc (General_options::parse_Bstatic): Remove.
15418 * options.h (class General_options): Add --fatal-warnings.
15419 * main.cc (main): Implement --fatal-warnings.
15420 * errors.h (Errors::warning_count): New function.
15422 * options.h (class General_options): Add -Bsymbolic-functions.
15423 * symtab.h (Symbol::is_preemptible): Check for
15424 -Bsymbolic-functions.
15426 2008-05-05 Ian Lance Taylor <iant@google.com>
15428 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15429 as noVARNAME rather than no-VARNAME.
15430 (class General_options): Add option -z combreloc.
15431 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15433 (Output_reloc::sort_before) [SHT_REL]: New function.
15434 (Output_reloc::sort_before) [SHT_RELA]: New function.
15435 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15436 Sort_relocs_comparison.
15437 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15438 parameter. Change all callers.
15439 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15440 sort_relocs parameter. Change all callers.
15441 * output.cc (Output_reloc::get_address): New function, broken out
15443 (Output_reloc::write_rel): Call it.
15444 (Output_reloc::compare): New function.
15445 (Output_data_reloc_base::do_write): Optionally sort relocs.
15447 * configure.ac: If targ_extra_obj is set, link it in.
15448 * configure.tgt: Initialize all variables.
15449 (x86_64*): Set targ_extra_obj and targ_extra_size.
15450 * configure: Rebuild.
15452 * object.cc (Sized_relobj::include_section_group): Adjust section
15453 indexes read from group data. Build vector to pass to
15455 * layout.cc (Layout::layout_group): Add flags and shndxes
15456 parameters. Remove contents parameter. Change caller. Update
15457 explicit instantiations.
15458 * layout.h (class Layout): Update layout_group declaration.
15459 * output.cc (Output_data_group::Output_data_group): Add flags and
15460 input_shndxes parameters. Remove contents parameter. Change
15462 (Output_data_group::do_write): Change input_sections_ to
15464 * output.h (class Output_data_group): Update constructor
15465 declaration. Rename input_sections_ to input_shndxes_.
15466 * testsuite/many_sections_test.cc: Add template.
15468 2008-04-30 Cary Coutant <ccoutant@google.com>
15470 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15472 * layout.cc (Layout::include_section): Refactored check for debug
15474 (Layout::add_comdat): Add new parameters. Change type
15475 of signature parameter. Add object and shndx to signatures table.
15476 (Layout::find_kept_object): New function.
15477 * layout.h: Include <cstring>.
15478 (Layout::is_debug_info_section): New function.
15479 (Layout::add_comdat): Add new parameters.
15480 (Layout::find_kept_object): New function.
15481 (Layout::Kept_section): New struct.
15482 (Layout::Signatures): Change type of map range.
15483 * object.cc (Relobj::output_section_address): New function.
15484 (Sized_relobj::include_section_group): Add new parameters. Change
15485 calls to Layout::add_comdat. Change to build table of kept comdat
15486 groups and table mapping discarded sections to kept sections.
15487 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15488 (Sized_relobj::do_layout): Change calls to include_section_group and
15489 include_linkonce_section.
15490 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15491 value to zero when section is discarded.
15492 (Sized_relobj::map_to_kept_section): New function.
15493 * object.h (Relobj::output_section_address): New function.
15494 (Relobj::Comdat_group): New type.
15495 (Relobj::find_comdat_group): New function.
15496 (Relobj::Comdat_group_table): New type.
15497 (Relobj::Kept_comdat_section): New type.
15498 (Relobj::Kept_comdat_section_table): New type.
15499 (Relobj::add_comdat_group): New function.
15500 (Relobj::set_kept_comdat_section): New function.
15501 (Relobj::get_kept_comdat_section): New function.
15502 (Relobj::comdat_groups_): New field.
15503 (Relobj::kept_comdat_sections_): New field.
15504 (Symbol_value::input_value): Update comment.
15505 (Sized_relobj::map_to_kept_section) New function.
15506 (Sized_relobj::include_linkonce_section): Add new parameter.
15507 * target-reloc.h (Comdat_behavior): New type.
15508 (get_comdat_behavior): New function.
15509 (relocate_section): Add code to map a discarded section to the
15510 corresponding kept section when applying a relocation.
15512 2008-04-30 Craig Silverstein <csilvers@google.com>
15514 * dwarf_reader.cc (next_generation_count): New static var.
15515 (Addr2line_cache_entry): New struct.
15516 (addr2line_cache): New static var.
15517 (Dwarf_line_info::one_addr2line): Added caching.
15518 (Dwarf_line_info::clear_addr2line_cache): New function.
15519 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15520 cache-size parameter.
15521 (Dwarf_line_info::one_addr2line_cache): New function.
15522 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15523 new cache-size argument to one_addr2line(), and clear cache.
15525 2008-04-28 Cary Coutant <ccoutant@google.com>
15527 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15528 R_386_PC8 relocations.
15530 2008-04-23 Ian Lance Taylor <iant@google.com>
15532 * object.cc (Sized_relobj::include_section_group): Check for
15533 invalid section group.
15535 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15538 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15539 than read for file header.
15540 * archive.cc (Archive::include_member): Likewise.
15542 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
15544 * aclocal.m4: Regenerate.
15545 * configure: Regenerate.
15547 2008-04-19 Ian Lance Taylor <iant@google.com>
15549 * version.cc (version_string): Bump to 1.6.
15551 * testsuite/Makefile.am (many_sections_r_test): New target.
15552 (many_sections_r_test_SOURCES): Remove.
15553 (many_sections_r_test_DEPENDENCIES): Remove.
15554 (many_sections_r_test_LDFLAGS): Remove.
15555 (many_sections_r_test_LDADD): Remove.
15557 * object.cc (Sized_relobj::do_add_symbols): Always pass
15558 local_symbol_count_ to add_from_relobj.
15560 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15561 every thousand variables.
15562 * testsuite/Makefile.in: Rebuild.
15564 * object.cc (Xindex::initialize_symtab_xindex): New function.
15565 (Xindex::read_symtab_xindex): New function.
15566 (Xindex::sym_xindex_to_shndx): New function.
15567 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15569 (Sized_relobj::do_initialize_xindex): New function.
15570 (Sized_relobj::do_read_symbols): Adjust section links.
15571 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15572 parameter. Change all callers.
15573 (Sized_relobj::include_section_group): Adjust section links and
15574 symbol section indexes.
15575 (Sized_relobj::do_layout): Adjust section links.
15576 (Sized_relobj::do_count_local_symbols): Adjust section links and
15577 symbol section indexes.
15578 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15579 ordinary and special symbols.
15580 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15581 dynsym_xindex parameters. Change all callers. Adjust section
15582 links. Use SHN_XINDEX when needed.
15583 (Sized_relobj::get_symbol_location_info): Adjust section links.
15584 Don't get fooled by special symbols.
15585 * object.h (class Xindex): Define.
15586 (class Object): Add xindex_ parameter. Declare virtual functoin
15587 do_initialize_xindex.
15588 (Object::adjust_sym_shndx): New function.
15589 (Object::set_xindex): New protected function.
15590 (class Symbol_value): Add is_ordinary_shndx_ field.
15591 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15592 (Symbol_value::value): Assert ordinary section.
15593 (Symbol_value::initialize_input_to_output_map): Likewise.
15594 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15595 Change all callers.
15596 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15598 (class Sized_relobj): Update declarations.
15599 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15600 parameter. Change all callers.
15601 (Sized_relobj::adjust_shndx): New function.
15602 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15604 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15605 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15606 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15607 (Sized_dynobj::read_dynsym_section): Adjust section links.
15608 (Sized_dynobj::read_dynamic): Likewise.
15609 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15611 (Sized_dynobj::do_initialize_xindex): New function.
15612 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15613 do_initialize_xindex.
15614 (Sized_dynobj::adjust_shndx): New function.
15615 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15616 dynsym_xindex_ fields.
15617 (Layout::finalize): Add a call to set_section_indexes before
15618 creating the symtab sections.
15619 (Layout::set_section_indexes): Don't do anything if the section
15620 already has a section index.
15621 (Layout::create_symtab_sections): Add shnum parameter. Change
15622 caller. Create .symtab_shndx section if needed.
15623 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15625 (Layout::allocated_output_section_count): New function.
15626 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15628 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15629 fields. Update declarations.
15630 (Layout::symtab_xindex): New function.
15631 (Layout::dynsym_xindex): New function.
15632 (class Write_symbols_task): Add layout_ field.
15633 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15635 * output.cc (Output_section_headers::Output_section_headers): Add
15636 shstrtab_section parameter. Change all callers.
15637 (Output_section_headers::do_sized_write): Store overflow values
15638 for section count and section string table section index in
15639 section header zero.
15640 (Output_file_header::do_sized_write): Check for overflow of
15641 section count and section string table section index.
15642 (Output_symtab_xindex::do_write): New function.
15643 (Output_symtab_xindex::endian_do_write): New function.
15644 * output.h (class Output_section_headers): Add shstrtab_section_.
15645 Update declarations.
15646 (class Output_symtab_xindex): Define.
15647 (Output_section::has_out_shndx): New function.
15648 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15650 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15651 Change all callers.
15652 (Sized_symbol::init): Likewise.
15653 (Symbol::output_section): Check for ordinary symbol.
15654 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15655 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15657 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15658 Change all callers. Simplify handling of symbols from sections
15659 not included in the link.
15660 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15662 (Weak_alias_sorter::operator()): Assert that symbols are
15664 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15666 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15667 parameters. Change all callers.
15668 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15669 symbol distinction. Use SHN_XINDEX when needed.
15670 (Symbol_table::write_section_symbol): Add symtab_xindex
15671 parameter. Change all callers.
15672 (Symbol_table::sized_write_section_symbol): Likewise. Use
15673 SHN_XINDEX when needed.
15674 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15676 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15677 (Symbol::is_defined): Check is_ordinary.
15678 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15679 (Symbol::is_absolute, Symbol::is_common): Likewise.
15680 (class Sized_symbol): Update declarations.
15681 (class Symbol_table): Update declarations.
15682 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15683 parameters. Change all callers.
15684 (Sized_symbol::override): Likewise.
15685 (Symbol_table::override): Likewise.
15686 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15687 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15688 is_ordinary, and orig_st_shndx parameters. Change all callers.
15689 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15690 to be in an ordinary section.
15691 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15692 object and is_ordinary parameters. Change all callers.
15693 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15694 Change all callers. Don't add undefined or non-ordinary symbols
15696 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15697 Change all callers.
15698 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15700 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15701 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15702 (Sized_relobj::relocate_sections): Likewise.
15703 * target-reloc.h (scan_relocs): Adjust section symbol index.
15704 (scan_relocatable_relocs): Likewise.
15705 * i386.cc (Scan::local): Check for ordinary symbols.
15706 * sparc.cc (Scan::local): Likewise.
15707 * x86_64.cc (Scan::local): Likewise.
15708 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15709 to symbol_section_and_value.
15710 * testsuite/many_sections_test.cc: New file.
15711 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15712 (check_PROGRAMS): Add many_sections_test.
15713 (many_sections_test_SOURCES): Define.
15714 (many_sections_test_DEPENDENCIES): Define.
15715 (many_sections_test_LDFLAGS): Define.
15716 (BUILT_SOURCES): Add many_sections_define.h.
15717 (many_sections_define.h): New target.
15718 (BUILT_SOURCES): Add many_sections_check.h.
15719 (many_sections_check.h): New target.
15720 (check_PROGRAMS): Add many_sections_r_test.
15721 (many_sections_r_test_SOURCES): Define.
15722 (many_sections_r_test_DEPENDENCIES): Define.
15723 (many_sections_r_test_LDFLAGS): Define.
15724 (many_sections_r_test_LDADD): Define.
15725 (many_sections_r_test.o): New target.
15726 * testsuite/Makefile.in: Rebuild.
15728 2008-04-17 Cary Coutant <ccoutant@google.com>
15730 * errors.cc (Errors::info): New function.
15731 (gold_info): New function.
15732 * errors.h (Errors::info): New function.
15733 * gold.h (gold_info): New function.
15734 * object.cc (Input_objects::add_object): Print trace output.
15735 * options.cc (options::parse_set): New function.
15736 (General_options::parse_wrap): Deleted.
15737 (General_options::General_options): Deleted initializer.
15738 * options.h (options::String_set): New typedef.
15739 (options::parse_set): New function.
15740 (DEFINE_set): New macro.
15741 (General_options::wrap): Changed to use DEFINE_set. Changed
15742 callers of any_wrap_symbols and is_wrap_symbol.
15743 (General_options::trace, General_options::trace_symbol):
15745 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15746 (General_options::wrap_symbols_): Deleted.
15747 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15749 2008-04-17 David S. Miller <davem@davemloft.net>
15751 * options.cc (General_options::parse_V): New function.
15752 * options.h: Add entries for -V and -Qy.
15754 2008-04-17 Ian Lance Taylor <iant@google.com>
15756 * common.cc (Symbol_table::allocate_commons): Remove options
15757 parameter. Change caller.
15758 (Symbol_table::do_allocate_commons): Remove options parameter.
15759 Change caller. Just call do_allocate_commons_list twice.
15760 (Symbol_table::do_allocate_commons_list): New function, broken out
15761 of do_allocate_commons.
15762 * common.h (class Allocate_commons_task): Remove options_ field.
15763 Update constructor.
15764 * symtab.cc (Symbol_table::Symbol_table): Initialize
15766 (Symbol_table::add_from_object): Put TLS common symbols on
15768 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15769 which are IN_OUTPUT_DATA.
15770 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15771 allocate_commons and do_allocate_commons declarations. Declare
15772 do_allocate_commons_list.
15773 * gold.cc (queue_middle_tasks): Update creation of
15774 Allocate_commons_task to not pass options.
15775 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15776 (TLS_TEST_C_FLAGS): New variable.
15777 (tls_test_c_pic.o): New target.
15778 (tls_test_shared.so): Link in tls_test_c_pic.o.
15779 (tls_test_c_pic_ie.o): New target.
15780 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15781 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15782 (tls_test_c.o): New target.
15783 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15784 (tls_pic_test_LDADD): Likewise.
15785 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15786 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15787 (tls_test_c_gnu2.o): New target.
15788 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15790 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15791 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15792 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15793 * testsuite/tls_test.cc: Include "config.h".
15794 (t_last): Call t11_last.
15795 * testsuite/tls_test.h (t11, t11_last): Declare.
15796 * testsuite/tls_test_c.c: New file.
15797 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15798 * configure.ac: Check for OpenMP support.
15799 * configure, config.in, Makefile.in: Rebuild.
15800 * testsuite/Makefile.in: Rebuild.
15802 2008-04-16 Cary Coutant <ccoutant@google.com>
15804 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15805 (Target_i386::tls_base_symbol_defined_): New field.
15806 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15807 (Target_i386::Scan::global): Likewise.
15808 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15809 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15810 (Target_x86_64::tls_base_symbol_defined_): New field.
15811 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15812 (Target_x86_64::Scan::global): Likewise.
15814 2008-04-16 Cary Coutant <ccoutant@google.com>
15816 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15817 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15818 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15819 building shared libraries.
15820 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15821 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15822 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15823 * testsuite/Makefile.in: Rebuild.
15824 * testsuite/weak_undef.h: New file.
15825 * testsuite/weak_undef_file1.cc: Add extra test cases.
15826 * testsuite/weak_undef_file2.cc: Likewise.
15827 * testsuite/weak_undef_test.cc: Likewise.
15829 2008-04-16 David S. Miller <davem@davemloft.net>
15831 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15832 Add issued_non_pic_error_ field. Declare check_non_pic.
15833 (Target_sparc::Scan::check_non_pic): New function.
15834 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15835 (Target_sparc::Scan::global): Likewise.
15837 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15838 * configure: Rebuild.
15840 * options.h (DEFINE_enable): New macro.
15841 (new_dtags): New enable option.
15842 (initfirst, interpose, loadfltr, nodefaultlib,
15843 nodelete, nodlopen, nodump): New -z options.
15844 * layout.cc (Layout:finish_dynamic_section): If new
15845 dtags enabled, emit DT_RUNPATH. Also, emit a
15846 DT_FLAGS_1 containing any specified -z flags.
15848 2008-04-16 Ian Lance Taylor <iant@google.com>
15850 * copy-relocs.cc: New file.
15851 * copy-relocs.h: New file.
15852 * reloc.cc: Remove Copy_relocs code.
15853 * reloc.h: Likewise.
15854 * reloc-types.h (struct Reloc_types) [both versions]: Add
15855 get_reloc_addend_noerror.
15856 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15857 variants of add_global which take an addend which must be zero.
15858 * i386.cc: Include "copy-relocs.h".
15859 (class Target_i386): Change type of copy_relocs_ to variable,
15860 update initializer.
15861 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15862 Change all callers.
15863 (Target_i386::do_finalize_sections): Change handling of
15865 * sparc.cc: Include "copy-relocs.h".
15866 (class Target_sparc): Change type of copy_relocs_ to variable,
15867 update initializer.
15868 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15869 Change all callers.
15870 (Target_sparc::do_finalize_sections): Change handling of
15872 * x86_64.cc: Include "copy-relocs.h".
15873 (class Target_x86_64): Change type of copy_relocs_ to variable,
15874 update initializer.
15875 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15876 class. Change all callers.
15877 (Target_x86_64::do_finalize_sections): Change handling of
15879 * Makefile.am (CCFILES): Add copy-relocs.cc.
15880 (HFILES): Add copy-relocs.h.
15882 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15884 * testsuite/script_test_4.sh: Permit leading zeroes.
15886 2008-04-15 Ian Lance Taylor <iant@google.com>
15888 * script-sections.cc (Script_sections::create_segments): Use
15889 header_size_adjustment even when there is enough room for the
15891 * testsuite/script_test_4.sh: New file.
15892 * testsuite/script_test_4.t: New file.
15893 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15894 (check_DATA): Add script_test_4.stdout.
15895 (MOSTLYCLEANFILES): Likewise.
15896 (script_test_4): New target.
15897 (script_test_4.stdout): New target.
15898 * testsuite/Makefile.in: Rebuild.
15900 * sparc.cc: Add definitions for Output_data_plt_sparc class
15903 2008-04-14 David S. Miller <davem@davemloft.net>
15905 * sparc.cc: New file.
15906 * Makefile.am (TARGETSOURCES): Add sparc.cc
15907 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15908 * configure.tgt: Document targ_extra_size and
15909 targ_extra_big_endian. Add entries for sparc-* and
15911 * configure.ac: Handle targ_extra_size and
15912 targ_extra_big_endian.
15913 * Makefile.in: Rebuild.
15914 * configure: Likewise.
15915 * po/POTFILES.in: Likewise.
15916 * po/gold.pot: Likewise.
15918 2008-04-14 Ian Lance Taylor <iant@google.com>
15920 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15921 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15922 in the name/type/flags to section mapping. Don't call
15923 allocate_output_section.
15924 (Layout::choose_output_section): Change parameter from adjust_name
15925 to is_input_section. Don't permit input sections after sections
15926 are attached to segments. Don't call allocate_output_section.
15927 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15928 not write_enable_output_section.
15929 (Layout::make_output_section): Don't push to
15930 unattached_section_list_ nor call attach_to_segment. Call
15931 attach_section_to_segment if sections are attached.
15932 (Layout::attach_sections_to_segments): New function.
15933 (Layout::attach_section_to_segment): New function.
15934 (Layout::attach_allocated_section_to_segment): Rename from
15935 attach_to_segment. Remove flags parameter.
15936 (Layout::allocate_output_section): Remove function.
15937 (Layout::write_enable_output_section): Remove function.
15938 * layout.h (class Layout): Update for above changes. Add new
15939 field sections_are_attached_.
15940 * output.h (Output_section::update_flags_for_input_section): New
15942 * output.cc (Output_section::add_input_section): Call
15943 update_flags_for_input_section.
15944 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15946 2008-04-11 Cary Coutant <ccoutant@google.com>
15948 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15949 thought unnecessary.
15950 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15952 2008-04-11 Ian Lance Taylor <iant@google.com>
15954 * output.h (class Output_section_data): Remove inline definition
15956 * output.cc (Output_section_data::set_addralign): New function.
15958 2008-04-11 Cary Coutant <ccoutant@google.com>
15960 Add support for TLS descriptors for i386 and x86_64.
15961 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15962 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15963 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15965 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15966 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15967 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15969 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15970 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15971 Fix problem with initial-exec relocations.
15972 (Target_i386::Relocate::relocate_tls): Likewise.
15973 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15975 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15976 support for section-plus-offset dynamic table entries.
15977 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15978 (Output_data_dynamic::Dynamic_entry): Add support for
15979 section-plus-offset dynamic table entries.
15980 (Output_data_dynamic::Classification): Likewise.
15981 (Output_data_dynamic::classification_): Renamed offset_.
15982 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15983 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15984 (Target_x86_64::make_plt_section): New function.
15985 (Target_x86_64::reserve_tlsdesc_entries): New function.
15986 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15987 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15988 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15989 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15990 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15991 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15992 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15993 add extra PLT entry for TLS descriptors.
15994 (Output_data_plt_x86_64::got_): New field.
15995 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15996 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15998 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16000 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16001 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16002 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16003 R_386_TLS_DESC_CALL relocations.
16004 (Target_x86_64::Scan::global): Likewise.
16005 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16006 for TLS descriptors.
16007 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16008 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16009 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16010 GD-to-IE relaxation.
16011 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16012 and TLS_DESCRIPTORS.
16013 * Makefile.in: Rebuild.
16014 * configure: Rebuild.
16015 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16016 (tls_test_shared2.so): New target.
16017 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16018 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16019 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16020 (tls_shared_gd_to_ie_test_LDADD): New variable.
16021 (tls_shared_gnu2_gd_to_ie_test): New target.
16022 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16024 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16025 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16026 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16027 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16028 (tls_shared_gnu2_test): New target.
16029 (tls_test_gnu2_shared.so): New target.
16030 (tls_shared_gnu2_test_SOURCES): New variable.
16031 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16032 (tls_shared_gnu2_test_LDFLAGS): New variable.
16033 (tls_shared_gnu2_test_LDADD): New variable.
16034 * testsuite/Makefile.in: Rebuild.
16035 * testsuite/Makefile.
16037 2008-04-11 Ian Lance Taylor <iant@google.com>
16039 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16041 * testsuite/Makefile.in: Rebuild.
16043 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16045 * testsuite/script_test_2.cc (main): Adjust test.
16047 2008-04-11 David S. Miller <davem@davemloft.net>
16048 Ian Lance Taylor <iant@google.com>
16050 * options.h (General_options): Add entries for '-Y' and
16052 * options.cc (General_options:finalize): If -Y was used, add those
16053 entries to the library path instead of the default "/lib" and
16056 2008-04-11 David S. Miller <davem@davemloft.net>
16058 * testsuite/justsyms.t: Start at 0x100.
16059 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
16060 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16062 * testsuite/script_test_2.cc: Adjust string and section length
16065 2008-04-09 Ian Lance Taylor <iant@google.com>
16068 * script-sections.cc (Sections_element::allocate_to_segment): Add
16070 (Output_section_definition::allocate_to_segment): Likewise.
16071 (Orphan_output_section::allocate_to_segment): Likewise.
16072 (Script_sections::attach_sections_using_phdrs_clause): Don't
16073 propagate non-PT_LOAD segments to orphan sections.
16074 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16075 readelf rather than objdump.
16076 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16077 .interp section and PT_INTERP segment are the same size.
16078 * testsuite/Makefile.in: Rebuild.
16080 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16081 aliases for symbols defined in the same object.
16082 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16083 (weak_alias_test_SOURCES): New variable.
16084 (weak_alias_test_DEPENDENCIES): New variable.
16085 (weak_alias_test_LDFLAGS): New variable.
16086 (weak_alias_test_LDADD): New variable.
16087 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16088 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16089 (weak_alias_test_3.o): New target.
16090 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16091 * testsuite/weak_alias_test_main.cc: New file.
16092 * testsuite/weak_alias_test_1.cc: New file.
16093 * testsuite/weak_alias_test_2.cc: New file.
16094 * testsuite/weak_alias_test_3.cc: New file.
16096 2008-04-08 Ian Lance Taylor <iant@google.com>
16098 * options.h (class General_options): Add --noinhibit-exec option.
16099 * main.cc (main): Check --noinhibit-exec.
16101 * options.h (class General_options): Define --wrap as a special
16102 option. Add wrap_symbols_ field.
16103 (General_options::any_wrap_symbols): New function.
16104 (General_options::is_wrap_symbol): New function.
16105 * options.cc (General_options::parse_wrap): New function.
16106 (General_options::General_options): Initialize wrap_symbols_.
16107 * symtab.cc (Symbol_table::wrap_symbol): New function.
16108 (Symbol_table::add_from_object): Handle --wrap.
16109 * symtab.h (class Symbol_table): Declare wrap_symbol.
16110 * target.h (Target::wrap_char): New function.
16111 (Target::Target_info): Add wrap_char field.
16112 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16113 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16114 * testsuite/testfile.cc (Target_test::test_target_info):
16117 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16120 * layout.h (class Layout): Add added_eh_frame_data_ field.
16121 * layout.cc (Layout::Layout): Initialize new field.
16122 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16123 output section until we find a section we merged successfully.
16124 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16125 that the size be non-zero.
16127 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16130 2008-04-08 Craig Silverstein <csilvers@google.com>
16132 * configure.ac: Export new conditional variable HAVE_ZLIB.
16133 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16135 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16136 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16138 2008-04-07 Ian Lance Taylor <iant@google.com>
16140 * version.cc (version_string): Set to "1.5".
16142 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16143 Add issued_non_pic_error_ field. Declare check_non_pic.
16144 (Target_x86_64::Scan::check_non_pic): New function.
16145 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16146 (Target_x86_64::Scan::global): Likewise.
16148 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16149 addend parameter. Change caller. Handle merge sections.
16150 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16151 Address to Addend. Don't add in the result of
16152 local_section_offset, pass down the addend and use the returned
16154 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16155 Update declarations of local_section_offset and symbol_value.
16156 * testsuite/two_file_test_1.cc (t18): New function.
16157 * testsuite/two_file_test_2.cc (f18): New function.
16158 * testsuite/two_file_test_main.cc (main): Call t18.
16159 * testsuite/two_file_test.h (t18, f18): Declare.
16161 * configure.ac: Don't test for objdump, c++filt, or readelf.
16162 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16164 (TEST_READELF): New variable.
16165 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16166 (check_PROGRAMS): Add two_file_strip_test.
16167 (two_file_strip_test): New target.
16168 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16169 (two_file_same_shared_strip_test_SOURCES): New variable.
16170 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16171 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16172 (two_file_same_shared_strip_test_LDADD): New variable.
16173 (two_file_shared_strip.so): New target.
16174 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16175 (ver_test_5.syms, ver_test_7.syms): Likewise.
16176 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16177 (strip_test_3.stdout): Use TEST_OBJDUMP.
16178 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16180 2008-04-04 Cary Coutant <ccoutant@google.com>
16182 * symtab.h (Symbol::is_weak_undefined): New function.
16183 (Symbol::is_strong_undefined): New function.
16184 (Symbol::is_absolute): New function.
16185 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16186 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16188 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16189 (weak_undef_test): New target.
16190 * testsuite/Makefile.in: Rebuild.
16191 * testsuite/weak_undef_file1.cc: New file.
16192 * testsuite/weak_undef_file2.cc: New file.
16193 * testsuite/weak_undef_test.cc: New file.
16195 2008-04-03 Craig Silverstein <csilvers@google.com>
16197 * compressed_output.h (class Output_compressed_section): Use
16199 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16201 (zlib_compressed_suffix): Removed.
16202 (Output_compressed_section::set_final_data_size): Use unsigned
16204 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16205 Fix linker invocation.
16206 (flagstest_o_specialfile_and_compress_debug_sections):
16208 * testsuite/Makefile.in: Regenerated.
16210 2008-04-02 David S. Miller <davem@davemloft.net>
16212 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16213 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16215 2008-04-02 Craig Silverstein <csilvers@google.com>
16219 2008-04-02 Ian Lance Taylor <iant@google.com>
16221 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16222 parameters. Update for new key type to views_. Change all
16224 (File_read::read): Adjust for byteshift in returned view.
16225 (File_read::add_view): New function, broken out of
16226 find_and_make_view.
16227 (File_read::make_view): New function, broken out of
16228 find_and_make_view.
16229 (File_read::find_or_make_view): Add offset and aligned
16230 parameters. Rewrite accordingly. Change all callers.
16231 (File_read::get_view): Add offset and aligned parameters. Adjust
16232 for byteshift in return value.
16233 (File_read::get_lasting_view): Likewise.
16234 * fileread.h (class File_read): Update declarations.
16235 (class File_read::View): Add byteshift_ field. Add byteshift to
16236 constructor. Add byteshift method.
16237 * archive.h (Archive::clear_uncached_views): New function.
16238 (Archive::get_view): Add aligned parameter. Change all callers.
16239 * object.h (Object::get_view): Add aligned parameter. Change all
16241 (Object::get_lasting_view): Likewise.
16243 * fileread.cc (File_read::release): Don't call clear_views if
16244 there are multiple objects.
16245 * fileread.h (File_read::clear_uncached_views): New function.
16246 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16249 2008-03-31 Cary Coutant <ccoutant@google.com>
16251 Add thin archive support.
16252 * archive.cc (Archive::armagt): New const.
16253 (Archive::setup): Remove task parameter and calls to unlock.
16254 (Archive::unlock_nested_archives): New function.
16255 (Archive::read_header): Add nested_off parameter. Change
16257 (Archive::interpret_header): Likewise.
16258 (Archive::include_all_members): Change to handle thin
16260 (Archive::include_member): Likewise.
16261 * archive.h (Archive::Archive): Add new parameters and
16263 (Archive::armagt): New const.
16264 (Archive::setup): Remove task parameter.
16265 (Archive::unlock_nested_archives): New function.
16266 (Archive::read_header): Add nested_off parameter.
16267 (Archive::interpret_header): Likewise.
16268 (Archive::Nested_archive_table): New typedef.
16269 (Archive::is_thin_archive_): New field.
16270 (Archive::nested_archives_): New field.
16271 (Archive::options_): New field.
16272 (Archive::dirpath_): New field.
16273 (Archive::task_): New field.
16274 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16275 for thin archives. Pass additional parameters to
16276 Archive::Archive. Unlock the archive file after calling
16279 2008-03-29 Ian Lance Taylor <iant@google.com>
16281 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16282 version symbol to be local.
16283 * testsuite/ver_test_4.sh: New file.
16284 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16285 (check_DATA): Add ver_test_4.syms.
16286 (ver_test_4.syms): New target.
16287 * testsuite/Makefile.in: Rebuild.
16290 (Output_section::Input_section_sort_entry::has_priority): New
16292 (Output_section::Input_section_sort_entry::match_file_name): New
16294 (Output_section::Input_section_sort_entry::match_section_name):
16296 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16298 (Output_section::Input_section_sort_entry::match_section_file):
16300 (Output_section::Input_section_sort_compare::operator()): Rewrite
16301 using new Input_section_sort_entry functions. Sort crtbegin and
16302 crtend first. Sort sections with no priority before sections with
16304 * testsuite/initpri1.c (d3): Check j != 4.
16305 (cd5): New constructor/destructor function.
16306 (main): Check j != 2.
16308 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16309 new symbol when resolving, don't call set_is_default.
16310 * testsuite/ver_test_7.cc: New file.
16311 * testsuite/ver_test_7.sh: New file.
16312 * testsuite/Makefile.am (ver_test_7.so): New target.
16313 (ver_test_7.o): New target.
16314 (check_SCRIPTS): Add ver_test_7.sh.
16315 (check_DATA): Add ver_test_7.syms.
16316 (ver_test_7.syms): New target.
16318 2008-03-28 Ian Lance Taylor <iant@google.com>
16320 * layout.cc (Layout::layout): If we see an input section with a
16321 name that needs sorting, set the must_sort flag for the output
16323 (Layout::make_output_section): If the name of the output section
16324 indicates that it might require sorting, set the may_sort flag.
16325 * output.h (Output_section::may_sort_attached_input_sections): New
16327 (Output_section::set_may_sort_attached_input_sections): New
16329 (Output_section::must_sort_attached_input_sections): New
16331 (Output_section::set_must_sort_attached_input_sections): New
16333 (class Output_section): Declare Input_section_sort_entry. Define
16334 Input_section_sort_compare. Declare
16335 sort_attached_input_sections. Add new fields:
16336 may_sort_attached_input_sections_,
16337 must_sort_attached_input_sections_,
16338 attached_input_sections_are_sorted_.
16339 * output.cc (Output_section::Output_section): Initialize new
16341 (Output_section::add_input_section): Add an entry to
16342 input_sections_ if may_sort or must_sort are true.
16343 (Output_section::set_final_data_size): Call
16344 sort_attached_input_sections if necessary.
16345 (Output_section::Input_section_sort_entry): Define new class.
16346 (Output_section::Input_section_sort_compare::operator()): New
16348 (Output_section::sort_attached_input_sections): New function.
16349 * configure.ac: Check whether the compiler supports constructor
16350 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16351 * testsuite/initpri1.c: New file.
16352 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16353 CONSTRUCTOR_PRIORITY.
16354 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16355 (initpri1_LDFLAGS): New variable.
16356 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16358 2008-03-27 Ian Lance Taylor <iant@google.com>
16360 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16361 * testsuite/common_test_1.c: New file.
16362 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16363 (common_test_1_SOURCES): New variable.
16364 (common_test_1_DEPENDENCIES): New variable.
16365 (common_test_1_LDFLAGS): New variable.
16367 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16368 and commons_ correctly when NAME/VERSION does not override
16370 * testsuite/ver_test_6.c: New file.
16371 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16372 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16373 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16375 2008-03-26 Ian Lance Taylor <iant@google.com>
16377 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16378 of an undefined symbol from a version script.
16379 * testsuite/Makefile.am (ver_test_5.so): New target.
16380 (ver_test_5.o): New target.
16381 (check_SCRIPTS): Add ver_test_5.sh.
16382 (check_DATA): Add ver_test_5.syms.
16383 (ver_test_5.syms): New target.
16384 * testsuite/ver_test_5.cc: New file.
16385 * testsuite/ver_test_5.script: New file.
16386 * testsuite/ver_test_5.sh: New file.
16387 * Makefile.in, testsuite/Makefile.in: Rebuild.
16390 Fix problems building gold with gcc 4.3.0.
16391 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16392 (gold_error_at_location, gold_warning_at_location): Use it.
16393 * configure.ac: Check whether we can compile and use a template
16394 function with a printf attribute.
16395 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16396 when jumping over bytes.
16397 * object.cc: Instantiate Object::read_section_data.
16398 * debug.h: Include <cstring>
16399 * dwarf_reader.cc: Include <algorithm>
16400 * main.cc: Include <cstring>.
16401 * options.cc: Include <cstring>.
16402 * output.cc: Include <cstring>.
16403 * script.cc: Include <cstring>.
16404 * script.h: Include <string>.
16405 * symtab.cc: Include <cstring> and <algorithm>.
16406 * target-select.cc: Include <cstring>.
16407 * version.cc: Include <string>.
16408 * testsuite/testmain.cc: Include <cstdlib>.
16409 * configure, config.in: Rebuild.
16411 2008-03-25 Ian Lance Taylor <iant@google.com>
16413 * options.cc: Include "../bfd/bfdver.h".
16414 (options::help): Print bug reporting address.
16416 * version.cc (print_version): Adjust output for current value of
16417 BFD_VERSION_STRING.
16421 * options.cc (options::help): Print list of supported targets.
16422 * target-select.h: Include <vector>.
16423 (class Target_selector): Make machine_, size_, and is_big_endian_
16424 fields const. Add bfd_name_ and instantiated_target_ fields.
16425 (Target_selector::Target_selector): Add bfd_name parameter.
16426 (Target_selector::recognize): Make non-virtual, call
16428 (Target_selector::recognize_by_name): Make non-virtual, call
16429 do_recognize_by_name.
16430 (Target_selector::supported_names): New function.
16431 (Target_selector::bfd_name): New function.
16432 (Target_selector::do_instantiate_target): New pure virtual
16434 (Target_selector::do_recognize): New virtual function.
16435 (Target_selector::do_recognize_by_name): New virtual function.
16436 (Target_selector::instantiate_target): New private function.
16437 (supported_target_names): Declare.
16438 * target-select.cc (Target_selector::Target_selector): Update for
16439 new parameter and fields.
16440 (select_target_by_name): Check that the name matches before
16441 calling recognize_by_name.
16442 (supported_target_names): New function.
16443 * i386.cc (class Target_selector_i386): Update Target_selector
16444 constructor call. Remove recognize and recognize_by_name. Add
16445 do_instantiate_target.
16446 * x86_64.cc (class Target_selector_x86_64): Likewise.
16447 * testsuite/testfile.cc (class Target_selector_test): Update for
16448 changes to Target_selector.
16450 * README: Rewrite, with some notes on unsupported features.
16452 2008-03-24 Cary Coutant <ccoutant@google.com>
16454 * i386.cc (Target_i386::Got_type): New enum declaration.
16455 (Target_i386::Scan::local): Updated callers of Output_data_got
16457 (Target_i386::Scan::global): Likewise.
16458 (Target_i386::Relocate::relocate): Likewise.
16459 (Target_i386::Relocate::relocate_tls): Likewise.
16460 * object.h (Got_offset_list): New class.
16461 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16462 (Sized_relobj::local_got_offset): Likewise.
16463 (Sized_relobj::set_local_got_offset): Likewise.
16464 (Sized_relobj::local_has_tls_got_offset): Removed.
16465 (Sized_relobj::local_tls_got_offset): Removed.
16466 (Sized_relobj::set_local_tls_got_offset): Removed.
16467 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16468 * output.cc (Output_data_got::add_global): Added got_type parameter.
16469 (Output_data_got::add_global_with_rel): Likewise.
16470 (Output_data_got::add_global_with_rela): Likewise.
16471 (Output_data_got::add_global_pair_with_rel): New function.
16472 (Output_data_got::add_global_pair_with_rela): New function.
16473 (Output_data_got::add_local): Added got_type parameter.
16474 (Output_data_got::add_local_with_rel): Likewise.
16475 (Output_data_got::add_local_with_rela): Likewise.
16476 (Output_data_got::add_local_pair_with_rel): New function.
16477 (Output_data_got::add_local_pair_with_rela): New function.
16478 (Output_data_got::add_global_tls): Removed.
16479 (Output_data_got::add_global_tls_with_rel): Removed.
16480 (Output_data_got::add_global_tls_with_rela): Removed.
16481 (Output_data_got::add_local_tls): Removed.
16482 (Output_data_got::add_local_tls_with_rel): Removed.
16483 (Output_data_got::add_local_tls_with_rela): Removed.
16484 * output.h (Output_data_got::add_global): Added got_type parameter.
16485 (Output_data_got::add_global_with_rel): Likewise.
16486 (Output_data_got::add_global_with_rela): Likewise.
16487 (Output_data_got::add_global_pair_with_rel): New function.
16488 (Output_data_got::add_global_pair_with_rela): New function.
16489 (Output_data_got::add_local): Added got_type parameter.
16490 (Output_data_got::add_local_with_rel): Likewise.
16491 (Output_data_got::add_local_with_rela): Likewise.
16492 (Output_data_got::add_local_pair_with_rel): New function.
16493 (Output_data_got::add_local_pair_with_rela): New function.
16494 (Output_data_got::add_global_tls): Removed.
16495 (Output_data_got::add_global_tls_with_rel): Removed.
16496 (Output_data_got::add_global_tls_with_rela): Removed.
16497 (Output_data_got::add_local_tls): Removed.
16498 (Output_data_got::add_local_tls_with_rel): Removed.
16499 (Output_data_got::add_local_tls_with_rela): Removed.
16500 * resolve.cc (Symbol::override_base_with_special): Removed
16501 reference to has_got_offset_ field.
16502 * symtab.cc (Symbol::init_fields): Replaced initialization
16503 of got_offset_ with got_offsets_. Removed initialization
16505 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
16506 (Symbol::got_offset): Likewise.
16507 (Symbol::set_got_offset): Likewise.
16508 (Symbol::has_tls_got_offset): Removed.
16509 (Symbol::tls_got_offset): Removed.
16510 (Symbol::set_tls_got_offset): Removed.
16511 (Symbol::got_offset_): Removed.
16512 (Symbol::tls_mod_got_offset_): Removed.
16513 (Symbol::tls_pair_got_offset_): Removed.
16514 (Symbol::got_offsets_): New field.
16515 (Symbol::has_got_offset): Removed.
16516 (Symbol::has_tls_mod_got_offset): Removed.
16517 (Symbol::has_tls_pair_got_offset): Removed.
16518 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16519 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16521 (Target_x86_64::Scan::global): Likewise.
16522 (Target_x86_64::Relocate::relocate): Likewise.
16523 (Target_x86_64::Relocate::relocate_tls): Likewise.
16525 2008-03-25 Ben Elliston <bje@au.ibm.com>
16527 * yyscript.y: Fix spelling error in comment.
16529 2008-03-24 Ian Lance Taylor <iant@google.com>
16531 * options.h (class General_options): Define build_id option.
16532 * layout.h (class Layout): Declare write_build_id, create_note,
16533 create_build_id. Add build_id_note_ member.
16534 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16535 "libiberty.h", "md5.h", "sha1.h".
16536 (Layout::Layout): Initialize eh_frame_data_,
16537 eh_frame_hdr_section_, and build_id_note_.
16538 (Layout::finalize): Call create_build_id.
16539 (Layout::create_note): New function, broken out of
16540 Layout::create_gold_note.
16541 (Layout::create_gold_note): Call create_note.
16542 (Layout::create_build_id): New function.
16543 (Layout::write_build_id): New function.
16544 (Close_task_runner::run): Call write_build_id.
16546 * x86_64.cc: Correct license to GPLv3.
16548 2008-03-23 Ian Lance Taylor <iant@google.com>
16550 * options.cc: Include "demangle.h".
16551 (parse_optional_string): New function.
16552 (parse_long_option): Handle takes_optional_argument.
16553 (parse_short_option): Update dash_z initializer. Handle
16554 takes_optional_argument.
16555 (General_options::General_options): Initialize do_demangle_.
16556 (General_options::finalize): Set do_demangle_. Handle demangling
16558 * options.h (parse_optional_string): Declare.
16559 (struct One_option): Add optional_arg field. Update constructor.
16560 Update call constructor calls. Add takes_optional_argument
16562 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16563 (DEFINE_optional_string): Define.
16564 (General_options::demangle): Change from DEFINE_bool to
16565 DEFINE_optional_string.
16566 (General_options::no_demangle): New function.
16567 (General_options::do_demangle): New function.
16568 (General_options::set_do_demangle): New function.
16569 (General_options::execstack_status_): Move definition to end of
16571 (General_options::static_): Likewise.
16572 (General_options::do_demangle_): New field.
16573 * object.cc (big_endian>::get_symbol_location_info): Call
16574 Options::do_demangle, not Options::demangle.
16575 * symtab.cc (demangle): Likewise.
16577 2008-03-22 Ian Lance Taylor <iant@google.com>
16579 * gold.h: Include <cstddef> and <sys/types.h>
16580 * options.h: Include <cstring>.
16582 2008-03-21 Ian Lance Taylor <iant@google.com>
16584 * Added source code to GNU binutils.
16586 Copyright (C) 2008-2015 Free Software Foundation, Inc.
16588 Copying and distribution of this file, with or without modification,
16589 are permitted in any medium without royalty provided the copyright
16590 notice and this notice are preserved.
16596 version-control: never