1 2015-01-22 Alan Modra <amodra@gmail.com>
3 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
4 condition for need of ifunc plt entry.
5 (Target_powerpc::Scan::global <got relocs>): Likewise.
7 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
9 * mips.cc (reloc_high): Add r_sym.
10 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
11 reloc_high constructor.
12 (Mips_relocate_functions::relgot16_local): Likewise.
13 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
14 r_type to decide whether LO16 matches HI16.
15 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
16 rello16 and relgot16_local.
18 2015-01-09 Cary Coutant <ccoutant@google.com>
20 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
21 unless alignment is larger than page size.
23 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
24 Cary Coutant <ccoutant@google.com>
27 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
28 (DEFAULT_TARGET_X32): Set for x32.
29 * x86_64.cc (cmp_insn_32): New.
30 (lea_r10_insn_32): Likewise.
31 (lea_r11_insn_32): Likewise.
32 (cmp_insn_64): Likewise.
33 (lea_r10_insn_64): Likewise.
34 (lea_r11_insn_64): Likewise.
35 (Target_x86_64<size>::do_calls_non_split): Handle x32.
36 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
37 (check_DATA): Add split_x32 files.
38 (split_x32_[1234n].o): New targets.
39 (split_x32_[124]): New targets.
40 (split_x32_[1234r].stdout): New targets.
41 * testsuite/split_x32.sh: New file.
42 * testsuite/split_x32_1.s: Likewise.
43 * testsuite/split_x32_2.s: Likewise.
44 * testsuite/split_x32_3.s: Likewise.
45 * testsuite/split_x32_4.s: Likewise.
46 * testsuite/split_x32_n.s: Likewise.
47 * configure: Regenerated.
48 * testsuite/Makefile.in: Likewise.
50 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
53 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
56 2015-01-02 Alan Modra <amodra@gmail.com>
58 * version.cc (print_version): Just print current year.
59 * dwp.cc (print_version): Likewise.
61 2015-01-01 Alan Modra <amodra@gmail.com>
63 Update year range in copyright notice of all files.
65 2014-12-25 Alan Modra <amodra@gmail.com>
67 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
69 (Target_arm::merge_object_attributes, ): Likewise.
71 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
73 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
74 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
75 AEABI_VFP_args_vfp to check that.
76 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
77 value and replace hardcoded values by enum values.
79 2014-12-22 Cary Coutant <ccoutant@google.com>
81 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
83 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
86 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
87 to "return i * i * 3;".
89 2014-12-16 Cary Coutant <ccoutant@google.com>
91 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
92 (Mapfile::print_output_data): Use current_data_size() to avoid
93 assert for sections requiring postprocessing; if address is not valid,
95 (Mapfile::print_output_section): Use current_data_size(); print note
96 that addresses and sizes are before compression.
98 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
100 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
101 Cast current_group_size to unsigned long when reporting error.
103 2014-12-10 Jing Yu <jingyu@google.com>
105 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
106 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
107 Update error message.
108 (Target_aarch64::do_relax): Use absolute value of option
109 stub_group_size. Replace local variable with class member
112 2014-12-04 Alan Modra <amodra@gmail.com>
114 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
115 addend of PLTREL24 reloc when not generating a plt stub. Make
116 max_branch_offset an "Address".
117 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
118 (Target_powerpc::Relocate::relocate): Likewise.
120 2014-12-04 Alan Modra <amodra@gmail.com>
123 * symtab.cc (Symbol::set_undefined): Remove assertion.
124 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
125 on symbols defined in discarded sections, instead return false.
126 Rearrange params, update all callers.
127 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
128 branches to syms in discarded sections.
129 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
130 undefined and flag as discarded.
131 (Target_powerpc::Relocate::relocate): Localize variable.
133 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
136 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
137 * testsuite/Makefile.in: Regenerated.
139 2014-12-03 Alan Modra <amodra@gmail.com>
142 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
143 when adding dynamic relocations against section symbols.
145 2014-12-01 Dimitry Ivanov <dimitry@google.com>
147 * layout.cc (Layout::finish_dynamic_section): When '-z global'
148 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
149 * options.h (General_options): New -z option (global).
151 2014-12-01 Cary Coutant <ccoutant@google.com>
154 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
156 (Layout::create_executable_stack_info): Warn when -z noexecstack is
157 given but some inputs require executable stack.
159 2014-11-26 Cary Coutant <ccoutant@google.com>
161 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
162 .debug_str_offsets; strip .debug_gnu_pubnames and
164 (lines_only_debug_sections): Strip all four new sections.
166 2014-11-26 Jing Yu <jingyu@google.com>
168 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
169 register to be x0 when to relax TLSDESC_LD64_LO12.
171 2014-11-26 Alan Modra <amodra@gmail.com>
173 * powerpc.cc (struct Stub_table_owner): New.
174 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
175 unsigned int vector. Update all references.
176 (powerpc_relobj::set_stub_table): Take an unsigned int param
177 rather than a Stub_table. Update callers.
178 (Powerpc_relobj::clear_stub_table): New function.
179 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
180 stub_group_size_ vars.
181 (Target_powerpc::new_stub_table): Delete.
182 (max_branch_delta): New function, extracted from..
183 (Target_powerpc::Relocate::relocate): ..here..
184 (Target_powerpc::Branch_info::make_stub): ..and here. Return
185 status on whether stub created successfully.
186 (Stub_control::Stub_control): Add "no_size_errors" param. Move
188 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
189 reduce on relax failure.
190 (Target_powerpc::group_sections): Add "no_size_errors" param.
191 Use stub_group_size_. Set up group info in a temp vector,
192 before building Stub_table vector. Account for input sections
193 possibly already converted to relaxed sections.
194 (Stub_table::init): Delete. Merge into..
195 (Stub_table::Stub_table): ..here.
196 (Stub_table::can_reach_stub): New function.
197 (Stub_table::add_plt_call_entry): Add "from" parameter and
198 return true iff stub could be reached.
199 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
201 (Stub_table::clear_stubs): Add "all" param.
203 2014-11-26 Alan Modra <amodra@gmail.com>
205 * powerpc.cc (Stub_control::set_output_and_owner): New function.
206 (Target_powerpc::group_sections): Use it.
208 2014-11-25 Cary Coutant <ccoutant@google.com>
210 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
211 (Binary_to_elf::write_symbol): Add st_size parameter.
212 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
214 2014-11-25 Cary Coutant <ccoutant@google.com>
217 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
218 (Sized_relobj_file::do_layout): Handle deferred sections properly
219 during GC pass 1. Don't add reloc sections to deferred list twice.
220 * object.h (Sized_relobj_file::is_deferred_layout): New function.
221 (Sized_relobj_file::is_deferred_layout_): New data member.
223 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
226 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
227 Check PC-relative offset overflow in PLT entry.
229 2014-11-21 Alan Modra <amodra@gmail.com>
231 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
234 2014-11-20 Alan Modra <amodra@gmail.com>
236 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
237 from --stub-group-size parameter divided by 1024.
238 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
239 template parameter. Update all uses.
240 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
241 has_stub_value. Set for long branches. Don't report overflow for
242 branch to undefined weak symbols. Print info message on
243 overflowing branch to stub.
245 2014-11-20 Alan Modra <amodra@gmail.com>
247 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
249 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
251 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
252 entry for R_X86_64_GOTPLT64.
253 (Target_x86_64<size>::Relocate::relocate): Update comments for
256 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
258 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
259 * plugin.h: add lock definition
261 2014-10-29 Han Shen <shenhan@google.com>
262 Jing Yu <jingyu@google.com>
264 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
265 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
266 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
268 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
270 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
271 (Target_aarch64::tls_ld_to_le): New method.
272 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
274 (Output_data_plt_aarch64::irelative_rel_): New data member.
275 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
276 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
277 (Output_data_plt_aarch64::add_relocation): New method.
278 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
279 offset. Add got_irelative size to got size.
280 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
281 type string with the new typename.
282 (AArch64_relocate_functions::update_adr): Replace parameter x with
284 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
285 (AArch64_relocate_functions::reloc_common): New method.
286 (AArch64_relocate_funcsions::rela_general): Extract common part out
287 into reloc_common method.
288 (AArch64_relocate_functions::rela_general): Likewise.
289 (AArch64_relocate_functions::pcrela_general): Likewise.
290 (AArch64_relocate_functions::adr): New method.
291 (AArch64_relocate_functions::adrp): Calculate immed before calling
293 (AArch64_relocate_functions::adrp): Likewise.
294 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
295 comparing x to 0. Calculate immed from ~x when x < 0.
296 (Target_aarch64::optimize_tls_reloc): Add new cases for
297 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
298 TLSLD_MOVW_DTPREL_G0_NC.
299 (Target_aarch64::possible_function_pointer_reloc): Implement this
301 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
303 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
304 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
305 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
306 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
307 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
308 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
309 (Target_aarch64::make_plt_entry): Call add_entry with two more
311 (Target_aarch64::make_local_ifunc_plt_entry): New method.
312 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
313 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
314 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
315 (Target_aarch64::Relocate::relocate_tls): Add cases for
316 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
317 TLSLD_MOVW_DTPREL_G0_NC.
318 * testsuite/icf_safe_so_test.cc: Correct test comment.
319 * testsuite/icf_safe_test.sh: Add AArch64 arch.
321 2014-10-22 Alan Modra <amodra@gmail.com>
323 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
326 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
328 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
330 2014-10-17 Cary Coutant <ccoutant@google.com>
332 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
333 Add "typename" keyword.
335 2014-10-15 Han Shen <shenhan@google.com>
336 Jing Yu <jingyu@google.com>
338 Patch for gold aarch64 backend to support relaxation.
339 * aarch64-reloc.def: Change format.
340 * aarch64.cc (class Reloc_stub): New class.
341 (class Stub_table): New class.
342 (class AArch64_relobj): New class.
343 (class AArch64_input_section): New class.
344 (class AArch64_output_section): New class.
345 (Target_aarch64::new_stub_table): New method.
346 (Target_aarch64::new_aarch64_input_section): New method.
347 (Target_aarch64::find_aarch64_input_section): New method.
348 (Target_aarch64::scan_section_for_stubs): New method.
349 (Target_aarch64::scan_reloc_section_for_stubs): New method.
350 (Target_aarch64::relocate_stub): New method.
351 (Target_aarch64::current_target): New method.
352 (Target_aarch64::do_make_elf_object): New method.
353 (Target_aarch64::do_may_relax): New method.
354 (Target_aarch64::do_relax): New method.
355 (Target_aarch64::group_sections): New method.
356 (Target_aarch64::scan_reloc_for_stub): New method.
357 (Target_aarch64::do_make_output_section): New method.
358 (Target_aarch64::stub_tables_): New data member.
359 (Target_aarch64::aarch64_input_section_map_): New data member.
360 (AArch64_relocate_functions::maybe_apply_stub): New method.
362 2014-09-30 Cary Coutant <ccoutant@google.com>
365 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
367 2014-09-30 Kito Cheng <kito@0xlab.org>
370 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
371 hash table before sysv-style hash table.
373 2014-09-29 Sriraman Tallam <tmsriram@google.com>
375 * options.h (--pic-executable): Add negative to alias to -no-pie.
377 2014-09-26 Cary Coutant <ccoutant@google.com>
380 * object.cc (Sized_relobj_file): Compute value of section symbols
381 for TLS sections the same as TLS symbols.
383 2014-09-25 Cary Coutant <ccoutant@google.com>
386 * resolve.cc (Symbol_table::resolve): Override common placeholder
387 symbols, but adjust sizes.
388 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
389 symbols to common lists.
391 2014-09-24 Alan Modra <amodra@gmail.com>
393 * po/POTFILES.in: Regenerate.
395 2014-09-23 Taiju Tsuiki <tzik@google.com>
396 Cary Coutant <ccoutant@google.com>
399 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
400 on input_sections_blocker.
401 * layout.cc (Write_sections_task::locks): Unblock
402 input_sections_blocker_.
403 * layout.h (Write_sections_task::Write_sections_task): Add
404 input_sections_blocker.
405 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
407 * testsuite/Makefile.in: Regenerate.
409 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
411 * testsuite/Makefile.am (plugin_test_10): New test.
412 * testsuite/Makefile.in: Regenerate
413 * testsuite/plugin_common_test_2.c (c1): Align to 8.
414 * testsuite/plugin_test_10.sh: New file.
416 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
418 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
419 * resolve.cc (Symbol_table::resolve): Don't override common symbols
420 during the replacement phase.
422 2014-09-17 Han Shen <shenhan@google.com>
423 Jing Yu <jingyu@google.com>
425 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
426 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
427 * aarch64.cc (Target_aarch64): Add data members
428 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
429 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
431 (Target_aarch64::do_reloc_symbol_index): New method.
432 (Target_aarch64::do_reloc_addend): New method.
433 (Target_aarch64::add_tlsdesc_info): New method.
434 (Target_aarch64::do_dynsym_value): New method.
435 (Target_aarch64::do_make_data_plt): Add new parameters: got,
436 got_irelative. Pass them to Output_data_plt_aarch64_standard.
437 (Target_aarch64::make_data_plt): Add new parameters: got,
438 got_irelative. Pass them to do_make_data_plt.
439 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
440 (Target_aarch64::Relocate:tls_gd_to_le): New method.
441 (Target_aarch64::Relocate:tls_ie_to_le): New method.
442 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
443 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
444 (Target_aarch64::got_tlsdesc_section): New method.
445 (Target_aarch64::make_local_ifunc_plt_entry): New method.
446 (Target_aarch64::define_tls_base_symbol): New method.
447 (Target_aarch64::reserve_tlsdesc_entries): New method.
448 (Target_aarch64::got_mod_index_entry): New method.
449 (Target_aarch64::rela_tlsdesc_section): New method.
450 (Target_aarch64::rela_irelative_section): New method.
451 (Target_aarch64::Tlsdesc_info): New struct.
452 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
453 relocations and tlsdesc relocations.
454 (Target_aarch64::optimize_tls_reloc): Implement method.
455 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
456 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
458 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
459 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
460 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
461 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
462 (Output_data_plt_aarch64::rela_tlsdesc): New method.
463 (Output_data_plt_aarch64::rela_irelative): New method.
464 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
465 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
466 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
467 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
468 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
469 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
470 (Output_data_plt_aarch64_standard): New member variables:
471 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
472 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
473 New parameter: got, got_irelative.
474 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
475 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
476 (Output_data_plt_aarch64::do_write): Replace got_address with
477 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
478 (AArch64_relocate_functions::update_movnz): New method.
479 (AArch64_relocate_functions): Correct format.
480 (AArch64_relocate_functions::movnz): New method.
481 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
482 before the switch. Add new cases to switch.
483 Check ie_to_le relaxation on tlsie relocations. Add code handling
485 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
486 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
487 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
488 Call reloc_name_in_error_message to print unsupported reloc.
489 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
491 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
492 relocs. Fill in some more dynamic tags.
493 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
494 Skip call tls_get_addr when tlsgd is relaxed.
495 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
496 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
497 tlsdesc->ie relaxation.
499 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
501 * mips.cc (Target_mips_nacl): New class.
502 (Target_selector_mips_nacl): New class.
503 (target_selector_mips32): Rename from target_selector_mips32be and use
504 Target_selector_mips_nacl instead of Target_selector_mips.
505 (target_selector_mips32el): Rename from target_selector_mips32 and use
506 Target_selector_mips_nacl instead of Target_selector_mips.
507 (target_selector_mips64): Rename from target_selector_mips64be and use
508 Target_selector_mips_nacl instead of Target_selector_mips.
509 (target_selector_mips64el): Rename from target_selector_mips64 and use
510 Target_selector_mips_nacl instead of Target_selector_mips.
511 (Target_mips::mips_info): Add const attribute.
513 2014-09-02 Cary Coutant <ccoutant@google.com>
515 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
516 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
517 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
518 (Sized_incr_dynobj::do_section_name): Likewise.
519 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
520 (Sized_incr_dynobj::do_section_name): Likewise.
521 * object.h (Object::section_name): Likewise.
522 (Object::do_section_name): Likewise.
523 (Sized_relobj_file::do_section_name): Likewise.
524 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
525 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
527 2014-09-02 Cary Coutant <ccoutant@google.com>
530 * ehframe.cc (Fde::write): Add output_offset parameter.
531 (Cie::write): Likewise.
532 (Eh_frame::set_final_data_size): Account for offset within output
534 (Eh_frame::do_sized_write): Likewise.
535 * ehframe.h (Fde::write): Add output_offset parameter.
536 (Cie::write): Likewise.
537 * output.cc (Output_section::Input_section_sort_entry): Remove
538 section_has_name_; add output_section_name parameter. Use
539 output section name for non-input sections.
540 (Output_section::Input_section_sort_entry::section_has_name): Remove.
541 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
542 (Output_section::Input_section_sort_compare): Remove logic for
543 sections without names.
544 (Output_section::Input_section_sort_init_fini_compare): Likewise.
545 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
547 (Output_section::Input_section_sort_section_name_compare): Likewise.
549 2014-08-29 Han Shen <shenhan@google.com>
550 Jing Yu <jingyu@google.com>
552 * aarch64-reloc-property.cc
553 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
554 reference reloc property in the table.
555 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
557 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
558 2 new overloaded methods.
559 (Output_data_got_aarch64::do_write): Add code to write out
561 (class Output_data_got_aarch64::Static_reloc): New class to wrap
563 (Output_data_got_aarch64::static_relocs): New vector to
565 (Target_aarch64::TCB_SIZE): New const static memeber.
566 (Target_aarch64::tcb_size): New method.
567 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
568 (Target_aarch64::Relocate::relocate_tls): New method.
569 (Target_aarch64::Scan::local): Add code handling new reloc types.
570 (Target_aarch64::Scan::global): Add code handling new reloc types.
572 2014-08-13 Sriraman Tallam <tmsriram@google.com>
574 * options.h (-no-pie): Add option.
576 2014-08-08 Jing Yu <jingyu@google.com>
577 Han Shen <shenhan@google.com>
579 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
580 (DEFFILES): add aarch64-reloc.def.
581 (TARGETSOURCES): Add aarch64-reloc-property.cc.
582 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
583 * Makefile.in: Regenerate.
584 * aarch64-reloc-property.cc: New file.
585 * aarch64-reloc-property.h: New file.
586 * aarch64-reloc.def: New file.
587 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
588 with tab to make the format consistent.
589 (Output_data_got_aarch64::symbol_table_): New method.
590 (Target_aarch64::do_plt_address_for_global): New method.
591 (Target_aarch64::do_plt_address_for_local): New method.
592 (Target_aarch64::do_select_as_default_target): New method.
593 (Target_aarch64::do_make_data_plt): New method.
594 (Target_aarch64::make_data_plt): New method.
595 (Output_data_plt_aarch64::has_irelative_section): New method.
596 (Output_data_plt_aarch64::address_for_global): New method.
597 (Output_data_plt_aarch64::address_for_local): New method.
598 (Output_data_plt_aarch64::irelative_rel_): New parameter.
599 (Output_data_plt_aarch64::add_entry): Implement contents.
600 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
601 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
602 the got_pov entry to plt0.
603 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
605 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
606 (AArch64_howto): New struct.
607 (aarch64_howto[]): New static const array.
608 (AArch64_relocate_functions): New class.
609 (Target_aarch64::Scan::get_reference_flags): Remove method.
610 (Target_aarch64::Scan::local): Implement to support a few relocations.
611 (Target_aarch64::Scan::global): Implement to support a few relocations.
612 (Target_aarch64::make_plt_section): Implement contents.
613 (Target_aarch64::make_plt_entry): Implement contents.
614 (Target_aarch64::do_finalize_sections): Implement contents.
615 (Target_aarch64::Relocate::relocate): Implement a few relocations.
616 (Target_aarch64::relocate_section): Implement contents.
618 2014-08-06 Alan Modra <amodra@gmail.com>
620 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
622 2014-08-06 Alan Modra <amodra@gmail.com>
625 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
627 2014-07-21 Sriraman Tallam <tmsriram@google.com>
629 * object.cc (Relobj::is_section_name_included): Add
630 ".rodata.nptl_version" to not garbage collect this section.
632 2014-07-08 Cary Coutant <ccoutant@google.com>
634 * expression.cc (struct Expression::Expression_eval_info): Add
635 new fields type_pointer, vis_pointer, and nonvis_pointer.
636 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
637 nonvis_pointer parameters. Adjust all calls.
638 (Symbol_expression::value): Update type, visibility, and nonvis bits
640 * script.cc (Symbol_assignment::sized_finalize): Update type,
641 visibility, and remaining st_other bits for new symbol.
642 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
643 vis_pointer, and nonvis_pointer parameters.
644 * symtab.h (Symbol::set_type): New method.
646 * testsuite/Makefile.am (defsym_test): New test.
647 * testsuite/Makefile.in: Regenerate.
648 * testsuite/defsym_test.c: New file.
649 * testsuite/defsym_test.sh: New file.
651 2014-07-08 Cary Coutant <ccoutant@google.com>
654 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
655 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
656 (Sized_dynobj::base_read_symbols): ...new method.
657 * object.h (Sized_relobj_file::base_read_symbols): New method.
658 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
659 (Sized_relobj_file::base_read_symbols): ...new method.
660 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
661 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
662 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
664 2014-07-04 Alan Modra <amodra@gmail.com>
666 * po/POTFILES.in: Regenerate.
668 2014-07-02 Jing Yu <jingyu@google.com>
670 * aarch64.cc: New file
671 * Makefile.am (TARGETSOURCES): Add aarch64.cc
672 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
673 * Makefile.in: Regenerate.
674 * configure.tgt: Add entries for aarch64*.
675 * configure.ac: Likewise.
676 * configure: Likewise.
678 2014-06-27 Alan Modra <amodra@gmail.com>
680 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
682 2014-06-24 Cary Coutant <ccoutant@google.com>
684 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
686 (Dwo_file::sized_read_unit_index): Likewise.
688 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
691 * Makefile.am (TARGETSOURCES): Add mips.cc
692 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
693 * configure.tgt: Add entries for mips*.
694 * configure.ac: Likewise.
695 * Makefile.in: Regenerate.
696 * configure: Likewise.
698 2014-06-09 Cary Coutant <ccoutant@google.com>
700 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
701 unit_length is within section bounds.
703 2014-06-09 Cary Coutant <ccoutant@google.com>
706 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
709 2014-06-07 Alan Modra <amodra@gmail.com>
711 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
713 2014-06-06 Cary Coutant <ccoutant@google.com>
715 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
716 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
717 (Dwarf_pubnames_table::read_header): Likewise.
718 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
721 2014-06-05 Joel Brobecker <brobecker@adacore.com>
723 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
724 * Makefile.in, configure: Regenerate.
726 2014-06-03 Alan Modra <amodra@gmail.com>
728 * powerpc.cc (addis_12_2): Define.
729 (Stub_table::do_write): Support fusion on ELFv2 stubs.
731 2014-06-03 Alan Modra <amodra@gmail.com>
733 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
736 2014-06-02 Alan Modra <amodra@gmail.com>
738 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
739 Only ignore relocs on ELFv1.
740 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
742 2014-05-30 Cary Coutant <ccoutant@google.com>
744 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
745 * testsuite/Makefile.in: Regenerate.
746 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
748 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
751 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
752 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
754 2014-05-15 Alan Modra <amodra@gmail.com>
756 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
757 Compare FDE contents with DW_CFA_nop rather than 0.
759 2014-05-13 Sriraman Tallam <tmsriram@google.com>
761 * symtab.h (may_need_copy_reloc): Remove check for position independent
763 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
764 position independence before pc absolute may_need_copy_reloc call.
765 Add check for executable output befor pc relative may_need_copy_reloc
771 * powerpc.cc: Add check for no position independence before
772 may_need_copy_reloc calls.
773 * testsuite/pie_copyrelocs_test.cc: New file.
774 * testsuite/pie_copyrelocs_shared_test.cc: New file.
775 * Makefile.am (pie_copyrelocs_test): New test.
776 * Makefile.in: Regenerate.
778 2014-05-08 Martin Liška <mliska@suse.cz>
780 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
782 2014-05-06 Cary Coutant <ccoutant@google.com>
785 * i386.cc (Output_data_got_plt_i386): New class.
786 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
787 parameter. Change all callers.
788 (Output_data_plt_i386::layout_): Remove.
789 (Output_data_plt_i386::got_plt_): Change type.
790 (Target_i386::got_plt_): Change type. Change all references.
791 (Target_i386::got_section): Create instance of new class.
792 (Output_data_got_plt_i386::do_write): New function.
793 * x86_64.cc (Output_data_got_plt_x86_64): New class.
794 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
795 parameter. Change all callers.
796 (Output_data_plt_x86_64::layout_): Remove.
797 (Output_data_plt_x86_64::got_plt_): Change type.
798 (Target_x86_64::got_plt_): Change type. Change all references.
799 (Target_x86_64::got_section): Create instance of new class.
800 (Output_data_got_plt_x86_64::do_write): New function.
801 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
802 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
805 2014-05-05 Cary Coutant <ccoutant@google.com>
807 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
808 if we have pubnames/pubtypes.
810 2014-05-02 Cary Coutant <ccoutant@google.com>
812 * defstd.cc (in_segment): Define __ehdr_start here...
813 * layout.cc (Layout::finalize): ...Instead of here. Set the
814 output segment when known.
815 * resolve.cc (Symbol::override_base_with_special): Remember
816 the original binding.
817 * symtab.cc (Symbol::set_output_segment): New function.
818 (Symbol::set_undefined): New function.
819 * symtab.h (Symbol::is_weak_undefined): Check original undef
821 (Symbol::is_strong_undefined): New function.
822 (Symbol::set_output_segment): New function.
823 (Symbol::set_undefined): New function.
824 * target-reloc.h (is_strong_undefined): Remove.
825 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
826 Check for hidden undefs.
827 (relocate_section): Call Symbol::is_strong_undefined.
829 * testsuite/Makefile.am (ehdr_start_test_1)
830 (ehdr_start_test_2, ehdr_start_test_3)
831 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
832 * testsuite/Makefile.in: Regenerate.
833 * testsuite/ehdr_start_def.cc: New source file.
834 * testsuite/ehdr_start_test.cc: New source file.
835 * testsuite/ehdr_start_test.t: New linker script.
836 * testsuite/ehdr_start_test_4.sh: New shell script.
838 2014-04-23 Cary Coutant <ccoutant@google.com>
841 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
843 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
845 * layout.cc (Layout::include_section): Allow a target to decide
846 whether to include a section.
847 * target.h (Target::should_include_section): New function.
848 (Target::do_should_include_section): New function.
850 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
852 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
854 (Copy_relocs::emit): ... here.
855 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
856 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
857 (Copy_reloc_entry::entries_): Change from private to protected.
859 2014-04-02 Sriraman Tallam <tmsriram@google.com>
861 * icf.cc (get_section_contents): Replace copies of reloc
862 vectors with const references.
864 2014-04-02 Cary Coutant <ccoutant@google.com>
866 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
867 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
868 * configure: Regenerate.
869 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
870 -fno-use-linker-plugin.
871 (LINK1, CXXLINK1): Add it to the link command.
872 * testsuite/Makefile.in: Regenerate.
874 2014-03-12 Alan Modra <amodra@gmail.com>
876 * Makefile.in: Regenerate.
878 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
880 * symtab.h (Symbol::set_nonvis): New function.
882 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
884 * symtab.cc (Sized_symbol<32>::init_output_data):
885 Instantiate the template.
886 (Sized_symbol<64>::init_output_data): Likewise.
888 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
890 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
891 adjust dynamic symbol value.
892 * target.h (Target::adjust_dyn_symbol): New function.
893 (Target::do_adjust_dyn_symbol): New function.
895 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
897 * output.cc (Output_data_dynamic::Dynamic_entry::write):
898 Get the value of DYNAMIC_CUSTOM dynamic entry.
899 * output.h (Output_data_dynamic::add_custom): New function.
900 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
902 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
903 * target.h (Target::dynamic_tag_custom_value): New function.
904 (Target::do_dynamic_tag_custom_value): New function.
906 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
908 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
910 * target.h (Target::has_custom_set_dynsym_indexes): New function.
911 (Target::do_has_custom_set_dynsym_indexes): New function.
912 (Target::set_dynsym_indexes): New function.
913 (Target::do_set_dynsym_indexes): New function.
915 2014-03-07 Alan Modra <amodra@gmail.com>
917 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
918 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
919 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
920 (Powerpc_relocate_functions::has_overflow_bitfield,
921 overflowed): Use the above.
922 (Target_powerpc::Relocate::relocate): Correct overflow checking
923 for a number of relocations. Modify overflow test for 16-bit
924 fields in instructions to signed/unsigned according to whether
925 the field takes a signed or unsigned value.
927 2014-03-05 Alan Modra <amodra@gmail.com>
929 Update copyright years.
931 2014-03-05 Alan Modra <amodra@gmail.com>
933 * powerpc.cc (Target_powerpc::Scan::local, global): Support
934 R_PPC64_ADDR64_LOCAL.
935 (Target_powerpc::Relocate::relocate): Likewise.
937 2014-03-03 Alan Modra <amodra@gmail.com>
939 * dwp.cc (print_version): Update copyright year to current.
941 2014-02-10 Alan Modra <amodra@gmail.com>
943 * po/gold.pot: Regenerate.
945 2014-02-06 Cary Coutant <ccoutant@google.com>
947 Fix problem where -u is ignored when a weak undef is seen.
949 * archive.cc (Library_base::should_include_member): Reorder
950 code to check for -u option if a weak undef has already been seen.
951 * testsuite/Makefile.am (weak_undef_test_2): New test case.
952 * testsuite/Makefile.in: Regenerate.
953 * testsuite/weak_undef_file3.cc: New file.
954 * testsuite/weak_undef_file4.cc: New file.
955 * testsuite/weak_undef_test_2.cc: New file.
957 2014-02-05 Cary Coutant <ccoutant@google.com>
959 Fix issues with gold undefined symbol diagnostics.
962 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
964 * target-reloc.h (is_strong_undefined): New function.
965 (relocate_section): Move undef vtable symbol check from here.
966 Check for is_strong_undefined.
968 2014-02-05 Cary Coutant <ccoutant@google.com>
970 Fix problems with the --dynamic-list option.
973 * options.cc (General_options::parse_dynamic_list):
974 Set have_dynamic_list_.
975 (General_options::General_options): Initialize have_dynamic_list_.
976 (General_options::finalize): Turn off -Bsymbolic and
977 -Bsymbolic-functions if --dynamic-list provided.
978 * options.h (General_options::have_dynamic_list): New function.
979 (General_options::have_dynamic_list_): New data member.
980 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
984 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
985 in --dynamic-list, mark it.
987 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
988 (dynamic_list_2): New test case.
989 * testsuite/Makefile.in: Regenerate.
990 * testsuite/dynamic_list_2.cc: New file.
991 * testsuite/dynamic_list_2.t: New file.
992 * testsuite/dynamic_list_lib1.cc: New file.
993 * testsuite/dynamic_list_lib2.cc: New file.
994 * testsuite/gc_dynamic_list_test.c: New file.
995 * testsuite/gc_dynamic_list_test.sh: New file.
996 * testsuite/gc_dynamic_list_test.t: New file.
998 2014-01-28 Cary Coutant <ccoutant@google.com>
1000 Add .gdb_index version 7 support.
1002 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1003 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1005 (Dwarf_ranges_table::read_ranges_table): Likewise.
1006 (Dwarf_pubnames_table::read_section): Check for GNU-style
1007 sections, and for compressed debug sections.
1008 (Dwarf_pubnames_table::read_header): Compute end address of table.
1009 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1010 for end of list by offset, not by offset == 0.
1011 (Dwarf_info_reader::do_read_string_table): Check for compressed
1013 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1014 Initialize new data members.
1015 (Dwarf_pubnames_table::next_name): return flag_byte.
1016 (Dwarf_pubnames_table::end_of_table_): New data member.
1017 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1018 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1019 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1020 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1021 read skeleton type unit DIEs.
1022 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1023 (Gdb_index::do_write): Write flag_byte.
1024 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1025 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1026 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1027 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1029 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1031 * version.cc (print_version): Update copyright year to 2014.
1033 2013-12-19 Dimitry Andric <dimitry@andric.com>
1035 * stringpool.cc (Stringpool_template::reserve): Add
1036 HAVE_UNORDERED_MAP case.
1037 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1039 2013-12-18 Cary Coutant <ccoutant@google.com>
1041 * configure.ac: Check for <unordered_set> and <unordered_map>.
1042 * config.in: Regenerate.
1043 * configure: Regenerate.
1044 * system.h: Use <unordered_set> and <unordered_map> if available.
1046 2013-12-10 Roland McGrath <mcgrathr@google.com>
1048 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1049 with $(INSTALL_PROGRAM_ENV).
1050 * Makefile.in: Regenerate.
1052 2013-11-22 Cary Coutant <ccoutant@google.com>
1054 * configure.ac: Add check for which library is needed for
1056 * configure: Regenerate.
1058 2013-11-22 Cary Coutant <ccoutant@google.com>
1060 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1062 * testsuite/Makefile.in: Regenerate.
1064 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1066 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1067 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1068 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1069 (Target_x86_64<size>::Scan::local): Likewise.
1070 (Target_x86_64<size>::Scan::global): Likewise.
1071 (Target_x86_64<size>::Relocate::relocate): Likewise.
1072 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1074 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1077 * testsuite/Makefile.am (check_PROGRAMS): Add
1078 exception_x86_64_bnd_test.
1079 (exception_x86_64_bnd_test_SOURCES): New macro.
1080 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1081 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1082 (exception_x86_64_bnd_test_LDADD): Likewise.
1083 (exception_x86_64_bnd_1.o): New rule.
1084 (exception_x86_64_bnd_2.o): Likewise.
1085 * testsuite/Makefile.in: Regenerated.
1087 2013-11-15 Alan Modra <amodra@gmail.com>
1089 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1091 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1092 Only call ppc64_local_entry_offset for 64-bit. Restrict
1093 symval_for_branch lookup to ELFv1.
1094 (Stub_table::add_plt_call_entry): Use unsigned int off.
1095 (Output_data_glink::Address, invalid_address): New.
1096 (Output_data_glink::add_eh_frame): Move out of line. Add
1098 (Output_data_glink::add_global_entry, find_global_entry,
1099 global_entry_address): New functions.
1100 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1101 ge_size): New variables.
1102 (Output_data_glink::set_final_data_size): Add global entry
1104 (Output_data_glink::do_write): Write global entry stubs.
1105 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1106 parameter. Return true for ELFv2. Adjust callers.
1107 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1108 ELFv1. Similarly for ifunc and dynamic relocation processing
1109 specific to ELFv1. Recognize that symbols are defined on
1110 their plt entries for ELFv2.
1111 (Target_powerpc::symval_for_branch): Assert if called for
1113 (Target_powerpc::Relocate::relocate): Use global entry plt
1114 stub for symbol value if such exists on ELFv2.
1115 (Target_powerpc::Relocate::relocate): Don't call
1116 symval_for_branch when ELFv2. Do adjust for local entry
1118 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1120 (Target_powerpc::do_plt_address_for_global): Similarly.
1122 2013-11-14 Cary Coutant <ccoutant@google.com>
1124 Revert patch -- this did not fix the problem, and there is
1127 2013-11-14 Cary Coutant <ccoutant@google.com>
1130 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1131 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1132 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1133 updating fde_offsets_.
1134 (Eh_frame_hdr::lock_): New data member.
1136 2013-11-14 Cary Coutant <ccoutant@google.com>
1138 * dwp.cc (Dwo_file_entry): New type.
1139 (File_list): Use Dwo_file_entry.
1140 (Dwo_file::verify): New function.
1141 (Dwo_file::verify_dwo_list): New function.
1142 (Dwo_file::sized_verify_dwo_list): New function.
1143 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1145 (Dwp_options): New enum type.
1146 (dwp_options): Add --verify-only.
1149 * dwp.h (gold_info): Add declaration.
1151 2013-11-14 Cary Coutant <ccoutant@google.com>
1154 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1155 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1156 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1157 updating fde_offsets_.
1158 (Eh_frame_hdr::lock_): New data member.
1160 2013-11-06 Cary Coutant <ccoutant@google.com>
1163 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1164 before reloc sections.
1166 2013-11-04 Alan Modra <amodra@gmail.com>
1168 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1169 (Symbol::needs_dynamic_reloc): Test new flag.
1170 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1171 (Target_powerpc::Scan::get_reference_flags): Add target param.
1172 Return FUNC_DESC_ABI for 64-bit ELFv1.
1173 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1175 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1176 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1178 2013-10-31 Cary Coutant <ccoutant@google.com>
1180 Restore support for dwp v2 DWARF package file format.
1182 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1183 tu_length parameter. Adjust all callers.
1184 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1185 * dwp.cc: Include dwarf.h.
1186 (Section_bounds): New struct type.
1187 (Unit_set): New struct type.
1188 (Dwo_file::Dwo_file): Initialize new data member.
1189 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1190 Combine and rename to...
1191 (Dwo_file::read_unit_index): ...this.
1192 (Dwo_file::sized_read_compunit_index)
1193 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1194 (Dwo_file::sized_read_unit_index): ...this.
1195 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1196 parameters; add section_id parameter.
1197 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1198 (Dwo_file::add_unit_set): ...this.
1199 (Dwo_file::shndx_map_): Remove.
1200 (Dwo_file::sect_offsets_): New data member.
1201 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1202 (Dwp_output_file::add_section): Rename to...
1203 (Dwp_output_file::add_contribution): ...this.
1204 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1205 (Dwp_output_file::add_tu_set): Likewise.
1206 (Dwp_output_file::Contribution): New type.
1207 (Dwp_output_file::Section::contributions): New data member.
1208 (Dwp_output_file::Cu_or_tu_set): Remove.
1209 (Dwp_output_file::Section::Section): New ctor.
1210 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1211 (Dwp_output_file::Dwp_index::Section_table): New type.
1212 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1213 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1215 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1216 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1217 (Dwp_output_file::Dwp_index::section_table): New member function.
1218 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1219 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1220 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1221 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1222 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1223 (Dwp_output_file::Dwp_index::section_table_): New data member.
1224 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1225 (Dwp_output_file::add_output_section): New member function.
1226 (Dwp_output_file::write_new_section): New member function.
1227 (Dwp_output_file::write_contributions): New member function.
1228 (Dwp_output_file::section_id_map_): New data member.
1229 (class Dwo_id_info_reader): Remove.
1230 (class Unit_reader): New class.
1231 (get_dwarf_section_name): New function.
1232 (Dwo_file::read_executable): Adjust initializations of class data.
1233 (Dwo_file::read): Add support for v2 package file format.
1234 (Dwo_file::read_unit_index): Likewise.
1235 (Dwo_file::sized_read_unit_index): Likewise.
1236 (Dwo_file::copy_section): Likewise.
1237 (Dwo_file::add_unit_set): Likewise.
1238 (Dwp_output_file::add_output_section): Likewise.
1239 (Dwp_output_file::add_contribution): Likewise.
1240 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1242 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1244 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1246 (Dwp_output_file::initialize): Remove unused function.
1247 (Dwp_output_file::finalize): Add support for v2 package file format.
1248 (Dwp_output_file::write_index): Likewise.
1249 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1252 2013-10-31 Cary Coutant <ccoutant@google.com>
1254 * configure.ac: Fix check for -fmerge-constants.
1255 * configure.ac: Regenerate.
1257 2013-10-30 Roland McGrath <mcgrathr@google.com>
1259 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1260 Correct 9-byte nop sequence to match what the assembler generates.
1262 2013-10-30 Alan Modra <amodra@gmail.com>
1264 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1265 ppc64_local_entry_offset, ppc64_local_entry_offset,
1266 do_read_symbols): New functions.
1267 (Powerpc_relobj::e_flags_, st_other_): New vars.
1268 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1269 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1270 (Powerpc_relobj::e_flags_): New var.
1271 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1272 and adjust for ELFv2.
1273 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1274 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1275 (Powerpc_dynobj::do_find_special_sections): Likewise.
1276 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1277 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1278 to ELFv2 local entry.
1279 (Target_powerpc::do_relax): No thread safe barriers needed for
1281 (Output_data_plt_powerpc::initial_plt_entry_size_,
1282 plt_entry_size): Delete. Replace all uses with
1283 first_plt_entry_offset() and plt_entry_size().
1284 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1285 reserved_size parm. Update callers.
1286 (Output_data_plt_powerpc::entry_count): Update.
1287 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1288 and use Target_powerpc::first_plt_entry_offset().
1289 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1290 rename to plt_entry_size.
1291 (Output_data_plt_powerpc::add_ifunc_entry,
1292 add_local_ifunc_entry): Adjust reloc for ELFv2.
1293 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1294 (glink_eh_frame_fde_64v2): New.
1295 (Stub_table::plt_call_size): Support ELFv2 sizing.
1296 (Output_data_glink::add_eh_frame): Use the new FDE.
1297 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1298 (Stub_table::do_write): Write ELFv2 stubs and glink.
1299 (Target_powerpc::Relocate::relocate): Replaces nop after call
1300 with ld 2,24(1) and adjust local offset destination for ELFv2.
1302 2013-10-30 Alan Modra <amodra@gmail.com>
1304 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1305 (Target_powerpc::Scan::global, local): Likewise.
1306 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1307 on all ppc64 @h and @ha relocs.
1309 2013-10-14 Alan Modra <amodra@gmail.com>
1311 * output.h (Output_data_got::add_constant): Tidy.
1312 (Output_data_got::add_constant_pair): New function.
1313 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1314 methods used so as to first call reserve_ent().
1316 2013-10-11 Roland McGrath <mcgrathr@google.com>
1318 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1319 add_got_entry and add_got_entry_pair.
1321 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1322 (HAVE_PUBNAMES): Likewise.
1323 * configure: Regenerate.
1325 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1326 * testsuite/Makefile.in: Regenerate.
1328 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1329 Remove const from declaration.
1330 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1331 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1332 * output.h (Output_file_header): Remove const from member target_
1333 and corresponding constructor argument.
1334 * output.cc (Output_file_header::Output_file_header): Update prototype.
1335 (Output_file_header::do_sized_write): Use this->target_ in place
1336 of parameters()->target().
1338 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1340 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1341 * configure: Regenerate.
1342 * Makefile.in: Regenerate.
1343 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1344 * testsuite/merge_string_literals_2.c: Likewise.
1345 * testsuite/Makefile.am
1346 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1347 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1348 literal -fmerge-constants.
1349 * testsuite/Makefile.in: Regenerate.
1351 * i386.cc (Target_i386): Remove unused member dynbss_.
1352 * arm.cc (Target_arm): Likewise.
1353 * powerpc.cc (Target_powerpc): Likewise.
1354 * sparc.cc (Target_sparc): Likewise.
1355 * tilegx.cc (Target_tilegx): Likewise.
1356 * x86_64.cc (Target_x86_64): Likewise.
1357 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1358 type_signature_, type_offset_.
1359 * plugin.h (Plugin_hook): Remove unused member layout_.
1360 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1362 (Read_member): Remove unused members input_objects_, symtab_,
1364 (Check_library): Remove unused member symtab_.
1365 * archive.h (Lib_group): Remove unused member lib_.
1366 * archive.cc (Lib_group::Lib_group): Update initializer.
1367 * incremental.h (Incremental_binary): Remove unused member target_.
1368 (Incremental_script_entry): Removed unused member script_.
1369 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1370 * icf.h (Icf): Remove unused member num_tracked_relocs.
1372 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1373 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1375 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1377 * archive.h: Use struct rather than class for forward declaration
1378 of Read_symbols_data.
1380 2013-10-07 Cary Coutant <ccoutant@google.com>
1383 * testsuite/Makefile.am (icf_test): Fix dependencies.
1384 (icf_safe_test): Likewise.
1385 (icf_safe_so_test): Likewise.
1386 (large_symbol_alignment): Add empty _LDADD rule.
1387 * testsuite/Makefile.in: Regenerate.
1389 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1392 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1393 relocation for R_X86_64_32 on x32.
1395 2013-08-27 Roland McGrath <mcgrathr@google.com>
1397 * output.cc (Output_segment::set_section_addresses): Take new
1398 Target* argument. If target->isolate_execinstr() and the segment
1399 is executable and starts at a target->abi_pagesize() boundary,
1400 pad its end out to a target->abi_pagesize() boundary with code fill.
1401 * output.h (Output_segment::set_section_addresses): Update decl.
1402 * layout.h (Layout::check_output_data_for_reset_values): Take new
1403 argument RELAX_OUTPUTS.
1404 (Layout): New member relax_output_list_.
1405 (Layout::add_relax_output): New method.
1406 * layout.cc (Layout::Layout): Update constructor.
1407 (Layout::reset_relax_output): New method.
1408 (Layout::clean_up_after_relaxation): Call it.
1409 (Layout::prepare_for_relaxation): Update caller.
1410 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1411 Call reset_relax_output before re-processing segments for
1412 isolate_execinstr case.
1413 (Layout::write_data): Handle relax_output_list_.
1414 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1415 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1417 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1420 * object.h: Fix typos.
1422 2013-08-16 Roland McGrath <mcgrathr@google.com>
1424 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1425 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1427 2013-08-07 Cary Coutant <ccoutant@google.com>
1429 Revert support for v2 DWP files:
1431 2013-03-01 Cary Coutant <ccoutant@google.com>
1433 Add dwp support for v2 DWARF package file format.
1434 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1435 tu_length parameter. Adjust all callers.
1436 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1437 * dwp.cc: Include dwarf.h.
1438 (Section_bounds): New struct type.
1439 (Unit_set): New struct type.
1440 (Dwo_file::Dwo_file): Initialize new data member.
1441 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1442 Combine and rename to...
1443 (Dwo_file::read_unit_index): ...this.
1444 (Dwo_file::sized_read_compunit_index)
1445 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1446 (Dwo_file::sized_read_unit_index): ...this.
1447 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1448 parameters; add section_id parameter.
1449 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1450 (Dwo_file::add_unit_set): ...this.
1451 (Dwo_file::shndx_map_): Remove.
1452 (Dwo_file::sect_offsets_): New data member.
1453 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1454 (Dwp_output_file::add_section): Rename to...
1455 (Dwp_output_file::add_contribution): ...this.
1456 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1457 (Dwp_output_file::add_tu_set): Likewise.
1458 (Dwp_output_file::Contribution): New type.
1459 (Dwp_output_file::Section::contributions): New data member.
1460 (Dwp_output_file::Cu_or_tu_set): Remove.
1461 (Dwp_output_file::Section::Section): New ctor.
1462 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1463 (Dwp_output_file::Dwp_index::Section_table): New type.
1464 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1465 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1467 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1468 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1469 (Dwp_output_file::Dwp_index::section_table): New member function.
1470 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1471 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1472 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1473 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1474 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1475 (Dwp_output_file::Dwp_index::section_table_): New data member.
1476 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1477 (Dwp_output_file::add_output_section): New member function.
1478 (Dwp_output_file::write_new_section): New member function.
1479 (Dwp_output_file::write_contributions): New member function.
1480 (Dwp_output_file::section_id_map_): New data member.
1481 (class Dwo_id_info_reader): Remove.
1482 (class Unit_reader): New class.
1483 (get_dwarf_section_name): New function.
1484 (Dwo_file::read_executable): Adjust initializations of class data.
1485 (Dwo_file::read): Add support for v2 package file format.
1486 (Dwo_file::read_unit_index): Likewise.
1487 (Dwo_file::sized_read_unit_index): Likewise.
1488 (Dwo_file::copy_section): Likewise.
1489 (Dwo_file::add_unit_set): Likewise.
1490 (Dwp_output_file::add_output_section): Likewise.
1491 (Dwp_output_file::add_contribution): Likewise.
1492 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1494 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1496 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1498 (Dwp_output_file::initialize): Remove unused function.
1499 (Dwp_output_file::finalize): Add support for v2 package file format.
1500 (Dwp_output_file::write_index): Likewise.
1501 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1504 2013-07-31 Cary Coutant <ccoutant@google.com>
1506 * object.cc (Sized_relobj::do_output_section_address): New function.
1507 (Sized_relobj): Instantiate explicitly.
1508 * object.h (Object::output_section_address): New function.
1509 (Object::do_output_section_address): New function.
1510 (Sized_relobj::do_output_section_address): New function.
1511 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1513 2013-07-30 Cary Coutant <ccoutant@google.com>
1514 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1516 * parameters.cc (Parameters::entry): Return target-specific entry
1518 * target.h (Target::entry_symbol_name): New function.
1519 (Target_info::entry_symbol_name): New data member.
1521 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1522 * i386.cc (Target_i386::i386_info): Likewise.
1523 (Target_i386_nacl::i386_nacl_info): Likewise.
1524 * sparc.cc (Target_sparc::sparc_info): Likewise.
1525 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1526 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1527 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1528 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1530 2013-07-22 Sterling Augustine <saugustine@google.com>
1532 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1533 Convert parameter shndx to local variable. Add parameters symtab
1534 and symtab_size. Scan over section names. Find relocation
1535 section corresponding to current section. Create and initialize
1536 reloc_mapper_ and reloc_type_.
1537 (Dwarf_pubnames_table::read_header): Add assertion. Change
1538 unit_length to off_t. Initialize member unit_length_. Fill in field
1540 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1541 Initialize new fields unit_length_ and cu_offset_.
1542 (Dwarf_pubnames_table::read_section): Update prototype.
1543 (Dwarf_pubnames_table::cu_offset): New member function.
1544 (Dwarf_pubnames_table::subsection_size): Likewise.
1545 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1547 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1548 member functions public.
1549 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1550 Update comment. Rework logic. Move repeated parts to...
1551 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1552 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1553 pubtypes_table_, and stmt_list_offset.
1554 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1555 Gdb_index::find_pubtype_offset,
1556 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1557 (Gdb_index::pubnames_read): Update prototype and rework logic.
1558 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1560 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1561 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1562 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1563 Gdb_index::map_pubtable_to_dies):
1565 (Gdb_index::pubnames_read): Update declaration.
1566 (Gdb_index::Pubname_offset_map): New type.
1567 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1568 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1569 Gdb_index::stmt_list_offset): Declare.
1570 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1571 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1572 Gdb_index::pubtypes_offset_): Remove.
1574 2013-07-19 Roland McGrath <mcgrathr@google.com>
1576 * options.h (General_options): Add -Trodata-segment option.
1577 * parameters.cc (Parameters::check_rodata_segment): New function.
1578 (Parameters::set_target_once): Call it.
1579 * parameters.h (Parameters): Declare it (private member function).
1580 * layout.cc (load_seg_unusable_for_headers): New function, broken
1581 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1582 then validate rodata segment rather than text segment.
1583 (relaxation_loop_body): Call that.
1584 (is_text_segment): New function. Don't admit a non-executable
1585 segment if TARGET->isolate_execinstr().
1586 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1588 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
1591 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1592 * nacl.h (Sniff_file::View::View): Request aligned view.
1594 2013-07-11 Cary Coutant <ccoutant@google.com>
1596 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1597 correct BRLT entry size.
1599 2013-07-03 Alan Modra <amodra@gmail.com>
1601 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1604 2013-07-01 Cary Coutant <ccoutant@google.com>
1606 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1608 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1609 (Dwarf_ranges_table::lookup_reloc): New function.
1610 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1612 (Dwarf_ranges_table::lookup_reloc): New function.
1613 (Dwarf_ranges_table::reloc_type_): New data member.
1615 2013-06-27 Jing Yu <jingyu@google.com>
1618 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1620 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1621 (Target_powerpc::do_relax): Call the above.
1623 2013-06-27 Cary Coutant <ccoutant@google.com>
1625 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1626 on garbage collected .opd section.
1628 2013-06-27 Alan Modra <amodra@gmail.com>
1630 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1632 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1633 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1635 2013-06-14 Cary Coutant <ccoutant@google.com>
1637 * resolve.cc (Symbol::override_base): Don't override st_type
1638 from plugin placeholder symbols.
1639 (Symbol_table::resolve): Likewise.
1640 (Symbol_table::should_override): Don't complain about TLS mismatch
1641 if the TO symbol is a plugin placeholder.
1642 * testsuite/Makefile.am (plugin_test_tls): New test.
1643 * testsuite/Makefile.in: Regenerate.
1644 * testsuite/plugin_test_tls.sh: New test script.
1645 * testsuite/two_file_test_2_tls.cc: New test source.
1646 * testsuite/two_file_test_tls.cc: New test source.
1648 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1650 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1651 the maximum segment alignment is larger than the page size.
1652 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1653 correctly aligns the symbols with large alignemnt.
1654 * testsuite/Makefile.in: Regenerate.
1655 * testsuite/large_symbol_alignment.cc: New file.
1657 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1658 Sriraman Tallam <tmsriram@google.com>
1660 * options.h (sort_section): New option.
1661 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1662 Rename from Input_section_sort_section_name_special_ordering_compare.
1663 (Input_section_sort_section_name_compare): New struct.
1664 * output.cc (Output_section::Input_section_sort_section_name_compare::
1665 operator()): New function.
1666 (Output_section::sort_attached_input_sections): Use new sort function
1667 for .text if --sort-section=name is specified.
1668 * layout.cc (Layout::make_output_section):
1669 Add sorting by name when --sort-section=name is specified.
1670 * testsuite/Makefile.am (text_section_grouping): Test option
1671 --sort-section=name.
1672 * testsuite/Makefile.in: Regenerate.
1673 * testsuite/section_sorting_name.cc: New file.
1674 * testsuite/section_sorting_name.sh: New file.
1676 2013-05-21 Cary Coutant <ccoutant@google.com>
1678 * symtab.h (Symbol::is_cxx_vtable): New function.
1679 * target-reloc.h (relocate_section): Check for vtable symbol.
1680 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1681 * testsuite/Makefile.in: Regenerate.
1682 * testsuite/missing_key_func.cc: New test source.
1683 * testsuite/missing_key_func.sh: New test script.
1685 2013-05-21 Cary Coutant <ccoutant@google.com>
1687 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1688 type of enclosing symbol.
1689 (Relocate_info::location): Check symbol type when describing symbol.
1690 * object.h (Symbol_location_info): Remove unused line_number;
1691 add enclosing_symbol_type.
1692 * testsuite/debug_msg.sh: Adjust expected output.
1694 2013-05-13 Cary Coutant <ccoutant@google.com>
1696 * configure.ac: Export DEFAULT_TARGET.
1697 * configure: Regenerate.
1698 * Makefile.in: Regenerate.
1699 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1700 * testsuite/Makefile.in: Regenerate.
1701 * testsuite/debug_msg.sh: Delete duplicate tests.
1702 Don't check undef_int error message match for powerpc where the
1703 source file and line number aren't available.
1705 2013-05-10 Roland McGrath <mcgrathr@google.com>
1707 * options.h (General_options): Add --rosegment-gap option.
1708 * options.cc (finalize): --rosegment-gap implies --rosegment.
1709 * layout.cc (set_segment_offsets): Let user option override
1710 target->rosegment_gap().
1712 2013-05-10 Roland McGrath <mcgrathr@google.com>
1714 * options.h (General_options): Remove leading space from help
1715 messages for -nostdlib and --rosegment.
1717 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1720 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1722 2013-05-03 Alan Modra <amodra@gmail.com>
1724 * merge.cc (Output_merge_string::do_add_input_section): Correct
1725 scan for number of strings. Rename vars to avoid shadowing.
1726 Include missing terminator in input_size_.
1728 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1730 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1731 Restore empty string handling.
1733 2013-05-01 Cary Coutant <ccoutant@google.com>
1735 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1736 uninitialized warning.
1738 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1740 * output.cc (Output_section::add_merge_input_section): Allow
1741 to merge sections if the alignment is more than character size.
1742 * merge.h (Output_merge_string::Output_merge_string): Remove
1744 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1745 only not-null strings. Check the alignment of strings.
1747 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1748 alignment as the argument.
1749 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1750 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1751 Align non-zero length strings according to the addralign_.
1752 (Stringpool_template<Stringpool_char>::set_string_offsets):
1753 Updating offsets according to the given alignment.
1754 * testsuite/Makefile.am (text_section_grouping): Test if string
1755 literals are getting merged.
1756 * testsuite/Makefile.in: Regenerate.
1757 * testsuite/merge_string_literals_1.c: New file.
1758 * testsuite/merge_string_literals_2.c: Ditto.
1759 * testsuite/merge_string_literals.sh: Ditto.
1761 2013-04-26 Ian Lance Taylor <iant@google.com>
1763 * target-reloc.h (relocate_section): If the reloc offset is out of
1764 range, pass VIEW as NULL to relocate.relocate.
1765 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1766 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1767 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1768 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1769 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1770 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1772 2013-04-26 Geoff Pike <gpike@chromium.org>
1774 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1775 * layout.cc (Hash_task): New class.
1776 (Layout::queue_build_id_tasks): New function.
1777 (Layout::write_build_id): Handle single-thread portion of build ID
1778 computation. (In some cases, all of it is single-threaded.) Replace
1779 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1780 functionality in fewer lines of code.
1781 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1782 * options.h (General_options): make "--build-id" default to tree
1783 rather than sha1. Add two new options related to --build-id=tree:
1784 --build-id-chunk-size-for-treehash and
1785 --build-id-min-file-size-for-treehash.
1786 * Makefile.am: add testing of --build-id=tree and related new options
1787 (these tests will be invoked by "make check").
1788 * Makefile.in: Regenerate.
1790 2013-04-25 Alan Modra <amodra@gmail.com>
1792 * configure.tgt: Add powerpcle and powerpc64le.
1794 2013-04-22 Alan Modra <amodra@gmail.com>
1797 * layout.cc (Layout::segment_precedes): Allow more than one
1798 segment with the same type and flags.
1800 2013-04-15 Cary Coutant <ccoutant@google.com>
1802 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1803 allocate space in file for BSS sections.
1805 2013-04-15 Cary Coutant <ccoutant@google.com>
1807 * script-sections.cc (Orphan_output_section): Reset address
1808 to zero after each orphaned section for relocatable links.
1810 2013-04-15 Cary Coutant <ccoutant@google.com>
1812 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1813 section starting address for relocatable link.
1814 * testsuite/Makefile.am (script_test_11): New test.
1815 * testsuite/Makefile.in: Regenerate.
1816 * testsuite/script_test_11.c: New source file.
1817 * testsuite/script_test_11.t: New linker script.
1819 2013-04-13 Alan Modra <amodra@gmail.com>
1821 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1822 owner when sections are not adjacent and exceed group size.
1823 (Target_powerpc::group_sections): Handle corner case.
1824 (Target_powerpc::Branch_info::make_stub): Handle case where
1825 stub table doesn't exist due to branches in non-exec sections.
1826 (Target_powerpc::Relocate::relocate): Likewise.
1828 2013-04-11 Alan Modra <amodra@gmail.com>
1831 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1832 .branch_lt to match bfd ld. Adjust comments throughout file.
1834 2013-04-04 Ian Lance Taylor <iant@google.com>
1837 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1838 sections before checking whether they are included in the link.
1840 2013-03-29 Sriraman Tallam <tmsriram@google.com>
1842 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1843 object before calling the plugin claim_file handler. Pass the elf
1844 object of the archive to the plugin. Delete the elf object if the
1845 plugin claims the file.
1847 2013-03-21 Alan Modra <amodra@gmail.com>
1849 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1850 segment when omagic.
1852 2013-03-21 Alan Modra <amodra@gmail.com>
1854 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1856 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1857 uninitialized" warning.
1859 2013-03-20 Alan Modra <amodra@gmail.com>
1861 * symtab.h (Symbol::clear_version): New function.
1862 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1863 is_needed by weak references. Clear version for symbols defined
1864 in as-needed objects that are not needed.
1866 2013-03-15 Alan Modra <amodra@gmail.com>
1868 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1869 static and public. Add report_err param. Return false for data refs.
1870 (Target_powerpc::rela_dyn_section): New overloaded function.
1871 (Target_powerpc::plt_, iplt_): Elucidate.
1872 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1873 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1874 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1875 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1876 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1877 push_branch and make_plt_entry for ifunc syms when
1878 reloc_needs_plt_for_ifunc.
1879 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1880 for ifunc unless reloc_needs_plt_for_ifunc.
1882 2013-03-15 Alan Modra <amodra@gmail.com>
1884 * gc.h (gc_process_relocs): Don't look through function descriptors.
1885 * icf.cc (get_section_contents): Do so here instead.
1887 2013-03-13 Alan Modra <amodra@gmail.com>
1889 * powerpc.cc (is_branch_reloc): Forward declare.
1890 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1891 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1892 false for 64-bit, true for 32-bit non-branch relocs.
1893 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1894 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1896 (icf_safe_test): Generate linker map file as well as nm output.
1897 (icf_safe_so_test): Likewise.
1898 * testsuite/Makefile.in: Regenerate.
1899 * testsuite/icf_test.sh: Parse linker map file to determine
1901 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1902 * testsuite/icf_safe_so_test.sh: Likewise.
1903 (X86_32_or_ARM_specific_safe_fold): Merge into..
1904 (arch_specific_safe_fold): ..this.
1905 (X86_64_specific_safe_fold): Delete unused function.
1907 2013-03-12 Alan Modra <amodra@gmail.com>
1909 * gc.h (gc_process_relocs): Look through function descriptors
1910 to determine shndx, symvalue and addend used by ICF. Tidy
1911 variable duplication.
1913 2013-03-11 Alan Modra <amodra@gmail.com>
1915 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1916 * layout.cc (Layout_task_runner::run): ..to here.
1917 * symtab.h (struct Symbol_location): Extract from..
1918 (class Symbol_table): ..here.
1919 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1920 * target.h (class Target): Add function_location and
1921 do_function_location functions.
1922 (class Sized_target): Add do_function_location.
1923 * object.h (class Sized_relobj_file): Move find_shdr..
1924 (class Object): ..to here.
1925 * object.cc: Likewise. Update to suit. Instantiate.
1926 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1927 * powerpc.cc (class Powerpc_dynobj): New.
1928 (Target_powerpc::do_function_location): New function.
1929 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1930 (Powerpc_dynobj::do_read_symbols): New function.
1931 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1933 2013-03-08 Ian Lance Taylor <iant@google.com>
1935 * options.cc (General_options::string_to_object_format): Accept
1938 2013-03-08 Alan Modra <amodra@gmail.com>
1940 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1941 pointer to Post_fde.
1942 (struct Post_fde): Move definition to here..
1943 * ehframe.cc (struct Post_fde): ..from here.
1944 (Cie::write): Don't alloc Post_fde.
1945 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1947 2013-03-07 Alan Modra <amodra@gmail.com>
1949 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1950 relocation referencing .LC0.
1951 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1953 2013-03-07 Alan Modra <amodra@gmail.com>
1955 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1956 always_inline. Add assembly for powerpc to avoid GOT.
1958 2013-03-07 Alan Modra <amodra@gmail.com>
1960 * testsuite/script_test_10.sh: Don't test .bss section
1963 2013-03-06 Alan Modra <amodra@gmail.com>
1965 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1966 (Target_powerpc::symval_for_branch): Add symtab param. Update
1967 all callers. Handle folded sections.
1968 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1970 (Global_symbol_visitor_opd::operator()): Likewise.
1972 2013-03-04 Alan Modra <amodra@gmail.com>
1974 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1975 * testsuite/Makefile.in: Regenerate.
1977 2013-03-01 Cary Coutant <ccoutant@google.com>
1979 Add dwp support for v2 DWARF package file format.
1980 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1981 tu_length parameter. Adjust all callers.
1982 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1983 * dwp.cc: Include dwarf.h.
1984 (Section_bounds): New struct type.
1985 (Unit_set): New struct type.
1986 (Dwo_file::Dwo_file): Initialize new data member.
1987 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1988 Combine and rename to...
1989 (Dwo_file::read_unit_index): ...this.
1990 (Dwo_file::sized_read_compunit_index)
1991 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1992 (Dwo_file::sized_read_unit_index): ...this.
1993 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1994 parameters; add section_id parameter.
1995 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1996 (Dwo_file::add_unit_set): ...this.
1997 (Dwo_file::shndx_map_): Remove.
1998 (Dwo_file::sect_offsets_): New data member.
1999 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2000 (Dwp_output_file::add_section): Rename to...
2001 (Dwp_output_file::add_contribution): ...this.
2002 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2003 (Dwp_output_file::add_tu_set): Likewise.
2004 (Dwp_output_file::Contribution): New type.
2005 (Dwp_output_file::Section::contributions): New data member.
2006 (Dwp_output_file::Cu_or_tu_set): Remove.
2007 (Dwp_output_file::Section::Section): New ctor.
2008 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2009 (Dwp_output_file::Dwp_index::Section_table): New type.
2010 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2011 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2013 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2014 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2015 (Dwp_output_file::Dwp_index::section_table): New member function.
2016 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2017 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2018 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2019 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2020 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2021 (Dwp_output_file::Dwp_index::section_table_): New data member.
2022 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2023 (Dwp_output_file::add_output_section): New member function.
2024 (Dwp_output_file::write_new_section): New member function.
2025 (Dwp_output_file::write_contributions): New member function.
2026 (Dwp_output_file::section_id_map_): New data member.
2027 (class Dwo_id_info_reader): Remove.
2028 (class Unit_reader): New class.
2029 (get_dwarf_section_name): New function.
2030 (Dwo_file::read_executable): Adjust initializations of class data.
2031 (Dwo_file::read): Add support for v2 package file format.
2032 (Dwo_file::read_unit_index): Likewise.
2033 (Dwo_file::sized_read_unit_index): Likewise.
2034 (Dwo_file::copy_section): Likewise.
2035 (Dwo_file::add_unit_set): Likewise.
2036 (Dwp_output_file::add_output_section): Likewise.
2037 (Dwp_output_file::add_contribution): Likewise.
2038 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2040 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2042 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2044 (Dwp_output_file::initialize): Remove unused function.
2045 (Dwp_output_file::finalize): Add support for v2 package file format.
2046 (Dwp_output_file::write_index): Likewise.
2047 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2050 2013-03-01 Cary Coutant <ccoutant@google.com>
2052 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2053 function into class definition in header file.
2054 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2055 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2057 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2059 2013-02-28 Alan Modra <amodra@gmail.com>
2061 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2062 * target.cc (Target::do_plt_fde_location): New function.
2063 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2064 accessor function, and constructor param.
2065 (struct Post_fde, Post_fdes): Declare.
2066 (Cie::write): Add post_fdes param.
2067 * ehframe.cc (Fde::write): Use plt_fde_location.
2068 (struct Post_fde): Define.
2069 (Cie::write): Stash FDEs added post merge mapping.
2070 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2071 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2072 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2074 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2075 (Target_powerpc::has_glink): New function.
2076 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2077 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2078 glink_eh_frame_fde_32, default_fde): New data.
2079 (Stub_table::eh_frame_added_): New var.
2080 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2082 (Stub_table::add_eh_frame): New function.
2083 (Output_data_glink::add_eh_frame): New function.
2084 (Target_powerpc::make_glink_section): Call add_eh_frame.
2086 2013-02-15 Ian Lance Taylor <iant@google.com>
2088 * options.h (DEFINE_uint64_alias): Define.
2089 (class General_options): Add -Ttext-segment as an alias for
2092 2013-02-15 Alan Modra <amodra@gmail.com>
2094 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2095 (Stub_table::do_write): ..here, two places.
2096 (Stub_table::plt_call_size): Use it here too.
2098 2013-02-11 Ian Lance Taylor <iant@google.com>
2100 * descriptors.cc (Descriptors::close_all): New function.
2101 * descriptors.h (class Descriptors): Declare close_all.
2102 (close_all_descriptors): New inline function.
2103 * plugin.cc: Include "descriptors.h".
2104 (Plugin_manager::cleanup): Call close_all_descriptors.
2106 2013-02-06 Alan Modra <amodra@gmail.com>
2108 * README: Update coding style link.
2110 2013-01-28 Cary Coutant <ccoutant@google.com>
2112 * dwp.cc (File_list): New typedef.
2113 (Dwo_name_info_reader): New class.
2114 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2115 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2116 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2117 (Dwo_file::read_executable): New function.
2118 (Dwo_file::read): Move common setup code to ...
2119 (Dwo_file::make_object): ... here.
2120 (dwp_options): Add --exec/-e.
2124 2013-01-24 Sriraman Tallam <tmsriram@google.com>
2126 * layout.cc (Layout::layout): Check for option text_reorder.
2127 (Layout::make_output_section): Ditto.
2128 * options.h (text_reorder): New option.
2129 * output.cc (Input_section_sort_compare): Remove special ordering
2132 Input_section_sort_section_name_special_ordering_compare::
2133 operator()): New function.
2134 (Output_section::sort_attached_input_sections): Use new sort function
2136 * output.h (Input_section_sort_section_name_special_ordering_compare):
2138 * testsuite/Makefile.am (text_section_grouping): Test option
2140 * testsuite/Makefile.in: Regenerate.
2141 * testsuite/text_section_grouping.sh: Check order of functions without
2142 default text reordering.
2144 2013-01-18 Mike Frysinger <vapier@gentoo.org>
2146 * options.h (General_options): Change default to true for new_dtags.
2148 2013-01-18 Mike Frysinger <vapier@gentoo.org>
2150 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2151 when enable_new_dtags is false. Only add DT_RUNPATH when
2152 enable_new_dtags is true.
2154 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2156 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2157 used in declaration and definition consistent.
2158 (Target_powerpc::symval_for_branch): Ditto.
2160 2013-01-16 Sriraman Tallam <tmsriram@google.com>
2162 * testsuite/plugin_final_layout.cc: Fix comment.
2164 2013-01-16 Sriraman Tallam <tmsriram@google.com>
2166 * layout.cc (Layout::layout): Do not do default sorting for
2167 text sections when section ordering is specified.
2168 (make_output_section): Ditto.
2169 * testsuite/plugin_final_layout.cc: Name the function sections
2170 to catch reordering issues.
2172 2013-01-15 Alan Modra <amodra@gmail.com>
2174 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2177 2013-01-15 Alan Modra <amodra@gmail.com>
2179 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2180 * testsuite/Makefile.in: Regenerate.
2182 2013-01-14 Alan Modra <amodra@gmail.com>
2184 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2185 * testsuite/Makefile.in: Regenerate.
2187 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2190 Fix mingw gold build with plugins enabled
2191 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2192 * configure.ac: Export DLOPEN_LIBS and add headers check.
2193 * plugin.cc: Handle non-dlfcn case.
2194 * Makefile.in: Regenerate.
2195 * config.in: Regenerate.
2196 * configure: Regenerate.
2197 * testsuite/Makefile.in: Regenerate.
2199 2013-01-09 Sriraman Tallam <tmsriram@google.com>
2201 * output.h (sort_attached_input_sections): Change to be public.
2202 * script-sections.cc
2203 (Output_section_definition::set_section_addresses): Sort
2204 attached input sections according to section order before linker
2205 script assigns section addresses.
2206 (Orphan_output_section::set_section_addresses): Sort
2207 attached input sections according to section order before linker
2208 script assigns section addresses.
2209 * Makefile.am (final_layout.sh): Use a simple linker script to
2210 check if section ordering still works.
2211 * Makefile.in: Regenerate.
2213 2013-01-09 Ben Cheng <bccheng@google.com>
2215 * arm.cc (Target_arm::attributes_accept_div): New function.
2216 (Target_arm::attributes_forbid_div): New function.
2217 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2218 attribute using the same new functions as what bfd/elf32_arm.c
2221 2013-01-07 Cary Coutant <ccoutant@google.com>
2224 * output.cc (Output_section::add_input_section): For incremental
2225 updates, don't track input sections that are allocated from patch
2228 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2229 Ian Lance Taylor <iant@google.com>
2232 * configure.ac (--enable-ld): Removed.
2233 (install_as_default): Set to yes only for --enable-gold=default
2235 * configure: Regenerated.
2237 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2239 * options.h (General_options): Add -fuse-ld= for GCC linker
2240 option compatibility.
2242 2013-01-04 Cary Coutant <ccoutant@google.com>
2244 * configure.ac: Fix typo restoring CXXFLAGS.
2245 * configure: Regenerate.
2247 2013-01-04 Cary Coutant <ccoutant@google.com>
2249 * testsuite/Makefile.am (CXXLINK_S): New macro.
2250 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2251 * testsuite/Makefile.in: Regenerate.
2253 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2255 * version.cc (print_version): Update copyright year to 2013.
2257 2012-12-20 Ian Lance Taylor <iant@google.com>
2259 * layout.cc (Layout::special_ordering_of_input_section): New
2261 (Layout::layout): If input section requires special ordering, must
2262 sort input sections.
2263 (Layout::make_output_section): May sort .text input sections.
2264 (Layout::is_section_name_prefix_grouped): Remove.
2265 * layout.h (class Layout): Declare
2266 special_ordering_of_input_section. Don't declare
2267 is_section_name_prefix_grouped.
2268 * output.cc (Output_section::add_input_section): Revert last
2270 (Output_section::Input_section_sort::match_file_name): Don't crash
2271 if called on output section data.
2272 (Output_section::Input_section_sort_compare): Sort based on
2274 (Output_section::Input_section_sort_section_order_index_compare):
2276 (Output_section::sort_attached_input_sections): Likewise.
2278 2012-12-18 Sriraman Tallam <tmsriram@google.com>
2280 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
2281 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2282 * output.cc (Output_section::add_input_section): Check if section
2283 name contains special prefix. Keep input sections to sort such
2285 (Output_section::Input_section_sort_section_order_index_compare
2286 ::operator()): Group sections according to prefixes.
2287 (Output_section::sort_attached_input_sections): Add condition to
2288 Input_section_entry constructor call.
2289 * testsuite/Makefile.am (text_section_grouping): New test.
2290 * testsuite/Makefile.in: Regenerate.
2291 * testsuite/text_section_grouping.cc: New file.
2292 * testsuite/text_section_grouping.sh: New file.
2294 2012-12-17 Nick Clifton <nickc@redhat.com>
2296 * Makefile.am: Add copyright notice.
2299 * configure.ac: Likewise.
2300 * ftruncate.c: Likewise.
2301 * Makefile.in: Regenerate.
2303 2012-12-14 Cary Coutant <ccoutant@google.com>
2305 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2306 --no-as-needed flag.
2307 (exception_separate_shared_12_test): Likewise.
2308 (incremental_copy_test): Likewise.
2309 * testsuite/Makefile.in: Regenerate.
2311 2012-12-14 Cary Coutant <ccoutant@google.com>
2313 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2314 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2316 2012-12-12 Alan Modra <amodra@gmail.com>
2318 * powerpc.cc (class Track_tls): New.
2319 (class Relocate, class Scan): Inherit Track_tls.
2320 (Target_powerpc::Scan::local, global): Track tls optimization
2321 and avoid creating plt entry for __tls_get_addr if all uses
2323 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2325 2012-12-12 Alan Modra <amodra@gmail.com>
2327 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2328 Replace no_toc_optimize with toc_optimize.
2329 * output.h (Output_section::input_sections): Provide non-const variant.
2330 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2331 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2333 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2334 (class Sort_toc_sections): New.
2335 (Target_powerpc::do_finalize_sections): Sort toc sections.
2336 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2338 2012-12-10 Roland McGrath <mcgrathr@google.com>
2340 * testsuite/binary_unittest.cc (read_all): New function.
2341 (Sized_binary_test): Use it instead of ::read.
2342 * fileread.cc (do_read): Don't assume pread always reads the whole
2343 amount in a single call.
2345 2012-12-10 Alan Modra <amodra@gmail.com>
2347 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2348 Set EM_PPC64 or EM_PPC here.
2349 (Target_selector_powerpc::do_recognize): Delete.
2351 2012-12-10 Alan Modra <amodra@gmail.com>
2353 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2355 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2357 2012-12-07 Roland McGrath <mcgrathr@google.com>
2359 * testsuite/binary_unittest.cc (Sized_binary_test):
2360 Use open_descriptor rather than ::open.
2362 2012-12-07 Alan Modra <amodra@gmail.com>
2364 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2365 typedef and invalid_address constant.
2366 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2367 instantiate constants.
2369 2012-12-06 Roland McGrath <mcgrathr@google.com>
2371 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2372 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2373 * aclocal.m4: Regenerate.
2374 * configure: Regenerate.
2375 * Makefile.in: Regenerate.
2376 * testsuite/Makefile.in: Regenerate.
2378 2012-12-07 Alan Modra <amodra@gmail.com>
2380 * options.h (General_options): Add no_toc_optimize.
2381 * powerpc.cc (ok_lo_toc_insn): New function.
2382 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2384 2012-12-06 Alan Modra <amodra@gmail.com>
2386 * options.h (General_options): Add plt_align, plt_static_chain,
2387 plt_thread_safe. Update stub_group_size help text.
2388 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2389 for new plt_thread_safe_ var.
2390 (use_plt_offset): Correct comments.
2391 (Target_powerpc::do_relax): Look for thread creation symbols to
2392 determine default plt_thread_safe value. Clear plt call stubs
2393 as well as branch stubs each iteration.
2394 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2396 (l, hi, ha, write_insn): Move earlier.
2397 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2398 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2400 (Stub_table::update_size): Adjust.
2401 (Stub_table::prev_size, set_prev_size): Delete.
2402 (Stub_table::stub_align): Let --plt-align affect result.
2403 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2404 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2405 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2406 (Stub_table::do_write): Support more stub variants.
2408 2012-12-04 Alan Modra <amodra@gmail.com>
2410 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2411 (Target_powerpc::do_define_standard_symbols): New function.
2413 2012-12-03 Alan Modra <amodra@gmail.com>
2415 * output.h: Formatting, whitespace.
2417 2012-12-03 Alan Modra <amodra@gmail.com>
2419 * layout.h (Layout::get_executable_sections): Declare.
2420 * layout.cc (Layout::get_executable_sections): New function.
2421 * arm.cc (Target_arm::group_sections): Use it.
2422 (Arm_output_section::group_sections): Delete now redundant test.
2423 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2424 param to handle relative relocs.
2425 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2426 (Output_data_reloc::add_absolute): Adjust.
2427 (Output_data_reloc::add_relative): New function.
2428 (Output_data::reset_data_size): New function.
2429 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2430 (Output_section::set_addralign): New function.
2431 (Output_section::checkpoint_set_addralign): New function.
2432 (Output_section::clear_section_offsets_need_adjustment): New function.
2433 (Output_section::input_sections): Make public.
2434 * powerpc.cc (class Output_data_brlt_powerpc): New.
2435 (class Stub_table, class Stub_control): New.
2436 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2437 stub_table_, set_stub_table, stub_table): New vectors and accessor
2439 (Target_powerpc::do_may_relax, do_relax, push_branch,
2440 new_stub_table, stub_tables, brlt_section, group_sections,
2441 add_branch_lookup_table, find_branch_lookup_table,
2442 write_branch_lookup_table, make_brlt_section): New functions.
2443 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2444 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2445 branch_info_): New vars.
2446 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2447 make call stubs here.
2448 (Output_data_glink): Remove all call stub handling from this class.
2449 (Target_powerpc::Scan::local, global): Save interesting branch
2450 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2451 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2452 functions on final link.
2453 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2454 Handle long branch destinations too.
2455 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2456 do_plt_address_for_local): Adjust lookup of plt call stubs.
2458 2012-11-30 Alan Modra <amodra@gmail.com>
2460 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2461 relocs against protected symbols when building 32-bit shared libs.
2463 2012-11-30 Alan Modra <amodra@gmail.com>
2465 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2466 param. Call got_section() to make .got. Update all callers
2467 and their callers and so on.
2469 2012-11-30 Alan Modra <amodra@gmail.com>
2471 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2472 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2473 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2474 value if it already exists.
2476 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2479 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2481 2012-11-14 Roland McGrath <mcgrathr@google.com>
2483 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2484 than bfc instruction for data sandboxing.
2486 2012-11-08 Alan Modra <amodra@gmail.com>
2488 * po/POTFILES.in: Regenerate.
2490 2012-11-05 Alan Modra <amodra@gmail.com>
2492 * configure.ac: Apply 2012-09-10 change to config.in here.
2493 * configure: Regenerate.
2495 2012-11-05 Alan Modra <amodra@gmail.com>
2497 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2498 (struct Opd_ent): Use "Address" rather than "Offset".
2499 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2500 (Target_powerpc::got_section): Make public.
2501 (Target_powerpc::scan_relocs): Move code setting symbols..
2502 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2503 Create _SDA_BASE_ only when referenced.
2505 2012-11-02 Roland McGrath <mcgrathr@google.com>
2507 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2510 2012-11-01 Roland McGrath <mcgrathr@google.com>
2512 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2513 for offset_in_output_section parameter.
2514 (Sized_target::relocate_special_relocatable): Likewise.
2515 * arm.cc (Target_arm::relocate_relocs): Likewise.
2516 (Target_arm::relocate_special_relocatable): Likewise.
2517 * i386.cc (Target_i386::relocate_relocs): Likewise.
2518 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2519 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2520 * target-reloc.h (relocate_relocs): Likewise.
2521 * testsuite/testfile.cc (Target_test): Likewise.
2522 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2523 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2525 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2526 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2528 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2529 parameter, which is unused in the [!F_SETFD] case.
2531 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2532 SYMNDX to off_t before comparing it to this->data_size().
2533 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2534 * incremental.cc (Output_section_incremental_inputs::do_write):
2535 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2537 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2539 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2541 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2542 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2545 2012-10-29 Cary Coutant <ccoutant@google.com>
2547 * dwp.cc (usage): Add file and exit status parameters;
2548 add --help and --version options.
2549 (print_version): New function.
2550 (main): Add --help and --version options.
2552 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2554 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2555 final_layout_sequence.txt.
2556 * testsuite/Makefile.in: Regenerated.
2558 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2560 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2561 COMPILE generated by automake.
2563 (CXXCOMPILE1): Likewise.
2564 (CXXLINK1): Likewise.
2565 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2567 (CXXCOMPILE): Likewise.
2568 (CXXLINK): Likewise.
2569 * testsuite/Makefile.in: Regenerated.
2571 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2573 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2574 on bad fwrite return.
2576 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2578 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2581 2012-10-23 Cary Coutant <ccoutant@google.com>
2583 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2584 * testsuite/Makefile.in: Regenerate.
2585 * testsuite/dwp_test.h: New source file.
2586 * testsuite/dwp_test_1.cc: New source file.
2587 * testsuite/dwp_test_1.s: New source file.
2588 * testsuite/dwp_test_1.sh: New source file.
2589 * testsuite/dwp_test_1b.cc: New source file.
2590 * testsuite/dwp_test_1b.s: New source file.
2591 * testsuite/dwp_test_2.cc: New source file.
2592 * testsuite/dwp_test_2.s: New source file.
2593 * testsuite/dwp_test_2.sh: New source file.
2594 * testsuite/dwp_test_main.cc: New source file.
2595 * testsuite/dwp_test_main.s: New source file.
2597 2012-10-23 Cary Coutant <ccoutant@google.com>
2599 * dwp.h: New header file.
2600 * dwp.cc: New source file.
2601 * gold.h: Move shared declarations to system.h.
2602 * system.h: New header file.
2603 * Makefile.am: Add dwp.
2604 * Makefile.in: Regenerate.
2606 2012-10-23 Cary Coutant <ccoutant@google.com>
2608 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2609 Dwarf_info_reader::read_from_pointer.
2610 (Dwarf_pubnames_table::read_header): Likewise.
2611 (Dwarf_pubnames_table::next_name): Likewise.
2612 (Dwarf_die::read_attributes): Likewise.
2613 (Dwarf_die::skip_attributes): Likewise.
2614 (Dwarf_info_reader::read_from_pointer): New function template.
2615 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2616 (Dwarf_pubnames_table): Likewise.
2617 (Dwarf_info_reader::read_from_pointer): New function template.
2618 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2619 Dwarf_pubnames_table ctor.
2621 2012-10-23 Cary Coutant <ccoutant@google.com>
2623 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2625 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2627 (Dwarf_info_reader::set_abbrev_shndx): New method.
2628 (Dwarf_info_reader::abbrev_shndx_): New data member.
2630 2012-10-23 Cary Coutant <ccoutant@google.com>
2632 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2633 from object, not parameters.
2634 (Dwarf_info_reader::parse): Likewise.
2635 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2636 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2637 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2640 2012-10-23 Cary Coutant <ccoutant@google.com>
2642 * fileread.cc (Input_file::Input_file): New constructor.
2643 * fileread.h (class Input_file): Add new constructor.
2645 2012-10-18 Alan Modra <amodra@gmail.com>
2648 * object.cc (Relobj::is_section_name_included): Also match
2649 .sdata personality section.
2651 2012-10-18 Alan Modra <amodra@gmail.com>
2653 * target-reloc.h (class Default_comdat_behavior): New, package up..
2654 (get_comdat_behaviour): ..this.
2655 (relocate_section): Add Relocate_comdat_behavior template arg,
2656 adjust code to suit.
2657 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2658 (Target_arm::scan_reloc_section): Likewise.
2659 * i386.cc (Target_i386::relocate_section): Likewise.
2660 * sparc.cc (Target_sparc::relocate_section): Likewise.
2661 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2662 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2663 * powerpc.cc (class Relocate_comdat_behavior): New.
2664 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2665 gold::relocate_section with new template arg.
2667 2012-10-18 Alan Modra <amodra@gmail.com>
2669 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2670 dynamic relocs for GOT_TPREL got entries, without symbol if
2672 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2673 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2674 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2676 2012-10-17 Alan Modra <amodra@gmail.com>
2679 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2681 2012-10-16 Sriraman Tallam <tmsriram@google.com>
2683 * layout.cc (Layout::include_section): Keep sections marked
2684 SHF_EXCLUDE when doing relocatable links.
2686 2012-10-16 Alan Modra <amodra@gmail.com>
2688 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2689 (Target_powerpc::do_finalize_sections): Call it.
2690 (Output_data_save_res): New class and supporting functions.
2691 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2692 normal symbols defined in object files.
2694 2012-10-12 Alan Modra <amodra@gmail.com>
2696 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2697 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2698 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2699 section if scan_opd_relocs not yet called.
2700 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2702 2012-10-12 Alan Modra <amodra@gmail.com>
2704 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2705 add_local_ifunc_entry): Revert last change.
2706 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2708 2012-10-05 Alan Modra <amodra@gmail.com>
2710 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2711 do_plt_address_for_global): New functions.
2712 (Output_data_got_powerpc::do_write): Don't segfault when linking
2714 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2715 add_local_ifunc_entry): Return true on adding entry..
2716 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2717 glink->add_entry call. Remove unused symtab param. Adjust calls.
2718 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2719 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2720 set up symbols here.
2721 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2722 syms here. Do so even when no .iplt. Don't segfault when linking
2724 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2725 new variants without reloc param.
2726 (Glink_sym_ent::Glink_sym_ent): Likewise.
2727 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2728 reloc when refs will resolve to plt call stub.
2729 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2730 R_PPC_PLTREL24 to resolve locally.
2731 (Target_powerpc::Scan::global): Correct ifunc handling.
2732 (Target_powerpc::Relocate::relocate): Correct local sym glink
2733 lookup. Don't destroy "value" when we have a plt call stub,
2734 and when checking plt call validity.
2735 (Target_powerpc::do_dynsym_value): Simplify.
2737 2012-10-05 Alan Modra <amodra@gmail.com>
2739 * i386.cc (Output_data_plt_i386::address_for_global,
2740 address_for_local): Add plt offset to returned value. Adjust uses.
2741 * sparc.cc (Output_data_plt_sparc::address_for_global,
2742 address_for_local): Likewise.
2743 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2744 address_for_local): Likewise.
2745 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2746 address_for_local): Likewise.
2747 * target.h (Target::plt_address_for_global, plt_address_for_local):
2749 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2750 (Output_data_got::Got_entry::write): Nor here.
2751 * output.h: Comment fix.
2753 2012-10-02 Jiong Wang <jiwang@tilera.com>
2755 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2756 global_offset_table_ value for larget got.
2757 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2759 2012-09-29 Alan Modra <amodra@gmail.com>
2761 * powerpc.cc (Target_powerpc::iplt_): New output section.
2762 (Target_powerpc::iplt_section, make_iplt_section,
2763 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2764 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2765 Target_powerpc::plt_entry_count): Count iplt entries too.
2766 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2767 reloc section in constructor. New params.
2768 (Target_powerpc::make_plt_section): Create reloc section here instead.
2769 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2771 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2772 (Output_data_glink::add_entry, find_entry): New functions to
2773 deal with local syms.
2774 (Glink_sym_ent): Add support for local syms.
2775 (Output_data_glink::do_write): Handle ifunc plt entries.
2776 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2777 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2778 (Target_powerpc::Relocate::relocate): Likewise.
2779 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2781 2012-09-25 Alan Modra <amodra@gmail.com>
2783 * object.h (Sized_relobj_file::adjust_local_symbol,
2784 do_adjust_local_symbol): New functions.
2785 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2786 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2787 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2788 and irregular opd entry spacing.
2789 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2790 (Global_symbol_visitor_opd): New functor.
2791 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2792 on deleted opd entries.
2794 2012-09-15 Jiong Wang <jiwang@tilera.com>
2796 * tilegx.cc: New file.
2797 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2798 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2799 * configure.tgt: Add entries for tilegx*.
2800 * configure.ac: Likewise.
2801 * Makefile.in: Rebuild.
2802 * configure: Likewise.
2803 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2806 2012-09-13 Alan Modra <amodra@gmail.com>
2808 * target-reloc.h (scan_relocs): Call scan.local for relocs
2809 against symbols in discarded sections. Pass is_discarded
2811 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2812 Add is_discarded param.
2813 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2814 is_discarded to flag opd entry as discarded. Don't emit dyn
2815 relocs on such entries.
2816 (Target_powerpc::Scan::global): Similarly detect and handle
2818 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2819 opd_ent_. Update all uses.
2820 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2821 (Target_powerpc::relocate_section): Zero out discarded opd
2824 2012-09-12 Ian Lance Taylor <iant@google.com>
2827 * output.cc: Rename Output_data_got template parameter from size
2828 to got_size for all functions. Compile all variants of
2830 (Output_data_got::Got_entry::write): Correct use of size for
2831 symbol value. Use local_is_tls rather than casting to
2833 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2834 (class Sized_relobj_file): Add do_local_is_tls.
2835 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2837 2012-09-11 Alan Modra <amodra@gmail.com>
2840 * layout.cc (Layout::set_segment_offsets): When using
2841 common-page-size alignment, ensure we are on a new max-page-size
2843 * output.cc (Output_segment::set_section_addresses): Use
2844 abi_pagesize, not common_pagesize for relro boundary.
2845 (Output_segment::set_offset): Likewise.
2847 2012-09-11 Alan Modra <amodra@gmail.com>
2849 * output.h (Output_data_got::add_global_tls, add_local_tls,
2850 add_local_tls_pair): New functions.
2851 (Output_data_got::add_local_pair_with_rel): Remove second
2852 reloc param. Expand comment.
2853 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2854 use_plt_or_tls_offset_, similarly for constructor param.
2855 (Output_data_got::Got_entry::write): Add got_index param.
2856 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2857 add_local_tls_pair): New functions.
2858 (Output_data_got::Got_entry::write): Handle tls symbols
2859 with use_plt_or_tls_offset_ set specially.
2860 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2861 (Output_data_got::do_write): Replace iterator with index, pass
2862 index to entry write function.
2863 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2864 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2865 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2867 * i386.cc (Target_i386::Scan::local): Likewise.
2868 * sparc.cc (Target_sparc::Scan::local): Likewise.
2869 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2870 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2871 do_tls_offset_for_global): New functions.
2872 (Target_powerpc::Scan::local): Correct TLS relocations and got
2874 (Target_powerpc::Scan::global): Don't emit unnecessary
2875 dynamic relocations on TLS GOT entries.
2877 2012-09-10 Matthias Klose <doko@ubuntu.com>
2879 * config.in: Disable sanity check for kfreebsd.
2881 2012-09-10 Sterling Augustine <saugustine@google.com>
2883 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2884 (Gdb_index::pubtypes_read): New parameter.
2885 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2887 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2890 2012-09-09 Alan Modra <amodra@gmail.com>
2892 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2893 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2894 * gc.h (gc_process_relocs): Call target gc_add_reference.
2895 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2896 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2897 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2899 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2900 to cater for when we don't need code offset. Update use.
2901 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2902 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2903 set_opd_valid): New functions.
2904 (Target_powerpc::do_gc_add_reference): New function.
2905 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2907 (Target_powerpc::do_gc_mark_symbol): New function.
2909 2012-09-06 Cary Coutant <ccoutant@google.com>
2911 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2912 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2913 (Dwarf_die::skip_attributes): Likewise.
2914 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2915 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2917 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2919 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2921 * testsuite/script_test_3.t: Add .got.plt output section
2923 * testsuite/script_test_4.t: Likewise.
2925 2012-09-05 Alan Modra <amodra@gmail.com>
2927 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2928 update all uses and lose "enum" when using type.
2930 2012-09-05 Alan Modra <amodra@gmail.com>
2932 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2933 * configure: Regenerate.
2934 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2935 (plugin_final_layout.stdout): Likewise.
2936 (memory_test): Set page sizes to 0x1000.
2937 * testsuite/Makefile.in: Regenerate.
2938 * testsuite/discard_locals_test.sh: Add FIXME comment.
2939 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2940 * testsuite/pr14265.t: Add .got output section statement.
2941 * testsuite/script_test_2.t: Likewise.
2942 * testsuite/script_test_3.t: Likewise.
2943 * testsuite/script_test_4.t: Likewise.
2944 * testsuite/script_test_5.t: Likewise.
2945 * testsuite/script_test_6.t: Likewise.
2946 * testsuite/script_test_7.t: Likewise.
2947 * testsuite/script_test_9.t: Likewise.
2949 2012-09-05 Alan Modra <amodra@gmail.com>
2951 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2952 (Powerpc_relocate_functions::Status): New typedef.
2953 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2954 (Target_powerpc::Scan::local): Handle REL64.
2955 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2956 for REL32 and REL64.
2957 (Target_powerpc::symval_for_branch): New function, extracted from..
2958 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2959 checks. Report overflow errors.
2961 2012-09-05 Alan Modra <amodra@gmail.com>
2963 * object.h (Sized_relobj_file::emit_relocs): Delete.
2964 (Sized_relobj_file::emit_relocs_reltype): Delete.
2965 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2966 relocate_relocs for --emit-relocs.
2967 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2968 * output.h: Update comment.
2969 (Output_segment::first_section): New function.
2970 (Output_segment::first_section_load_address): Use first_section.
2971 * output.cc (Output_segment::first_section): New function extracted..
2972 (Output_segment::first_section_load_address): ..from here. Delete.
2973 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2974 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2975 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2976 adjust call to target.h function.
2977 * i386.cc (Target_i386): Likewise.
2978 * sparc.cc (Target_sparc): Likewise.
2979 * x86_64.cc (Target_x86_64): Likewise.
2980 * powerpc.cc (Target_powerpc): Likewise.
2981 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2982 first tls section has section symbol for optimised local dynamic
2984 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2985 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2987 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2988 Rename to relocate_relocs. Update error message.
2990 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2992 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2995 2012-08-31 Alan Modra <amodra@gmail.com>
2997 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2998 (Powerpc_relobj::toc_base_offset): New stub function.
2999 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3000 got_mod_index_offset to tlsld_got_offset. Update all refs.
3001 (Target_powerpc::Relocate::enum skip_tls): New.
3002 (Target_powerpc::call_tls_get_addr_): New var.
3003 (Target_powerpc::is_branch_reloc): Move to file scope.
3004 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3005 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3007 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3008 (powerpc_info): Correct common_pagesize for ppc64.
3009 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3010 (Powerpc_relocate_functions): Add overflow check enums and functions.
3011 Add non-shift version of rela, rela_ua. Delete all rel public
3012 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3013 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3014 addr16_ha3, addr14 functions.
3015 (Output_data_got_powerpc::add_constant_pair): New function.
3016 (Output_data_got_powerpc::got_base_offset): Likewise.
3017 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3018 (instruction constants): Sort, add some more.
3019 (Output_data_glink::do_write): Add and use Address typedef. Use
3020 object->toc_base_offset() stub for 64-bit.
3021 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3022 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3023 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3024 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3025 Always treat .opd relocs as against locally defined symbol.
3026 Correct condition for RELATIVE relocs.
3027 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3028 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3029 for 32-bit syms with a plt entry. Correct ppc64 toc base
3030 calculations. Handle TLS relocs, and more. Add overflow
3031 checking and adjust for Powerpc_relocate_functions changes.
3032 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3033 Reinstate --emit-relocs code with FIXME.
3035 2012-08-30 Alan Modra <amodra@gmail.com>
3037 * layout.cc (Layout::set_segment_offsets): Set p_align to
3038 abi_pagesize, not common_pagesize.
3039 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3040 to determine whether file header can go in segment.
3042 2012-08-30 Alan Modra <amodra@gmail.com>
3044 * output.h (Output_reloc::Output_reloc <output section>): Add
3045 is_relative param. Adjust calls.
3046 (Output_reloc::add_output_section_relative): New functions.
3047 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3049 (Output_reloc::symbol_value): Handle SECTION_CODE.
3051 2012-08-24 Sriraman Tallam <tmsriram@google.com>
3053 * gold.cc (queue_middle_tasks): Call layout again when unique
3054 segments for sections is desired.
3055 * layout.cc (Layout::Layout): Initialize new members.
3056 (Layout::get_output_section_flags): New function.
3057 (Layout::choose_output_section): Call get_output_section_flags.
3058 (Layout::layout): Make output section for mapping to a unique segment.
3059 (Layout::insert_section_segment_map): New function.
3060 (Layout::attach_allocated_section_to_segment): Make unique segment for
3061 output sections marked so.
3062 (Layout::segment_precedes): Check for unique segments when sorting.
3063 * layout.h (Layout::Unique_segment_info): New struct.
3064 (Layout::Section_segment_map): New typedef.
3065 (Layout::insert_section_segment_map): New function.
3066 (Layout::get_output_section_flags): New function.
3067 (Layout::is_unique_segment_for_sections_specified): New function.
3068 (Layout::set_unique_segment_for_sections_specified): New function.
3069 (Layout::unique_segment_for_sections_specified_): New member.
3070 (Layout::section_segment_map_): New member.
3071 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3072 Rename is_gc_pass_one to is_pass_one.
3073 Rename is_gc_pass_two to is_pass_two.
3074 Rename is_gc_or_icf to is_two_pass.
3075 Check for which pass based on whether symbols data is present.
3076 Make it two pass when unique segments for sections is desired.
3077 * output.cc (Output_section::Output_section): Initialize new
3079 * output.h (Output_section::is_unique_segment): New function.
3080 (Output_section::set_is_unique_segment): New function.
3081 (Output_section::is_unique_segment_): New member.
3082 (Output_section::extra_segment_flags): New function.
3083 (Output_section::set_extra_segment_flags): New function.
3084 (Output_section::extra_segment_flags_): New member.
3085 (Output_section::segment_alignment): New function.
3086 (Output_section::set_segment_alignment): New function.
3087 (Output_section::segment_alignment_): New member.
3088 (Output_segment::Output_segment): Initialize is_unique_segment_.
3089 (Output_segment::is_unique_segment): New function.
3090 (Output_segment::set_is_unique_segment): New function.
3091 (Output_segment::is_unique_segment_): New member.
3092 * plugin.cc (allow_unique_segment_for_sections): New function.
3093 (unique_segment_for_sections): New function.
3094 (Plugin::load): Add new functions to transfer vector.
3095 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3096 * Makefile.in: Regenerate.
3097 * testsuite/plugin_final_layout.sh: Check if unique segment
3098 functionality works.
3099 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3101 (allow_unique_segment_for_sections): New global.
3102 (unique_segment_for_sections): New global.
3103 (claim_file_hook): Call allow_unique_segment_for_sections.
3104 (all_symbols_read_hook): Call unique_segment_for_sections.
3106 2012-08-22 Cary Coutant <ccoutant@google.com>
3108 * layout.cc (Layout::include_section): Don't assert on GROUP
3109 sections with --emit-relocs.
3111 2012-08-21 Cary Coutant <ccoutant@google.com>
3113 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3114 if --export-dynamic-symbol names an undef symbol.
3116 2012-08-18 Alan Modra <amodra@gmail.com>
3118 * powerpc.cc: Formatting and white space.
3119 (Powerpc_relobj): Rename got2_section_ to special_.
3120 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3121 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3122 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3123 (Target_powerpc): Add Address typedef and invalid_address. Use
3125 (Target_powerpc::is_branch_reloc): New function.
3126 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3127 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3128 for dst_mask, value and addend.
3129 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3130 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3131 (Output_data_glink::do_write): Correct toc base. Don't try to use
3132 uint16_t for 24-bit offset. Use get_output_section_offset and
3134 (Target_powerpc::Scan::local): Handle more relocs.
3135 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3136 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3137 Plug in toc restoring insn after plt calls. Translate branches
3138 to function descriptor symbols to corresponding entry point.
3139 (Target_powerpc::relocate_for_relocatable): Check return from
3140 get_output_section_offset.
3141 * symtab.h: Comment typo.
3143 2012-08-14 Ian Lance Taylor <iant@google.com>
3145 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3146 unsupported_relocal_local to call unsupported_reloc_global.
3148 2012-08-14 Nick Clifton <nickc@redhat.com>
3151 * script-sections.cc (Sections_element::output_section_name): Add
3152 keep return parameter.
3153 (Output_section_element::match_name): Add keep return parameter.
3154 Return the value of the keep_ member.
3155 * script-sections.h (class Output_section): Update
3156 output_section_name prototype.
3157 * layout.cc (Layout::keep_input_section): New public member
3159 (Layout::choose_output_section): Pass keep parameter to
3160 output_section_name.
3161 * layout.h (class Layout): Add keep_input_section.
3162 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3164 * testsuite/Makefile.am: Add a test.
3165 * testsuite/Makefile.in: Regenerate.
3166 * testsuite/pr14265.c: Source file for the test.
3167 * testsuite/pr14265.t: Linker script for the test.
3168 * testsuite/pr14265.sh: Shell script for the test.
3170 2012-08-14 Alan Modra <amodra@gmail.com>
3172 * target.h (Target::output_section_name): New function.
3173 (Target::do_output_section_name): New function.
3174 * layout.cc (Layout::choose_output_section): Call the above.
3175 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3177 2012-08-14 Alan Modra <amodra@gmail.com>
3179 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3180 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3181 for replace_constant call.
3182 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3183 (Output_data_glink::do_print_to_mapfile): New function.
3184 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3185 (Target_powerpc::Relocate::relocate): Likewise.
3187 2012-08-14 Alan Modra <amodra@gmail.com>
3189 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3190 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3191 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3192 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3193 all references to shndx_. Handle special case for R_PPC_PLTREL24
3195 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3196 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3197 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3199 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3200 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3202 2012-08-12 Alan Modra <amodra@gmail.com>
3204 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3205 (glink insn constants): Use uint32_t.
3206 (Output_data_glink::add_entry): Use insert, not [] operator.
3208 2012-08-11 Alan Modra <amodra@gmail.com>
3210 * object.h (Sized_relobj_file::find_shdr): New function.
3211 (Sized_relobj_file::find_special_sections): New function.
3212 * object.cc (Sized_relobj_file::find_shdr): New function.
3213 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3214 (Sized_relobj_file::find_special_sections): New function, split out..
3215 (Sized_relobj_file::do_read_symbols): ..from here.
3216 * output.h (Output_data_got::replace_constant): New function.
3217 (Output_data_got::num_entries): New function.
3218 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3219 (Output_data_got::got_offset): Protected rather than private.
3220 (Output_data_got::replace_got_entry): New function.
3221 * output.cc (Output_data_got::replace_got_entry): New function.
3222 * powerpc.cc (class Powerpc_relobj): New.
3223 (class Powerpc_relocate_functions): Delete all psymval variants or
3224 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3225 Implement _ha functions using corresponding _hi function.
3226 (Powerpc_relobj::find_special_sections): New function.
3227 (Target_powerpc::do_make_elf_object): New function.
3228 (class Output_data_got_powerpc): New.
3229 (class Output_data_glink): New.
3230 (class Powerpc_scan_relocatable_reloc): New.
3231 Many more changes througout file.
3233 2012-08-09 Nick Clifton <nickc@redhat.com>
3235 * po/vi.po: Updated Vietnamese translation.
3237 2012-08-07 Ian Lance Taylor <iant@google.com>
3239 * layout.cc (Layout::add_target_dynamic_tags): If
3240 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3243 2012-07-30 Nick Clifton <nickc@redhat.com>
3245 * po/gold.pot: Updated template.
3246 * po/es.po: Updated Spanish translation.
3248 2012-07-18 Cary Coutant <ccoutant@google.com>
3251 * configure.ac: Add check for -gpubnames support.
3252 * configure: Regenerate.
3253 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3254 support; force -gno-pubnames.
3255 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3257 (gdb_index_test_4): New test.
3258 * testsuite/Makefile.in: Regenerate.
3259 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3260 * testsuite/gdb_index_test_2.sh: Likewise.
3261 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3262 * testsuite/gdb_index_test_4.sh: New script.
3263 * testsuite/gdb_index_test_comm.sh: New script with common code;
3264 don't look for space after colon.
3266 2012-07-16 Sriraman Tallam <tmsriram@google.com>
3268 * gold.cc (queue_middle_tasks): Update function order only after
3269 deferred objects due to plugins are processed.
3271 2012-07-11 Ian Lance Taylor <iant@google.com>
3273 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3274 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3275 (Target_arm::scan_reloc_for_stub): Likewise.
3276 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3277 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3278 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3279 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3280 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3282 2012-07-10 Dodji Seketeli <dodji@redhat.com>
3283 Ian Lance Taylor <iant@google.com>
3286 * configure.ac: Test whether std::tr1::hash<off_t> works.
3287 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3289 * output.h (class Output_fill): Add virtual destructor.
3290 * configure, config.in: Rebuild.
3292 2012-06-22 Roland McGrath <mcgrathr@google.com>
3294 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3296 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3298 * plugin.cc (Plugin::load): Handle position independent executables.
3300 2012-06-06 Cary Coutant <ccoutant@google.com>
3302 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3304 (lines_only_debug_sections): Likewise.
3305 (gdb_fast_lookup_sections): New static array.
3306 (is_gdb_debug_section): Rename formal parameter.
3307 (is_lines_only_debug_section): Likewise.
3308 (is_gdb_fast_lookup_section): New function.
3309 (Layout::include_section): Check for ".zdebug_" prefix; pass
3310 section name suffix to is_gdb_debug_section, et al.; check for
3311 fast-lookup sections when building .gdb_index.
3312 * options.h (--strip-debug-gdb): Update GDB version number.
3314 2012-06-06 Cary Coutant <ccoutant@google.com>
3316 * configure.ac: Add check for fallocate.
3317 * configure: Regenerate.
3318 * config.in: Regenerate.
3320 * options.h (class General_options): Add --mmap-output-file and
3321 --posix-fallocate options.
3322 * output.cc: (posix_fallocate): Remove; replace with...
3323 (gold_fallocate): New function.
3324 (Output_file::map_no_anonymous): Call gold_fallocate.
3325 (Output_file::map): Check --mmap-output-file option.
3327 2012-06-05 Jing Yu <jingyu@google.com>
3329 * gold.h (textdomain): Add do {} to empty while(0).
3330 (bindtextdomain): Likewise.
3332 2012-06-04 Cary Coutant <ccoutant@google.com>
3334 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3337 2012-05-25 Sriraman Tallam <tmsriram@google.com>
3339 * symtab.cc (Symbol_table::define_special_symbol):
3340 Initialize *poldsym to prevent uninitialized variable errors.
3342 2012-05-23 Cary Coutant <ccoutant@google.com>
3344 * layout.cc (Layout::section_name_mapping): Add rules to handle
3345 exact match on .data.rel.ro.local or .data.rel.ro.
3346 (Layout::output_section_name): Check for exact matches.
3348 2012-05-23 Cary Coutant <ccoutant@google.com>
3350 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3353 2012-05-22 Cary Coutant <ccoutant@google.com>
3355 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3356 object before exporting symbol.
3358 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3360 * testsuite/tls_test.cc: Include "config.h" first.
3361 * testsuite/tls_test_c.c: Likewise.
3363 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
3364 Nick Clifton <nickc@redhat.com>
3367 * configure.in: Add check that sysdep.h has been included before
3368 any system header files.
3369 * configure: Regenerate.
3370 * config.in: Regenerate.
3372 2012-05-14 Cary Coutant <ccoutant@google.com>
3374 * layout.cc (Layout::make_output_section): Mark .tdata section
3376 * testsuite/relro_test.cc: Add a TLS variable.
3378 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3381 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3382 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3385 2012-05-08 Cary Coutant <ccoutant@google.com>
3387 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3388 (lines_only_debug_sections): Likewise.
3390 2012-05-02 Roland McGrath <mcgrathr@google.com>
3392 * nacl.cc: New file.
3394 * Makefile.am (CCFILES, HFILES): Add them.
3395 * Makefile.in: Regenerate.
3396 * i386.cc (Output_data_plt_i386_nacl): New class.
3397 (Output_data_plt_i386_nacl_exec): New class.
3398 (Output_data_plt_i386_nacl_dyn): New class.
3399 (Target_i386_nacl): New class.
3400 (Target_selector_i386_nacl): New class.
3401 (target_selector_i386): Use it instead of Target_selector_i386.
3402 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3403 (Target_x86_64_nacl): New class.
3404 (Target_selector_x86_64_nacl): New class.
3405 (target_selector_x86_64, target_selector_x32): Use it instead of
3406 Target_selector_x86_64.
3407 * arm.cc (Output_data_plt_arm_nacl): New class.
3408 (Target_arm_nacl): New class.
3409 (Target_selector_arm_nacl): New class.
3410 (target_selector_arm, target_selector_armbe): Use it instead of
3411 Target_selector_arm.
3413 * target-select.cc (select_target): Take new Input_file* and off_t
3414 arguments, pass them on to recognize method of selector.
3415 * object.cc (make_elf_sized_object): Update caller.
3416 * parameters.cc (parameters_force_valid_target): Likewise.
3417 * incremental.cc (make_sized_incremental_binary): Likewise.
3418 * target-select.h: Update decl.
3419 (Target_selector::recognize): Take new Input_file* argument,
3420 pass it on to do_recognize.
3421 (Target_selector::do_recognize): Take new Input_file* argument.
3422 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3423 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3424 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3425 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3427 * target.h (Target::Target_info): New members isolate_execinstr
3429 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3430 * arm.cc (Target_arm::arm_info): Update initializer.
3431 * i386.cc (Target_i386::i386_info): Likewise.
3432 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3433 * sparc.cc (Target_sparc::sparc_info): Likewise.
3434 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3435 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3436 * layout.cc (Layout::attach_allocated_section_to_segment):
3437 Take new const Target* argument. If target->isolate_execinstr(), act
3439 (Layout::find_first_load_seg): Take new const Target* argument;
3440 if target->isolate_execinstr(), reject PF_X segments.
3441 (Layout::relaxation_loop_body): Update caller.
3442 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3443 reset file offset to zero when we hit LOAD_SEG, and then do a second
3444 loop over the segments before LOAD_SEG to reassign offsets after
3445 addresses have been determined. Handle target->rosegment_gap().
3446 (Layout::attach_section_to_segment): Take new const Target* argument;
3447 pass it to attach_allocated_section_to_segment.
3448 (Layout::make_output_section): Update caller.
3449 (Layout::attach_sections_to_segments): Take new const Target* argument;
3450 pass it to attach_section_to_segment.
3451 * gold.cc (queue_middle_tasks): Update caller.
3452 * layout.h (Layout): Update method decls with new arguments.
3454 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3455 Target_info pointer to use.
3456 (Target_arm::do_make_data_plt): New virtual method.
3457 (Target_arm::make_data_plt): New method that calls it.
3458 (Target_arm::make_plt_entry): Use it.
3459 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3460 for the section alignment.
3461 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3463 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3464 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3466 (Output_data_plt_arm::get_plt_entry_size): Call it.
3467 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3468 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3469 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3471 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3472 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3473 method instead of sizeof(plt_entry).
3474 (Output_data_plt_arm::add_entry): Likewise.
3475 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3476 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3478 (Target_arm::plt_entry_size): Likewise.
3479 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3481 (Output_data_plt_arm_standard): ... here, new class.
3482 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3483 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3484 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3486 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3487 Take additional argument for the PLT entry size.
3488 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3489 Use get_plt_entry_size method rather than plt_entry_size variable.
3490 (Output_data_plt_x86_64::reserve_slot): Likewise.
3491 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3492 (Output_data_plt_x86_64::add_entry): Likewise.
3493 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3494 (Output_data_plt_x86_64::address_for_global): Likewise.
3495 (Output_data_plt_x86_64::address_for_local): Likewise.
3496 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3497 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3498 Make method non-static.
3499 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3501 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3502 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3503 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3504 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3506 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3507 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3509 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3510 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3512 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3513 (Output_data_plt_x86_64::plt_entry_size)
3514 (Output_data_plt_x86_64::first_plt_entry)
3515 (Output_data_plt_x86_64::plt_entry)
3516 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3517 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3518 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3519 (Output_data_plt_x86_64_standard): ... here, new class.
3520 (Target_x86_64::Target_x86_64): Take optional argument for the
3521 Target_info pointer to use.
3522 (Target_x86_64::do_make_data_plt): New virtual method.
3523 (Target_x86_64::make_data_plt): New method to call it.
3524 (Target_x86_64::init_got_plt_for_update): Use that.
3525 Call this->plt_->add_eh_frame method here.
3526 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3527 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3528 rather than static method.
3529 (Target_x86_64::plt_entry_size): Likewise.
3530 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3531 rather than plt_entry_size variable. Move guts of PLT filling to...
3532 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3533 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3534 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3536 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3537 additional argument for the section alignment.
3538 Don't do add_eh_frame_for_plt here.
3539 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3540 non-static. Use get_plt_entry_size method rather than plt_entry_size
3542 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3544 (Output_data_plt_i386::get_plt_entry_size): Call it.
3545 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3546 (Output_data_plt_i386::add_eh_frame): New method to call it.
3547 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3549 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3550 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3552 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3553 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3554 method instead of plt_entry_size.
3555 (Output_data_plt_i386::plt_entry_size)
3556 (Output_data_plt_i386::plt_eh_frame_fde_size)
3557 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3558 (Output_data_plt_i386_standard): ... here, new class.
3559 (Output_data_plt_i386_exec): New class.
3560 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3561 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3562 (Output_data_plt_i386::exec_plt_entry): Move to ...
3563 (Output_data_plt_i386_exec::plt_entry): ... here.
3564 (Output_data_plt_i386_dyn): New class.
3565 (Output_data_plt_i386::first_plt_entry): Move to ...
3566 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3567 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3568 (Output_data_plt_i386_dyn::plt_entry): ... here.
3569 (Target_i386::Target_i386): Take optional argument for the Target_info
3571 (Target_i386::do_make_data_plt): New virtual method.
3572 (Target_i386::make_data_plt): New method to call it.
3573 (Target_i386::make_plt_section): Use that.
3574 Call this->plt_->add_eh_frame method here.
3575 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3576 rather than plt_entry_size variable.
3577 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3578 (Output_data_plt_i386::address_for_local): Likewise.
3579 (Output_data_plt_i386::do_write): Likewise.
3580 Move guts of PLT filling to...
3581 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3582 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3583 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3584 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3586 2012-05-01 Cary Coutant <ccoutant@google.com>
3588 * dwarf_reader.cc (Dwarf_die::read_attributes)
3589 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3590 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3591 * reduced_debug_output.cc
3592 (Output_reduced_debug_info_section::get_die_end): Remove
3593 DW_FORM_GNU_ref_index. Add default case.
3595 2012-04-26 Mark Wielaard <mjw@redhat.com>
3597 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3598 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3599 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3600 DW_AT_high_pc as offset from DW_AT_low_pc.
3602 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3603 * testsuite/Makefile.in: Regenerate.
3604 * testsuite/gdb_index_test_3.c: New test source file.
3605 * testsuite/gdb_index_test_3.sh: New test source file.
3607 2012-04-25 Ian Lance Taylor <iant@google.com>
3609 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3611 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3612 as a class, not a struct.
3613 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3614 (Target_arm::apply_cortex_a8_workaround): Likewise.
3615 * gc.h: Declare Reloc_types as a struct, not a class.
3616 * object.h: Declare Symbols_data as a struct.
3617 * reloc.h: Declare Read_relocs_data as a struct.
3618 * target.h: Declare Relocate_info as a struct.
3620 2012-04-24 David S. Miller <davem@davemloft.net>
3622 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3623 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3626 2012-04-24 Cary Coutant <ccoutant@google.com>
3628 * incremental-dump.cc (find_input_containing_global): Replace
3629 magic number with symbolic constant.
3630 (dump_incremental_inputs): Update version number.
3631 * incremental.cc (Output_section_incremental_inputs): Update version
3632 number; import symbolic constants from Incremental_inputs_reader.
3633 (Incremental_inputs::create_data_sections): Align relocations
3634 section correctly for 64-bit targets.
3635 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3636 constants; add padding.
3637 (Output_section_incremental_inputs::write_header): Add assert for
3639 (Output_section_incremental_inputs::write_input_files): Add assert
3640 for input_entry_size.
3641 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3642 add assert for object_info_size, input_section_entry_size,
3643 global_sym_entry_size.
3644 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3645 for data structure sizes; use them.
3646 (Incremental_input_entry_reader): Import symbolic constants from
3647 Incremental_inputs_reader; use them.
3649 2012-04-23 David S. Miller <davem@davemloft.net>
3651 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3653 (Target_sparc::Target_sparc): Initialize new fields.
3654 (Target_sparc::do_make_elf_object): New function.
3655 (Target_sparc::do_adjust_elf_header): New function.
3657 2012-04-23 Cary Coutant <ccoutant@google.com>
3659 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3660 CU range table of gdb index.
3662 2012-04-20 David S. Miller <davem@davemloft.net>
3664 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3667 2012-04-16 David S. Miller <davem@davemloft.net>
3669 * sparc.cc (Target_sparc::got_address): New function.
3670 (Sparc_relocate_functions::gdop_hix22): New function.
3671 (Sparc_relocate_functions::gdop_lox10): New function.
3672 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3674 (Target_sparc::Scan::local): Likewise if the global symbol is not
3675 preemptible and is not IFUNC.
3676 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3677 transformations for local and non-preemptible non-IFUNC global
3680 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3681 writing out 64-bit part of ranges.
3683 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3684 -fpic and -fpie respectively.
3685 * Makefile.in: Regenerate.
3687 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3688 (Target_sparc::Target_sparc): Initialize new field.
3689 (Target_sparc::do_plt_section_for_global): New function.
3690 (Target_sparc::do_plt_section_for_local): New function.
3691 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3692 (Target_sparc::make_plt_section): New function, broken out of
3693 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3694 (Target_sparc::make_plt_entry): Call make_plt_section.
3695 (Target_sparc::make_local_ifunc_plt_entry): New function.
3696 (Target_sparc::rela_ifunc_section): New function.
3697 (Target_sparc::plt_section): Remove const.
3698 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3699 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3700 and ifunc_count_ fields.
3701 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3702 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3703 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3704 (Output_data_plt_sparc::rela_ifunc): New function.
3705 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3706 (Output_data_plt_sparc::has_ifunc_section): New function.
3707 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3708 (Output_data_plt_sparc::address_for_global): New function.
3709 (Output_data_plt_sparc::address_for_local): New function.
3710 (Output_data_plt_sparc::plt_index_to_offset): New function.
3711 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3713 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3715 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3716 R_SPARC_JMP_IREL to switch.
3717 (Target_sparc::Scan::check_non_pic): Likewise.
3718 (Target_sparc::Scan::local): Handle IFUNC symbols.
3719 (Target_sparc::Scan::local): Likewise.
3720 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3721 and plt_address_for_local.
3722 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3723 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3725 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3726 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3727 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3728 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3730 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3731 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3733 * sparc.cc (Target_sparc::Scan::global): Likewise.
3734 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3736 2012-04-16 Cary Coutant <ccoutant@google.com>
3738 * archive.cc (Library_base::should_include_member): Check for
3739 --export-dynamic-symbol.
3740 * options.h (class General_options): Add --export-dynamic-symbol.
3741 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3742 --export-dynamic-symbol.
3743 (Symbol_table::gc_mark_undef_symbols): Likewise.
3744 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3746 2012-04-12 David S. Miller <davem@davemloft.net>
3748 * sparc.cc (Reloc::wdisp10): New relocation method.
3749 (Reloc::h34): Likewise.
3750 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3751 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3753 (Target_sparc::Scan::local): Likewise.
3754 (Target_sparc::Scan::global): Likewise.
3755 (Target_sparc::Relocate::relocate): Likewise.
3757 2012-04-09 Cary Coutant <ccoutant@google.com>
3759 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3762 2012-04-06 Ian Lance Taylor <iant@google.com>
3764 * timer.cc: #include <unistd.h>.
3766 2012-04-06 Roland McGrath <mcgrathr@google.com>
3768 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3769 * config.in: Regenerate.
3770 * configure: Regenerate.
3772 2012-04-05 Nick Clifton <nickc@redhat.com>
3774 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3775 (AM_LC_MESSAGES): Add.
3776 * aclocal.m4: Regenerate.
3777 * config.in: Regenerate.
3778 * configure: Regenerate.
3780 2012-03-21 Cary Coutant <ccoutant@google.com>
3782 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3783 * Makefile.in: Regenerate.
3784 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3785 (Sized_elf_reloc_mapper::symbol_section): New function.
3786 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3787 (make_elf_reloc_mapper): New function.
3788 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3789 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3790 (Dwarf_abbrev_table::do_get_abbrev): New function.
3791 (Dwarf_ranges_table::read_ranges_table): New function.
3792 (Dwarf_ranges_table::read_range_list): New function.
3793 (Dwarf_pubnames_table::read_section): New function.
3794 (Dwarf_pubnames_table::read_header): New function.
3795 (Dwarf_pubnames_table::next_name): New function.
3796 (Dwarf_die::Dwarf_die): New function.
3797 (Dwarf_die::read_attributes): New function.
3798 (Dwarf_die::skip_attributes): New function.
3799 (Dwarf_die::set_name): New function.
3800 (Dwarf_die::set_linkage_name): New function.
3801 (Dwarf_die::attribute): New function.
3802 (Dwarf_die::string_attribute): New function.
3803 (Dwarf_die::int_attribute): New function.
3804 (Dwarf_die::uint_attribute): New function.
3805 (Dwarf_die::ref_attribute): New function.
3806 (Dwarf_die::child_offset): New function.
3807 (Dwarf_die::sibling_offset): New function.
3808 (Dwarf_info_reader::check_buffer): New function.
3809 (Dwarf_info_reader::parse): New function.
3810 (Dwarf_info_reader::do_parse): New function.
3811 (Dwarf_info_reader::do_read_string_table): New function.
3812 (Dwarf_info_reader::lookup_reloc): New function.
3813 (Dwarf_info_reader::get_string): New function.
3814 (Dwarf_info_reader::visit_compilation_unit): New function.
3815 (Dwarf_info_reader::visit_type_unit): New function.
3816 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3817 Sized_elf_reloc_mapper.
3818 (Sized_dwarf_line_info::symbol_section): Remove function.
3819 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3820 (Sized_dwarf_line_info::read_line_mappings): Remove object
3821 parameter, adjust callers.
3822 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3823 * dwarf_reader.h: Include <sys/types.h>.
3824 (class Track_relocs): Remove forward declaration.
3825 (class Elf_reloc_mapper): New class.
3826 (class Sized_elf_reloc_mapper): New class.
3827 (class Dwarf_abbrev_table): New class.
3828 (class Dwarf_range_list): New class.
3829 (class Dwarf_ranges_table): New class.
3830 (class Dwarf_pubnames_table): New class.
3831 (class Dwarf_die): New class.
3832 (class Dwarf_info_reader): New class.
3833 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3834 (Sized_dwarf_line_info::symbol_section): Remove member function.
3835 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3837 * gdb-index.cc: New source file.
3838 * gdb-index.h: New source file.
3839 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3840 and .debug_types sections, call Layout::add_to_gdb_index.
3841 (Sized_relobj_incr::do_section_name): Implement.
3842 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3843 return type; Implement.
3844 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3846 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3847 parameter list and return type.
3848 (Sized_incr_dynobj::do_section_contents): Likewise.
3849 * layout.cc: Include gdb-index.h.
3850 (Layout::Layout): Initialize gdb_index_data_.
3851 (Layout::init_fixed_output_section): Check for .gdb_index section.
3852 (Layout::add_to_gdb_index): New function. Instantiate.
3853 * layout.h: Add forward declaration for class Gdb_index.
3854 (Layout::add_to_gdb_index): New member function.
3855 (Layout::gdb_index_data_): New data member.
3856 * main.cc: Include gdb-index.h.
3857 (main): Print statistics for gdb index.
3858 * object.cc (Object::section_contents): Move code into
3859 do_section_contents.
3860 (need_decompressed_section): Check for sections needed when building
3862 (build_compressed_section_map): Likewise.
3863 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3865 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3866 sections; call Layout::add_to_gdb_index.
3867 (Sized_relobj_file::do_decompressed_section_contents): Call
3868 do_section_contents directly.
3869 * object.h (Object::do_section_contents): Adjust parameter list and
3871 (Object::do_decompressed_section_contents): Call do_section_contents
3873 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3875 * options.h (class General_options): Add --gdb-index option.
3876 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3877 list and return type.
3878 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3879 * reloc.h (Track_relocs::checkpoint): New function.
3880 (Track_relocs::reset): New function.
3882 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3884 * testsuite/Makefile.in: Regenerate.
3885 * testsuite/gdb_index_test.cc: New test source file.
3886 * testsuite/gdb_index_test_1.sh: New test source file.
3887 * testsuite/gdb_index_test_2.sh: New test source file.
3889 2012-03-19 Doug Kwan <dougkwan@google.com>
3891 * arm.cc (Target_arm::do_define_standard_symbols): New method.
3892 (Target_arm::do_finalize_sections): Remove code which defines
3893 __exidx_start and __exidx_end. Make symbol table parameter
3894 anonymous as it is not used.
3895 * gold.cc (queue_middle_tasks): Call target hook to define any
3896 target-specific symbols.
3897 * target.h (Target::define_standard_symbols): New method.
3898 (Target::do_define_standard_symbols): Same.
3899 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3900 * testsuite/Makefile.in: Regenerate.
3901 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3903 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3904 relocations are generated for __exidx_start and __exidx_end.
3906 2012-03-16 Doug Kwan <dougkwan@google.com>
3908 * testsuite/Makefile.am: Disable test initpri3b.
3909 * testsuite/Makefile.in: Regenerate.
3911 2012-03-15 Doug Kwan <dougkwan@google.com>
3913 * arm.cc (Target_arm::got_section): Make .got section read-only
3916 2012-03-15 Ian Lance Taylor <iant@google.com>
3919 * layout.cc (Layout::make_output_section): Correctly mark
3920 SHT_INIT_ARRAY, et. al., as relro.
3922 2012-03-14 Doug Kwan <dougkwan@google.com>
3924 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3925 dynamic relocations for protected symbols in shared objects.
3927 2012-03-13 Ian Lance Taylor <iant@google.com>
3929 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3930 keep the larger alignment.
3932 2012-03-12 Cary Coutant <ccoutant@google.com>
3934 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3935 handling of DW_LNE_define_file.
3937 2012-03-12 Cary Coutant <ccoutant@google.com>
3939 * reduced_debug_output.cc
3940 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3943 2012-02-29 Cary Coutant <ccoutant@google.com>
3945 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3947 2012-02-29 Cary Coutant <ccoutant@google.com>
3949 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3950 Call Object::decompressed_section_contents.
3951 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3953 (Sized_dwarf_line_info::buffer_start_): New data member.
3954 * merge.cc (Output_merge_data::do_add_input_section): Call
3955 Object::decompressed_section_contents.
3956 (Output_merge_string::do_add_input_section): Likewise.
3957 * object.cc (need_decompressed_section): New function.
3958 (build_compressed_section_map): Decompress sections needed later.
3959 (Sized_relobj_file::do_decompressed_section_contents): New function.
3960 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3961 * object.h (Object::decompressed_section_contents): New function.
3962 (Object::discard_decompressed_sections): New function.
3963 (Object::do_decompressed_section_contents): New function.
3964 (Object::do_discard_decompressed_sections): New function.
3965 (Compressed_section_info): New type.
3966 (Compressed_section_map): Include decompressed section contents.
3967 (Sized_relobj_file::do_decompressed_section_contents): New function.
3968 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3970 2012-02-16 Cary Coutant <ccoutant@google.com>
3972 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3973 * testsuite/Makefile.in: Regenerate.
3975 2012-02-14 Cary Coutant <ccoutant@google.com>
3977 * options.cc (General_options::finalize): Disallow -pie and -static.
3979 2012-02-03 Doug Kwan <dougkwan@google.com>
3981 * arm.cc (Arm_relocate_functions::abs8,
3982 Arm_relocate_functions::abs16): Use
3983 Bits::has_signed_unsigned_overflow32.
3984 (Arm_relocate_functions::thm_abs8): Correct range of
3986 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3989 2012-02-02 Doug Kwan <dougkwan@google.com>
3991 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3992 position independent outputs, not just shared objects.
3994 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3996 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3997 * configure: Regenerated.
3999 2012-01-27 Ian Lance Taylor <iant@google.com>
4001 * reloc.h (Bits): New class with static functions, copied from
4002 namespace utils in arm.cc.
4003 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4006 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4008 * incremental.cc (write_info_blocks): Correct relocation offset.
4010 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4012 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4013 (Relocate::tls_gd_to_le): Likewise.
4015 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4017 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4019 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4021 * configure.ac: Check if -mcmodel=medium works.
4022 * configure: Regenerated.
4024 2012-01-24 Cary Coutant <ccoutant@google.com>
4026 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4028 (read_unsigned_LEB_128_x): ... this new function.
4029 (read_signed_LEB_128): Replaced with inline definition and ...
4030 (read_signed_LEB_128_x): ... this new function.
4031 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4032 (read_unsigned_LEB_128): Add inline definition.
4033 (read_signed_LEB_128_x): New function.
4034 (read_signed_LEB_128): Add inline definition.
4035 * testsuite/Makefile.am (leb128_unittest): New unit test.
4036 * testsuite/Makefile.in: Regenerate.
4037 * testsuite/leb128_unittest.cc: New unit test.
4039 2012-01-23 Ian Lance Taylor <iant@google.com>
4042 * i386.cc (Target_i386::do_code_fill): When using a jmp
4043 instruction, pad with nop instructions.
4044 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4046 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4048 * x86_64.cc (gc_process_relocs): Add typename on types used in
4050 (scan_relocs): Likewise.
4051 (relocate_section): Likewise.
4052 (apply_relocation): Likewise.
4054 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4056 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4057 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4060 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4062 * x86_64.cc: Initial support for x32.
4064 2012-01-03 Cary Coutant <ccoutant@google.com>
4066 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4067 Use abstract base class for GOT.
4068 * gold/output.h (class Output_data_got_base): New abstract base class.
4069 (class Output_data_got): Derive from new base class, adjust ctors.
4070 (Output_data_got::reserve_slot): Make virtual; rename to
4071 do_reserve_slot; Adjust callers.
4072 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4073 pointer to abstract base class.
4074 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4076 2011-12-18 Ian Lance Taylor <iant@google.com>
4078 * object.h (Relobj::local_symbol_value): New function.
4079 (Relobj::local_plt_offset): New function.
4080 (Relobj::local_has_got_offset): New function.
4081 (Relobj::local_got_offset): New function.
4082 (Relobj::set_local_got_offset): New function.
4083 (Relobj::do_local_symbol_value): New pure virtual function.
4084 (Relobj::do_local_plt_offset): Likewise.
4085 (Relobj::do_local_has_got_offset): Likewise.
4086 (Relobj::do_local_got_offset): Likewise.
4087 (Relobj::do_set_local_got_offset): Likewise.
4088 (Sized_relobj::do_local_has_got_offset): Rename from
4089 local_has_got_offset.
4090 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4091 (Sized_relobj::do_set_local_got_offset): Rename from
4092 set_local_got_offset.
4093 (Sized_relobj_file::do_local_plt_offset): Rename from
4095 (Sized_relobj_file::do_local_symbol_value): New function.
4096 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4098 * output.cc (Output_data_got::Got_entry::write): Change object to
4099 Relobj. Use local_symbol_value.
4100 (Output_data_got::add_global_with_rel): Change rel_dyn to
4101 Output_data_reloc_generic*. Use add_global_generic.
4102 (Output_data_got::add_global_with_rela): Remove. Change all
4103 callers to use add_global_with_rel.
4104 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4105 Output_data_reloc_generic*. Use add_global_generic.
4106 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4107 callers to use add_global_pair_with_rel.
4108 (Output_data_got::add_local): Change object to Relobj*.
4109 (Output_data_got::add_local_plt): Likewise.
4110 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4111 change rel_dyn to Output_data_reloc_generic*. Use
4113 (Output_data_got::add_local_with_rela): Remove. Change all
4114 callers to use all_local_with_rel.
4115 (Output_data_got::add_local_pair_with_rel): Change object to
4116 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4117 add_output_section_generic.
4118 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4119 callers to use add_local_pair_with_rel.
4120 (Output_data_got::reserve_local): Change object to Relobj*.
4121 * output.h: (class Output_data_reloc_generic): Add pure virtual
4122 declarations for add_global_generic, add_local_generic,
4123 add_output_section_generic.
4124 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4125 functions for Output_data_reloc_generic. Update declarations for
4126 changes listed in output.cc.
4127 (class Output_data_got): Change template parameter to got_size.
4128 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4129 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4131 (Sized_relobj_incr::do_local_plt_offset): New function.
4132 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4135 2011-12-17 Cary Coutant <ccoutant@google.com>
4137 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4138 * resolve.cc (Symbol_table::resolve): Likewise.
4139 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4141 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4143 2011-12-16 Ian Lance Taylor <iant@google.com>
4145 * output.h (Output_data_reloc_generic::add): Only call
4146 add_dynamic_reloc if this is a dynamic reloc section.
4148 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4151 * target-reloc.h (apply_relocation): Replace <64, false> with
4154 2011-11-25 Nick Clifton <nickc@redhat.com>
4156 * po/it.po: New Italian translation.
4158 2011-11-17 Sterling Augustine <saugustine@google.com>
4160 * script.cc (script_include_directive): Implement.
4161 (read_script_file): New local variables name and search_path. Update
4162 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4163 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4164 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4166 2011-11-11 Sterling Augustine <saugustine@google.com>
4168 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4169 (file_or_sections_cmd): Likewise.
4171 2011-11-11 Doug Kwan <dougkwan@google.com>
4173 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4174 if --just-symbols is given.
4176 2011-11-10 Doug Kwan <dougkwan@google.com>
4179 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4180 when processing data relocs.
4181 * reloc.h (Relocate_functions::rel_unaligned): New method.
4182 (Relocate_functions::pcrel_unaligned): Ditto.
4183 (Relocate_functions::rel32_unaligned): Ditto.
4184 (Relocate_functions::pcrel32_unaligned): Ditto.
4186 2011-11-09 Doug Kwan <dougkwan@google.com>
4189 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4190 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4191 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4192 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4193 (Relocate_functions::rel_unaligned): New.
4194 (Relocate_functions::rel32_unaligned): New.
4195 * target-reloc.h (relocate_for_relocatable): Add code to handle
4196 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4197 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4198 arm_unaligned_reloc_r): New targets.
4199 * testsuite/Makefile.in: Regenerate.
4200 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4203 2011-11-02 Ian Lance Taylor <iant@google.com>
4205 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4207 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4208 * options.cc (General_options::finalize): Use library search path
4209 from configure script if specified. If not native and no sysroot,
4210 only search TOOLLIBDIR.
4211 * options.h (Search_directory::Search_directory): Change name to
4213 (General_options::add_to_library_path_with_sysroot): Change arg to
4215 * configure, Makefile.in, config.in: Rebuild.
4217 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4219 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4220 we are working around the ARM1176 Erratum.
4221 * options.h (General_options::fix_arm1176): Add option.
4222 * testsuite/Makefile.am: Add testcases, and keep current ones
4224 * testsuite/Makefile.in: Regenerate.
4225 * testsuite/arm_fix_1176.s: New file.
4226 * testsuite/arm_fix_1176.sh: Likewise.
4228 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4230 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4232 (Target_arm::may_use_blx): Remove method.
4233 (Target_arm::set_may_use_blx): Likewise.
4234 (Target_arm::may_use_v4t_interworking): New method.
4235 (Target_arm::may_use_v5t_interworking): Likewise.
4236 (Target_arm::may_use_blx_): Remove member variable.
4237 (Arm_relocate_functions::arm_branch_common): Check for v5T
4239 (Arm_relocate_functions::thumb_branch_common): Likewise.
4240 (Reloc_stub::stub_type_for_reloc): Likewise.
4241 (Target_arm::do_finalize_sections): Correct interworking checks.
4242 * testsuite/Makefile.am: Add new tests.
4243 * testsuite/Makefile.in: Regenerate.
4244 * testsuite/arm_farcall_arm_arm.s: New test.
4245 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4246 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4247 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4248 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4249 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4250 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4251 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4253 2011-10-31 Cary Coutant <ccoutant@google.com>
4256 * expression.cc (Expression::eval_with_dot): Add
4257 is_section_dot_assignment parameter.
4258 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4259 absolute and assigning to dot within a section.
4260 * script-sections.cc
4261 (Output_section_element_assignment::set_section_addresses): Pass
4262 dot_section to set_if_absolute.
4263 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4264 as is_section_dot_assignment flag to eval_with_dot.
4265 (Output_section_element_dot_assignment::set_section_addresses):
4267 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4268 parameter. Also set value if relative to dot_section; set the
4269 symbol's output_section.
4270 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4271 parameter. Adjust all callers.
4272 (Expression::eval_maybe_dot): Likewise.
4273 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4275 * testsuite/script_test_2.t: Test assignment of an absolute value
4276 to dot within an output section element.
4278 2011-10-31 Cary Coutant <ccoutant@google.com>
4280 * options.h (class General_options): Add --[no-]gnu-unique options.
4281 * symtab.cc (Symbol_table::sized_write_globals): Convert
4282 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4284 2011-10-31 Cary Coutant <ccoutant@google.com>
4287 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4288 unnecessary assertion.
4289 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4291 2011-10-31 Sriraman Tallam <tmsriram@google.com>
4293 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4295 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4297 Change to just keep the section associated with symbol.
4298 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4299 they are externally visible and --export-dynamic is turned on.
4300 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4302 2011-10-19 Ian Lance Taylor <iant@google.com>
4305 * script-sections.cc
4306 (Output_section_element_dot_assignment::needs_output_section): New
4309 2011-10-19 Ian Lance Taylor <iant@google.com>
4312 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4313 --section-start option was seen.
4314 * options.h (General_options::any_section_start): New function.
4316 2011-10-18 David S. Miller <davem@davemloft.net>
4319 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4320 member to track relocation locations that have moved during TLS
4321 reloc optimizations.
4322 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4323 (Target_sparc::Relocate::relocate): Adjust view down by 4
4324 bytes if it matches reloc_adjust_addr_.
4325 (Target_sparc::Relocate::relocate_tls): Always move the
4326 __tls_get_addr call delay slot instruction forward 4 bytes when
4327 performing relaxation.
4329 2011-10-18 Cary Coutant <ccoutant@google.com>
4331 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4332 (Output_file::map_no_anonymous): Check for non-zero
4333 return code from posix_fallocate.
4335 2011-10-17 Cary Coutant <ccoutant@google.com>
4338 * plugin.cc (is_visible_from_outside): Check for symbols
4339 referenced from dynamic objects.
4340 * resolve.cc (Symbol_table::resolve): Don't count references
4341 from dynamic objects as references from real ELF files.
4342 * testsuite/plugin_test_2.sh: Adjust expected result.
4344 2011-10-17 Cary Coutant <ccoutant@google.com>
4346 * gold.cc: Include timer.h.
4347 (queue_middle_tasks): Stamp time.
4348 (queue_final_tasks): Likewise.
4349 * main.cc (main): Store timer in parameters. Print timers
4351 * parameters.cc (Parameters::Parameters): Initialize timer_.
4352 (Parameters::set_timer): New function.
4353 (set_parameters_timer): New function.
4354 * parameters.h (Parameters::set_timer): New function.
4355 (Parameters::timer): New function.
4356 (Parameters::timer_): New data member.
4357 (set_parameters_timer): New function.
4358 * timer.cc (Timer::stamp): New function.
4359 (Timer::get_pass_time): New function.
4360 * timer.h (Timer::stamp): New function.
4361 (Timer::get_pass_time): New function.
4362 (Timer::pass_times_): New data member.
4364 2011-10-17 Cary Coutant <ccoutant@google.com>
4366 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4367 task for members of lib groups.
4369 2011-10-17 Cary Coutant <ccoutant@google.com>
4372 * fileread.cc (File_read::find_view): Add assert.
4373 (File_read::make_view): Move bounds check (replace with assert)...
4374 (File_read::find_or_make_view): ... to here.
4376 2011-10-12 Cary Coutant <ccoutant@google.com>
4378 * output.cc (Output_file::open_base_file): Handle case where
4379 ::read returns less than requested size.
4381 2011-10-10 Cary Coutant <ccoutant@google.com>
4383 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
4384 Initialize defined_count_.
4385 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4386 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4387 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4388 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4389 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4390 * incremental.h (Sized_relobj_incr::defined_count_): New data
4392 (Sized_incr_dynobj::defined_count_): New data member.
4393 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
4394 Return zeroes instead of internal error.
4396 2011-10-10 Cary Coutant <ccoutant@google.com>
4399 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
4400 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4401 * output.h (class Output_reloc): Add use_plt_offset flag.
4402 (Output_reloc::type_): Adjust size of bit field.
4403 (Output_reloc::use_plt_offset_): New bit field.
4404 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4405 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4406 flag. Adjust all callers.
4407 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
4408 creating RELATIVE relocations.
4410 2011-10-10 Nick Clifton <nickc@redhat.com>
4412 * po/es.po: Updated Spanish translation.
4413 * po/fi.po: Updated Finnish translation.
4415 2011-10-03 Diego Novillo <dnovillo@google.com>
4417 * options.cc (parse_uint): Fix dereference of RETVAL.
4419 2011-09-29 Sriraman Tallam <tmsriram@google.com>
4421 * layout.h (section_order_map_): New member.
4422 (get_section_order_map): New member function.
4423 * output.cc (Output_section::add_input_section): Check for patterns
4424 only when --section-ordering-file is specified.
4425 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4426 output_sections have been formed.
4427 * layout.cc (Layout_Layout): Initialize section_order_map_.
4428 * plugin.cc (update_section_order): Store order in order_map. Do not
4430 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4431 * testsuite/Makefile.in: Regenerate.
4432 * testsuite/plugin_section_order.c: New file.
4433 * testsuite/plugin_final_layout.cc: New file.
4434 * testsuite/plugin_final_layout.sh: New file.
4436 2011-09-29 Cary Coutant <ccoutant@google.com>
4438 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4440 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
4441 symbols during incremental update.
4442 (Symbol_table::add_from_dynobj): Likewise.
4444 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4445 Ian Lance Taylor <iant@google.com>
4447 * symtab.cc (Symbol_table::define_special_symbol): Always
4448 canonicalize version string.
4450 2011-09-26 Cary Coutant <ccoutant@google.com>
4452 * gold.cc (queue_initial_tasks): Move option checks ...
4453 * options.cc (General_options::finalize): ... to here. Disable
4454 some options; make others fatal.
4456 2011-09-26 Cary Coutant <ccoutant@google.com>
4459 * plugin.cc (get_symbols_v2): New function.
4460 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4461 (is_referenced_from_outside): New function.
4462 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4463 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4464 (get_symbols): Pass version parameter.
4465 (get_symbols_v2): New function.
4466 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4468 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4469 (onload): Add LDPT_GET_SYMBOLS_V2.
4470 (all_symbols_read_hook): Use get_symbols_v2; check for
4471 LDPR_PREVAILING_DEF_IRONLY_EXP.
4472 * testsuite/plugin_test_3.sh: Update expected results.
4474 2011-09-23 Simon Baldwin <simonb@google.com>
4476 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4477 configuration options.
4478 * configure: Regenerate.
4479 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4480 * Makefile.in: Regenerate.
4481 * testsuite/Makefile.in: Regenerate.
4483 2011-09-19 Sriraman Tallam <tmsriram@google.com>
4485 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4487 2011-09-19 Cary Coutant <ccoutant@google.com>
4489 * incremental.cc (can_incremental_update): Fix typo in comment.
4490 * incremental.h (can_incremental_update): Likewise.
4492 2011-09-18 Cary Coutant <ccoutant@google.com>
4494 * incremental.cc (can_incremental_update): New function.
4495 * incremental.h (can_incremental_update): New function.
4496 * layout.cc (Layout::init_fixed_output_section): Call it.
4497 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4498 * object.cc (Sized_relobj_file::do_layout): Call
4499 can_incremental_update.
4501 2011-09-13 Cary Coutant <ccoutant@google.com>
4503 * configure.ac: Check for glibc support for gnu_indirect_function
4504 support with static linking, setting automake conditional
4506 * Makefile.in: Regenerate.
4507 * configure: Regenerate.
4509 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4510 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4512 * testsuite/Makefile.in: Regenerate.
4514 2011-09-13 Cary Coutant <ccoutant@google.com>
4516 * incremental.cc (Sized_relobj_incr::do_layout): Call
4517 report_comdat_group for kept comdat sections.
4518 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4519 * testsuite/Makefile.in: Regenerate.
4520 * testsuite/incr_comdat_test_1.cc: New source file.
4521 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4522 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4523 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4525 2011-09-13 Ian Lance Taylor <iant@google.com>
4527 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4528 variable external_symbols_offset.
4530 2011-09-12 Ian Lance Taylor <iant@google.com>
4532 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4533 triggered if object has no symbols.
4535 2011-09-09 David S. Miller <davem@davemloft.net>
4537 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4538 (Output_fill_debug_line::do_write): Likewise.
4540 2011-08-29 Cary Coutant <ccoutant@google.com>
4542 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4543 casts to match formatting specs.
4544 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4546 2011-08-26 Cary Coutant <ccoutant@google.com>
4548 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4549 remaining hole size when allocating.
4550 (Layout::make_output_section): Set fill methods for debug sections.
4551 * layout.h (Free_list::Free_list_node): Move from private to
4553 (Free_list::set_min_hole_size): New function.
4554 (Free_list::begin, Free_list::end): New functions.
4555 (Free_list::min_hole_): New data member.
4556 * output.cc: Include dwarf.h.
4557 (Output_fill_debug_info::do_minimum_hole_size): New function.
4558 (Output_fill_debug_info::do_write): New function.
4559 (Output_fill_debug_line::do_minimum_hole_size): New function.
4560 (Output_fill_debug_line::do_write): New function.
4561 (Output_section::Output_section): Initialize new data member.
4562 (Output_section::set_final_data_size): Ensure patch space is larger
4563 than minimum hole size.
4564 (Output_section::do_write): Fill holes in debug sections.
4565 * output.h (Output_fill): New class.
4566 (Output_fill_debug_info): New class.
4567 (Output_fill_debug_line): New class.
4568 (Output_section::set_free_space_fill): New function.
4569 (Output_section::free_space_fill_): New data member.
4570 * testsuite/Makefile.am (incremental_test_3): Add
4571 --incremental-patch option.
4572 (incremental_test_4): Likewise.
4573 (incremental_test_5): Likewise.
4574 (incremental_test_6): Likewise.
4575 (incremental_copy_test): Likewise.
4576 (incremental_common_test_1): Likewise.
4577 * testsuite/Makefile.in: Regenerate.
4579 2011-08-26 Nick Clifton <nickc@redhat.com>
4581 * po/es.po: Updated Spanish translation.
4583 2011-08-01 Cary Coutant <ccoutant@google.com>
4585 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4586 * gold/testsuite/Makefile.in: Regenerate.
4587 * gold/testsuite/justsyms_exec.c: New source file.
4588 * gold/testsuite/justsyms_lib.c: New source file.
4590 2011-08-01 Cary Coutant <ccoutant@google.com>
4592 * layout.cc (Layout::set_segment_offsets): Don't realign text
4593 segment if -Ttext was specified.
4594 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4596 * object.h (Sized_relobj_file::e_type): New function.
4597 (Sized_relobj_file::e_type_): New data member.
4598 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4599 base address for ET_EXEC files.
4600 * target.cc (Target::do_make_elf_object_implementation): Allow
4601 ET_EXEC files with --just-symbols option.
4603 2011-07-28 Cary Coutant <ccoutant@google.com>
4605 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4606 Add thread_number parameter.
4607 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4608 * workqueue-threads.cc
4609 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4610 current thread if its thread number is greater than desired thread
4612 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4613 Add thread_number parameter.
4614 (Workqueue::should_cancel_thread): Likewise.
4615 (Workqueue::find_runnable_or_wait): Pass thread_number to
4616 should_cancel_thread.
4617 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4620 2011-07-22 Sriraman Tallam <tmsriram@google.com>
4622 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4623 only after checking if it cannot be forced local.
4624 * symtab.h (is_externally_visible): Check if the symbol is not forced
4627 2011-07-15 Ian Lance Taylor <iant@google.com>
4629 * options.h (class General_options): Add --print-output-format.
4630 Move -EL next to -EB, for better --help output.
4631 * target-select.cc: Include <cstdio>, "options.h", and
4633 (Target_selector::do_target_bfd_name): New function.
4634 (print_output_format): New function.
4635 * target-select.h (class Target_selector): Update declarations.
4636 (Target_selector::target_bfd_name): New function.
4637 (print_output_format): Declare.
4638 * main.cc: Include "target-select.h".
4639 (main): Handle --print-output-format.
4640 * gold.cc: Include "target-select.h".
4641 (queue_initial_tasks): Handle --print-output-format when there are
4643 * parameters.cc (parameters_force_valid_target): Give a better
4644 error message if -EB/-EL does not match target.
4645 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4648 2011-07-15 Ian Lance Taylor <iant@google.com>
4650 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4651 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4652 (Output_data_plt_i386::do_write): Write address of .dynamic
4653 section to first entry in .got.plt section.
4654 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4655 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4657 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4658 section to first entry in .got.plt section.
4659 * layout.h (Layout::dynamic_section): New function.
4661 2011-07-13 Sriraman Tallam <tmsriram@google.com>
4663 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4665 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4666 input_section_position_, and input_section_glob_.
4667 (read_layout_from_file): Call function section_ordering_specified.
4668 * layout.h (is_section_ordering_specified): New function.
4669 (section_ordering_specified): New function.
4670 (section_ordering_specified_): New boolean member.
4671 * main.cc(main): Call load_plugins after layout object is defined.
4672 * output.cc (Output_section::add_input_section): Use
4673 function section_ordering_specified to check if section ordering is
4675 * output.cc (Output_section::add_relaxed_input_section): Use
4676 function section_ordering_specified to check if section ordering is
4678 (Output_section::update_section_layout): New function.
4679 (Output_section::sort_attached_input_sections): Check if input section
4681 * output.h (Output_section::update_section_layout): New function.
4682 * plugin.cc (get_section_count): New function.
4683 (get_section_type): New function.
4684 (get_section_name): New function.
4685 (get_section_contents): New function.
4686 (update_section_order): New function.
4687 (allow_section_ordering): New function.
4688 (Plugin::load): Add the new interfaces to the transfer vector.
4689 (Plugin_manager::load_plugins): New parameter.
4690 (Plugin_manager::all_symbols_read): New parameter.
4691 (Plugin_manager::claim_file): New parameter. Save the elf object for
4693 (Plugin_manager::get_elf_object): New function.
4694 (Plugin_manager::get_view): Change to directly use the bool to check
4695 if get_view is called from claim_file_hook.
4696 * plugin.h (input_objects): New function
4697 (Plugin__manager::load_plugins): New parameter.
4698 (Plugin_manager::claim_file): New parameter.
4699 (Plugin_manager::get_elf_object): New function.
4700 (Plugin_manager::in_claim_file_handler): New function.
4701 (Plugin_manager::in_claim_file_handler_): New member.
4702 (layout): New function.
4703 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4704 handler with an extra parameter. Make the elf object before calling
4706 * testsuite/plugin_test.c (get_section_count): New function pointer.
4707 (get_section_type): New function pointer.
4708 (get_section_name): New function pointer.
4709 (get_section_contents): New function pointer.
4710 (update_section_order): New function pointer.
4711 (allow_section_ordering): New function pointer.
4712 (onload): Check if the new interfaces exist.
4714 2011-07-13 Ian Lance Taylor <iant@google.com>
4716 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4718 * x86_64.cc (Target_x86_64::got_section): Likewise.
4719 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4720 (relro_now_test_SOURCES): New variable.
4721 (relro_now_test_DEPENDENCIES): New variable.
4722 (relro_now_test_LDFLAGS): New variable.
4723 (relro_now_test_LDADD): New variable.
4724 (relro_now_test.so): New target.
4725 * testsuite/Makefile.in: Rebuild.
4727 2011-07-12 Ian Lance Taylor <iant@google.com>
4730 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4731 GLOB_DAT relocation rather than a RELATIVE relocation for a
4732 protected symbol when creating a shared library.
4733 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4734 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4735 * testsuite/protected_main_1.cc (main): Test that protected
4736 function has same address.
4738 2011-07-11 Ian Lance Taylor <iant@google.com>
4741 * options.h (class General_options): Add -Bgroup.
4742 * options.cc (General_options::finalize): If -Bgroup is set,
4743 default to --unresolved-symbols=report-all.
4744 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4745 * target-reloc.h (issue_undefined_symbol_error): Handle
4746 --unresolved-symbols=report-all.
4748 2011-07-08 Ian Lance Taylor <iant@google.com>
4751 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4752 if linker script discards key sections.
4753 (Layout::create_dynamic_symtab): Likewise.
4754 (Layout::assign_local_dynsym_offsets): Likewise.
4755 (Layout::sized_create_version_sections): Likewise.
4756 (Layout::create_interp): Likewise.
4757 (Layout::finish_dynamic_section): Likewise.
4758 (Layout::set_dynamic_symbol_size): Likewise.
4760 2011-07-08 Ian Lance Taylor <iant@google.com>
4763 * options.h (class General_options): Add --unresolved-symbols.
4764 * target-reloc.h (issue_undefined_symbol_error): Check
4765 --unresolved-symbols. Add comments.
4767 2011-07-08 Ian Lance Taylor <iant@google.com>
4769 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4770 expression more complex.
4772 2011-07-08 Ian Lance Taylor <iant@google.com>
4775 * target-reloc.h (issue_undefined_symbol_error): New inline
4776 function, broken out of relocate_section.
4777 (relocate_section): Call issue_undefined_symbol_error.
4778 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4779 there is no TLS segment if we are about to issue an undefined
4781 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4783 2011-07-08 Ian Lance Taylor <iant@google.com>
4786 * resolve.cc (Symbol_table::should_override): Add fromtype
4787 parameter. Change all callers. Give error when linking together
4788 TLS and non-TLS symbol.
4789 (Symbol_table::should_override_with_special): Add fromtype
4790 parameter. Change all callers.
4791 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4792 there is no TLS segment if we have reported some errors.
4793 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4795 2011-07-08 Ian Lance Taylor <iant@google.com>
4798 * target.h (Target::plt_address_for_global): New function.
4799 (Target::plt_address_for_local): New function.
4800 (Target::plt_section_for_global): Remove.
4801 (Target::plt_section_for_local): Remove.
4802 (Target::do_plt_address_for_global): New virtual function.
4803 (Target::do_plt_address_for_local): New virtual function.
4804 (Target::do_plt_section_for_global): Remove.
4805 (Target::do_plt_section_for_local): Remove.
4806 (Target::register_global_plt_entry): Add Symbol_table and Layout
4808 * output.cc (Output_data_got::Got_entry::write): Use
4809 plt_address_for_global and plt_address_for_local.
4810 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4811 address of output section.
4812 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4813 got_irelative_, and irelative_count_ fields. Update
4815 (Output_data_plt_i386::has_irelative_section): New function.
4816 (Output_data_plt_i386::entry_count): Add irelative_count_.
4817 (Output_data_plt_i386::set_final_data_size): Likewise.
4818 (class Target_i386): Add got_irelative_ and rel_irelative_
4819 fields. Update declarations.
4820 (Target_i386::Target_i386): Initialize new fields.
4821 (Target_i386::do_plt_address_for_global): New function replacing
4822 do_plt_section_for_global.
4823 (Target_i386::do_plt_address_for_local): New function replacing
4824 do_plt_section_for_local.
4825 (Target_i386::got_section): Create got_irelative_.
4826 (Target_i386::rel_irelative_section): New function.
4827 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4828 fields. Don't define __rel_iplt_{start,end}.
4829 (Output_data_plt_i386::add_entry): Add symtab and layout
4830 parameters. Change all callers. Use different PLT and GOT for
4832 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4833 layout parameters. Change all callers. Use different PLT and
4835 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4836 (Output_data_plt_i386::rel_irelative): New function.
4837 (Output_data_plt_i386::address_for_global): New function.
4838 (Output_data_plt_i386::address_for_local): New function.
4839 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4840 IRELATIVE GOT when changing IFUNC GOT entries.
4841 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4843 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4844 if we didn't create an IRELATIVE GOT.
4845 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4846 plt_address_for_local.
4847 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4848 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4849 got_irelative_, and irelative_count_ fields. Update
4851 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4852 Initialize new fields. Remove symtab parameter. Change all
4854 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4856 (Output_data_plt_x86_64::has_irelative_section): New function.
4857 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4858 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4859 fields. Update declarations.
4860 (Target_x86_64::Target_x86_64): Initialize new fields.
4861 (Target_x86_64::do_plt_address_for_global): New function replacing
4862 do_plt_section_for_global.
4863 (Target_x86_64::do_plt_address_for_local): New function replacing
4864 do_plt_section_for_local.
4865 (Target_x86_64::got_section): Create got_irelative_.
4866 (Target_x86_64::rela_irelative_section): New function.
4867 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4868 all callers. Don't create __rel_iplt_{start,end}.
4869 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4870 parameters. Change all callers. Use different PLT and GOT for
4872 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4873 layout parameters. Change all callers. Use different PLT and
4875 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4876 parameters. Change all callers. Use different PLT and GOT for
4878 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4879 (Output_data_plt_x86_64::rela_irelative): New function.
4880 (Output_data_plt_x86_64::address_for_global): New function.
4881 (Output_data_plt_x86_64::address_for_local): New function.
4882 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4883 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4884 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4885 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4887 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4889 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4890 symbols if we didn't create an IRELATIVE GOT.
4891 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4892 plt_address_for_local.
4893 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4894 * testsuite/ifuncvar1.c: New test file.
4895 * testsuite/ifuncvar2.c: New test file.
4896 * testsuite/ifuncvar3.c: New test file.
4897 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4898 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4899 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4900 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4901 * testsuite/Makefile.in: Rebuild.
4903 2011-07-07 Cary Coutant <ccoutant@google.com>
4905 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4906 (two_file_test_1_ndebug.o): Likewise.
4907 (two_file_test_1b_ndebug.o): Likewise.
4908 (two_file_test_2_ndebug.o): Likewise.
4909 (two_file_test_main_ndebug.o): Likewise.
4910 (incremental_test_2): Link with no-debug versions.
4912 2011-07-06 Cary Coutant <ccoutant@google.com>
4914 * gold/incremental.cc
4915 (Output_section_incremental_inputs::write_info_blocks): Check for
4916 hidden and internal symbols.
4918 2011-07-06 Cary Coutant <ccoutant@google.com>
4920 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4921 Check disposition for startup file.
4922 (Incremental_inputs::report_command_line): Ignore
4923 --incremental-startup-unchanged option.
4924 * options.cc (General_options::parse_incremental_startup_unchanged):
4926 (General_options::General_options): Initialize new data member.
4927 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4928 (General_options): Add --incremental-startup-unchanged option.
4929 (General_options::incremental_startup_disposition): New function.
4930 (General_options::incremental_startup_disposition_): New data member.
4932 2011-07-06 Cary Coutant <ccoutant@google.com>
4934 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4935 input file index to Script_info ctor.
4936 (Sized_incremental_binary::do_file_has_changed): Find the
4937 command-line argument for files named in scripts.
4938 * incremental.h (Script_info::Script_info): New ctor
4939 with input file index.
4940 (Script_info::input_file_index): New function.
4941 (Script_info::input_file_index_): New data member.
4942 (Incremental_binary::get_library): Add const.
4943 (Incremental_binary::get_script_info): Add const.
4944 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4945 * testsuite/Makefile.am (incremental_test_5): New test case.
4946 (incremental_test_6): New test case.
4947 * testsuite/Makefile.in: Regenerate.
4949 2011-07-06 Cary Coutant <ccoutant@google.com>
4951 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4952 debug output when command lines differ.
4954 2011-07-06 Cary Coutant <ccoutant@google.com>
4956 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4957 --incremental-patch option.
4958 * layout.cc (Free_list::allocate): Extend allocation beyond original
4960 (Layout::make_output_section): Mark sections that should get
4962 * options.cc (parse_percent): New function.
4963 * options.h (parse_percent): New function.
4964 (DEFINE_percent): New macro.
4965 (General_options): Add --incremental-patch option.
4966 * output.cc (Output_section::Output_section): Initialize new data
4968 (Output_section::add_input_section): Print section name when out
4970 (Output_section::add_output_section_data): Likewise.
4971 (Output_section::set_final_data_size): Add patch space when
4972 doing --incremental-full.
4973 (Output_section::do_reset_address_and_file_offset): Remove patch
4975 (Output_segment::set_section_list_addresses): Print debug output
4976 only if --incremental-update.
4977 * output.h (Output_section::set_is_patch_space_allowed): New function.
4978 (Output_section::is_patch_space_allowed_): New data member.
4979 (Output_section::patch_space_): New data member.
4980 * parameters.cc (Parameters::incremental_full): New function.
4981 * parameters.h (Parameters::incremental_full): New function
4982 * testsuite/Makefile.am (incremental_test_2): Add test for
4983 --incremental-patch option.
4984 * testsuite/Makefile.in: Regenerate.
4985 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4986 (t18): Remove function body.
4988 2011-07-05 Doug Kwan <dougkwan@google.com>
4991 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4992 Arm_Address type for relocation result.
4993 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4995 (Arm_relocate_functions::abs32): Use unaligned access.
4996 (Arm_relocate_functions::rel32): Ditto.
4997 (Arm_relocate_functions::prel31): Ditto.
4998 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4999 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5000 static data relocations.
5001 * testsuite/Makefile.in: Regnerate.
5002 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5004 2011-07-05 Ian Lance Taylor <iant@google.com>
5007 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5008 symbols if necessary.
5009 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5011 2011-07-05 Ian Lance Taylor <iant@google.com>
5014 * resolve.cc (Symbol::override_base_with_special): Simply override
5015 version with special symbol version, ignoring previous version.
5017 2011-07-05 Ian Lance Taylor <iant@google.com>
5019 * object.cc (Sized_relobj_file::include_section_group): Add
5020 information to comment about signature location.
5022 2011-07-02 Ian Lance Taylor <iant@google.com>
5025 * options.h (class General_options): Add -f and -F.
5026 * options.cc (General_options::finalize): Fatal error if -f/-F
5027 are used without -shared.
5028 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5030 2011-07-02 Ian Lance Taylor <iant@google.com>
5032 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5034 2011-07-01 Ian Lance Taylor <iant@google.com>
5038 * resolve.cc (Symbol::override_base_with_special): Don't override
5039 the version if the overriding symbol has a different name.
5040 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5041 all callers. If we give an error about an undefined version,
5042 define the base version if necessary.
5043 * dynobj.h (class Versions): Update declaration.
5044 * testsuite/weak_alias_test_5.cc: New file.
5045 * testsuite/weak_alias_test.script: New file.
5046 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5047 and versioned_alias have the right value, and call t2.
5048 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5049 weak_alias_test_5.so.
5050 (weak_alias_test_LDADD): Likewise.
5051 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5052 * testsuite/Makefile.in: Rebuild.
5054 2011-07-01 Ian Lance Taylor <iant@google.com>
5057 * options.h (class General_options): Support -z notext.
5058 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5060 (two_file_shared_nonpic.so): Likewise.
5061 (two_file_shared_mixed.so): Likewise.
5062 (two_file_shared_mixed_1.so): Likewise.
5063 (weak_undef_lib_nonpic.so): Likewise.
5064 (alt/weak_undef_lib_nonpic.so): Likewise.
5065 (tls_test_shared_nonpic.so): Likewise.
5066 * testsuite/Makefile.in: Rebuild.
5068 2011-07-01 Ian Lance Taylor <iant@google.com>
5071 * configure.ac: Test whether static linking works, setting
5072 the automake conditional HAVE_STATIC.
5073 * testsuite/Makefile.am: Disable tests using -static if
5074 HAVE_STATIC is not true.
5075 * configure, testsuite/Makefile.in: Rebuild.
5077 2011-07-01 Ian Lance Taylor <iant@google.com>
5080 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5081 Assert if we see DW_EH_PE_indirect.
5082 * target.h (Target::ehframe_datarel_base): New function.
5083 (Target::do_ehframe_datarel_base): New target function.
5084 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5085 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5088 2011-07-01 Ian Lance Taylor <iant@google.com>
5091 * options.h (class General_options): Add
5092 --ld-generated-unwind-info.
5093 * ehframe.cc (Fde::write): Add address parameter. Change all
5094 callers. If associated with PLT, fill in address and size.
5095 (Cie::set_output_offset): Only add merge mapping if there is an
5097 (Cie::write): Add address parameter. Change all callers.
5098 (Eh_frame::add_ehframe_for_plt): New function.
5099 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5100 input_offset_ fields into union u_, with new plt field.
5101 (Fde::Fde): Adjust for new union field.
5102 (Fde::Fde) [Output_data version]: New constructor.
5103 (Fde::add_mapping): Only add merge mapping if there is an object.
5104 (class Cie): Update declarations.
5105 (class Eh_frame): Declare add_ehframe_for_plt.
5106 * layout.cc (Layout::layout_eh_frame): Break out code into
5107 make_eh_frame_section, and call it.
5108 (Layout::make_eh_frame_section): New function.
5109 (Layout::add_eh_frame_for_plt): New function.
5110 * layout.h (class Layout): Update declarations.
5111 * merge.cc (Merge_map::add_mapping): Add assertion.
5112 * i386.cc: Include "dwarf.h".
5113 (class Output_data_plt_i386): Make first_plt_entry,
5114 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5115 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5116 and plt_eh_frame_fde.
5117 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5118 boundary. Call add_eh_frame_for_plt if appropriate.
5119 * x86_64.cc: Include "dwarf.h".
5120 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5121 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5122 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5123 and plt_eh_frame_fde.
5124 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5127 2011-06-29 Ian Lance Taylor <iant@google.com>
5130 * object.cc (Sized_relobj_file::layout_section): Change shdr
5131 parameter to be const.
5132 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5134 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5135 appropriate. Call layout_eh_frame_section.
5136 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5138 * object.h (class Sized_relobj_file): Update declarations.
5140 2011-06-29 Ian Lance Taylor <iant@google.com>
5143 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5145 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5147 2011-06-29 Ian Lance Taylor <iant@google.com>
5150 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5152 * layout.cc (Layout::layout_eh_frame): Likewise.
5154 2011-06-29 Ian Lance Taylor <iant@google.com>
5157 * layout.cc (Layout::symtab_section_shndx): New function.
5158 * layout.h (class Layout): Declare symtab_section_shndx.
5159 * output.cc (Output_section::write_header): Call it.
5161 2011-06-29 Ian Lance Taylor <iant@google.com>
5164 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5165 symbols which are not used in a relocation.
5167 2011-06-28 Ian Lance Taylor <iant@google.com>
5170 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5171 script create indistinguishable segments.
5172 (Layout::set_segment_offsets): Use stable_sort when sorting
5173 segments. Pass this to Compare_segments constructor.
5174 * layout.h (class Layout): Make segment_precedes non-static.
5175 (class Compare_segments): Change from struct to class. Add
5176 layout_ field. Add constructor.
5177 * script-sections.cc
5178 (Script_sections::attach_sections_using_phdrs_clause): Rename
5179 local orphan to is_orphan. Don't report failure to put empty
5180 section in segment. On attachment failure, report name of
5181 section, and attach to first PT_LOAD segment.
5183 2011-06-28 Ian Lance Taylor <iant@google.com>
5186 * target-select.cc (Target_selector::Target_selector): Add
5187 emulation parameter. Change all callers.
5188 (select_target_by_bfd_name): Rename from select_target_by_name.
5190 (select_target_by_emulation): New function.
5191 (supported_emulation_names): New function.
5192 * target-select.h (class Target_selector): Add emulation_ field.
5193 Update declarations.
5194 (Target_selector::recognize_by_bfd_name): Rename from
5195 recognize_by_name. Change all callers.
5196 (Target_selector::supported_bfd_names): Rename from
5197 supported_names. Change all callers.
5198 (Target_selector::recognize_by_emulation): New function.
5199 (Target_selector::supported_emulations): New function.
5200 (Target_selector::emulation): New function.
5201 (Target_selector::do_recognize_by_bfd_name): Rename from
5202 do_recognize_by_name. Change all callers.
5203 (Target_selector::do_supported_bfd_names): Rename from
5204 do_supported_names. Change all callers.
5205 (Target_selector::do_recognize_by_emulation): New function.
5206 (Target_selector::do_supported_emulations): New function.
5207 (select_target_by_bfd_name): Change name in declaration.
5208 (select_target_by_emulation): Declare.
5209 (supported_emulation_names): Declare.
5210 * parameters.cc (parameters_force_valid_target): Try to find
5211 target based on emulation from -m option.
5212 * options.h (class General_options): Change doc string for -m.
5213 * options.cc (help): Print emulations.
5214 (General_options::parse_V): Likewise.
5215 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5216 Add emulation parameter. Change all callers.
5218 2011-06-28 Ian Lance Taylor <iant@google.com>
5220 * target.h (class Target): Add osabi_ field.
5221 (Target::osabi): New function.
5222 (Target::set_osabi): New function.
5223 (Target::Target): Initialize osabi_.
5224 (Target::do_adjust_elf_header): Make pure virtual.
5225 (Sized_target::do_adjust_elf_header): Declare.
5226 * target.cc (Sized_target::do_adjust_elf_header): New function.
5227 (class Sized_target): Instantiate all versions.
5228 * freebsd.h (class Target_freebsd): Remove.
5229 (Target_selector_freebsd::do_recognize): Call set_osabi on
5231 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5232 (Target_selector_freebsd::set_osabi): Remove.
5233 * i386.cc (class Target_i386): Inherit from Sized_target rather
5234 than Target_freebsd.
5235 * x86_64.cc (class Target_x86_64): Likewise.
5237 2011-06-28 Ian Lance Taylor <iant@google.com>
5239 * target.h (Target::can_check_for_function_pointers): Rewrite.
5241 (Target::can_icf_inline_merge_sections): Likewise.
5242 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5243 (Target::Target_info): Add can_icf_inline_merge_sections field.
5244 (Target::do_can_check_for_function_pointers): New virtual
5246 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5247 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5248 from can_check_for_function_pointers, move in file.
5249 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5250 section_may_have_icf_unsafe_poineters, move in file.
5251 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5252 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5253 Rename from can_check_for_function_pointers, move in file.
5254 (Target_i386::can_icf_inline_merge_sections): Remove.
5255 (Target_i386::i386_info): Initialize
5256 can_icf_inline_merge_sections.
5257 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5258 Initialize can_icf_inline_merge_sections.
5259 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5260 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5261 Rename from can_check_for_function_pointers, move in file.
5262 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5263 (Target_x86_64::x86_64_info): Initialize
5264 can_icf_inline_merge_sections.
5265 * testsuite/testfile.cc (Target_test::test_target_info):
5267 * icf.cc (get_section_contents): Correct formatting.
5269 2011-06-27 Ian Lance Taylor <iant@google.com>
5271 * symtab.cc (Symbol::versioned_name): New function.
5272 (Symbol_table::add_to_final_symtab): Use versioned_name when
5274 (Symbol_table::sized_write_symbol): Likewise.
5275 * symtab.h (class Symbol): Declare versioned_name.
5276 * stringpool.h (class Stringpool_template): Add variant of add
5277 which takes a std::basic_string.
5278 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5279 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5280 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5281 (ver_test_12.o): New target.
5282 * testsuite/Makefile.in: Rebuild.
5284 2011-06-27 Doug Kwan <dougkwan@google.com>
5286 * arm.cc (Arm_relocate_functions::thm_jump8,
5287 Arm_relocate_functions::thm_jump11): Use a wider signed
5288 type to compute offset.
5289 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5291 * testsuite/Makefile.in: Regenerate.
5292 * testsuite/arm_branch_in_range.sh: Check test results of
5293 arm_thm_jump11 and arm_thm_jump8.
5294 * testsuite/arm_thm_jump11.s: New test source file.
5295 * testsuite/arm_thm_jump11.t: New linker script.
5296 * testsuite/arm_thm_jump8.s: New test source file.
5297 * testsuite/arm_thm_jump8.t: New linker script.
5299 2011-06-24 Ian Lance Taylor <iant@google.com>
5301 * layout.cc: Include "object.h".
5302 (ctors_sections_in_init_array): New static variable.
5303 (Layout::is_ctors_in_init_array): New function.
5304 (Layout::layout): Add entry to ctors_sections_in_init_array if
5306 * layout.h (class Layout): Declare is_ctors_in_init_array.
5307 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5308 is_ctors_reverse_view is set.
5309 (Sized_relobj_file::write_sections): Add layout parameter. Change
5310 all callers. Set is_ctors_reverse_view field of View_size.
5311 (Sized_relobj_file::reverse_words): New function.
5312 * object.h (Sized_relobj_file::View_size): Add
5313 is_ctors_reverse_view field.
5314 (class Sized_relobj_file): Update declarations.
5315 * testsuite/initpri3.c: New test.
5316 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5318 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5319 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5320 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5321 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5322 * testsuite/Makefile.in: Rebuild.
5324 2011-06-24 Cary Coutant <ccoutant@google.com>
5326 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5327 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5328 (debug_msg_cdebug.err): New targets.
5329 * testsuite/Makefile.in: Regenerate.
5330 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5331 Fix checks for link with shared library.
5333 2011-06-24 Doug Kwan <dougkwan@google.com>
5335 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5336 skip empty text sections.
5337 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5339 2011-06-22 Ian Lance Taylor <iant@google.com>
5342 * options.h (class General_options): Add --ctors-in-init-array.
5343 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5344 friends as SHT_PROGBITS for merging sections.
5345 (Layout::layout): Remove special handling of .init_array and
5346 friends. Don't sort if doing relocatable link. Sort for .ctors
5347 and .dtors if ctors_in_init_array.
5348 (Layout::make_output_section): Force correct section types for
5349 .init_array and friends. Don't sort if doing relocatable link,
5350 Don't sort .ctors and .dtors if ctors_in_init_array.
5351 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5352 (Layout::output_section_name): Add relobj parameter. Change all
5353 callers. Handle .ctors. and .dtors. in code rather than table.
5354 Handle .ctors and .dtors if ctors_in_init_array.
5355 (Layout::match_file_name): New function, moved from output.cc.
5356 * layout.h (class Layout): Update declarations.
5357 * output.cc: Include "layout.h".
5358 (Input_section_sort_entry::get_priority): New function.
5359 (Input_section_sort_entry::match_file_name): Just call
5360 Layout::match_file_name.
5361 (Output_section::Input_section_sort_init_fini_compare::operator()):
5362 Handle .ctors and .dtors. Sort by explicit priority rather than
5364 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5365 * testsuite/initpri2.c: New test.
5366 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5367 (check_PROGRAMS): Add initpri2.
5368 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5369 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5370 * configure, testsuite/Makefile.in: Rebuild.
5372 2011-06-19 Ian Lance Taylor <iant@google.com>
5375 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5376 .interp section to a PT_INTERP segment even if we have seen a
5377 --dynamic-linker option. Don't do it if we have seen a PHDRS
5378 clause in a linker script.
5379 (Layout::finalize): Don't create a .interp section if we've
5380 already create a PT_INTERP segment.
5381 (Layout::create_interp): Always call choose_output_section (revert
5382 patch of 2011-06-17). Don't create PT_INTERP segment.
5383 * script-sections.cc
5384 (Script_sections::create_note_and_tls_segments): Add a .interp
5385 section to a PT_INTERP segment even if we have seen a
5386 --dynamic-linker option.
5388 2011-06-18 Ian Lance Taylor <iant@google.com>
5390 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5391 merely because a non-PT_LOAD segment has a dynamic reloc.
5393 2011-06-18 Ian Lance Taylor <iant@google.com>
5395 * layout.cc (Layout::finish_dynamic_section): Don't create
5396 DT_FLAGS entry if not needed.
5398 2011-06-18 Ian Lance Taylor <iant@google.com>
5401 * layout.cc (Layout::layout_eh_frame): Correct handling of
5402 writable .eh_frame section.
5404 2011-06-17 Ian Lance Taylor <iant@google.com>
5407 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5408 symbol is redefined with the exact same object and value.
5410 2011-06-17 Ian Lance Taylor <iant@google.com>
5413 * layout.h (class Layout): Add interp_segment_ field.
5414 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5415 (Layout::attach_allocated_section_to_segment): If making shared
5416 library, put .interp section in PT_INTERP segment.
5417 (Layout::finalize): Also call create_interp if -dynamic-linker
5419 (Layout::create_interp): Assert that there is no PT_INTERP
5420 segment. If not using a SECTIONS clause, use make_output_section.
5421 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5422 * script-sections.cc
5423 (Script_sections::create_note_and_tls_segments): If making shared
5424 library, put .interp section in PT_INTERP segment.
5426 2011-06-17 Ian Lance Taylor <iant@google.com>
5428 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5429 when making a shared library.
5431 2011-06-17 Ian Lance Taylor <iant@google.com>
5433 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5434 parameter. Change all callers. Don't issue warning about PC32
5435 against locally defined symbol.
5437 2011-06-16 Ian Lance Taylor <iant@google.com>
5439 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5440 occurs in same object.
5442 2011-06-14 Alan Modra <amodra@gmail.com>
5444 * po/POTFILES.in: Regenerate.
5446 2011-06-09 Ian Lance Taylor <iant@google.com>
5448 * script-sections.cc
5449 (Orphan_output_section::set_section_addresses): For a relocatable
5450 link set address to 0.
5452 2011-06-09 Cary Coutant <ccoutant@google.com>
5455 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5456 used with --compress-debug-sections.
5457 * gold/object.cc (Sized_relobj_file::do_layout): Report
5458 uncompressed size of compressed input sections.
5460 2011-06-08 Cary Coutant <ccoutant@google.com>
5463 * testsuite/two_file_test_2_v1.cc: Change initialization of
5464 v2 to keep it in .data.
5466 2011-06-07 Cary Coutant <ccoutant@google.com>
5468 * common.cc (Symbol_table::do_allocate_commons_list): Call
5470 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5471 (Errors::fallback): New function.
5472 (gold_fallback): New function.
5473 * errors.h (Errors::fallback): New function.
5474 * gold.cc (gold_exit): Change status parameter to enum; adjust
5476 (queue_initial_tasks): Call gold_fallback.
5477 * gold.h: Include cstdlib.
5478 (Exit_status): New enum type.
5479 (gold_exit): Change status parameter to enum.
5480 (gold_fallback): New function.
5481 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5482 (Layout::create_symtab_sections): Likewise.
5483 (Layout::create_shdrs): Likewise.
5484 * main.cc (main): Adjust call to gold_exit.
5485 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5486 (Output_data_got::add_got_entry_pair): Likewise.
5487 (Output_section::add_input_section): Likewise.
5488 (Output_section::add_output_section_data): Likewise.
5489 (Output_segment::set_section_list_addresses): Likewise.
5490 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5492 2011-06-07 Cary Coutant <ccoutant@google.com>
5494 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5495 for incremental links.
5496 * output.cc (Output_segment::set_section_list_addresses): Remove
5497 FIXME and test for TLS or BSS.
5499 2011-06-07 Cary Coutant <ccoutant@google.com>
5501 * testsuite/Makefile.am: Add incremental_copy_test,
5502 incremental_common_test_1.
5503 * testsuite/Makefile.in: Regenerate.
5504 * testsuite/common_test_1_v1.c: New source file.
5505 * testsuite/common_test_1_v2.c: New source file.
5506 * testsuite/copy_test_v1.cc: New source file.
5508 2011-06-07 Cary Coutant <ccoutant@google.com>
5510 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5511 update, allocate common from bss section's free list.
5512 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5513 linker-defined symbols.
5514 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5515 Skip GOT and PLT entries that are no longer referenced.
5516 (Output_section_incremental_inputs::write_info_blocks): Mark
5517 linker-defined symbols.
5518 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5519 * output.cc (Output_section::allocate): New function.
5520 * output.h (Output_section::allocate): New function.
5521 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5522 linker-defined symbols.
5523 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5524 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5525 (Symbol::init_base_output_data): Likewise.
5526 (Symbol::init_base_output_segment): Likewise.
5527 (Symbol::init_base_constant): Likewise.
5528 (Sized_symbol::init_output_data): Likewise.
5529 (Sized_symbol::init_output_segment): Likewise.
5530 (Sized_symbol::init_constant): Likewise.
5531 (Symbol_table::do_define_in_output_data): Likewise.
5532 (Symbol_table::do_define_in_output_segment): Likewise.
5533 (Symbol_table::do_define_as_constant): Likewise.
5534 * symtab.h (Symbol::is_predefined): New function.
5535 (Symbol::init_base_output_data): Add is_predefined parameter.
5536 (Symbol::init_base_output_segment): Likewise.
5537 (Symbol::init_base_constant): Likewise.
5538 (Symbol::is_predefined_): New data member.
5539 (Sized_symbol::init_output_data): Add is_predefined parameter.
5540 (Sized_symbol::init_output_segment): Likewise.
5541 (Sized_symbol::init_constant): Likewise.
5542 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5544 2011-06-07 Cary Coutant <ccoutant@google.com>
5546 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5547 instead of emit_copy_reloc.
5548 (Copy_relocs::emit_copy_reloc): Refactor.
5549 (Copy_relocs::make_copy_reloc): New function.
5550 (Copy_relocs::add_copy_reloc): Remove.
5551 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5553 (Copy_relocs::make_copy_reloc): New function.
5554 (Copy_relocs::add_copy_reloc): Remove.
5555 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5556 unchanged input files.
5557 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5558 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5559 Reserve BSS space for COPY relocations.
5560 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5561 (Output_section_incremental_inputs::write_info_blocks): Record
5562 whether a symbol is copied from a shared object.
5563 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5564 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5565 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5566 (Incremental_input_entry_reader::get_output_symbol_index): Add
5568 (Incremental_binary::emit_copy_relocs): New function.
5569 (Incremental_binary::do_emit_copy_relocs): New function.
5570 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5572 (Sized_incremental_binary::add_copy_reloc): New function.
5573 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5574 (Sized_incremental_binary::Copy_reloc): New struct.
5575 (Sized_incremental_binary::Copy_relocs): New typedef.
5576 (Sized_incremental_binary::copy_relocs_): New data member.
5577 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5578 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5579 * target.h (Sized_target::emit_copy_reloc): New function.
5580 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5582 2011-06-02 Cary Coutant <ccoutant@google.com>
5585 * gold/archive.cc (Archive::Archive): Initialize new data member.
5586 (Archive::include_all_members): Return if archive has already been
5588 * gold/archive.h (Archive::include_all_members_): New data member.
5590 2011-06-02 Nick Clifton <nickc@redhat.com>
5592 * dynobj.h: Fix spelling mistake in comment.
5593 * output.cc: Likewise.
5595 2011-05-31 Doug Kwan <dougkwan@google.com>
5599 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
5600 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5601 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5602 redundant arm_exidx_test.so.
5603 * testsuite/Makefile.in: Regenerate.
5604 (check_SCRIPTS): Add pr12826.sh
5605 (check_DATA): Add pr12826.stdout
5606 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5607 * testsuite/pr12826.sh: New file.
5608 * testsuite/pr12826_1.s: Ditto.
5609 * testsuite/pr12826_1.s: Ditto.
5611 2011-05-30 Ian Lance Taylor <iant@google.com>
5613 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5616 2011-05-29 Ian Lance Taylor <iant@google.com>
5619 * testsuite/Makefile.am: Use different file name for two_file_test
5620 temporary file for each incremental test.
5621 * testsuite/Makefile.in: Rebuild.
5623 2011-05-29 Ian Lance Taylor <iant@google.com>
5625 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5626 binary input file is empty.
5628 2011-05-27 Ian Lance Taylor <iant@google.com>
5630 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5631 (ver_test_9.so): Likewise.
5632 * testsuite/Makefile.in: Rebuild.
5634 2011-05-26 Cary Coutant <ccoutant@google.com>
5636 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5637 * incremental.cc (Incremental_inputs::report_input_section): Fix
5638 comment, indentation.
5639 (Incremental_inputs::report_comdat_group): New function.
5640 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5641 of data for incremental input file entry.
5642 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5643 group count, COMDAT group signatures.
5644 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5645 an unchanged input file.
5646 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5647 Initialize new data member.
5648 (Incremental_object_entry::add_comdat_group): New function.
5649 (Incremental_object_entry::get_comdat_group_count): New function.
5650 (Incremental_object_entry::get_comdat_signature_key): New function.
5651 (Incremental_object_entry::groups_): New data member.
5652 (Incremental_inputs::report_comdat_group): New function.
5653 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5654 data for incremental input file entry.
5655 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5656 (Incremental_input_entry_reader::get_input_section): Adjust size of
5657 data for incremental input file entry.
5658 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5659 (Incremental_input_entry_reader::get_comdat_group_signature): New
5661 * object.cc (Sized_relobj::include_section_group): Report kept
5662 COMDAT groups for incremental links.
5664 2011-05-24 David Meyer <pdox@google.com>
5666 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5667 with name parameter. Add found_name parameter.
5668 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5669 * dirsearch.h (class Dirsearch): Update declaration.
5671 2011-05-24 Ian Lance Taylor <iant@google.com>
5673 * archive.cc (Library_base::should_include_member): Pull in object
5674 from archive if it defines the entry symbol.
5675 * parameters.cc (Parameters::entry): New function.
5676 * parameters.h (class Parameters): Declare entry.
5677 * output.h (class Output_file_header): Remove entry_ field.
5678 * output.cc (Output_file_header::Output_file_header): Remove entry
5679 parameter. Change all callers.
5680 (Output_file_header::entry): Use parameters->entry.
5681 * gold.cc (queue_middle_tasks): Likewise.
5682 * plugin.cc (Plugin_hook::run): Likewise.
5684 2011-05-24 Cary Coutant <ccoutant@google.com>
5686 * gold.cc (queue_initial_tasks): Pass incremental base filename
5687 to Output_file::open_base_file; don't print error message.
5688 * incremental-dump.cc (main): Adjust call to
5689 Output_file::open_for_modification.
5690 * incremental-dump.cc (main): Likewise.
5691 * incremental.cc (Incremental_inputs::report_command_line):
5692 Ignore --incremental-base option when comparing command lines.
5693 Ignore parameter when given as separate argument.
5694 * options.h (class General_options): Add --incremental-base.
5695 * output.cc (Output_file::Output_file):
5696 (Output_file::open_base_file): Add base_name and writable parameters;
5697 read base file into new file; print error message here.
5698 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5700 * output.h (Output_file::open_for_modification): Rename to...
5701 (Output_file::open_base_file): ...this; add base_name and
5702 writable parameters; adjust all callers.
5703 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5705 * testsuite/Makefile.am (incremental_test_4): Test
5707 * testsuite/Makefile.in: Regenerate.
5709 2011-05-24 Cary Coutant <ccoutant@google.com>
5711 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5713 * testsuite/Makefile.in: Regenerate.
5714 * testsuite/two_file_test_1_v1.cc: New test source file.
5715 * testsuite/two_file_test_1b_v1.cc: New test source file.
5716 * testsuite/two_file_test_2_v1.cc: New test source file.
5718 2011-05-24 Cary Coutant <ccoutant@google.com>
5720 * dynobj.h (Dynobj::do_dynobj): New function.
5721 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5722 flag and soname for shared objects.
5723 * incremental.cc (Incremental_inputs::report_object): Make
5724 either Incremental_object_entry or Incremental_dynobj_entry; add
5725 soname to string table.
5726 (Incremental_inputs::report_input_section): Add assertion.
5727 (Output_section_incremental_inputs::set_final_data_size): Adjust
5728 type of input file entry for shared libraries; adjust size of
5729 shared library info entry.
5730 (Output_section_incremental_inputs::write_input_files): Write
5731 as_needed flag for shared libraries.
5732 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5733 of input file entry for shared libraries; write soname.
5734 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5735 soname from incremental info.
5736 * incremental.h (enum Incremental_input_flags): Add
5737 INCREMENTAL_INPUT_AS_NEEDED.
5738 (Incremental_input_entry::Incremental_input_entry): Initialize new
5740 (Incremental_input_entry::set_as_needed): New function.
5741 (Incremental_input_entry::as_needed): New function.
5742 (Incremental_input_entry::do_dynobj_entry): New function.
5743 (Incremental_input_entry::as_needed_): New data member.
5744 (Incremental_object_entry::Incremental_object_entry): Don't check
5746 (Incremental_object_entry::do_type): Likewise.
5747 (class Incremental_dynobj_entry): New class.
5748 (Incremental_input_entry_reader::as_needed): New function.
5749 (Incremental_input_entry_reader::get_soname): New function.
5750 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5751 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5752 size of shared library info entry.
5753 * layout.cc (Layout::finish_dynamic_section): Don't test for
5754 incremental link when adding DT_NEEDED entries.
5755 * object.h (Object::Object): Initialize new data member.
5756 (Object::dynobj): New function.
5757 (Object::set_as_needed): New function.
5758 (Object::as_needed): New function.
5759 (Object::do_dynobj): New function.
5760 (Object::as_needed_): New data member.
5762 2011-05-24 Cary Coutant <ccoutant@google.com>
5764 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5765 info; adjust display of GOT entries.
5766 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5767 vector of input objects; remove file_status_.
5768 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5769 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5770 got_plt reader; call target hooks to reserve GOT entries.
5771 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5772 of input file info header and GOT info entry.
5773 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5775 (Got_plt_view_info::got_descriptor): Remove.
5776 (Got_plt_view_info::sym_index): New data member.
5777 (Got_plt_view_info::input_index): New data member.
5778 (Local_got_offset_visitor::visit): Write input file index.
5779 (Global_got_offset_visitor::visit): Write 0 for input file index.
5780 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5781 with sym_index and input_index.
5782 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5783 incremental info GOT entry; replace got_descriptor with input_index.
5784 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5785 map from input file index to object.
5786 (Sized_relobj_incr::do_layout): Replace direct data member reference
5787 with accessor function.
5788 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5789 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5790 Adjust size of input file info header.
5791 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5792 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5793 (Incremental_input_entry_reader::get_input_section): Adjust size of
5794 input file info header.
5795 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5796 of incremental info GOT entry.
5797 (Incremental_got_plt_reader::get_got_desc): Remove.
5798 (Incremental_got_plt_reader::get_got_symndx): New function.
5799 (Incremental_got_plt_reader::get_got_input_index): New function.
5800 (Sized_incremental_binary::Sized_incremental_binary): Remove
5801 file_status_; add input_objects_.
5802 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5803 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5804 (Sized_incremental_binary::file_is_unchanged): Remove.
5805 (Sized_incremental_binary::set_input_object): New function.
5806 (Sized_incremental_binary::input_object): New function.
5807 (Sized_incremental_binary::file_status_): Remove.
5808 (Sized_incremental_binary::input_objects_): New data member.
5809 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5811 (Sized_relobj_incr::invalid_address): Move to base class.
5812 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5814 (Sized_relobj_incr::do_output_section_offset): Likewise.
5815 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5816 (Sized_relobj_incr::section_offsets_): Likewise.
5817 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5819 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5820 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5821 with accessor function.
5822 (Sized_relobj_file::do_layout): Likewise.
5823 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5824 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5825 (Sized_relobj_file::compute_final_local_value): Replace refs to
5826 section_offsets_ with accessor function.
5827 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5828 * object.h (Relobj::Relobj): Initialize new data members.
5829 (Relobj::add_dyn_reloc): New function.
5830 (Relobj::first_dyn_reloc): New function.
5831 (Relobj::dyn_reloc_count): New function.
5832 (Relobj::first_dyn_reloc_): New data member.
5833 (Relobj::dyn_reloc_count_): New data member.
5834 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5836 (Sized_relobj::Address): New typedef.
5837 (Sized_relobj::invalid_address): Move here from child class.
5838 (Sized_relobj::Sized_relobj): Initialize new data members.
5839 (Sized_relobj::sized_relobj): New function.
5840 (Sized_relobj::is_output_section_offset_invalid): Move here from
5842 (Sized_relobj::get_output_section_offset): Likewise.
5843 (Sized_relobj::local_has_got_offset): Likewise.
5844 (Sized_relobj::local_got_offset): Likewise.
5845 (Sized_relobj::set_local_got_offset): Likewise.
5846 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5847 (Sized_relobj::clear_got_offsets): New function.
5848 (Sized_relobj::section_offsets): Move here from child class.
5849 (Sized_relobj::do_output_section_offset): Likewise.
5850 (Sized_relobj::do_set_section_offset): Likewise.
5851 (Sized_relobj::Local_got_offsets): Likewise.
5852 (Sized_relobj::local_got_offsets_): Likewise.
5853 (Sized_relobj::section_offsets_): Likewise.
5854 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5856 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5858 (Sized_relobj_file::sized_relobj): New function
5859 (Sized_relobj_file::local_has_got_offset): Move to base class.
5860 (Sized_relobj_file::local_got_offset): Likewise.
5861 (Sized_relobj_file::set_local_got_offset): Likewise.
5862 (Sized_relobj_file::get_output_section_offset): Likewise.
5863 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5864 (Sized_relobj_file::do_output_section_offset): Likewise.
5865 (Sized_relobj_file::do_set_section_offset): Likewise.
5866 (Sized_relobj_file::Local_got_offsets): Likewise.
5867 (Sized_relobj_file::local_got_offsets_): Likewise.
5868 (Sized_relobj_file::section_offsets_): Likewise.
5869 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5871 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5872 (Output_reloc::get_symbol_index): Likewise.
5873 (Output_reloc::local_section_offset): Likewise.
5874 (Output_reloc::get_address): Likewise.
5875 (Output_reloc::symbol_value): Likewise.
5876 (Output_data_got::reserve_slot): Move to class definition.
5877 (Output_data_got::reserve_local): New function.
5878 (Output_data_got::reserve_slot_for_global): Remove.
5879 (Output_data_got::reserve_global): New function.
5880 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5881 (all constructors, two instantiations).
5882 (Output_reloc::get_relobj): New function (two instantiations).
5883 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5884 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5885 (Output_data_reloc::add_global): Adjust type of relobj.
5886 (Output_data_reloc::add_global_relative): Likewise.
5887 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5888 (Output_data_reloc::add_local): Likewise.
5889 (Output_data_reloc::add_local_relative): Likewise.
5890 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5891 (Output_data_reloc::add_local_section): Likewise.
5892 (Output_data_reloc::add_output_section): Likewise.
5893 (Output_data_reloc::add_absolute): Likewise.
5894 (Output_data_reloc::add_target_specific): Likewise.
5895 (Output_data_got::reserve_slot): Move definition here.
5896 (Output_data_got::reserve_local): New function.
5897 (Output_data_got::reserve_global): New function.
5898 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5899 section_offsets_ with accessor function.
5900 (Sized_relobj_file::write_sections): Likewise.
5901 (Sized_relobj_file::do_relocate_sections): Likewise.
5902 * target.h (Sized_target::reserve_local_got_entry): New function.
5903 (Sized_target::reserve_global_got_entry): New function.
5904 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5905 (Target_x86_64::reserve_global_got_entry): New function.
5906 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5908 2011-05-23 Cary Coutant <ccoutant@google.com>
5910 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5911 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5912 bit when checking got_type.
5913 * incremental.cc (Sized_incremental_binary::setup_readers):
5914 Store symbol table and string table locations; initialize bit vector
5915 of file status flags.
5916 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5918 (Sized_incremental_binary::do_process_got_plt): New function.
5919 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5920 (Output_section_incremental_inputs::set_final_data_size): Record
5921 file index for each input file.
5922 (Output_section_incremental_inputs::write_got_plt): Store file index
5923 instead of input entry offset for each GOT entry.
5925 (Incremental_input_entry::Incremental_input_entry): Initialize new
5927 (Incremental_input_entry::set_offset): Store file index.
5928 (Incremental_input_entry::get_file_index): New function.
5929 (Incremental_input_entry::file_index_): New data member.
5930 (Incremental_binary::process_got_plt): New function.
5931 (Incremental_binary::do_process_got_plt): New function.
5932 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5934 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5935 (Sized_incremental_binary::set_file_is_unchanged): New function.
5936 (Sized_incremental_binary::file_is_unchanged): New function.
5937 (Sized_incremental_binary::do_process_got_plt): New function.
5938 (Sized_incremental_binary::file_status_): New data member.
5939 (Sized_incremental_binary::main_symtab_loc_): New data member.
5940 (Sized_incremental_binary::main_strtab_loc_): New data member.
5941 * output.cc (Output_data_got::Got_entry::write): Add case
5943 (Output_data_got::add_global): Call add_got_entry.
5944 (Output_data_got::add_global_plt): Likewise.
5945 (Output_data_got::add_global_with_rel): Likewise.
5946 (Output_data_got::add_global_with_rela): Likewise.
5947 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5948 (Output_data_got::add_global_pair_with_rela): Likewise.
5949 (Output_data_got::add_local): Call add_got_entry.
5950 (Output_data_got::add_local_plt): Likewise.
5951 (Output_data_got::add_local_with_rel): Likewise.
5952 (Output_data_got::add_local_with_rela): Likewise.
5953 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5954 (Output_data_got::add_local_pair_with_rela): Likewise.
5955 (Output_data_got::reserve_slot): New function.
5956 (Output_data_got::reserve_slot_for_global): New function.
5957 (Output_data_got::add_got_entry): New function.
5958 (Output_data_got::add_got_entry_pair): New function.
5959 (Output_section::add_output_section_data): Edit FIXME.
5961 (Output_section_data_build::Output_section_data_build): New
5962 constructor with size parameter.
5963 (Output_data_space::Output_data_space): Likewise.
5964 (Output_data_got::Output_data_got): Initialize new data member; new
5965 constructor with size parameter.
5966 (Output_data_got::add_constant): Call add_got_entry.
5967 (Output_data_got::reserve_slot): New function.
5968 (Output_data_got::reserve_slot_for_global): New function.
5969 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5970 (Output_data_got::add_got_entry): New function.
5971 (Output_data_got::add_got_entry_pair): New function.
5972 (Output_data_got::free_list_): New data member.
5973 * target.h (Sized_target::init_got_plt_for_update): New function.
5974 (Sized_target::register_global_plt_entry): New function.
5975 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5976 Initialize new data member; call init; add constructor with PLT count.
5977 (Output_data_plt_x86_64::init): New function.
5978 (Output_data_plt_x86_64::add_relocation): New function.
5979 (Output_data_plt_x86_64::reserve_slot): New function.
5980 (Output_data_plt_x86_64::free_list_): New data member.
5981 (Target_x86_64::init_got_plt_for_update): New function.
5982 (Target_x86_64::register_global_plt_entry): New function.
5983 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5984 incremental updates.
5985 (Output_data_plt_x86_64::add_relocation): New function.
5986 * testsuite/object_unittest.cc (Object_test): Set default options.
5988 2011-05-16 Ian Lance Taylor <iant@google.com>
5990 * options.h (class General_options): Make -i a synonym for -r.
5992 2011-05-16 Ian Lance Taylor <iant@google.com>
5994 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5996 2011-05-10 Cary Coutant <ccoutant@google.com>
5998 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6001 2011-05-06 Ian Lance Taylor <iant@google.com>
6003 * layout.cc (Layout::layout): If the output section flags change,
6004 update the ordering.
6006 2011-04-25 Cary Coutant <ccoutant@google.com>
6008 * incremental-dump.cc (dump_incremental_inputs): Print local
6009 symbol info for each input file.
6011 (Output_section_incremental_inputs::set_final_data_size): Add local
6012 symbol info to input file entries in incremental info.
6013 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6014 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6015 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6016 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6018 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6019 (Sized_incr_relobj::do_relocate): Write the local symbols.
6020 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6021 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6022 Adjust size of input file header.
6023 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6024 (Incremental_inputs_reader::get_local_symbol_count): New function.
6025 (Incremental_inputs_reader::get_input_section): Adjust size of input
6027 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6028 (Sized_incr_relobj::This): New typedef.
6029 (Sized_incr_relobj::sym_size): New const data member.
6030 (Sized_incr_relobj::Local_symbol): New struct.
6031 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6032 (Sized_incr_relobj::do_local_symbol_offset): New function.
6033 (Sized_incr_relobj::local_symbol_count_): New data member.
6034 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6035 (Sized_incr_relobj::local_symbol_index_): New data member.
6036 (Sized_incr_relobj::local_symbol_offset_): New data member.
6037 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6038 (Sized_incr_relobj::local_symbols_): New data member.
6039 * object.h (Relobj::output_local_symbol_count): New function.
6040 (Relobj::local_symbol_offset): New function.
6041 (Relobj::do_output_local_symbol_count): New function.
6042 (Relobj::do_local_symbol_offset): New function.
6043 (Sized_relobj::do_output_local_symbol_count): New function.
6044 (Sized_relobj::do_local_symbol_offset): New function.
6046 2011-04-22 Vladimir Simonov <sv@sw.ru>
6048 * descriptors.cc (set_close_on_exec): New function.
6049 (Descriptors::open): Use set_close_on_exec.
6050 * output.cc (S_ISLNK): Define if not defined.
6052 2011-04-22 Cary Coutant <ccoutant@google.com>
6054 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6056 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6057 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6058 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6060 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6061 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6062 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6064 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6066 (Incremental_binary::apply_incremental_relocs): New function.
6067 (Incremental_binary::do_apply_incremental_relocs): New function.
6068 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6070 (Sized_incremental_binary::add_global_symbol): New function.
6071 (Sized_incremental_binary::global_symbol): New function.
6072 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6073 (Sized_incremental_binary::symbol_map_): New data member.
6074 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6075 * target.h (Sized_target::apply_relocation): New function.
6076 * target-reloc.h (apply_relocation): New function.
6077 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6079 2011-04-22 Doug Kwan <dougkwan@google.com>
6081 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6082 flag of a SHT_ARM_EXIDX section.
6083 * testsuite/Makefile.am (arm_exidx_test): New test rules.
6084 * testsuite/Makefile.in: Regenerate.
6085 * testsuite/arm_exidx_test.s: New file.
6086 * testsuite/arm_exidx_test.sh: Same.
6088 2011-04-20 Cary Coutant <ccoutant@google.com>
6091 * archive.h (Incremental_archive_entry::Archive_member):
6092 Initialize arg_serial_ (second constructor).
6094 2011-04-17 Ian Lance Taylor <iant@google.com>
6096 * object.cc (Relocate_info::location): Simplify location string.
6097 * errors.cc (Errors::error_at_location): Don't print program
6099 (Errors::warning_at_location): Likewise.
6100 (Errors::undefined_symbol): Likewise.
6101 * testsuite/debug_msg.sh: Update accordingly.
6103 2011-04-14 Cary Coutant <ccoutant@google.com>
6105 * gold/layout.cc (Layout::symtab_section_offset): New function.
6106 * gold/layout.h (Layout::symtab_section_offset): New function.
6107 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6109 2011-04-12 Ian Lance Taylor <iant@google.com>
6111 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6112 with MREMAP_MAYMOVE.
6113 * output.h (class Output_file): Add map_is_allocated_ field.
6114 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6115 not available, provide stubs. If mremap is not available, #define
6117 (MREMAP_MAYMOVE): Define if not defined.
6118 (Output_file::Output_file): Initialize map_is_allocated_.
6119 (Output_file::resize): Check map_is_allocated_.
6120 (Output_file::map_anonymous): If mmap fails, use malloc.
6121 (Output_file::unmap): Don't do anything for an anonymous map.
6122 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6123 is not available, provide stubs.
6124 (File_read::View::~View): Use free rather than delete[].
6125 (File_read::make_view): Use malloc rather than new[]. If mmap
6127 (File_read::find_or_make_view): Use malloc rather than new[].
6128 * gold.h: Remove HAVE_REMAP code.
6129 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6130 exists. Rename mremap to gold_mremap. If mmap is not available
6132 * configure, config.in: Rebuild.
6134 2011-04-11 Ian Lance Taylor <iant@google.com>
6136 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6137 initialize local variable v.
6139 2011-04-11 Cary Coutant <ccoutant@google.com>
6141 * archive.cc (Archive::include_member): Adjust call to
6143 (Add_archive_symbols::run): Track argument serial numbers.
6144 (Lib_group::include_member): Likewise.
6145 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6146 * archive.h (Incremental_archive_entry::Archive_member):
6147 Initialize arg_serial_.
6148 (Archive_member::arg_serial_): New data member.
6149 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6150 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6152 (Sized_dynobj::do_for_all_local_got_entries): New function.
6153 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6155 * fileread.cc (get_mtime): New function.
6156 * fileread.h (get_mtime): New function.
6157 * gold.cc (queue_initial_tasks): Check for incremental update.
6158 (process_incremental_input): New function.
6159 (queue_middle_tasks): Don't force valid target for incremental
6161 * incremental-dump.cc (find_input_containing_global): Adjust
6162 size of symbol info entry.
6163 (dump_incremental_inputs): Dump argument serial number and
6164 in_system_directory flag; bias shndx by 1; print symbol names
6165 when dumping per-file symbol lists; use new symbol info readers.
6167 (Output_section_incremental_inputs:update_data_size): New function.
6168 (Sized_incremental_binary::setup_readers): Setup input readers
6169 for each input file; build maps for files added from libraries
6171 (Sized_incremental_binary::check_input_args): New function.
6172 (Sized_incremental_binary::do_check_inputs): Build map of argument
6173 serial numbers to input arguments.
6174 (Sized_incremental_binary::do_file_has_changed): Rename
6175 do_file_is_unchanged to this; compare file modification times.
6176 (Sized_incremental_binary::do_init_layout): New function.
6177 (Sized_incremental_binary::do_reserve_layout): New function.
6178 (Sized_incremental_binary::do_get_input_reader): Remove.
6179 (Sized_incremental_binary::get_symtab_view): New function.
6180 (Incremental_checker::can_incrementally_link_output_file): Remove.
6181 (Incremental_inputs::report_command_line): Exclude --debug options.
6182 (Incremental_inputs::report_archive_begin): Add parameter; track
6183 argument serial numbers; don't put input file entry for archive
6184 before archive members.
6185 (Incremental_inputs::report_archive_end): Put input file entry
6186 for archive after archive members.
6187 (Incremental_inputs::report_object): Add parameter; track argument
6188 serial numbers and in_system_directory flag.
6189 (Incremental_inputs::report_script): Add parameter; track argument
6191 (Output_section_incremental_inputs::set_final_data_size): Adjust
6192 size of symbol info entry; check for forwarding symbols.
6193 (Output_section_incremental_inputs::write_input_files): Write
6194 in_system_directory flag and argument serial number.
6195 (Output_section_incremental_inputs::write_info_blocks): Map section
6196 indices between incremental info and original input file; store
6197 input section index for each symbol.
6198 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6199 change operator() to visit().
6200 (class Global_got_offset_visitor): Likewise.
6201 (class Global_symbol_visitor_got_plt):
6202 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6204 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6205 (Sized_incr_relobj::do_read_symbols): New function.
6206 (Sized_incr_relobj::do_layout): New function.
6207 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6208 (Sized_incr_relobj::do_add_symbols): New function.
6209 (Sized_incr_relobj::do_should_include_member): New function.
6210 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6211 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6212 (Sized_incr_relobj::do_section_size): New function.
6213 (Sized_incr_relobj::do_section_name): New function.
6214 (Sized_incr_relobj::do_section_contents): New function.
6215 (Sized_incr_relobj::do_section_flags): New function.
6216 (Sized_incr_relobj::do_section_entsize): New function.
6217 (Sized_incr_relobj::do_section_address): New function.
6218 (Sized_incr_relobj::do_section_type): New function.
6219 (Sized_incr_relobj::do_section_link): New function.
6220 (Sized_incr_relobj::do_section_info): New function.
6221 (Sized_incr_relobj::do_section_addralign): New function.
6222 (Sized_incr_relobj::do_initialize_xindex): New function.
6223 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6224 (Sized_incr_relobj::do_read_relocs): New function.
6225 (Sized_incr_relobj::do_gc_process_relocs): New function.
6226 (Sized_incr_relobj::do_scan_relocs): New function.
6227 (Sized_incr_relobj::do_count_local_symbols): New function.
6228 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6229 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6230 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6231 (Sized_incr_relobj::do_relocate): New function.
6232 (Sized_incr_relobj::do_set_section_offset): New function.
6233 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6234 (Sized_incr_dynobj::do_read_symbols): New function.
6235 (Sized_incr_dynobj::do_layout): New function.
6236 (Sized_incr_dynobj::do_add_symbols): New function.
6237 (Sized_incr_dynobj::do_should_include_member): New function.
6238 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6239 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6240 (Sized_incr_dynobj::do_section_size): New function.
6241 (Sized_incr_dynobj::do_section_name): New function.
6242 (Sized_incr_dynobj::do_section_contents): New function.
6243 (Sized_incr_dynobj::do_section_flags): New function.
6244 (Sized_incr_dynobj::do_section_entsize): New function.
6245 (Sized_incr_dynobj::do_section_address): New function.
6246 (Sized_incr_dynobj::do_section_type): New function.
6247 (Sized_incr_dynobj::do_section_link): New function.
6248 (Sized_incr_dynobj::do_section_info): New function.
6249 (Sized_incr_dynobj::do_section_addralign): New function.
6250 (Sized_incr_dynobj::do_initialize_xindex): New function.
6251 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6252 (make_sized_incremental_object): New function.
6253 (Incremental_library::copy_unused_symbols): New function.
6254 (Incremental_library::do_for_all_unused_symbols): New function.
6255 * incremental.h (enum Incremental_input_flags): New type.
6256 (class Incremental_checker): Remove.
6257 (Incremental_input_entry::Incremental_input_entry): Add argument
6259 (Incremental_input_entry::arg_serial): New function.
6260 (Incremental_input_entry::set_is_in_system_directory): New function.
6261 (Incremental_input_entry::is_in_system_directory): New function.
6262 (Incremental_input_entry::arg_serial_): New data member.
6263 (Incremental_input_entry::is_in_system_directory_): New data member.
6264 (class Script_info): Move here from script.h.
6265 (Script_info::Script_info): Add filename parameter.
6266 (Script_info::filename): New function.
6267 (Script_info::filename_): New data member.
6268 (Incremental_script_entry::Incremental_script_entry): Add argument
6270 (Incremental_object_entry::Incremental_object_entry): Likewise.
6271 (Incremental_object_entry::add_input_section): Build list of input
6272 sections with map to original shndx.
6273 (Incremental_object_entry::get_input_section_index): New function.
6274 (Incremental_object_entry::shndx_): New data member.
6275 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6276 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6277 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6279 (Incremental_inputs::report_archive_begin): Likewise.
6280 (Incremental_inputs::report_object): Likewise.
6281 (Incremental_inputs::report_script): Likewise.
6282 (class Incremental_global_symbol_reader): New class.
6283 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6284 and store flags and input file type.
6285 (Incremental_input_entry_reader::arg_serial): New function.
6286 (Incremental_input_entry_reader::type): Extract type from flags.
6287 (Incremental_input_entry_reader::is_in_system_directory): New function.
6288 (Incremental_input_entry_reader::get_input_section_count): Call
6289 accessor function for type.
6290 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6291 function for type; adjust size of global symbol entry.
6292 (Incremental_input_entry_reader::get_global_symbol_count): Call
6293 accessor function for type.
6294 (Incremental_input_entry_reader::get_object_count): Likewise.
6295 (Incremental_input_entry_reader::get_object_offset): Likewise.
6296 (Incremental_input_entry_reader::get_member_count): Likewise.
6297 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6298 (Incremental_input_entry_reader::get_member_offset): Likewise.
6299 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6300 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6301 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6302 (Incremental_input_entry_reader::get_global_symbol_reader): New
6304 (Incremental_input_entry_reader::get_output_symbol_index): New
6306 (Incremental_input_entry_reader::type_): Remove.
6307 (Incremental_input_entry_reader::flags_): New data member.
6308 (Incremental_inputs_reader::input_file_offset): New function.
6309 (Incremental_inputs_reader::input_file_index): New function.
6310 (Incremental_inputs_reader::input_file): Call input_file_offset.
6311 (Incremental_inputs_reader::input_file_at_offset): New function.
6312 (Incremental_relocs_reader::get_r_type): Reformat.
6313 (Incremental_relocs_reader::get_r_shndx): Reformat.
6314 (Incremental_relocs_reader::get_r_offset): Reformat.
6315 (Incremental_relocs_reader::data): New function.
6316 (Incremental_binary::Incremental_binary): Initialize new data members.
6317 (Incremental_binary::check_inputs): Add cmdline parameter.
6318 (Incremental_binary::file_is_unchanged): Remove.
6319 (Input_reader::arg_serial): New function.
6320 (Input_reader::get_unused_symbol_count): New function.
6321 (Input_reader::get_unused_symbol): New function.
6322 (Input_reader::do_arg_serial): New function.
6323 (Input_reader::do_get_unused_symbol_count): New function.
6324 (Input_reader::do_get_unused_symbol): New function.
6325 (Incremental_binary::input_file_count): New function.
6326 (Incremental_binary::get_input_reader): Change signature to use
6327 index instead of filename.
6328 (Incremental_binary::file_has_changed): New function.
6329 (Incremental_binary::get_input_argument): New function.
6330 (Incremental_binary::get_library): New function.
6331 (Incremental_binary::get_script_info): New function.
6332 (Incremental_binary::init_layout): New function.
6333 (Incremental_binary::reserve_layout): New function.
6334 (Incremental_binary::output_file): New function.
6335 (Incremental_binary::do_check_inputs): New function.
6336 (Incremental_binary::do_file_is_unchanged): Remove.
6337 (Incremental_binary::do_file_has_changed): New function.
6338 (Incremental_binary::do_init_layout): New function.
6339 (Incremental_binary::do_reserve_layout): New function.
6340 (Incremental_binary::do_input_file_count): New function.
6341 (Incremental_binary::do_get_input_reader): Change signature.
6342 (Incremental_binary::input_args_map_): New data member.
6343 (Incremental_binary::library_map_): New data member.
6344 (Incremental_binary::script_map_): New data member.
6345 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6347 (Sized_incremental_binary::output_section): New function.
6348 (Sized_incremental_binary::inputs_reader): Add const.
6349 (Sized_incremental_binary::symtab_reader): Add const.
6350 (Sized_incremental_binary::relocs_reader): Add const.
6351 (Sized_incremental_binary::got_plt_reader): Add const.
6352 (Sized_incremental_binary::get_symtab_view): New function.
6353 (Sized_incremental_binary::Inputs_reader): New typedef.
6354 (Sized_incremental_binary::Input_entry_reader): New typedef.
6355 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6356 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6357 (Sized_incremental_binary::do_file_has_changed): New function.
6358 (Sized_incremental_binary::do_init_layout): New function.
6359 (Sized_incremental_binary::do_reserve_layout): New function.
6360 (Sized_input_reader::Inputs_reader): Remove.
6361 (Sized_input_reader::Input_entry_reader): Remove.
6362 (Sized_input_reader::do_arg_serial): New function.
6363 (Sized_input_reader::do_get_unused_symbol_count): New function.
6364 (Sized_input_reader::do_get_unused_symbol): New function.
6365 (Sized_incremental_binary::do_input_file_count): New function.
6366 (Sized_incremental_binary::do_get_input_reader): Change signature;
6367 use index instead of filename.
6368 (Sized_incremental_binary::section_map_): New data member.
6369 (Sized_incremental_binary::input_entry_readers_): New data member.
6370 (class Sized_incr_relobj): New class.
6371 (class Sized_incr_dynobj): New class.
6372 (make_sized_incremental_object): New function.
6373 (class Incremental_library): New class.
6374 * layout.cc (Free_list::num_lists): New static data member.
6375 (Free_list::num_nodes): New static data member.
6376 (Free_list::num_removes): New static data member.
6377 (Free_list::num_remove_visits): New static data member.
6378 (Free_list::num_allocates): New static data member.
6379 (Free_list::num_allocate_visits): New static data member.
6380 (Free_list::init): New function.
6381 (Free_list::remove): New function.
6382 (Free_list::allocate): New function.
6383 (Free_list::dump): New function.
6384 (Free_list::print_stats): New function.
6385 (Layout_task_runner::run): Resize output file for incremental updates.
6386 (Layout::Layout): Initialize new data members.
6387 (Layout::set_incremental_base): New function.
6388 (Layout::init_fixed_output_section): New function.
6389 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6390 incremental updates.
6391 (Layout::create_gold_note): Do not create gold note section for
6392 incremental updates.
6393 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6394 for incremental updates.
6395 (Layout::set_section_offsets): For incremental updates, allocate space
6397 (Layout::create_symtab_sections): Layout with offsets relative to
6398 start of section; for incremental updates, allocate space from free
6400 (Layout::create_shdrs): For incremental updates, allocate space from
6402 (Layout::finish_dynamic_section): For incremental updates, do not
6403 check --as-needed (fixed in subsequent patch).
6404 * layout.h (class Free_list): New class.
6405 (Layout::set_incremental_base): New function.
6406 (Layout::incremental_base): New function.
6407 (Layout::init_fixed_output_section): New function.
6408 (Layout::allocate): New function.
6409 (Layout::incremental_base_): New data member.
6410 (Layout::free_list_): New data member.
6411 * main.cc (main): Print Free_list statistics.
6412 * object.cc (Relobj::finalize_incremental_relocs): Add
6413 clear_counts parameter; clear counts only when clear_counts is set.
6414 (Sized_relobj::Sized_relobj): Initialize new base class.
6415 (Sized_relobj::do_layout): Don't report special sections.
6416 (Sized_relobj::do_for_all_local_got_entries): New function.
6417 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6418 symtab_off to all symbol table offsets.
6419 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6420 * object.h (class Got_offset_list): Move to top of file.
6421 (Object::Object): Allow case where input_file == NULL.
6422 (Object::~Object): Likewise.
6423 (Object::input_file): Assert that input_file != NULL.
6424 (Object::lock): Allow case where input_file == NULL.
6425 (Object::unlock): Likewise.
6426 (Object::is_locked): Likewise.
6427 (Object::token): Likewise.
6428 (Object::release): Likewise.
6429 (Object::is_incremental): New function.
6430 (Object::get_mtime): New function.
6431 (Object::for_all_local_got_entries): New function.
6432 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6433 (Object::set_is_in_system_directory): New function.
6434 (Object::is_in_system_directory): New function.
6435 (Object::do_is_incremental): New function.
6436 (Object::do_get_mtime): New function.
6437 (Object::do_for_all_local_got_entries): New function.
6438 (Object::is_in_system_directory_): New data member.
6439 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6440 (class Sized_relobj_base): New class.
6441 (class Sized_relobj): Derive from Sized_relobj_base.
6442 (class Sized_relobj::Symbols): Redeclare from base class.
6443 (class Sized_relobj::local_got_offset_list): Remove.
6444 (class Sized_relobj::Output_sections): Redeclare from base class.
6445 (class Sized_relobj::do_for_all_local_got_entries): New function.
6446 (class Sized_relobj::write_local_symbols): Add offset parameter.
6447 (class Sized_relobj::local_symbol_offset_): Update comment.
6448 (class Sized_relobj::local_dynsym_offset_): Update comment.
6449 * options.cc (Input_arguments::add_file): Remove const.
6450 * options.h (Input_file_argument::Input_file_argument):
6451 Initialize arg_serial_ (all constructors).
6452 (Input_file_argument::set_arg_serial): New function.
6453 (Input_file_argument::arg_serial): New function.
6454 (Input_file_argument::arg_serial_): New data member.
6455 (Input_arguments::Input_arguments): Initialize file_count_.
6456 (Input_arguments::add_file): Remove const.
6457 (Input_arguments::number_of_input_files): New function.
6458 (Input_arguments::file_count_): New data member.
6459 (Command_line::number_of_input_files): Call
6460 Input_arguments::number_of_input_files.
6461 * output.cc (Output_segment_headers::Output_segment_headers):
6463 (Output_section::Input_section::current_data_size): New function.
6464 (Output_section::Output_section): Initialize new data members.
6465 (Output_section::add_input_section): Don't do merge sections for
6466 an incremental link; allocate space from free list for an
6468 (Output_section::add_output_section_data): Allocate space from
6469 free list for an incremental update.
6470 (Output_section::update_data_size): New function.
6471 (Output_section::set_fixed_layout): New function.
6472 (Output_section::reserve): New function.
6473 (Output_segment::set_section_addresses): Remove const.
6474 (Output_segment::set_section_list_addresses): Remove const; allocate
6475 space from free list for an incremental update.
6476 (Output_segment::set_offset): Adjust size of RELRO segment for an
6478 * output.h (Output_data::current_data_size): Move here from
6480 (Output_data::pre_finalize_data_size): New function.
6481 (Output_data::update_data_size): New function.
6482 (Output_section_headers::update_data_size): new function.
6483 (Output_section_data_build::current_data_size): Move to Output_data.
6484 (Output_data_strtab::update_data_size): New function.
6485 (Output_section::current_data_size): Move to Output_data.
6486 (Output_section::set_fixed_layout): New function.
6487 (Output_section::has_fixed_layout): New function.
6488 (Output_section::reserve): New function.
6489 (Output_section::update_data_size): New function.
6490 (Output_section::has_fixed_layout_): New data member.
6491 (Output_section::free_list_): New data member.
6492 (Output_segment::set_section_addresses): Remove const.
6493 (Output_segment::set_section_list_addresses): Remove const.
6494 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6496 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6498 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6499 parameter when calling Add_symbols constructor; store argument
6500 serial number for members of a lib group.
6501 (Add_symbols::locks): Allow case where token == NULL.
6502 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6503 (Read_member::~Read_member): New function.
6504 (Read_member::is_runnable): New function.
6505 (Read_member::locks): New function.
6506 (Read_member::run): New function.
6507 (Check_script::~Check_script): New function.
6508 (Check_script::is_runnable): New function.
6509 (Check_script::locks): New function.
6510 (Check_script::run): New function.
6511 (Check_library::~Check_library): New function.
6512 (Check_library::is_runnable): New function.
6513 (Check_library::locks): New function.
6514 (Check_library::run): New function.
6515 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6516 (Add_symbols::library_): New data member.
6517 (class Read_member): New class.
6518 (class Check_script): New class.
6519 (class Check_library): New class.
6520 * reloc.cc (Read_relocs::is_runnable): Allow case where
6522 (Read_relocs::locks): Likewise.
6523 (Scan_relocs::locks): Likewise.
6524 (Relocate_task::locks): Likewise.
6525 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6527 (Sized_relobj::incremental_relocs_scan): Fix comment.
6528 (Sized_relobj::do_relocate): Pass output file offset to
6529 write_local_symbols.
6530 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6531 from class declaration.
6532 * script.cc (read_input_script): Allocate Script_info; pass
6533 argument serial number to report_script.
6534 * script.h (class Script_info): Move to incremental.h.
6535 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6536 * symtab.h (Symbol_table::add_from_incrobj): New function.
6537 (Symbol_table::set_file_offset): New function.
6539 2011-04-05 Cary Coutant <ccoutant@google.com>
6541 * incremental-dump.cc (dump_incremental_inputs): Change signature
6542 to take a Sized_incremental_binary; change caller. Use readers
6543 in Sized_incremental_binary.
6545 (Sized_incremental_binary::find_incremental_inputs_sections):
6546 Rename do_find_incremental_inputs_sections to this.
6547 (Sized_incremental_binary::setup_readers): New function.
6548 (Sized_incremental_binary::do_check_inputs): Check
6549 has_incremental_info_ flag; move setup code to setup_readers;
6551 (Sized_incremental_binary::do_file_is_unchanged): New function.
6552 (Sized_incremental_binary::do_get_input_reader): New function.
6553 * incremental.h (class Incremental_binary): Move to end of file.
6554 (Incremental_binary::file_is_unchanged): New function.
6555 (Incremental_binary::do_file_is_unchanged): New function.
6556 (Incremental_binary::Input_reader): New class.
6557 (Incremental_binary::get_input_reader): New function.
6558 (class Sized_incremental_binary): Move to end of file.
6559 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6560 input section reader classes.
6561 (Sized_incremental_binary::has_incremental_info): New function.
6562 (Sized_incremental_binary::inputs_reader): New function.
6563 (Sized_incremental_binary::symtab_reader): New function.
6564 (Sized_incremental_binary::relocs_reader): New function.
6565 (Sized_incremental_binary::got_plt_reader): New function.
6566 (Sized_incremental_binary::do_file_is_unchanged): New function.
6567 (Sized_incremental_binary::Sized_input_reader): New class.
6568 (Sized_incremental_binary::get_input_reader): New function.
6569 (Sized_incremental_binary::find_incremental_inputs_sections):
6570 Rename do_find_incremental_inputs_sections to this.
6571 (Sized_incremental_binary::setup_readers): New function.
6572 (Sized_incremental_binary::has_incremental_info_): New data member.
6573 (Sized_incremental_binary::inputs_reader_): New data member.
6574 (Sized_incremental_binary::symtab_reader_): New data member.
6575 (Sized_incremental_binary::relocs_reader_): New data member.
6576 (Sized_incremental_binary::got_plt_reader_): New data member.
6577 (Sized_incremental_binary::current_input_file_): New data member.
6579 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6582 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6585 2011-03-30 Cary Coutant <ccoutant@google.com>
6587 * archive.cc (Archive::include_member): Adjust call to report_object.
6588 (Add_archive_symbols::run): Add script_info to call to
6589 report_archive_begin.
6590 (Lib_group::include_member): Adjust call to report_object.
6591 (Add_lib_group_symbols::run): Adjust call to report_object.
6592 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6593 blocks. Add object count for script input files.
6594 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6595 script_info parameter; change all callers.
6596 (Incremental_inputs::report_object): Add script_info parameter;
6598 (Incremental_inputs::report_script): Store backpointer to
6599 incremental info entry.
6600 (Output_section_incremental_inputs::set_final_data_size): Record
6601 additional information for scripts.
6602 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6603 * incremental.h (Incremental_script_entry::add_object): New function.
6604 (Incremental_script_entry::get_object_count): New function.
6605 (Incremental_script_entry::get_object): New function.
6606 (Incremental_script_entry::objects_): New data member; adjust
6608 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6609 (Incremental_inputs::report_object): Add script_info parameter.
6610 (Incremental_inputs_reader::get_object_count): New function.
6611 (Incremental_inputs_reader::get_object_offset): New function.
6612 * options.cc (Input_arguments::add_file): Return reference to
6614 * options.h (Input_argument::set_script_info): New function.
6615 (Input_argument::script_info): New function.
6616 (Input_argument::script_info_): New data member; adjust all
6618 (Input_file_group::add_file): Return reference to new input argument.
6619 (Input_file_lib::add_file): Likewise.
6620 (Input_arguments::add_file): Likewise.
6621 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6622 * script.cc (Parser_closure::Parser_closure): Add script_info
6623 parameter; adjust all callers.
6624 (Parser_closure::script_info): New function.
6625 (Parser_closure::script_info_): New data member.
6626 (read_input_script): Report scripts earlier to incremental info.
6627 (script_add_file): Set script_info in Input_argument.
6628 (script_add_library): Likewise.
6629 * script.h (Script_options::Script_info): Rewrite class.
6631 2011-03-29 Cary Coutant <ccoutant@google.com>
6633 * archive.cc (Library_base::should_include_member): Move
6634 method here from class Archive.
6635 (Archive::Archive): Initialize base class.
6636 (Archive::should_include_member): Move to base class.
6637 (Archive::do_for_all_unused_symbols): New function.
6638 (Add_archive_symbols::run): Remove redundant access to
6640 (Lib_group::Lib_group): Initialize base class.
6641 (Lib_group::do_filename): New function.
6642 (Lib_group::include_member): Pass pointer to Lib_group to
6644 (Lib_group::do_for_all_unused_symbols): New function.
6645 (Add_lib_group_symbols::run): Report archive information for
6647 * archive.h (class Library_base): New base class.
6648 (class Archive): Derive from Library_base.
6649 (Archive::filename): Move to base class.
6650 (Archive::set_incremental_info): Likewise.
6651 (Archive::incremental_info): Likewise.
6652 (Archive::Should_include): Likewise.
6653 (Archive::should_include_member): Likewise.
6654 (Archive::Armap_entry): Remove.
6655 (Archive::Unused_symbol_iterator): Remove.
6656 (Archive::unused_symbols_begin): Remove.
6657 (Archive::unused_symbols_end): Remove.
6658 (Archive::do_filename): New function.
6659 (Archive::do_get_mtime): New function.
6660 (Archive::do_for_all_unused_symbols): New function.
6661 (Archive::task_): Move to base class.
6662 (Archive::incremental_info_): Likewise.
6663 (class Lib_group): Derive from Library_base.
6664 (Lib_group::do_filename): New function.
6665 (Lib_group::do_get_mtime): New function.
6666 (Lib_group::do_for_all_unused_symbols): New function.
6667 (Lib_group::task_): Move to base class.
6668 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6670 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6672 * incremental.cc (Incremental_inputs::report_archive_begin):
6673 Use Library_base; call library's get_mtime; add incremental inputs
6674 entry before members.
6675 (class Unused_symbol_visitor): New class.
6676 (Incremental_inputs::report_archive_end): Use Library_base; use
6677 visitor class to record unused symbols; don't add incremental inputs
6678 entry after members.
6679 (Incremental_inputs::report_object): Use Library_base.
6681 (Incremental_archive_entry::Incremental_archive_entry): Remove
6682 unused Archive parameter.
6683 (Incremental_inputs::report_archive_begin): Use Library_base.
6684 (Incremental_inputs::report_archive_end): Likewise.
6685 (Incremental_inputs::report_object): Likewise.
6686 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6688 * object.h (Object::for_all_global_symbols): New function.
6689 (Object::do_for_all_global_symbols): New function.
6690 (Sized_relobj::do_for_all_global_symbols): New function.
6691 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6693 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6696 2011-03-27 Ian Lance Taylor <iant@google.com>
6698 * archive.cc (Archive::interpret_header): Return -1 if something
6699 goes wrong. Change callers accordingly.
6701 2011-03-25 Cary Coutant <ccoutant@google.com>
6703 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6704 * testsuite/Makefile.in: Regenerate.
6706 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
6708 * plugin.cc (get_view): New.
6709 (Plugin::load): Pass get_view to the plugin.
6710 (Plugin_manager::get_view): New.
6712 2011-03-21 Ian Lance Taylor <iant@google.com>
6714 * testsuite/final_layout.sh: Rewrite to not use dc.
6715 * testsuite/relro_test.sh: Fail if dc is not present.
6717 2011-03-21 Sriraman Tallam <tmsriram@google.com>
6719 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6721 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6722 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6724 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6725 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6727 2011-03-14 Ian Lance Taylor <iant@google.com>
6729 * script-sections.cc (Sort_output_sections::script_compare):
6730 Rename from is_before, change return type.
6731 (Sort_output_sections::operator()): Adjust accordingly.
6733 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6736 * testsuite/odr_violation2.cc: Add comment to make all error line
6737 numbers double digits.
6738 * testsuite/debug_msg.sh: Adjust expected errors.
6740 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6742 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6743 but mark earlier ones as non-canonical
6744 (offset_to_iterator): Update search target and example
6745 (do_addr2line): Return extra lines in a vector*
6746 (format_file_lineno): Extract from do_addr2line
6747 (one_addr2line): Add vector* out-param
6748 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6749 when a lineno entry appeared last for its instruction
6750 (Dwarf_line_info): Add vector* out-param
6751 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6752 * symtab.cc (Odr_violation_compare): Include the lineno in the
6754 (linenos_from_loc): New. Combine the canonical line for an
6755 address with its other lines.
6756 (True_if_intersect): New. Helper functor to make
6757 std::set_intersection a query.
6758 (detect_odr_violations): Compare sets of lines instead of just
6759 one line for each function. This became less deterministic, but
6760 has fewer false positives.
6761 * symtab.h: Declarations.
6762 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6763 mix an optimized and non-optimized object in the same binary
6764 (odr_violation2.so): Same.
6765 * testsuite/Makefile.in: Regenerate from Makefile.am.
6766 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6767 * testsuite/debug_msg.sh: Update line numbers and add
6769 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6770 non-optimized context.
6771 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6772 isn't inlined, and use OdrDerived in an optimized context.
6773 * testsuite/odr_header1.h: Defines OdrDerived, where
6774 optimization will change the
6775 first-instruction-in-the-destructor's file and line number.
6776 * testsuite/odr_header2.h: Defines OdrBase.
6778 2011-03-09 Ian Lance Taylor <iant@google.com>
6780 * fileread.cc (File_read::clear_views): Don't delete the whole
6783 2011-03-08 Ian Lance Taylor <iant@google.com>
6786 * fileread.cc: #include <climits>.
6787 (GOLD_IOV_MAX): Define.
6788 (File_read::read_multiple): Limit number of entries by iov_max.
6789 * fileread.h (class File_read): Always set max_readv_entries to
6792 2011-03-07 Ian Lance Taylor <iant@google.com>
6795 * options.h (class General_options): Add -dy and -dn.
6797 2011-03-02 Cary Coutant <ccoutant@google.com>
6799 * testsuite/script_test_9.t: Add TLS segment.
6801 2011-03-02 Simon Baldwin <simonb@google.com>
6803 * configure.ac: Add check for gnu_indirect_function support in
6804 the toolchain building binutils.
6805 * configure: Rebuild.
6807 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
6809 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6810 plugin only symbols.
6811 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6812 in plugin files as not needed in the symbol table.
6814 2011-02-11 Sriraman Tallam <tmsriram@google.com>
6816 * output.cc (Output_section::add_input_section): Delay fill
6817 generation for section ordering.
6819 2011-02-09 Ian Lance Taylor <iant@google.com>
6822 * object.h (class Sized_relobj): Remove clear_local_symbols.
6823 * reloc.cc (Sized_relobj::do_relocate): Don't call
6824 clear_local_symbols.
6826 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
6828 * plugin.cc (is_visible_from_outside): Return true for symbols
6831 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6833 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6836 2011-02-02 Sriraman Tallam <tmsriram@google.com>
6838 * icf.h (is_section_foldable_candidate): Change type of parameter
6840 * icf.cc (Icf::find_identical_sections): Change type of local variable
6841 section_name to be std::string.
6842 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6844 2011-01-25 Ian Lance Taylor <iant@google.com>
6846 * script.cc (script_add_extern): Rewrite to use
6847 add_symbol_reference.
6849 2011-01-25 Doug Kwan <dougkwan@google.com>
6851 * icf.cc (get_section_contents): Always lock section's object.
6853 2011-01-24 Ian Lance Taylor <iant@google.com>
6855 * options.h (class General_options): Accept
6856 --no-detect-odr-violations.
6858 2011-01-24 Ian Lance Taylor <iant@google.com>
6860 * version.cc (version_string): Bump to 1.11.
6862 2011-01-24 Ian Lance Taylor <iant@google.com>
6864 * plugin.cc (class Plugin_rescan): Define new class.
6865 (Plugin_manager::claim_file): Set any_claimed_.
6866 (Plugin_manager::save_archive): New function.
6867 (Plugin_manager::save_input_group): New function.
6868 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6870 (Plugin_manager::new_undefined_symbol): New function.
6871 (Plugin_manager::rescan): New function.
6872 (Plugin_manager::rescannable_defines): New function.
6873 (Plugin_manager::add_input_file): Set any_added_.
6874 * plugin.h (class Plugin_manager): define new fields rescannable_,
6875 undefined_symbols_, any_claimed_, and any_added_. Declare
6876 Plugin_rescan as friend. Declare new functions.
6877 (Plugin_manager::Rescannable): Define type.
6878 (Plugin_manager::Rescannable_list): Define type.
6879 (Plugin_manager::Undefined_symbol_list): Define type.
6880 (Plugin_manager::Plugin_manager): Initialize new fields.
6881 * archive.cc (Archive::defines_symbol): New function.
6882 (Add_archive_symbols::run): Pass archive to plugins if any.
6883 * archive.h (class Archive): Declare defines_symbol.
6884 * readsyms.cc (Input_group::~Input_group): New function.
6885 (Finish_group::run): Pass input_group to plugins if any.
6886 * readsyms.h (class Input_group): Declare destructor.
6887 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6890 2011-01-10 Ian Lance Taylor <iant@google.com>
6892 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6894 (Layout::set_segment_offsets): Reset increase_relro before calling
6895 set_section_addresses a second time.
6897 2011-01-04 Cary Coutant <ccoutant@google.com>
6899 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6900 sections before NOBITS sections.
6902 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6904 * version.cc (print_version): Update copyright to 2011.
6906 2010-12-23 Cary Coutant <ccoutant@google.com>
6908 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6909 of OS to this->add. Add OD parameter to second form of the function.
6911 2010-12-20 Ian Lance Taylor <iant@google.com>
6913 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6914 second of two consecutive entries with same offset.
6916 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6918 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6919 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6920 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6921 to avoid unneeded links against $(LDADD).
6922 * testsuite/Makefile.in: Regenerate.
6924 2010-12-15 Ian Lance Taylor <iant@google.com>
6927 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6928 for R_X86_64_32 and R_X86_64_PC32.
6929 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6930 ver_matching_def_pic.o.
6931 (ver_matching_def_pic.o): New target.
6933 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6935 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6936 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6937 Move definition before File_read::View member definitions.
6938 (File_read::View::~View): Initialize and hold lock before
6939 updating current_mapped_bytes.
6941 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6943 * dwarf_reader.cc: Remove outdated comment.
6944 * gold-threads.cc: Fix typo in error message.
6945 * archive.cc: Fix typos in comments.
6946 * archive.h: Likewise.
6947 * arm-reloc-property.cc: Likewise.
6948 * arm-reloc-property.h: Likewise.
6949 * arm-reloc.def: Likewise.
6951 * attributes.h: Likewise.
6952 * cref.cc: Likewise.
6953 * ehframe.cc: Likewise.
6954 * fileread.h: Likewise.
6956 * i386.cc: Likewise.
6958 * incremental.h: Likewise.
6959 * int_encoding.cc: Likewise.
6960 * layout.h: Likewise.
6961 * main.cc: Likewise.
6962 * merge.h: Likewise.
6963 * object.cc: Likewise.
6964 * object.h: Likewise.
6965 * options.cc: Likewise.
6966 * readsyms.cc: Likewise.
6967 * reduced_debug_output.cc: Likewise.
6968 * reloc.cc: Likewise.
6969 * script-sections.cc: Likewise.
6970 * sparc.cc: Likewise.
6971 * symtab.h: Likewise.
6972 * target-reloc.h: Likewise.
6973 * target.cc: Likewise.
6974 * target.h: Likewise.
6975 * timer.cc: Likewise.
6976 * timer.h: Likewise.
6977 * x86_64.cc: Likewise.
6979 2010-12-09 Cary Coutant <ccoutant@google.com>
6981 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6983 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6984 parameter; change all callers.
6985 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6986 * options.h (warn_execstack): New option.
6988 2010-12-07 Doug Kwan <dougkwan@google.com>
6990 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6991 like function call relocations.
6993 2010-12-07 Ian Lance Taylor <iant@google.com>
6995 * archive.cc (Archive::get_elf_object_for_member): Permit
6996 punconfigured to be NULL.
6997 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6998 (Archive::include_member): Pass NULL to get_elf_object_for_member
6999 if we searched for the archive and this is the first included
7002 2010-12-01 Ian Lance Taylor <iant@google.com>
7004 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7005 track_relocs_type_ field.
7006 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7007 Set track_relocs_type_.
7008 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7009 contents when using RELA relocs.
7010 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7012 * reloc.cc (Track_relocs::next_addend): New function.
7013 * reloc.h (class Track_relocs): Declare next_addend.
7015 2010-12-01 Ian Lance Taylor <iant@google.com>
7017 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7020 2010-12-01 Ian Lance Taylor <iant@google.com>
7022 * README: Update compilers known to work and fail.
7024 2010-11-23 Matthias Klose <doko@ubuntu.com>
7026 * configure.in: For --enable-gold, handle value `default' instead of
7027 `both*'. Always install ld as ld.bfd, install as ld if gold is
7029 * configure: Regenerate.
7031 2010-11-18 Doug Kwan <dougkwan@google.com>
7033 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7034 and right_alignment to be zero. Store result alignment only if it is
7035 greater than existing alignment.
7037 2010-11-16 Cary Coutant <ccoutant@google.com>
7040 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7041 Check for ".zdebug_line".
7043 2010-11-16 Doug Kwan <dougkwan@google.com>
7044 Cary Coutant <ccoutant@google.com>
7046 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7047 by reference; adjust all callers.
7048 * output.cc (Output_segment::set_section_addresses): Adjust references
7049 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7051 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7052 end at page boundary.
7054 2010-11-16 Cary Coutant <ccoutant@google.com>
7057 * layout.cc (Layout::choose_output_section): Transform names of
7058 compressed sections even when using a script with a SECTIONS clause.
7059 (Layout::output_section_name): Remove code to transform
7060 compressed debug section names.
7061 * output.cc (Output_section::add_input_section): Use uncompressed
7062 section size when tracking input sections.
7064 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7066 * symtab.h (Symbol::NON_PIC_REF): Remove.
7067 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7068 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7069 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7070 (Symbol::use_plt_offset): Take a flags argument and pass it
7071 directly to needs_dynamic_reloc. Restrict check for undefined
7072 weak symbols to function calls.
7073 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7074 (Target_arm::Scan::global): Use it.
7075 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7076 (Target_arm::Relocate::relocate): Likewise.
7077 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7078 parameter with an r_type parameter. Use get_reference_flags
7080 (Target_arm::Relocate::relocate): Update accordingly.
7081 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7082 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7083 (Target_i386::Scan::global): Likewise.
7084 (Target_i386::Relocate::relocate): Likewise.
7085 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7086 parameter with an r_type parameter. Use get_reference_flags
7088 (Target_i386::Relocate::relocate): Update accordingly.
7089 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7090 (Target_powerpc::Scan::global): Use it.
7091 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7092 (Target_powerpc::Relocate::relocate): Likewise.
7093 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7094 (Target_sparc::Scan::global): Use it.
7095 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7096 (Target_sparc::Relocate::relocate): Likewise.
7097 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7098 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7099 (Target_x86_64::Scan::global): Likewise.
7100 (Target_x86_64::Relocate::relocate): Likewise.
7102 2010-11-08 Doug Kwan <dougkwan@google.com>
7103 Cary Coutant <ccoutant@google.com>
7105 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7106 (Arm_exidx_merge_section::section_contents_): New data member.
7107 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7108 (Arm_input_section::~Arm_input_section): De-allocate memory.
7109 (Arm_input_section::original_contents_): New data member.
7110 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7111 in parameters instead of calling Object::section_contents without
7113 (Arm_output_section::group_section): New parameter TASK. Pass it
7114 to callees that need locking objects.
7115 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7116 to lock EXIDX input sections. Fix a formatting issue. Call
7117 Arm_exidx_merged_section::build_contents to create merged section
7119 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7120 to lock object of stub table owner.
7121 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7122 TEXT_SIZE to initialize data member TEXT_SIZE_.
7123 (Arm_exidx_input_section::addralign): Fix typo in comment.
7124 (Arm_exidx_input_section::text_size): New method.
7125 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7126 that require locking objects. Lock objects before scanning for stubs
7127 and updating local symbols.
7128 (Arm_input_section<big_endian>::init): Copy contents of original
7130 (Arm_input_section<big_endian>::do_write): Use saved contents of
7131 original input section instead of calling Object::section_contents
7133 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7134 size without calling Object::section_size().
7135 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7136 for size. Allocate a buffer for merged EXIDX entries.
7137 (Arm_exidx_merged_section::build_contents): New method.
7138 (Arm_exidx_merged_section::do_write): Move merge section contents
7139 building code to Arm_exidx_merged_section::build_contetns. Write
7140 out contetns in buffer instead of building it on the fly.
7141 (Arm_relobj::make_exidx_input_section): Also pass text section size
7142 to Arm_exidx_input_section constructor.
7143 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7144 (Arm_dynobj::do_read_symbols): Fix memory leak.
7145 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7146 * target.h: (class Task): Add forward declaration.
7147 (Target::relax): Add new parameter TASK and pass it to
7149 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7151 2010-11-05 Cary Coutant <ccoutant@google.com>
7154 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7155 object when reading from the file.
7156 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7158 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7159 when reading section contents.
7160 (get_section_contents): Likewise.
7161 (icf::find_identical_sections): Likewise.
7162 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7163 object when reading from the file.
7164 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7165 the object when doing deferred section layout.
7167 2010-11-03 Nick Clifton <nickc@redhat.com>
7170 * script.h (class Symbol_assignment: name): New member. Returns
7171 the name of the symbol.
7172 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7173 Returns true if the given symbol name is on the list of
7174 assignments wating to be processed.
7175 * archive.cc (should_incldue_member): If the symbol is undefined,
7176 check to see if it is on the list of symbols pending assignment.
7178 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7180 * script-sections.cc (Script_sections::find_memory_region): Check
7181 for a NULL output section pointer.
7183 2010-10-29 Doug Kwan <dougkwan@google.com>
7185 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7186 Output_section::add_relaxed_input_section.
7187 * output.cc (Output_section::add_relaxed_input_section): Add new
7188 arguments LAYOUT and NAME. Set section order index.
7189 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7190 Copy section order index.
7191 * output.h (Output_section::add_relaxed_input_section): Add new
7192 arguments LAYOUT and NAME.
7194 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7196 * testsuite/Makefile.am: Move gcctestdir/ld rule to
7197 NATIVE_OR_CROSS_LINKER.
7198 * testsuite/Makefile.in: Regenerate.
7200 2010-10-20 Doug Kwan <dougkwan@google.com>
7202 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7203 without SHF_LINK_ORDER flags.
7204 * layout.cc (Layout::choose_output_section): Do not filter
7205 SHF_LINK_ORDER flag in a relocatable link.
7207 2010-10-17 Cary Coutant <ccoutant@google.com>
7209 * output.h (Output_segment::set_section_addresses): Change function
7210 signature. Update all callers.
7211 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7213 (Output_segment::set_section_addresses): Align after last TLS
7214 section. Add padding before last relro section instead of after.
7216 2010-10-17 Doug Kwan <dougkwan@google.com>
7218 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7219 GOT output section to be writable.
7221 2010-10-14 Cary Coutant <ccoutant@google.com>
7223 * debug.h (DEBUG_INCREMENTAL): New flag.
7224 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7225 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7227 * incremental.cc (report_command_line): Ignore all forms of
7229 * layout.cc (Layout::Layout): Check parameters for incremental link
7231 * options.cc (General_options::parse_incremental): New function.
7232 (General_options::parse_no_incremental): New function.
7233 (General_options::parse_incremental_full): New function.
7234 (General_options::parse_incremental_update): New function.
7235 (General_options::incremental_mode_): New data member.
7236 (General_options::finalize): Check incremental_mode_.
7237 * options.h (General_options): Update help text for --incremental.
7238 Add --no-incremental, --incremental-full, --incremental-update.
7239 (General_options::Incremental_mode): New enum type.
7240 (General_options::incremental_mode): New function.
7241 (General_options::incremental_mode_): New data member.
7242 * parameters.cc (Parameters::incremental_mode_): New data member.
7243 (Parameters::set_options): Set incremental_mode_.
7244 (Parameters::set_incremental_full): New function.
7245 (Parameters::incremental): New function.
7246 (Parameters::incremental_update): New function.
7247 (set_parameters_incremental_full): New function.
7248 * parameters.h (Parameters::set_incremental_full): New function.
7249 (Parameters::incremental): New function.
7250 (Parameters::incremental_update): New function.
7251 (Parameters::incremental_mode_): New data member.
7252 (set_parameters_incremental_full): New function.
7253 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7254 incremental link mode.
7255 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7256 (Sized_relobj::do_relocate_sections): Likewise.
7257 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7259 * testsuite/Makefile.in: Regenerate.
7260 * testsuite/incremental_test.sh: Filter all forms of --incremental.
7262 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7264 * script-sections.h (class Script_sections): Make
7265 Sections_elements typedef public.
7266 * script-sections.cc (class Sort_output_sections): Add elements_
7267 field. Add constructor which sets it; change all callers.
7268 (Sort_output_sections::is_before): New function.
7269 (Sort_output_sections::operator()): Call is_before.
7270 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7272 * testsuite/script_test_10.sh: New test. Test script section
7274 * testsuite/script_test_10.t: Likewise.
7275 * testsuite/script_test_10.s: Likewise.
7276 * testsuite/Makefile.am: Wrap the cross linker tests and the
7277 common tests into NATIVE_OR_CROSS_LINKER.
7278 (check_SCRIPTS): Add script_test_10.sh.
7279 (check_DATA): Add script_test_10.stdout.
7280 (script_test_10.o, script_test_10): New targets.
7281 (script_test_10.stdout): New target.
7282 * configure, testsuite/Makefile.in: Regenerate.
7284 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7286 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7287 error for the deprecated relocations.
7288 (Target_arm::Scan::global): Likewise.
7289 (Target_arm::Relocate::relocate): Likewise.
7291 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7293 * fileread.cc (Input_file::find_file): Initialize *found_name
7294 and *namep when using the fallback search for case 4.
7296 2010-10-11 Cary Coutant <ccoutant@google.com>
7298 * options.h (class General_options): Redefine -z lazy as an alias for
7299 the negation of -z now.
7301 2010-10-11 Ian Lance Taylor <iant@google.com>
7303 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7306 2010-10-06 Nick Clifton <nickc@redhat.com>
7308 * script-sections.cc(class Memory_region): Remove
7309 current_lma_offset_ field. Rename current_vma_offset_ to
7310 current_offset_. Add last_section_ field.
7311 (Memory_region::get_current_vma_address): Rename to
7312 get_current_address.
7313 (Memory_region::get_current_lma_address): Delete.
7314 (Memory_region::increment_vma_offset): Rename to
7316 (Memory_region::increment_lma_offset): Delete.
7317 (Memory_region::attributes_compatible): New method. Returns
7318 true if the provided section is compatible with the region.
7319 (Memory_region::get_last_section): New method. Returns the last
7320 section to use the region.
7321 (Memory_region::set_last_section): New method. Stores the last
7322 section to use the region.
7323 (Script_sections::block_in_region): New method. Returns true if
7324 a block of memory is contained within a region.
7325 (Script_sections::find_memory_region): New method. Locates a
7326 memory region to be used to set a VMA or LMA address.
7327 (Output_section_definition::set_section_addresses): Add code to
7328 check for addresses set by memory regions.
7329 (Output_segment::set_section_addresses): Remove memory region
7331 (Script_sections::create_segment): Add a warning if a header
7332 segment is created outside of any region.
7333 * script-sections.h (class Script_sections): Add prototypes for
7334 find_memory_region and block_in_region methods.
7335 * testsuite/memory_test.s: Use .long instead of .word.
7336 * testsuite/memory_test.t: Add some more output sections.
7337 * testsuite/memory_test.sh: Update expected output.
7339 2010-10-02 Doug Kwan <dougkwan@google.com>
7341 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7342 defintion to symtab.h
7343 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7344 declaration to defintion.
7346 2010-10-01 Nick Clifton <nickc@redhat.com>
7348 * expression.cc (eval): Replace dummy argument with NULL.
7349 (eval_maybe_dot): Check for a NULL result section pointer.
7350 (Symbol_expression::value): Likewise.
7351 (Dot_expression::value): Likewise.
7352 (BINARY_EXPRESSION): Likewise.
7353 (Max_expression::value): Likewise.
7354 (Min_expression::value): Likewise.
7355 (Absolute_expression::value): Likewise.
7356 (Addr_expression::value_from_output_section): Likewise.
7357 (Loaddddr_expression::value_from_output_section): Likewise.
7358 (Segment_start_expression::value): Likewise.
7359 * script-sections.cc
7360 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7362 (Sections_elememt_dot_assignment::set_section_addresses):
7364 (Output_data_expression::do_write_to_buffer): Likewise.
7365 (Output_section_definition::finalize_symbols): Likewise.
7366 (Output_section_definition::set_section_addresses): Likewise.
7368 2010-09-30 Doug Kwan <dougkwan@google.com>
7370 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7372 2010-09-28 Sriraman Tallam <tmsriram@google.com>
7374 * target.h (Target::can_icf_inline_merge_sections): New virtual
7376 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7378 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7380 * icf.cc (get_section_contents): Inline merge sections only when
7383 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7385 * configure: Regenerate.
7387 2010-09-17 Ian Lance Taylor <iant@google.com>
7389 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
7390 * testsuite/Makefile.am (memory_test.o): New target.
7391 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7393 * testsuite/Makefile.in: Rebuild.
7395 2010-09-17 Doug Kwan <dougkwan@google.com>
7397 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7398 defintion if relocation uses GOT entries of the symbol.
7399 * testsuite/icf_safe_test.sh: Fix test.
7400 * testsuite/icf_safe_so_test.sh: Fix test.
7402 2010-09-16 Cary Coutant <ccoutant@google.com>
7404 * script_sections.cc (class Memory_region): Remove "NULL" from
7405 vector initializations.
7407 2010-09-15 Cary Coutant <ccoutant@google.com>
7409 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7410 Resolve forwarding symbols.
7412 2010-09-15 Doug Kwan <dougkwan@google.com>
7414 * gold/testsuite/script_test_3.t: Add ARM special sections.
7415 * gold/testsuite/script_test_4.t: Same.
7416 * gold/testsuite/script_test_5.t: Same.
7417 * gold/testsuite/script_test_6.t: Same.
7418 * gold/testsuite/script_test_7.t: Same.
7419 * gold/testsuite/script_test_7.t: Same.
7420 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7422 2010-09-14 Cary Coutant <ccoutant@google.com>
7424 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7425 (Target_x86_64::Relocate::relocate_tls): Replace check for
7426 saw_tls_block_reloc_ with test for executable section.
7428 2010-09-12 Cary Coutant <ccoutant@google.com>
7430 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7431 position-independent executables to shared libraries need dynamic
7433 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7434 position-independent executables.
7435 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7436 * testsuite/Makefile.in: Regenerate.
7438 2010-09-10 Nick Clifton <nickc@redhat.com>
7441 * testsuite/memory_test.t: Discard any sections that are not
7444 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7447 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7448 "This::" to work around a bug in gcc 4.2.
7450 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7452 2010-09-09 Rafael Espindola <espindola@google.com>
7454 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7455 sections with different PF_X flags in the same segment.
7456 (Layout::find_first_load_seg): Search all segments to find the first
7458 * options.h (rosegment): New.
7460 2010-09-08 Rafael Espindola <espindola@google.com>
7462 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
7464 2010-09-08 Doug Kwan <dougkwan@google.com>
7466 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7467 (Arm_relobj::do_relocate_sections): Add new parameter for output
7468 file to match the parent.
7469 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7470 of local symbols instead of input values. Update code to track
7471 changes in gold::relocate_section.
7472 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7473 (Sized_relobj::compute_final_local_value_internal): New methods.
7474 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7475 body into private version of Sized_relobj::compute_final_local_value.
7476 Call the inline method.
7477 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7478 merged symbol value if there is one.
7479 (Symbol_value::has_output_value): New method defintiion.
7480 (Sized_relobj::Compute_final_local_value_status): New enum type.
7481 (Sized_relobj::compute_final_local_value): New methods.
7482 (Sized_relobj::compute_final_local_value_internal): New methods.
7483 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7484 and arm_cortex_a8.sh.
7485 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7486 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7488 * Makefile.in: Regenerate.
7489 * testsuite/arm_bl_out_of_range.s: Update test.
7490 * testsuite/thumb_bl_out_of_range.s: Ditto.
7491 * testsuite/thumb_blx_out_of_range.s: Ditto.
7492 * testsuite/arm_branch_out_of_range.sh: New file.
7493 * testsuite/arm_cortex_a8.sh: Ditto.
7494 * testsuite/arm_cortex_a8_b.s: Ditto.
7495 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7496 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7497 * testsuite/arm_cortex_a8_bl.s: Ditto.
7498 * testsuite/arm_cortex_a8_blx.s: Ditto.
7499 * testsuite/arm_cortex_a8_local.s: Ditto.
7500 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7501 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7503 2010-09-08 Rafael Espindola <espindola@google.com>
7505 * Makefile.am (memory_test.stdout): Run readelf with -W.
7506 * Makefile.in: Regenerate.
7507 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7510 2010-09-08 Rafael Espindola <espindola@google.com>
7512 * script-sections.cc (Script_sections::add_memory_region): Convert
7513 field precision to int.
7514 * script.cc (script_set_section_region, script_set_section_region):
7515 Convert field precision to int.
7517 2010-09-08 Rafael Espindola <espindola@google.com>
7519 * arm.cc (do_finalize_sections): Create the __exidx_start and
7520 __exdix_end symbols even when the section is missing.
7522 2010-09-08 Nick Clifton <nickc@redhat.com>
7524 * README: Remove claim that MEMORY is not supported.
7525 * expression.cc (script_exp_function_origin)
7526 (script_exp_function_length): Move from here to ...
7527 * script.cc: ... here.
7528 (script_set_section_region, script_add_memory)
7529 (script_parse_memory_attr, script_include_directive): New
7531 * script-sections.cc
7532 (class Memory_region): New class.
7533 (class Output_section_definition): Add set_memory_region,
7534 set_section_vma, set_section_lma and get_section_name methods.
7535 (class Script_Sections): Add add_memory_region,
7536 find_memory_region, find_memory_region_origin,
7537 find_memory_region_length and set_memory_region methods.
7538 Have set_section_addresses method walk the list of set memory
7540 Extend the print methos to display memory regions.
7541 * script-sections.h: Add prototypes for new methods.
7542 Add enum for MEMORY region attributes.
7543 * yyscript.y: Add support for parsing MEMORY regions.
7544 * script-c.h: Add prototypes for new functions.
7545 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7546 * testsuite/Makefile.in: Regenerate.
7547 * testsuite/memory_test.sh: New script.
7548 * testsuite/memory_test.s: New assembler source file.
7549 * testsuite/memory_test.t: New linker script.
7551 2010-08-27 Doug Kwan <dougkwan@google.com>
7553 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7554 reference override an existing dynamic weak reference.
7555 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7556 * testsuite/Makefile.in: Regenerate.
7557 * testsuite/dyn_weak_ref.sh: New file.
7558 * testsuite/dyn_weak_ref_1.c: Ditto.
7559 * testsuite/dyn_weak_ref_2.c: Ditto.
7561 2010-08-27 Ian Lance Taylor <iant@google.com>
7563 * incremental.h (class Incremental_input_entry): Add virtual
7566 2010-08-27 Ian Lance Taylor <iant@google.com>
7568 * testsuite/start_lib_test_3.c: Mark t3 as used.
7570 2010-08-27 Nick Clifton <nickc@redhat.com>
7572 * options.cc (version_script): Fix small typo in previous
7575 2010-08-25 Nick Clifton <nickc@redhat.com>
7577 * archive.cc: Formatting fixes: Remove whitespace between
7578 typename and following asterisk. Remove whitespace between
7579 function name and opening parenthesis.
7580 * archive.h: Likewise.
7582 * attributes.cc: Likewise.
7583 * attributes.h: Likewise.
7584 * common.cc: Likewise.
7585 * copy-relocs.cc: Likewise.
7586 * dirsearch.h: Likewise.
7587 * dynobj.cc: Likewise.
7588 * ehframe.cc: Likewise.
7589 * ehframe.h: Likewise.
7590 * expression.cc: Likewise.
7591 * fileread.cc: Likewise.
7592 * fileread.h: Likewise.
7594 * gold-threads.cc: Likewise.
7595 * gold.cc: Likewise.
7596 * i386.cc: Likewise.
7598 * incremental-dump.cc: Likewise.
7599 * incremental.cc: Likewise.
7600 * layout.cc: Likewise.
7601 * layout.h: Likewise.
7602 * main.cc: Likewise.
7603 * merge.cc: Likewise.
7604 * merge.h: Likewise.
7605 * object.cc: Likewise.
7606 * object.h: Likewise.
7607 * options.cc: Likewise.
7608 * options.h: Likewise.
7609 * output.cc: Likewise.
7610 * output.h: Likewise.
7611 * plugin.cc: Likewise.
7612 * plugin.h: Likewise.
7613 * powerpc.cc: Likewise.
7614 * reloc.cc: Likewise.
7615 * script-c.h: Likewise.
7616 * script-sections.cc: Likewise.
7617 * script.cc: Likewise.
7618 * stringpool.cc: Likewise.
7619 * symtab.cc: Likewise.
7620 * symtab.h: Likewise.
7621 * target.cc: Likewise.
7622 * timer.cc: Likewise.
7623 * timer.h: Likewise.
7624 * version.cc: Likewise.
7625 * x86_64.cc: Likewise.
7627 2010-08-24 Nick Clifton <nickc@redhat.com>
7630 * layout.cc (segment_precedes): Sort segments by their physical
7631 addresses, if they have been set.
7633 2010-08-23 Cary Coutant <ccoutant@google.com>
7635 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7637 (Lib_group::include_member): Unlock object after deleting its
7639 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7642 2010-08-19 Neil Vachharajani <nvachhar@google.com>
7643 Cary Coutant <ccoutant@google.com>
7645 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7646 constructor, and set_blocker.
7647 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7649 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7650 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7651 * testsuite/Makefile.am (start_lib_test): New test case.
7652 * testsuite/Makefile.in: Regenerate.
7653 * testsuite/start_lib_test_main.c: New file.
7654 * testsuite/start_lib_test_1.c: New file.
7655 * testsuite/start_lib_test_2.c: New file.
7656 * testsuite/start_lib_test_3.c: New file.
7658 2010-08-19 Ian Lance Taylor <iant@google.com>
7660 * Makefile.in: Rebuild with automake 1.11.1.
7661 * aclocal.m4: Likewise.
7662 * testsuite/Makefile.in: Likewise.
7664 2010-08-19 Ian Lance Taylor <iant@google.com>
7667 * i386.cc (class Output_data_plt_i386): Update declarations.
7668 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7669 local_ifuncs_ fields.
7670 (Target_i386::do_plt_section_for_global): New function.
7671 (Target_i386::do_plt_section_for_local): New function.
7672 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7673 parameter; change all callers. Initialize global_ifuncs_ and
7674 local_ifuncs_. If doing a static link define __rel_iplt_start and
7676 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7677 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7678 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7680 (Target_i386::make_plt_section): New function, broken out of
7681 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7682 (Target_i386::make_plt_entry): Call make_plt_section.
7683 (Target_i386::make_local_ifunc_plt_entry): New function.
7684 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7685 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7686 R_386_IRELATIVE to switch.
7687 (Target_i386::Scan::global): Likewise.
7688 (Target_i386::Relocate::relocate): Likewise.
7689 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7691 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7692 (Target_x86_64::do_plt_section_for_global): New function.
7693 (Target_x86_64::do_plt_section_for_local): New function.
7694 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7695 parameter; change all callers. If doing a static link define
7696 __rela_iplt_start and __rela_iplt_end.
7697 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7698 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7699 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7701 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7702 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7704 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7705 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7706 R_X86_64_IRELATIVE to switch.
7707 (Target_x86_64::Scan::global): Likewise.
7708 (Target_x86_64::Relocate::relocate): Likewise.
7709 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7711 * target.h (class Target): Add plt_section_for_global and
7712 plt_section_for_local functions. Add do_plt_section_for_global
7713 and do_plt_section_for_local virtual functions.
7714 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7715 clarifying comments.
7716 (Symbol::use_plt_offset): Handle IFUNC symbol.
7717 * object.cc (Sized_relobj::Sized_relobj): Initialize
7719 (Sized_relobj::local_has_plt_offset): New function.
7720 (Sized_relobj::local_plt_offset): New function.
7721 (Sized_relobj::set_local_plt_offset): New function.
7722 (Sized_relobj::do_count): Handle IFUNC symbol.
7723 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7724 a bit away from input_shndx_ field. Add set_is_func_symbol and
7725 is_ifunc_symbol functions.
7726 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7727 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7728 local_plt_offsets_ field.
7729 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7730 * output.h (class Output_section_data): Add non-const
7731 output_section function.
7732 (class Output_data_got): Update declarations.
7733 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7734 Add use_plt_offset parameter to global and local constructors.
7735 Change all callers. Change local_sym_index_ field to 31 bits.
7736 Change GSYM_CODE and CONSTANT_CODE accordingly.
7737 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7738 doing a static link don't set sh_link field.
7739 (Output_data_got::Got_entry::write): Use PLT offset if
7741 (Output_data_got::add_global_plt): New function.
7742 (Output_data_got::add_local_plt): New function.
7743 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7744 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7745 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7746 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7747 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7749 * testsuite/ifunc-sel.h: New file.
7750 * testsuite/ifuncmain1.c: New file.
7751 * testsuite/ifuncmain1vis.c: New file.
7752 * testsuite/ifuncmod1.c: New file.
7753 * testsuite/ifuncdep2.c: New file.
7754 * testsuite/ifuncmain2.c: New file.
7755 * testsuite/ifuncmain3.c: New file.
7756 * testsuite/ifuncmod3.c: New file.
7757 * testsuite/ifuncmain4.c: New file.
7758 * testsuite/ifuncmain5.c: New file.
7759 * testsuite/ifuncmod5.c: New file.
7760 * testsuite/ifuncmain6pie.c: New file.
7761 * testsuite/ifuncmod6.c: New file.
7762 * testsuite/ifuncmain7.c: New file.
7763 * configure, testsuite/Makefile.in: Rebuild.
7765 2010-08-18 Ian Lance Taylor <iant@google.com>
7768 (Output_section_incremental_inputs::write_input_files): Add cast
7769 to avoid signed/unsigned comparison warning.
7770 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7772 2010-08-12 Cary Coutant <ccoutant@google.com>
7774 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7776 2010-08-13 Ian Lance Taylor <iant@google.com>
7778 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7780 2010-08-12 Cary Coutant <ccoutant@google.com>
7781 Doug Kwan <dougkwan@google.com>
7783 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7784 defintion overrides non-weak undef, remember that the original undef
7786 * symtab.cc (Symbol_table::sized_write_global): For undef without
7787 an original weak binding, set binding to global in output.
7788 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7789 * testsuite/Makefile.in: Regenerate.
7790 * testsuite/strong_ref_weak_def.sh: New file.
7791 * testsuite/strong_ref_weak_def_1.c: Ditto.
7792 * testsuite/strong_ref_weak_def_2.c: Ditto.
7794 2010-08-12 Cary Coutant <ccoutant@google.com>
7796 * testsuite/incremental_test.sh: Rewrite.
7797 * testsuite/incremental_test_1.c: Rewrite.
7798 * testsuite/incremental_test_2.c: Rewrite.
7800 2010-08-12 Cary Coutant <ccoutant@google.com>
7802 * arm.cc (Target_arm::got_size): Add const.
7803 (Target_arm::got_entry_count): New function.
7804 (Target_arm::plt_entry_count): New function.
7805 (Target_arm::first_plt_entry_offset): New function.
7806 (Target_arm::plt_entry_size): New function.
7807 (Output_data_plt_arm::entry_count): New function.
7808 (Output_data_plt_arm::first_plt_entry_offset): New function.
7809 (Output_data_plt_arm::get_plt_entry_size): New function.
7810 * i386.cc (Target_i386::got_size): Add const.
7811 (Target_i386::got_entry_count): New function.
7812 (Target_i386::plt_entry_count): New function.
7813 (Target_i386::first_plt_entry_offset): New function.
7814 (Target_i386::plt_entry_size): New function.
7815 (Output_data_plt_i386::entry_count): New function.
7816 (Output_data_plt_i386::first_plt_entry_offset): New function.
7817 (Output_data_plt_i386::get_plt_entry_size): New function.
7818 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7819 find_incremental_inputs_sections. Dump incremental_got_plt section.
7820 * incremental.cc: Include target.h.
7821 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7822 parameter. Adjust all callers. Find incremental_got_plt section.
7823 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7825 (Output_section_incremental_inputs::set_final_data_size): Calculate
7826 size of incremental_got_plt section.
7827 (Output_section_incremental_inputs::do_write): Write the
7828 incremental_got_plt section.
7829 (Got_plt_view_info): New struct.
7830 (Local_got_offset_visitor): New class.
7831 (Global_got_offset_visitor): New class.
7832 (Global_symbol_visitor_got_plt): New class.
7833 (Output_section_incremental_inputs::write_got_plt): New function.
7834 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7835 Add parameter. Adjust all callers.
7836 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7837 (Incremental_inputs::got_plt_section): New function.
7838 (Incremental_inputs::got_plt_section_): New data member.
7839 (Incremental_got_plt_reader): New class.
7840 * layout.cc (Layout::create_incremental_info_sections): Add the
7841 incremental_got_plt section.
7842 * object.h (Got_offset_list::get_list): New function.
7843 (Got offset_list::for_all_got_offsets): New function.
7844 (Sized_relobj::local_got_offset_list): New function.
7845 * powerpc.cc (Target_powerpc::got_size): Add const.
7846 (Target_powerpc::got_entry_count): New function.
7847 (Target_powerpc::plt_entry_count): New function.
7848 (Target_powerpc::first_plt_entry_offset): New function.
7849 (Target_powerpc::plt_entry_size): New function.
7850 (Output_data_plt_powerpc::entry_count): New function.
7851 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7852 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7853 * sparc.cc (Target_sparc::got_size): Add const.
7854 (Target_sparc::got_entry_count): New function.
7855 (Target_sparc::plt_entry_count): New function.
7856 (Target_sparc::first_plt_entry_offset): New function.
7857 (Target_sparc::plt_entry_size): New function.
7858 (Output_data_plt_sparc::entry_count): New function.
7859 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7860 (Output_data_plt_sparc::get_plt_entry_size): New function.
7861 * symtab.h (Symbol::got_offset_list): New function.
7862 (Symbol_table::for_all_symbols): New function.
7863 * target.h (Sized_target::got_entry_count): New function.
7864 (Sized_target::plt_entry_count): New function.
7865 (Sized_target::plt_entry_size): New function.
7866 * x86_64.cc (Target_x86_64::got_size): Add const.
7867 (Target_x86_64::got_entry_count): New function.
7868 (Target_x86_64::plt_entry_count): New function.
7869 (Target_x86_64::first_plt_entry_offset): New function.
7870 (Target_x86_64::plt_entry_size): New function.
7871 (Output_data_plt_x86_64::entry_count): New function.
7872 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7873 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7875 2010-08-12 Cary Coutant <ccoutant@google.com>
7877 * archive.cc: Include incremental.h.
7878 (Archive::Archive): Initialize incremental_info_.
7879 (Archive::include_member): Record archive members in incremental info.
7880 (Add_archive_symbols::run): Record begin and end of an archive in
7882 (Lib_group::include_member): Record objects in incremental info.
7883 * archive.h (Incremental_archive_entry): Forward declaration.
7884 (Archive::set_incremental_info): New member function.
7885 (Archive::incremental_info): New member function.
7886 (Archive::Unused_symbol_iterator): New class.
7887 (Archive::unused_symbols_begin): New member function.
7888 (Archive::unused_symbols_end): New member function.
7889 (Archive::incremental_info_): New data member.
7890 * incremental-dump.cc (find_input_containing_global): New function.
7891 (dump_incremental_inputs): Dump new incremental info sections.
7892 * incremental.cc: Include symtab.h.
7893 (Output_section_incremental_inputs): New class.
7894 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7895 new incremental info sections.
7896 (Sized_incremental_binary::do_check_inputs): Likewise.
7897 (Incremental_inputs::report_archive): Remove.
7898 (Incremental_inputs::report_archive_begin): New function.
7899 (Incremental_inputs::report_archive_end): New function.
7900 (Incremental_inputs::report_object): New function.
7901 (Incremental_inputs::finalize_inputs): Remove.
7902 (Incremental_inputs::report_input_section): New function.
7903 (Incremental_inputs::report_script): Rewrite.
7904 (Incremental_inputs::finalize): Do nothing but finalize string table.
7905 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7906 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7907 (Incremental_inputs::create_data_sections): New function.
7908 (Incremental_inputs::relocs_entsize): New function.
7909 (Output_section_incremental_inputs::set_final_data_size): New function.
7910 (Output_section_incremental_inputs::do_write): New function.
7911 (Output_section_incremental_inputs::write_header): New function.
7912 (Output_section_incremental_inputs::write_input_files): New function.
7913 (Output_section_incremental_inputs::write_info_blocks): New function.
7914 (Output_section_incremental_inputs::write_symtab): New function.
7915 * incremental.h (Incremental_script_entry): Forward declaration.
7916 (Incremental_object_entry): Forward declaration.
7917 (Incremental_archive_entry): Forward declaration.
7918 (Incremental_inputs): Forward declaration.
7919 (Incremental_inputs_header_data): Remove.
7920 (Incremental_inputs_header): Remove.
7921 (Incremental_inputs_header_write): Remove.
7922 (Incremental_inputs_entry_data): Remove.
7923 (Incremental_inputs_entry): Remove.
7924 (Incremental_inputs_entry_write): Remove.
7925 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7926 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7927 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7928 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7930 (Incremental_input_entry): New class.
7931 (Incremental_script_entry): New class.
7932 (Incremental_object_entry): New class.
7933 (Incremental_archive_entry): New class.
7934 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7935 (Incremental_inputs::report_inputs): Remove.
7936 (Incremental_inputs::report_archive): Remove.
7937 (Incremental_inputs::report_archive_begin): New function.
7938 (Incremental_inputs::report_archive_end): New function.
7939 (Incremental_inputs::report_object): Change prototype.
7940 (Incremental_inputs::report_input_section): New function.
7941 (Incremental_inputs::report_script): Change prototype.
7942 (Incremental_inputs::get_reloc_count): New function.
7943 (Incremental_inputs::set_reloc_count): New function.
7944 (Incremental_inputs::create_data_sections): New function.
7945 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7946 (Incremental_inputs::inputs_section): New function.
7947 (Incremental_inputs::symtab_section): New function.
7948 (Incremental_inputs::relocs_section): New function.
7949 (Incremental_inputs::get_stringpool): Add const.
7950 (Incremental_inputs::command_line): Add const.
7951 (Incremental_inputs::inputs): Remove.
7952 (Incremental_inputs::command_line_key): New function.
7953 (Incremental_inputs::input_file_count): New function.
7954 (Incremental_inputs::input_files): New function.
7955 (Incremental_inputs::relocs_entsize): New function.
7956 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7957 (Incremental_inputs::finalize_inputs): Remove.
7958 (Incremental_inputs::Input_info): Remove.
7959 (Incremental_inputs::lock_): Remove.
7960 (Incremental_inputs::inputs_): Change type.
7961 (Incremental_inputs::inputs_map_): Remove.
7962 (Incremental_inputs::current_object_entry_): New data member.
7963 (Incremental_inputs::inputs_section_): New data member.
7964 (Incremental_inputs::symtab_section_): New data member.
7965 (Incremental_inputs::relocs_section_): New data member.
7966 (Incremental_inputs::reloc_count_): New data member.
7967 (Incremental_inputs_reader): New class.
7968 (Incremental_symtab_reader): New class.
7969 (Incremental_relocs_reader): New class.
7970 * layout.cc (Layout::finalize): Move finalization of incremental info
7971 and creation of incremental info sections to follow finalization of
7972 symbol table. Set offsets for postprocessing sections.
7973 (Layout::create_incremental_info_sections): Call
7974 Incremental_inputs::create_data_sections. Add incremental symtab
7975 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7976 sections to layout after input sections.
7977 * layout.h (struct Timespec): Forward declaration.
7978 (Layout::incremental_inputs): Add const.
7979 (Layout::create_incremental_info_sections): Add parameter.
7980 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7981 * object.cc: Include incremental.h.
7982 (Relobj::finalize_incremental_relocs): New function.
7983 (Sized_relobj::do_layout): Record input sections in incremental info.
7984 * object.h (Object::output_section): New function.
7985 (Object::output_section_offset): Moved from Relobj.
7986 (Object::get_incremental_reloc_base): New function.
7987 (Object::get_incremental_reloc_count): New function.
7988 (Object::do_output_section): New function.
7989 (Object::do_output_section_offset): Moved from Relobj.
7990 (Object::do_get_incremental_reloc_base): New function.
7991 (Object::do_get_incremental_reloc_count): New function.
7992 (Object::Object): Initialize new data members.
7993 (Relobj::output_section): Renamed do_output_section and moved to
7995 (Relobj::output_section_offset): Moved to Object.
7996 (Relobj::do_get_incremental_reloc_base): New function.
7997 (Relobj::do_get_incremental_reloc_count): New function.
7998 (Relobj::allocate_incremental_reloc_counts): New function.
7999 (Relobj::count_incremental_reloc): New function.
8000 (Relobj::finalize_incremental_relocs): New function.
8001 (Relobj::next_incremental_reloc_index): New function.
8002 (Relobj::reloc_counts_): New data member.
8003 (Relobj::reloc_bases_): New data member.
8004 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8005 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8006 (Sized_relobj::incremental_relocs_scan): New function.
8007 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8008 (Sized_relobj::incremental_relocs_write): New function.
8009 (Sized_relobj::incremental_relocs_write_reltype): New function.
8010 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8012 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8013 archives and object files elsewhere.
8014 (Add_symbols::run): Report object files here.
8015 (Finish_group::run): Report end of archive at end of group.
8016 * reloc.cc: Include layout.h, incremental.h.
8017 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8018 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8019 (Sized_relobj::incremental_relocs_scan): New function.
8020 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8021 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8022 (Sized_relobj::incremental_relocs_write): New function.
8023 (Sized_relobj::incremental_relocs_write_reltype): New function.
8024 * script.cc (read_input_script): Rewrite test for incremental link.
8025 Change call to Incremental_inputs::report_script.
8026 * symtab.h (Symbol_table::first_global_index): New function.
8027 (Symbol_table::output_count): New function.
8029 2010-08-12 Doug Kwan <dougkwan@google.com>
8031 * arm.cc (Target_arm::merge_object_attributes): Check command line
8032 options --no-wchar-size-warning and --no-enum-size-warning.
8033 * options.h (General_options): Add ld-compatible options
8034 --no-enum-size-warning and --no-wchar-size-warning.
8036 2010-08-04 Ian Lance Taylor <iant@google.com>
8038 * x86_64.cc (Target_x86_64::Scan::local): Use
8039 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8040 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8041 (Target_x86_64::Scan::global): Likewise.
8042 (Target_x86_64::Relocate::relocate): Likewise.
8043 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8046 2010-08-03 Cary Coutant <ccoutant@google.com>
8048 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8049 to reserve space in merged_strings vector. Keep total input size
8051 (Output_merge_string::do_print_merge_stats): Print total input size.
8052 * merge.h (Output_merge_string): Add input_size_ field.
8053 * stringpool.cc (Stringpool_template::string_length): Move
8054 implementations out of Stringpool_template class and place in
8056 * stringpool.h (string_length): Move out of Stringpool_template.
8058 2010-08-03 Ian Lance Taylor <iant@google.com>
8061 * layout.cc (relaxation_loop_body): If address of load segment is
8062 set, adjust address to include headers if possible.
8064 2010-08-03 Ian Lance Taylor <iant@google.com>
8066 * version.cc (version_string): Bump to 1.10.
8068 2010-08-03 Ian Lance Taylor <iant@google.com>
8071 * layout.h (enum Output_section_order): Define.
8072 (class Layout): Update declarations.
8073 * layout.cc (Layout::get_output_section): Add order parameter.
8074 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8075 is_first_non_relro parameters. Change all callers.
8076 (Layout::choose_output_section): Likewise.
8077 (Layout::add_output_section_data): Likewise.
8078 (Layout::make_output_section): Likewise. Set order.
8079 (Layout::default_section_order): New function.
8080 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8081 * output.cc (Output_section::Output_section): Initialize order_.
8082 Don't initialize deleted fields.
8083 (Output_segment::Output_segment): Don't initialize deleted
8085 (Output_segment::add_output_section_to_load): New function
8086 replacing add_output_section. Change all callers to call this or
8087 add_output_section_to_nonload.
8088 (Output_segment::add_output_section_to_nonload): New function.
8089 (Output_segment::remove_output_section): Rewrite.
8090 (Output_segment::add_initial_output_data): Likewise.
8091 (Output_segment::has_any_data_sections): Likewise.
8092 (Output_segment::is_first_section_relro): Likewise.
8093 (Output_segment::maximum_alignment): Likewise.
8094 (Output_segment::has_dynamic_reloc): New function replacing
8095 dynamic_reloc_count. Change all callers.
8096 (Output_segment::has_dynamic_reloc_list): New function replacing
8097 dynamic_reloc_count_list. Change all callers.
8098 (Output_segment::set_section_addresses): Rewrite.
8099 (Output_segment::set_offset): Rewrite.
8100 (Output_segment::find_first_and_last_list): Remove.
8101 (Output_segment::set_tls_offsets): Rewrite.
8102 (Output_segment::first_section_load_address): Likewise.
8103 (Output_segment::output_section_count): Likewise.
8104 (Output_segment::section_with_lowest_load_address): Likewise.
8105 (Output_segment::write_section_headers): Likewise.
8106 (Output_segment::print_sections_to_map): Likewise.
8107 * output.h (class Output_data): Remove dynamic_reloc_count_
8108 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8109 (Output_data::add_dynamic_reloc): Rewrite.
8110 (Output_data::has_dynamic_reloc): New function.
8111 (Output_data::dynamic_reloc_count): Remove.
8112 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8113 is_last_relro_, is_first_non_relro_, is_interp_,
8114 is_dynamic_linker_section_ fields. Add order and set_order
8115 functions. Remove is_relro_local, set_is_relro_local,
8116 is_last_relro, set_is_last_relro, is_first_non_relro,
8117 set_is_first_non_relro functions, is_interp, set_is_interp,
8118 is_dynamic_linker_section, and set_is_dynamic_linker_section
8120 (class Output_segment): Change Output_data_list from std::list to
8121 std:;vector. Add output_lists_ field. Remove output_data_ and
8122 output_bss_ fields. Update declarations.
8124 2010-08-02 Ian Lance Taylor <iant@google.com>
8126 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8127 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8128 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8130 2010-08-02 Ian Lance Taylor <iant@google.com>
8133 * script.cc (Script_options::Script_options): Initialize
8134 symbol_definitions_ and symbol_references_.
8135 (Script_options::add_symbol_assignment): Update
8136 symbol_definitions_ and symbol_references_.
8137 (Script_options::add_symbol_reference): New function.
8138 (script_symbol): New function.
8139 * script.h (class Script_options): Add symbol_definitions_ and
8140 symbol_references_ fields.
8141 (Script_options::referenced_const_iterator): New type.
8142 (Script_options::referenced_begin): New function.
8143 (Script_options::referenced_end): New function.
8144 (Script_options::is_referenced): New function.
8145 (Script_options::any_unreferenced): New function.
8146 * script-c.h (script_symbol): Declare.
8147 * yyscript.y (exp): Call script_symbol.
8148 * symtab.cc: Include "script.h".
8149 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8150 Change all callers. Check symbols referenced by scripts.
8151 (Symbol_table::add_undefined_symbols_from_command_line): Add
8152 layout parameter. Change all callers.
8153 (Symbol_table::do_add_undefined_symbols_from_command_line):
8154 Likewise. Break out loop body. Check symbols referenced by
8156 (Symbol_table::add_undefined_symbol_from_command_line): New
8157 function broken out of
8158 do_add_undefined_symbols_from_command_line.
8159 * symtab.h (class Symbol_table): Update declarations.
8160 * archive.cc: Include "layout.h".
8161 (Archive::should_include_member): Add layout parameter. Change
8162 all callers. Check for symbol mentioned in expression.
8163 * archive.h (class Archive): Update declaration.
8164 * object.cc (Sized_relobj::do_should_include_member): Add layout
8166 * object.h (Object::should_include_member): Add layout parameter.
8168 (Object::do_should_include_member): Add layout parameter.
8169 (class Sized_relobj): Update declaration.
8170 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8172 * dynobj.h (class Sized_dynobj): Update declaration.
8173 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8175 * plugin.h (class Sized_pluginobj): Update declaration.
8177 2010-08-02 Ian Lance Taylor <iant@google.com>
8180 * output.cc (Output_segment::set_offset): Search for the first and
8181 last sections rather than assuming that the list is in order.
8182 (Output_segment::find_first_and_last_list): New function.
8183 * output.h (class Output_segment): Update declarations.
8184 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8185 (relro_strip_test_SOURCES): New variable.
8186 (relro_strip_test_DEPENDENCIES): New variable.
8187 (relro_strip_test_LDFLAGS): New variable.
8188 (relro_strip_test_LDADD): New variable.
8189 (relro_strip_test.so): New target.
8191 2010-08-02 Ian Lance Taylor <iant@google.com>
8193 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8194 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8195 (Target_i386::got_tlsdesc_section): New function.
8196 (Target_i386::got_section): Create space for GOT entries for
8197 TLSDESC relocations.
8198 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8200 (Target_i386::Scan::global): Likewise.
8201 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8203 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8204 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8205 (Target_x86_64::got_tlsdesc_section): New function.
8206 (Target_x86_64::got_section): Create space for GOT entries for
8207 TLSDESC relocations.
8208 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8210 (Target_x86_64::Scan::global): Likewise.
8211 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8214 2010-08-02 Ian Lance Taylor <iant@google.com>
8216 * testsuite/final_layout.sh: Use dc to convert from hex to
8219 2010-07-29 Sriraman Tallam <tmsriram@google.com>
8221 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8222 paramter to the call to gold::gc_process_relocs.
8223 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8224 paramter to the call to gold::gc_process_relocs.
8225 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8226 parameter to the call to gold::gc_process_relocs.
8227 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8228 template parameter to the call to gold::gc_process_relocs.
8229 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8230 paramter to the call to gold::gc_process_relocs.
8231 * gc.h (get_embedded_addend_size): New function.
8232 (gc_process_relocs): Save the size of the reloc for use by ICF.
8233 * icf.cc (get_section_contents): Get the addend from the text section
8234 for SHT_REL relocation sections.
8235 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8236 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8237 * int_encoding.h (read_from_pointer): New overloaded function.
8238 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8239 * testsuite/icf_sht_rel_addend_test.sh: New file.
8240 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8241 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8243 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8245 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8246 * Makefile.in: Regenerate.
8247 * testsuite/Makefile.in: Regenerate.
8249 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8251 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8252 * gold/testsuite/debug_msg.cc: Likewise.
8253 * gold/testsuite/odr_violation1.cc
8254 * gold/testsuite/odr_violation2.cc
8256 2010-07-21 Cary Coutant <ccoutant@google.com>
8258 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8259 string, and length fields.
8260 (Output_merge_string::Merged_strings_list): New type.
8261 (Output_merge_string::Merged_strings_lists): New typedef.
8262 (Output_merge_string): Replace merged_strings_ with
8263 merged_strings_lists_.
8264 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8265 Merged_strings_list per input object and section. Don't store pointer
8266 to the string. Don't store length with each merged string entry.
8267 (Output_merge_string::finalize_merged_data): Loop over list of merged
8268 strings lists. Recompute length of each merged string.
8270 2010-07-15 Cary Coutant <ccoutant@google.com>
8272 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8275 2010-07-14 Ian Lance Taylor <iant@google.com>
8277 * descriptors.cc (Descriptors::open): Report correct name in error
8280 2010-07-13 Doug Kwan <dougkwan@google.com>
8282 * arm.cc (Arm_input_section::Arm_input_section): For a
8283 SHT_ARM_EXIDX section, always keeps the input sections.
8284 (Arm_input_section::set_exidx_section_link): New method.
8285 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8286 has_errors_ to false.
8287 (Arm_exidx_input_section::has_errors,
8288 Arm_exidx_input_section::set_has_errors): New methods.
8289 (Arm_exidx_input_section::has_errors_): New data member.
8290 (Arm_relobj::get_exidx_shndx_list): New method.
8291 (Arm_output_section::append_text_sections_to_list): Do not skip
8292 section without SHF_EXECINSTR.
8293 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8295 (Arm_relobj::make_exidx_input_section): Add new parameter for text
8296 section header. Make error messages more verbose. Check for
8297 a non-executable section linked to an EXIDX section.
8298 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8299 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8300 check that there is no deferred EXIDX section if we exit early.
8301 Instead of not making an EXIDX section in case of an error, make one
8302 and set the has_errors flag of it.
8303 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8304 in a relocatable link.
8305 (Target_arm::do_relax): Look for the EXIDX output section instead of
8306 assuming that it is called .ARM.exidx.
8307 (Target_arm::fix_exidx_coverage): Add a new parameter for input
8308 section list. Do not check for SHF_EXECINSTR section flags but
8309 skip any input section with errors.
8310 * output.cc (Output_section::Output_section): Initialize
8311 always_keeps_input_sections_ to false.
8312 (Output_section::add_input_section): Check for
8313 always_keeps_input_sections_.
8314 * output.h (Output_section::always_keeps_input_sections,
8315 Output_section::set_always_keeps_input_sections): New methods.
8316 (Output_section::always_keeps_input_sections): New data member.
8318 2010-07-13 Rafael Espindola <espindola@google.com>
8320 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8321 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8323 2010-07-13 Philip Herron <herron.philip@googlemail.com>
8324 Ian Lance Taylor <iant@google.com>
8326 * output.h (Output_section_lookup_maps::add_merge_section):
8327 Correct check of whether value was inserted.
8328 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8329 (Output_section_lookup_maps::add_relaxed_input_section):
8331 * arm.cc (Target_arm::got_section): Remove used local os.
8332 * i386.cc (Target_i386::got_section): Likewise.
8333 * x86_64.cc (Target_x86_64::got_section): Likewise.
8334 * sparc.cc (Target_sparc::got_section): Likewise.
8335 (Target_sparc::relocate): Remove unused local have_got_offset.
8336 * powerpc.cc (Target_powerpc::relocate): Likewise.
8338 2010-07-13 Ian Lance Taylor <iant@google.com>
8340 * compressed_output.cc (zlib_decompress): Fix signature in
8343 * archive.cc (Archive::include_member): Unlock an external member
8344 of a thin archive. Don't bother to delete an object we know is
8347 2010-07-12 Cary Coutant <ccoutant@google.com>
8349 * compressed_output.cc (zlib_decompress): New function.
8350 (get_uncompressed_size): New function.
8351 (decompress_input_section): New function.
8352 * compressed_output.h (get_uncompressed_size): New function.
8353 (decompress_input_section): New function.
8354 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8355 Handle compressed debug sections.
8356 * layout.cc (is_compressed_debug_section): New function.
8357 (Layout::output_section_name): Map compressed section names to
8359 * layout.h (is_compressed_debug_section): New function.
8360 (is_debug_info_section): Recognize compressed debug sections.
8361 * merge.cc: Include compressed_output.h.
8362 (Output_merge_data::do_add_input_section): Handle compressed
8364 (Output_merge_string::do_add_input_section): Handle compressed
8366 * object.cc: Include compressed_output.h.
8367 (Sized_relobj::Sized_relobj): Initialize new data members.
8368 (build_compressed_section_map): New function.
8369 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8370 * object.h (Object::section_is_compressed): New method.
8371 (Object::do_section_is_compressed): New method.
8372 (Sized_relobj::Compressed_section_map): New type.
8373 (Sized_relobj::do_section_is_compressed): New method.
8374 (Sized_relobj::compressed_sections_): New data member.
8375 * output.cc (Output_section::add_input_section): Handle compressed
8377 * reloc.cc: Include compressed_output.h.
8378 (Sized_relobj::write_sections): Handle compressed debug sections.
8380 2010-07-08 Cary Coutant <ccoutant@google.com>
8382 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8383 weak when resolving to a dynamic def.
8384 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8385 for weak undef/dynamic def cases. Adjust callers.
8386 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8387 undef_binding_weak_.
8388 (Symbol_table::sized_write_globals): Adjust symbol binding.
8389 (Symbol_table::sized_write_symbol): Add binding parameter.
8390 * symtab.h (Symbol::set_undef_binding): New method.
8391 (Symbol::is_undef_binding_weak): New method.
8392 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8393 (Symbol_table::should_override): Add new parameter.
8394 (Symbol_table::sized_write_symbol): Add new parameter.
8396 * testsuite/weak_undef_file1.cc: Add new test case.
8397 * testsuite/weak_undef_file2.cc: Fix header comment.
8398 * testsuite/weak_undef_test.cc: Add new test case.
8400 2010-06-29 Doug Kwan <dougkwan@google.com>
8402 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8403 Initialize USE_SYMBOL_.
8404 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8406 (Arm_reloc_property::uses_symbol_): New data member declaration.
8407 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8408 uses symbol value and symbol is undefined but not weakly undefined.
8410 2010-06-28 Rafael Espindola <espindola@google.com>
8412 * plugin.cc (Plugin::load): Use dlerror.
8414 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8416 * symtab.cc (detect_odr_violations): When reporting an ODR
8417 violation, report an object where the symbol is defined.
8419 2010-06-25 Doug Kwan <dougkwan@google.com>
8421 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8422 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8424 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8425 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8426 target hook to detect function points.
8427 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8428 * icf.h (Icf::check_section_for_function_pointers): Change type of
8429 parameter SECTION_NAME to const reference to std::string. Use
8430 target hook to determine if section may have unsafe pointers.
8431 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8434 2010-06-21 Rafael Espindola <espindola@google.com>
8436 * fileread.cc (Input_file::find_fie): New
8437 (Input_file::open): Use Input_file::find_fie.
8438 * fileread.h (Input_file::find_fie): New
8439 * plugin.cc (set_extra_library_path): New.
8440 (Plugin::load): Add set_extra_library_path to the transfer vector.
8441 (Plugin_manager::set_extra_library_path): New.
8442 (Plugin_manager::add_input_file): Use the extra search path if set.
8443 (set_extra_library_path(): New.
8444 * plugin.h (Plugin_manager): Add set_extra_library_path and
8447 2010-06-19 Cary Coutant <ccoutant@google.com>
8449 * layout.cc (gdb_sections): Add .debug_types.
8450 (lines_only_debug_sections): Likewise.
8452 2010-06-18 Rafael Espindola <espindola@google.com>
8454 * plugin.cc (add_input_file,add_input_library)
8455 (Plugin_manager::add_input_file): Make filename arguments const.
8456 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8459 2010-06-16 Doug Kwan <dougkwan@google.com>
8461 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8462 .ARM.attributes section if we have not merged any input
8463 attributes sections.
8465 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8467 * arm.cc: Allow combining objects with no EABI version
8470 2010-06-15 Rafael Espindola <espindola@google.com>
8472 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8474 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8476 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8477 (struct iovec): Correct !HAVE_READV definition.
8479 2010-06-10 Cary Coutant <ccoutant@google.com>
8481 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8482 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8484 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8487 * symtab.h (Symbol::is_placeholder): New member function.
8488 * target-reloc.h (relocate_section): Check for placeholder symbols.
8490 * testsuite/Makefile.am (plugin_test_8): New test.
8491 (plugin_test_9): New test.
8492 * testsuite/Makefile.in: Regenerate.
8494 2010-06-09 Nick Clifton <nickc@redhat.com>
8496 * yyscript.y (input_list_element): Allow strings prefixed with
8497 the '-' character. Treat these as libraries.
8498 * script.cc (script_add_library): New function. Adds a library
8499 specified by "-l<name>" found in an input script.
8500 * script-c.h: Add prototype for script_add_library.
8502 2010-06-07 Doug Kwan <dougkwan@google.com>
8504 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8505 Restrict stub-group size to be within long conditional branch
8506 range when working around cortex-A8 erratum.
8508 2010-06-07 Damien Diederen <dd@crosstwine.com>
8510 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8513 2010-06-03 Sriraman Tallam <tmsriram@google.com>
8517 (Output_section::Input_section_sort_entry::compare_section_ordering):
8518 Change to return non-zero correctly.
8519 (Output_section::Input_section_sort_section_order_index_compare
8520 ::operator()): Change to fix ambiguity in comparisons.
8522 2010-06-01 Sriraman Tallam <tmsriram@google.com>
8524 * gold.h (is_wildcard_string): New function.
8525 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8526 (Layout::layout_eh_frame): Ditto.
8527 (Layout::find_section_order_index): New method.
8528 (Layout::read_layout_from_file): New method.
8529 * layout.h (Layout::find_section_order_index): New method.
8530 (Layout::read_layout_from_file): New method.
8531 (Layout::input_section_position_): New private member.
8532 (Layout::input_section_glob_): New private member.
8533 * main.cc (main): Call read_layout_from_file here.
8534 * options.h (--section-ordering-file): New option.
8535 * output.cc (Output_section::input_section_order_specified_): New
8537 (Output_section::Output_section): Initialize new member.
8538 (Output_section::add_input_section): Add new parameter.
8539 Keep input sections when --section-ordering-file is used.
8540 (Output_section::set_final_data_size): Sort input sections when
8541 section ordering file is specified.
8542 (Output_section::Input_section_sort_entry): Add new parameter.
8544 (Output_section::Input_section_sort_entry::compare_section_ordering):
8546 (Output_section::Input_section_sort_compare::operator()): Change to
8547 consider section_order_index.
8548 (Output_section::Input_section_sort_init_fini_compare::operator()):
8549 Change to consider section_order_index.
8550 (Output_section::Input_section_sort_section_order_index_compare
8551 ::operator()): New method.
8552 (Output_section::sort_attached_input_sections): Change to sort
8553 according to section order when specified.
8554 (Output_section::add_input_section<32, true>): Add new parameter.
8555 (Output_section::add_input_section<64, true>): Add new parameter.
8556 (Output_section::add_input_section<32, false>): Add new parameter.
8557 (Output_section::add_input_section<64, false>): Add new parameter.
8558 * output.h (Output_section::add_input_section): Add new parameter.
8559 (Output_section::input_section_order_specified): New
8561 (Output_section::set_input_section_order_specified): New method.
8562 (Input_section::Input_section): Initialize section_order_index_.
8563 (Input_section::section_order_index): New method.
8564 (Input_section::set_section_order_index): New method.
8565 (Input_section::section_order_index_): New member.
8566 (Input_section::Input_section_sort_section_order_index_compare): New
8568 (Output_section::input_section_order_specified_): New member.
8569 * script-sections.cc (is_wildcard_string): Delete and move modified
8571 (Output_section_element_input::Output_section_element_input): Modify
8572 call to is_wildcard_string.
8573 (Output_section_element_input::Input_section_pattern
8574 ::Input_section_pattern): Ditto.
8575 (Output_section_element_input::Output_section_element_input): Ditto.
8576 * testsuite/Makefile.am (final_layout): New test case.
8577 * testsuite/Makefile.in: Regenerate.
8578 * testsuite/final_layout.cc: New file.
8579 * testsuite/final_layout.sh: New file.
8581 2010-06-01 Rafael Espindola <espindola@google.com>
8583 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8585 2010-06-01 Rafael Espindola <espindola@google.com>
8587 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8588 visibility of symbols.
8590 2010-05-27 Doug Kwan <dougkwan@google.com>
8592 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8593 from start of output section instead of address for a local symbol
8594 in a merged or relaxed section when doing a relocatable link.
8596 2010-05-26 Rafael Espindola <espindola@google.com>
8599 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8600 adding sections the garbage collector removed.
8601 * gold/testsuite/Makefile.am: Add test.
8602 * gold/testsuite/Makefile.in: Regenerate.
8603 * gold/testsuite/plugin_test_7.sh: New.
8604 * gold/testsuite/plugin_test_7_1.c: New.
8605 * gold/testsuite/plugin_test_7_2.c: New.
8607 2010-05-26 Rafael Espindola <espindola@google.com>
8609 * script-sections.cc (Output_section_definition::set_section_addresses):
8610 Check for --section-start.
8612 2010-05-26 Doug Kwan <dougkwan@google.com>
8614 * arm.cc (Arm_scan_relocatable_relocs): New class.
8615 (Target_arm::relocate_special_relocatable): New method.
8616 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8617 (Arm_relocate_functions::thumb_branch_common): Same.
8618 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8619 instead of Default_scan_relocatable_relocs.
8620 * target-reloc.h (relocate_for_relocatable): Let target handle
8621 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8622 * target.h (Sized_target::relocate_special_relocatable): New method.
8624 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8626 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8628 2010-05-23 Doug Kwan <dougkwan@google.com>
8630 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8632 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8633 with a direct branch, not a conditional branch, to a stub.
8634 * merge.cc (Output_merge_base::record_input_section): New method
8636 (Output_merge_data::do_add_input_section): Record input section if
8637 keeps-input-sections flag is set.
8638 (Output_merge_string::do_add_input_section): Ditto.
8639 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8640 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8642 (Output_merge_base::keeps_input_sections,
8643 Output_merge_base::set_keeps_input_sections,
8644 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8646 (Output_merge_base::Input_sections): New type declaration.
8647 (Output_merge_base::input_sections_begin,
8648 Output_merge_base::input_sections_end,
8649 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8650 (Output_merge_base::bool keeps_input_sections_,
8651 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8652 Output_merge_base::input_sections_): New data members.
8653 (Output_merge_data::do_set_keeps_input_sections): New method
8655 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8656 * output.cc (Output_section::Input_section::relobj): Move method
8657 defintion from class declaration to here and handle merge sections.
8658 (Output_section::Input_section::shndx): Ditto.
8659 (Output_section::Output_section): Remove initializations of removed
8660 data members and initialize new data member LOOKUP_MAPS_.
8661 (Output_section::add_input_section): Set keeps-input-sections flag
8662 for a newly created merge output section as appropriate. Adjust code
8663 to use Output_section_lookup_maps class.
8664 (Output_section::add_relaxed_input_section): Adjst code for lookup
8665 maps code refactoring.
8666 (Output_section::add_merge_input_section): Add a new parameter
8667 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8668 class. If adding input section to a newly created merge output
8669 section fails, remove the new merge section.
8670 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
8671 Adjust code for use of the Output_section_lookup_maps class.
8672 (Output_section::find_merge_section): Ditto.
8673 (Output_section::build_lookup_maps): New method defintion.
8674 (Output_section::find_relaxed_input_section): Adjust code to use
8675 Output_section_lookup_maps class.
8676 (Output_section::get_input_sections): Export merge sections. Adjust
8677 code to use Output_section_lookup_maps class.
8678 (Output_section:::add_script_input_section): Adjust code to use
8679 Output_section_lookup_maps class. Update lookup maps for merge
8681 (Output_section::discard_states): Use Output_section_lookup_maps.
8682 (Output_section::restore_states): Same.
8683 * output.h (Merge_section_properties): Move class defintion out of
8685 (Output_section_lookup_maps): New class.
8686 (Output_section::Input_section::is_merge_section): New method
8688 (Output_section::Input_section::relobj): Move defintion out of class
8689 defintion. Declare method only.
8690 (Output_section::Input_section::shndx): Ditto.
8691 (Output_section::Input_section::output_merge_base): New method defintion.
8692 (Output_section::Input_section::u2_.pomb): New union field.
8693 (Output_section::Merge_section_by_properties_map,
8694 Output_section::Output_section_data_by_input_section_map,
8695 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8697 (Output_section::add_merge_input_section): Add new parameter
8698 KEEPS_INPUT_SECTIONS.
8699 (Output_section::build_lookup_maps): New method declaration.
8700 (Output_section::merge_section_map_,
8701 Output_section::merge_section_by_properties_map_,
8702 Output_section::relaxed_input_section_map_,
8703 Output_section::is_relaxed_input_section_map_valid_): Remove data
8705 (Output_section::lookup_maps_): New data member.
8707 2010-05-21 Doug Kwan <dougkwan@google.com>
8710 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8711 avoid a compilation error.
8713 2010-05-19 Rafael Espindola <espindola@google.com>
8715 * script-sections.cc (Output_section_definition::allocate_to_segment):
8716 Update the phdrs_list even when the output section is NULL.
8717 * testsuite/Makefile.am: Add test.
8718 * testsuite/Makefile.in: Regenerate.
8719 * testsuite/script_test_9.cc: New.
8720 * testsuite/script_test_9.sh: New.
8721 * testsuite/script_test_9.t: New.
8723 2010-05-19 Doug Kwan <dougkwan@google.com>
8725 * arm.cc (Arm_input_section::original_size): New method.
8726 (Arm_input_section::do_addralign): Add a cast.
8727 (Arm_input_section::do_output_offset): Remove static cast.
8728 (Arm_input_section::original_addralign,
8729 Arm_input_section::original_size_): Change type to uint32_t.
8730 (Arm_input_section::init): Add safe casts for section alignment
8732 (Arm_input_section::set_final_data_size): Do not set address and
8733 offset of stub table.
8734 (Arm_output_section::fix_exidx_coverage): Change use of of
8735 Output_section::Simple_input_section to that of
8736 Output_section::Input_section.
8737 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8738 except for the first pass.
8739 * output.cc (Output_section::get_input_sections): Change type of
8740 input_sections to std::list<Input_section>.
8741 (Output_section::add_script_input_section): Rename from
8742 Output_section::add_simple_input_section. Change type of SIS
8743 parameter from Simple_input_section to Input_section.
8744 * output.h (Output_section::Simple_input_section): Remove class.
8745 (Output_section::Input_section): Change class visibility to public.
8746 (Output_section::Input_section::addralign): Use stored alignments
8747 for special input sections if set.
8748 (Output_section::Input_section::set_addralign): New method.
8749 (Output_section::get_input_sections): Change parameter type from
8750 list of Simple_input_section to list of Input_section.
8751 (Output_section::add_script_input_section): Rename from
8752 Output_section::add_simple_input_section. Change first parameter's
8753 type from Simple_input_section to Input_section and remove the
8754 second and third parameters.
8755 * script-sections.cc (Input_section::Input_section_list): Change
8756 type to list of Output_section::Input_section/
8757 (Input_section_info::Input_section_info): Change parameter type of
8758 INPUT_SECTION to Output_section::Input_section.
8759 (Input_section_info::input_section): Change return type.
8760 (Input_section_info::input_section_): Change type to
8761 Output_section::Input_section.
8762 (Output_section_element_input::set_section_addresses): Adjust code
8763 to use Output_section::Input_section instead of
8764 Output_section::Simple_input_section. Adjust code for renaming
8765 of Output_section::add_simple_input_section.
8766 (Orphan_output_section::set_section_addresses): Ditto.
8768 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8770 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8771 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8773 2010-05-18 Rafael Espindola <espindola@google.com>
8775 * options.cc (General_options::finalize): Handle -nostdlib.
8776 * options.h (nostdlib): New option.
8777 * script.cc (script_add_search_dir): Handle -nostdlib.
8779 2010-05-12 Doug Kwan <dougkwan@google.com>
8781 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8782 attributes section only if there no attributes section after merging.
8783 (Target_arm::merge_object_attributes): Move value of
8784 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
8785 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8786 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8787 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8788 and arm_attr_merge_7.stdout.
8789 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8790 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8791 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8792 arm_attr_merge_7b.o): New rules.
8793 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8795 * testsuite/Makefile.in: Regenerate.
8796 * testsuite/arm_attr_merge.sh: New file.
8797 * testsuite/arm_attr_merge_[67][ab].s: Same.
8799 2010-05-05 Nick Clifton <nickc@redhat.com>
8801 * po/es.po: Updated Spanish translation.
8803 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8805 * Makefile.am (install-exec-local): Properly install gold as
8806 default cross linker.
8807 * Makefile.in: Regenerated.
8809 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8810 Nick Clifton <nickc@redhat.com>
8812 * configure.ac (install_as_default): Define and set to false
8813 unless --enable-gold or --enable-gold=both/gold has been
8815 * configure: Regenerate.
8817 * Makefile.am (install-exec-local): Install the executable as
8818 'ld.gold'. If install_as_default is true then also install it as
8820 * Makefile.in: Regenerated.
8822 2010-04-24 Ian Lance Taylor <iant@google.com>
8824 * layout.cc (Layout::layout_reloc): In relocatable link don't
8825 combine reloc sections for grouped sections.
8827 2010-04-23 Sriraman Tallam <tmsriram@google.com>
8829 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8830 sections that are not ordinary to icf.
8831 * icf.cc (get_section_contents): Handle relocation pointing to section
8832 with no object or shndx information.
8833 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8834 * testsuite/Makefile.in: Regenerate.
8835 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8836 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8838 2010-04-22 Ian Lance Taylor <iant@google.com>
8840 * expression.cc (Expression::Expression_eval_info): Add
8841 result_alignment_pointer field.
8842 (Expression::eval_with_dot): Add result_alignment_pointer
8843 parameter. Change all callers.
8844 (Expression::eval_maybe_dot): Likewise.
8845 (class Binary_expression): Add alignment_pointer parameter to
8846 left_value and right_value. Change all callers.
8847 (BINARY_EXPRESSION): Set result alignment.
8848 (class Trinary_expression): Add alignment_pointer parameter to
8849 arg2_value and arg3_value. Change all callers.
8850 (Trinary_cond::value): Set result alignment.
8851 (Max_expression::value, Min_expression::value): Likewise.
8852 (Align_expression::value): Likewise.
8853 * script-sections.cc (class Sections_element): Add dot_alignment
8854 parameter to set_section_addresses virtual function. Update
8856 (class Output_section_element): Likewise.
8857 (Script_sections::create_segments): Add dot_alignment parameter.
8859 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8860 (Script_sections::set_phdrs_clause_addresses): Likewise.
8861 * script-sections.h: Update declarations.
8862 * script.h: Update declarations.
8863 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8865 * testsuite/script_test_3.t: Set large alignment.
8866 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8867 segment has expected alignment.
8869 2010-04-22 Nick Clifton <nickc@redhat.com>
8871 * po/gold.pot: Updated by the Translation project.
8872 * po/vi.po: Updated Vietnamese translation.
8874 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8876 * testsuite/Makefile.am (check_PROGRAMS): Add
8877 icf_virtual_function_folding_test.
8878 * testsuite/Makefile.in: Regenerated.
8880 2010-04-15 Andrew Haley <aph@redhat.com>
8882 * options.h (merge_exidx_entries): New option.
8883 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8884 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8885 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8886 (Target_arm::merge_exidx_entries): New function.
8887 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8888 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8889 to Arm_exidx_fixup constructor.
8890 Add new arg, merge_exidx_entries.
8891 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8892 Arm_output_section::fix_exidx_coverage.
8894 2010-04-18 Sriraman Tallam <tmsriram@google.com>
8896 * icf.cc (get_section_contents): Check for preemptible functions.
8897 Ignore addend when appropriate.
8898 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8900 (add_from_relobj): Check for section folded.
8901 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8902 * symtab.h (should_add_dynsym_entry): Add new parameter.
8903 * target-reloc.h (scan_relocs): Check for section folded.
8904 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8905 Check reloc types for function pointers in shared objects.
8906 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8908 (icf_preemptible_functions_test): New test case.
8909 (icf_string_merge_test): New test case.
8910 * testsuite.Makefile.in: Regenerate.
8911 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8912 bar_glob. Refactor code.
8913 * testsuite/icf_preemptible_functions_test.cc: New file.
8914 * testsuite/icf_preemptible_functions_test.sh: New file.
8915 * testsuite/icf_string_merge_test.cc: New file.
8916 * testsuite/icf_string_merge_test.sh: New file.
8917 * testsuite/icf_virtual_function_folding_test.cc: New file.
8918 * testsuite/icf_virtual_function_folding_test.sh: New file.
8920 2010-04-14 Doug Kwan <dougkwan@google.com>
8922 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8923 for local symbol recounting if we remove a section due to ICF.
8924 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8925 there are no regular objects in input.
8927 2010-04-13 Doug Kwan <dougkwan@google.com>
8929 * arm.cc (Arm_input_section::set_final_data_size): Compute
8930 accurate final data size instead of using current data size.
8932 2010-04-09 Doug Kwan <dougkwan@google.com>
8934 * layout.cc (Layout::choose_output_section): Handle script section
8936 (Layout::make_output_section_for_script): Add section type parameter.
8937 Handle script section types.
8938 * layout.h (Layout::make_output_section_for_script): Add section
8940 * output.cc (Output_section::Output_section): Initialize data member
8942 (Output_section::do_reset_address_and_file_offset): Do not set address
8943 to 0 if section is a NOLOAD section.
8944 * output.h (Output_section::is_noload): New method.
8945 (Output_section::set_is_noload): Ditto.
8946 (Output_section::is_noload_): New data member.
8947 * script-c.h (Script_section_type): New enum type.
8948 (struct Parser_output_section_header): Add new file section_type.
8949 * script-sections.cc (Sections_element::output_section_name): Add
8950 parameter for returning script section type.
8951 (Output_section_definition::output_section_name): Ditto.
8952 (Output_section_definition::section_type)P; New method.
8953 (Output_section_definiton::script_section_type_name): Ditto.
8954 (Output_section_definition::script_section_type_): New data member.
8955 (Output_section_definition::Output_section_definition): Initialize
8956 data member Output_section_definition::script_section_type_.
8957 (Output_section_definition::create_sections): Pass script section type
8958 to Layout::make_output_section_for_script.
8959 (Output_section_definition::output_section_name): Return script
8960 section type to caller.
8961 (Output_section_definition::set_section_address): Do not advance
8962 dot value and load address if section type is NOLOAD. Set address
8963 of NOLOAD sections regardless of section flags.
8964 (Output_section_definition::print): Print section type if it is
8965 not SCRIPT_SECTION_TYPE_NONE.
8966 (Output_section_definition::section_type): New method.
8967 (Output_section_definition::script_section_type_name): Ditto.
8968 (Script_sections::output_section_name): Add new parameter
8969 PSECTION_TYPE for returning script section type. Pass it to
8970 section elements. Handle discard sections.
8971 (Sort_output_sections::operator()): Handle NOLOAD sections.
8972 * script-sections.h (Script_sections::Section_type): New enum type.
8973 (Script_sections::output_section_name): Add a new parameter for
8974 returning script section type.
8975 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8977 * yyscript.y (union): Add new field SECTION_TYPE.
8978 (COPY, DSECT, INFO, NOLOAD): New tokens.
8979 (opt_address_and_section_type): Change type to output_section_header.
8980 (section_type): New non-terminal
8981 (section_header): Handle section type.
8982 (opt_address_and_section_type): Return section type value.
8984 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8986 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8987 * testsuite/plugin_common_test_2.c (foo): Likewise.
8989 2010-04-08 Doug Kwan <dougkwan@google.com>
8991 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8993 * output.cc (Output_section::add_merge_input_section): Simplify
8994 code and return status of Output_merge_base::add_input_section.
8995 Update merge section map only if Output_merge_base::add_input_section
8998 2010-04-07 Doug Kwan <dougkwan@google.com>
9000 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9001 if section is marked as containing instructions but has no mapping
9003 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9004 correct section index.
9005 (Arm_relobj::find_linked_text_section): Ditto.
9007 2010-04-07 Cary Coutant <ccoutant@google.com>
9009 * archive.cc (include_member): Destroy Read_symbols_data object before
9011 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9012 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9013 (Read_symbols_data::~Read_symbols_data) New destructor.
9014 (Section_relocs::Section_relocs) New constructor.
9015 (Section_relocs::~Section_relocs) New destructor.
9016 (Read_relocs_data::Read_relocs_data) New constructor.
9017 (Read_relocs_data::~Read_relocs_data) New destructor.
9018 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9019 pointers to NULL after deleting.
9021 2010-04-07 Doug Kwan <dougkwan@google.com>
9023 * arm.cc: Replace "endianity" with "endianness" in comments.
9024 (Arm_exidx_cantunwind): Ditto.
9025 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9026 (Arm_relobj::merge_flags_and_attributes): New method.
9027 (Arm_relobj::merge_flags_and_attributes_): New data member.
9028 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9029 (Arm_relobj::scan_sections_for_stubs): Ditto.
9030 (Arm_relobj::do_read_symbols): Check to see if we really want to
9031 merge processor-specific flags and attributes. Exit early if
9032 an object is empty except for section names and the undefined symbol.
9033 (Target_arm::do_finalize_sections): Move check for ELF format to
9034 Arm_relobj::do_read_symbols. Merge processor specific flags and
9035 attributes from a regular object only when we have determined that
9036 it is aapropriate. Do not create an .ARM.attributes section in
9037 output if there is no regular input object.
9038 (Target_arm::merge_processor_specific_flags): Check
9039 --warn-mismatch before printing any error.
9040 (Target_arm::merge_object_attributes): Ditto.
9041 * gold.cc (queue_middle_tasks): Handle the case in which there is
9042 no regular object in input.
9043 * options.cc (General_options::parse_EB): New method.
9044 (General_options::parse_EL): Same.
9045 (General_options::General_options): Initialize endianness_.
9046 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9048 (General_options::Endianness): New enum.
9049 (General_options::endianness): New method.
9050 (General_options::endianness_): New data member.
9051 * parameters.cc (Parameters::set_options): Check target endianness.
9052 (Parameters::set_target_once): Ditto.
9053 (Parameters::check_target_endianness): New method.
9054 (parameters_force_valid_target): If either -EL or -EB is specified,
9055 use it to define endianness of default target.
9056 * parameters.h (Parameters::check_target_endianness): New method
9058 * target.h (class Target): Change "endianity" to "endianness"
9061 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9063 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9064 * configure: Regenerate.
9065 * Makefile.in: Regenerate.
9066 * testsuite/Makefile.in: Regenerate.
9068 2010-04-06 Cary Coutant <ccoutant@google.com>
9071 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9072 prevailing definitions of common symbols.
9073 * testsuite/plugin_test_6.sh: New test case.
9074 * testsuite/plugin_common_test_1.c: New test case.
9075 * testsuite/plugin_common_test_2.c: New test case.
9076 * testsuite/Makefile.am (plugin_test_6): New test case.
9077 * testsuite/Makefile.in: Regenerate.
9079 2010-04-06 Nick Clifton <nickc@redhat.com>
9081 * po/vi.po: New Vietnamese translation.
9083 2010-03-30 Doug Kwan <dougkwan@google.com>
9085 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9087 2010-03-25 Doug Kwan <dougkwan@google.com>
9089 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9090 to avoid a conversion warning on a 32-bit host.
9092 2010-03-24 Ian Lance Taylor <iant@google.com>
9094 * testsuite/script_test_3.t: Add a TLS segment.
9095 * testsuite/Makefile.am (check_PROGRAMS): Add
9096 tls_phdrs_script_test.
9097 (tls_phdrs_script_test_SOURCES): Define.
9098 (tls_phdrs_script_test_DEPENDENCIES): Define.
9099 (tls_phdrs_script_test_LDFLAGS): Define.
9100 (tls_phdrs_script_test_LDADD): Define.
9101 * testsuite/Makefile.in: Rebuild.
9103 2010-03-23 Cary Coutant <ccoutant@google.com>
9105 * fileread.cc (find_or_make_view): Fix comment.
9107 2010-03-23 Ian Lance Taylor <iant@google.com>
9109 * script-sections.cc (class Orphan_section_placement): Define
9110 PLACE_TLS and PLACE_TLS_BSS.
9111 (Orphan_section_placement::Orphan_section_placement): Initialize
9113 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9114 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9115 (tls_script_test_SOURCES): Define.
9116 (tls_script_test_DEPENDENCIES): Define.
9117 (tls_script_test_LDFLAGS): Define.
9118 (tls_script_test_LDADD): Define.
9119 * testsuite/Makefile.in: Rebuild.
9121 2010-03-22 Doug Kwan <dougkwan@google.com>
9123 * arm.cc (Arm_relocate_functions::abs8,
9124 Arm_relocate_functions::abs16): Use correct check for overflow
9125 specified in the ARM ELF specs.
9126 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9127 target of a BLX instruction specially.
9128 (Reloc_stub::stub_type_for_reloc): Ditto.
9129 (Relocate::relocate): Use symbolic names instead of numeric relocation
9130 codes to report error.
9131 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9133 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9134 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9135 thumb2_blx_out_of_range.stdout
9136 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9137 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9138 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9139 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9140 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9141 thumb2_blx_in_range, thumb2_blx_in_range.o,
9142 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9143 thumb2_blx_out_of_range.o): New rules.
9144 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
9145 thumb2_blx_in_range and thumb2_blx_out_of_range.
9146 * testsuite/Makefile.in: Regenerate.
9147 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9148 * testsuite/thumb_blx_in_range.s: New file.
9149 * testsuite/thumb_blx_out_of_range.s: New file.
9151 2010-03-22 Rafael Espindola <espindola@google.com>
9153 * archive.cc (Should_include): Move to archive.h.
9154 (should_include_member): Make it a member of Archive.
9156 (Add_lib_group_symbols): New.
9157 * archive.h: Include options.h.
9158 (Archive_member): Moved from Archive.
9159 (Should_include): Moved from archive.cc.
9161 (Add_lib_group_symbols): New.
9162 * dynobj.cc (do_should_include_member): New.
9163 * dynobj.h (do_should_include_member): New.
9164 * gold.cc (queue_initial_tasks): Update call to queue.
9165 * main.cc (main): Print lib group stats.
9166 * object.cc (do_should_include_member): New.
9167 * object.h: Include archive.h.
9168 (Object::should_include_member): New.
9169 (Object::do_should_include_member): New.
9170 (Sized_relobj::do_should_include_member): New.
9171 * options.cc (General_options::parse_start_lib): New.
9172 (General_options::parse_end_lib): New.
9173 (Input_arguments::add_file): Handle lib groups.
9174 (Input_arguments::start_group): Check we are not in a lib.
9175 (Input_arguments::start_lib): New.
9176 (Input_arguments::end_lib): New.
9177 * options.h (General_options): Add start_lib and end_lib.
9178 (Input_argument::lib_): New.
9179 (Input_argument::lib): New.
9180 (Input_argument::is_lib): New.
9181 (Input_file_lib): New.
9182 (Input_arguments::in_lib_): New.
9183 (Input_arguments::in_lib): New.
9184 (Input_arguments::start_lib): New.
9185 (Input_arguments::end_lib_): New.
9186 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9187 in unused members as preempted.
9188 (Sized_pluginobj::do_should_include_member): New.
9189 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9190 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9192 (Read_symbols::do_whole_lib_group): New.
9193 (Read_symbols::do_lib_group): New.
9194 (Read_symbols::do_read_symbols): Handle lib groups.
9195 (Read_symbols::get_name): Handle lib groups.
9196 * readsyms.h (Read_symbols): Add an archive member pointer.
9197 (Read_symbols::do_whole_lib_group): New.
9198 (Read_symbols::do_lib_group): New.
9199 (Read_symbols::member_): New.
9200 * script.cc (read_input_script): Update call to queue_soon.
9202 2010-03-19 Doug Kwan <dougkwan@google.com>
9204 * arm.cc (Stub_table::Stub_table): Initialize new data members
9205 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9206 (Stub_table::add_reloc_stub): Assign stub offset and update
9207 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9208 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9210 (Stub_table::update_data_size_and_addralign): Use
9211 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9212 instead of going over all reloc stubs.
9213 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
9214 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9215 Stringpool_template::offset_ to size of Stringpool_char.
9216 (Stringpool_template::new_key_offset): Remove code to initialize
9217 Stringpool_template::offset_.
9218 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9219 Stringpool_template::offset_ to zero.
9221 2010-03-15 Doug Kwan <dougkwan@google.com>
9223 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9225 (Stringpool_template::new_key_offset): New method.
9226 (Stringpool_template::add_string): Assign offsets when adding new
9228 (Stringpool_template::set_string_offsets): Do not set string offsets
9229 when not optimizing.
9230 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9232 (Chunked_vector::clear): Clear size_.
9233 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9234 (Chunked_vector::size): Return size_.
9235 (Chunked_vector::push_back): Use size_ to find insert position.
9236 (Chunked_vector::size_): New data member.
9237 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9238 (Stringpool_template::new_key_offset): New method declaration.
9239 (Stringpool_template::offset_): New data member.
9241 2010-03-15 Rafael Espindola <espindola@google.com>
9243 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9244 Add_symbols' constructor.
9245 * readsyms.h (Add_symbols): Remove the input_group member.
9247 2010-03-10 Ian Lance Taylor <iant@google.com>
9249 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9250 target to ask whether a reference to a symbol requires a stack
9252 * target.h (Target::is_call_to_non_split): New function.
9253 (Target::do_is_call_to_non_split): Declare virtual function.
9254 * target.cc: Include "symtab.h".
9255 (Target::do_is_call_to_non_split): New function.
9256 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9258 2010-03-10 Cary Coutant <ccoutant@google.com>
9260 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9261 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9262 (File_read::open[2]): Add whole_file_view_ to list of views.
9263 (File_read::make_view): Remove test of whole_file_view_.
9264 (File_read::find_or_make_view): Create whole_file_view_ if
9266 (File_read::clear_views): Replace bool parameter with enum;
9267 adjust all callers. Don't delete views with permanent data;
9268 do delete cached views and views from archives if
9269 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9270 if clearing the corresponding view.
9271 * fileread.h (File_read::Clear_views_mode): New enum.
9272 (File_read::View::is_permanent_view): New method.
9273 (File_read::clear_views): Replace bool parameter
9274 with enum; adjust all callers.
9275 * options.h (General_options): Change keep_files_mapped option;
9276 add map_whole_files.
9277 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9279 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9282 2010-03-10 David S. Miller <davem@davemloft.net>
9284 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9286 2010-03-09 Sriraman Tallam <tmsriram@google.com>
9288 * icf.cc (get_section_contents): Add '@' marker after processing the
9291 2010-03-08 Doug Kwan <dougkwan@google.com>
9293 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9294 due to a conversion warning.
9295 (Arm_relobj::update_output_local_symbol_count): Check for local
9296 symbol with unset output index.
9298 2010-03-05 Ian Lance Taylor <iant@google.com>
9300 * options.h (class General_options): Add --spare-dynamic-tags.
9301 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9302 --spare-dynamic-tags.
9304 2010-03-05 Ian Lance Taylor <iant@google.com>
9306 * incremental.cc: Include "libiberty.h".
9308 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9310 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9311 function, is_info_ member.
9312 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9313 (Versions::Versions): Update caller.
9314 (Versions::define_base_version): Likewise.
9315 (Versions::add_def): Likewise.
9317 2010-03-03 Sriraman Tallam <tmsriram@google.com>
9319 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9320 (Scan::possible_function_pointer_reloc): New function.
9321 (Scan::local_reloc_may_be_function_pointer): Change to call
9322 possible_function_pointer_reloc.
9323 (Scan::global_reloc_may_be_function_pointer): Ditto.
9324 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9325 relocations in ".data.rel.ro._ZTV" section.
9326 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9327 * testsuite/icf_safe_so_test.cc: Ditto.
9328 * testsuite/icf_safe_test.cc: Ditto.
9329 * testsuite/icf_safe_test.sh: Ditto.
9331 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9332 Ian Lance Taylor <iant@google.com>
9334 * target-reloc.h (relocate_section): Check the symbol table index
9335 for -1U before setting the local symbol index.
9336 (scan_relocatable_relocs): If copying the relocation, record that
9337 the local symbol is required.
9338 * object.h (Symbol_value::is_output_symtab_index_set): New
9340 (Symbol_value::may_be_discarded_from_output_symtab): New
9342 (Symbol_value::has_output_symtab_entry): New function.
9343 (Symbol_value::needs_output_symtab_entry): Remove.
9344 (Symbol_value::output_symtab_index): Make sure the symbol index is
9346 (Symbol_value::set_output_symtab_index): Make sure the symbol
9347 index is not set. Make sure the new index is valid.
9348 (Symbol_value::set_must_have_output_symtab_entry): New function.
9349 (Symbol_value::has_output_dynsym_entry): New function.
9350 (Symbol_value::set_output_dynsym_index): Make sure the new index
9352 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9353 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9354 local symbol if permitted.
9355 (Sized_relobj::do_finalize_local_symbols): Call
9356 is_output_symtab_index_set rather than needs_output_symtab_entry.
9357 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9358 rather than needs_output_symtab_entry. Call
9359 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9360 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9361 is_output_symtab_index_set rather than needs_output_symtab_entry.
9362 * testsuite/discard_locals_relocatable_test.c: New file.
9363 * testsuite/discard_locals_test.sh: Test -r.
9364 * testsuite/Makefile.am (check_DATA): Add
9365 discard_locals_relocatable_test1.syms,
9366 discard_local_relocatable_test2.syms.
9367 (MOSTLYCLEANFILES): Likewise. Also add
9368 discard_locals_relocatable_test1.lout and
9369 discard_locals_relocatable_test2.out.
9370 (discard_locals_relocatable_test1.syms): New target.
9371 (discard_locals_relocatable_test.o): New target.
9372 (discard_locals_relocatable_test1.out): New target.
9373 (discard_locals_relocatable_test2.syms): New target.
9374 (discard_locals_relocatable_test2.out): New target.
9375 (various): Add missing ../ld-new dependencies.
9376 * testsuite/Makefile.in: Rebuild.
9378 2010-03-03 Nick Clifton <nickc@redhat.com>
9380 * po/fi.po: New Finnish translation.
9382 2010-03-01 Doug Kwan <dougkwan@google.com>
9384 * layout.cc (Layout::Layout): Force section types of .init_array*,
9385 .preinit_array* and .fini_array* sections.
9386 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9387 Fix check of return value of std::string::find.().
9388 (Output_section::Input_section_sort_compare::operator()): Remove
9389 comment about .init_array.
9390 (Output_section::Input_section_sort_init_fini_compare::operator()):
9392 (Output_section::sort_attached_input_sections): Handle .init_array
9393 and .fini_array specially.
9394 * output.h (Output_section::Inut_section_sort_compare): Update
9396 (Output_section::Input_section_sort_init_fini_compare): New struct.
9398 2010-02-26 Doug Kwan <dougkwan@google.com>
9400 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9401 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9402 * testsuite/debug_msg.sh: Avoid matching source line number for
9403 use of global variable undef_int.
9405 2010-02-26 Doug Kwan <dougkwan@google.com>
9407 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9408 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9409 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9410 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9411 * options.cc (General_options::General_options): Initialize member
9413 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9414 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9415 and rm_no_fix_v4bx.stdout
9416 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9417 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9418 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9419 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9420 and arm_no_fix_v4bx.
9421 * Makefile.in: Regenerate.
9422 * testsuite/arm_fix_v4bx.s: New file.
9423 * testsuite/arm_fix_v4bx.sh: Ditto.
9425 2010-02-24 Doug Kwan <dougkwan@google.com>
9427 * arm.cc (Target_arm::got_section): Make the .got section the first
9428 non RELRO section in the data segment.
9429 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9430 suffixes of section names.
9432 2010-02-24 Doug Kwan <dougkwan@google.com>
9434 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9435 flags and attributes merging if an input file is a binary file.
9436 * fileread.cc (Input_file::open): Record format of original file.
9437 * fileread.h (Input_file::Format): New enum type.
9438 (Input_file::Input_file): Initialize data member format_.
9439 (Input_file::format): New method definition.
9440 (Input_file::format_):: New data member.
9442 2010-02-24 Doug Kwan <dougkwan@google.com>
9444 * arm.cc (Arm_output_data_got): New class.
9445 (ARM_TCB_SIZE): New constant
9446 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9447 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9448 If user uses a script with a SECTIONS clause, issue only a warning
9449 for a misplaced EXIDX input section. Otherwise, issue an error.
9450 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
9452 (Target_arm::got_mode_index_entry): Handle static linking.
9453 (Target_arm::Scan::local): Ditto.
9454 (Target_arm::Scan::global): Ditto.
9455 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9456 all incorrectly implemented relocations.
9457 (Target_arm::fix_exidx_coverage): Pass layout to
9458 Arm_output_section::fix_exidx_coverage.
9459 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9460 from ".ARM.exidx." and ".ARM.extab.".
9462 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9464 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9465 section if it does not already exist.
9466 * attributes.cc (Attributes_section_data::Attributes_section_data):
9467 Don't crash if size is zero.
9469 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9470 Ian Lance Taylor <iant@google.com>
9472 * gold.cc (queue_middle_tasks): If no input files were opened,
9474 * workqueue.h (Task_function::Task_function): Assert that there is
9477 2010-02-22 Doug Kwan <dougkwan@google.com>
9479 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9480 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9481 types to avoid warnings due to different uint64_t implementations
9484 2010-02-21 Doug Kwan <dougkwan@google.com>
9486 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9487 handling of the maximum backward branch offset.
9488 (Arm_relocate_functions::thumb_branch_common): Ditto.
9489 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9490 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
9491 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
9492 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9493 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9494 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9495 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9496 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9497 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9498 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9499 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9500 thumb2_bl_out_of_range.o): New rules.
9501 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9502 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9503 thumb2_bl_out_of_range
9504 * testsuite/Makefile.in: Regenerate.
9505 * testsuite/arm_bl_in_range.s: New file.
9506 * testsuite/arm_bl_out_of_range.s: Ditto.
9507 * testsuite/arm_branch_in_range.sh: Ditto.
9508 * testsuite/arm_branch_range.t: Ditto.
9509 * testsuite/thumb2_branch_range.t: Ditto.
9510 * testsuite/thumb_bl_in_range.s: Ditto.
9511 * testsuite/thumb_bl_out_of_range.s: Ditto.
9512 * testsuite/thumb_branch_range.t: Ditto.
9514 2010-02-20 Sriraman Tallam <tmsriram@google.com>
9516 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9517 Add reloc offset information.
9518 * icf.cc (get_section_contents): Change iterators to point to the new
9519 vectors. Add reloc offset information to the contents.
9520 * icf.h (Icf::Sections_reachable_info): New typedef.
9521 (Icf::Sections_reachable_list): New typedef.
9522 (Icf::Offset_info): New typedef.
9523 (Icf::Reloc_info): New struct typedef.
9524 (Icf::Reloc_info_list): New typedef.
9525 (Icf::symbol_reloc_list): Delete method.
9526 (Icf::addend_reloc_list): Delete method.
9527 (Icf::section_reloc_list): Delete method.
9528 (Icf::reloc_info_list): New method.
9529 (Icf::reloc_info_list_): New member.
9531 2010-02-19 Doug Kwan <dougkwan@google.com>
9533 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9534 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9535 * arm.cc (Arm_relocation_functions): New forward declaration.
9536 (Target_arm::Target_arm): Initialize new data members
9537 got_mod_index_offset_ and tls_base_symbol_defined_.
9538 (Target_arm::Relocate::relocate_tls): New method.
9539 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9540 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9542 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
9543 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9544 (Target_arm::got_mod_index_offset_,
9545 Target_arm::tls_base_symbol_defined_): New data members.
9546 (Target_arm::Scan::local, Target::Scan::global,
9547 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9550 2010-02-18 Doug Kwan <dougkwan@google.com>
9552 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9553 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9554 text section as a parameter becuase some broken tools may not set
9555 the link in section header.
9556 (Target_arm::has_got_section): New method.
9557 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9558 without any mapping symbol as data only. Remove warning.
9559 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9560 link in its section header, try to discover the link by inspecting the
9561 REL31 relocation at the beginning of the section.
9562 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9564 (Target_arm::Scan::global): Treat any reference to the symbol
9565 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9567 2010-02-12 Sriraman Tallam <tmsriram@google.com>
9569 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9570 (Scan::global_reloc_may_be_function_pointer): New function.
9571 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9572 (Scan::global_reloc_may_be_function_pointer): New function.
9573 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9574 (Scan::global_reloc_may_be_function_pointer): New function.
9575 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9576 (Scan::global_reloc_may_be_function_pointer): New function.
9577 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9578 (Scan::global_reloc_may_be_function_pointer): New function.
9579 (Scan::possible_function_pointer_reloc): New function.
9580 (Target_x86_64::can_check_for_function_pointers): New function.
9581 * gc.h (gc_process_relocs): Scan relocation types to determine if
9582 function pointers were taken for targets that support it.
9583 * icf.cc (Icf::find_identical_sections): Include functions for
9584 folding in safe ICF whose pointer is not taken.
9585 * icf.h (Secn_fptr_taken_set): New typedef.
9586 (fptr_section_id_): New member.
9587 (section_has_function_pointers): New function.
9588 (set_section_has_function_pointers): New function.
9589 (check_section_for_function_pointers): New function.
9590 * options.h: Fix comment for safe ICF option.
9591 * target.h (can_check_for_function_pointers): New function.
9592 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9593 Modify icf_safe_test for X86-64.
9594 * testsuite/Makefile.in: Regenerate.
9595 * testsuite/icf_safe_so_test.cc: New file.
9596 * testsuite/icf_safe_so_test.sh: New file.
9597 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9598 (main): Change to take pointer to function kept_func_3.
9599 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9600 folding is done correctly for X86-64.
9602 2010-02-12 David S. Miller <davem@davemloft.net>
9604 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9605 is_symbolless parameter.
9606 (Output_reloc<SHT_REL>::is_symbolless): New.
9607 (Output_reloc<SHT_REL>::is_symbolless_): New.
9608 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9609 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9610 (Output_reloc<SHT_RELA>::is_symbolless): New.
9611 (Output_data_reloc::add_global): Handle is_symbolless.
9612 (Output_data_reloc::add_global_relative): Likewise.
9613 (Output_data_reloc::add_local): Likewise.
9614 (Output_data_reloc::add_local_relative): Likewise.
9615 (Output_data_reloc::add_symbolless_global_addend): New.
9616 (Output_data_reloc::add_symbolless_local_addend): New.
9617 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9619 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9620 instead of ->is_relative_
9621 (Output_reloc::write): Likewise.
9622 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9623 (Output_reloc::write_rel): Simplify.
9625 * sparc.cc (Target_sparc::Scan::local): Use
9626 ->add_symbolless_local_addend as needed.
9627 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9628 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9629 based upon relocation offset.
9631 2010-02-11 Doug Kwan <dougkwan@google.com>
9633 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9634 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9635 beginning of function.
9636 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9637 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9638 parameter is_32bit in calls to should_apply_static_reloc.
9639 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9640 (check_DATA): Add arm_abs_global.stdout.
9641 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9642 arm_abs_global.stdout): New rules.
9643 (MOSTLLYCLEANFILES): Add arm_abs_global
9644 * Makefile.in: Regenerate.
9645 * testsuite/arm_abs_global.s: New file.
9646 * testsuite/arm_abs_global.sh: Ditto.
9647 * testsuite/arm_abs_lib.s: Ditto.
9649 2010-02-11 Ian Lance Taylor <iant@google.com>
9651 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9653 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9654 Allocate_commons_task first.
9655 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9656 task, rather than symtab_lock_.
9657 (Gc_process_relocs::~Gc_process_relocs): New function.
9658 (Gc_process_relocs::is_runnable): Check this_blocker_.
9659 (Gc_process_relocs::locks): Use next_blocker_ rather than
9661 (Scan_relocs::~Scan_relocs): New function.
9662 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9664 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9666 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9667 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9668 constructor accordingly.
9669 (class Gc_process_relocs): Likewise.
9670 (class Scan_relocs): Likewise.
9671 * common.h (class Allocate_commons_task): Remove symtab_lock_
9672 field, and corresponding constructor parameter.
9673 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9675 (Allocate_commons_task::locks): Likewise.
9677 2010-02-11 Ian Lance Taylor <iant@google.com>
9679 * gold-threads.h (class Once): Define.
9680 (class Initialize_lock): Rewrite as child of Once.
9681 * gold-threads.cc (class Once_initialize): Define.
9682 (once_pointer_control): New static variable.
9683 (once_pointer, once_arg): New static variables.
9684 (c_run_once): New static function.
9685 (Once::Once, Once::run_once, Once::internal_run): New functions.
9686 (class Initialize_lock_once): Remove.
9687 (initialize_lock_control): Remove.
9688 (initialize_lock_pointer): Remove.
9689 (initialize_lock_once): Remove.
9690 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9691 (Initialize_lock::initialize): Rewrite.
9692 (Initialize_lock::do_run_once): New function.
9693 * archive.cc (Archive::interpret_header): Only clear name if it is
9695 * fileread.cc: Include "gold-threads.h"
9696 (file_counts_lock): New static variable.
9697 (file_counts_initialize_lock): Likewise.
9698 (File_read::release): Only increment counts when using --stats.
9699 Use a lock around the increment.
9700 * parameters.cc (class Set_parameters_target_once): Define.
9701 (set_parameters_target_once): New static variable.
9702 (Parameters::Parameters): Move here from parameters.h.
9703 (Parameters::set_target): Rewrite.
9704 (Parameters::set_target_once): New function.
9705 (Parameters::clear_target): Move here and rewrite.
9706 * parameters.h (class Parameters): Update declarations. Add
9707 set_parameters_target_once_ field.
9708 (Parameters::Parameters): Move to parameters.cc.
9709 (Parameters::clear_target): Likewise.
9710 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9712 (Start_group::~Start_group): New function.
9713 (Start_group::is_runnable): New function.
9714 (Start_group::locks, Start_group::run): New functions.
9715 (Finish_group::run): Change saw_undefined to size_t.
9716 * readsyms.h (class Start_group): Define.
9717 (class Finish_group): Change saw_undefined_ field to size_t.
9718 (Finish_group::Finish_group): Remove saw_undefined and
9719 this_blocker parameters. Change all callers.
9720 (Finish_group::set_saw_undefined): New function.
9721 (Finish_group::set_blocker): New function.
9722 * symtab.h (class Symbol_table): Change saw_undefined to return
9723 size_t. Change saw_undefined_ field to size_t.
9724 * target-select.cc (Set_target_once::do_run_once): New function.
9725 (Target_selector::Target_selector): Initialize set_target_once_
9726 field. Don't initialize lock_ and initialize_lock_ fields.
9727 (Target_selector::instantiate_target): Rewrite.
9728 (Target_selector::set_target): New function.
9729 * target-select.h (class Set_target_once): Define.
9730 (class Target_selector): Update declarations. Make
9731 Set_target_once a friend. Remove lock_ and initialize_lock_
9732 fields. Add set_target_once_ field.
9734 2010-02-10 Ian Lance Taylor <iant@google.com>
9736 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9738 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9739 (queue_middle_tasks): Add all blockers before queueing any tasks.
9740 (queue_final_tasks): Likewise.
9741 * token.h (Task_token::add_blockers): New function.
9742 * object.h (Input_objects::number_of_relobjs): New function.
9744 2010-02-10 Ian Lance Taylor <iant@google.com>
9746 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9747 shared, not if not position independent.
9748 * x86_64.cc (Relocate::relocate_tls): Likewise.
9749 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9750 (tls_pie_pic_test): New target.
9751 * testsuite/Makefile.in: Rebuild.
9753 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9754 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9755 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9756 * testsuite/Makefile.in: Rebuild.
9758 2010-02-09 David S. Miller <davem@davemloft.net>
9760 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9761 R_SPARC_RELATIVE using ->add_local_relative().
9762 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9764 * output.h (Output_data_dynamic::add_section_size): New method
9765 that takes two Output_data objects.
9766 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9767 entry param. Handle it in initializers.
9768 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9769 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9770 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9772 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9773 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9774 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9775 for dynrel_includes_plt.
9776 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9777 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9778 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9780 (Target_sparc::do_finalize_sections): Update to pass true for
9781 dynrel_includes_plt.
9782 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9783 output before .rela.plt
9784 (Target_powerpc::do_finalize_sections): Update to pass true for
9785 dynrel_includes_plt when 32-bit.
9787 2010-02-08 Doug Kwan <dougkwan@google.com>
9789 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9791 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9792 Arm_relobj::scan_section_for_cortex_a8_stubs,
9793 Arm_relobj::do_relocation_section): Instead of calling
9794 Output_section::output_address, use faster
9795 Arm_relobj::simple_input_section_output_address.
9797 2010-02-08 David S. Miller <davem@davemloft.net>
9799 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9800 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9801 relocation helper function.
9803 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9804 just like R_SPARC_GOT{10,13,22}.
9805 (Target_sparc::Scan::local): Likewise.
9806 (Target_sparc::Relocate:relocate): Likewise.
9808 2010-02-06 Ian Lance Taylor <iant@google.com>
9810 * configure.ac: Rewrite targetobjs duplicate removal code to use
9811 only shell constructs.
9812 * configure: Rebuild.
9814 2010-02-05 Doug Kwan <dougkwan@google.com>
9817 * arm.cc (Arm_relobj::section_is_scannable): New method.
9818 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9819 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9821 2010-02-04 Doug Kwan <dougkwan@google.com>
9824 * arm-reloc-property.cc (cstdio): Include.
9825 * configure.ac (targetobjs): Remove duplicates.
9826 * configure: Regenerate.
9827 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9828 big and little endian version for a given address size.
9830 2010-02-03 Doug Kwan <dougkwan@google.com>
9832 * arm-reloc-property.cc
9833 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9835 * arm-reloc-property.h
9836 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9837 New method definition.
9838 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9840 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9842 (GOT_PREL): Change implemented to Y.
9843 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9844 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9845 (Arm_relocate_functions::movw_abs_nc): Remove method.
9846 (Arm_relocate_functions::movt_abs): Ditto.
9847 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9848 (Arm_relocate_functions::thm_movt_abs): Ditto.
9849 (Arm_relocate_functions::movw_rel_nc): Ditto.
9850 (Arm_relocate_functions::movw_rel): Ditto.
9851 (Arm_relocate_functions::movt_rel): Ditto.
9852 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9853 (Arm_relocate_functions:thm_movw_rel): Ditto.
9854 (Arm_relocate_functions:thm_movt_rel): Ditto.
9855 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9856 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9857 New method definitions.
9858 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9859 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9860 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9861 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9862 (Target_arm::Relocate::relocate): Check for non-static or
9863 unimplemented relocation code and exit early. Change calls to
9864 Target_arm::reloc_uses_thumb_bit and
9865 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9866 instead. Refactor code to handle similar relocations to increase
9867 code sharing. Remove check for unsupported relocation code in switch
9869 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9870 relocation property table to find out size. Change error message to
9871 print out the name of a relocation code instead of the numeric value.
9872 (Target_arm::scan_reloc_for_stub): Use relocation property table
9873 instead of calling Target_arm::reloc_uses_thumb_bit().
9875 2010-02-02 Doug Kwan <dougkwan@google.com>
9877 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9878 types of relaxed input section.
9880 2010-02-02 Doug Kwan <dougkwan@google.com>
9882 * Makefile.am (HFILES): Add arm-reloc-property.h.
9884 (TARGETSOURCES): Add arm-reloc-property.cc
9885 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
9886 (libgold_a_SOURCES): $(DEFFILES)
9887 * Makefile.in: Regenerate.
9888 * arm-reloc-property.cc: New file.
9889 * arm-reloc-property.h: New file.
9890 * arm-reloc.def: New file.
9891 * arm.cc: Update comments.
9892 (arm-reloc-property.h): New included header.
9893 (arm_reloc_property_table): New global variable.
9894 (Target_arm::do_select_as_default_target): New method definition.
9895 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9896 arm-reloc-property to targ_extra_obj.
9897 * parameters.cc (set_parameters_target): Call
9898 Target::select_as_default_target().
9899 * target.h (Target::select_as_default_target): New method definition.
9900 (Target::do_select_as_default_target): Same.
9902 2010-02-01 Doug Kwan <dougkwan@google.com>
9904 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9905 first_output_text_section_.
9906 (Arm_exidx_fixup::first_output_text_section): New method definition.
9907 (Arm_exidx_fixup::first_output_text_section_): New data member.
9908 (Arm_exidx_fixup::process_exidx_section): Record the first text
9909 output section seen.
9910 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9911 and entsize in output section header.
9913 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9915 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9916 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9917 (Arm_relocate_functions::thm_alu11): New Method.
9918 (Arm_relocate_functions::thm_pc8): New Method.
9919 (Arm_relocate_functions::thm_pc12): New Method.
9920 (Target_arm::Scan::local): Handle the relocations.
9921 (Target_arm::Scan::global): Likewise.
9922 (Target_arm::Relocate::relocate): Likewise.
9923 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9925 2010-01-29 Doug Kwan <dougkwan@google.com>
9927 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9928 of relocation types as ld.
9930 2010-01-29 Doug Kwan <dougkwan@google.com>
9932 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9934 (Arm_relocate_functions::thumb_branch_common): Ditto.
9935 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9936 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9937 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9938 Arm_relocate_functions::jump24): Remove.
9939 (Target_arm::Relocate::relocate): Adjust code to call
9940 Arm_relocation_functions::arm_branch_common and
9941 Arm_relocation_functions::thumb_branch_common instead of their removed
9942 wrappers. Merge switch-cases together to reduce source code size.
9944 2010-01-29 Doug Kwan <dougkwan@google.com>
9946 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9947 output_local_symbol_count_needs_update_.
9948 (Arm_relobj::output_local_symbol_count_needs_update,
9949 Arm_relobj::set_output_local_symbol_count_needs_update,
9950 Arm_relobj::update_output_local_symbol_count): New methods.
9951 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9953 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9954 of pointed function as in a R_ARM_PREL31 relocation.
9955 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9956 for output local symbol count updating.
9957 (Target_arm::do_relax): Update output local symbol counts in objects
9959 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9961 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9963 * arm.cc: Added support for the ARM relocations:
9964 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9965 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9966 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9968 (Arm_relocate_functions::movw_rel): New method.
9969 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9970 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9972 (Arm_relocate_functions::thm_movw_rel): New method.
9973 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9975 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9977 (Target_arm::Scan::global): Likewise.
9978 (Target_arm::Relocate::relocate): Likewise.
9979 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9982 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9984 * arm.cc: Added support for ARM group relocations.
9985 (Target_arm::reloc_needs_sym_origin): New method.
9986 (Arm_relocate_functions::calc_grp_kn): New method.
9987 (Arm_relocate_functions::calc_grp_residual): New method.
9988 (Arm_relocate_functions::calc_grp_gn): New method.
9989 (Arm_relocate_functions::arm_grp_alu): New Method.
9990 (Arm_relocate_functions::arm_grp_ldr): New Method.
9991 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9992 (Arm_relocate_functions::arm_grp_ldc): New Method.
9993 (Target_arm::Scan::local): Handle the ARM group relocations.
9994 (Target_arm::Scan::global): Likewise.
9995 (Target_arm::Relocate::relocate): Likewise.
9996 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9999 2010-01-26 Doug Kwan <dougkwan@google.com>
10001 * arm.cc (set): Include.
10002 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10004 (Arm_output_section::Text_section_list): New type.
10005 (Arm_output_section::append_text_sections_to_list): New method.
10006 (Arm_output_section::fix_exidx_coverage): Ditto.
10007 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
10008 (Arm_relobj::convert_input_section_to_relaxed_section): Use
10009 Relobj::set_section_offset() instead of
10010 Sized_relobj::invalidate_section_offset().
10011 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
10012 parameter for section headers. Ignore relocation sections for
10013 unallocated sections and EXIDX sections.
10014 (Target_arm::fix_exidx_coverage): New method.
10015 (Target_arm::output_section_address_less_than): New type.
10016 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10017 linked text section instead of the EXIDX section.
10018 (Arm_output_section::create_stub_group): Add an assertion to check
10019 that this is not an EXIDX output section.
10020 (Arm_output_section::append_text_sections_to_list): New method.
10021 (Arm_output_section::fix_exidx_coverage): Ditto.
10022 (Arm_relobj::scan_sections_for_stubs): Adjust call to
10023 Arm_relobj::section_needs_reloc_stub_scanning.
10024 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10026 (Target_arm::fix_exidx_coverage): New method.
10027 * object.h (Relobj::set_output_section): New method.
10028 (Sized_relobj::invalidate_section_offset): Remove method.
10029 (Sized_relobj::do_invalidate_section_offset): Remove method.
10030 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10032 2010-01-25 Doug Kwan <dougkwan@google.com>
10034 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10035 Fix warning due to signed and unsigned comparison on a 32-bit host.
10037 2010-01-22 Doug Kwan <dougkwan@google.com>
10039 * arm.cc (Target_arm::do_relax): Record an output section for section
10040 offset adjustment it contains any stub table that has changed.
10041 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10042 offsets in an output section if necessary.
10043 * output.cc (Output_section::Output_section): Initialize
10044 section_offsets_need_adjustments_.
10045 (Output_section::add_input_section_for_script): Renamed to
10046 Output_section::add_simple_input_section.
10047 (Output_section::save_states): Add a comment.
10048 (Output_section::discard_states): New method defintion.
10049 (Output_section::adjust_section_offsets): Same.
10050 * output.h (Output_section::add_input_section_for_script): Renamed to
10051 Output_section::add_simple_input_section.
10052 (Output_section::discard_states): New method declaration.
10053 (Output_section::adjust_section_offsets): Same.
10054 (Output_section::section_offsets_need_adjustment,
10055 Output_section::set_section_offsets_need_adjustment): New method
10057 (Output_section::section_offsets_need_adjustment_): New data member.
10058 * script-sections.cc
10059 (Output_section_element_input::set_section_address): Adjust code for
10060 renaming of Output_section::add_input_section_for_script.
10061 (Orphan_output_section::set_section_address): Same.
10063 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10065 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10066 Fix_v4bx enum values .
10067 * gold/options.h (General_options): New option definitions.
10068 (General_options::fix_v4bx): New method.
10069 (General_options::Fix_v4bx): New enum.
10070 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10071 (General_options::parse_fix_v4bx_interworking): New method.
10073 2010-01-22 Doug Kwan <dougkwan@google.com>
10075 * arm.cc (Arm_exidx_fixup): New class.
10077 2010-01-21 Doug Kwan <dougkwan@google.com>
10079 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10081 (Arm_exidx_section_offset_map): New type.
10083 2010-01-21 Doug Kwan <dougkwan@google.com>
10085 * arm.cc (Arm_exidx_input_section): New class.
10086 (Arm_relobj::exidx_input_section_by_link,
10087 Arm_relobj::exidx_input_section_by_shndx,
10088 Arm_relobj::make_exidx_input_section): New methods.
10089 (read_arm_attributes_section): Remove.
10090 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10091 information about them.
10092 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10095 2010-01-20 Doug Kwan <dougkwan@google.com>
10097 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10098 Input_section_specifier to Section_id.
10099 (Target_arm::new_arm_input_section: Adjust code for change of key
10101 (Target_arm::find_arm_input_section): Ditto.
10102 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10103 (Section_id): Remove.
10104 (Garbage_collection::Section_id_hash): Remove.
10105 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10106 (Section_id): Remove.
10107 (Icf::Section_id_hash): Remove.
10108 * object.h (Section_id, Const_section_id, Section_id_hash,
10109 Const_section_id_hash): New type definitions.
10110 * output.cc (Output_section::add_relaxed_input_section): Change to
10111 use Const_section_id instead of Input_section_specifier as key type.
10112 (Output_section::add_merge_input_section): Ditto.
10113 (Output_section::build_relaxation_map): Change to use Section_id
10114 instead of Input_section_specifier as key type.
10115 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
10117 (Output_section::convert_input_sections_to_relaxed_sections): Change
10118 to use Const_section_id instead of Input_section_specifier as key type.
10119 (Output_section::find_merge_section): Ditto.
10120 (Output_section::find_relaxed_input_section): Ditto.
10121 * output.h (Input_section_specifier): Remove class.
10122 (Output_section::Output_section_data_by_input_section_map): Change
10123 key type to Const_section_id.
10124 (Output_section::Output_relaxed_input_section_by_input_section_map):
10126 (Output_section::Relaxation_map): Change key type to Section_id.
10128 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10130 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10131 (class Arm_v4bx_stub): New class.
10132 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10133 (Stub_factory::make_arm_v4bx_stub): New method.
10134 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10135 (Stub_table::empty): Handle v4bx stubs.
10136 (Stub_table::add_arm_v4bx_stub): New method.
10137 (Stub_table::find_arm_v4bx_stub): New method.
10138 (Arm_relocate_functions::v4bx): New method.
10139 (Target_arm::fix_v4bx): New method.
10140 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10141 (Stub_table::relocate_stubs): Likewise.
10142 (Stub_table::do_write): Likewise.
10143 (Stub_table::update_data_size_and_addralign): Likewise.
10144 (Stub_table::finalize_stubs): Likewise.
10145 (Target_arm::Scan::local): Likewise.
10146 (Target_arm::Scan::global): Likewise.
10147 (Target_arm::do_finalize_sections): Likewise.
10148 (Target_arm::Relocate::relocate): Likewise.
10149 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10151 (Target_arm::scan_reloc_for_stub): Likewise.
10152 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10154 2010-01-19 Ian Lance Taylor <iant@google.com>
10156 * output.cc (Output_section_headers::do_sized_write): Write large
10157 segment count to sh_info field.
10158 (Output_file_header::do_sized_write): For large segment count,
10159 write PN_XNUM to e_phnum field.
10161 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10163 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10164 (Arm_relocate_functions::thm_jump8): New function.
10165 (Arm_relocate_functions::thm_jump11): New function.
10166 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10168 (Target_arm::Scan::global): Likewise.
10169 (Target_arm::Relocate::relocate): Likewise.
10170 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10173 2010-01-14 Doug Kwan <dougkwan@google.com>
10175 * arm.cc (map, utility): Include headers.
10176 (Target_arm::apply_cortex_a8_workaround): New method.
10177 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10178 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10179 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10180 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10181 the --[no-]fix-cortex-a8 command line options.
10182 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10183 (Target_arm::relocate_stub): Use addend in instruction template.
10184 * options.h (DEFINE_bool): Set the user-set flag.
10185 (General_options): Add --[no-]-fix-cortex options.
10186 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
10187 : Update fast look-up map after conversion.
10189 2010-01-14 Sriraman Tallam <tmsriram@google.com>
10191 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10192 in the first pass of do_layout.
10194 2010-01-13 Doug Kwan <dougkwan@google.com>
10196 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10197 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10198 apparent compiler problem of not folding static constant integral
10199 data members of elfcpp::Elf_sizes<32>.
10201 2010-01-13 Doug Kwan <dougkwan@google.com>
10203 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10204 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10205 Arm_relobj::scan_section_for_cortex_a8_erratum,
10206 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10207 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10208 sections to scan for relocation stubs into a new method
10209 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10210 relocation and Cortex-A8 stub scanning.
10211 (Target_arm::do_relax): Force stubs to be after stubbed sections
10212 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
10213 the beginning of a new relaxation pass. Update a comment.
10214 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10216 2010-01-12 Ian Lance Taylor <iant@google.com>
10218 * target-reloc.h (visibility_error): New inline function.
10219 (relocate_section): Call visibility_error.
10220 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10221 (MOSTLYCLEANFILES): Likewise.
10222 (protected_4_pic.o, protected_3.err): New targets.
10223 * testsuite/protected_4.cc: New file.
10225 2010-01-12 Doug Kwan <dougkwan@google.com>
10227 * arm.cc (Cortex_a8_reloc): New class.
10228 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10229 and cortex_a8_relocs_info_.
10230 (Target_arm::fix_cortex_a8): New method definition.
10231 (Target_arm::Cortex_a8_relocs_info): New type.
10232 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10233 New data member declarations.
10234 (Target_arm::scan_reloc_for_stub): Record information about
10235 relocations for THUMB branches that might be exempted from the
10236 Cortex-A8 workaround.
10237 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10238 at the beginning of a relaxation pass.
10240 2010-01-12 Doug Kwan <dougkwan@google.com>
10242 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10243 (Arm_relobj::Mapping_symbol_position,
10244 Arm_reloj::Mapping_symbol_position_less,
10245 Arm_relobj::Mapping_symbols_info): New types.
10246 (Target_arm::is_mapping_symbol_name): New method definition.
10247 (Arm_relobj::do_count_local_symbols): Save information about mapping
10250 2010-01-11 Doug Kwan <dougkwan@google.com>
10252 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10253 Arm_relocate_functions::thumb32_branch_upper,
10254 Arm_relocate_functions::thumb32_branch_lower,
10255 Arm_relocate_functions::thumb32_cond_branch_offset,
10256 Arm_relocate_functions::thumb32_cond_branch_upper,
10257 Arm_relocate_functions::thumb32_cond_branch_lower,
10258 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10259 branch offset encoding.
10260 (Arm_relocate_functions::thumb_branch_common): Use new branch
10261 offset encoding methods to avoid code duplication.
10262 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10263 (Stub_addend_reader::operator()): Use new branch encoding method
10264 to avoid code duplication.
10266 2010-01-11 Doug Kwan <dougkwan@google.com>
10268 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10269 (Target_arm::do_finalize_sections): Define special EXIDX section
10270 symbols only if referenced.
10271 * gc.h (Garbage_collection::add_reference): New method.
10272 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10275 2010-01-11 Ian Lance Taylor <iant@google.com>
10277 * script.cc (Version_script_info::build_expression_list_lookup):
10278 Change complaing about duplicate wildcard match from error to
10281 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10283 (Version_script_info::Version_script_info): Initialize globs_,
10284 default_version_, default_is_global_, and exact_. Don't
10285 initialize globals_ or locals_.
10286 (Version_script_info::build_lookup_tables): Build local symbols
10288 (Version_script_info::unquote): New function.
10289 (Version_script_info::add_exact_match): New function.
10290 (Version_script_info::build_expression_list_lookup): Remove lookup
10291 parameter. Add is_global parameter. Change all callers. Handle
10292 wildcard pattern specially. Unquote pattern. Call
10294 (Version_script_info::get_name_to_match): New function.
10295 (Version_script_info::get_symbol_version): New function.
10296 (Version_script_info::get_symbol_version_helper): Remove.
10297 (Version_script_info::check_unmatched_names): Call unquote.
10298 * script.h (class Version_script_info): Change get_symbol_version
10299 to be non-inline and add is_global parameter; change all callers.
10300 Rewrite symbol_is_local. Update declarations. Define struct
10301 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10302 Remove globals_ and locals_ members. Add exact_, globs_,
10303 default_version_, is_global_.
10304 (Version_script_info::Glob): Remove pattern, add expression and
10305 is_global. Update constructor. Change all callers.
10306 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10308 (Versions::symbol_section_contents): If a symbol is undefined, or
10309 defined in a dynamic object, set the version index to
10311 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10313 (Symbol_table::add_from_pluginobj): Likewise.
10314 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10316 2010-01-11 Doug Kwan <dougkwan@google.com>
10318 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10319 (incremental_dump_LDADD): Add linking option for libintl.
10320 * Makefile.in: Regenerate.
10322 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10325 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10327 * testsuite/Makefile.in: Regenerated.
10329 2010-01-10 Doug Kwan <dougkwan@google.com>
10331 * options.h (DEFINE_var): Use parentheses around argument varname__
10332 in macro body to avoid any unintended subsequent substitutions.
10334 2010-01-10 Ian Lance Taylor <iant@google.com>
10336 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10337 candidates before doing symbol resolution.
10339 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10340 ODR candidates if only one is weak.
10342 2010-01-08 Ian Lance Taylor <iant@google.com>
10344 * script.cc (Version_script_info::build_expression_list_lookup):
10345 Don't warn about ambiguous version, just record the ambiguity.
10346 (Version_script_info::get_symbol_version_helper): Give error if
10347 version is ambiguous.
10349 2010-01-08 Doug Kwan <dougkwan@google.com>
10351 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
10352 prev_data_size_ and prev_addralign_. Remove initializer for
10353 deleted data member has_been_changed_.
10354 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10355 to determine if the table is empty.
10356 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10358 (Stub_table::add_reloc_stub): Define method in class definition
10359 instead of just declaring it there.
10360 (Stub_table::add_cortex_a8_stub): New method definition.
10361 (Stub_table::update_data_size_and_addralign): Ditto.
10362 (Stub_table::finalize_stubs): Ditto.
10363 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10364 (Stub_table::do_addralign_): Return address alignment in the
10365 (Stub_table::do_reset_address_and_file_offset): Define method in
10366 class definition instead of declaring it there. Set current data
10367 size to be the data size of the previous pass.
10368 (Stub_table::set_final_data_size): Use current data size as the
10370 (Stub_table::relocate_stub): Change parameter type of stub from
10371 Reloc_stub pointer to Stub pointer.
10372 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10373 (Stub_table::Cortex_a8_stub_list): New typedef.
10374 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10375 Stub_table::prev_addralign_): New data member.
10376 (Arm_relobj::Arm_relobj): Initialize data member
10377 section_has_cortex_a8_workaround_.
10378 (Arm_relobj::section_has_cortex_a8_workaround,
10379 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10381 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10383 (Target_arm::relocate_stub): Change parameter type of stub from
10384 Reloc_stub pointer to Stub pointer.
10385 (Insn_template::size, Insn_template::alignment): Handle
10386 THUMB16_SPECIAL_TYPE.
10387 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10388 Stub_table::update_data_size_and_addralign,
10389 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10391 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10392 (Stub_table::do_write): Ditto.
10393 (Target_arm::do_relax): Adjust code for changes in Stub_table.
10395 2010-01-08 Ian Lance Taylor <iant@google.com>
10398 * symtab.h (class Symbol): Remove fields is_target_special_ and
10399 has_plt_offset_. Add field is_defined_in_discarded_section_.
10400 (Symbol::is_defined_in_discarded_section): New function.
10401 (Symbol::set_is_defined_in_discarded_section): New function.
10402 (Symbol::has_plt_offset): Rewrite.
10403 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10404 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10405 Don't initialize is_target_special_ or has_plt_offset_.
10406 Initialize is_defined_in_discarded_section_.
10407 (Symbol_table::add_from_relobj): If appropriate, set
10408 is_defined_in_discarded_section.
10409 * resolve.cc (Symbol::override_base_with_special): Don't test
10410 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10411 * target-reloc.h (relocate_section): Do special handling for
10412 symbols defined in discarded sections for global symbols as well
10415 2010-01-08 Ian Lance Taylor <iant@google.com>
10417 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10418 the SHT_SYMTAB case.
10420 2010-01-08 Ian Lance Taylor <iant@google.com>
10422 * object.cc (Sized_relobj::do_layout): Don't get confused if
10423 layout_eh_frame returns NULL.
10425 2010-01-08 Ian Lance Taylor <iant@google.com>
10428 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10429 dynamic symbol table, use the normal symbol table.
10430 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10433 2010-01-08 Ian Lance Taylor <iant@google.com>
10436 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10439 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10441 * version.cc (print_version): Change to "Copyright 2010".
10443 2010-01-08 Ian Lance Taylor <iant@google.com>
10447 * i386.cc (class Target_i386): Change return type of plt_section
10449 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10450 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10451 tls_desc_rel_ field.
10452 (Output_data_plt_i386::rel_tls_desc): New function.
10453 (Target_i386::rel_tls_desc_section): New function.
10454 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10455 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10456 R_386_TLS_DESC reloc in rel_tls_desc_section.
10457 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10458 Define struct Tlsdesc_info.
10459 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10460 (Target_x86_64::do_reloc_symbol_index): New function.
10461 (Target_x86_64::add_tlsdesc_info): New function.
10462 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10463 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10464 tlsdesc_rel_ field.
10465 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10467 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10468 (Target_x86_64::rela_tlsdesc_section): New function.
10469 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10471 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10472 (Target_x86_64::do_reloc_addend): New function.
10473 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10474 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10475 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10476 (Output_reloc::type): New function.
10477 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10478 (Output_reloc::is_target_specific): New function.
10479 (Output_reloc::target_arg): New function.
10480 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10481 absolute relocs and target specific relocs.
10482 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10483 add_target_specific.
10484 (class Output_data_reloc) [SHT_RELA]: Likewise.
10485 * output.cc (Output_reloc::Output_reloc): Add four new versions
10486 for absolute relocs and target specific relocs.
10487 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10488 (Output_reloc::get_symbol_index): Likewise.
10489 (Output_reloc::local_section_offset): Check that local_sym_index_
10490 is not TARGET_CODE or 0.
10491 (Output_reloc::symbol_value): Likewise.
10492 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10494 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10495 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10497 * layout.cc (add_target_dynamic_tags): Use output section for
10498 DT_PLTRELSZ and DT_JMPREL.
10500 2010-01-07 Ian Lance Taylor <iant@google.com>
10503 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10505 (class Output_data_reloc_generic): Define.
10506 (class Output_data_reloc_base): Change base class to
10507 Output_data_reloc_generic. Change add() method to call
10508 bump_relative_reloc_count for a relative reloc. Remove
10509 sort_relocs_ field.
10510 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10512 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10513 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10515 * layout.h (class Layout): Update declaration.
10517 2010-01-07 Ian Lance Taylor <iant@google.com>
10519 * output.h (class Output_data): Add const version of
10520 output_section and do_output_section.
10521 (class Output_section_data): Add const version of
10523 (class Output_section): Likewise.
10524 * layout.cc (Layout::add_target_dynamic_tags): New function.
10525 * layout.h (class Layout): Update declarations.
10526 * arm.cc (Target_arm::do_finalize_sections): Use
10527 add_target_dynamic_tags.
10528 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10529 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10530 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10531 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10533 2010-01-07 Ian Lance Taylor <iant@google.com>
10536 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10539 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10540 Ian Lance Taylor <iant@google.com>
10543 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10544 Xindex::read_symtab_xindex.
10546 2010-01-07 Doug Kwan <dougkwan@google.com>
10548 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10549 (Insn_template::thumb16_bcond_insn): New method declaration.
10550 (Insn_template): Fix spelling.
10551 (Stub::thumb16_special): New method declaration.
10552 (Stub::do_write): Define virtual method which was previously pure
10554 (Stub::do_thumb16_special): New method declaration.
10555 (Stub::do_fixed_endian_write): New template member.
10556 (Reloc_stub::do_write): Remove.
10557 (Reloc_stub::do_fixed_endian_write): Remove.
10558 (Cortex_a8_stub): New class definition.
10559 (Stub_factory::make_cortex_a8_stub): New method definition.
10560 (Stub_factory::Stub_factory): Add missing static storage class
10561 qualifier for elf32_arm_stub_a8_veneer_blx.
10563 2010-01-07 Ian Lance Taylor <iant@google.com>
10566 * options.h (class General_options): Add --warn-unresolved-symbols
10567 and --error-unresolved-symbols.
10568 * errors.cc (Errors::undefined_symbol): Implement
10569 --warn-unresolved-symbols.
10571 * options.h (class General_options): Add -z text and -z textoff.
10572 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10574 2010-01-06 Sriraman Tallam <tmsriram@google.com>
10576 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10577 (Garbage_collection::cident_sections): New function.
10578 (Garbage_collection::add_cident_section): New function.
10579 (Garbage_collection::cident_sections_): New member.
10580 (gc_process_relocs): Add references to sections whose names are C
10582 * gold.h (cident_section_start_prefix): New constant.
10583 (cident_section_stop_prefix): New constant.
10584 (is_cident): New function.
10585 * layout.cc (Layout::define_section_symbols): Replace string constants
10586 with the newly defined constants.
10587 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10589 * testsuite/Makefile.am: Add gc_orphan_section_test.
10590 * testsuite/Makefile.in: Regenerate.
10591 * testsuite/gc_orphan_section_test.cc: New file.
10592 * testsuite/gc_orphan_section_test.sh: New file.
10594 2010-01-06 Ian Lance Taylor <iant@google.com>
10597 * options.h (class General_options): Add --warn-shared-textrel.
10598 * layout.cc (Layout::finish_dynamic_section): Implement
10599 --warn-shared-textrel.
10602 * options.h (class General_options): Add --warn-multiple-gp.
10604 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10606 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10607 $(THREADSLIB) and $(LIBDL).
10608 * Makefile.in: Rebuild.
10610 2010-01-06 Ian Lance Taylor <iant@google.com>
10613 * options.cc (General_options::parse_section_start): New function.
10614 (General_options::section_start): New function.
10615 (General_options::General_options): Initialize all members.
10616 * options.h: Include <map>
10617 (class General_options): Add --section-start. Add section_starts_
10619 * layout.cc (Layout::attach_allocated_section_to_segment): If
10620 --section-start was used, set the address of the segment. Remove
10621 local sort_sections.
10622 (Layout::relaxation_loop_body): If the address of the load segment
10623 has been set by --section-start, don't use it.
10624 * output.h (Output_segment::update_flags_for_output_section): New
10626 * output.cc (Output_segment::add_output_section): Call
10627 update_flags_for_output_section.
10629 2010-01-05 Ian Lance Taylor <iant@google.com>
10632 * options.h (class General_options): Add --undefined-version.
10633 * script.cc (struct Version_expression): Add was_matched_by_symbol
10635 (Version_script_info::matched_symbol): New function.
10636 (Version_script_info::get_symbol_version_helper): Call
10638 (Version_script_info::check_unmatched_names): New function.
10639 * script.h (class Version_script_info): Update declarations.
10640 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10642 * options.h (class General_options): Use DEFINE_bool_alias for
10643 allow_multiple_definition.
10644 * resolve.cc (Symbol_table::should_override): Don't test
10645 allow_multiple_definition.
10648 * options.h (class General_options): Add --cref.
10649 * main.cc (main): Print cref table if --cref. Don't close mapfile
10650 until after printing cref table.
10651 * cref.cc: Include "symtab.h".
10652 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10653 (Cref_table_compare::operator()): New function.
10654 (Cref_inputs::gather_cref): New function.
10655 (filecol): New static const.
10656 (Cref_inputs::print_cref): New function.
10657 (Cref::print_cref): New function.
10658 * cref.h: Include <cstdio>.
10659 (class Cref): Update declarations.
10660 * mapfile.h (Mapfile::file): New function.
10661 * object.h (class Object): Define Symbols. Declare virtual
10662 do_get_global_symbols.
10663 (Object::get_global_symbols): New function.
10664 * object.cc (Input_objects::add_object): Pass object to cref_ if
10666 (Input_objects::archive_start): Likewise.
10667 (Input_objects::archive_stop): Likewise.
10668 (Input_objects::print_cref): New function.
10669 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10670 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10672 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10674 * plugin.h (class Sized_pluginobj): Update declarations.
10676 2010-01-05 Ian Lance Taylor <iant@google.com>
10678 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10679 to is_default_version. Rename insdef to insdefault.
10680 (Symbol_table::add_from_relobj): Rename def to is_default_version
10681 and local to is_forced_local.
10682 (Symbol_table::add_from_pluginobj): Likewise.
10683 (Symbol_table::add_from_dynobj): Likewise.
10684 (Symbol_table::define_special_symbol): Rename insdef to
10687 2010-01-04 Ian Lance Taylor <iant@google.com>
10690 * options.h (class General_options): Add
10691 --allow-multiple-definition and -z muldefs.
10692 * resolve.cc (Symbol_table::should_override): Don't warn about a
10693 multiple symbol definition if --allow-multiple-definition or -z
10697 * options.h (class General_options): Add --add-needed and
10698 --copy-dt-needed-entries. Tweak --as-needed help entry.
10699 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10700 error if --copy-dt-needed-entries aka --add-needed is used and
10701 would cause a change in behaviour.
10704 * options.h (class General_options): Add -G as a short version of
10705 --shared. Add no-op options -assert, -g, and -i.
10707 2010-01-04 Sriraman Tallam <tmsriram@google.com>
10709 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10710 check for .text or .gnu.linkonce.t sections.
10711 * icf.cc (Icf::find_identical_sections): Ditto.
10712 Change the detection for mangled function name within the section
10714 * icf.h (is_section_foldable_candidate): New function.
10716 2009-12-30 Ian Lance Taylor <iant@google.com>
10719 * options.h (class General_options): Permit two dashes with
10720 --retain-symbols-file.
10722 2009-12-30 Ian Lance Taylor <iant@google.com>
10725 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10726 don't put the file header and segment headers in the text
10730 * common.cc (Sort_commons::operator()): Stabilize sort when both
10732 (Symbol_table::do_allocate_commons_list): When allocating common
10733 symbols, skip a symbol which is no longer common.
10734 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10735 an object before checking its type.
10736 * testsuite/common_test_2.c: New file.
10737 * testsuite/common_test_3.c: New file.
10738 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10739 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10740 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10741 (common_test_2_pic.o, common_test_2.so): New targets.
10742 (common_test_3_pic.o, common_test_3.so): New targets.
10743 * testsuite/Makefile.in: Rebuild.
10746 * script.cc (read_input_script): If we see a new SECTIONS clause,
10747 and we have added an input section, give an error.
10748 * layout.h (class Layout): Add have_added_input_section function.
10749 Add have_added_input_section_ field.
10750 * layout.cc (Layout::Layout): Initialize
10751 have_added_input_section_.
10752 (Layout::layout): Set have_added_input_section_.
10753 (Layout::layout_eh_frame): Likewise.
10755 2009-12-30 Ian Lance Taylor <iant@google.com>
10758 * options.h (class General_options): Add --sort-common option.
10759 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10760 * common.cc (Sort_common): Add sort_order parameter to
10761 constructor. Add sort_order_ field.
10762 (Sort_commons::operator): Check sort_order_.
10763 (Symbol_table::allocate_commons): Determine the sort order.
10764 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10765 Change all callers.
10766 (Symbol_table::do_allocate_commons_list): Likewise.
10768 2009-12-30 Ian Lance Taylor <iant@google.com>
10771 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10772 symbols from this object, don't change the visibility of an
10774 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10776 2009-12-30 Ian Lance Taylor <iant@google.com>
10779 * script.h (class Version_script_info): Define Language enum.
10780 Update declarations. Define Glob, Exact, and Lookup types. Add
10781 new fields globals_, locals_, and is_finalized_.
10782 * script.cc: Various formatting fixes.
10783 (class Parser_closure): Change language_stack_ from a vector of
10784 std::string to one of Version_script_info::Language. Adjust all
10786 (class Lazy_demangler): Remove.
10787 (struct Version_expression): Change language from std::string to
10788 Version_script_info::Language.
10789 (Version_script_info::Version_script_info): New function.
10790 (Version_script_info::~Version_script_info): Don't call clear.
10791 (Version_script_info::finalize): New function.
10792 (Version_script_info::build_lookup_tables): New function.
10793 (Version_script_info::build_expression_list_lookup): New
10795 (Version_script_info::get_symbol_version_helper): Rewrite to use
10797 (Version_script_info::print_expression_list): Adjust to use
10798 Version_script_info::Language.
10799 (script_push_lex_into_version_mode): Check that the version script
10800 has not been finalized.
10801 (version_script_push_lang): Change language string to
10802 Version_script_info::Language.
10803 * options.cc (Command_line::version_script): New function.
10804 * options.h (class General_options): Add finalize_dynamic_list
10805 function. Change version_script from declaration to definition.
10806 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10807 * testsuite/version_script.map: Remove duplicate def of foo.
10808 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10809 version_script.map.
10810 * testsuite/Makefile.in: Rebuild.
10812 2009-12-30 Ian Lance Taylor <iant@google.com>
10815 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10816 if the input symbol index is 0, make the output symbol index 0.
10818 2009-12-30 Ian Lance Taylor <iant@google.com>
10821 * options.h (class General_options): Add -x/--discard-all.
10822 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10823 --discard-all. If the local symbol needs a dynamic entry, check
10824 that before handling --discard-locals.
10826 2009-12-30 Ian Lance Taylor <iant@google.com>
10829 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10831 (Output_segment::add_output_section): Don't change the flags if
10832 the type is PT_TLS.
10835 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10836 GNU hash table if they need a dynamic value. Otherwise, don't add
10837 them if they are defined in a dynamic object or are forced local.
10839 2009-12-29 Ian Lance Taylor <iant@google.com>
10842 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10843 .gnu.hash table for a 32-bit target.
10846 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10847 regular and a dynamic object only needs a dynamic symbol table
10848 entry if it is externally visible.
10851 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10852 constructor. Add global_offset_table_ field.
10853 (Target_i386::got_section): Set global_offset_table_.
10854 (Target_i386::do_finalize_sections): Set global_offset_table_
10856 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10857 in constructor. Add global_offset_table_ field.
10858 (Target_x86_64::got_section): Set global_offset_table_.
10859 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10862 * layout.cc (Layout::Layout): Initialize increase_relro_.
10863 (Layout::get_output_section): Add is_relro, is_last_relro, and
10864 is_first_non_relro parameters. Change all callers.
10865 (Layout::choose_output_section): Likewise.
10866 (Layout::add_output_section_data): Likewise.
10867 (Layout::make_output_section): Likewise.
10868 (Layout::set_segment_offsets): Clear increase_relro when using a
10870 * layout.h (class Layout): Add increase_relro method. Add
10871 increase_relro_ field. Update declarations.
10872 * output.cc (Output_section::Output_section): Initialize
10873 is_last_relro_ and is_first_non_relro_.
10874 (Output_segment::add_output_section): Group relro sections is
10875 do_sort is true. Handle is_last_relro and is_first_non_relro.
10876 (Output_segment::maximum_alignment): Remove relro handling.
10877 (Output_segment::set_section_addresses): Add increase_relro
10878 parameter. Change all callers. Add initial alignment to align
10879 relro sections on separate page. Remove old relro handling.
10880 (Output_segment::set_section_list_addresses): Remove in_relro
10881 parameter. Change all callers.
10882 (Output_segment::set_offset): Add increase parameter. Change all
10883 callers. Remove old relro handling.
10884 * output.h (class Output_section): Add new methods: is_last_relro,
10885 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10886 Add is_last_relro_ and is_first_non_relro_ fields.
10887 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10888 Create separate .got.plt section. Call increase_relro.
10889 * x86_64.cc (Target_x86_64::got_section): Likewise.
10890 * testsuite/relro_script_test.t: Add .got.plt.
10893 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10894 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10895 (Layout::finalize): Call set_dynamic_symbol_size.
10896 (Layout::set_dynamic_symbol_size): New function.
10897 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10898 set_dynamic_symbol_size.
10901 * output.h (class Output_section): Add is_entsize_zero_ field.
10902 * output.cc (Output_section::Output_section): Initialize
10904 (Output_section::set_entsize): If two different entsizes are
10905 requested, force it to zero.
10906 (Output_section::add_input_section): Set flags for .debug_str
10907 before updating section flags. Set entsize.
10908 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10909 and SHF_STRING if all input sections have those flags.
10911 2009-12-29 Rafael Espindola <espindola@google.com>
10913 * main.cc (main): Fix the sys time reporting.
10914 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10917 2009-12-29 Sriraman Tallam <tmsriram@google.com>
10919 * options.cc (General_options::parse_version): Allow -v to exit
10920 without an error if there is nothing to link.
10922 2009-12-29 Ian Lance Taylor <iant@google.com>
10924 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10925 using a version of gcc before 4.1.
10926 * configure: Rebuild.
10928 2009-12-28 Chris Demetriou <cgd@google.com>
10930 * attributes.cc (Output_attributes_section_data::do_write): Use
10931 std::vector::front rather than std::vector::data.
10933 2009-12-28 Ian Lance Taylor <iant@google.com>
10935 * symtab.h (class Symbol_table): Add enum Defined.
10936 * resolve.cc (Symbol_table::should_override): Add defined
10937 parameter. Change all callers. Test whether object is NULL
10938 before calling a method on it.
10939 (Symbol_table::report_resolve_problem): Add defined parameter.
10940 Change all callers.
10941 (Symbol_table::should_override_with_special): Likewise.
10942 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10943 parameter. Change all callers.
10944 (Symbol_table::do_define_in_output_data): Likewise.
10945 (Symbol_table::define_in_output_segment): Likewise.
10946 (Symbol_table::do_define_in_output_segment): Likewise.
10947 (Symbol_table::define_as_constant): Likewise.
10948 (Symbol_table::do_define_as_constant): Likewise.
10949 * script.h (class Symbol_assignment): Add is_defsym parameter to
10950 constructor; change all callers.
10951 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10952 parameter. Change all callers. Add is_defsym_ field.
10953 (class Parser_closure): Add parsing_defsym parameter to
10954 constructor; change all callers. Add parsing_defsym accessor
10955 function. Add parsing_defsym_ field.
10957 2009-12-28 Ian Lance Taylor <iant@google.com>
10959 * gold.cc (queue_middle_tasks): Fix formatting.
10960 * object.cc (Relobj::is_section_name_included): Likewise.
10962 2009-12-23 Ian Lance Taylor <iant@google.com>
10964 * i386.cc (Target_i386::do_calls_non_split): Recognize
10965 -fsplit-stack prologue for a function with a static chain.
10966 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10967 -fsplit-stack prologue when using %r11.
10969 2009-12-21 Sriraman Tallam <tmsriram@google.com>
10971 * options.cc (General_options::parse_version): Make -v continue and do
10972 the link like GNU ld does.
10974 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
10976 * Makefile.am (CCFILES): Add timer.cc.
10977 (HFILES): Add timer.h.
10978 * configure.ac: Check for sysconf and times.
10979 * main.cc: include timer.h.
10980 (main): Use Timer instead of get_run_time.
10983 * workqueue.cc: include timer.h.
10984 (Workqueue::find_and_run_task):
10985 Report user, sys and wall time.
10986 * Makefile.in: Regenerate.
10987 * config.in: Regenerate.
10988 * configure: Regenerate.
10990 2009-12-16 Doug Kwan <dougkwan@google.com>
10992 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10994 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10995 relaxed input sections.
10996 * output.cc (Output_section::find_relaxed_input_section): Change
10997 return type to Output_relaxed_input_section pointer. Adjust code
10998 for new type of relaxed_input_section_map_.
10999 * output.h (Output_section::find_relaxed_input_section): Change
11000 return type to Output_relaxed_input_section pointer.
11001 (Output_section::Output_relaxed_input_section_by_input_section_map):
11003 (Output_section::relaxed_input_section_map_): Change type to
11004 Output_section::Output_relaxed_input_section_by_input_section_map.
11005 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11008 2009-12-15 Ian Lance Taylor <iant@google.com>
11010 * layout.cc (Layout::create_shstrtab): Only write out after input
11011 sections if we are compressing debug sections.
11013 2009-12-15 Ian Lance Taylor <iant@google.com>
11015 * archive.cc (Archive::add_symbols): Only look up a symbol without
11016 a version if there is, in fact, a version.
11018 2009-12-14 Ian Lance Taylor <iant@google.com>
11020 Revert -Wshadow changes, all changes from:
11021 2009-12-11 Doug Kwan <dougkwan@google.com>
11022 2009-12-11 Nick Clifton <nickc@redhat.com>
11023 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11025 2009-12-11 Doug Kwan <dougkwan@google.com>
11027 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11029 * attributes.cc (Object_attribute::size): Ditto.
11030 (Attributes_section_data::size): Ditto.
11031 (Attributes_section_data::Attributes_section_data): Ditto.
11032 (Output_attributes_section_data::do_write): Ditto.
11033 * attributes.h (Object_attribute::set_type): Ditto.
11034 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11036 2009-12-11 Nick Clifton <nickc@redhat.com>
11038 * archive.cc: Fix shadowed variable warnings.
11039 * arm.cc: Likewise.
11040 * compressed_output.cc: Likewise.
11041 * compressed_output.h: Likewise.
11042 * configure: Likewise.
11043 * dwarf_reader.cc: Likewise.
11044 * dynobj.cc: Likewise.
11045 * dynobj.h: Likewise.
11046 * ehframe.cc: Likewise.
11047 * ehframe.h: Likewise.
11048 * errors.cc: Likewise.
11049 * expression.cc: Likewise.
11050 * fileread.cc: Likewise.
11051 * fileread.h: Likewise.
11052 * freebsd.h: Likewise.
11053 * i386.cc: Likewise.
11054 * icf.cc: Likewise.
11055 * incremental.h: Likewise.
11056 * layout.cc: Likewise.
11057 * layout.h: Likewise.
11058 * mapfile.cc: Likewise.
11059 * merge.cc: Likewise.
11060 * merge.h: Likewise.
11061 * object.cc: Likewise.
11062 * object.h: Likewise.
11063 * options.h: Likewise.
11064 * output.cc: Likewise.
11065 * output.h: Likewise.
11066 * parameters.cc: Likewise.
11067 * plugin.cc: Likewise.
11068 * powerpc.cc: Likewise.
11069 * reduced_debug_output.cc: Likewise.
11070 * reduced_debug_output.h: Likewise.
11071 * reloc.cc: Likewise.
11072 * reloc.h: Likewise.
11073 * resolve.cc: Likewise.
11074 * script-sections.cc: Likewise.
11075 * script.cc: Likewise.
11076 * script.h: Likewise.
11077 * sparc.cc: Likewise.
11078 * symtab.cc: Likewise.
11079 * symtab.h: Likewise.
11080 * target-select.cc: Likewise.
11081 * target-select.h: Likewise.
11082 * token.h: Likewise.
11083 * workqueue.cc: Likewise.
11084 * workqueue.h: Likewise.
11085 * x86_64.cc: Likewise.
11087 2009-12-10 Doug Kwan <dougkwan@google.com>
11089 * arm.cc (attributes.h): New include.
11090 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11091 (Arm_relobj::~Arm_relobj): Delete object pointed by
11092 attributes_section_data_.
11093 (Arm_relobj::attributes_section_data): New method definition.
11094 (Arm_relobj::attributes_section_data_): New data member declaration.
11095 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11096 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11097 attributes_section_data_.
11098 (Arm_dynobj::attributes_section_data): New method definition.
11099 (Arm_dynobj::attributes_section_data_): New data member declaration.
11100 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11101 initialization value of may_use_blx_ to false.
11102 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
11103 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11104 object attributes to compute results instead of hard-coding.
11105 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11106 Target_arm::get_secondary_compatible_arch,
11107 Target_arm::set_secondary_compatible_arch
11108 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11109 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11110 New method declarations.
11111 (Target_arm::get_aeabi_object_attribute): New method definition.
11112 (Target_arm::attributes_section_data_): New data member declaration.
11113 (read_arm_attributes_section): New template definition.
11114 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11115 (Arm_dynobj::do_read_symbols): Ditto.
11116 (Target_arm::do_finalize_sections): Merge attributes sections from
11117 input. Check for BLX use after attributes section merging.
11118 Fix __exidx_start and __exidx_end visibility. Create an
11119 .ARM.attributes section if necessary.
11120 (Target_arm::get_secondary_compatible_arch,
11121 Target_arm::set_secondary_compatible_arch,
11122 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11123 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
11124 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
11125 New method definitions.
11127 2009-12-09 Ian Lance Taylor <iant@google.com>
11129 * plugin.cc (Plugin::load): Don't cast from void* to a function
11132 2009-12-09 Ian Lance Taylor <iant@google.com>
11134 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11135 information fields.
11137 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11139 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11140 Replace two_file_shared_1.so with two_file_shared_2.so.
11141 * testsuite/Makefile.in: Regenerated.
11143 2009-12-08 Doug Kwan <dougkwan@google.com>
11145 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11146 (HFILES): Add attributes.h and int_encoding.h.
11147 * Makefile.in: Regenerate.
11148 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11149 function definitions to int_encoding.cc
11150 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11151 prototypes to int_encoding.h
11152 * reduced_debug_output.cc (int_encoding.h): New include.
11153 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11154 function definitions to int_encoding.cc
11155 (insert_into_vector, read_from_pointer): Move template definitions to
11157 * attributes.cc: New file.
11158 * attributes.h: New file.
11159 * int_encoding.cc: New file.
11160 * int_encoding.h: New file.
11162 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
11165 * incremental-dump.cc (dump_incremental_inputs): New.
11166 (main): Use dump_incremental_inputs.
11168 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11171 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11172 checking elfcpp::STT_FUNC.
11173 (Target_i386::Relocate::relocate): Likewise.
11174 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11176 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11177 symbols from shared libraries into normal FUNC symbols.
11179 * symtab.h (Symbol): Add is_func and use it.
11181 2009-12-05 Doug Kwan <dougkwan@google.com>
11183 * arm.cc (Target_arm::arm_info): Initialize new fields
11184 attributes_section and attributes_vendor.
11185 * i386.cc (Target_i386::i386_info): Same.
11186 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11187 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11188 fields attributes_section and attributes_vendor.
11189 * sparc.cc (Target_sparc::sparc_info): Same.
11190 * target.h (Target::attributes_section, Target::attributes_vendor,
11191 Target::is_attributes_section, Target::attribute_arg_type,
11192 Target::attributes_order): New method definitions.
11193 (Target::Target_info::attributes_section,
11194 Target::Target_info::attributes_vendor): New fields.
11195 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11196 virtual method definitions.
11197 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11198 attributes_section and attributes_vendor.
11199 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11201 2009-12-05 Doug Kwan <dougkwan@google.com>
11203 * arm.cc: Update comments about interworking and stub generation.
11204 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11205 considered as non-PIC.
11206 (Arm_relocate_functions::base_abs): Fix formatting.
11207 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11208 of function to use GOT entry address instead of offset.
11209 (Target_arm::Scan::global): Issue an error if a symbol would need a
11210 PLT does not get one because it is untyped. Remove code to create
11211 dynamic symbols for relative branches.
11212 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11213 takes unsigned integer instead of boolean.
11215 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11217 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11218 (two_file_test_LDADD): Likewise.
11219 (common_test_1_LDADD): Likewise.
11220 (exception_test_LDADD) Likewise.
11221 (weak_test_LDADD): Likewise.
11222 (many_sections_test_LDADD): Likewise.
11223 (initpri1_LDADD): Likewise.
11224 (script_test_1_LDADD): Likewise.
11225 (script_test_2_LDADD): Likewise.
11226 (justsyms_LDADD): Likewise.
11227 (binary_test_LDADD): Likewise.
11228 (large_LDADD): Likewise.
11229 * testsuite/Makefile.in: Regenerated.
11231 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
11233 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11234 (Symbol_table::override_with_special): Likewise.
11235 (Symbol_table::add_from_object): Likewise.
11237 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
11239 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11240 Don't set the data_offset twice.
11242 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
11244 * testsuite/Makefile.in: Regenerate.
11246 2009-12-03 Doug Kwan <dougkwan@google.com>
11248 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11249 (Target_arm::do_finalize_sections): Add parameter for symbol table
11250 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11251 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11252 parameter for symbol table pointer.
11253 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11254 an additional parameter for a pointer to symbol table.
11255 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11256 parameter for a symbol table pointer.
11257 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11258 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11260 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11261 parameter for a symbol table pointer.
11263 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
11265 * incremental.cc (Incremental_inputs_header)
11266 (Incremental_inputs_header_write, Incremental_inputs_entry)
11267 (Incremental_inputs_entry_write): Move ...
11268 * incremental.h (Incremental_inputs_header)
11269 (Incremental_inputs_header_write, Incremental_inputs_entry)
11270 (Incremental_inputs_entry_write): here.
11272 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11274 * incremental.cc (make_sized_incremental_binary): Set the target.
11275 Error if it is incompatible.
11276 * output.h (Output_file): Add filename method.
11278 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11280 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11281 from the get_* methods.
11283 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11285 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11286 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11287 Write 0 for the data_offset of scripts.
11289 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11291 * testsuite/Makefile.am: Add the incremental_test.sh test.
11292 * testsuite/incremental_test.sh: New.
11293 * testsuite/incremental_test_1.c: New.
11294 * testsuite/incremental_test_2.c: New.
11296 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
11298 * incremental-dump.cc (main): Fix typos.
11300 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
11303 * incremental-dump.cc (main): Use llu to print 64 bit values.
11305 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11306 H.J. Lu <hongjiu.lu@intel.com>
11308 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11310 (incremental_dump_LDADD): Likewise.
11311 * Makefile.in: Regenerated.
11313 2009-11-25 Doug Kwan <dougkwan@google.com>
11317 2009-11-25 Doug Kwan <dougkwan@google.com>
11319 * arm.cc (Target_arm::Target_arm): Move method definition
11320 outside of class definition. Add code to handle
11321 --target1-rel, --target1-abs and --target2= options.
11322 (Target_arm::get_reloc_reloc_type): Change method to be
11323 non-static and const.
11324 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11325 New data member declaration.
11326 (Target_arm::Scan::local, Target_arm::Scan::global,
11327 Target_arm::Relocate::relocate,
11328 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11329 Adjust call to Target_arm::get_real_reloc_type.
11330 (Target_arm::get_real_reloc_type): Use command line options
11331 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11332 * options.h (--target1-rel, --target1-abs, --target2): New
11335 2009-11-25 Doug Kwan <dougkwan@google.com>
11337 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11338 class definition. Add code to handle --target1-rel, --target1-abs
11339 and --target2= options.
11340 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11342 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11343 member declaration.
11344 (Target_arm::Scan::local, Target_arm::Scan::global,
11345 Target_arm::Relocate::relocate,
11346 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11347 call to Target_arm::get_real_reloc_type.
11348 (Target_arm::get_real_reloc_type): Use command line options to
11349 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11350 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11353 2009-11-25 Doug Kwan <dougkwan@google.com>
11355 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11356 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11357 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11359 (Arm_relocate_functions::thm_call): Replace body with a call to
11360 Arm_relocate_functions::thumb_branch_common.
11361 (Arm_relocate_functions::thm_jump24,
11362 Arm_relocate_functions::thm_xpc22): New method definitions.
11363 (Arm_relocate_functions::thumb_branch_common): New method definition.
11364 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11366 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11367 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11369 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11371 * Makefile.am: Build incremental-dump
11372 * Makefile.in: Regenerate.
11373 * incremental-dump.cc: New.
11374 * incremental.cc (Incremental_inputs_header_data,
11375 Incremental_inputs_entry_data): Move to incremental.h
11376 * incremental.h: (Incremental_inputs_header_data,
11377 Incremental_inputs_entry_data): Move from incremental.cc
11379 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11381 * incremental.cc (Incremental_inputs_header,
11382 Incremental_inputs_header_write, Incremental_inputs_entry,
11383 Incremental_inputs_entry_write): Add a typedef with the data type.
11385 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11387 * incremental.cc (Incremental_inputs_header,
11388 Incremental_inputs_header_write, Incremental_inputs_entry,
11389 Incremental_inputs_entry_write): Update comment about which
11390 type has the filed descriptions.
11392 2009-11-15 Doug Kwan <dougkwan@google.com>
11394 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11395 (Arm_relocate_functions::arm_branch_common): Change method defintion
11396 in class definition to a method declaration and update list of formal
11398 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11399 Arm_relocation_functions::jump24): Adjust call to
11400 Arm_relocate_functions::arm_branch_common. Update list of formal
11402 (Arm_relocate_functions::xpc25): New method definition.
11403 (Arm_relocate_functions::arm_branch_common): Move method defintion
11404 out from class definition. Use stubs for mode-switching and extending
11406 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11407 specially. Change code to enable use of stubs in ARM branches.
11409 2009-11-10 Doug Kwan <dougkwan@google.com>
11411 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11412 in method declaration.
11413 (Target_arm::relocate_stub): New method declaration.
11414 (Target_arm::default_target): Change to return a pointer instead of
11416 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11417 Target_arm::default_target.
11418 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11420 (Target_arm::relocate_section): Adjust view.
11421 (Target_arm::relocate_stub): New method definition.
11423 2009-11-10 Doug Kwan <dougkwan@google.com>
11425 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11427 * incremental.cc (open_incremental_binary): Initialized local
11428 variables to avoid warnings.
11429 * object.cc (make_elf_object): Ditto.
11430 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11433 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11436 * testsuite/plugin_test.c: Include "config.h".
11438 2009-11-09 Doug Kwan <dougkwan@google.com>
11440 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11441 (arm_symbol_value): Remove.
11442 (Arm_relocate_functions::arm_branch_common,
11443 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11444 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11445 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11446 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11447 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11448 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11449 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11450 Arm_relocate_functions::thm_mobw_abs_nc,
11451 Arm_relocate_functions::thm_mov_abs,
11452 Arm_relocate_functions::movw_prel_nc,
11453 Arm_relocate_functions::thm_movt_abs,
11454 Arm_relocate_functions::movt_prel,
11455 Arm_relocate_functions::thm_movw_prel_nc,
11456 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11457 (Target_arm::Relocate::relocate): Only decompose address into two
11458 parts if relocation type uses the thumb-bit and pass the actual
11459 bit instead of a flag indicating that the thumb-bit is used. Adjust
11460 calls to methods in Arm_relocate_functions for this change.
11462 2009-11-08 Ian Lance Taylor <iant@google.com>
11465 * reloc.cc: Instantiate
11466 Sized_relobj::initialize_input_to_output_maps and
11467 Sized_relobj:free_input_to_output_maps.
11469 2009-11-06 Ian Lance Taylor <iant@google.com>
11472 * defstd.cc (in_segment): Set only_if_ref true for "end".
11474 2009-11-06 Doug Kwan <dougkwan@google.com>
11476 * arm.cc (class Reloc_stub): Correct a comment.
11477 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11478 (Target_arm::scan_section_for_stubs): New method declaration.
11479 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11480 Change methods from private to protected.
11481 (Target_arm::do_may_relax): New method definition.
11482 (Target_arm::do_relax, Target_arm::group_sections,
11483 Target_arm::scan_reloc_for_stub,
11484 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11485 (Target_arm::arm_input_section_map_): New data member declaration.
11486 (Target_arm::scan_reloc_for_stub,
11487 Target_arm::scan_reloc_section_for_stubs,
11488 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11489 Target_arm::do_relax): New method definitions.
11491 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11493 * configure.ac: Check for (struct stat)::st_mtim
11494 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11495 * config.in: Regenerate.
11496 * configure: Regenerate.
11498 2009-11-05 Ian Lance Taylor <iant@google.com>
11501 * output.cc (Output_segment::add_output_section): Add missing
11504 2009-11-04 Ian Lance Taylor <iant@google.com>
11507 * object.h (class Object): Add is_needed and set_is_needed
11508 methods. Add is_needed_ field. Make bool fields into bitfields.
11509 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11510 defined in a dynamic object and referenced by a regular object,
11511 set is_needed for the dynamic object.
11512 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11513 if the file is marked with as_needed and it is not needed.
11515 2009-11-04 Ian Lance Taylor <iant@google.com>
11518 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11519 tags if data is discarded by linker script.
11520 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11521 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11522 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11523 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11525 2009-11-04 Ian Lance Taylor <iant@google.com>
11527 * layout.cc (Layout::get_output_section): Add is_interp and
11528 is_dynamic_linker_section parameters. Change all callers.
11529 (Layout::choose_output_section): Likewise.
11530 (Layout::make_output_section): Likewise.
11531 (Layout::add_output_section_data): Add is_dynamic_linker_section
11532 parameter. Change all callers.
11533 * layout.h (class Layout): Update declarations.
11534 * output.h (class Output_section): Add is_interp, set_is_interp,
11535 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11536 Add is_interp_, is_dynamic_linker_section_ fields. Change
11537 generate_code_fills_at_write_ to a bitfield.
11538 * output.cc (Output_section::Output_sections): Initialize new
11540 (Output_segment::add_output_section): Add do_sort parameter.
11541 Change all callers.
11543 2009-11-03 Ian Lance Taylor <iant@google.com>
11546 * options.h (class General_options): Add --warn-common.
11547 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11548 merging two common symbols.
11549 (Symbol_table::should_override): Handle --warn-common when merging
11550 a common symbol with a defined symbol. Use report_resolve_problem
11551 for multiple definitions.
11552 (Symbol_table::report_resolve_problem): New function.
11553 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11555 2009-11-03 Doug Kwan <dougkwan@google.com>
11557 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11559 (Target_arm::stub_factory): New method definition.
11560 (Target_arm::new_arm_input_section,
11561 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11562 Target_arm::reloc_uses_thumb_bit): New method declarations.
11563 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
11564 New type definitions.
11565 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11566 member declarations.
11567 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11568 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11569 New method definitions.
11571 2009-11-03 Ian Lance Taylor <iant@google.com>
11573 * options.h (class General_options): Add --warn_constructors.
11575 2009-11-03 Ian Lance Taylor <iant@google.com>
11578 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11579 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11581 2009-11-03 Ian Lance Taylor <iant@google.com>
11584 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11585 --msgid-bugs-address.
11586 (install-pdf): New target.
11587 (install-data_yes): Look up one directory to find mkinstalldirs.
11589 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11591 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11594 2009-10-30 Doug Kwan <dougkwan@google.com>
11596 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11598 2009-10-30 Doug Kwan <dougkwan@google.com>
11600 * arm.cc (Stub_addend_reader): New struct template definition
11601 and partial specializations.
11602 (Stub_addend_reader::operator()): New method definition for a
11603 partially specialized template.
11605 2009-10-30 Doug Kwan <dougkwan@google.com>
11607 * arm.cc (Arm_relobj::processor_specific_flags): New method
11609 (Arm_relobj::do_read_symbols): New method declaration.
11610 (Arm_relobj::processor_specific_flags_): New data member declaration.
11611 (Arm_dynobj): New class definition.
11612 (Target_arm::do_finalize_sections): Add input_objects parameter.
11613 (Target_arm::do_adjust_elf_header): New method declaration.
11614 (Target_arm::are_eabi_versions_compatible,
11615 (Target_arm::merge_processor_specific_flags): New method declaration.
11616 (Target_arm::do_make_elf_object): New overloaded method definitions
11618 (Arm_relobj::do_read_symbols): New method definition.
11619 (Arm_dynobj::do_read_symbols): Ditto.
11620 (Target_arm::do_finalize_sections): Add input_objects parameters.
11621 Merge processor-specific flags from all input objects.
11622 (Target_arm::are_eabi_versions_compatible,
11623 Target_arm::merge_processor_specific_flags,
11624 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11625 New method definitions.
11626 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11627 Input_objects pointer type parameter.
11628 * layout.cc (Layout::finalize): Pass input objects to target's.
11629 finalize_sections function.
11630 * output.cc (Output_file_header::do_sized_write): Set ELF file
11631 header's processor-specific flags.
11632 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11633 Input_objects pointer type parameter.
11634 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11635 * target.h (Input_objects): New forward class declaration.
11636 (Target::processor_specific_flags,
11637 Target::are_processor_specific_flags_sect): New method definitions.
11638 (Target::finalize_sections): Add input_objects parameter.
11639 (Target::Target): Initialize processor_specific_flags_ and
11640 are_processor_specific_flags_set_.
11641 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11643 (Target::set_processor_specific_flags): New method definition.
11644 (Target::processor_specific_flags_,
11645 Target::are_processor_specific_flags_set_): New data member
11647 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11648 Input_objects pointer type parameter.
11650 2009-10-30 Doug Kwan <dougkwan@google.com>
11652 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11654 2009-10-28 Ian Lance Taylor <iant@google.com>
11656 * object.h (class Relobj): Drop options parameter from
11657 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11658 do_scan_relocs, do_relocate. Change all callers.
11659 (class Sized_relobj): Drop options parameters from
11660 do_gc_process_relocs, do_scan_relocs, do_relocate,
11661 do_relocate_sections, relocate_sections, emit_relocs_scan,
11662 emit_relocs_scan_reltype. Change all callers.
11663 (struct Relocate_info): Remove options field and all references to
11665 * reloc.h (class Read_relocs): Remove options constructor
11666 parameter and options_ field. Change all callers.
11667 (class Gc_process_relocs, class Scan_relocs): Likewise.
11668 (class Relocate_task): Likewise.
11669 * target-reloc.h (scan_relocs): Remove options parameter. Change
11671 (scan_relocatable_relocs): Likewise.
11672 * target.h (class Sized_target): Remove options parameter from
11673 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11675 * gc.h (gc_process_relocs): Remove options parameter. Change all
11677 * arm.cc: Update functions to remove options parameters.
11678 * i386.cc: Likewise.
11679 * powerpc.cc: Likewise.
11680 * sparc.cc: Likewise.
11681 * x86_64.cc: Likewise.
11682 * testsuite/testfile.cc: Likewise.
11684 2009-10-28 Doug Kwan <dougkwan@google.com>
11686 * arm.cc (Arm_relobj): New class definition.
11687 (Arm_relobj::scan_sections_for_stubs,
11688 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11689 New method definitions.
11691 2009-10-28 Cary Coutant <ccoutant@google.com>
11693 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11694 (Plugin::cleanup_done_): New member.
11695 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11696 (Plugin_manager::cleanup_done_): Remove.
11697 (Plugin_manager::add_input_file): Edit error message.
11698 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11699 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11701 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11703 * fileread.cc: (File_read::View::~View): Use the new
11704 data_ownership_ filed.
11705 (File_read::~File_read): Dispose the new whole_file_view_.
11706 (File_read::open): Mmap the whole file if needed.
11707 (File_read::open): Use whole_file_view_ instead of contents_.
11708 (File_read::find_view): Use whole_file_view_ if applicable.
11709 (File_read::do_read): Use whole_file_view_ instead of contents_.
11710 (File_read::make_view): Use whole_file_view_ instead of contents_,
11711 update File_read::View::View call.
11712 (File_read::find_or_make_view): Update File_read::View::View
11714 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11716 (File_read::View::Data_ownership): New enum.
11717 (File_read::View::View): Replace bool mapped_ with Data_ownership
11719 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11720 (File_read::View::data_ownership_): New field.
11721 (File_read::contents_): Remove (replaced by whole_file_view_).
11722 (File_read::whole_file_view_): New field.
11723 * options.h (class General_options): Add --keep-files-mapped.
11725 2009-10-27 Cary Coutant <ccoutant@google.com>
11727 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11728 * testsuite/Makefile.am (plugin_test_5): New test case.
11729 * testsuite/Makefile.in: Regenerate.
11731 2009-10-25 Doug Kwan <dougkwan@google.com>
11733 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11734 from private to protected to allow access by child class.
11735 (Sized_relobj::do_relocate_sections): New method declaration.
11736 (Sized_relobj::relocate_sections): Virtualize.
11737 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
11738 Sized_relobj::relocate_sections. Instantiate template explicitly
11739 for different target sizes and endianity.
11741 2009-10-24 Doug Kwan <dougkwan@google.com>
11743 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11744 (Arm_input_section::as_arm_input_section): New method.
11745 (Arm_output_section): New class definition.
11746 (Arm_output_section::create_stub_group,
11747 Arm_output_section::group_sections): New method definitions.
11749 2009-10-22 Doug Kwan <dougkwan@google.com>
11751 * arm.cc (Arm_input_section): New class definition.
11752 (Arm_input_section::init, Arm_input_section:do_write,
11753 Arm_input_section::set_final_data_size,
11754 Arm_input_section::do_reset_address_and_file_offset): New method
11757 2009-10-21 Doug Kwan <dougkwan@google.com>
11759 * arm.cc (Stub_table, Arm_input_section): New forward class
11761 (Stub_table): New class defintion.
11762 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11763 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11764 New method definition.
11766 2009-10-21 Doug Kwan <dougkwan@google.com>
11768 * arm.cc: Update copyright comments.
11769 (Target_arm): New forward class template declaration.
11770 (Arm_address): New type.
11771 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11772 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11773 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11775 (Insn_template): Same.
11776 (DEF_STUBS): New macro.
11777 (Stub_type): New enum type.
11778 (Stub_template): New class definition.
11780 (Reloc_stub): Same.
11781 (Stub_factory): Same.
11782 (Target_arm::Target_arm): Initialize may_use_blx_ and
11783 should_force_pic_veneer_.
11784 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11785 Target_arm::should_force_pic_veneer,
11786 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11787 Target_arm::using_thumb_only, Target_arm:;default_target): New
11789 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11790 New data member declarations.
11791 (Insn_template::size, Insn_template::alignment): New method defintions.
11792 (Stub_template::Stub_template): New method definition.
11793 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11794 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11795 (Stub_factory::Stub_factory): New method definition.
11796 * gold.h (string_hash): New template.
11797 * output.h (Input_section_specifier::hash_value): Use
11799 (Input_section_specifier::string_hash): Remove.
11800 * stringpool.cc (Stringpool_template::string_hash): Use
11803 2009-10-20 Doug Kwan <dougkwan@google.com>
11805 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11806 symbols of relaxed input sections.
11807 * output.h (Output_section::find_relaxed_input_section): Make
11810 2009-10-16 Doug Kwan <dougkwan@google.com>
11812 * dynobj.cc (Versions::Versions): Initialize version_script_.
11813 Only insert base version symbol definition for a shared object
11814 if version script defines any version versions.
11815 (Versions::define_base_version): New method definition.
11816 (Versions::add_def): Check that base version is not needed.
11817 (Versions::add_need): Define base version lazily.
11818 * dynobj.h (Versions::define_base_version): New method declaration.
11819 (Versions::needs_base_version_): New data member declaration.
11820 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11821 (check_DATA): Add no_version_test.stdout.
11822 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11824 * testsuite/Makefile.in: Regenerate.
11825 * testsuite/no_version_test.c: New file.
11826 * testsuite/no_version_test.sh: Ditto.
11828 2009-10-16 Doug Kwan <dougkwan@google.com>
11830 * expression.cc (class Segment_start_expression): New class definition.
11831 (Segment_start_expression::value): New method definition.
11832 (script_exp_function_segment_start): Return a new
11833 Segment_start_expression.
11834 * gold/script-c.h (script_saw_segment_start_expression): New function
11836 * script-sections.cc (Script_sections::Script_sections): Initialize
11837 SAW_SEGMENT_START_EXPRESSION_ to false.
11838 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11839 and -Tbbs options to specify section addresses if given in
11840 command line and no SEGMENT_START expression is seen in a script.
11841 * script-sections.h (Script_sections::saw_segment_start_expression,
11842 Script_sections::set_saw_segment_start_expression): New method
11844 (Script_sections::saw_segment_start_expression_): New data member
11846 * script.cc (script_saw_segment_start_expression): New function.
11847 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11848 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11849 script_test_7.sh and script_test_8.sh.
11850 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11851 script_test_8.stdout.
11852 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11853 (script_test_6, script_test_6.stdout, script_test_7,
11854 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11855 * Makefile.in: Regenerate.
11856 * testsuite/script_test_6.sh: New file.
11857 * testsuite/script_test_6.t: Same.
11858 * testsuite/script_test_7.sh: Same.
11859 * testsuite/script_test_7.t: Same.
11860 * testsuite/script_test_8.sh: Same.
11862 2009-10-16 Doug Kwan <dougkwan@google.com>
11864 * output.cc (Output_segment::set_section_list_address): Cast
11865 expressions to unsigned long long type to avoid format warnings.
11867 2009-10-15 Ian Lance Taylor <iant@google.com>
11869 * script.cc (Script_options::add_symbol_assignment): Always add a
11870 dot assignment to script_sections_.
11871 * script-sections.cc (Script_sections::add_dot_assignment):
11872 Initialize if necessary.
11874 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11875 program headers with no load segment if there is a linker script.
11877 * layout.cc (Layout::set_segment_offsets): Align the file offset
11878 to the segment aligment for -N or -n with no load segment.
11879 * output.cc (Output_segment::add_output_section): Don't crash if
11880 the first section is a TLS section.
11881 (Output_segment::set_section_list_addresses): Print an error
11882 message if the address moves backward in a linker script.
11883 * script-sections.cc
11884 (Output_section_element_input::set_section_addresses): Don't
11885 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11886 (Orphan_output_section::set_section_addresses): Likewise.
11888 2009-10-15 Doug Kwan <dougkwan@google.com>
11890 * layout.cc (Layout::finish_dynamic_section): Generate tags
11891 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11892 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11893 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11895 2009-10-14 Ian Lance Taylor <iant@google.com>
11897 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11899 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11900 data_shdr fields of relinfo.
11901 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11902 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11903 R_386_TLS_LDO_32, adjust based on section flags.
11904 (Target_i386::Relocate::fix_up_ldo): Remove.
11906 2009-10-13 Ian Lance Taylor <iant@google.com>
11908 Add support for -pie.
11909 * options.h (class General_options): Add -pie and
11911 (General_options::output_is_position_independent): Test -pie.
11912 (General_options::output_is_executable): Return true if not shared
11913 and not relocatable.
11914 (General_options::output_is_pie): Remove.
11915 * options.cc (General_options::finalize): Reject incompatible uses
11917 * gold.cc (queue_middle_tasks): A -pie link is not static.
11918 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11919 * symtab.cc (Symbol::final_value_is_known): Return false if
11920 output_is_position_independent.
11921 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11922 output_is_position_independent.
11923 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11924 output_is_position_independent.
11925 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11926 output_is_position_independent.
11927 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11929 (basic_pie_test.o, basic_pie_test): New targets.
11930 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11931 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11932 (two_file_pie_test): New target.
11933 * testsuite/Makefile.in: Rebuild.
11934 * README: Remove note saying that -pie is not supported.
11936 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11938 * options.h (class General_options): Add -init and -fini.
11939 * layout.cc (Layout::finish_dynamic_section): Emit
11940 given init and fini functions.
11942 2009-10-13 Sriraman Tallam <tmsriram@google.com>
11944 * gc.h (gc_process_relocs): Check if icf is enabled using new
11946 * gold.cc (queue_initial_tasks): Likewise.
11947 (queue_middle_tasks): Likewise.
11948 * object.cc (do_layout): Likewise.
11949 * symtab.cc (is_section_folded): Likewise.
11950 * main.cc (main): Likewise.
11951 * reloc.cc (Read_relocs::run): Likewise.
11952 (Sized_relobj::do_scan_relocs): Likewise.
11953 * icf.cc (is_function_ctor_or_dtor): New function.
11954 (Icf::find_identical_sections): Check if function is ctor or dtor when
11955 safe icf is chosen.
11956 * options.h (General_options::icf): Change option to be an enum.
11957 (Icf_status): New enum.
11958 (icf_enabled): New method.
11959 (icf_safe_folding): New method.
11960 (set_icf_status): New method.
11961 (icf_status_): New variable.
11962 * (options.cc) (General_options::finalize): Set icf_status_.
11963 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11964 icf_test and icf_keep_unique_test to use the --icf enum flag.
11965 * testsuite/icf_safe_test.sh: New file.
11966 * testsuite/icf_safe_test.cc: New file.
11968 2009-10-12 Sriraman Tallam <tmsriram@google.com>
11970 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11971 includes to gc.h and icf.h.
11972 * arm.cc: Include gc.h.
11973 * gold.cc: Likewise.
11974 * i386.cc: Likewise.
11975 * powerpc.cc: Likewise.
11976 * sparc.cc: Likewise.
11977 * x86_64.cc: Likewise.
11978 * gc.h: Include icf.h.
11980 2009-10-11 Ian Lance Taylor <iant@google.com>
11982 * plugin.cc: Include "gold.h" before other header files.
11984 2009-10-10 Chris Demetriou <cgd@google.com>
11986 * options.h (Input_file_argument::Input_file_type): New enum.
11987 (Input_file_argument::is_lib_): Replace with...
11988 (Input_file_argument::type_): New member.
11989 (Input_file_argument::Input_file_argument): Take Input_file_type
11990 'type' rather than boolean 'is_lib' as second argument.
11991 (Input_file_argument::is_lib): Use type_.
11992 (Input_file_argument::is_searched_file): New function.
11993 (Input_file_argument::may_need_search): Handle is_searched_file.
11994 * options.cc (General_options::parse_library): Support -l:filename.
11995 (General_options::parse_just_symbols): Update for Input_file_argument
11997 (Command_line::process): Likewise.
11998 * archive.cc (Archive::get_file_and_offset): Likewise.
11999 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12000 * script.cc (read_script_file, script_add_file): Likewise.
12001 * fileread.cc (Input_file::Input_file): Likewise.
12002 (Input_file::will_search_for): Handle is_searched_file.
12003 (Input_file::open): Likewise.
12004 * readsyms.cc (Read_symbols::get_name): Likewise.
12005 * testsuite/Makefile.am (searched_file_test): New test.
12006 * testsuite/Makefile.in: Regenerate.
12007 * testsuite/searched_file_test.cc: New file.
12008 * testsuite/searched_file_test_lib.cc: New file.
12010 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12011 Ian Lance Taylor <iant@google.com>
12013 * descriptor.cc: Include <cstdio> and "binary-io.h".
12014 (Descriptors::open): Open the files in binary mode always.
12015 * script.cc (Lex::get_token): Treat \r as whitespace.
12017 2009-10-09 Ian Lance Taylor <iant@google.com>
12019 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12021 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12022 Ian Lance Taylor <iant@google.com>
12024 * configure.ac: Check for readv function also.
12025 * fileread.cc (readv): Define if not HAVE_READV.
12026 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12028 * config.in: Regenerate.
12029 * configure: Regenerate.
12031 2009-10-09 Doug Kwan <dougkwan@google.com>
12033 * layout.cc (Layout::make_output_section): Call target hook to make
12034 ordinary output section.
12035 (Layout::finalize): Adjust parameter list of call the
12036 Target::may_relax().
12037 * layout.h (class Layout::section_list): New method.
12038 * merge.h (Output_merge_base::entsize): Change visibility to public.
12039 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12041 (Output_merge_string::do_is_string): New method.
12042 * object.cc (Sized_relobj::do_setup): renamed from
12043 Sized_relobj::set_up.
12044 * object.h (Sized_relobj::adjust_shndx,
12045 Sized_relobj::initializ_input_to_output_maps,
12046 Sized_relobj::free_input_to_output_maps): Change visibilities to
12048 (Sized_relobj::setup): Virtualize.
12049 (Sized_relobj::do_setup): New method declaration.
12050 (Sized_relobj::invalidate_section_offset,
12051 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12052 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12053 * options.cc (parse_int): New function.
12054 * options.h (parse_int): New declaration.
12055 (DEFINE_int): New macro.
12056 (stub_group_size): New option.
12057 * output.cc (Output_section::Output_section): Initialize memebers
12058 merge_section_map_, merge_section_by_properties_map_,
12059 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12060 (Output_section::add_input_section): Handled deferred code-fill
12061 generation and remove an old comment.
12062 (Output_section::add_relaxed_input_section): New method definition.
12063 (Output_section::add_merge_input_section): Use merge section by
12064 properties map to speed to search. Update merge section maps
12066 (Output_section::build_relaxation_map): New method definition.
12067 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12069 (Output_section::relax_input_section): Renamed to
12070 Output_section::convert_input_sections_to_relaxed_sections and change
12071 interface to take a vector of pointers to relaxed sections.
12072 (Output_section::find_merge_section,
12073 Output_section::find_relaxed_input_section): New method definitions.
12074 (Output_section::is_input_address_mapped,
12075 Output_section::output_offset, Output_section::output_address):
12076 Use output section data maps to speed up searching.
12077 (Output_section::find_starting_output_address): Add comments.
12078 (Output_section::do_write,
12079 Output_section::write_to_postprocessing_buffer): Do code-fill
12080 generation as appropriate.
12081 (Output_section::get_input_sections): Invalidate relaxed input section
12083 (Output_section::restore_states): Adjust type of checkpoint .
12084 Invalidate relaxed input section map.
12085 * output.h (Output_merge_base): New class declaration.
12086 (Input_section_specifier): New class defintion.
12087 (class Output_relaxed_input_section) Change base class to
12088 Output_section_data_build.
12089 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12090 base class initializer.
12091 (Output_section::add_relaxed_input_section): New method declaration.
12092 (Output_section::Input_section): Change visibility to protected.
12093 (Output_section::Input_section::relobj,
12094 Output_section::Input_section::shndx): Handle relaxed input sections.
12095 Output_section::input_sections) Change visibility to protected. Also
12096 define overload to return a non-const pointer.
12097 (Output_section::Merge_section_properties): New class defintion.
12098 (Output_section::Merge_section_by_properties_map,
12099 Output_section::Output_section_data_by_input_section_map,
12100 Output_section::Relaxation_map): New types.
12101 (Output_section::relax_input_section): Rename method to
12102 Output_section::convert_input_sections_to_relaxed_sections and change
12103 interface to take a vector of relaxed section pointers.
12104 (Output_section::find_merge_section,
12105 Output_section::find_relaxed_input_section,
12106 Output_section::build_relaxation_map,
12107 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12108 New method declarations.
12109 (Output_section::merge_section_map_
12110 Output_section::merge_section_by_properties_map_,
12111 Output_section::relaxed_input_section_map_,
12112 Output_section::is_relaxed_input_section_map_valid_,
12113 Output_section::generate_code_fills_at_write_): New data members.
12114 * script-sections.cc
12115 (Output_section_element_input::set_section_addresses): Call
12116 current_data_size and addralign methods of relaxed input sections.
12117 (Orphan_output_section::set_section_addresses): Call current_data_size
12118 and addralign methods of relaxed input sections.
12119 * symtab.cc (Symbol_table::compute_final_value): Extract template
12120 from the body of Symbol_table::sized_finalize_symbol.
12121 (Symbol_table::sized_finalized_symbol): Call
12122 Symbol_table::compute_final_value.
12123 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12124 (Symbol_table::compute_final_value): New templated method declaration.
12125 * target.cc (Target::do_make_output_section): New method defintion.
12126 * target.h (Target::make_output_section): New method declaration.
12127 (Target::relax): Add more parameters for input objects, symbol table
12128 and layout. Adjust call to do_relax.
12129 (Target::do_make_output_section): New method declaration.
12130 (Target::do_relax): Add parameters for input objects, symbol table
12133 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12135 * pread.c: Include stdio.h.
12137 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12139 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12142 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12144 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12145 Change read_shndx type to unsigned int.
12146 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12148 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12149 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12150 Change read_shndx type to unsigned int.
12151 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12153 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12154 * layout.cc (Layout::create_symtab_sections): Cast the result of
12155 local_symcount * symsize to off_t in the gold_assert.
12157 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12159 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12160 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12162 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12163 (Arm_relocate_functions::thm_abs5): New function.
12164 (Arm_relocate_functions::abs12): New function.
12165 (Arm_relocate_functions::abs16): New function.
12166 (Arm_relocate_functions::base_abs): New function.
12167 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12168 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12169 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12171 (Scan::global): Likewise.
12172 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12173 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12174 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12175 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12178 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12180 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12181 (Arm_relocate_functions::movt_prel): New function.
12182 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12183 (Arm_relocate_functions::thm_movt_prel): New function.
12184 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12185 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12186 (Scan::global, Relocate::relocate): Likewise.
12187 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12189 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12191 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12192 Incremental_checker.
12193 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12195 (class Incremental_inputs_header): New class.
12196 (Incremental_inputs_header_writer): Edit comment.
12197 (Incremental_inputs_entry): New class.
12198 (Incremental_inputs_entry_writer): Edit comment.
12199 (Sized_incremental_binary::do_find_incremental_inputs_section):
12200 Add *strtab_shndx parameter, fill it.
12201 (Sized_incremental_binary::do_check_inputs): New method.
12202 (Incremental_checker::can_incrementally_link_output_file): Use
12203 Sized_incremental_binary::check_inputs.
12204 (Incremental_inputs::report_command_line): Save command line in
12207 (Incremental_binary::find_incremental_inputs_section): New
12209 (Incremental_binary::do_find_incremental_inputs_section): Add
12210 strtab_shndx parameter.
12211 (Incremental_binary::do_check_inputs): New pure virtual method.
12212 (Sized_incremental_binary::do_check_inputs): Declare.
12213 (Incremental_checker::Incremental_checker): Add incremental_inputs
12214 parameter, use it to initialize incremental_inputs_.
12215 (Incremental_checker::incremental_inputs_): New field.
12216 (Incremental_checker::command_line): New method.
12217 (Incremental_checker::inputs): New method.
12218 (Incremental_checker::command_line_): New field.
12220 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12222 * incremental.cc: Include <cstdarg> and "target-select.h".
12223 (vexplain_no_incremental): New function.
12224 (explain_no_incremental): New function.
12225 (Incremental_binary::error): New method.
12226 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12228 (make_sized_incremental_binary): New function.
12229 (open_incremental_binary): New function.
12230 (can_incrementally_link_file): Add checks if output is ELF and has
12232 * incremental.h: Include "elfcpp_file.h" and "output.h".
12233 (Incremental_binary): New class.
12234 (Sized_incremental_binary): New class.
12235 (open_incremental_binary): Declare.
12236 * object.cc (is_elf_object): Use
12237 elfcpp::Elf_recognizer::is_elf_file.
12238 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12239 * output.h (Output_file::filesize): New method.
12241 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12243 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12245 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12246 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12248 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12250 (Arm_relocate_functions::movw_abs_nc): New function.
12251 (Arm_relocate_functions::movt_abs): New function.
12252 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12253 (Arm_relocate_functions::thm_movt_abs): New function.
12254 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12255 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12256 (Scan::global): Likewise.
12257 (Relocate::relocate): Likewise.
12258 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12260 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12262 * arm.cc (Arm_relocate_functions::got_prel) New function.
12263 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12264 (Relocate::relocate): Likewise.
12265 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12267 2009-10-06 Ian Lance Taylor <iant@google.com>
12269 * options.h (class General_options): Define
12270 split_stack_adjust_size parameter.
12271 * object.h (class Object): Add uses_split_stack_ and
12272 has_no_split_stack_ fields. Add uses_split_stack and
12273 has_no_split_stack accessor functions. Declare
12274 handle_split_stack_section.
12275 (class Reloc_symbol_changes): Define.
12276 (class Sized_relobj): Define Function_offsets. Declare
12277 split_stack_adjust, split_stack_adjust_reltype, and
12279 * object.cc (Object::handle_split_stack_section): New function.
12280 (Sized_relobj::do_layout): Call handle_split_stack_section.
12281 * dynobj.cc (Sized_dynobj::do_layout): Call
12282 handle_split_stack_section.
12283 * reloc.cc (Sized_relobj::relocate_sections): Call
12284 split_stack_adjust for executable sections in split_stack
12285 objects. Pass reloc_map to relocate_section.
12286 (Sized_relobj::split_stack_adjust): New function.
12287 (Sized_relobj::split_stack_adjust_reltype): New function.
12288 (Sized_relobj::find_functions): New function.
12289 * target-reloc.h: Include "object.h".
12290 (relocate_section): Add reloc_symbol_changes parameter. Change
12292 * target.h (class Target): Add calls_non_split method. Declare
12293 do_calls_non_split virtual method. Declare match_view and
12295 * target.cc: Include "elfcpp.h".
12296 (Target::do_calls_non_split): New function.
12297 (Target::match_view): New function.
12298 (Target::set_view_to_nop): New function.
12299 * gold.cc (queue_middle_tasks): Give an error if mixing
12300 split-stack and non-split-stack objects with -r.
12301 * i386.cc (Target_i386::relocate_section): Add
12302 reloc_symbol_changes parameter.
12303 (Target_i386::do_calls_non_split): New function.
12304 * x86_64.cc (Target_x86_64::relocate_section): Add
12305 reloc_symbol_changes parameter.
12306 (Target_x86_64::do_calls_non_split): New function.
12307 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12309 * powerpc.cc (Target_powerpc::relocate_section): Add
12310 reloc_symbol_changes parameter.
12311 * sparc.cc (Target_sparc::relocate_section): Add
12312 reloc_symbol_changes parameter.
12313 * configure.ac: Call AM_CONDITIONAL for the default target.
12314 * configure: Rebuild.
12315 * testsuite/Makefile.am (TEST_AS): New variable.
12316 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12317 (check_DATA): Add split_i386 and split_x86_64 files.
12318 (SPLIT_DEFSYMS): Define.
12319 (split_i386_[1234n].o): New targets.
12320 (split_i386_[124]): New targets.
12321 (split_i386_[1234r].stdout): New targets.
12322 (split_x86_64_[1234n].o): New targets.
12323 (split_x86_64_[124]): New targets.
12324 (split_x86_64_[1234r].stdout): New targets.
12325 (MOSTLYCLEANFILES): Add new executables.
12326 * testsuite/split_i386.sh: New file.
12327 * testsuite/split_x86_64.sh: New file.
12328 * testsuite/split_i386_1.s: New file.
12329 * testsuite/split_i386_2.s: New file.
12330 * testsuite/split_i386_3.s: New file.
12331 * testsuite/split_i386_4.s: New file.
12332 * testsuite/split_i386_n.s: New file.
12333 * testsuite/split_x86_64_1.s: New file.
12334 * testsuite/split_x86_64_2.s: New file.
12335 * testsuite/split_x86_64_3.s: New file.
12336 * testsuite/split_x86_64_4.s: New file.
12337 * testsuite/split_x86_64_n.s: New file.
12338 * testsuite/testfile.cc (Target_test): Update relocation_section
12340 * testsuite/Makefile.in: Rebuild.
12342 2009-10-06 Ian Lance Taylor <iant@google.com>
12344 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12345 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12346 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12347 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12348 the address on ldo_addrs_.
12349 (Target_i386::Relocate::fix_up_ldo): New function.
12351 2009-10-06 Rafael Espindola <espindola@google.com>
12353 * plugin.cc (add_input_library): New.
12354 (Plugin::load): Add add_input_library to tv.
12355 (Plugin_manager::add_input_file): Add the is_lib argument.
12356 (add_input_file): Update call to Plugin_manager::add_input_file.
12357 (add_input_library): New.
12358 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12360 2009-09-30 Doug Kwan <dougkwan@google.com>
12362 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12363 symbol and call Symbol::may_need_copy_reloc to determine if
12364 a copy reloc is needed.
12365 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12366 nocopyreloc is given in command line.
12367 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12368 given in command line.
12369 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12370 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12371 of the removed Target_i386::may_need_copy_reloc.
12372 * options.h (copyreloc): New option with default value false.
12373 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12374 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12375 instead of the removed Target_powerpc::may_need_copy_reloc.
12376 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12377 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12378 instead of the removed Target_sparc::may_need_copy_reloc.
12379 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12380 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12381 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12382 instead of the removed Target_x86_64::may_need_copy_reloc.
12384 2009-09-30 Ian Lance Taylor <iant@google.com>
12386 * object.h (class Object): Remove target_ field, and target,
12387 sized_target, and set_target methods.
12388 (Object::sized_target): Remove.
12389 (class Sized_relobj): Update declarations. Remove sized_target.
12390 * object.cc (Sized_relobj::setup): Remove target parameter.
12391 Change all callers.
12392 (Input_objects::add_object): Don't do anything with the target.
12393 (make_elf_sized_object): Add punconfigured parameter. Change all
12394 callers. Set or test parameter target.
12395 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12396 Change all callers.
12397 * parameters.cc (Parameters::set_target): Change parameter type to
12399 (Parameters::default_target): Remove.
12400 (set_parameters_target): Change parameter type to be non-const.
12401 (parameters_force_valid_target): New function.
12402 (parameters_clear_target): New function.
12403 * parameters.h (class Parameters): Update declarations. Remove
12404 default_target method. Add sized_target and clear_target
12405 methods. Change target_ to be non-const.
12406 (set_parameters_target): Update declaration.
12407 (parameters_force_valid_target): Declare.
12408 (parameters_clear_target): Declare.
12409 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12410 as NULL if we aren't searching.
12411 (Add_symbols::run): Don't check for compatible target.
12412 * fileread.cc (Input_file::open_binary): Call
12413 parameters_force_valid_target.
12414 * gold.cc (queue_middle_tasks): Likewise.
12415 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12416 set_target on object.
12417 * dynobj.h (class Sized_dynobj): Update declarations.
12418 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12419 make_elf_object returns NULL.
12420 (Archive::include_member): Don't check whether object target is
12422 * output.cc (Output_section::add_input_section): Get target from
12424 (Output_section::relax_input_section): Likewise.
12425 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12427 (Sized_relobj::do_scan_relocs): Likewise.
12428 (Sized_relobj::relocate_sections): Likewise.
12429 * resolve.cc (Symbol_table::resolve): Likewise.
12430 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12431 parameter. Change all callers.
12432 (Symbol_table::add_from_object): Get target from parameters.
12433 (Symbol_table::add_from_relobj): Don't check object target.
12434 (Symbol_table::add_from_dynobj): Likewise.
12435 (Symbol_table::define_special_symbol): Get target from
12437 * symtab.h (class Symbol_table): Update declaration.
12438 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12439 parameter. Change all callers. Clear parameter target.
12440 (Binary_test): Test target here.
12441 * testsuite/object_unittest.cc (gold_testsuite): Remove
12442 target_test_pointer parameter. Change all callers.
12443 (Object_test): Test target here.
12445 2009-09-26 Ian Lance Taylor <iant@google.com>
12447 * testsuite/initpri1.c: Don't try to use constructor priorities if
12448 compiling with gcc before 4.3.
12450 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12452 * testsuite/retain_symbols_file_test.sh (check_present): Change
12453 output file name to retain_symbols_file_test.stdout.
12454 (check_absent): Likewise.
12456 2009-09-18 Craig Silverstein <csilvers@google.com>
12458 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12459 * options.cc: Include <cerrno> and <fstream>.
12460 (General_options::finalize): Parse -retain-symbols-file tag.
12461 * options.h: New flag.
12462 (General_options): New method should_retain_symbol, new
12463 variable symbols_to_retain.
12464 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12465 should_retain_symbol map.
12466 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12467 * testsuite/Makefile.in: Regenerate.
12468 * testsuite/retain_symbols_file_test.sh: New file.
12470 2009-09-18 Nick Clifton <nickc@redhat.com>
12472 * po/es.po: Updated Spanish translation.
12474 2009-09-17 Doug Kwan <dougkwan@google.com>
12476 * debug.h (DEBUG_RELAXATION): New constant.
12477 (DEBUG_ALL): Add DEBUG_RELAXATION.
12478 (debug_string_to_enum): Add relaxation debug option.
12480 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12481 Layout::Relaxation_debug_check::read_sections,
12482 Layout::Relaxation_debug_check::read_sections): New method definitions.
12483 (Layout::Layout): Initialize data members
12484 record_output_section_data_from_scrips_,
12485 script_output_section_data_list_ and relaxation_debug_check_.
12486 (Layout::save_segments, Layout::restore_segments,
12487 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12488 Layout::relaxation_loop_body): New method definitions.
12489 (Layout::finalize): Support relaxation. Move section layout code to
12490 Layout::relaxation_loop_body.
12491 (Layout::set_asection_address_from_script): Move code for orphan
12492 section placement out.
12493 (Layout::place_orphan_sections_in_script): New method definition.
12494 * layout.h (Output_segment_headers, Output_file_header):
12495 New forward class declarations.
12496 (Layout::~Layout): Define.
12497 (Layout::new_output_section_data_from_script): New method definition.
12498 (Layout::place_orphan_sections_in_script): New method declaration.
12499 (Layout::Segment_states): New type declaration.
12500 (Layout::save_segments, Layout::restore_segments,
12501 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12502 Layout::relaxation_loop_body): New method declarations.
12503 (Layout::Output_section_data_list): New type declaration.
12504 (Layout::Relaxation_debug_check): New class definition.
12505 (Layout::record_output_section_data_from_script_,
12506 Layout::script_output_section_data_list_, Layout::segment_states_,
12507 Layout::relaxation_debug_check_): New data members.
12508 * output.cc: (Output_section_headers::do_size): New method definition.
12509 (Output_section_headers::Output_section_headers): Move size
12510 computation to Output_section_headers::do_size.
12511 (Output_segment_headers::do_size): New method definition.
12512 (Output_file_header::Output_file_header): Move size computation to
12513 Output_file_header::do_size and call it.
12514 (Output_file_header::do_size): New method definition.
12515 (Output_data_group::Output_data_group): Adjust call to
12516 Output_section_data.
12517 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12518 (Output_symtab_xindex::do_write): Add array bound check.
12519 (Output_section::Input_section::print_to_mapfile): Handle
12520 RELAXED_INPUT_SECTION_CODE.
12521 (Output_section::Output_section): Initialize data member checkpoint_.
12522 (Output_section::~Output_section): Delete checkpoint object pointed
12524 (Output_section::add_input_section): Always add an Input_section if
12526 (Output_section::add_merge_input_section): Add assert.
12527 (Output_section::relax_input_section): New method definition.
12528 (Output_section::set_final_data_size): Set load address to zero for
12529 an unallocated section.
12530 (Output_section::do_address_and_file_offset_have_reset_values):
12531 New method definition.
12532 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12533 Handle relaxed input section.
12534 (Output_section::sort_attached_input_sections): Checkpoint input
12535 section list lazily.
12536 (Output_section::get_input_sections): Change type of input_sections to
12537 list of Simple_input_section pointers. Checkpoint input section list
12538 lazily. Also handle relaxed input sections.
12539 (Output_section::add_input_section_for_script): Take a reference to
12540 a Simple_input_section object instead of Relobj pointer and section
12541 index as parameter. Handle relaxed input sections.
12542 (Output_section::save_states, Output_section::restore_states): New
12543 method definitions.
12544 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12545 (Output_data::is_data_size_fixed): New method definition.
12546 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12548 (Output_data::address_and_file_offset_have_reset_values): New method
12550 (Output_data::do_address_and_file_offset_have_reset_values): New method
12552 (Output_data::set_data_size): Check that data size is not fixed.
12553 (Output_data::fix_data_size): New method definition.
12554 (Output_data::is_data_size_fixed_): New data member.
12555 (Output_section_headers::set_final_data_size): New method definition.
12556 (Output_section_headers::do_size): New method declaration.
12557 (Output_segment_headers::set_final_data_size): New method definition.
12558 (Output_segment_headers::do_size): New method declaration.
12559 (Output_file_header::set_final_data_size)::New method definition.
12560 (Output_file_header::do_size)::New method declaration.
12561 (Output_section_data::Output_section_data): Add new parameter
12562 is_data_size_fixed and use it to fix data size.
12563 (Output_data_const::Output_data_const): Adjust call to base class
12564 constructor and fix data size.
12565 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12566 base class constructor and fix data size.
12567 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12568 base class constructor and fix data size.
12569 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12570 class constructor and fix data size.
12571 (Output_data_group::set_final_data_size): New method definition.
12572 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12573 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12574 class constructor and fix data size.
12575 (Output_relaxed_input_section): New class definition.
12576 (Output_section::Simple_input_section): New class definition.
12577 (Output_section::get_input_sections): Adjust parameter list.
12578 (Output_section::add_input_section_for_script): Same.
12579 (Output_section::save_states, Output_section::restore_states,
12580 Output_section::do_address_and_file_offset_have_reset_values,
12581 (Output_section::Input_section::Input_section): Handle
12582 RELAXED_INPUT_SECTION_CODE. Add new overload for
12583 Output_relaxed_input_section.
12584 (Output_section::Input_section::is_input_section,
12585 Output_section::Input_section::set_output_section): Handle relaxed
12587 (Output_section::Input_section::is_relaxed_input_section,
12588 Output_section::Input_section::output_section_data,
12589 Output_section::Input_section::relaxed_input_section): New method
12591 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12593 (Output_section::Input_section::u1_): Update comments.
12594 (Output_section::Input_section::u2_): Add new union member poris.
12595 (Output_section::Checkpoint_output_section): New classs definition.
12596 (Output_section::relax_input_section): New method declaration.
12597 (Output_section::checkpoint_): New data member.
12598 (Output_segment): Update comments.
12599 (Output_segment::Output_segment): Un-privatize copy constructor.
12600 (Output_segment::operator=): Un-privatize.
12601 * script-sections.cc (Output_section_element::Input_section_list):
12602 Change element type to Output_section::Simple_input_section.
12603 (Output_section_element_dot_assignment::set_section_addresses):
12604 Register output section data for relaxation clean up.
12605 (Output_data_exression::Output_data_expression): Adjust call to base
12606 constructor to fix data size.
12607 (Output_section_element_data::set_section_addresses): Register
12608 Output_data_expression object for relaxation clean up.
12609 (struct Input_section_info): Replace Relobj pointer and section index
12610 pair with Output_section::Simple_input_section and Convert struct to a
12612 (Input_section_sorter::operator()): Adjust access to
12613 Input_section_info data member to use accessors.
12614 (Output_section_element_input::set_section_addresses): Use layout
12615 parameter. Adjust code to use Output_section::Simple_input_section
12616 and Input_secction_info classes. Register filler for relaxation
12618 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12619 and section index pair with Output_section::Simple_input_section
12620 class. Adjust code accordingly.
12621 (Phdrs_element::release_segment): New method definition.
12622 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12624 (Script_sections::release_segments): New method definition.
12625 * gold/script-sections.h (Script_sections::release_segments): New
12626 method declaration.
12627 * gold/target.h (Target::may_relax, Target::relax,
12628 Target::do_may_relax, Target::do_relax): New method definitions.
12630 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12632 * arm.cc (has_signed_unsigned_overflow): New function.
12633 (Arm_relocate_functions::abs8): New function.
12634 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12635 (Target_arm::Scan::global): Likewise.
12636 (Target_arm::relocate::relocate): Likewise.
12637 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12640 2009-09-16 Cary Coutant <ccoutant@google.com>
12642 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12643 * testsuite/Makefile.in: Regenerate.
12645 2009-09-11 Nick Clifton <nickc@redhat.com>
12647 * po/gold.pot: Updated by the Translation project.
12649 2009-09-08 Cary Coutant <ccoutant@google.com>
12651 * output.cc (Output_file::open): Add execute permission to empty file.
12652 * testsuite/Makefile.am (permission_test): New test.
12653 * testsuite/Makefile.in: Regenerate.
12655 2009-09-02 Ian Lance Taylor <iant@google.com>
12657 * output.cc (Output_file::resize): Call map_no_anonymous rather
12660 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12662 * gold.cc: Include "incremental.h".
12663 (queue_initial_tasks): Call Incremental_checker methods.
12664 * incremental.cc: Include "output.h".
12665 (Incremental_checker::can_incrementally_link_output_file): New
12667 * incremental.h (Incremental_checker): New class.
12669 * output.cc (Output_file::open_for_modification): New method.
12670 (Output_file::map_anonymous): Changed return type to bool. Record
12671 map in base_ field.
12672 (Output_file::map_no_anonymous): New method, broken out of map.
12673 (Output_file::map): Use map_no_anonymous and map_anonymous.
12674 * output.h (class Output_file): Update declarations.
12676 2009-08-24 Cary Coutant <ccoutant@google.com>
12678 * options.h (Command_line::Pre_options): New class.
12679 (Command_line::pre_options): New member.
12680 * options.cc (gold::options::ready_to_register): New variable.
12681 (One_option::register_option): Do nothing if not registering options.
12682 Assert if same short option registered twice.
12683 (General_options::General_options): Turn off option registration when
12685 (Command_line::Pre_options::Pre_options): New constructor.
12687 2009-08-24 Cary Coutant <ccoutant@google.com>
12689 * options.h (General_options::no_keep_memory): Remove incorrect
12692 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12694 * Makefile.am (am__skiplex, am__skipyacc): New.
12695 * Makefile.in: Regenerate.
12697 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12699 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12700 (INCLUDES): ... this.
12701 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12702 (AM_CPPFLAGS): Renamed from ...
12703 (INCLUDE): ... this.
12704 * Makefile.in, testsuite/Makefile.in: Regenerate.
12706 * Makefile.in: Regenerate.
12707 * aclocal.m4: Likewise.
12708 * config.in: Likewise.
12709 * configure: Likewise.
12710 * testsuite/Makefile.in: Likewise.
12712 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12713 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12714 * Makefile.in: Regenerate.
12715 * testsuite/Makefile.in: Regenerate.
12717 2009-08-19 Cary Coutant <ccoutant@google.com>
12719 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12720 symbols in shared libraries overridden by hidden or internal symbols
12721 in the main program.
12723 2009-08-19 Chris Demetriou <cgd@google.com>
12725 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12726 checking source file names in error messages.
12728 2009-08-18 Doug Kwan <dougkwan@google.com>
12730 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12731 an elcpp::Ehdr as parameter. Adjust call to set_target.
12732 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12733 an elfcpp::Ehdr as parameter.
12734 * object.cc (Object::set_target): Remove the version that looks up
12735 a target and sets it.
12736 (Sized_relobj::setup): Take a Target object instead of
12737 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12738 (make_elf_sized_object): Find target and ask target to
12739 make an ELF object.
12740 * object.h: (Object::set_target): Remove the version that looks up
12741 a target and sets it.
12742 (Sized_relobj::setup): Take a Target object instead of
12743 an elfcpp:Ehdr as parameter.
12744 * target.cc: Include dynobj.h.
12745 (Target::do_make_elf_object_implementation): New.
12746 (Target::do_make_elf_object): New.
12747 * target.h (Target::make_elf_object): New template declaration.
12748 (Target::do_make_elf_object): New method declarations.
12749 (Target::do_make_elf_object_implementation): New template declaration.
12751 2009-08-14 Ian Lance Taylor <iant@google.com>
12753 * gold.h (FUNCTION_NAME): Define.
12754 (gold_unreachable): Use FUNCTION_NAME.
12756 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12758 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12759 symbol in the --keep-unique list is not found.
12761 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12763 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12764 been maked as --keep-unique.
12765 (Icf::unfold_section): New function.
12766 * icf.h (Icf::unfold_section): New function.
12767 * options.h (General_options::keep_unique): New option.
12768 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12769 * testsuite/Makefile.in: Regenerate.
12770 * testsuite/icf_keep_unique_test.sh: New file.
12771 * testsuite/icf_keep_unique_test.cc: New file.
12773 2009-08-12 Cary Coutant <ccoutant@google.com>
12776 * resolve.cc (Symbol_table::resolve): Check for references from
12777 dynamic objects to hidden and internal symbols.
12778 * testsuite/Makefile.am (hidden_test.sh): New test.
12779 * testsuite/Makefile.in: Regenerate.
12780 * testsuite/hidden_test.sh: New script.
12781 * testsuite/hidden_test_1.c: New test source.
12782 * testsuite/hidden_test_main.c: New test source.
12784 2009-08-11 Doug Kwan <dougkwan@google.com>
12786 * arm.cc: Update comments.
12787 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12788 segment to locate the .ARM.exidx section if present.
12790 2009-08-09 Doug Kwan <dougkwan@google.com>
12792 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12795 2009-08-07 Sriraman Tallam <tmsriram@google.com>
12796 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12799 2009-08-06 Sriraman Tallam <tmsriram@google.com>
12801 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12802 valid tls_segment only for non-debug-section relocations.
12803 * testsuite/Makefile.am: Add gc_tls_test.
12804 * testsuite/Makefile.in: Regenerate.
12805 * testsuite/gc_tls_test.cc: New file.
12806 * testsuite/gc_tls_test.sh: New file.
12808 2009-08-05 Sriraman Tallam <tmsriram@google.com>
12810 * icf.cc: New file.
12812 * Makefile.am (CCFILES): Add icf.cc.
12813 (HFILES): Add icf.h
12814 * Makefile.in: Regenerate.
12815 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12816 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12817 section, symbol and addend information for the relocs.
12818 * gold.cc (queue_middle_tasks): Call identical code folding.
12819 * gold.h: Add defines for multimap.
12820 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12821 to the call of finalize_local_symbols.
12822 * main.cc (main): Create object of class Icf.
12823 * object.cc (Sized_relobj::do_layout): Allow this function to be
12824 called twice during icf.
12825 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12826 to sections marked as identical by icf.
12827 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12829 (Sized_relobj::do_section_entsize): New function.
12830 * object.h (Object::section_entsize): New function.
12831 (Object::do_section_entsize): New pure virtual function.
12832 (Relobj::finalize_local_symbols): Add new parameter.
12833 (Relobj::do_section_entsize): New function.
12834 * options.h (General_options::icf): New option.
12835 (General_options::icf_iterations): New option.
12836 (General_options::print_icf_sections): New option.
12837 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12838 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12839 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12841 * symtab.cc (Symbol_table::is_section_folded): New function.
12842 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12843 to sections marked as identical by icf.
12844 * symtab.h (Symbol_table::set_icf): New function.
12845 (Symbol_table::icf): New function.
12846 (Symbol_table::is_section_folded): New function.
12847 (Symbol_table::icf_): New data member.
12848 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12849 * testsuite/Makefile.am: Add commands to build icf_test.
12850 * testsuite/Makefile.in: Regenerate.
12851 * testsuite/icf_test.sh: New file.
12852 * testsuite/icf_test.cc: New file.
12854 2009-07-24 Chris Demetriou <cgd@google.com>
12856 * layout.cc (is_compressible_debug_section): Fix incorrect
12857 comment about compressed section names.
12859 2009-07-20 Ian Lance Taylor <ian@airs.com>
12862 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12864 2009-07-16 Ian Lance Taylor <iant@google.com>
12867 * layout.h: #include <map>.
12868 (class Kept_section): Change from struct to class. Add accessors
12869 and setters. Add section size to Comdat_group mapping. Change
12870 Comdat_group to std::map. Add is_comdat_ field. Add
12871 linkonce_size field in union.
12872 (class Layout): Update declaration of find_or_add_kept_section.
12873 Don't declare find_kept_object.
12874 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12875 parameter. Add object, shndx, is_comdat, and is_group_name
12876 parameters. Change all callers. Adjust for new Kept_section.
12877 (Layout::find_kept_object): Remove.
12878 * object.cc (Sized_relobj::include_section_group): Update use of
12879 Kept_section. Rename secnum to shndx. Only record
12880 Kept_comdat_section if sections are the same size.
12881 (Sized_relobj::include_linkonce_section): Update use of
12882 Kept_section. Only record Kept_comdat_section if sections are the
12883 same size. Set size of linkonce section.
12884 (Sized_relobj::map_to_kept_section): Update call to
12885 get_kept_comdat_section.
12886 * object.h (class Sized_relobj): Rename fields in
12887 Kept_comdat_section to drop trailing underscores; change object
12888 field to Relobj*. Change Kept_comdat_section_table to store
12889 struct rather than pointer.
12890 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12891 Add kept_object and kept_shndx parameters. Change all callers.
12892 (Sized_relobj::get_kept_comdat_section): Change return type to
12893 bool. Add kept_object and kept_shndx parameters. Change all
12895 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12896 Layout::find_or_add_kept_section.
12898 2009-07-09 Ian Lance Taylor <iant@google.com>
12900 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12901 Reserve space in the hash table.
12903 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12905 * fileread.cc (File_read::get_mtime): New method.
12906 * fileread.h (Timespec): New structure.
12907 (File_read::get_mtime): New method.
12908 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12909 Renamed from timestamp_nsec.
12910 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12912 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
12914 (Incremental_inputs::report_archive): Save mtime; style fix.
12915 (Incremental_inputs::report_obejct): Save mtime; style fix.
12916 (Incremental_inputs::report_script): Save mtime; style fix.
12917 (Incremental_inputs::finalize_inputs): Style fix.
12918 (Incremental_inputs::finalize): Style fix.
12919 (Incremental_inputs::create_input_section_data): Store inputs
12921 * incremental.h (Incremental_inputs::report_script): Add mtime
12923 (Incremental_inputs::Input_info::Input_info): Intialize only one
12925 (Incremental_inputs::Input_info::archive): Move to nameless
12927 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12928 (Incremental_inputs::Input_info::script): Move to nameless union.
12929 (Incremental_inputs::mtime): New field.
12930 * script.cc (read_input_script): Pass file mtime to
12932 * script.h (Script_info::inputs): Style fix.
12934 2009-07-01 Ian Lance Taylor <ian@airs.com>
12936 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12939 2009-06-24 Ian Lance Taylor <iant@google.com>
12942 * layout.cc (Layout::choose_output_section): If we find an
12943 existing section, update the flags.
12944 (Layout::create_notes): New function, broken out of
12946 (Layout::finalize): Don't create note sections.
12947 (Layout::create_note): Don't crash if linker script discards
12949 (Layout::create_gold_note): Likewise.
12950 (Layout::create_build_id): Likewise. Don't set
12951 after_input_sections on the section.
12952 (Layout::create_executable_stack_info): Remove target parameter.
12954 * layout.h (class Layout): Declare create_notes. Update
12955 declaration of create_executable_stack_info.
12956 * gold.cc (queue_middle_tasks): Call create_notes.
12957 * output.cc (Output_section::update_flags_for_input_section): Move
12958 here from output.h. If SHF_ALLOC flag is newly set, mark address
12960 * output.h (Output_data::mark_address_invalid): New function.
12961 (class Output_section): Only declare, not define,
12962 update_flags_for_input_section. Remove set_flags.
12964 2009-06-24 Ian Lance Taylor <iant@google.com>
12966 * script-sections.cc (Output_section_definition::
12967 set_section_addresses): Rename shadowing local load_address to
12970 2009-06-24 Ian Lance Taylor <iant@google.com>
12973 * reloc.cc (relocate_sections): Skip empty relocation sections.
12975 2009-06-23 Ian Lance Taylor <iant@google.com>
12978 * layout.cc (Layout::create_note): Use choose_output_section
12979 rather than make_output_section.
12981 2009-06-23 Ian Lance Taylor <iant@google.com>
12984 * options.cc (General_options::parse_V): Set printed_version_.
12985 (General_options::General_options): Initialize printed_version_.
12986 * options.h (class General_options): Add printed_version_ field.
12987 * gold.cc (queue_initial_tasks): If there are no input files,
12988 don't give a fatal error if we printed the version information.
12989 (queue_middle_tasks): If using -r with a shared object, give a
12990 fatal error rather than an ordinary error.
12992 2009-06-23 Ian Lance Taylor <iant@google.com>
12995 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12996 (Layout::make_output_section): Set have_stabstr_section_ if we see
12997 a .stab*str section.
12998 (Layout::finalize): Call link_stabs_sections.
12999 (Layout::link_stabs_sections): New file.
13000 * layout.h (class Layout): Add have_stabstr_section_ field.
13001 Declare link_stabs_sections.
13003 2009-06-23 Doug Kwan <dougkwan@google.com>
13005 * Makefile.am (libgold_a_LIBADD): New.
13006 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
13007 * Makefile.in: Regenerate.
13008 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13009 * configure: Regenerate.
13010 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13011 * fileread.cc: Include sys/state.h
13012 * gold.h: Declare memmem and strndup if found missing.
13013 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13015 2009-06-23 Ian Lance Taylor <iant@google.com>
13017 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13018 * configure: Rebuild.
13020 2009-06-23 Ian Lance Taylor <iant@google.com>
13023 * object.cc (Object::section_contents): Don't try to get a view if
13024 the section has length zero.
13025 (Object::handle_gnu_warning_section): If the section is empty, use
13026 the name of the section as the warning.
13028 2009-06-23 Ian Lance Taylor <iant@google.com>
13031 * stringpool.h (class Stringpool_template): Add optimize_ field.
13032 (Stringpool_template::set_optimize): New function.
13033 * stringpool.cc (Stringpool_template::Stringpool_template):
13034 Initialize optimize_ field.
13035 (Stringpool_template::set_string_offsets): Test local optimize
13036 fild rather than parameter.
13037 * layout.cc (Layout::Layout): Call set_optimize on the section
13040 2009-06-22 Ian Lance Taylor <iant@google.com>
13043 * yyscript.y: Parse TARGET.
13044 * script.cc (script_set_target): New function.
13045 * script-c.h (script_set_target): Declare.
13046 * options.cc (General_options::string_to_object_format): Rename
13047 from string_to_object_format in anonymous namespace. Change
13049 * options.h (class General_options): Declare
13050 string_to_object_format.
13052 2009-06-22 Ian Lance Taylor <iant@google.com>
13054 * script-sections.cc (Script_sections::create_segments): Don't put
13055 program headers in a PT_LOAD segment if -n or -N.
13057 2009-06-22 Ian Lance Taylor <iant@google.com>
13060 * options.h (class General_options): Add -z lazy and -z now. Sort
13061 -z options into alphabetical order.
13062 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13064 2009-06-21 Ian Lance Taylor <iant@google.com>
13066 * layout.cc (Layout::make_output_section): Call
13067 Target::new_output_section.
13068 (Layout::attach_allocated_section_to_segment): Put large section
13069 sections in a separate load segment with the large segment flag
13071 (Layout::segment_precedes): Sort large data segments after other
13073 (align_file_offset): New static function.
13074 (Layout::set_segment_offsets): Use align_file_offset.
13075 * output.h (class Output_section): Add is_small_section_ and
13076 is_large_section_ fields.
13077 (Output_section::is_small_section): New function.
13078 (Output_section::set_is_small_section): New function.
13079 (Output_section::is_large_section): New function.
13080 (Output_section::set_is_large_section): New function.
13081 (Output_section::is_large_data_section): New function.
13082 (class Output_segment): Add is_large_data_segment_ field.
13083 (Output_segment::is_large_data_segment): New function.
13084 (Output_segment::set_is_large_data_segment): New function.
13085 * output.cc (Output_section::Output_section): Initialize new
13087 (Output_segment::Output_segment): Likewise.
13088 (Output_segment::add_output_section): Add assertion that large
13089 data sections always go in large data segments. Force small data
13090 sections to the end of the list of data sections. Force small BSS
13091 sections to the start of the list of BSS sections. For large BSS
13092 sections to the end of the list of BSS sections.
13093 * symtab.h (class Symbol): Declare is_common_shndx.
13094 (Symbol::is_defined): Check Symbol::is_common_shndx.
13095 (Symbol::is_common): Likewise.
13096 (class Symbol_table): Define enum Commons_section_type. Update
13097 declarations. Add small_commons_ and large_commons_ fields.
13098 * symtab.cc (Symbol::is_common_shndx): New function.
13099 (Symbol_table::Symbol_table): Initialize new fields.
13100 (Symbol_table::add_from_object): Put small and large common
13101 symbols in the right list.
13102 (Symbol_table::sized_finalized_symbol): Check
13103 Symbol::is_common_shndx.
13104 (Symbol_table::sized_write_globals): Likewise.
13105 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13106 common symbol lists. Don't call do_allocate_commons_list if the
13108 (Symbol_table::do_allocate_commons_list): Remove is_tls
13109 parameter. Add comons_section_type parameter. Change all
13110 callers. Handle small and large common symbols.
13111 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13112 Symbol::is_common_shndx.
13113 * resolve.cc (symbol_to_bits): Likewise.
13114 * target.h (Target::small_common_shndx): New function.
13115 (Target::small_common_section_flags): New function.
13116 (Target::large_common_shndx): New function.
13117 (Target::large_common_section_flags): New function.
13118 (Target::new_output_section): New function.
13119 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13120 small_common_section_flags, and large_common_section_flags
13122 (Target::do_new_output_section): New virtual function.
13123 * arm.cc (Target_arm::arm_info): Initialize new fields.
13124 * i386.cc (Target_i386::i386_info): Likewise.
13125 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13127 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13128 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13129 (Target_x86_64::do_new_output_section): New function.
13130 * configure.ac: Define conditional MCMODEL_MEDIUM.
13131 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13132 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13133 (large_LDFLAGS): Define.
13134 * testsuite/large.c: New file.
13135 * testsuite/testfile.cc (Target_test::test_target_info):
13136 Initialize new fields.
13137 * configure, testsuite/Makefile.in: Rebuild.
13139 2009-06-05 Doug Kwan <dougkwan@google.com>
13141 * Makefile.am (CCFILES): Add target.cc.
13142 * Makefile.in: Regenerate.
13143 * i386.cc (class Target_i386): Define new virtual method to
13144 override do_is_local_label_name in parent.
13145 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13146 local symbols if --discard-locals or -X is given.
13147 * options.h (class General_options): Declare new options
13148 '--discard-locals' and '-X' for discarding locals.
13149 * target.h (class Target): Define new methods is_local_label_name.
13150 Declare new virtual method do_is_local_label_name.
13151 * target.cc: New file.
13152 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13153 (check_SCRIPTS): Add discard_locals_test.sh.
13154 (check_DATA): Add discard_local_tests.syms.
13155 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13156 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13157 * testsuite/Makefile.in: Regenerate.
13158 * testsuite/discard_locals_test.c: New file.
13159 * testsuite/discard_locals_test.sh: Same.
13161 2009-06-05 Doug Kwan <dougkwan@google.com>
13163 * object.cc (Sized_relobj::Sized_relobj): Initialize
13164 discarded_eh_frame_shndx_ to -1U.
13165 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13167 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13168 a discarded .eh_frame section.
13169 (Sized_relobj::do_finalize_local_symbols): Ditto.
13170 * object.h (class Sized_relobj): Declare new member
13171 discarded_eh_frame_shndx_.
13172 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13173 (local_labels_test.o, local_labels_test): New rules.
13174 * testsuite/Makefile.in: Regenerate.
13176 2009-06-04 Doug Kwan <dougkwan@google.com>
13178 * layout.cc (Layout::section_name_mapping): Add mapping for
13179 special ARM sections.
13181 2009-06-03 Doug Kwan <dougkwan@google.com>
13183 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13184 (utils::has_overflow): Same.
13186 2009-06-03 Ian Lance Taylor <iant@google.com>
13188 * layout.cc (Layout::section_name_mapping): New array, replacing
13189 Layout::linkonce_mapping.
13190 (Layout::section_name_mapping_count): New variable, replacing
13191 Layout::linkonce_mapping_count.
13192 (Layout::linkonce_output_name): Remove.
13193 (Layout::output_section_name): Rewrite.
13194 * layout.h (class Layout): Rename Linkonce_mapping to
13195 Section_name_mapping, linkonce_mapping to section_name_mapping,
13196 linkonce_mapping_count to section_name_mapping_count. Don't
13197 declare linkonce_output_name.
13199 2009-06-03 Doug Kwan <dougkwan@google.com>
13201 * gold/arm.cc (namespace utils): New.
13202 (Target_arm::reloc_is_non_pic): Define new method.
13203 (class Arm_relocate_functions): New.
13204 (Target_arm::Relocate::relocate): Handle relocation types used by
13207 2009-06-03 Ian Lance Taylor <iant@google.com>
13209 * arm.cc (Target_arm::scan::global): Use || instead of |.
13211 2009-06-02 Doug Kwan <dougkwan@google.com>
13213 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13214 issued_non_pic_error_.
13215 (class Target_arm::Scan): Declare new method check_non_pic.
13216 Define new method symbol_needs_plt_entry.
13217 Declare new data member issued_non_pic_error_.
13218 (class Target_arm::Relocate): Declare new method
13219 should_apply_static_reloc.
13220 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13221 (Target_arm::Scan::check_non_pic): Define new method.
13222 (Target_arm::Scan::local): Handle a small subset of reloc types used
13224 (Target_arm::Scan::local): Same.
13225 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13227 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13229 * incremental.cc (Incremental_inputs::report_command_line): Filter
13230 out --incremental-* options.
13232 2009-05-29 Doug Kwan <dougkwan@google.com>
13234 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13236 (class Target_arm): Update comment.
13237 (Target_arm::Target_arm): Initialize new data members GOT_,
13238 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13239 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13240 and Target_arm::rel_dyn_section.
13241 Declare new_enum Target_arm::Got_type.
13242 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13244 Update commments for member do_dynsym_value.
13245 (Target_arm::got_size, Target_arm::plt_section,
13246 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13247 new methods inside class defintion.
13248 (Target_arm::got_section): Define new method.
13249 (Target_arm::rel_dyn_section): Same.
13250 (Output_data_plt_arm): New template class.
13251 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13252 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13253 (Output_data_plt_arm::add_entry): Same.
13254 (Output_data_plt_arm::first_plt_entry): Define new
13255 static data member for PLT instruction template.
13256 (Output_data_plt_arm::plt_entry): Same.
13257 (Output_data_plt_arm::do_write): Define new method.
13258 (Target_arm::make_plt_entry): Same.
13259 (Target_arm::do_finalize_sections): Same.
13260 (Target_arm::do_dynsym_value): Same.
13262 2009-05-28 Doug Kwan <dougkwan@google.com>
13264 * Makefile.am (TARGETSOURCES): Add arm.cc.
13265 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13266 * Makefile.in: Regenerate.
13267 * arm.cc: New file.
13268 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13270 2009-05-26 Doug Kwan <dougkwan@google.com>
13272 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13273 (General_options::check_excluded_libs): Strip off directories in
13274 archive name before matching like GNU ld does.
13275 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13276 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13277 (exclude_libs_test_LDFLAGS): Add linker option
13278 -Wl,--exclude-libs,libexclude_libs_test_3
13279 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13280 an explicit archive without using -l.
13281 (alt/libexclude_libs_test_3.a): New make rule.
13282 * testsuite/Makefile.in: Regenerate.
13283 * testsuite/exclude_libs_test.c : Declare lib3_default().
13285 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13286 * exclude_libs_test_3.c: New file.
13288 2009-05-26 Nick Clifton <nickc@redhat.com>
13290 * po/id.po: New Indonesian translation.
13291 * po/gold.pot: Updated template file.
13293 2009-05-22 Sriraman Tallam <tmsriram@google.com>
13295 * testsuite/Makefile.am: Add -ffunction-sections to compile
13296 gc_comdat_test files. Add -Wl,--gc-sections to build
13298 * testsuite/Makefile.in: Regenerate.
13299 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13301 2009-05-21 Sriraman Tallam <tmsriram@google.com>
13303 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13304 kept comdat section was garbage collected.
13305 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13306 * testsuite/Makefile.in: Regenerate.
13307 * testsuite/gc_comdat_test.sh: New file.
13308 * testsuite/gc_comdat_test_1.cc: New file.
13309 * testsuite/gc_comdat_test_2.cc: New file.
13311 2009-05-19 Doug Kwan <dougkwan@google.com>
13313 * archive.cc (Archive::Archive): Move constructor from archive.h
13314 to here. Initialize no_export_.
13315 (Archive::get_elf_object_for_member): Set no_export flag of object.
13316 * archive.h (Archive::Archive): Move constructor body to
13318 (Archive::no_export): New method.
13319 (Archive::no_export_): New field.
13320 * object.h (Object::Object): Initialize no_export_ to false.
13321 (Object::no_export, Object::set_no_export): New methods.
13322 (Object::no_export_): New field.
13323 * options.cc (General_options::parse_exclude_libs): New method.
13324 (General_options::check_excluded_libs) Same.
13325 * options.h (exclude_libs): New option.
13326 (General_options::check_excluded_libs): New method declaration.
13327 (General_options::excluded_libs_): New field.
13328 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13329 default or protected visibility if an object has no-export flag set.
13330 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13331 (check_SCRIPTS): Add exclude_libs_test.sh.
13332 (check_DATA): Add exclude_libs_test.syms.
13333 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13334 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13335 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13336 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13337 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13338 libexclude_libs_test_2.a): New rules.
13339 * testsuite/Makefile.in: Regenerate.
13340 * testsuite/exclude_libs_test.c: New file.
13341 * testsuite/exclude_libs_test.sh: Ditto.
13342 * testsuite/exclude_libs_test_1.c: Ditto.
13343 * testsuite/exclude_libs_test_2.c: Ditto.
13345 2009-05-15 Ian Lance Taylor <iant@google.com>
13347 * configure.ac: Check for declarations for cases where libiberty.h
13348 checks HAVE_DECL_xxx.
13349 * configure, config.in: Rebuild.
13351 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13353 * gold.h (Incremental_argument_list): Remove (invalid) forward
13355 * incremental.cc (Incremental_inputs::report_achive): New method.
13356 (Incremental_inputs::report_object): New method.
13357 (Incremental_inputs::report_script): New method.
13358 (Incremental_inputs::finalize_inputs): New method.
13359 (Incremental_inputs::finalize): Call finalize_inputs().
13360 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13361 Create inputs entries.
13362 * incremental.h (Incremental_input_type): New enum.
13363 (Incremental_inputs::Incremental_input): Initialize new fields.
13364 (Incremental_inputs::report_inputs): New method.
13365 (Incremental_inputs::report_achive): New method.
13366 (Incremental_inputs::report_object): New method.
13367 (Incremental_inputs::report_script): New method.
13368 (Incremental_inputs::finalize_inputs): New method.
13369 (Incremental_inputs::Input_info): New struct.
13370 (Incremental_inputs::Input_info_map): New typedef.
13371 (Incremental_inputs::lock_): New field.
13372 (Incremental_inputs::Inputs_): New field.
13373 (Incremental_inputs::Inputs_map): New field.
13374 * main.cc (main): Call Incremental_input::report_inputs.
13375 * options.h (Input_argument_list): Typedef moved from
13377 (Input_file_group::Files): Remove, use ::Input_argument_list.
13378 (Input_file_group::Input_argument_list): Remove, use
13379 ::Input_argument_list.
13380 * plugin.cc (Plugin_manager::add_input_file): Add error in
13382 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13384 * script.cc (read_input_script): Call
13385 Incremental_input::report_script.
13386 * script.h (Script_info): New class.
13388 2009-04-27 Ian Lance Taylor <iant@google.com>
13390 * x86_64.cc (do_adjust_output_section): Set entsize to
13393 2009-04-23 Elliott Hughes <enh@google.com>
13395 * output.cc (Output_file::close): After short writes, continue
13396 writing from the correct offset in the buffer being written.
13398 2009-04-23 Chris Demetriou <cgd@google.com>
13400 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13401 * configure: Regenerate.
13402 * config.in: Regenerate.
13403 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13404 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13406 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13408 * incremental.cc (Incremental_inputs_header_data): Renamed from
13409 Incremental_input_header_data.
13410 (Incremental_inputs_header_data::data_size): New field.
13411 (Incremental_inputs_header_data::put_input_file_count): Renamed
13412 from input_file_count.
13413 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13414 from command_line_offset.
13415 (Incremental_inputs_header_data::put_reserved): Renamed from
13417 (Incremental_inputs_entry_data): Renamed from
13418 Incremental_input_entry_data.
13419 (Incremental_inputs_entry_data::data_size): New field.
13420 (Incremental_inputs::report_command_line): New method.
13421 (Incremental_inputs::finalize): New method.
13422 (Incremental_inputs::create_incremental_inputs_data): New method.
13423 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13424 * incremental.h: New file.
13425 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
13426 (Layout::finalize): Create incremental inputs section in
13427 incremental builds.
13428 (Layout::create_incremental_info_sections): New method.
13429 * layout.h (Layout::incremental_inputs): New method.
13430 (Layout::create_incremental_info_sections): New method.
13431 (Layout::incremental_inputs_): New field.
13432 * main.cc (main): Notify Incremental_input of the command line.
13434 2009-04-01 Ian Lance Taylor <iant@google.com>
13435 Mikolaj Zalewski <mikolajz@google.com>
13437 * gold.h (reserve_unordered_map): Define, three versions, one for
13438 each version of Unordered_map.
13439 * layout.cc (Layout::Layout): Remove options parameter. Add
13440 number_of_input_files parameter. Don't initialize options_.
13441 Initialize number_of_input_files_ and resized_signatures_. Move
13442 sections_are_attached_.
13443 (Layout::layout_group): Reserve space for group_signatures_.
13444 (Layout::find_or_add_kept_section): Change name parameter to be a
13445 reference. Resize signatures_ map when it gets large enough.
13446 (Layout::layout_eh_frame): Use parameters->options() instead of
13448 (Layout::make_output_section): Likewise.
13449 (Layout::attach_allocated_section_to_segment): Likewise.
13450 (Layout::finalize, Layout::create_executable_stack): Likewise.
13451 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13452 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13453 * layout.h (class Layout): Update declarations. Remove options_
13454 field. Add number_of_input_files_ and resized_signatures_
13455 fields. Move sections_are_attached_ field.
13456 * main.cc (main): Pass number of input files to Layout
13457 constructor. Don't pass options.
13459 2009-03-30 Ian Lance Taylor <iant@google.com>
13461 * ffsll.c (ffsll): Correct implementation.
13463 2009-03-27 Ian Lance Taylor <iant@google.com>
13465 * ffsll.c: New file.
13466 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13467 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13468 * ftruncate.c (ftruncate): Declare before definition.
13469 * mremap.c (mremap): Likewise.
13470 * pread.c (pread): Likewise.
13471 * configure, Makefile.in, config.in: Rebuild.
13473 * mremap.c: New file.
13474 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13475 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13476 (mremap): Declare if HAVE_MREMAP is not defined.
13477 * configure, Makefile.in, config.in: Rebuild.
13479 2009-03-27 Cary Coutant <ccoutant@google.com>
13481 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13482 position independent.
13483 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13484 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13486 2009-03-24 Cary Coutant <ccoutant@google.com>
13488 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13490 (needs_dynamic_reloc): Likewise.
13492 2009-03-24 Ian Lance Taylor <iant@google.com>
13494 * yyscript.y (file_cmd): Recognize EXTERN.
13495 (extern_name_list, extern_name_list_body): New nonterminals.
13496 * script.cc (script_add_extern): Define.
13497 * script-c.h (script_add_extern): Declare.
13499 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
13501 * object.cc (is_elf_object): Define.
13502 * object.h (is_elf_object): Declare.
13503 * archive.cc (Archive::get_elf_object_for_member): Call
13505 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
13507 2009-03-24 Elliott Hughes <enh@google.com>
13509 * output.cc (Output_file::map_anonymous): Define.
13510 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13511 try an anonymous one. Report the size if the mmap fails.
13512 * output.h (class Output_file): Declare map_anonymous.
13514 2009-03-24 Ian Lance Taylor <iant@google.com>
13516 * target-select.cc (instantiate_target): Don't acquire the lock if
13517 the instantiated_target_ field has already been set.
13519 2009-03-23 Ian Lance Taylor <iant@google.com>
13521 * gold-threads.h (class Initialize_lock): Define.
13522 * gold-threads.cc (class Initialize_lock_once): Define.
13523 (initialize_lock_control): New static variable.
13524 (initialize_lock_pointer): New static variable.
13525 (initialize_lock_once): New static function.
13526 (Initialize_lock::Initialize_lock): Define.
13527 (Initialize_lock::initialize): Define.
13528 * target-select.h: Include "gold-threads.h".
13529 (class Target_selector): Add lock_ and initialize_lock_ fields.
13530 Don't define instantiate_target, just declare it.
13531 * target-select.cc (Target_selector::Target_selector): Initialize
13533 (Target_selector::instantiate_target): Define.
13534 * descriptors.h: Include "gold-threads.h".
13535 (class Descriptors): Add initialize_lock_ field.
13536 * descriptors.cc (Descriptors::Descriptors): Initialize new
13538 (Descriptors::open): Use initialize_lock_ field
13539 * errors.h (class Errors): Add initialize_lock_ field.
13540 * errors.cc (Errors::Errors): Initialize new field.
13541 (Errors::initialize_lock): Use initialize_lock_ field.
13542 * powerpc.cc (class Target_selector_powerpc): Remove
13543 instantiated_target_ field. In do_recognize call
13544 instantiate_target rather than do_instantiate_target. In
13545 do_instantiate_target just allocate a new target.
13546 * sparc.cc (class Target_selector_sparc): Likewise.
13548 * freebsd.h: New file.
13549 * i386.cc: Include "freebsd.h".
13550 (Target_i386): Derive from Target_freebsd rather than
13552 (Target_selector_i386): Derive from Target_selector_freebsd rather
13553 than Target_selector.
13554 * x86_64.cc: Include "freebsd.h".
13555 (Target_x86_64): Derive from Target_freebsd rather than
13557 (Target_selector_x86_64): Derive from Target_selector_freebsd
13558 rather than Target_selector.
13559 * target.h (class Target): Add adjust_elf_header and
13560 do_adjust_elf_header.
13561 * output.cc (Output_file_header:: do_sized_write): Call target
13562 adjust_elf_header routine.
13563 * configure.tgt: Set targ_osabi.
13564 * configure.ac: Define GOLD_DEFAULT_OSABI.
13565 * parameters.cc (Parameters::default_target): Pass
13566 GOLD_DEFAULT_OSABI to select_target.
13567 * target-select.h (class Target_selector): Make instantiate_target
13568 protected rather than private.
13569 * Makefile.am (HFILES): Add freebsd.h.
13570 * configure, Makefile.in, config.in: Rebuild.
13572 * merge.cc (do_add_input_section): Correct pend value. Change
13573 message about last entry not being null terminated from error to
13576 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13578 * incremental.cc: New file.
13579 * Makefile.am (CCFILES): Add incremental.cc.
13580 * Makefile.in: Rebuild.
13582 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13584 * layout.cc (Layout::output_section_name): Preserve names
13585 of '.note.' sections.
13587 2009-03-19 Ian Lance Taylor <iant@google.com>
13589 * descriptors.cc (Descriptors::open): Check that the options are
13590 valid before using them.
13592 2009-03-18 Ian Lance Taylor <iant@google.com>
13594 * script-sections.h: Include <list>.
13595 (class Script_sections): Change Sections_elements from std::vector
13596 to std::list. Typedef public Elements_iterator. Add
13597 orphan_section_placement_, data_segment_align_start_, and
13598 saw_data_segment_align_ fields. Remove data_segment_align_index_
13600 * script-sections.cc (class Orphan_section_placement): New class.
13601 (class Sections_element): Add virtual functions is_relro and
13602 orphan_section_init. Remove virtual function place_orphan_here.
13603 (class Output_section_definition): Add is_relro and
13604 orphan_section_init. Remove place_orphan_here.
13605 (class Orphan_output_section): Likewise.
13606 (Script_sections::Script_sections): Update for field changes.
13607 (Script_sections::data_segment_align): Set saw_data_segment_align_
13608 and data_segment_align_start_, not data_segment_align_index.
13609 (Script_sections::data_segment_relro_end): Check
13610 saw_data_segment_align_. Use data_segment_align_start_ rather
13611 than data_segment_align_index_.
13612 (Script_sections::place_orphan): Rewrite to use
13613 Orphan_section_placement.
13615 2009-03-17 Ian Lance Taylor <iant@google.com>
13617 * archive.cc (Archive::add_symbols): Check for a version attached
13618 to the symbol name in the archive map.
13619 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13620 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13621 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13622 (ver_test_11.a): New target.
13623 * testsuite/Makefile.in: Rebuild.
13625 * configure.ac: Check for chsize and posix_fallocate. Replace
13627 * ftruncate.c: New file, from gnulib.
13628 * output.cc (posix_fallocate): Define dummy version if not
13629 HAVE_POSIX_FALLOCATE.
13630 (Output_file::map): Call posix_fallocate rather than lseek and
13632 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13633 * configure, Makefile.in, config.in: Rebuild.
13635 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
13637 * layout.h (Layout::create_note): Add section_name parameter.
13638 * layout.cc (Layout::create_note): Likewise.
13639 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
13641 2009-03-17 Ian Lance Taylor <iant@google.com>
13643 * descriptors.cc: Include "options.h".
13644 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13645 (Descriptors::open): Always use O_CLOEXEC when opening a new
13646 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13647 then set FD_CLOEXEC.
13649 * sparc.cc (class Target_sparc): Add has_got_section.
13650 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13651 make sure we have a GOT section.
13653 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13654 (Target_sparc::Scan::local): Likewise.
13655 (Target_sparc::Scan::global): Likewise.
13656 (Target_sparc::Relocate::relocate): Likewise.
13657 (Target_sparc::Relocate::relocate_tls): Likewise.
13659 * symtab.cc (Symbol_table::define_default_version): New function,
13660 broken out of add_from_object.
13661 (Symbol_table::add_from_object): Call define_default_version.
13662 (Symbol_table::define_special_symbol): Add resolve_oldsym
13663 parameter. Change all callers. If the version for a symbol comes
13664 from a version script, resolve it with the symbol with the same
13665 name with no version. Also add the symbol without a version if
13667 (do_define_in_output_data): If resolving with oldsym, don't delete
13669 (do_define_in_output_segment): Likewise.
13670 (do_define_as_constant): Likewise.
13671 * symtab.h (class Symbol_table): Update declarations.
13673 2009-03-13 Ian Lance Taylor <iant@google.com>
13675 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13676 (Read_symbols::requeue): New function.
13677 (Read_symbols::do_read_symbols): If make_elf_object fails because
13678 the target type is not configured, and the file was searched for,
13679 issue a warning and retry with the next directory.
13680 (Add_symbols::run): If the file has an incompatible format, and
13681 it was searched for, requeue the Read_symbols task. On error,
13682 release the object.
13683 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13684 dirindex parameter to constructor. Change all callers. Declare
13685 incompatible_warning and requeue.
13686 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13687 input_argument_ and input_group_ fields. Add them to
13688 constructor. Change all callers.
13689 (class Read_script): Add dirindex_ field. Add it to constructor.
13690 Change all callers.
13691 * archive.cc (Archive::setup): Remove input_objects parameter.
13692 Change all callers.
13693 (Archive::get_file_and_offset): Likewise.
13694 (Archive::read_all_symbols): Likewise.
13695 (Archive::read_symbols): Likewise.
13696 (Archive::get_elf_object_for_member): Remove input_objects
13697 parameter. Add punconfigured parameter. Change all callers.
13698 (Archive::add_symbols): Change return type to bool. Check return
13699 value of include_member.
13700 (Archive::include_all_members): Likewise.
13701 (Archive::include_member): Change return type to bool. Return
13702 false if first included object has incompatible target. Set
13703 included_member_ field.
13704 (Add_archive_symbols::run): If add_symbols returns false, requeue
13706 * archive.h (class Archive): Add included_member_ field.
13707 Initialize it in constructor. Add input_file and searched_for
13708 methods. Update declarations.
13709 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13710 input_argument_ fields. Add them to constructor. Change all
13712 * script.cc: Include "target-select.h".
13713 (class Parser_closure): Add skip_on_incompatible_target_ and
13714 found_incompatible_target_ fields. Add
13715 skip_on_incompatible_target parameter to constructor. Change all
13716 callers. Add methods skip_on_incompatible_target,
13717 clear_skip_on_incompatible_target, found_incompatible_target, and
13718 set_found_incompatible_target.
13719 (read_input_script): Add dirindex parameter. Change all callers.
13720 If parser finds an incompatible target, requeue Read_symbols
13722 (script_set_symbol): Clear skip_on_incompatible_target in
13724 (script_add_assertion, script_parse_option): Likewise.
13725 (script_start_sections, script_add_phdr): Likewise.
13726 (script_check_output_format): New function.
13727 * script.h (read_input_script): Update declaration.
13728 * script-c.h (script_check_output_format): Declare.
13729 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13730 (ignore_cmd): Remove OUTPUT_FORMAT.
13731 * fileread.cc (Input_file::Input_file): Add explicit this.
13732 (Input_file::will_search_for): New function.
13733 (Input_file::open): Add pindex parameter. Change all callers.
13734 * fileread.h (class Input_file): Add input_file_argument method.
13735 Declare will_search_for. Update declarations.
13736 * object.cc (make_elf_object): Add punconfigured parameter.
13737 Change all callers.
13738 * object.h (class Object): Make input_file public. Add
13739 searched_for method.
13740 (make_elf_object): Update declaration.
13741 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13743 * dirsearch.h (class Dirsearch): Update declaration.
13744 * options.h (class General_options): Add --warn-search-mismatch.
13745 * parameters.cc (Parameters::is_compatible_target): New function.
13746 * parameters.h (class Parameters): Declare is_compatible_target.
13747 * workqueue.cc (Workqueue::add_blocker): New function.
13748 * workqueue.h (class Workqueue): Declare add_blocker.
13750 * fileread.cc (Input_file::open): Remove options parameter.
13751 Change all callers.
13752 (Input_file::open_binary): Likewise.
13753 * script.cc (read_input_script): Likewise.
13754 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13755 options parameter from constructor. Change all callers.
13756 (class Read_script): Likewise.
13757 * fileread.h (class Input_file): Update declarations.
13758 * script.h (read_input_script): Update declaration.
13760 2009-03-10 Nick Clifton <nickc@redhat.com>
13762 * po/es.po: New Spanish translation.
13764 2009-03-06 Cary Coutant <ccoutant@google.com>
13766 * options.cc (parse_short_option): Keep dash_z from registering itself.
13768 2009-03-03 Ian Lance Taylor <iant@google.com>
13771 * target-reloc.h (relocate_section): Pass output_section to
13773 * i386.cc (Target_i386::should_apply_static_reloc): Add
13774 output_section parameter. Change all callers.
13775 (Target_i386::Relocate::relocate): Add output_section parameter.
13776 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13777 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13778 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13779 * testsuite/two_file_shared.sh: New script.
13780 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13781 (check_DATA): Add two_file_shared.dbg.
13782 (two_file_shared.dbg): New target.
13783 * testsuite/Makefile.in: Rebuild.
13785 2009-03-01 Ian Lance Taylor <iant@google.com>
13787 * configure.ac: Check for byteswap.h.
13788 * configure: Rebuild.
13789 * config.in: Rebuild.
13791 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13793 * layout.cc (Layout::find_or_add_kept_section): New function.
13794 (Layout::add_comdat): Removed.
13795 * layout.h (struct Kept_section): Move out of class Layout.
13796 Remove trailing underscores from field names. Add group_sections
13797 field. Rename group_ field to is_group. Change all uses.
13798 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13799 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13800 comdat_groups_ field.
13801 (Sized_relobj::include_section_group): Use
13802 find_or_add_kept_section and Kept_section::group_sections.
13803 (Sized_relobj::include_linkonce_section): Likewise.
13804 * object.cc (class Sized_relobj): Don't define Comdat_group or
13805 Comdat_group_table. Remove find_comdat_group and
13806 add_comdat_group. Remove comdat_groups_ field.
13807 * plugin.cc (include_comdat_group): Use
13808 Layout::find_or_add_kept_section.
13810 2009-02-28 Ian Lance Taylor <iant@google.com>
13812 * README: --gc-sections and map files are now supported. Document
13813 some build requirements.
13816 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13817 relocatable link set the value of the section symbol to zero.
13818 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13819 relocatable link don't include the section address in the local
13822 2009-02-27 Ian Lance Taylor <iant@google.com>
13825 * options.h (class Search_directory): Add is_system_directory.
13826 (class General_options): Declare is_in_system_directory.
13827 * options.cc (get_relative_sysroot): Make static.
13828 (get_default_sysroot): Make static.
13829 (General_optoins::is_in_system_directory): New function.
13830 * fileread.cc (Input_file::is_in_system_directory): New function.
13831 * fileread.h (class Input_file): Declare is_in_system_directory.
13832 * object.h (class Object): Add is_in_system_directory.
13833 (class Input_objects): Remove system_library_directory_ field.
13834 * object.cc (Input_objects::add_object): Don't set
13835 system_library_directory_.
13836 (input_objects::found_in_system_library_directory): Remove.
13837 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13838 parameter. Change all callers.
13839 (Symbol_table::sized_write_globals): Likewise.
13840 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13841 Call Object::is_in_system_directory.
13842 * symtab.h (class Symbol_table): Update declarations.
13845 * descriptors.h (Open_descriptor): Add is_on_stack field.
13846 * descriptors.cc (Descriptors::open): If the descriptor is on the
13847 top of the stack, remove it. Initialize is_on_stack field.
13848 (Descriptors::release): Only add pod to stack if it is not on the
13850 (Descriptors::close_some_descriptor): Clear stack_next and
13851 is_on_stack fields.
13854 * output.cc (Output_section::find_starting_output_address): Rename
13855 from starting_output_address; add PADDR parameter; change return
13857 * output.h (class Output_section): Declare
13858 find_starting_output_address instead of starting_output_address.
13859 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13860 section symbol for which we can't find a merge section.
13863 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13864 hidden or internal, force the symbol to be local.
13865 * resolve.cc (Symbol::override_visibility): Define.
13866 (Symbol::override_base): Use override_visibility.
13867 (Symbol_table::resolve): Likewise.
13868 (Symbol::override_base_with_special): Likewise.
13869 (Symbol_table::override_with_special): If the visibility is hidden
13870 or internal, force the symbol to be local.
13871 * symtab.h (class Symbol): Add set_visibility and
13872 override_visibility.
13873 * testsuite/ver_test_1.sh: New file.
13874 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13875 (check_DATA): Add ver_test_1.syms.
13876 (ver_test_1.syms): New target.
13877 * testsuite/Makefile.in: Rebuild.
13879 2009-02-25 Cary Coutant <ccoutant@google.com>
13881 * layout.cc (Layout::choose_output_section): Don't rename sections
13882 when using a linker script that has a SECTIONS clause.
13883 * Makefile.in: Regenerate.
13885 * testsuite/Makefile.am (script_test_5.sh): New test case.
13886 * testsuite/Makefile.in: Regenerate.
13887 * testsuite/script_test_5.cc: New file.
13888 * testsuite/script_test_5.sh: New file.
13889 * testsuite/script_test_5.t: New file.
13891 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
13893 * archive.cc (Archive::include_member): Update calls to add_symbols.
13894 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13895 the Layout argument.
13896 * dynobj.h (do_add_symbols): Add the Layout argument.
13897 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13899 * object.h (Object::add_symbols): Add the Layout argument.
13900 (Object::do_add_symbols): Add the Layout argument.
13901 (Sized_relobj::do_add_symbols): Add the Layout argument.
13902 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13903 Unify the two versions.
13904 (Add_plugin_symbols): Remove.
13905 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13906 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13907 (Add_plugin_symbols): Remove.
13908 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13909 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13910 (Add_symbols::run): Make it work with Pulginobj.
13912 2009-02-06 Ian Lance Taylor <iant@google.com>
13914 * object.cc (Sized_relobj::do_layout): Make info message start
13915 with lower case letter.
13917 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13919 * binary.cc: Fix file comment.
13921 * options.h (enum Incremental_disposition): Define.
13922 (class General_options): Add new options: --incremental,
13923 --incremental_changed, --incremental_unchanged,
13924 --incremental_unknown. Add incremental_disposition_ and
13925 implicit_incremental_ fields.
13926 (General_options::incremental_disposition): New function.
13927 (class Position_dependent_options): Add incremental_disposition
13929 (Position_dependent_options::copy_from_options): Set incremental
13931 * options.cc (General_options::parse_incremental_changed): New
13933 (General_options::parse_incremental_unchanged): New function.
13934 (General_options::parse_incremental_unknown): New function.
13935 (General_options::General_options): Initialize new fields
13936 incremental_disposition_ and implicit_incremental_.
13937 (General_options::finalize): Check for uasge of --incremental-*
13938 without --incremental.
13940 2009-02-06 Chris Demetriou <cgd@google.com>
13942 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13943 pointer and to report location as the file name associated with
13945 (gold_undefined_symbol_at_location): New function to replace the
13946 old gold_undefined_symbol functionality.
13947 * target-reloc.h (relocate_section): Update to use
13948 gold_undefined_symbol_at_location.
13949 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13950 Call gold_undefined_symbol function rather than gold_error.
13951 * errors.h (Errors::undefined_symbol): Take location as a
13952 string, rather than calculating it from a relocation.
13953 * errors.cc (Errors::fatal): Print "fatal error:" before the
13955 (Errors::error, Errors::error_at_location): Print "error: "
13956 before the formatted message.
13957 (Errors::undefined_symbol): Take location as a string, rather
13958 than calculating it from a relocation.
13959 (gold_undefined_symbol_at_location): New function akin to
13960 old gold_undefined_symbol, calculates location from relocation.
13961 (gold_undefined_symbol): Change to take only a Symbol pointer
13962 and to report location as the file name associated with the symbol.
13963 * testsuite/debug_msg.sh: Update for changed error messages.
13964 * testsuite/undef_symbol.sh: Likewise.
13966 2009-02-04 Duncan Sands <baldrick@free.fr>
13969 * reduced_debug_output.h
13970 (Output_reduced_debug_abbrev_section::failed): Use format for
13972 (Output_reduced_debug_info_section::faild): Likewise.
13974 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13976 * script.cc (Lazy_demangler): New class.
13977 (Version_script_info::get_symbol_version_helper): Demangle a
13980 2009-01-29 Cary Coutant <ccoutant@google.com>
13982 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13984 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13986 2009-01-28 Ian Lance Taylor <iant@google.com>
13988 * version.cc (version_string): Bump to 1.9.
13990 * gold.h: Include <cstring> and <stdint.h>.
13991 * version.cc: Include <cstdio>.
13992 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13994 * reduced_debug_output.cc (insert_into_vector): Rename from
13995 Insert_into_vector; change all callers. Use Swap_unaligned to
13996 avoid aliasing issue; remove union since it is unnecessary.
13998 2009-01-27 Sriraman Tallam <tmsriram@google.com>
14000 * Makefile.am (CCFILES): Add gc.cc.
14001 (HFILES): Add gc.h.
14002 * Makefile.in: Regenerate.
14003 * gold.cc (Gc_runner): New class.
14004 (queue_initial_tasks): Call garbage collection related tasks
14005 when corresponding options are invoked.
14006 (queue_middle_gc_tasks): New function.
14007 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14008 processed early before laying out sections during garbage collection.
14009 * gold.h (queue_middle_gc_tasks): New function.
14010 (is_prefix_of): Move from "layout.cc".
14011 * i386.cc (Target_i386::gc_process_relocs): New function.
14012 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14013 * main.cc (main): Create object of class "Garbage_collection".
14014 * object.cc (Relobj::copy_symbols_data): New function.
14015 (Relobj::is_section_name_included): New function.
14016 (Sized_relobj::do_layout): Allow this function to be called twice
14017 during garbage collection and defer layout of section during the
14019 * object.h (Relobj::get_symbols_data): New function.
14020 (Relobj::is_section_name_included): New function.
14021 (Relobj::copy_symbols_data): New function.
14022 (Relobj::set_symbols_data): New function.
14023 (Relobj::get_relocs_data): New function.
14024 (Relobj::set_relocs_data): New function.
14025 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14026 (Relobj::gc_process_relocs): New function.
14027 (Relobj::do_gc_process_relocs): New pure virtual function.
14028 (Relobj::sd_): New data member.
14029 (Sized_relobj::is_output_section_offset_invalid): New function.
14030 (Sized_relobj::do_gc_process_relocs): New function.
14031 * options.h (General_options::gc_sections): Modify to not be a no-op.
14032 (General_options::print_gc_sections): New option.
14033 * plugin.cc (Plugin_finish::run): Remove function call to
14034 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14035 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14036 * reloc.cc (Read_relocs::run): Add task to process relocs and
14037 determine unreferenced sections when doing garbage collection.
14038 (Gc_process_relocs): New class.
14039 (Sized_relobj::do_gc_process_relocs): New function.
14040 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14041 sections that are garbage collected.
14042 * reloc.h (Gc_process_relocs): New class.
14043 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14044 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14045 symbols whose corresponding sections are garbage collected.
14046 (Symbol_table::Symbol_table): Add new parameter for the garbage
14048 (Symbol_table::gc_mark_undef_symbols): New function.
14049 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14050 (Symbol_table::gc_mark_dyn_syms): New function.
14051 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14053 (Symbol_table::add_from_object): Likewise.
14054 (Symbol_table::add_from_relobj): When building shared objects, do not
14055 treat externally visible symbols as garbage.
14056 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14057 table information for static and relocatable links.
14058 * symtab.h (Symbol_table::set_gc): New function.
14059 (Symbol_table::gc): New function.
14060 (Symbol_table::gc_mark_undef_symbols): New function.
14061 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14062 (Symbol_table::gc_mark_dyn_syms): New function.
14063 (Symbol_table::gc_): New data member.
14064 * target.h (Sized_target::gc_process_relocs): New pure virtual
14066 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14067 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14069 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14071 * options.h (General_options::gc_sections): Define as a no-op for now.
14072 (General_options::no_keep_memory): Ditto.
14073 (General_options::Bshareable): Define.
14074 * options.cc (General_options::finalize): Honor -Bshareable.
14076 2009-01-20 Andreas Schwab <schwab@suse.de>
14078 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14079 read the value in the contents, since we don't use it. Use the
14080 template endianness when writing.
14081 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14083 2009-01-19 Andreas Schwab <schwab@suse.de>
14085 * configure.tgt (powerpc64-*): Fix targ_obj.
14087 2009-01-15 Ian Lance Taylor <iant@google.com>
14089 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14090 local symbols when stripping all symbols.
14092 2009-01-14 Cary Coutant <ccoutant@google.com>
14094 * output.cc (Output_reloc): Add explicit instantiations.
14096 2009-01-14 Cary Coutant <ccoutant@google.com>
14098 * archive.cc (Archive::get_elf_object_for_member): Remove call
14099 to File_read::claim_for_plugin.
14100 * descriptors.cc (Descriptors::open): Remove reference to
14102 (Descriptors::claim_for_plugin): Remove.
14103 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14104 (Descriptors::is_claimed): Remove.
14105 (claim_descriptor_for_plugin): Remove.
14106 * fileread.cc (File_read::claim_for_plugin): Remove.
14107 * fileread.h (File_read::claim_for_plugin): Remove.
14108 (File_read::descriptor): Reopen descriptor if necessary.
14109 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14110 (Plugin_manager::all_symbols_read): Add task parameter. Change
14112 (Plugin_manager::get_input_file): New function.
14113 (Plugin_manager::release_input_file): New function.
14114 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14115 corresponding data member.
14116 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14117 and pass to base constructor. Change all callers.
14118 (get_input_file, release_input_file): New functions.
14119 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14120 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14121 (Plugin_manager::all_symbols_read): Add task parameter.
14122 (Plugin_manager::get_input_file): New function.
14123 (Plugin_manager::release_input_file): New function.
14124 (Plugin_manager::task_): New data member.
14125 (Pluginobj::Pluginobj): Add filesize parameter.
14126 (Pluginobj::filename): New function.
14127 (Pluginobj::descriptor): New function.
14128 (Pluginobj::filesize): New function.
14129 (Pluginobj::filesize_): New data member.
14130 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14131 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14132 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14134 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14135 with archive libraries.
14136 * testsuite/Makefile.in: Regenerate.
14137 * testsuite/plugin_test.c (struct sym_info): New type.
14138 (get_input_file, release_input_file): New static variables.
14139 (onload): Capture new transfer vector entries.
14140 (claim_file_hook): Stop reading at end of file according to filesize.
14141 Factor out parsing of readelf output into separate function.
14142 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14143 APIs and get the source file name from the symbol table. Convert
14144 source file name to corresponding object file name. Print info
14145 message when adding new input files.
14146 (parse_readelf_line): New function.
14147 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14148 * testsuite/plugin_test_2.sh: Likewise.
14149 * testsuite/plugin_test_3.sh: Likewise.
14150 * testsuite/plugin_test_4.sh: New test case.
14152 2009-01-07 Ian Lance Taylor <iant@google.com>
14154 * version.cc (version_string): Bump to 1.8.
14156 2008-12-23 Cary Coutant <ccoutant@google.com>
14158 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14159 * plugin.cc (Plugin_manager::finish): Rename as
14160 layout_deferred_objects. Move cleanup to separate function.
14161 (Plugin_manager::cleanup): New function.
14162 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14164 * plugin.h (Plugin_manager::finish): Rename as
14165 layout_deferred_objects.
14166 (Plugin_manager::cleanup): New function.
14167 (Plugin_manager::cleanup_done): New field.
14169 2008-12-23 Cary Coutant <ccoutant@google.com>
14171 * plugin.cc (is_visible_from_outside): New function.
14172 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14173 so we don't return "IR only" status for exported symbols or -r links.
14175 * testsuite/Makefile.am (plugin_test_3): New test case.
14176 * testsuite/Makefile.in: Regenerate.
14177 * testsuite/plugin_test_3.sh: New file.
14179 2008-12-22 Cary Coutant <ccoutant@google.com>
14181 * object.cc (Sized_relobj::layout_section): New function.
14182 (Sized_relobj::do_layout): Defer layout of input sections until after
14183 plugin has provided replacement files.
14184 (Sized_relobj::do_layout_deferred_sections): New function.
14185 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14186 (Relobj::layout_deferred_sections): New function.
14187 (Relobj::do_layout_deferred_sections): New function.
14188 (Sized_relobj::do_layout_deferred_sections): New function.
14189 (Sized_relobj::layout_section): New function.
14190 (Sized_relobj::Deferred_layout): New structure.
14191 (Sized_relobj::deferred_layout_): New field.
14192 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14193 Change all callers. Layout deferred sections.
14194 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14196 (Plugin_hook::run): Move code from do_plugin_hook inline.
14197 (Plugin_hook::do_plugin_hook): Remove.
14198 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14199 (Plugin_manager::finish): Renamed, was cleanup.
14200 (Plugin_manager::should_defer_layout): New function.
14201 (Plugin_manager::add_deferred_layout_object): New function.
14202 (Plugin_manager::Deferred_layout_list): New type.
14203 (Plugin_manager::deferred_layout_objects_): New field.
14204 (Plugin_hook::do_plugin_hook): Remove.
14206 2008-12-17 Ian Lance Taylor <iant@google.com>
14208 * options.h (class General_options): Add --no case for
14211 2008-12-16 Cary Coutant <ccoutant@google.com>
14213 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14215 (Plugin_manager::claim_file): Create plugin object even if
14216 plugin did not call the add_symbols callback.
14217 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14218 asking for more symbols than were added.
14219 * testsuite/Makefile.am (plugin_test_1): Add test case with
14221 (empty.syms): New target.
14222 * testsuite/Makefile.in: Regenerate.
14223 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14224 message. Don't call add_symbols if no globals.
14225 (all_symbols_read_hook): Don't provide replacement for empty
14228 2008-12-12 Ian Lance Taylor <iant@google.com>
14230 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14231 r_type == 0 for a local symbol with r_sym == 0.
14232 (scan_relocatable_relocs): Pass r_sym to
14233 local_non_section_strategy.
14234 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14237 * configure.ac: Update test for TLS descriptors: they are
14238 supported as of glibc 2.9.
14239 * configure: Rebuild.
14241 2008-12-11 Ian Lance Taylor <iant@google.com>
14244 * target-reloc.h (Default_scan_relocatable_relocs): For each
14245 function, map r_type == 0 to RELOC_DISCARD.
14247 2008-12-10 Cary Coutant <ccoutant@google.com>
14249 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14250 object to override a kept COMDAT group from a plugin object.
14252 2008-12-09 Ian Lance Taylor <iant@google.com>
14255 * yyscript.y (file_cmd): Handle INPUT.
14257 * testsuite/initpri1.c: Change all declarations to be full
14258 prototypes by adding void, to avoid compiler warnings.
14260 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
14262 * options.cc (General_options::parse_plugin_opt): New.
14263 (General_options::add_plugin): The argument now is just the filename.
14264 (General_options::add_plugin_option): New.
14265 * options.h (plugin_opt): New.
14266 (add_plugin): Change argument name.
14267 (add_plugin_option): New.
14268 * plugin.cc (Plugin::load): Don't parse the plugin option.
14269 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14270 (Plugin::add_option): New.
14271 (Plugin::args_): Change type.
14272 (Plugin::filename_): New.
14273 (Plugin_manager::add_plugin_option): New.
14274 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14275 * testsuite/Makefile.in: Regenerate.
14277 2008-12-05 Cary Coutant <ccoutant@google.com>
14279 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14280 Handle --strip-lto-sections option.
14281 * options.h (strip_lto_sections): New option.
14283 2008-12-01 Cary Coutant <ccoutant@google.com>
14285 * plugin.cc (ld_plugin_message): Change format parameter to const.
14286 Fix mismatch between new[] and delete.
14288 2008-11-14 Cary Coutant <ccoutant@google.com>
14290 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14293 2008-11-05 Craig Silverstein <csilvers@google.com>
14295 * options.cc (General_options::parse_dynamic_list): New function.
14296 * options.h (General_options): New flags dynamic_list,
14297 dynamic_list_data, dynamic_list_cpp_new, and
14298 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14299 (General_options::in_dynamic_list): New function.
14300 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14301 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14302 (Lex::can_continue_name): Likewise.
14304 (read_script_file): New parameter script_options.
14305 (read_dynamic_list): New function.
14306 (Script_options::define_dynamic_list): New function.
14307 (dynamic_list_keyword_parsecodes): New variable.
14308 (dynamic_list_keywords): New variable.
14309 * script.h (Script_options::define_dynamic_list): New function
14311 (read_dynamic_list): New function prototype.
14312 * symtab.cc (strprefix): New macro.
14313 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14314 dynamic_list_data, dynamic_list_cpp_new, and
14315 dynamic_list_cpp_typeinfo.
14316 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14317 (dynamic_list_expr): New rule.
14318 (dynamic_list_nodes): Likewise.
14319 (dynamic_list_node): Likewise.
14320 * testsuite/Makefile.am (dynamic_list): New test.
14321 * testsuite/Makefile.in: Regenerated.
14322 * testsuite/dynamic_list.t: New file.
14323 * testsuite/dynamic_list.sh: New file.
14325 2008-11-05 Craig Silverstein <csilvers@google.com>
14327 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14328 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14329 (t11_last): Likewise.
14330 * testsuite/ver_test_6.c (main): Likewise.
14332 2008-10-07 Cary Coutant <ccoutant@google.com>
14334 * options.c (General_options::finalize): Add check for -static and
14336 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14339 2008-10-02 Cary Coutant <ccoutant@google.com>
14341 * plugin.cc (make_sized_plugin_object): Fix conditional
14342 compilation to work when not all targets are enabled.
14344 2008-09-29 Cary Coutant <ccoutant@google.com>
14346 * archive.cc (Archive::get_file_and_offset): Use filename instead
14347 of name to get library path.
14348 (Archive::include_member): Unlock external member of a thin archive.
14350 * testsuite/Makefile.am (TEST_AR): New variable.
14351 (thin_archive_test_1): New test.
14352 (thin_archive_test_2): New test.
14353 * testsuite/Makefile.in: Regenerate.
14354 * testsuite/thin_archive_main.cc: New file.
14355 * testsuite/thin_archive_test_1.cc: New file.
14356 * testsuite/thin_archive_test_2.cc: New file.
14357 * testsuite/thin_archive_test_3.cc: New file.
14358 * testsuite/thin_archive_test_4.cc: New file.
14360 2008-09-29 Cary Coutant <ccoutant@google.com>
14362 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14363 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14365 (Sized_relobj::do_finalize_local_symbols): Likewise.
14366 (Sized_relobj::map_to_kept_section): Likewise.
14367 * object.h (Sized_relobj::invalid_address): New constant.
14368 (Sized_relobj::do_output_section_offset): Check for invalid_address
14370 * output.cc (Output_reloc::local_section_offset): Use constant
14371 invalid_address instead of -1U.
14372 (Output_reloc::get_address): Likewise.
14373 (Output_section::output_address): Change -1U to -1ULL.
14374 * output.h (Output_reloc::invalid_address): New constant.
14375 * reloc.cc (Sized_relobj::write_sections): Use constant
14376 invalid_address instead of -1U.
14377 (Sized_relobj::relocate_sections): Likewise.
14378 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14379 values for merge sections.
14380 * target-reloc.h (relocate_for_relocatable): Use constant
14381 invalid_address instead of -1U.
14383 2008-09-19 Cary Coutant <ccoutant@google.com>
14385 Add plugin functionality for link-time optimization (LTO).
14386 * configure.ac (plugins): Add --enable-plugins option.
14387 * configure: Regenerate.
14388 * config.in: Regenerate.
14389 * Makefile.am (LIBDL): New variable.
14390 (CCFILES): Add plugin.cc.
14391 (HFILES): Add plugin.h.
14392 (ldadd_var): Add LIBDL.
14393 * Makefile.in: Regenerate.
14395 * archive.cc: Include "plugin.h".
14396 (Archive::setup): Don't preread archive symbols when using a plugin.
14397 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14398 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14400 (Archive::include_member): Add symbols from plugin objects.
14401 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14402 * descriptors.cc (Descriptors::open): Check for file descriptors
14403 abandoned by plugins.
14404 (Descriptors::claim_for_plugin): New function.
14405 * descriptors.h (Descriptors::claim_for_plugin): New function.
14406 (Open_descriptor::is_claimed): New field.
14407 (claim_descriptor_for_plugin): New function.
14408 * fileread.cc (File_read::claim_for_plugin): New function.
14409 * fileread.h (File_read::claim_for_plugin): New function.
14410 (File_read::descriptor): New function.
14411 * gold.cc: Include "plugin.h".
14412 (queue_initial_tasks): Add task to call plugin hooks for generating
14414 * main.cc: Include "plugin.h".
14415 (main): Load plugin libraries.
14416 * object.h (Pluginobj): Declare.
14417 (Object::pluginobj): New function.
14418 (Object::do_pluginobj): New function.
14419 (Object::set_target): New function.
14420 * options.cc: Include "plugin.h".
14421 (General_options::parse_plugin): New function.
14422 (General_options::General_options): Initialize plugins_ field.
14423 (General_options::add_plugin): New function.
14424 * options.h (Plugin_manager): Declare.
14425 (General_options): Add --plugin option.
14426 (General_options::has_plugins): New function.
14427 (General_options::plugins): New function.
14428 (General_options::add_plugin): New function.
14429 (General_options::plugins_): New field.
14430 * plugin.cc: New file.
14431 * plugin.h: New file.
14432 * readsyms.cc: Include "plugin.h".
14433 (Read_symbols::do_read_symbols): Check for archive before checking
14434 for ELF file. Call plugin hooks to claim files.
14435 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14436 from a real object file; force override when processing replacement
14438 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14439 (Symbol::init_base_object): Likewise.
14440 (Symbol::init_base_output_data): Likewise.
14441 (Symbol::init_base_output_segment): Likewise.
14442 (Symbol::init_base_constant): Likewise.
14443 (Symbol::init_base_undefined): Likewise.
14444 (Symbol::output_section): Assert that object is not a plugin.
14445 (Symbol_table::add_from_pluginobj): New function.
14446 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14448 (Symbol_table::sized_write_globals): Likewise.
14449 (Symbol_table::add_from_pluginobj): Instantiate template.
14450 * symtab.h (Sized_pluginobj): Declare.
14451 (Symbol::in_real_elf): New function.
14452 (Symbol::set_in_real_elf): New function.
14453 (Symbol::in_real_elf_): New field.
14454 (Symbol_table::add_from_pluginobj): New function.
14456 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14457 (LIBDL): New variable.
14458 (LDADD): Add LIBDL.
14459 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14460 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14461 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14462 (MOSTLYCLEANFILES): Likewise.
14463 * testsuite/Makefile.in: Regenerate.
14464 * testsuite/plugin_test.c: New file.
14465 * testsuite/plugin_test_1.sh: New file.
14466 * testsuite/plugin_test_2.sh: New file.
14468 2008-09-16 Ian Lance Taylor <iant@google.com>
14470 * target-reloc.h (relocate_section): Check whether a symbol is
14471 defined by the ABI before reporting an undefined symbol error.
14472 * target.h (Target::is_defined_by_abi): Make parameter const.
14473 (Target::do_is_defined_by_abi): Likewise.
14474 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14475 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14476 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14477 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14478 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14479 * testsuite/Makefile.in: Rebuild.
14481 * fileread.cc (make_view): Add casts to avoid warning.
14483 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
14485 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14486 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14488 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
14490 * options.h (General_options::output_is_executable): New.
14491 (General_options::output_is_pie): New.
14492 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14493 for shared libraries.
14494 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14496 2008-09-11 Chris Demetriou <cgd@google.com>
14498 * options.h (origin): New -z option.
14499 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14500 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14503 2008-09-05 Cary Coutant <ccoutant@google.com>
14505 * fileread.cc (File_read::make_view): Add check for attempt to map
14506 beyond end of file.
14508 2008-09-05 Cary Coutant <ccoutant@google.com>
14510 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14511 explicit instantiations.
14513 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14516 * options.cc (General_options::finalize): Allow undefined symbols
14517 in shlibs if linking -shared.
14520 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14521 symbols as not needing a dynsym entry.
14523 2008-08-20 Craig Silverstein <csilvers@google.com>
14525 * fileread.cc (File_read::open): Do not lock the file unless it
14526 was successfully opened.
14528 2008-08-14 Cary Coutant <ccoutant@google.com>
14530 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14531 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14532 * testsuite/tls_test.cc (struct int128): 128-bit struct
14533 for testing TLS relocs with non-zero addend.
14534 (v12): New TLS variable.
14536 (t_last): Add check for v12.
14537 * testsuite/tls_test.h (t12): New function.
14538 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14540 2008-08-13 Ian Lance Taylor <iant@google.com>
14542 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14543 set tls_segment_ or relro_segment_.
14544 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14546 * output.h (Output_section::clear_is_relro): New function.
14547 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14548 sections specially even when output_data_ is empty.
14549 (Output_segment::maximum_alignment): When first section is relro,
14550 only force alignment for PT_LOAD segments.
14551 * script.cc (script_data_segment_align): New function.
14552 (script_data_segment_relro_end): New function.
14553 * script-c.h (script_data_segment_align): Declare.
14554 (script_data_segment_relro_end): Declare.
14555 * script-sections.h (class Script_sections): Declare
14556 data_segment_align and data_segment_relro_end. Add fields
14557 segment_align_index_ and saw_relro_end_.
14558 * script-sections.cc (class Sections_element): Add set_is_relro
14559 virtual function. Add new bool* parameter to place_orphan_here.
14560 Add get_output_section virtual function.
14561 (class Output_section_definition): Add set_is_relro. Add new
14562 bool* parameter to place_orphan_here. Add get_output_section.
14563 Add is_relro_ field.
14564 (Output_section_definition::Output_section_definition): Initialize
14565 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14566 and is_relro_ fields.
14567 (Output_section_definition::place_orphan_here): Add is_relro
14569 (Output_section_definition::set_section_addresses): Set relro for
14571 (Output_section_definition::alternate_constraint): Likewise.
14572 (class Orphan_output_section): Add new bool* parameter to
14573 place_orphan_here. Add get_output_section.
14574 (Orphan_output_section::place_orphan_here): Add is_relro
14576 (Script_sections::Script_sections): Initialize
14577 data_segment_align_index_ and saw_relro_end_.
14578 (Script_sections::data_segment_align): New function.
14579 (Script_sections::data_segment_relro_end): New function.
14580 (Script_sections::place_orphan): Set or clear is_relro.
14581 (Script_sections::set_section_addresses): Force alignment of first
14583 * yyscript.y (exp): Call script_data_segment_align and
14584 script_data_segment_relro_end.
14585 * testsuite/relro_script_test.t: New file.
14586 * testsuite/relro_test.cc (using_script): Declare.
14587 (t1, t2): Test using_script.
14588 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14589 (relro_script_test_SOURCES): Define.
14590 (relro_script_test_DEPENDENCIES): Define.
14591 (relro_script_test_LDFLAGS): Define.
14592 (relro_script_test_LDADD): Define.
14593 (relro_script_test.so): New target.
14594 * testsuite/Makefile.in: Rebuild.
14596 2008-08-06 Cary Coutant <ccoutant@google.com>
14598 * archive.cc (Archive::total_archives, Archive::total_members)
14599 (Archive::total_members_loaded): New variables.
14600 (Archive::setup): Add parameter. Add option to preread
14602 (Archive::read_armap): Add counter.
14603 (Archive::get_file_and_offset): New function.
14604 (Archive::get_elf_object_for_member): New function.
14605 (Archive::read_all_symbols): New function.
14606 (Archive::read_symbols): New function.
14607 (Archive::add_symbols): Add counters.
14608 (Archive::include_all_members): Use armap to find members if it's
14610 (Archive::include_member): Skip reading symbols if already read.
14611 Factored code into Archive::get_file_and_offset and
14612 Archive::get_elf_object_for_member. Changed call to
14613 Mapfile::report_include_archive_member.
14614 (Archive::print_stats): New function.
14615 * archive.h: Declare Object and Read_symbols_data classes.
14616 (Archive::Archive): Add initializers for new members.
14617 (Archive::setup): Add parameter.
14618 (Archive::print_stats): New function.
14619 (Archive::total_archives, Archive::total_members)
14620 (Archive::total_members_loaded): New variables.
14621 (Archive::get_file_and_offset): New function.
14622 (Archive::get_elf_object_for_member): New function.
14623 (Archive::read_all_symbols): New function.
14624 (Archive::read_symbols): New function.
14625 (Archive::Archive_member): New class.
14626 (Archive::members_): New member.
14627 (Archive::num_members_): New member.
14628 * main.cc: Include archive.h.
14629 (main): Call Archive::print_stats.
14630 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14631 archive parameter; member_name is now the fully-decorated name.
14632 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14633 * options.h: (General_options): Add --preread-archive-symbols option.
14634 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14637 2008-08-04 Ian Lance Taylor <iant@google.com>
14639 * symtab.h (Symbol::use_plt_offset): New function.
14640 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14641 * powerpc.cc (Relocate::relocate): Likewise.
14642 * sparc.cc (Relocate::relocate): Likewise.
14643 * x86_64.cc (Relocate::relocate): Likewise.
14644 * testsuite/weak_plt.sh: New test.
14645 * testsuite/weak_plt_main.cc: New test.
14646 * testsuite/weak_plt_shared.cc: New test.
14647 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14648 (check_PROGRAMS): Add weak_plt.
14649 (check_DATA): Add weak_plt_shared.so.
14650 (weak_plt_main_pic.o, weak_plt): New targets.
14651 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14652 * testsuite/Makefile.in: Rebuild.
14654 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14656 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14657 * testsuite/Makefile.in: Rebuild.
14659 2008-08-04 Alan Modra <amodra@bigpond.net.au>
14661 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14662 * Makefile.in: Regenerate.
14663 * po/POTFILES.in: Regenerate.
14665 2008-07-29 Ian Lance Taylor <iant@google.com>
14667 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14668 symbols before other symbols.
14669 * testsuite/script_test_2.cc (test_addr): Declare.
14670 (test_addr_alias): Declare.
14671 (main): Check that test_addr and test_addr_alias have the right
14673 * testsuite/script_test_2.t: Define test_addr_alias and
14676 2008-07-24 Ian Lance Taylor <iant@google.com>
14679 * descriptors.cc: New file.
14680 * descriptors.h: New file.
14681 * gold-threads.h (class Hold_optional_lock): New class.
14682 * fileread.cc: Include "descriptors.h".
14683 (File_read::~File_read): Release descriptor rather than closing
14685 (File_read::open) [file]: Call open_descriptor rather than open.
14686 Set is_descriptor_opened_.
14687 (File_read::open) [memory]: Assert that descriptor is not open.
14688 (File_read::reopen_descriptor): New function.
14689 (File_read::release): Release descriptor.
14690 (File_read::do_read): Make non-const. Reopen descriptor.
14691 (File_read::read): Make non-const.
14692 (File_read::make_view): Reopen descriptor.
14693 (File_read::do_readv): Likewise.
14694 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14695 Update declarations.
14696 * layout.cc: Include "descriptors.h".
14697 (Layout::create_build_id): Use open_descriptor rather than open.
14698 * output.cc: Include "descriptors.h".
14699 (Output_file::open): Use open_descriptor rather than open.
14700 * archive.cc (Archive::const_iterator): Change Archive to be
14702 (Archive::begin, Archive::end): Make non-const.
14703 (Archive::count_members): Likewise.
14704 * archive.h (class Archive): Update declarations.
14705 * object.h (Object::read): Make non-const.
14706 * Makefile.am (CCFILES): Add descriptors.cc.
14707 (HFILES): Add descriptors.h.
14708 * Makefile.in: Rebuild.
14711 * gold.h: Always include <clocale>. Add Solaris workarounds
14712 following code in binutils/sysdep.h.
14715 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14716 this->eh_frame_hdr_ is NULL before using it.
14718 * dynobj.cc (Versions::Versions): Update comment.
14720 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14721 the base version name.
14723 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14724 array size plus one.
14725 (Stringpool_template::set_string_offsets): Subtract one from key
14726 before using it as an array index.
14727 (Stringpool_template::get_offset_with_length): Likewise.
14728 (Stringpool_template::write_to_buffer): Likewise.
14729 * stringpool.h (Stringpool_template::get_offset_from_key):
14732 2008-07-23 Ian Lance Taylor <iant@google.com>
14735 * object.h (Merged_symbol_value::value): Do our best to handle a
14739 * script.cc (Version_script_info::get_versions): Don't add empty
14740 version tag to return value.
14741 (Version_script_info::get_symbol_version_helper): Change return
14742 type to bool. Add pversion parameter. Change all callers.
14743 (script_register_vers_node): Don't require a non-NULL tag.
14744 * script.h (class Version_script_info): Update declarations.
14745 (Version_script_info::get_symbol_version): Change return type to
14746 bool. Add version parameter. Change all callers.
14747 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14748 handling. Handle an empty version from a version script.
14749 (Symbol_table::define_special_symbol): Likewise.
14750 * testsuite/ver_test_10.script: New file.
14751 * testsuite/ver_test_10.sh: New file.
14752 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14753 (check_DATA): Add ver_test_10.syms.
14754 (ver_test_10.syms, ver_test_10.so): New target.
14755 * testsuite/Makefile.in: Rebuild.
14757 2008-07-23 Simon Baldwin <simonb@google.com>
14759 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14760 to zero for undefined symbols from dynamic libraries.
14762 2008-07-23 Ian Lance Taylor <iant@google.com>
14764 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14765 Change all callers.
14766 * symtab.h (class Symbol_table): Update declaration.
14767 * testsuite/ver_test_9.cc: New file.
14768 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14769 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14770 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14771 (ver_test_9.so, ver_test_9.o): New targets.
14772 * testsuite/Makefile.in: Rebuild.
14774 2008-07-22 Ian Lance Taylor <iant@google.com>
14776 * options.h (class General_options): Define --check-sections.
14777 * layout.cc (Layout::set_segment_offsets): Handle
14780 * options.h (class General_options): Define -n/--nmagic and
14782 * options.cc (General_options::finalize): For -n/--nmagic or
14783 -N/--omagic, set -static.
14784 * layout.cc (Layout::attach_allocated_section_to_segment): If
14785 -N/--omagic, don't put read-only and read-write sections in
14786 different segments.
14787 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14788 finding a read-only segment.
14789 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14790 don't set the minimum segment alignment to the common page size,
14791 and don't set the file offset to the address modulo the page size.
14792 * script-sections.cc (Script_sections::create_segments): If
14793 -n/--omagic, don't put read-only and read-write sections in
14794 different segments.
14796 * cref.cc: New file.
14797 * cref.h: New file.
14798 * options.h (class General_options): Add --print-symbol-counts.
14799 * main.cc (main): Issue defined symbol report if requested.
14800 * archive.cc (Archive::interpret_header): Make into a const member
14802 (Archive::add_symbols): Call Input_objects::archive_start and
14804 (Archive::const_iterator): Define new class.
14805 (Archive::begin, Archive::end): New functions.
14806 (Archive::include_all_members): Rewrite to use iterator.
14807 (Archive::count_members): New function.
14808 * archive.h (class Archive): Update declarations.
14809 (Archive::filename): New function.
14810 * object.cc: Include "cref.h".
14811 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14812 (Sized_relobj::do_get_global_symbol_counts): New function.
14813 (Input_objects::add_object): Add object to cross-referencer.
14814 (Input_objects::archive_start): New function.
14815 (Input_objects::archive_stop): New function.
14816 (Input_objects::print_symbol_counts): New function.
14817 * object.h: Declare Cref and Archive.
14818 (Object::get_global_symbol_counts): New function.
14819 (Object::do_get_global_symbol_counts): New pure virtual function.
14820 (class Sized_relobj): Add defined_count_ field. Update
14822 (class Input_objects): Add cref_ field. Update constructor.
14823 Update declarations.
14824 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14826 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14828 (Sized_dynobj::do_get_global_symbol_counts): New function.
14829 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14830 defined_count_. Update declarations. Define Symbols typedef.
14831 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14832 parameter. Change all callers.
14833 (Symbol_table::add_from_dynobj): Add sympointers and defined
14834 parameters. Change all callers.
14835 * symtab.h (class Symbol_table): Update declarations.
14836 * Makefile.am (CCFILES): Add cref.cc.
14837 (HFILES): Add cref.h.
14838 * Makefile.in: Rebuild.
14840 2008-07-22 Simon Baldwin <simonb@google.com>
14842 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14843 to zero when writing undefined symbols.
14845 2008-07-22 Ian Lance Taylor <iant@google.com>
14847 * output.cc (Output_section::add_input_section): Don't try to
14848 merge empty merge sections.
14850 2008-07-21 Craig Silverstein <csilvers@google.com>
14852 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14853 Include symbol version in error message.
14855 2008-07-20 Chris Demetriou <cgd@google.com>
14857 * configure.ac (gold_cv_c_random_seed): New configured variable.
14858 (RANDOM_SEED_CFLAGS): New substituted variable.
14859 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14860 * configure: Rebuild.
14861 * Makefile.in: Likewise.
14862 * testsuite/Makefile.in: Likewise.
14864 2008-07-18 Ian Lance Taylor <iant@google.com>
14866 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14867 where we see NAME/NULL and NAME/VERSION as separate symbols.
14868 * testsuite/ver_test_main.cc (main): Call t4.
14869 (t4, t4_2a): Define.
14870 * testsuite/ver_test_2.cc (t4_2): Define.
14871 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14872 * testsuite/ver_test_4.cc (t4_2a): Define.
14873 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14874 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14876 2008-07-17 Ian Lance Taylor <iant@google.com>
14878 * dynobj.cc (Versions::add_def): If we give an error about a
14879 missing version, go ahead and create the version anyhow.
14881 2008-07-10 Ian Lance Taylor <iant@google.com>
14883 Handle output sections with more than 0x7fffffff bytes.
14884 * object.h (class Relobj): Change map_to_output_ to
14885 output_sections_, and just keep a section pointer. Change all
14886 uses. Move comdat group support to Sized_relobj.
14887 (Relobj::is_section_specially_mapped): Remove.
14888 (Relobj::output_section): Remove poff parameter. Change all
14890 (Relobj::output_section_offset): New function.
14891 (Relobj::set_section_offset): Rewrite.
14892 (Relobj::map_to_output): Remove.
14893 (Relobj::output_sections): New function.
14894 (Relobj::do_output_section_offset): New pure virtual function.
14895 (Relobj::do_set_section_offset): Likewise.
14896 (class Sized_relobj): Add section_offsets_ field. Add comdat
14897 group support from Relobj. Update declarations.
14898 (Sized_relobj::get_output_section_offset): New function.
14899 (Sized_relobj::do_output_section_offset): New function.
14900 (Sized_relobj::do_set_section_offset): New function.
14901 * object.cc (Relobj::output_section_address): Remove.
14902 (Sized_relobj::Sized_relobj): Initialize new fields.
14903 (Sized_relobj::include_section_group): Cast find_kept_object to
14905 (Sized_relobj::include_linkonce_section): Likewise.
14906 (Sized_relobj::do_layout): Use separate arrays for output section
14908 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14910 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14911 output_sections and section_offsets.
14912 (Sized_relobj::write_local_symbols): Likewise.
14913 (map_to_kept_section): Compute output address directly.
14914 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14915 output_sections and section_offsets.
14916 (Sized_relobj::write_sections): Likewise.
14917 (Sized_relobj::relocate_sections): Likewise.
14918 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14919 * output.h (class Output_reloc): Update declarations. Change
14920 u2_.relobj to Sized_relobj*.
14921 (class Output_data_reloc): Change add functions to use
14923 * output.cc (Output_reloc::Output_reloc): Change relobj to
14925 (Output_reloc::local_section_offset): Change return type to
14926 Elf_Addr. Use get_output_section_offset.
14927 (Output_reloc::get_address): Likewise.
14928 (Output_section::is_input_address_mapped): Don't call
14929 is_section_specially_mapped.
14930 (Output_section::output_offset): Likewise.
14931 (Output_section::output_address): Likewise.
14932 (Output_section::starting_output_address): Likewise.
14933 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14934 parameter to Sized_relobj*.
14935 (Copy_relocs::need_copy_reloc): Likewise.
14936 (Copy_relocs::save): Likewise.
14937 * copy-relocs.h (class Copy_relocs): Update declarations.
14938 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14939 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14940 * target-reloc.h (relocate_for_relocatable): Change
14941 offset_in_output_section type to Elf_Addr. Change code that uses
14943 * layout.cc (Layout::layout): Always set *off.
14944 * mapfile.cc (Mapfile::print_input_section): Use
14945 output_section_offset.
14946 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14948 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14949 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14950 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14952 2008-07-03 Ian Lance Taylor <iant@google.com>
14954 * layout.cc (Layout::include_section): Do not discard unrecognized
14955 SHT_STRTAB sections.
14957 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14959 * script.cc (Lex::can_continue_name): Make '?' allowable in
14960 version-script names.
14961 * testsuite/version_script.map: Change glob pattern to use '?'
14963 2008-06-30 Manish Singh <yosh@gimp.org>
14966 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14969 2008-06-30 Ian Lance Taylor <iant@google.com>
14973 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14974 versions]: Don't try to read the value in the contents, since we
14975 don't use it. Use the template endianness when writing.
14977 2008-06-25 Cary Coutant <ccoutant@google.com>
14979 * fileread.cc (File_read::make_view): Assert on zero-length view.
14980 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14981 symbol table when there are no symbols to read.
14983 2008-06-23 Craig Silverstein <csilvers@google.com>
14985 * version.cc (version_string): Bump to 1.7
14987 2008-06-18 Craig Silverstein <csilvers@google.com>
14989 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14990 constant 0xFFFF to type Valtype.
14991 (Powerpc_relocate_functions::rel16_ha): Likewise.
14993 2008-06-17 Ian Lance Taylor <iant@google.com>
14995 * output.h (Output_section::Input_section): Initialize p2align_ to
14996 zero for Output_section_data constructors.
14997 (Output_section::Input_section::addralign): If not an input
14998 section, return the alignment of the Output_section_data.
14999 * testsuite/copy_test.cc: New file.
15000 * testsuite/copy_test_1.cc: New file.
15001 * testsuite/copy_test_2.cc: New file.
15002 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15003 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15004 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15005 (copy_test_1_pic.o, copy_test_1.so): New targets.
15006 (copy_test_2_pic.o, copy_test_2.so): New targets.
15007 * testsuite/Makefile.in: Rebuild.
15009 * script-sections.cc (Script_sections::place_orphan): Initialize
15010 local variable exact.
15012 2008-06-13 David Edelsohn <edelsohn@gnu.org>
15014 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15016 2008-06-12 David Edelsohn <edelsohn@gnu.org>
15017 David S. Miller <davem@davemloft.net>
15019 * powerpc.cc: New file.
15020 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15021 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15022 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15023 * Makefile.in: Rebuild.
15025 2008-06-09 Ian Lance Taylor <iant@google.com>
15027 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15029 (throwing, orig_terminate): New static variables.
15030 (terminate_handler): New static function.
15031 (t2): Set terminate handler.
15033 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15036 * binary.cc (Binary_to_elf::sized_convert): Fix .data
15039 2008-05-30 Cary Coutant <ccoutant@google.com>
15041 * archive.cc (Archive::include_all_members) Correct to step
15042 over symbol table and extended name table in thin archives.
15044 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15047 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15050 2008-05-28 Caleb Howe <cshowe@google.com>
15052 * reduced_debug_output.cc: New file.
15053 * reduced_debug_output.h: New file.
15054 * options.h (class General_options): Add --strip-debug-non-line.
15055 * options.cc (General_options::finalize): Add strip_debug_non_line
15056 to the strip heirarchy.
15057 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15059 * layout.cc: Include "reduced_debug_output.h".
15060 (Layout::Layout): Initialize new fields.
15061 (line_only_debug_sections): New static array.
15062 (is_lines_only_debug_sections): New static inline function.
15063 (Layout::include_section): Handle --strip-debug-non-line.
15064 (Layout::make_output_section): If --strip-debug-non-line, build
15065 new output sections for .debug_abbrev and .debug_info.
15066 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15067 gold. Warn about possible overflow.
15068 (read_signed_LEB_128): Likewise.
15069 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15070 (read_signed_LEB_128): Declare.
15071 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15072 (HFILES): Add reduced_debug_output.h.
15073 * Makefile.in: Rebuild.
15075 2008-05-21 Ian Lance Taylor <iant@google.com>
15077 * mapfile.cc: New file.
15078 * mapfile.h: New file.
15079 * options.h (class General_options): Add -M/--print-map and -Map.
15080 * options.cc (General_options::finalize): Make -M equivalent to
15082 * main.cc: Include <cstdio> and "mapfile.h".
15083 (main): Open mapfile if requested.
15084 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15085 constructor. Change caller.
15086 (queue_initial_tasks): Add mapfile parameter. Change caller.
15087 (queue_middle_tasks): Likewise.
15088 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15090 * archive.cc: Include "mapfile.h".
15091 (Archive::add_symbols): Add mapfile parameter. Change all
15092 callers. Pass mapfile, symbol, and reason to include_member.
15093 (Archive::include_all_members): Add mapfile parameter. Change all
15095 (Archive::include_member): Add mapfile, sym, and why parameters.
15096 Change all callers. Report inclusion to map file.
15097 * archive.h: Include "fileread.h".
15098 (class Archive): Update declarations.
15099 (Archive::file): New const method.
15100 (class Add_archive_symbols): Add mapfile_ field. Update
15101 constructor. Change all callers.
15102 * readsyms.h (class Read_symbols): Likewise.
15103 (class Finish_group): Likewise.
15104 (class Read_script): Likewise.
15105 * common.cc: Include "mapfile.h".
15106 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15108 (Symbol_table::do_allocate_commons): Likewise.
15109 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15110 symbol allocation to mapfile.
15111 * common.h (class Allocate_commons_task): Add mapfile_ field.
15112 Update constructor. Change all callers.
15113 * symtab.h (class Symbol_table): Update declarations.
15114 * layout.cc: Include "mapfile.h".
15115 (Layout_task_runner::run): Print information to mapfile.
15116 (Layout::create_gold_note): Change Output_data_fixed_space to
15117 Output_data_zero_fill.
15118 (Layout::create_build_id): Likewise.
15119 (Layout::print_to_mapfile): New function.
15120 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15121 constructor. Change caller.
15122 (class Layout): Declare print_to_mapfile.
15123 * output.cc (Output_section::Input_section::print_to_mapfile): New
15125 (Output_section::add_input_section): If producing a map, always
15126 add to input_sections_ list.
15127 (Output_section::do_print_to_mapfile): New function.
15128 (Output_segment::print_sections_to_mapfile): New function.
15129 (Output_segment::print_section_list_to_mapfile): New function.
15130 * output.h: Include "mapfile.h".
15131 (Output_data::print_to_mapfile): New function.
15132 (Output_data::do_print_to_mapfile): New virtual function.
15133 (Output_segment_headers::do_print_to_mapfile): New function.
15134 (Output_file_header::do_print_to_mapfile): New function.
15135 (Output_data_const::do_print_to_mapfile): New function.
15136 (class Output_data_const_buffer): Add map_name_ field. Update
15137 constructor. Change all callers. Add do_print_to_mapfile
15139 (class Output_data_fixed_space): Likewise.
15140 (class Output_data_space): Likewise.
15141 (class Output_data_zero_fill): New class.
15142 (Output_data_strtab::do_print_to_mapfile): New function.
15143 (Output_data_reloc_base::do_print_to_mapfile): New function.
15144 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15145 (Output_data_group::do_print_to_mapfile): New function.
15146 (Output_data_got::do_print_to_mapfile): New function.
15147 (Output_data_dynamic::do_print_to_mapfile): New function.
15148 (Output_symtab_xindex::do_print_to_mapfile): New function.
15149 (class Output_section): Declare do_print_to_mapflie. Declare
15150 print_to_mapfile in Input_section.
15151 (class Output_segment): Declare new functions.
15152 * object.h (Sized_relobj::symbol_count): New function.
15153 * script-sections.cc
15154 (Output_section_element_dot_assignment::set_section_addresses):
15155 Change Output_data_fixed_space to Output_data_zero_fill.
15156 (Output_data_expression::do_print_to_mapfile): New function.
15157 * script.cc (read_input_script): Add mapfile parameter. Change
15159 * script.h (read_input_script): Update declaration.
15160 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15161 (Eh_frame::do_print_to_mapfile): New function.
15162 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15163 (Output_merge_string::do_print_to_mapfile): New function.
15164 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15166 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15168 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15170 * Makefile.am (CCFILES): Add mapfile.cc.
15171 (HFILES): Add mapfile.h.
15172 * Makefile.in: Rebuild.
15174 2008-05-19 Ian Lance Taylor <iant@google.com>
15176 * options.h (class General_options): Add -z relro.
15177 * layout.cc (Layout::Layout): Initialize relro_segment_.
15178 (Layout::add_output_section_data): Return the output section.
15179 (Layout::make_output_section): Rcognize relro sections and mark
15180 them appropriately.
15181 (Layout::attach_allocated_section_to_segment): Put relro sections
15182 in a PT_GNU_RELRO segment.
15183 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15185 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15187 (Layout::linkonce_mapping): Map d.rel.ro.local to
15188 .data.rel.ro.local.
15189 (Layout::output_section_name): Us .data.rel.ro.local for any
15190 section which begins with that.
15191 * layout.h (class Layout): Update add_output_section_data
15192 declaration. Add relro_segment_ field.
15193 * output.cc (Output_section::Output_section): Initialize is_relro_
15194 and is_relro_local_ fields.
15195 (Output_segment::add_output_section): Group relro sections.
15196 (Output_segment::is_first_section_relro): New function.
15197 (Output_segment::maximum_alignment): If there is a relro section,
15198 align the segment to the common page size.
15199 (Output_segment::set_section_addresses): Track whether we are
15200 looking at relro sections. If the last section is a relro
15201 section, align to the common page size.
15202 (Output_segment::set_section_list_addresses): Add in_relro
15203 parameter. Change all callers. Align to the page size when
15204 moving from relro to non-relro section.
15205 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15207 * output.h (class Output_section): Add is_relro_ and
15208 is_relro_local_ fields.
15209 (Output_section::is_relro): New function.
15210 (Output_section::set_is_relro): New function.
15211 (Output_section::is_relro_local): New function.
15212 (Output_section::set_is_relro_local): New function.
15213 (class Output_segment): Update declarations.
15214 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15215 * sparc.cc (Target_sparc::got_section): Likewise.
15216 * x86_64.cc (Target_x86_64::got_section): Likewise.
15217 * testsuite/relro_test_main.cc: New file.
15218 * testsuite/relro_test.cc: New file.
15219 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15220 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15221 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15222 (relro_test.so, relro_test_pic.o): New targets.
15223 * testsuite/Makefile.in: Rebuild.
15225 2008-05-16 Ian Lance Taylor <iant@google.com>
15227 * output.cc (Output_segment::add_output_section): Remove front
15229 * output.h (class Output_segment): Remove
15230 add_initial_output_section and overloaded add_output_section.
15231 Update declaration of remaining add_output_section.
15232 * layout.cc (Layout::create_interp): Call add_output_section
15233 rather than add_initial_output_section.
15234 (Layout::finish_dynamic_section): Likewise.
15236 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15237 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15238 know the dynamic type.
15239 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15240 field. Initialize it in constructor.
15241 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15242 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15243 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15246 * output.cc (Output_reloc::get_address): Change return type to
15248 * output.h (class Output_reloc): Update get_address declaration.
15249 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15250 for section addresses.
15252 2008-05-09 Ian Lance Taylor <iant@google.com>
15255 * gold.cc (gold_nomem): Use return value of write.
15257 2008-05-08 Ian Lance Taylor <iant@google.com>
15259 * symtab.c (Symbol::init_base_output_data): Add version
15260 parameter. Change all callers.
15261 (Symbol::init_base_output_segment): Likewise.
15262 (Symbol::init_base_constant): Likewise.
15263 (Symbol::init_base_undefined): Likewise.
15264 (Sized_symbol::init_output_data): Likewise.
15265 (Sized_symbol::init_output_segment): Likewise.
15266 (Sized_symbol::init_constant): Likewise.
15267 (Sized_symbol::init_undefined): Likewise.
15268 (Symbol_table::do_define_in_output_data): If the new symbol has a
15269 version, mark it as the default.
15270 (Symbol_table::do_define_in_output_segment): Likewise.
15271 (Symbol_table::do_define_as_constant): Likewise.
15272 * symtab.h (class Symbol): Update declarations.
15273 (class Sized_symbol): Likewise.
15274 * resolve.cc (Symbol::override_version): New function.
15275 (Symbol::override_base): Call override_version.
15276 (Symbol::override_base_with_special): Likewise.
15277 * testsuite/ver_script_8.script: New file.
15278 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15279 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15280 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15281 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15283 2008-05-06 Ian Lance Taylor <iant@google.com>
15286 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15288 (class General_options): Remove existing --undefined, and add
15289 --no-undefined instead. Add new --undefined as synonym for -u.
15290 * archive.cc (Archive::add_symbols): Check whether symbol was
15292 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15293 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15294 all uses. Add IS_UNDEFINED. Update declarations to split
15295 different versions of init_base. Declare init_base_undefined.
15296 (Symbol::is_defined): Handle IS_UNDEFINED.
15297 (Symbol::is_undefined): Likewise.
15298 (Symbol::is_weak_undefined): Call is_undefined.
15299 (Symbol::is_absolute): Handle IS_CONSTANT.
15300 (class Sized_symbol): Update declarations to split different
15301 versions of init. Declare init_undefined.
15302 (class Symbol_table): Declare new functions.
15303 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15304 Change all callers.
15305 (Symbol::init_base_output_data): Likewise.
15306 (Symbol::init_base_output_segment): Likewise.
15307 (Symbol::init_base_constant): Likewise.
15308 (Symbol::init_base_undefined): New function.
15309 (Sized_symbol::init_object): Rename from init. Change all
15311 (Sized_symbol::init_output_data): Likewise.
15312 (Sized_symbol::init_output_segment): Likewise.
15313 (Sized_symbol::init_constant): Likewise.
15314 (Sized_symbol::init_undefined): New function.
15315 (Symbol_table::add_undefined_symbols_from_command_line): New
15317 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15319 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15320 (Symbol::output_section): Likewise.
15321 (Symbol::set_output_section): Likewise.
15322 (Symbol_table::sized_finalize_symbol): Likewise.
15323 (Symbol_table::sized_write_globals): Likewise.
15324 * resolve.cc (Symbol_table::should_override): Likewise.
15325 (Symbol::override_base_with_special): Likewise.
15327 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15328 symbol, change it to have default visibility.
15329 * testsuite/protected_1.cc: New file.
15330 * testsuite/protected_2.cc: New file.
15331 * testsuite/protected_3.cc: New file.
15332 * testsuite/protected_main_1.cc: New file.
15333 * testsuite/protected_main_2.cc: New file.
15334 * testsuite/protected_main_3.cc: New file.
15335 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15336 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15337 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15338 (protected_1.so): New target.
15339 (protected_1_pic.o, protected_2_pic.o): New targets.
15340 (protected_3_pic.o): New target.
15341 (check_PROGRAMS): Add protected_2.
15342 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15343 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15344 * testsuite/Makefile.in: Rebuild.
15346 * options.h (DEFINE_var): Add set_user_set_##varname__.
15347 (DEFINE_bool_alias): New macro.
15348 (class General_options): Define -Bstatic using DEFINE_bool_alias
15349 rather than DEFINE_special. Add --undefined as an alias for -z
15351 * options.cc (General_options::parse_Bstatic): Remove.
15353 * options.h (class General_options): Add --fatal-warnings.
15354 * main.cc (main): Implement --fatal-warnings.
15355 * errors.h (Errors::warning_count): New function.
15357 * options.h (class General_options): Add -Bsymbolic-functions.
15358 * symtab.h (Symbol::is_preemptible): Check for
15359 -Bsymbolic-functions.
15361 2008-05-05 Ian Lance Taylor <iant@google.com>
15363 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15364 as noVARNAME rather than no-VARNAME.
15365 (class General_options): Add option -z combreloc.
15366 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15368 (Output_reloc::sort_before) [SHT_REL]: New function.
15369 (Output_reloc::sort_before) [SHT_RELA]: New function.
15370 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15371 Sort_relocs_comparison.
15372 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15373 parameter. Change all callers.
15374 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15375 sort_relocs parameter. Change all callers.
15376 * output.cc (Output_reloc::get_address): New function, broken out
15378 (Output_reloc::write_rel): Call it.
15379 (Output_reloc::compare): New function.
15380 (Output_data_reloc_base::do_write): Optionally sort relocs.
15382 * configure.ac: If targ_extra_obj is set, link it in.
15383 * configure.tgt: Initialize all variables.
15384 (x86_64*): Set targ_extra_obj and targ_extra_size.
15385 * configure: Rebuild.
15387 * object.cc (Sized_relobj::include_section_group): Adjust section
15388 indexes read from group data. Build vector to pass to
15390 * layout.cc (Layout::layout_group): Add flags and shndxes
15391 parameters. Remove contents parameter. Change caller. Update
15392 explicit instantiations.
15393 * layout.h (class Layout): Update layout_group declaration.
15394 * output.cc (Output_data_group::Output_data_group): Add flags and
15395 input_shndxes parameters. Remove contents parameter. Change
15397 (Output_data_group::do_write): Change input_sections_ to
15399 * output.h (class Output_data_group): Update constructor
15400 declaration. Rename input_sections_ to input_shndxes_.
15401 * testsuite/many_sections_test.cc: Add template.
15403 2008-04-30 Cary Coutant <ccoutant@google.com>
15405 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15407 * layout.cc (Layout::include_section): Refactored check for debug
15409 (Layout::add_comdat): Add new parameters. Change type
15410 of signature parameter. Add object and shndx to signatures table.
15411 (Layout::find_kept_object): New function.
15412 * layout.h: Include <cstring>.
15413 (Layout::is_debug_info_section): New function.
15414 (Layout::add_comdat): Add new parameters.
15415 (Layout::find_kept_object): New function.
15416 (Layout::Kept_section): New struct.
15417 (Layout::Signatures): Change type of map range.
15418 * object.cc (Relobj::output_section_address): New function.
15419 (Sized_relobj::include_section_group): Add new parameters. Change
15420 calls to Layout::add_comdat. Change to build table of kept comdat
15421 groups and table mapping discarded sections to kept sections.
15422 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15423 (Sized_relobj::do_layout): Change calls to include_section_group and
15424 include_linkonce_section.
15425 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15426 value to zero when section is discarded.
15427 (Sized_relobj::map_to_kept_section): New function.
15428 * object.h (Relobj::output_section_address): New function.
15429 (Relobj::Comdat_group): New type.
15430 (Relobj::find_comdat_group): New function.
15431 (Relobj::Comdat_group_table): New type.
15432 (Relobj::Kept_comdat_section): New type.
15433 (Relobj::Kept_comdat_section_table): New type.
15434 (Relobj::add_comdat_group): New function.
15435 (Relobj::set_kept_comdat_section): New function.
15436 (Relobj::get_kept_comdat_section): New function.
15437 (Relobj::comdat_groups_): New field.
15438 (Relobj::kept_comdat_sections_): New field.
15439 (Symbol_value::input_value): Update comment.
15440 (Sized_relobj::map_to_kept_section) New function.
15441 (Sized_relobj::include_linkonce_section): Add new parameter.
15442 * target-reloc.h (Comdat_behavior): New type.
15443 (get_comdat_behavior): New function.
15444 (relocate_section): Add code to map a discarded section to the
15445 corresponding kept section when applying a relocation.
15447 2008-04-30 Craig Silverstein <csilvers@google.com>
15449 * dwarf_reader.cc (next_generation_count): New static var.
15450 (Addr2line_cache_entry): New struct.
15451 (addr2line_cache): New static var.
15452 (Dwarf_line_info::one_addr2line): Added caching.
15453 (Dwarf_line_info::clear_addr2line_cache): New function.
15454 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15455 cache-size parameter.
15456 (Dwarf_line_info::one_addr2line_cache): New function.
15457 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15458 new cache-size argument to one_addr2line(), and clear cache.
15460 2008-04-28 Cary Coutant <ccoutant@google.com>
15462 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15463 R_386_PC8 relocations.
15465 2008-04-23 Ian Lance Taylor <iant@google.com>
15467 * object.cc (Sized_relobj::include_section_group): Check for
15468 invalid section group.
15470 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15473 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15474 than read for file header.
15475 * archive.cc (Archive::include_member): Likewise.
15477 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
15479 * aclocal.m4: Regenerate.
15480 * configure: Regenerate.
15482 2008-04-19 Ian Lance Taylor <iant@google.com>
15484 * version.cc (version_string): Bump to 1.6.
15486 * testsuite/Makefile.am (many_sections_r_test): New target.
15487 (many_sections_r_test_SOURCES): Remove.
15488 (many_sections_r_test_DEPENDENCIES): Remove.
15489 (many_sections_r_test_LDFLAGS): Remove.
15490 (many_sections_r_test_LDADD): Remove.
15492 * object.cc (Sized_relobj::do_add_symbols): Always pass
15493 local_symbol_count_ to add_from_relobj.
15495 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15496 every thousand variables.
15497 * testsuite/Makefile.in: Rebuild.
15499 * object.cc (Xindex::initialize_symtab_xindex): New function.
15500 (Xindex::read_symtab_xindex): New function.
15501 (Xindex::sym_xindex_to_shndx): New function.
15502 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15504 (Sized_relobj::do_initialize_xindex): New function.
15505 (Sized_relobj::do_read_symbols): Adjust section links.
15506 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15507 parameter. Change all callers.
15508 (Sized_relobj::include_section_group): Adjust section links and
15509 symbol section indexes.
15510 (Sized_relobj::do_layout): Adjust section links.
15511 (Sized_relobj::do_count_local_symbols): Adjust section links and
15512 symbol section indexes.
15513 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15514 ordinary and special symbols.
15515 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15516 dynsym_xindex parameters. Change all callers. Adjust section
15517 links. Use SHN_XINDEX when needed.
15518 (Sized_relobj::get_symbol_location_info): Adjust section links.
15519 Don't get fooled by special symbols.
15520 * object.h (class Xindex): Define.
15521 (class Object): Add xindex_ parameter. Declare virtual functoin
15522 do_initialize_xindex.
15523 (Object::adjust_sym_shndx): New function.
15524 (Object::set_xindex): New protected function.
15525 (class Symbol_value): Add is_ordinary_shndx_ field.
15526 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15527 (Symbol_value::value): Assert ordinary section.
15528 (Symbol_value::initialize_input_to_output_map): Likewise.
15529 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15530 Change all callers.
15531 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15533 (class Sized_relobj): Update declarations.
15534 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15535 parameter. Change all callers.
15536 (Sized_relobj::adjust_shndx): New function.
15537 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15539 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15540 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15541 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15542 (Sized_dynobj::read_dynsym_section): Adjust section links.
15543 (Sized_dynobj::read_dynamic): Likewise.
15544 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15546 (Sized_dynobj::do_initialize_xindex): New function.
15547 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15548 do_initialize_xindex.
15549 (Sized_dynobj::adjust_shndx): New function.
15550 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15551 dynsym_xindex_ fields.
15552 (Layout::finalize): Add a call to set_section_indexes before
15553 creating the symtab sections.
15554 (Layout::set_section_indexes): Don't do anything if the section
15555 already has a section index.
15556 (Layout::create_symtab_sections): Add shnum parameter. Change
15557 caller. Create .symtab_shndx section if needed.
15558 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15560 (Layout::allocated_output_section_count): New function.
15561 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15563 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15564 fields. Update declarations.
15565 (Layout::symtab_xindex): New function.
15566 (Layout::dynsym_xindex): New function.
15567 (class Write_symbols_task): Add layout_ field.
15568 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15570 * output.cc (Output_section_headers::Output_section_headers): Add
15571 shstrtab_section parameter. Change all callers.
15572 (Output_section_headers::do_sized_write): Store overflow values
15573 for section count and section string table section index in
15574 section header zero.
15575 (Output_file_header::do_sized_write): Check for overflow of
15576 section count and section string table section index.
15577 (Output_symtab_xindex::do_write): New function.
15578 (Output_symtab_xindex::endian_do_write): New function.
15579 * output.h (class Output_section_headers): Add shstrtab_section_.
15580 Update declarations.
15581 (class Output_symtab_xindex): Define.
15582 (Output_section::has_out_shndx): New function.
15583 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15585 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15586 Change all callers.
15587 (Sized_symbol::init): Likewise.
15588 (Symbol::output_section): Check for ordinary symbol.
15589 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15590 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15592 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15593 Change all callers. Simplify handling of symbols from sections
15594 not included in the link.
15595 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15597 (Weak_alias_sorter::operator()): Assert that symbols are
15599 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15601 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15602 parameters. Change all callers.
15603 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15604 symbol distinction. Use SHN_XINDEX when needed.
15605 (Symbol_table::write_section_symbol): Add symtab_xindex
15606 parameter. Change all callers.
15607 (Symbol_table::sized_write_section_symbol): Likewise. Use
15608 SHN_XINDEX when needed.
15609 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15611 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15612 (Symbol::is_defined): Check is_ordinary.
15613 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15614 (Symbol::is_absolute, Symbol::is_common): Likewise.
15615 (class Sized_symbol): Update declarations.
15616 (class Symbol_table): Update declarations.
15617 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15618 parameters. Change all callers.
15619 (Sized_symbol::override): Likewise.
15620 (Symbol_table::override): Likewise.
15621 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15622 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15623 is_ordinary, and orig_st_shndx parameters. Change all callers.
15624 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15625 to be in an ordinary section.
15626 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15627 object and is_ordinary parameters. Change all callers.
15628 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15629 Change all callers. Don't add undefined or non-ordinary symbols
15631 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15632 Change all callers.
15633 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15635 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15636 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15637 (Sized_relobj::relocate_sections): Likewise.
15638 * target-reloc.h (scan_relocs): Adjust section symbol index.
15639 (scan_relocatable_relocs): Likewise.
15640 * i386.cc (Scan::local): Check for ordinary symbols.
15641 * sparc.cc (Scan::local): Likewise.
15642 * x86_64.cc (Scan::local): Likewise.
15643 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15644 to symbol_section_and_value.
15645 * testsuite/many_sections_test.cc: New file.
15646 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15647 (check_PROGRAMS): Add many_sections_test.
15648 (many_sections_test_SOURCES): Define.
15649 (many_sections_test_DEPENDENCIES): Define.
15650 (many_sections_test_LDFLAGS): Define.
15651 (BUILT_SOURCES): Add many_sections_define.h.
15652 (many_sections_define.h): New target.
15653 (BUILT_SOURCES): Add many_sections_check.h.
15654 (many_sections_check.h): New target.
15655 (check_PROGRAMS): Add many_sections_r_test.
15656 (many_sections_r_test_SOURCES): Define.
15657 (many_sections_r_test_DEPENDENCIES): Define.
15658 (many_sections_r_test_LDFLAGS): Define.
15659 (many_sections_r_test_LDADD): Define.
15660 (many_sections_r_test.o): New target.
15661 * testsuite/Makefile.in: Rebuild.
15663 2008-04-17 Cary Coutant <ccoutant@google.com>
15665 * errors.cc (Errors::info): New function.
15666 (gold_info): New function.
15667 * errors.h (Errors::info): New function.
15668 * gold.h (gold_info): New function.
15669 * object.cc (Input_objects::add_object): Print trace output.
15670 * options.cc (options::parse_set): New function.
15671 (General_options::parse_wrap): Deleted.
15672 (General_options::General_options): Deleted initializer.
15673 * options.h (options::String_set): New typedef.
15674 (options::parse_set): New function.
15675 (DEFINE_set): New macro.
15676 (General_options::wrap): Changed to use DEFINE_set. Changed
15677 callers of any_wrap_symbols and is_wrap_symbol.
15678 (General_options::trace, General_options::trace_symbol):
15680 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15681 (General_options::wrap_symbols_): Deleted.
15682 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15684 2008-04-17 David S. Miller <davem@davemloft.net>
15686 * options.cc (General_options::parse_V): New function.
15687 * options.h: Add entries for -V and -Qy.
15689 2008-04-17 Ian Lance Taylor <iant@google.com>
15691 * common.cc (Symbol_table::allocate_commons): Remove options
15692 parameter. Change caller.
15693 (Symbol_table::do_allocate_commons): Remove options parameter.
15694 Change caller. Just call do_allocate_commons_list twice.
15695 (Symbol_table::do_allocate_commons_list): New function, broken out
15696 of do_allocate_commons.
15697 * common.h (class Allocate_commons_task): Remove options_ field.
15698 Update constructor.
15699 * symtab.cc (Symbol_table::Symbol_table): Initialize
15701 (Symbol_table::add_from_object): Put TLS common symbols on
15703 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15704 which are IN_OUTPUT_DATA.
15705 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15706 allocate_commons and do_allocate_commons declarations. Declare
15707 do_allocate_commons_list.
15708 * gold.cc (queue_middle_tasks): Update creation of
15709 Allocate_commons_task to not pass options.
15710 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15711 (TLS_TEST_C_FLAGS): New variable.
15712 (tls_test_c_pic.o): New target.
15713 (tls_test_shared.so): Link in tls_test_c_pic.o.
15714 (tls_test_c_pic_ie.o): New target.
15715 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15716 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15717 (tls_test_c.o): New target.
15718 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15719 (tls_pic_test_LDADD): Likewise.
15720 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15721 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15722 (tls_test_c_gnu2.o): New target.
15723 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15725 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15726 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15727 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15728 * testsuite/tls_test.cc: Include "config.h".
15729 (t_last): Call t11_last.
15730 * testsuite/tls_test.h (t11, t11_last): Declare.
15731 * testsuite/tls_test_c.c: New file.
15732 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15733 * configure.ac: Check for OpenMP support.
15734 * configure, config.in, Makefile.in: Rebuild.
15735 * testsuite/Makefile.in: Rebuild.
15737 2008-04-16 Cary Coutant <ccoutant@google.com>
15739 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15740 (Target_i386::tls_base_symbol_defined_): New field.
15741 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15742 (Target_i386::Scan::global): Likewise.
15743 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15744 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15745 (Target_x86_64::tls_base_symbol_defined_): New field.
15746 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15747 (Target_x86_64::Scan::global): Likewise.
15749 2008-04-16 Cary Coutant <ccoutant@google.com>
15751 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15752 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15753 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15754 building shared libraries.
15755 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15756 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15757 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15758 * testsuite/Makefile.in: Rebuild.
15759 * testsuite/weak_undef.h: New file.
15760 * testsuite/weak_undef_file1.cc: Add extra test cases.
15761 * testsuite/weak_undef_file2.cc: Likewise.
15762 * testsuite/weak_undef_test.cc: Likewise.
15764 2008-04-16 David S. Miller <davem@davemloft.net>
15766 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15767 Add issued_non_pic_error_ field. Declare check_non_pic.
15768 (Target_sparc::Scan::check_non_pic): New function.
15769 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15770 (Target_sparc::Scan::global): Likewise.
15772 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15773 * configure: Rebuild.
15775 * options.h (DEFINE_enable): New macro.
15776 (new_dtags): New enable option.
15777 (initfirst, interpose, loadfltr, nodefaultlib,
15778 nodelete, nodlopen, nodump): New -z options.
15779 * layout.cc (Layout:finish_dynamic_section): If new
15780 dtags enabled, emit DT_RUNPATH. Also, emit a
15781 DT_FLAGS_1 containing any specified -z flags.
15783 2008-04-16 Ian Lance Taylor <iant@google.com>
15785 * copy-relocs.cc: New file.
15786 * copy-relocs.h: New file.
15787 * reloc.cc: Remove Copy_relocs code.
15788 * reloc.h: Likewise.
15789 * reloc-types.h (struct Reloc_types) [both versions]: Add
15790 get_reloc_addend_noerror.
15791 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15792 variants of add_global which take an addend which must be zero.
15793 * i386.cc: Include "copy-relocs.h".
15794 (class Target_i386): Change type of copy_relocs_ to variable,
15795 update initializer.
15796 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15797 Change all callers.
15798 (Target_i386::do_finalize_sections): Change handling of
15800 * sparc.cc: Include "copy-relocs.h".
15801 (class Target_sparc): Change type of copy_relocs_ to variable,
15802 update initializer.
15803 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15804 Change all callers.
15805 (Target_sparc::do_finalize_sections): Change handling of
15807 * x86_64.cc: Include "copy-relocs.h".
15808 (class Target_x86_64): Change type of copy_relocs_ to variable,
15809 update initializer.
15810 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15811 class. Change all callers.
15812 (Target_x86_64::do_finalize_sections): Change handling of
15814 * Makefile.am (CCFILES): Add copy-relocs.cc.
15815 (HFILES): Add copy-relocs.h.
15817 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15819 * testsuite/script_test_4.sh: Permit leading zeroes.
15821 2008-04-15 Ian Lance Taylor <iant@google.com>
15823 * script-sections.cc (Script_sections::create_segments): Use
15824 header_size_adjustment even when there is enough room for the
15826 * testsuite/script_test_4.sh: New file.
15827 * testsuite/script_test_4.t: New file.
15828 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15829 (check_DATA): Add script_test_4.stdout.
15830 (MOSTLYCLEANFILES): Likewise.
15831 (script_test_4): New target.
15832 (script_test_4.stdout): New target.
15833 * testsuite/Makefile.in: Rebuild.
15835 * sparc.cc: Add definitions for Output_data_plt_sparc class
15838 2008-04-14 David S. Miller <davem@davemloft.net>
15840 * sparc.cc: New file.
15841 * Makefile.am (TARGETSOURCES): Add sparc.cc
15842 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15843 * configure.tgt: Document targ_extra_size and
15844 targ_extra_big_endian. Add entries for sparc-* and
15846 * configure.ac: Handle targ_extra_size and
15847 targ_extra_big_endian.
15848 * Makefile.in: Rebuild.
15849 * configure: Likewise.
15850 * po/POTFILES.in: Likewise.
15851 * po/gold.pot: Likewise.
15853 2008-04-14 Ian Lance Taylor <iant@google.com>
15855 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15856 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15857 in the name/type/flags to section mapping. Don't call
15858 allocate_output_section.
15859 (Layout::choose_output_section): Change parameter from adjust_name
15860 to is_input_section. Don't permit input sections after sections
15861 are attached to segments. Don't call allocate_output_section.
15862 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15863 not write_enable_output_section.
15864 (Layout::make_output_section): Don't push to
15865 unattached_section_list_ nor call attach_to_segment. Call
15866 attach_section_to_segment if sections are attached.
15867 (Layout::attach_sections_to_segments): New function.
15868 (Layout::attach_section_to_segment): New function.
15869 (Layout::attach_allocated_section_to_segment): Rename from
15870 attach_to_segment. Remove flags parameter.
15871 (Layout::allocate_output_section): Remove function.
15872 (Layout::write_enable_output_section): Remove function.
15873 * layout.h (class Layout): Update for above changes. Add new
15874 field sections_are_attached_.
15875 * output.h (Output_section::update_flags_for_input_section): New
15877 * output.cc (Output_section::add_input_section): Call
15878 update_flags_for_input_section.
15879 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15881 2008-04-11 Cary Coutant <ccoutant@google.com>
15883 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15884 thought unnecessary.
15885 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15887 2008-04-11 Ian Lance Taylor <iant@google.com>
15889 * output.h (class Output_section_data): Remove inline definition
15891 * output.cc (Output_section_data::set_addralign): New function.
15893 2008-04-11 Cary Coutant <ccoutant@google.com>
15895 Add support for TLS descriptors for i386 and x86_64.
15896 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15897 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15898 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15900 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15901 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15902 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15904 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15905 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15906 Fix problem with initial-exec relocations.
15907 (Target_i386::Relocate::relocate_tls): Likewise.
15908 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15910 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15911 support for section-plus-offset dynamic table entries.
15912 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15913 (Output_data_dynamic::Dynamic_entry): Add support for
15914 section-plus-offset dynamic table entries.
15915 (Output_data_dynamic::Classification): Likewise.
15916 (Output_data_dynamic::classification_): Renamed offset_.
15917 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15918 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15919 (Target_x86_64::make_plt_section): New function.
15920 (Target_x86_64::reserve_tlsdesc_entries): New function.
15921 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15922 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15923 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15924 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15925 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15926 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15927 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15928 add extra PLT entry for TLS descriptors.
15929 (Output_data_plt_x86_64::got_): New field.
15930 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15931 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15933 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15935 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15936 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15937 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15938 R_386_TLS_DESC_CALL relocations.
15939 (Target_x86_64::Scan::global): Likewise.
15940 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15941 for TLS descriptors.
15942 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15943 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15944 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15945 GD-to-IE relaxation.
15946 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15947 and TLS_DESCRIPTORS.
15948 * Makefile.in: Rebuild.
15949 * configure: Rebuild.
15950 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15951 (tls_test_shared2.so): New target.
15952 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15953 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15954 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15955 (tls_shared_gd_to_ie_test_LDADD): New variable.
15956 (tls_shared_gnu2_gd_to_ie_test): New target.
15957 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15959 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15960 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15961 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15962 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15963 (tls_shared_gnu2_test): New target.
15964 (tls_test_gnu2_shared.so): New target.
15965 (tls_shared_gnu2_test_SOURCES): New variable.
15966 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15967 (tls_shared_gnu2_test_LDFLAGS): New variable.
15968 (tls_shared_gnu2_test_LDADD): New variable.
15969 * testsuite/Makefile.in: Rebuild.
15970 * testsuite/Makefile.
15972 2008-04-11 Ian Lance Taylor <iant@google.com>
15974 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15976 * testsuite/Makefile.in: Rebuild.
15978 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15980 * testsuite/script_test_2.cc (main): Adjust test.
15982 2008-04-11 David S. Miller <davem@davemloft.net>
15983 Ian Lance Taylor <iant@google.com>
15985 * options.h (General_options): Add entries for '-Y' and
15987 * options.cc (General_options:finalize): If -Y was used, add those
15988 entries to the library path instead of the default "/lib" and
15991 2008-04-11 David S. Miller <davem@davemloft.net>
15993 * testsuite/justsyms.t: Start at 0x100.
15994 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
15995 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15997 * testsuite/script_test_2.cc: Adjust string and section length
16000 2008-04-09 Ian Lance Taylor <iant@google.com>
16003 * script-sections.cc (Sections_element::allocate_to_segment): Add
16005 (Output_section_definition::allocate_to_segment): Likewise.
16006 (Orphan_output_section::allocate_to_segment): Likewise.
16007 (Script_sections::attach_sections_using_phdrs_clause): Don't
16008 propagate non-PT_LOAD segments to orphan sections.
16009 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16010 readelf rather than objdump.
16011 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16012 .interp section and PT_INTERP segment are the same size.
16013 * testsuite/Makefile.in: Rebuild.
16015 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16016 aliases for symbols defined in the same object.
16017 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16018 (weak_alias_test_SOURCES): New variable.
16019 (weak_alias_test_DEPENDENCIES): New variable.
16020 (weak_alias_test_LDFLAGS): New variable.
16021 (weak_alias_test_LDADD): New variable.
16022 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16023 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16024 (weak_alias_test_3.o): New target.
16025 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16026 * testsuite/weak_alias_test_main.cc: New file.
16027 * testsuite/weak_alias_test_1.cc: New file.
16028 * testsuite/weak_alias_test_2.cc: New file.
16029 * testsuite/weak_alias_test_3.cc: New file.
16031 2008-04-08 Ian Lance Taylor <iant@google.com>
16033 * options.h (class General_options): Add --noinhibit-exec option.
16034 * main.cc (main): Check --noinhibit-exec.
16036 * options.h (class General_options): Define --wrap as a special
16037 option. Add wrap_symbols_ field.
16038 (General_options::any_wrap_symbols): New function.
16039 (General_options::is_wrap_symbol): New function.
16040 * options.cc (General_options::parse_wrap): New function.
16041 (General_options::General_options): Initialize wrap_symbols_.
16042 * symtab.cc (Symbol_table::wrap_symbol): New function.
16043 (Symbol_table::add_from_object): Handle --wrap.
16044 * symtab.h (class Symbol_table): Declare wrap_symbol.
16045 * target.h (Target::wrap_char): New function.
16046 (Target::Target_info): Add wrap_char field.
16047 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16048 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16049 * testsuite/testfile.cc (Target_test::test_target_info):
16052 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16055 * layout.h (class Layout): Add added_eh_frame_data_ field.
16056 * layout.cc (Layout::Layout): Initialize new field.
16057 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16058 output section until we find a section we merged successfully.
16059 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16060 that the size be non-zero.
16062 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16065 2008-04-08 Craig Silverstein <csilvers@google.com>
16067 * configure.ac: Export new conditional variable HAVE_ZLIB.
16068 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16070 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16071 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16073 2008-04-07 Ian Lance Taylor <iant@google.com>
16075 * version.cc (version_string): Set to "1.5".
16077 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16078 Add issued_non_pic_error_ field. Declare check_non_pic.
16079 (Target_x86_64::Scan::check_non_pic): New function.
16080 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16081 (Target_x86_64::Scan::global): Likewise.
16083 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16084 addend parameter. Change caller. Handle merge sections.
16085 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16086 Address to Addend. Don't add in the result of
16087 local_section_offset, pass down the addend and use the returned
16089 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16090 Update declarations of local_section_offset and symbol_value.
16091 * testsuite/two_file_test_1.cc (t18): New function.
16092 * testsuite/two_file_test_2.cc (f18): New function.
16093 * testsuite/two_file_test_main.cc (main): Call t18.
16094 * testsuite/two_file_test.h (t18, f18): Declare.
16096 * configure.ac: Don't test for objdump, c++filt, or readelf.
16097 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16099 (TEST_READELF): New variable.
16100 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16101 (check_PROGRAMS): Add two_file_strip_test.
16102 (two_file_strip_test): New target.
16103 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16104 (two_file_same_shared_strip_test_SOURCES): New variable.
16105 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16106 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16107 (two_file_same_shared_strip_test_LDADD): New variable.
16108 (two_file_shared_strip.so): New target.
16109 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16110 (ver_test_5.syms, ver_test_7.syms): Likewise.
16111 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16112 (strip_test_3.stdout): Use TEST_OBJDUMP.
16113 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16115 2008-04-04 Cary Coutant <ccoutant@google.com>
16117 * symtab.h (Symbol::is_weak_undefined): New function.
16118 (Symbol::is_strong_undefined): New function.
16119 (Symbol::is_absolute): New function.
16120 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16121 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16123 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16124 (weak_undef_test): New target.
16125 * testsuite/Makefile.in: Rebuild.
16126 * testsuite/weak_undef_file1.cc: New file.
16127 * testsuite/weak_undef_file2.cc: New file.
16128 * testsuite/weak_undef_test.cc: New file.
16130 2008-04-03 Craig Silverstein <csilvers@google.com>
16132 * compressed_output.h (class Output_compressed_section): Use
16134 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16136 (zlib_compressed_suffix): Removed.
16137 (Output_compressed_section::set_final_data_size): Use unsigned
16139 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16140 Fix linker invocation.
16141 (flagstest_o_specialfile_and_compress_debug_sections):
16143 * testsuite/Makefile.in: Regenerated.
16145 2008-04-02 David S. Miller <davem@davemloft.net>
16147 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16148 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16150 2008-04-02 Craig Silverstein <csilvers@google.com>
16154 2008-04-02 Ian Lance Taylor <iant@google.com>
16156 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16157 parameters. Update for new key type to views_. Change all
16159 (File_read::read): Adjust for byteshift in returned view.
16160 (File_read::add_view): New function, broken out of
16161 find_and_make_view.
16162 (File_read::make_view): New function, broken out of
16163 find_and_make_view.
16164 (File_read::find_or_make_view): Add offset and aligned
16165 parameters. Rewrite accordingly. Change all callers.
16166 (File_read::get_view): Add offset and aligned parameters. Adjust
16167 for byteshift in return value.
16168 (File_read::get_lasting_view): Likewise.
16169 * fileread.h (class File_read): Update declarations.
16170 (class File_read::View): Add byteshift_ field. Add byteshift to
16171 constructor. Add byteshift method.
16172 * archive.h (Archive::clear_uncached_views): New function.
16173 (Archive::get_view): Add aligned parameter. Change all callers.
16174 * object.h (Object::get_view): Add aligned parameter. Change all
16176 (Object::get_lasting_view): Likewise.
16178 * fileread.cc (File_read::release): Don't call clear_views if
16179 there are multiple objects.
16180 * fileread.h (File_read::clear_uncached_views): New function.
16181 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16184 2008-03-31 Cary Coutant <ccoutant@google.com>
16186 Add thin archive support.
16187 * archive.cc (Archive::armagt): New const.
16188 (Archive::setup): Remove task parameter and calls to unlock.
16189 (Archive::unlock_nested_archives): New function.
16190 (Archive::read_header): Add nested_off parameter. Change
16192 (Archive::interpret_header): Likewise.
16193 (Archive::include_all_members): Change to handle thin
16195 (Archive::include_member): Likewise.
16196 * archive.h (Archive::Archive): Add new parameters and
16198 (Archive::armagt): New const.
16199 (Archive::setup): Remove task parameter.
16200 (Archive::unlock_nested_archives): New function.
16201 (Archive::read_header): Add nested_off parameter.
16202 (Archive::interpret_header): Likewise.
16203 (Archive::Nested_archive_table): New typedef.
16204 (Archive::is_thin_archive_): New field.
16205 (Archive::nested_archives_): New field.
16206 (Archive::options_): New field.
16207 (Archive::dirpath_): New field.
16208 (Archive::task_): New field.
16209 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16210 for thin archives. Pass additional parameters to
16211 Archive::Archive. Unlock the archive file after calling
16214 2008-03-29 Ian Lance Taylor <iant@google.com>
16216 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16217 version symbol to be local.
16218 * testsuite/ver_test_4.sh: New file.
16219 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16220 (check_DATA): Add ver_test_4.syms.
16221 (ver_test_4.syms): New target.
16222 * testsuite/Makefile.in: Rebuild.
16225 (Output_section::Input_section_sort_entry::has_priority): New
16227 (Output_section::Input_section_sort_entry::match_file_name): New
16229 (Output_section::Input_section_sort_entry::match_section_name):
16231 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16233 (Output_section::Input_section_sort_entry::match_section_file):
16235 (Output_section::Input_section_sort_compare::operator()): Rewrite
16236 using new Input_section_sort_entry functions. Sort crtbegin and
16237 crtend first. Sort sections with no priority before sections with
16239 * testsuite/initpri1.c (d3): Check j != 4.
16240 (cd5): New constructor/destructor function.
16241 (main): Check j != 2.
16243 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16244 new symbol when resolving, don't call set_is_default.
16245 * testsuite/ver_test_7.cc: New file.
16246 * testsuite/ver_test_7.sh: New file.
16247 * testsuite/Makefile.am (ver_test_7.so): New target.
16248 (ver_test_7.o): New target.
16249 (check_SCRIPTS): Add ver_test_7.sh.
16250 (check_DATA): Add ver_test_7.syms.
16251 (ver_test_7.syms): New target.
16253 2008-03-28 Ian Lance Taylor <iant@google.com>
16255 * layout.cc (Layout::layout): If we see an input section with a
16256 name that needs sorting, set the must_sort flag for the output
16258 (Layout::make_output_section): If the name of the output section
16259 indicates that it might require sorting, set the may_sort flag.
16260 * output.h (Output_section::may_sort_attached_input_sections): New
16262 (Output_section::set_may_sort_attached_input_sections): New
16264 (Output_section::must_sort_attached_input_sections): New
16266 (Output_section::set_must_sort_attached_input_sections): New
16268 (class Output_section): Declare Input_section_sort_entry. Define
16269 Input_section_sort_compare. Declare
16270 sort_attached_input_sections. Add new fields:
16271 may_sort_attached_input_sections_,
16272 must_sort_attached_input_sections_,
16273 attached_input_sections_are_sorted_.
16274 * output.cc (Output_section::Output_section): Initialize new
16276 (Output_section::add_input_section): Add an entry to
16277 input_sections_ if may_sort or must_sort are true.
16278 (Output_section::set_final_data_size): Call
16279 sort_attached_input_sections if necessary.
16280 (Output_section::Input_section_sort_entry): Define new class.
16281 (Output_section::Input_section_sort_compare::operator()): New
16283 (Output_section::sort_attached_input_sections): New function.
16284 * configure.ac: Check whether the compiler supports constructor
16285 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16286 * testsuite/initpri1.c: New file.
16287 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16288 CONSTRUCTOR_PRIORITY.
16289 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16290 (initpri1_LDFLAGS): New variable.
16291 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16293 2008-03-27 Ian Lance Taylor <iant@google.com>
16295 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16296 * testsuite/common_test_1.c: New file.
16297 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16298 (common_test_1_SOURCES): New variable.
16299 (common_test_1_DEPENDENCIES): New variable.
16300 (common_test_1_LDFLAGS): New variable.
16302 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16303 and commons_ correctly when NAME/VERSION does not override
16305 * testsuite/ver_test_6.c: New file.
16306 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16307 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16308 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16310 2008-03-26 Ian Lance Taylor <iant@google.com>
16312 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16313 of an undefined symbol from a version script.
16314 * testsuite/Makefile.am (ver_test_5.so): New target.
16315 (ver_test_5.o): New target.
16316 (check_SCRIPTS): Add ver_test_5.sh.
16317 (check_DATA): Add ver_test_5.syms.
16318 (ver_test_5.syms): New target.
16319 * testsuite/ver_test_5.cc: New file.
16320 * testsuite/ver_test_5.script: New file.
16321 * testsuite/ver_test_5.sh: New file.
16322 * Makefile.in, testsuite/Makefile.in: Rebuild.
16325 Fix problems building gold with gcc 4.3.0.
16326 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16327 (gold_error_at_location, gold_warning_at_location): Use it.
16328 * configure.ac: Check whether we can compile and use a template
16329 function with a printf attribute.
16330 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16331 when jumping over bytes.
16332 * object.cc: Instantiate Object::read_section_data.
16333 * debug.h: Include <cstring>
16334 * dwarf_reader.cc: Include <algorithm>
16335 * main.cc: Include <cstring>.
16336 * options.cc: Include <cstring>.
16337 * output.cc: Include <cstring>.
16338 * script.cc: Include <cstring>.
16339 * script.h: Include <string>.
16340 * symtab.cc: Include <cstring> and <algorithm>.
16341 * target-select.cc: Include <cstring>.
16342 * version.cc: Include <string>.
16343 * testsuite/testmain.cc: Include <cstdlib>.
16344 * configure, config.in: Rebuild.
16346 2008-03-25 Ian Lance Taylor <iant@google.com>
16348 * options.cc: Include "../bfd/bfdver.h".
16349 (options::help): Print bug reporting address.
16351 * version.cc (print_version): Adjust output for current value of
16352 BFD_VERSION_STRING.
16356 * options.cc (options::help): Print list of supported targets.
16357 * target-select.h: Include <vector>.
16358 (class Target_selector): Make machine_, size_, and is_big_endian_
16359 fields const. Add bfd_name_ and instantiated_target_ fields.
16360 (Target_selector::Target_selector): Add bfd_name parameter.
16361 (Target_selector::recognize): Make non-virtual, call
16363 (Target_selector::recognize_by_name): Make non-virtual, call
16364 do_recognize_by_name.
16365 (Target_selector::supported_names): New function.
16366 (Target_selector::bfd_name): New function.
16367 (Target_selector::do_instantiate_target): New pure virtual
16369 (Target_selector::do_recognize): New virtual function.
16370 (Target_selector::do_recognize_by_name): New virtual function.
16371 (Target_selector::instantiate_target): New private function.
16372 (supported_target_names): Declare.
16373 * target-select.cc (Target_selector::Target_selector): Update for
16374 new parameter and fields.
16375 (select_target_by_name): Check that the name matches before
16376 calling recognize_by_name.
16377 (supported_target_names): New function.
16378 * i386.cc (class Target_selector_i386): Update Target_selector
16379 constructor call. Remove recognize and recognize_by_name. Add
16380 do_instantiate_target.
16381 * x86_64.cc (class Target_selector_x86_64): Likewise.
16382 * testsuite/testfile.cc (class Target_selector_test): Update for
16383 changes to Target_selector.
16385 * README: Rewrite, with some notes on unsupported features.
16387 2008-03-24 Cary Coutant <ccoutant@google.com>
16389 * i386.cc (Target_i386::Got_type): New enum declaration.
16390 (Target_i386::Scan::local): Updated callers of Output_data_got
16392 (Target_i386::Scan::global): Likewise.
16393 (Target_i386::Relocate::relocate): Likewise.
16394 (Target_i386::Relocate::relocate_tls): Likewise.
16395 * object.h (Got_offset_list): New class.
16396 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16397 (Sized_relobj::local_got_offset): Likewise.
16398 (Sized_relobj::set_local_got_offset): Likewise.
16399 (Sized_relobj::local_has_tls_got_offset): Removed.
16400 (Sized_relobj::local_tls_got_offset): Removed.
16401 (Sized_relobj::set_local_tls_got_offset): Removed.
16402 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16403 * output.cc (Output_data_got::add_global): Added got_type parameter.
16404 (Output_data_got::add_global_with_rel): Likewise.
16405 (Output_data_got::add_global_with_rela): Likewise.
16406 (Output_data_got::add_global_pair_with_rel): New function.
16407 (Output_data_got::add_global_pair_with_rela): New function.
16408 (Output_data_got::add_local): Added got_type parameter.
16409 (Output_data_got::add_local_with_rel): Likewise.
16410 (Output_data_got::add_local_with_rela): Likewise.
16411 (Output_data_got::add_local_pair_with_rel): New function.
16412 (Output_data_got::add_local_pair_with_rela): New function.
16413 (Output_data_got::add_global_tls): Removed.
16414 (Output_data_got::add_global_tls_with_rel): Removed.
16415 (Output_data_got::add_global_tls_with_rela): Removed.
16416 (Output_data_got::add_local_tls): Removed.
16417 (Output_data_got::add_local_tls_with_rel): Removed.
16418 (Output_data_got::add_local_tls_with_rela): Removed.
16419 * output.h (Output_data_got::add_global): Added got_type parameter.
16420 (Output_data_got::add_global_with_rel): Likewise.
16421 (Output_data_got::add_global_with_rela): Likewise.
16422 (Output_data_got::add_global_pair_with_rel): New function.
16423 (Output_data_got::add_global_pair_with_rela): New function.
16424 (Output_data_got::add_local): Added got_type parameter.
16425 (Output_data_got::add_local_with_rel): Likewise.
16426 (Output_data_got::add_local_with_rela): Likewise.
16427 (Output_data_got::add_local_pair_with_rel): New function.
16428 (Output_data_got::add_local_pair_with_rela): New function.
16429 (Output_data_got::add_global_tls): Removed.
16430 (Output_data_got::add_global_tls_with_rel): Removed.
16431 (Output_data_got::add_global_tls_with_rela): Removed.
16432 (Output_data_got::add_local_tls): Removed.
16433 (Output_data_got::add_local_tls_with_rel): Removed.
16434 (Output_data_got::add_local_tls_with_rela): Removed.
16435 * resolve.cc (Symbol::override_base_with_special): Removed
16436 reference to has_got_offset_ field.
16437 * symtab.cc (Symbol::init_fields): Replaced initialization
16438 of got_offset_ with got_offsets_. Removed initialization
16440 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
16441 (Symbol::got_offset): Likewise.
16442 (Symbol::set_got_offset): Likewise.
16443 (Symbol::has_tls_got_offset): Removed.
16444 (Symbol::tls_got_offset): Removed.
16445 (Symbol::set_tls_got_offset): Removed.
16446 (Symbol::got_offset_): Removed.
16447 (Symbol::tls_mod_got_offset_): Removed.
16448 (Symbol::tls_pair_got_offset_): Removed.
16449 (Symbol::got_offsets_): New field.
16450 (Symbol::has_got_offset): Removed.
16451 (Symbol::has_tls_mod_got_offset): Removed.
16452 (Symbol::has_tls_pair_got_offset): Removed.
16453 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16454 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16456 (Target_x86_64::Scan::global): Likewise.
16457 (Target_x86_64::Relocate::relocate): Likewise.
16458 (Target_x86_64::Relocate::relocate_tls): Likewise.
16460 2008-03-25 Ben Elliston <bje@au.ibm.com>
16462 * yyscript.y: Fix spelling error in comment.
16464 2008-03-24 Ian Lance Taylor <iant@google.com>
16466 * options.h (class General_options): Define build_id option.
16467 * layout.h (class Layout): Declare write_build_id, create_note,
16468 create_build_id. Add build_id_note_ member.
16469 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16470 "libiberty.h", "md5.h", "sha1.h".
16471 (Layout::Layout): Initialize eh_frame_data_,
16472 eh_frame_hdr_section_, and build_id_note_.
16473 (Layout::finalize): Call create_build_id.
16474 (Layout::create_note): New function, broken out of
16475 Layout::create_gold_note.
16476 (Layout::create_gold_note): Call create_note.
16477 (Layout::create_build_id): New function.
16478 (Layout::write_build_id): New function.
16479 (Close_task_runner::run): Call write_build_id.
16481 * x86_64.cc: Correct license to GPLv3.
16483 2008-03-23 Ian Lance Taylor <iant@google.com>
16485 * options.cc: Include "demangle.h".
16486 (parse_optional_string): New function.
16487 (parse_long_option): Handle takes_optional_argument.
16488 (parse_short_option): Update dash_z initializer. Handle
16489 takes_optional_argument.
16490 (General_options::General_options): Initialize do_demangle_.
16491 (General_options::finalize): Set do_demangle_. Handle demangling
16493 * options.h (parse_optional_string): Declare.
16494 (struct One_option): Add optional_arg field. Update constructor.
16495 Update call constructor calls. Add takes_optional_argument
16497 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16498 (DEFINE_optional_string): Define.
16499 (General_options::demangle): Change from DEFINE_bool to
16500 DEFINE_optional_string.
16501 (General_options::no_demangle): New function.
16502 (General_options::do_demangle): New function.
16503 (General_options::set_do_demangle): New function.
16504 (General_options::execstack_status_): Move definition to end of
16506 (General_options::static_): Likewise.
16507 (General_options::do_demangle_): New field.
16508 * object.cc (big_endian>::get_symbol_location_info): Call
16509 Options::do_demangle, not Options::demangle.
16510 * symtab.cc (demangle): Likewise.
16512 2008-03-22 Ian Lance Taylor <iant@google.com>
16514 * gold.h: Include <cstddef> and <sys/types.h>
16515 * options.h: Include <cstring>.
16517 2008-03-21 Ian Lance Taylor <iant@google.com>
16519 * Added source code to GNU binutils.
16521 Copyright (C) 2008-2015 Free Software Foundation, Inc.
16523 Copying and distribution of this file, with or without modification,
16524 are permitted in any medium without royalty provided the copyright
16525 notice and this notice are preserved.
16531 version-control: never