1 2014-12-01 Cary Coutant <ccoutant@google.com>
4 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
6 (Layout::create_executable_stack_info): Warn when -z noexecstack is
7 given but some inputs require executable stack.
9 2014-11-26 Cary Coutant <ccoutant@google.com>
11 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
12 .debug_str_offsets; strip .debug_gnu_pubnames and
14 (lines_only_debug_sections): Strip all four new sections.
16 2014-11-26 Jing Yu <jingyu@google.com>
18 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
19 register to be x0 when to relax TLSDESC_LD64_LO12.
21 2014-11-26 Alan Modra <amodra@gmail.com>
23 * powerpc.cc (struct Stub_table_owner): New.
24 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
25 unsigned int vector. Update all references.
26 (powerpc_relobj::set_stub_table): Take an unsigned int param
27 rather than a Stub_table. Update callers.
28 (Powerpc_relobj::clear_stub_table): New function.
29 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
30 stub_group_size_ vars.
31 (Target_powerpc::new_stub_table): Delete.
32 (max_branch_delta): New function, extracted from..
33 (Target_powerpc::Relocate::relocate): ..here..
34 (Target_powerpc::Branch_info::make_stub): ..and here. Return
35 status on whether stub created successfully.
36 (Stub_control::Stub_control): Add "no_size_errors" param. Move
38 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
39 reduce on relax failure.
40 (Target_powerpc::group_sections): Add "no_size_errors" param.
41 Use stub_group_size_. Set up group info in a temp vector,
42 before building Stub_table vector. Account for input sections
43 possibly already converted to relaxed sections.
44 (Stub_table::init): Delete. Merge into..
45 (Stub_table::Stub_table): ..here.
46 (Stub_table::can_reach_stub): New function.
47 (Stub_table::add_plt_call_entry): Add "from" parameter and
48 return true iff stub could be reached.
49 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
51 (Stub_table::clear_stubs): Add "all" param.
53 2014-11-26 Alan Modra <amodra@gmail.com>
55 * powerpc.cc (Stub_control::set_output_and_owner): New function.
56 (Target_powerpc::group_sections): Use it.
58 2014-11-25 Cary Coutant <ccoutant@google.com>
60 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
61 (Binary_to_elf::write_symbol): Add st_size parameter.
62 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
64 2014-11-25 Cary Coutant <ccoutant@google.com>
67 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
68 (Sized_relobj_file::do_layout): Handle deferred sections properly
69 during GC pass 1. Don't add reloc sections to deferred list twice.
70 * object.h (Sized_relobj_file::is_deferred_layout): New function.
71 (Sized_relobj_file::is_deferred_layout_): New data member.
73 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
76 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
77 Check PC-relative offset overflow in PLT entry.
79 2014-11-21 Alan Modra <amodra@gmail.com>
81 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
84 2014-11-20 Alan Modra <amodra@gmail.com>
86 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
87 from --stub-group-size parameter divided by 1024.
88 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
89 template parameter. Update all uses.
90 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
91 has_stub_value. Set for long branches. Don't report overflow for
92 branch to undefined weak symbols. Print info message on
93 overflowing branch to stub.
95 2014-11-20 Alan Modra <amodra@gmail.com>
97 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
99 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
101 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
102 entry for R_X86_64_GOTPLT64.
103 (Target_x86_64<size>::Relocate::relocate): Update comments for
106 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
108 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
109 * plugin.h: add lock definition
111 2014-10-29 Han Shen <shenhan@google.com>
112 Jing Yu <jingyu@google.com>
114 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
115 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
116 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
118 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
120 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
121 (Target_aarch64::tls_ld_to_le): New method.
122 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
124 (Output_data_plt_aarch64::irelative_rel_): New data member.
125 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
126 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
127 (Output_data_plt_aarch64::add_relocation): New method.
128 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
129 offset. Add got_irelative size to got size.
130 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
131 type string with the new typename.
132 (AArch64_relocate_functions::update_adr): Replace parameter x with
134 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
135 (AArch64_relocate_functions::reloc_common): New method.
136 (AArch64_relocate_funcsions::rela_general): Extract common part out
137 into reloc_common method.
138 (AArch64_relocate_functions::rela_general): Likewise.
139 (AArch64_relocate_functions::pcrela_general): Likewise.
140 (AArch64_relocate_functions::adr): New method.
141 (AArch64_relocate_functions::adrp): Calculate immed before calling
143 (AArch64_relocate_functions::adrp): Likewise.
144 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
145 comparing x to 0. Calculate immed from ~x when x < 0.
146 (Target_aarch64::optimize_tls_reloc): Add new cases for
147 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
148 TLSLD_MOVW_DTPREL_G0_NC.
149 (Target_aarch64::possible_function_pointer_reloc): Implement this
151 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
153 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
154 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
155 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
156 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
157 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
158 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
159 (Target_aarch64::make_plt_entry): Call add_entry with two more
161 (Target_aarch64::make_local_ifunc_plt_entry): New method.
162 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
163 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
164 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
165 (Target_aarch64::Relocate::relocate_tls): Add cases for
166 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
167 TLSLD_MOVW_DTPREL_G0_NC.
168 * testsuite/icf_safe_so_test.cc: Correct test comment.
169 * testsuite/icf_safe_test.sh: Add AArch64 arch.
171 2014-10-22 Alan Modra <amodra@gmail.com>
173 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
176 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
178 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
180 2014-10-17 Cary Coutant <ccoutant@google.com>
182 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
183 Add "typename" keyword.
185 2014-10-15 Han Shen <shenhan@google.com>
186 Jing Yu <jingyu@google.com>
188 Patch for gold aarch64 backend to support relaxation.
189 * aarch64-reloc.def: Change format.
190 * aarch64.cc (class Reloc_stub): New class.
191 (class Stub_table): New class.
192 (class AArch64_relobj): New class.
193 (class AArch64_input_section): New class.
194 (class AArch64_output_section): New class.
195 (Target_aarch64::new_stub_table): New method.
196 (Target_aarch64::new_aarch64_input_section): New method.
197 (Target_aarch64::find_aarch64_input_section): New method.
198 (Target_aarch64::scan_section_for_stubs): New method.
199 (Target_aarch64::scan_reloc_section_for_stubs): New method.
200 (Target_aarch64::relocate_stub): New method.
201 (Target_aarch64::current_target): New method.
202 (Target_aarch64::do_make_elf_object): New method.
203 (Target_aarch64::do_may_relax): New method.
204 (Target_aarch64::do_relax): New method.
205 (Target_aarch64::group_sections): New method.
206 (Target_aarch64::scan_reloc_for_stub): New method.
207 (Target_aarch64::do_make_output_section): New method.
208 (Target_aarch64::stub_tables_): New data member.
209 (Target_aarch64::aarch64_input_section_map_): New data member.
210 (AArch64_relocate_functions::maybe_apply_stub): New method.
212 2014-09-30 Cary Coutant <ccoutant@google.com>
215 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
217 2014-09-30 Kito Cheng <kito@0xlab.org>
220 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
221 hash table before sysv-style hash table.
223 2014-09-29 Sriraman Tallam <tmsriram@google.com>
225 * options.h (--pic-executable): Add negative to alias to -no-pie.
227 2014-09-26 Cary Coutant <ccoutant@google.com>
230 * object.cc (Sized_relobj_file): Compute value of section symbols
231 for TLS sections the same as TLS symbols.
233 2014-09-25 Cary Coutant <ccoutant@google.com>
236 * resolve.cc (Symbol_table::resolve): Override common placeholder
237 symbols, but adjust sizes.
238 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
239 symbols to common lists.
241 2014-09-24 Alan Modra <amodra@gmail.com>
243 * po/POTFILES.in: Regenerate.
245 2014-09-23 Taiju Tsuiki <tzik@google.com>
246 Cary Coutant <ccoutant@google.com>
249 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
250 on input_sections_blocker.
251 * layout.cc (Write_sections_task::locks): Unblock
252 input_sections_blocker_.
253 * layout.h (Write_sections_task::Write_sections_task): Add
254 input_sections_blocker.
255 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
257 * testsuite/Makefile.in: Regenerate.
259 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
261 * testsuite/Makefile.am (plugin_test_10): New test.
262 * testsuite/Makefile.in: Regenerate
263 * testsuite/plugin_common_test_2.c (c1): Align to 8.
264 * testsuite/plugin_test_10.sh: New file.
266 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
268 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
269 * resolve.cc (Symbol_table::resolve): Don't override common symbols
270 during the replacement phase.
272 2014-09-17 Han Shen <shenhan@google.com>
273 Jing Yu <jingyu@google.com>
275 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
276 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
277 * aarch64.cc (Target_aarch64): Add data members
278 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
279 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
281 (Target_aarch64::do_reloc_symbol_index): New method.
282 (Target_aarch64::do_reloc_addend): New method.
283 (Target_aarch64::add_tlsdesc_info): New method.
284 (Target_aarch64::do_dynsym_value): New method.
285 (Target_aarch64::do_make_data_plt): Add new parameters: got,
286 got_irelative. Pass them to Output_data_plt_aarch64_standard.
287 (Target_aarch64::make_data_plt): Add new parameters: got,
288 got_irelative. Pass them to do_make_data_plt.
289 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
290 (Target_aarch64::Relocate:tls_gd_to_le): New method.
291 (Target_aarch64::Relocate:tls_ie_to_le): New method.
292 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
293 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
294 (Target_aarch64::got_tlsdesc_section): New method.
295 (Target_aarch64::make_local_ifunc_plt_entry): New method.
296 (Target_aarch64::define_tls_base_symbol): New method.
297 (Target_aarch64::reserve_tlsdesc_entries): New method.
298 (Target_aarch64::got_mod_index_entry): New method.
299 (Target_aarch64::rela_tlsdesc_section): New method.
300 (Target_aarch64::rela_irelative_section): New method.
301 (Target_aarch64::Tlsdesc_info): New struct.
302 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
303 relocations and tlsdesc relocations.
304 (Target_aarch64::optimize_tls_reloc): Implement method.
305 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
306 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
308 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
309 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
310 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
311 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
312 (Output_data_plt_aarch64::rela_tlsdesc): New method.
313 (Output_data_plt_aarch64::rela_irelative): New method.
314 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
315 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
316 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
317 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
318 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
319 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
320 (Output_data_plt_aarch64_standard): New member variables:
321 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
322 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
323 New parameter: got, got_irelative.
324 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
325 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
326 (Output_data_plt_aarch64::do_write): Replace got_address with
327 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
328 (AArch64_relocate_functions::update_movnz): New method.
329 (AArch64_relocate_functions): Correct format.
330 (AArch64_relocate_functions::movnz): New method.
331 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
332 before the switch. Add new cases to switch.
333 Check ie_to_le relaxation on tlsie relocations. Add code handling
335 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
336 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
337 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
338 Call reloc_name_in_error_message to print unsupported reloc.
339 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
341 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
342 relocs. Fill in some more dynamic tags.
343 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
344 Skip call tls_get_addr when tlsgd is relaxed.
345 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
346 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
347 tlsdesc->ie relaxation.
349 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
351 * mips.cc (Target_mips_nacl): New class.
352 (Target_selector_mips_nacl): New class.
353 (target_selector_mips32): Rename from target_selector_mips32be and use
354 Target_selector_mips_nacl instead of Target_selector_mips.
355 (target_selector_mips32el): Rename from target_selector_mips32 and use
356 Target_selector_mips_nacl instead of Target_selector_mips.
357 (target_selector_mips64): Rename from target_selector_mips64be and use
358 Target_selector_mips_nacl instead of Target_selector_mips.
359 (target_selector_mips64el): Rename from target_selector_mips64 and use
360 Target_selector_mips_nacl instead of Target_selector_mips.
361 (Target_mips::mips_info): Add const attribute.
363 2014-09-02 Cary Coutant <ccoutant@google.com>
365 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
366 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
367 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
368 (Sized_incr_dynobj::do_section_name): Likewise.
369 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
370 (Sized_incr_dynobj::do_section_name): Likewise.
371 * object.h (Object::section_name): Likewise.
372 (Object::do_section_name): Likewise.
373 (Sized_relobj_file::do_section_name): Likewise.
374 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
375 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
377 2014-09-02 Cary Coutant <ccoutant@google.com>
380 * ehframe.cc (Fde::write): Add output_offset parameter.
381 (Cie::write): Likewise.
382 (Eh_frame::set_final_data_size): Account for offset within output
384 (Eh_frame::do_sized_write): Likewise.
385 * ehframe.h (Fde::write): Add output_offset parameter.
386 (Cie::write): Likewise.
387 * output.cc (Output_section::Input_section_sort_entry): Remove
388 section_has_name_; add output_section_name parameter. Use
389 output section name for non-input sections.
390 (Output_section::Input_section_sort_entry::section_has_name): Remove.
391 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
392 (Output_section::Input_section_sort_compare): Remove logic for
393 sections without names.
394 (Output_section::Input_section_sort_init_fini_compare): Likewise.
395 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
397 (Output_section::Input_section_sort_section_name_compare): Likewise.
399 2014-08-29 Han Shen <shenhan@google.com>
400 Jing Yu <jingyu@google.com>
402 * aarch64-reloc-property.cc
403 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
404 reference reloc property in the table.
405 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
407 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
408 2 new overloaded methods.
409 (Output_data_got_aarch64::do_write): Add code to write out
411 (class Output_data_got_aarch64::Static_reloc): New class to wrap
413 (Output_data_got_aarch64::static_relocs): New vector to
415 (Target_aarch64::TCB_SIZE): New const static memeber.
416 (Target_aarch64::tcb_size): New method.
417 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
418 (Target_aarch64::Relocate::relocate_tls): New method.
419 (Target_aarch64::Scan::local): Add code handling new reloc types.
420 (Target_aarch64::Scan::global): Add code handling new reloc types.
422 2014-08-13 Sriraman Tallam <tmsriram@google.com>
424 * options.h (-no-pie): Add option.
426 2014-08-08 Jing Yu <jingyu@google.com>
427 Han Shen <shenhan@google.com>
429 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
430 (DEFFILES): add aarch64-reloc.def.
431 (TARGETSOURCES): Add aarch64-reloc-property.cc.
432 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
433 * Makefile.in: Regenerate.
434 * aarch64-reloc-property.cc: New file.
435 * aarch64-reloc-property.h: New file.
436 * aarch64-reloc.def: New file.
437 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
438 with tab to make the format consistent.
439 (Output_data_got_aarch64::symbol_table_): New method.
440 (Target_aarch64::do_plt_address_for_global): New method.
441 (Target_aarch64::do_plt_address_for_local): New method.
442 (Target_aarch64::do_select_as_default_target): New method.
443 (Target_aarch64::do_make_data_plt): New method.
444 (Target_aarch64::make_data_plt): New method.
445 (Output_data_plt_aarch64::has_irelative_section): New method.
446 (Output_data_plt_aarch64::address_for_global): New method.
447 (Output_data_plt_aarch64::address_for_local): New method.
448 (Output_data_plt_aarch64::irelative_rel_): New parameter.
449 (Output_data_plt_aarch64::add_entry): Implement contents.
450 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
451 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
452 the got_pov entry to plt0.
453 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
455 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
456 (AArch64_howto): New struct.
457 (aarch64_howto[]): New static const array.
458 (AArch64_relocate_functions): New class.
459 (Target_aarch64::Scan::get_reference_flags): Remove method.
460 (Target_aarch64::Scan::local): Implement to support a few relocations.
461 (Target_aarch64::Scan::global): Implement to support a few relocations.
462 (Target_aarch64::make_plt_section): Implement contents.
463 (Target_aarch64::make_plt_entry): Implement contents.
464 (Target_aarch64::do_finalize_sections): Implement contents.
465 (Target_aarch64::Relocate::relocate): Implement a few relocations.
466 (Target_aarch64::relocate_section): Implement contents.
468 2014-08-06 Alan Modra <amodra@gmail.com>
470 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
472 2014-08-06 Alan Modra <amodra@gmail.com>
475 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
477 2014-07-21 Sriraman Tallam <tmsriram@google.com>
479 * object.cc (Relobj::is_section_name_included): Add
480 ".rodata.nptl_version" to not garbage collect this section.
482 2014-07-08 Cary Coutant <ccoutant@google.com>
484 * expression.cc (struct Expression::Expression_eval_info): Add
485 new fields type_pointer, vis_pointer, and nonvis_pointer.
486 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
487 nonvis_pointer parameters. Adjust all calls.
488 (Symbol_expression::value): Update type, visibility, and nonvis bits
490 * script.cc (Symbol_assignment::sized_finalize): Update type,
491 visibility, and remaining st_other bits for new symbol.
492 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
493 vis_pointer, and nonvis_pointer parameters.
494 * symtab.h (Symbol::set_type): New method.
496 * testsuite/Makefile.am (defsym_test): New test.
497 * testsuite/Makefile.in: Regenerate.
498 * testsuite/defsym_test.c: New file.
499 * testsuite/defsym_test.sh: New file.
501 2014-07-08 Cary Coutant <ccoutant@google.com>
504 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
505 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
506 (Sized_dynobj::base_read_symbols): ...new method.
507 * object.h (Sized_relobj_file::base_read_symbols): New method.
508 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
509 (Sized_relobj_file::base_read_symbols): ...new method.
510 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
511 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
512 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
514 2014-07-04 Alan Modra <amodra@gmail.com>
516 * po/POTFILES.in: Regenerate.
518 2014-07-02 Jing Yu <jingyu@google.com>
520 * aarch64.cc: New file
521 * Makefile.am (TARGETSOURCES): Add aarch64.cc
522 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
523 * Makefile.in: Regenerate.
524 * configure.tgt: Add entries for aarch64*.
525 * configure.ac: Likewise.
526 * configure: Likewise.
528 2014-06-27 Alan Modra <amodra@gmail.com>
530 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
532 2014-06-24 Cary Coutant <ccoutant@google.com>
534 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
536 (Dwo_file::sized_read_unit_index): Likewise.
538 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
541 * Makefile.am (TARGETSOURCES): Add mips.cc
542 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
543 * configure.tgt: Add entries for mips*.
544 * configure.ac: Likewise.
545 * Makefile.in: Regenerate.
546 * configure: Likewise.
548 2014-06-09 Cary Coutant <ccoutant@google.com>
550 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
551 unit_length is within section bounds.
553 2014-06-09 Cary Coutant <ccoutant@google.com>
556 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
559 2014-06-07 Alan Modra <amodra@gmail.com>
561 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
563 2014-06-06 Cary Coutant <ccoutant@google.com>
565 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
566 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
567 (Dwarf_pubnames_table::read_header): Likewise.
568 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
571 2014-06-05 Joel Brobecker <brobecker@adacore.com>
573 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
574 * Makefile.in, configure: Regenerate.
576 2014-06-03 Alan Modra <amodra@gmail.com>
578 * powerpc.cc (addis_12_2): Define.
579 (Stub_table::do_write): Support fusion on ELFv2 stubs.
581 2014-06-03 Alan Modra <amodra@gmail.com>
583 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
586 2014-06-02 Alan Modra <amodra@gmail.com>
588 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
589 Only ignore relocs on ELFv1.
590 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
592 2014-05-30 Cary Coutant <ccoutant@google.com>
594 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
595 * testsuite/Makefile.in: Regenerate.
596 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
598 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
601 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
602 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
604 2014-05-15 Alan Modra <amodra@gmail.com>
606 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
607 Compare FDE contents with DW_CFA_nop rather than 0.
609 2014-05-13 Sriraman Tallam <tmsriram@google.com>
611 * symtab.h (may_need_copy_reloc): Remove check for position independent
613 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
614 position independence before pc absolute may_need_copy_reloc call.
615 Add check for executable output befor pc relative may_need_copy_reloc
621 * powerpc.cc: Add check for no position independence before
622 may_need_copy_reloc calls.
623 * testsuite/pie_copyrelocs_test.cc: New file.
624 * testsuite/pie_copyrelocs_shared_test.cc: New file.
625 * Makefile.am (pie_copyrelocs_test): New test.
626 * Makefile.in: Regenerate.
628 2014-05-08 Martin Liška <mliska@suse.cz>
630 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
632 2014-05-06 Cary Coutant <ccoutant@google.com>
635 * i386.cc (Output_data_got_plt_i386): New class.
636 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
637 parameter. Change all callers.
638 (Output_data_plt_i386::layout_): Remove.
639 (Output_data_plt_i386::got_plt_): Change type.
640 (Target_i386::got_plt_): Change type. Change all references.
641 (Target_i386::got_section): Create instance of new class.
642 (Output_data_got_plt_i386::do_write): New function.
643 * x86_64.cc (Output_data_got_plt_x86_64): New class.
644 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
645 parameter. Change all callers.
646 (Output_data_plt_x86_64::layout_): Remove.
647 (Output_data_plt_x86_64::got_plt_): Change type.
648 (Target_x86_64::got_plt_): Change type. Change all references.
649 (Target_x86_64::got_section): Create instance of new class.
650 (Output_data_got_plt_x86_64::do_write): New function.
651 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
652 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
655 2014-05-05 Cary Coutant <ccoutant@google.com>
657 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
658 if we have pubnames/pubtypes.
660 2014-05-02 Cary Coutant <ccoutant@google.com>
662 * defstd.cc (in_segment): Define __ehdr_start here...
663 * layout.cc (Layout::finalize): ...Instead of here. Set the
664 output segment when known.
665 * resolve.cc (Symbol::override_base_with_special): Remember
666 the original binding.
667 * symtab.cc (Symbol::set_output_segment): New function.
668 (Symbol::set_undefined): New function.
669 * symtab.h (Symbol::is_weak_undefined): Check original undef
671 (Symbol::is_strong_undefined): New function.
672 (Symbol::set_output_segment): New function.
673 (Symbol::set_undefined): New function.
674 * target-reloc.h (is_strong_undefined): Remove.
675 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
676 Check for hidden undefs.
677 (relocate_section): Call Symbol::is_strong_undefined.
679 * testsuite/Makefile.am (ehdr_start_test_1)
680 (ehdr_start_test_2, ehdr_start_test_3)
681 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
682 * testsuite/Makefile.in: Regenerate.
683 * testsuite/ehdr_start_def.cc: New source file.
684 * testsuite/ehdr_start_test.cc: New source file.
685 * testsuite/ehdr_start_test.t: New linker script.
686 * testsuite/ehdr_start_test_4.sh: New shell script.
688 2014-04-23 Cary Coutant <ccoutant@google.com>
691 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
693 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
695 * layout.cc (Layout::include_section): Allow a target to decide
696 whether to include a section.
697 * target.h (Target::should_include_section): New function.
698 (Target::do_should_include_section): New function.
700 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
702 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
704 (Copy_relocs::emit): ... here.
705 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
706 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
707 (Copy_reloc_entry::entries_): Change from private to protected.
709 2014-04-02 Sriraman Tallam <tmsriram@google.com>
711 * icf.cc (get_section_contents): Replace copies of reloc
712 vectors with const references.
714 2014-04-02 Cary Coutant <ccoutant@google.com>
716 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
717 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
718 * configure: Regenerate.
719 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
720 -fno-use-linker-plugin.
721 (LINK1, CXXLINK1): Add it to the link command.
722 * testsuite/Makefile.in: Regenerate.
724 2014-03-12 Alan Modra <amodra@gmail.com>
726 * Makefile.in: Regenerate.
728 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
730 * symtab.h (Symbol::set_nonvis): New function.
732 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
734 * symtab.cc (Sized_symbol<32>::init_output_data):
735 Instantiate the template.
736 (Sized_symbol<64>::init_output_data): Likewise.
738 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
740 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
741 adjust dynamic symbol value.
742 * target.h (Target::adjust_dyn_symbol): New function.
743 (Target::do_adjust_dyn_symbol): New function.
745 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
747 * output.cc (Output_data_dynamic::Dynamic_entry::write):
748 Get the value of DYNAMIC_CUSTOM dynamic entry.
749 * output.h (Output_data_dynamic::add_custom): New function.
750 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
752 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
753 * target.h (Target::dynamic_tag_custom_value): New function.
754 (Target::do_dynamic_tag_custom_value): New function.
756 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
758 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
760 * target.h (Target::has_custom_set_dynsym_indexes): New function.
761 (Target::do_has_custom_set_dynsym_indexes): New function.
762 (Target::set_dynsym_indexes): New function.
763 (Target::do_set_dynsym_indexes): New function.
765 2014-03-07 Alan Modra <amodra@gmail.com>
767 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
768 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
769 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
770 (Powerpc_relocate_functions::has_overflow_bitfield,
771 overflowed): Use the above.
772 (Target_powerpc::Relocate::relocate): Correct overflow checking
773 for a number of relocations. Modify overflow test for 16-bit
774 fields in instructions to signed/unsigned according to whether
775 the field takes a signed or unsigned value.
777 2014-03-05 Alan Modra <amodra@gmail.com>
779 Update copyright years.
781 2014-03-05 Alan Modra <amodra@gmail.com>
783 * powerpc.cc (Target_powerpc::Scan::local, global): Support
784 R_PPC64_ADDR64_LOCAL.
785 (Target_powerpc::Relocate::relocate): Likewise.
787 2014-03-03 Alan Modra <amodra@gmail.com>
789 * dwp.cc (print_version): Update copyright year to current.
791 2014-02-10 Alan Modra <amodra@gmail.com>
793 * po/gold.pot: Regenerate.
795 2014-02-06 Cary Coutant <ccoutant@google.com>
797 Fix problem where -u is ignored when a weak undef is seen.
799 * archive.cc (Library_base::should_include_member): Reorder
800 code to check for -u option if a weak undef has already been seen.
801 * testsuite/Makefile.am (weak_undef_test_2): New test case.
802 * testsuite/Makefile.in: Regenerate.
803 * testsuite/weak_undef_file3.cc: New file.
804 * testsuite/weak_undef_file4.cc: New file.
805 * testsuite/weak_undef_test_2.cc: New file.
807 2014-02-05 Cary Coutant <ccoutant@google.com>
809 Fix issues with gold undefined symbol diagnostics.
812 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
814 * target-reloc.h (is_strong_undefined): New function.
815 (relocate_section): Move undef vtable symbol check from here.
816 Check for is_strong_undefined.
818 2014-02-05 Cary Coutant <ccoutant@google.com>
820 Fix problems with the --dynamic-list option.
823 * options.cc (General_options::parse_dynamic_list):
824 Set have_dynamic_list_.
825 (General_options::General_options): Initialize have_dynamic_list_.
826 (General_options::finalize): Turn off -Bsymbolic and
827 -Bsymbolic-functions if --dynamic-list provided.
828 * options.h (General_options::have_dynamic_list): New function.
829 (General_options::have_dynamic_list_): New data member.
830 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
834 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
835 in --dynamic-list, mark it.
837 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
838 (dynamic_list_2): New test case.
839 * testsuite/Makefile.in: Regenerate.
840 * testsuite/dynamic_list_2.cc: New file.
841 * testsuite/dynamic_list_2.t: New file.
842 * testsuite/dynamic_list_lib1.cc: New file.
843 * testsuite/dynamic_list_lib2.cc: New file.
844 * testsuite/gc_dynamic_list_test.c: New file.
845 * testsuite/gc_dynamic_list_test.sh: New file.
846 * testsuite/gc_dynamic_list_test.t: New file.
848 2014-01-28 Cary Coutant <ccoutant@google.com>
850 Add .gdb_index version 7 support.
852 * gold/dwarf_reader.cc: include <utility> (for make_pair).
853 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
855 (Dwarf_ranges_table::read_ranges_table): Likewise.
856 (Dwarf_pubnames_table::read_section): Check for GNU-style
857 sections, and for compressed debug sections.
858 (Dwarf_pubnames_table::read_header): Compute end address of table.
859 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
860 for end of list by offset, not by offset == 0.
861 (Dwarf_info_reader::do_read_string_table): Check for compressed
863 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
864 Initialize new data members.
865 (Dwarf_pubnames_table::next_name): return flag_byte.
866 (Dwarf_pubnames_table::end_of_table_): New data member.
867 (Dwarf_pubnames_table::is_gnu_style_): New data member.
868 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
869 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
870 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
871 read skeleton type unit DIEs.
872 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
873 (Gdb_index::do_write): Write flag_byte.
874 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
875 (Gdb_index::Cu_vector): Store flags along with cu indexes.
876 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
877 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
879 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
881 * version.cc (print_version): Update copyright year to 2014.
883 2013-12-19 Dimitry Andric <dimitry@andric.com>
885 * stringpool.cc (Stringpool_template::reserve): Add
886 HAVE_UNORDERED_MAP case.
887 * stringpool.cc (Stringpool_template::print_stats): Likewise.
889 2013-12-18 Cary Coutant <ccoutant@google.com>
891 * configure.ac: Check for <unordered_set> and <unordered_map>.
892 * config.in: Regenerate.
893 * configure: Regenerate.
894 * system.h: Use <unordered_set> and <unordered_map> if available.
896 2013-12-10 Roland McGrath <mcgrathr@google.com>
898 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
899 with $(INSTALL_PROGRAM_ENV).
900 * Makefile.in: Regenerate.
902 2013-11-22 Cary Coutant <ccoutant@google.com>
904 * configure.ac: Add check for which library is needed for
906 * configure: Regenerate.
908 2013-11-22 Cary Coutant <ccoutant@google.com>
910 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
912 * testsuite/Makefile.in: Regenerate.
914 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
916 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
917 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
918 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
919 (Target_x86_64<size>::Scan::local): Likewise.
920 (Target_x86_64<size>::Scan::global): Likewise.
921 (Target_x86_64<size>::Relocate::relocate): Likewise.
922 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
924 (Target_x86_64<size>::Scan::check_non_pic(): Handle
927 * testsuite/Makefile.am (check_PROGRAMS): Add
928 exception_x86_64_bnd_test.
929 (exception_x86_64_bnd_test_SOURCES): New macro.
930 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
931 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
932 (exception_x86_64_bnd_test_LDADD): Likewise.
933 (exception_x86_64_bnd_1.o): New rule.
934 (exception_x86_64_bnd_2.o): Likewise.
935 * testsuite/Makefile.in: Regenerated.
937 2013-11-15 Alan Modra <amodra@gmail.com>
939 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
941 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
942 Only call ppc64_local_entry_offset for 64-bit. Restrict
943 symval_for_branch lookup to ELFv1.
944 (Stub_table::add_plt_call_entry): Use unsigned int off.
945 (Output_data_glink::Address, invalid_address): New.
946 (Output_data_glink::add_eh_frame): Move out of line. Add
948 (Output_data_glink::add_global_entry, find_global_entry,
949 global_entry_address): New functions.
950 (Output_data_glink::global_entry_stubs_, end_branch_table_,
951 ge_size): New variables.
952 (Output_data_glink::set_final_data_size): Add global entry
954 (Output_data_glink::do_write): Write global entry stubs.
955 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
956 parameter. Return true for ELFv2. Adjust callers.
957 (Target_powerpc::Scan::local, global): Restrict opd lookup to
958 ELFv1. Similarly for ifunc and dynamic relocation processing
959 specific to ELFv1. Recognize that symbols are defined on
960 their plt entries for ELFv2.
961 (Target_powerpc::symval_for_branch): Assert if called for
963 (Target_powerpc::Relocate::relocate): Use global entry plt
964 stub for symbol value if such exists on ELFv2.
965 (Target_powerpc::Relocate::relocate): Don't call
966 symval_for_branch when ELFv2. Do adjust for local entry
968 (Target_powerpc::do_dynsym_value): Set symbols to global entry
970 (Target_powerpc::do_plt_address_for_global): Similarly.
972 2013-11-14 Cary Coutant <ccoutant@google.com>
974 Revert patch -- this did not fix the problem, and there is
977 2013-11-14 Cary Coutant <ccoutant@google.com>
980 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
981 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
982 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
983 updating fde_offsets_.
984 (Eh_frame_hdr::lock_): New data member.
986 2013-11-14 Cary Coutant <ccoutant@google.com>
988 * dwp.cc (Dwo_file_entry): New type.
989 (File_list): Use Dwo_file_entry.
990 (Dwo_file::verify): New function.
991 (Dwo_file::verify_dwo_list): New function.
992 (Dwo_file::sized_verify_dwo_list): New function.
993 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
995 (Dwp_options): New enum type.
996 (dwp_options): Add --verify-only.
999 * dwp.h (gold_info): Add declaration.
1001 2013-11-14 Cary Coutant <ccoutant@google.com>
1004 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1005 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1006 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1007 updating fde_offsets_.
1008 (Eh_frame_hdr::lock_): New data member.
1010 2013-11-06 Cary Coutant <ccoutant@google.com>
1013 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1014 before reloc sections.
1016 2013-11-04 Alan Modra <amodra@gmail.com>
1018 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1019 (Symbol::needs_dynamic_reloc): Test new flag.
1020 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1021 (Target_powerpc::Scan::get_reference_flags): Add target param.
1022 Return FUNC_DESC_ABI for 64-bit ELFv1.
1023 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1025 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1026 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1028 2013-10-31 Cary Coutant <ccoutant@google.com>
1030 Restore support for dwp v2 DWARF package file format.
1032 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1033 tu_length parameter. Adjust all callers.
1034 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1035 * dwp.cc: Include dwarf.h.
1036 (Section_bounds): New struct type.
1037 (Unit_set): New struct type.
1038 (Dwo_file::Dwo_file): Initialize new data member.
1039 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1040 Combine and rename to...
1041 (Dwo_file::read_unit_index): ...this.
1042 (Dwo_file::sized_read_compunit_index)
1043 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1044 (Dwo_file::sized_read_unit_index): ...this.
1045 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1046 parameters; add section_id parameter.
1047 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1048 (Dwo_file::add_unit_set): ...this.
1049 (Dwo_file::shndx_map_): Remove.
1050 (Dwo_file::sect_offsets_): New data member.
1051 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1052 (Dwp_output_file::add_section): Rename to...
1053 (Dwp_output_file::add_contribution): ...this.
1054 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1055 (Dwp_output_file::add_tu_set): Likewise.
1056 (Dwp_output_file::Contribution): New type.
1057 (Dwp_output_file::Section::contributions): New data member.
1058 (Dwp_output_file::Cu_or_tu_set): Remove.
1059 (Dwp_output_file::Section::Section): New ctor.
1060 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1061 (Dwp_output_file::Dwp_index::Section_table): New type.
1062 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1063 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1065 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1066 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1067 (Dwp_output_file::Dwp_index::section_table): New member function.
1068 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1069 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1070 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1071 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1072 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1073 (Dwp_output_file::Dwp_index::section_table_): New data member.
1074 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1075 (Dwp_output_file::add_output_section): New member function.
1076 (Dwp_output_file::write_new_section): New member function.
1077 (Dwp_output_file::write_contributions): New member function.
1078 (Dwp_output_file::section_id_map_): New data member.
1079 (class Dwo_id_info_reader): Remove.
1080 (class Unit_reader): New class.
1081 (get_dwarf_section_name): New function.
1082 (Dwo_file::read_executable): Adjust initializations of class data.
1083 (Dwo_file::read): Add support for v2 package file format.
1084 (Dwo_file::read_unit_index): Likewise.
1085 (Dwo_file::sized_read_unit_index): Likewise.
1086 (Dwo_file::copy_section): Likewise.
1087 (Dwo_file::add_unit_set): Likewise.
1088 (Dwp_output_file::add_output_section): Likewise.
1089 (Dwp_output_file::add_contribution): Likewise.
1090 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1092 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1094 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1096 (Dwp_output_file::initialize): Remove unused function.
1097 (Dwp_output_file::finalize): Add support for v2 package file format.
1098 (Dwp_output_file::write_index): Likewise.
1099 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1102 2013-10-31 Cary Coutant <ccoutant@google.com>
1104 * configure.ac: Fix check for -fmerge-constants.
1105 * configure.ac: Regenerate.
1107 2013-10-30 Roland McGrath <mcgrathr@google.com>
1109 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1110 Correct 9-byte nop sequence to match what the assembler generates.
1112 2013-10-30 Alan Modra <amodra@gmail.com>
1114 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1115 ppc64_local_entry_offset, ppc64_local_entry_offset,
1116 do_read_symbols): New functions.
1117 (Powerpc_relobj::e_flags_, st_other_): New vars.
1118 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1119 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1120 (Powerpc_relobj::e_flags_): New var.
1121 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1122 and adjust for ELFv2.
1123 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1124 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1125 (Powerpc_dynobj::do_find_special_sections): Likewise.
1126 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1127 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1128 to ELFv2 local entry.
1129 (Target_powerpc::do_relax): No thread safe barriers needed for
1131 (Output_data_plt_powerpc::initial_plt_entry_size_,
1132 plt_entry_size): Delete. Replace all uses with
1133 first_plt_entry_offset() and plt_entry_size().
1134 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1135 reserved_size parm. Update callers.
1136 (Output_data_plt_powerpc::entry_count): Update.
1137 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1138 and use Target_powerpc::first_plt_entry_offset().
1139 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1140 rename to plt_entry_size.
1141 (Output_data_plt_powerpc::add_ifunc_entry,
1142 add_local_ifunc_entry): Adjust reloc for ELFv2.
1143 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1144 (glink_eh_frame_fde_64v2): New.
1145 (Stub_table::plt_call_size): Support ELFv2 sizing.
1146 (Output_data_glink::add_eh_frame): Use the new FDE.
1147 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1148 (Stub_table::do_write): Write ELFv2 stubs and glink.
1149 (Target_powerpc::Relocate::relocate): Replaces nop after call
1150 with ld 2,24(1) and adjust local offset destination for ELFv2.
1152 2013-10-30 Alan Modra <amodra@gmail.com>
1154 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1155 (Target_powerpc::Scan::global, local): Likewise.
1156 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1157 on all ppc64 @h and @ha relocs.
1159 2013-10-14 Alan Modra <amodra@gmail.com>
1161 * output.h (Output_data_got::add_constant): Tidy.
1162 (Output_data_got::add_constant_pair): New function.
1163 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1164 methods used so as to first call reserve_ent().
1166 2013-10-11 Roland McGrath <mcgrathr@google.com>
1168 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1169 add_got_entry and add_got_entry_pair.
1171 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1172 (HAVE_PUBNAMES): Likewise.
1173 * configure: Regenerate.
1175 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1176 * testsuite/Makefile.in: Regenerate.
1178 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1179 Remove const from declaration.
1180 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1181 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1182 * output.h (Output_file_header): Remove const from member target_
1183 and corresponding constructor argument.
1184 * output.cc (Output_file_header::Output_file_header): Update prototype.
1185 (Output_file_header::do_sized_write): Use this->target_ in place
1186 of parameters()->target().
1188 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1190 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1191 * configure: Regenerate.
1192 * Makefile.in: Regenerate.
1193 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1194 * testsuite/merge_string_literals_2.c: Likewise.
1195 * testsuite/Makefile.am
1196 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1197 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1198 literal -fmerge-constants.
1199 * testsuite/Makefile.in: Regenerate.
1201 * i386.cc (Target_i386): Remove unused member dynbss_.
1202 * arm.cc (Target_arm): Likewise.
1203 * powerpc.cc (Target_powerpc): Likewise.
1204 * sparc.cc (Target_sparc): Likewise.
1205 * tilegx.cc (Target_tilegx): Likewise.
1206 * x86_64.cc (Target_x86_64): Likewise.
1207 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1208 type_signature_, type_offset_.
1209 * plugin.h (Plugin_hook): Remove unused member layout_.
1210 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1212 (Read_member): Remove unused members input_objects_, symtab_,
1214 (Check_library): Remove unused member symtab_.
1215 * archive.h (Lib_group): Remove unused member lib_.
1216 * archive.cc (Lib_group::Lib_group): Update initializer.
1217 * incremental.h (Incremental_binary): Remove unused member target_.
1218 (Incremental_script_entry): Removed unused member script_.
1219 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1220 * icf.h (Icf): Remove unused member num_tracked_relocs.
1222 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1223 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1225 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1227 * archive.h: Use struct rather than class for forward declaration
1228 of Read_symbols_data.
1230 2013-10-07 Cary Coutant <ccoutant@google.com>
1233 * testsuite/Makefile.am (icf_test): Fix dependencies.
1234 (icf_safe_test): Likewise.
1235 (icf_safe_so_test): Likewise.
1236 (large_symbol_alignment): Add empty _LDADD rule.
1237 * testsuite/Makefile.in: Regenerate.
1239 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1242 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1243 relocation for R_X86_64_32 on x32.
1245 2013-08-27 Roland McGrath <mcgrathr@google.com>
1247 * output.cc (Output_segment::set_section_addresses): Take new
1248 Target* argument. If target->isolate_execinstr() and the segment
1249 is executable and starts at a target->abi_pagesize() boundary,
1250 pad its end out to a target->abi_pagesize() boundary with code fill.
1251 * output.h (Output_segment::set_section_addresses): Update decl.
1252 * layout.h (Layout::check_output_data_for_reset_values): Take new
1253 argument RELAX_OUTPUTS.
1254 (Layout): New member relax_output_list_.
1255 (Layout::add_relax_output): New method.
1256 * layout.cc (Layout::Layout): Update constructor.
1257 (Layout::reset_relax_output): New method.
1258 (Layout::clean_up_after_relaxation): Call it.
1259 (Layout::prepare_for_relaxation): Update caller.
1260 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1261 Call reset_relax_output before re-processing segments for
1262 isolate_execinstr case.
1263 (Layout::write_data): Handle relax_output_list_.
1264 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1265 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1267 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1270 * object.h: Fix typos.
1272 2013-08-16 Roland McGrath <mcgrathr@google.com>
1274 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1275 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1277 2013-08-07 Cary Coutant <ccoutant@google.com>
1279 Revert support for v2 DWP files:
1281 2013-03-01 Cary Coutant <ccoutant@google.com>
1283 Add dwp support for v2 DWARF package file format.
1284 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1285 tu_length parameter. Adjust all callers.
1286 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1287 * dwp.cc: Include dwarf.h.
1288 (Section_bounds): New struct type.
1289 (Unit_set): New struct type.
1290 (Dwo_file::Dwo_file): Initialize new data member.
1291 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1292 Combine and rename to...
1293 (Dwo_file::read_unit_index): ...this.
1294 (Dwo_file::sized_read_compunit_index)
1295 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1296 (Dwo_file::sized_read_unit_index): ...this.
1297 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1298 parameters; add section_id parameter.
1299 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1300 (Dwo_file::add_unit_set): ...this.
1301 (Dwo_file::shndx_map_): Remove.
1302 (Dwo_file::sect_offsets_): New data member.
1303 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1304 (Dwp_output_file::add_section): Rename to...
1305 (Dwp_output_file::add_contribution): ...this.
1306 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1307 (Dwp_output_file::add_tu_set): Likewise.
1308 (Dwp_output_file::Contribution): New type.
1309 (Dwp_output_file::Section::contributions): New data member.
1310 (Dwp_output_file::Cu_or_tu_set): Remove.
1311 (Dwp_output_file::Section::Section): New ctor.
1312 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1313 (Dwp_output_file::Dwp_index::Section_table): New type.
1314 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1315 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1317 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1318 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1319 (Dwp_output_file::Dwp_index::section_table): New member function.
1320 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1321 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1322 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1323 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1324 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1325 (Dwp_output_file::Dwp_index::section_table_): New data member.
1326 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1327 (Dwp_output_file::add_output_section): New member function.
1328 (Dwp_output_file::write_new_section): New member function.
1329 (Dwp_output_file::write_contributions): New member function.
1330 (Dwp_output_file::section_id_map_): New data member.
1331 (class Dwo_id_info_reader): Remove.
1332 (class Unit_reader): New class.
1333 (get_dwarf_section_name): New function.
1334 (Dwo_file::read_executable): Adjust initializations of class data.
1335 (Dwo_file::read): Add support for v2 package file format.
1336 (Dwo_file::read_unit_index): Likewise.
1337 (Dwo_file::sized_read_unit_index): Likewise.
1338 (Dwo_file::copy_section): Likewise.
1339 (Dwo_file::add_unit_set): Likewise.
1340 (Dwp_output_file::add_output_section): Likewise.
1341 (Dwp_output_file::add_contribution): Likewise.
1342 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1344 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1346 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1348 (Dwp_output_file::initialize): Remove unused function.
1349 (Dwp_output_file::finalize): Add support for v2 package file format.
1350 (Dwp_output_file::write_index): Likewise.
1351 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1354 2013-07-31 Cary Coutant <ccoutant@google.com>
1356 * object.cc (Sized_relobj::do_output_section_address): New function.
1357 (Sized_relobj): Instantiate explicitly.
1358 * object.h (Object::output_section_address): New function.
1359 (Object::do_output_section_address): New function.
1360 (Sized_relobj::do_output_section_address): New function.
1361 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1363 2013-07-30 Cary Coutant <ccoutant@google.com>
1364 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1366 * parameters.cc (Parameters::entry): Return target-specific entry
1368 * target.h (Target::entry_symbol_name): New function.
1369 (Target_info::entry_symbol_name): New data member.
1371 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1372 * i386.cc (Target_i386::i386_info): Likewise.
1373 (Target_i386_nacl::i386_nacl_info): Likewise.
1374 * sparc.cc (Target_sparc::sparc_info): Likewise.
1375 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1376 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1377 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1378 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1380 2013-07-22 Sterling Augustine <saugustine@google.com>
1382 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1383 Convert parameter shndx to local variable. Add parameters symtab
1384 and symtab_size. Scan over section names. Find relocation
1385 section corresponding to current section. Create and initialize
1386 reloc_mapper_ and reloc_type_.
1387 (Dwarf_pubnames_table::read_header): Add assertion. Change
1388 unit_length to off_t. Initialize member unit_length_. Fill in field
1390 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1391 Initialize new fields unit_length_ and cu_offset_.
1392 (Dwarf_pubnames_table::read_section): Update prototype.
1393 (Dwarf_pubnames_table::cu_offset): New member function.
1394 (Dwarf_pubnames_table::subsection_size): Likewise.
1395 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1397 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1398 member functions public.
1399 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1400 Update comment. Rework logic. Move repeated parts to...
1401 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1402 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1403 pubtypes_table_, and stmt_list_offset.
1404 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1405 Gdb_index::find_pubtype_offset,
1406 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1407 (Gdb_index::pubnames_read): Update prototype and rework logic.
1408 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1410 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1411 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1412 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1413 Gdb_index::map_pubtable_to_dies):
1415 (Gdb_index::pubnames_read): Update declaration.
1416 (Gdb_index::Pubname_offset_map): New type.
1417 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1418 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1419 Gdb_index::stmt_list_offset): Declare.
1420 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1421 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1422 Gdb_index::pubtypes_offset_): Remove.
1424 2013-07-19 Roland McGrath <mcgrathr@google.com>
1426 * options.h (General_options): Add -Trodata-segment option.
1427 * parameters.cc (Parameters::check_rodata_segment): New function.
1428 (Parameters::set_target_once): Call it.
1429 * parameters.h (Parameters): Declare it (private member function).
1430 * layout.cc (load_seg_unusable_for_headers): New function, broken
1431 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1432 then validate rodata segment rather than text segment.
1433 (relaxation_loop_body): Call that.
1434 (is_text_segment): New function. Don't admit a non-executable
1435 segment if TARGET->isolate_execinstr().
1436 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1438 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
1441 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1442 * nacl.h (Sniff_file::View::View): Request aligned view.
1444 2013-07-11 Cary Coutant <ccoutant@google.com>
1446 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1447 correct BRLT entry size.
1449 2013-07-03 Alan Modra <amodra@gmail.com>
1451 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1454 2013-07-01 Cary Coutant <ccoutant@google.com>
1456 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1458 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1459 (Dwarf_ranges_table::lookup_reloc): New function.
1460 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1462 (Dwarf_ranges_table::lookup_reloc): New function.
1463 (Dwarf_ranges_table::reloc_type_): New data member.
1465 2013-06-27 Jing Yu <jingyu@google.com>
1468 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1470 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1471 (Target_powerpc::do_relax): Call the above.
1473 2013-06-27 Cary Coutant <ccoutant@google.com>
1475 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1476 on garbage collected .opd section.
1478 2013-06-27 Alan Modra <amodra@gmail.com>
1480 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1482 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1483 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1485 2013-06-14 Cary Coutant <ccoutant@google.com>
1487 * resolve.cc (Symbol::override_base): Don't override st_type
1488 from plugin placeholder symbols.
1489 (Symbol_table::resolve): Likewise.
1490 (Symbol_table::should_override): Don't complain about TLS mismatch
1491 if the TO symbol is a plugin placeholder.
1492 * testsuite/Makefile.am (plugin_test_tls): New test.
1493 * testsuite/Makefile.in: Regenerate.
1494 * testsuite/plugin_test_tls.sh: New test script.
1495 * testsuite/two_file_test_2_tls.cc: New test source.
1496 * testsuite/two_file_test_tls.cc: New test source.
1498 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1500 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1501 the maximum segment alignment is larger than the page size.
1502 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1503 correctly aligns the symbols with large alignemnt.
1504 * testsuite/Makefile.in: Regenerate.
1505 * testsuite/large_symbol_alignment.cc: New file.
1507 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1508 Sriraman Tallam <tmsriram@google.com>
1510 * options.h (sort_section): New option.
1511 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1512 Rename from Input_section_sort_section_name_special_ordering_compare.
1513 (Input_section_sort_section_name_compare): New struct.
1514 * output.cc (Output_section::Input_section_sort_section_name_compare::
1515 operator()): New function.
1516 (Output_section::sort_attached_input_sections): Use new sort function
1517 for .text if --sort-section=name is specified.
1518 * layout.cc (Layout::make_output_section):
1519 Add sorting by name when --sort-section=name is specified.
1520 * testsuite/Makefile.am (text_section_grouping): Test option
1521 --sort-section=name.
1522 * testsuite/Makefile.in: Regenerate.
1523 * testsuite/section_sorting_name.cc: New file.
1524 * testsuite/section_sorting_name.sh: New file.
1526 2013-05-21 Cary Coutant <ccoutant@google.com>
1528 * symtab.h (Symbol::is_cxx_vtable): New function.
1529 * target-reloc.h (relocate_section): Check for vtable symbol.
1530 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1531 * testsuite/Makefile.in: Regenerate.
1532 * testsuite/missing_key_func.cc: New test source.
1533 * testsuite/missing_key_func.sh: New test script.
1535 2013-05-21 Cary Coutant <ccoutant@google.com>
1537 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1538 type of enclosing symbol.
1539 (Relocate_info::location): Check symbol type when describing symbol.
1540 * object.h (Symbol_location_info): Remove unused line_number;
1541 add enclosing_symbol_type.
1542 * testsuite/debug_msg.sh: Adjust expected output.
1544 2013-05-13 Cary Coutant <ccoutant@google.com>
1546 * configure.ac: Export DEFAULT_TARGET.
1547 * configure: Regenerate.
1548 * Makefile.in: Regenerate.
1549 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1550 * testsuite/Makefile.in: Regenerate.
1551 * testsuite/debug_msg.sh: Delete duplicate tests.
1552 Don't check undef_int error message match for powerpc where the
1553 source file and line number aren't available.
1555 2013-05-10 Roland McGrath <mcgrathr@google.com>
1557 * options.h (General_options): Add --rosegment-gap option.
1558 * options.cc (finalize): --rosegment-gap implies --rosegment.
1559 * layout.cc (set_segment_offsets): Let user option override
1560 target->rosegment_gap().
1562 2013-05-10 Roland McGrath <mcgrathr@google.com>
1564 * options.h (General_options): Remove leading space from help
1565 messages for -nostdlib and --rosegment.
1567 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1570 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1572 2013-05-03 Alan Modra <amodra@gmail.com>
1574 * merge.cc (Output_merge_string::do_add_input_section): Correct
1575 scan for number of strings. Rename vars to avoid shadowing.
1576 Include missing terminator in input_size_.
1578 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1580 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1581 Restore empty string handling.
1583 2013-05-01 Cary Coutant <ccoutant@google.com>
1585 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1586 uninitialized warning.
1588 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1590 * output.cc (Output_section::add_merge_input_section): Allow
1591 to merge sections if the alignment is more than character size.
1592 * merge.h (Output_merge_string::Output_merge_string): Remove
1594 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1595 only not-null strings. Check the alignment of strings.
1597 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1598 alignment as the argument.
1599 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1600 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1601 Align non-zero length strings according to the addralign_.
1602 (Stringpool_template<Stringpool_char>::set_string_offsets):
1603 Updating offsets according to the given alignment.
1604 * testsuite/Makefile.am (text_section_grouping): Test if string
1605 literals are getting merged.
1606 * testsuite/Makefile.in: Regenerate.
1607 * testsuite/merge_string_literals_1.c: New file.
1608 * testsuite/merge_string_literals_2.c: Ditto.
1609 * testsuite/merge_string_literals.sh: Ditto.
1611 2013-04-26 Ian Lance Taylor <iant@google.com>
1613 * target-reloc.h (relocate_section): If the reloc offset is out of
1614 range, pass VIEW as NULL to relocate.relocate.
1615 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1616 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1617 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1618 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1619 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1620 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1622 2013-04-26 Geoff Pike <gpike@chromium.org>
1624 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1625 * layout.cc (Hash_task): New class.
1626 (Layout::queue_build_id_tasks): New function.
1627 (Layout::write_build_id): Handle single-thread portion of build ID
1628 computation. (In some cases, all of it is single-threaded.) Replace
1629 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1630 functionality in fewer lines of code.
1631 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1632 * options.h (General_options): make "--build-id" default to tree
1633 rather than sha1. Add two new options related to --build-id=tree:
1634 --build-id-chunk-size-for-treehash and
1635 --build-id-min-file-size-for-treehash.
1636 * Makefile.am: add testing of --build-id=tree and related new options
1637 (these tests will be invoked by "make check").
1638 * Makefile.in: Regenerate.
1640 2013-04-25 Alan Modra <amodra@gmail.com>
1642 * configure.tgt: Add powerpcle and powerpc64le.
1644 2013-04-22 Alan Modra <amodra@gmail.com>
1647 * layout.cc (Layout::segment_precedes): Allow more than one
1648 segment with the same type and flags.
1650 2013-04-15 Cary Coutant <ccoutant@google.com>
1652 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1653 allocate space in file for BSS sections.
1655 2013-04-15 Cary Coutant <ccoutant@google.com>
1657 * script-sections.cc (Orphan_output_section): Reset address
1658 to zero after each orphaned section for relocatable links.
1660 2013-04-15 Cary Coutant <ccoutant@google.com>
1662 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1663 section starting address for relocatable link.
1664 * testsuite/Makefile.am (script_test_11): New test.
1665 * testsuite/Makefile.in: Regenerate.
1666 * testsuite/script_test_11.c: New source file.
1667 * testsuite/script_test_11.t: New linker script.
1669 2013-04-13 Alan Modra <amodra@gmail.com>
1671 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1672 owner when sections are not adjacent and exceed group size.
1673 (Target_powerpc::group_sections): Handle corner case.
1674 (Target_powerpc::Branch_info::make_stub): Handle case where
1675 stub table doesn't exist due to branches in non-exec sections.
1676 (Target_powerpc::Relocate::relocate): Likewise.
1678 2013-04-11 Alan Modra <amodra@gmail.com>
1681 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1682 .branch_lt to match bfd ld. Adjust comments throughout file.
1684 2013-04-04 Ian Lance Taylor <iant@google.com>
1687 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1688 sections before checking whether they are included in the link.
1690 2013-03-29 Sriraman Tallam <tmsriram@google.com>
1692 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1693 object before calling the plugin claim_file handler. Pass the elf
1694 object of the archive to the plugin. Delete the elf object if the
1695 plugin claims the file.
1697 2013-03-21 Alan Modra <amodra@gmail.com>
1699 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1700 segment when omagic.
1702 2013-03-21 Alan Modra <amodra@gmail.com>
1704 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1706 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1707 uninitialized" warning.
1709 2013-03-20 Alan Modra <amodra@gmail.com>
1711 * symtab.h (Symbol::clear_version): New function.
1712 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1713 is_needed by weak references. Clear version for symbols defined
1714 in as-needed objects that are not needed.
1716 2013-03-15 Alan Modra <amodra@gmail.com>
1718 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1719 static and public. Add report_err param. Return false for data refs.
1720 (Target_powerpc::rela_dyn_section): New overloaded function.
1721 (Target_powerpc::plt_, iplt_): Elucidate.
1722 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1723 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1724 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1725 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1726 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1727 push_branch and make_plt_entry for ifunc syms when
1728 reloc_needs_plt_for_ifunc.
1729 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1730 for ifunc unless reloc_needs_plt_for_ifunc.
1732 2013-03-15 Alan Modra <amodra@gmail.com>
1734 * gc.h (gc_process_relocs): Don't look through function descriptors.
1735 * icf.cc (get_section_contents): Do so here instead.
1737 2013-03-13 Alan Modra <amodra@gmail.com>
1739 * powerpc.cc (is_branch_reloc): Forward declare.
1740 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1741 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1742 false for 64-bit, true for 32-bit non-branch relocs.
1743 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1744 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1746 (icf_safe_test): Generate linker map file as well as nm output.
1747 (icf_safe_so_test): Likewise.
1748 * testsuite/Makefile.in: Regenerate.
1749 * testsuite/icf_test.sh: Parse linker map file to determine
1751 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1752 * testsuite/icf_safe_so_test.sh: Likewise.
1753 (X86_32_or_ARM_specific_safe_fold): Merge into..
1754 (arch_specific_safe_fold): ..this.
1755 (X86_64_specific_safe_fold): Delete unused function.
1757 2013-03-12 Alan Modra <amodra@gmail.com>
1759 * gc.h (gc_process_relocs): Look through function descriptors
1760 to determine shndx, symvalue and addend used by ICF. Tidy
1761 variable duplication.
1763 2013-03-11 Alan Modra <amodra@gmail.com>
1765 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1766 * layout.cc (Layout_task_runner::run): ..to here.
1767 * symtab.h (struct Symbol_location): Extract from..
1768 (class Symbol_table): ..here.
1769 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1770 * target.h (class Target): Add function_location and
1771 do_function_location functions.
1772 (class Sized_target): Add do_function_location.
1773 * object.h (class Sized_relobj_file): Move find_shdr..
1774 (class Object): ..to here.
1775 * object.cc: Likewise. Update to suit. Instantiate.
1776 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1777 * powerpc.cc (class Powerpc_dynobj): New.
1778 (Target_powerpc::do_function_location): New function.
1779 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1780 (Powerpc_dynobj::do_read_symbols): New function.
1781 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1783 2013-03-08 Ian Lance Taylor <iant@google.com>
1785 * options.cc (General_options::string_to_object_format): Accept
1788 2013-03-08 Alan Modra <amodra@gmail.com>
1790 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1791 pointer to Post_fde.
1792 (struct Post_fde): Move definition to here..
1793 * ehframe.cc (struct Post_fde): ..from here.
1794 (Cie::write): Don't alloc Post_fde.
1795 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1797 2013-03-07 Alan Modra <amodra@gmail.com>
1799 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1800 relocation referencing .LC0.
1801 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1803 2013-03-07 Alan Modra <amodra@gmail.com>
1805 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1806 always_inline. Add assembly for powerpc to avoid GOT.
1808 2013-03-07 Alan Modra <amodra@gmail.com>
1810 * testsuite/script_test_10.sh: Don't test .bss section
1813 2013-03-06 Alan Modra <amodra@gmail.com>
1815 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1816 (Target_powerpc::symval_for_branch): Add symtab param. Update
1817 all callers. Handle folded sections.
1818 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1820 (Global_symbol_visitor_opd::operator()): Likewise.
1822 2013-03-04 Alan Modra <amodra@gmail.com>
1824 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1825 * testsuite/Makefile.in: Regenerate.
1827 2013-03-01 Cary Coutant <ccoutant@google.com>
1829 Add dwp support for v2 DWARF package file format.
1830 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1831 tu_length parameter. Adjust all callers.
1832 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1833 * dwp.cc: Include dwarf.h.
1834 (Section_bounds): New struct type.
1835 (Unit_set): New struct type.
1836 (Dwo_file::Dwo_file): Initialize new data member.
1837 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1838 Combine and rename to...
1839 (Dwo_file::read_unit_index): ...this.
1840 (Dwo_file::sized_read_compunit_index)
1841 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1842 (Dwo_file::sized_read_unit_index): ...this.
1843 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1844 parameters; add section_id parameter.
1845 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1846 (Dwo_file::add_unit_set): ...this.
1847 (Dwo_file::shndx_map_): Remove.
1848 (Dwo_file::sect_offsets_): New data member.
1849 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1850 (Dwp_output_file::add_section): Rename to...
1851 (Dwp_output_file::add_contribution): ...this.
1852 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1853 (Dwp_output_file::add_tu_set): Likewise.
1854 (Dwp_output_file::Contribution): New type.
1855 (Dwp_output_file::Section::contributions): New data member.
1856 (Dwp_output_file::Cu_or_tu_set): Remove.
1857 (Dwp_output_file::Section::Section): New ctor.
1858 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1859 (Dwp_output_file::Dwp_index::Section_table): New type.
1860 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1861 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1863 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1864 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1865 (Dwp_output_file::Dwp_index::section_table): New member function.
1866 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1867 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1868 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1869 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1870 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1871 (Dwp_output_file::Dwp_index::section_table_): New data member.
1872 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1873 (Dwp_output_file::add_output_section): New member function.
1874 (Dwp_output_file::write_new_section): New member function.
1875 (Dwp_output_file::write_contributions): New member function.
1876 (Dwp_output_file::section_id_map_): New data member.
1877 (class Dwo_id_info_reader): Remove.
1878 (class Unit_reader): New class.
1879 (get_dwarf_section_name): New function.
1880 (Dwo_file::read_executable): Adjust initializations of class data.
1881 (Dwo_file::read): Add support for v2 package file format.
1882 (Dwo_file::read_unit_index): Likewise.
1883 (Dwo_file::sized_read_unit_index): Likewise.
1884 (Dwo_file::copy_section): Likewise.
1885 (Dwo_file::add_unit_set): Likewise.
1886 (Dwp_output_file::add_output_section): Likewise.
1887 (Dwp_output_file::add_contribution): Likewise.
1888 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1890 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1892 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1894 (Dwp_output_file::initialize): Remove unused function.
1895 (Dwp_output_file::finalize): Add support for v2 package file format.
1896 (Dwp_output_file::write_index): Likewise.
1897 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1900 2013-03-01 Cary Coutant <ccoutant@google.com>
1902 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1903 function into class definition in header file.
1904 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1905 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1907 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1909 2013-02-28 Alan Modra <amodra@gmail.com>
1911 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1912 * target.cc (Target::do_plt_fde_location): New function.
1913 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1914 accessor function, and constructor param.
1915 (struct Post_fde, Post_fdes): Declare.
1916 (Cie::write): Add post_fdes param.
1917 * ehframe.cc (Fde::write): Use plt_fde_location.
1918 (struct Post_fde): Define.
1919 (Cie::write): Stash FDEs added post merge mapping.
1920 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1921 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1922 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1924 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1925 (Target_powerpc::has_glink): New function.
1926 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1927 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1928 glink_eh_frame_fde_32, default_fde): New data.
1929 (Stub_table::eh_frame_added_): New var.
1930 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1932 (Stub_table::add_eh_frame): New function.
1933 (Output_data_glink::add_eh_frame): New function.
1934 (Target_powerpc::make_glink_section): Call add_eh_frame.
1936 2013-02-15 Ian Lance Taylor <iant@google.com>
1938 * options.h (DEFINE_uint64_alias): Define.
1939 (class General_options): Add -Ttext-segment as an alias for
1942 2013-02-15 Alan Modra <amodra@gmail.com>
1944 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1945 (Stub_table::do_write): ..here, two places.
1946 (Stub_table::plt_call_size): Use it here too.
1948 2013-02-11 Ian Lance Taylor <iant@google.com>
1950 * descriptors.cc (Descriptors::close_all): New function.
1951 * descriptors.h (class Descriptors): Declare close_all.
1952 (close_all_descriptors): New inline function.
1953 * plugin.cc: Include "descriptors.h".
1954 (Plugin_manager::cleanup): Call close_all_descriptors.
1956 2013-02-06 Alan Modra <amodra@gmail.com>
1958 * README: Update coding style link.
1960 2013-01-28 Cary Coutant <ccoutant@google.com>
1962 * dwp.cc (File_list): New typedef.
1963 (Dwo_name_info_reader): New class.
1964 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1965 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1966 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1967 (Dwo_file::read_executable): New function.
1968 (Dwo_file::read): Move common setup code to ...
1969 (Dwo_file::make_object): ... here.
1970 (dwp_options): Add --exec/-e.
1974 2013-01-24 Sriraman Tallam <tmsriram@google.com>
1976 * layout.cc (Layout::layout): Check for option text_reorder.
1977 (Layout::make_output_section): Ditto.
1978 * options.h (text_reorder): New option.
1979 * output.cc (Input_section_sort_compare): Remove special ordering
1982 Input_section_sort_section_name_special_ordering_compare::
1983 operator()): New function.
1984 (Output_section::sort_attached_input_sections): Use new sort function
1986 * output.h (Input_section_sort_section_name_special_ordering_compare):
1988 * testsuite/Makefile.am (text_section_grouping): Test option
1990 * testsuite/Makefile.in: Regenerate.
1991 * testsuite/text_section_grouping.sh: Check order of functions without
1992 default text reordering.
1994 2013-01-18 Mike Frysinger <vapier@gentoo.org>
1996 * options.h (General_options): Change default to true for new_dtags.
1998 2013-01-18 Mike Frysinger <vapier@gentoo.org>
2000 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2001 when enable_new_dtags is false. Only add DT_RUNPATH when
2002 enable_new_dtags is true.
2004 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2006 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2007 used in declaration and definition consistent.
2008 (Target_powerpc::symval_for_branch): Ditto.
2010 2013-01-16 Sriraman Tallam <tmsriram@google.com>
2012 * testsuite/plugin_final_layout.cc: Fix comment.
2014 2013-01-16 Sriraman Tallam <tmsriram@google.com>
2016 * layout.cc (Layout::layout): Do not do default sorting for
2017 text sections when section ordering is specified.
2018 (make_output_section): Ditto.
2019 * testsuite/plugin_final_layout.cc: Name the function sections
2020 to catch reordering issues.
2022 2013-01-15 Alan Modra <amodra@gmail.com>
2024 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2027 2013-01-15 Alan Modra <amodra@gmail.com>
2029 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2030 * testsuite/Makefile.in: Regenerate.
2032 2013-01-14 Alan Modra <amodra@gmail.com>
2034 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2035 * testsuite/Makefile.in: Regenerate.
2037 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2040 Fix mingw gold build with plugins enabled
2041 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2042 * configure.ac: Export DLOPEN_LIBS and add headers check.
2043 * plugin.cc: Handle non-dlfcn case.
2044 * Makefile.in: Regenerate.
2045 * config.in: Regenerate.
2046 * configure: Regenerate.
2047 * testsuite/Makefile.in: Regenerate.
2049 2013-01-09 Sriraman Tallam <tmsriram@google.com>
2051 * output.h (sort_attached_input_sections): Change to be public.
2052 * script-sections.cc
2053 (Output_section_definition::set_section_addresses): Sort
2054 attached input sections according to section order before linker
2055 script assigns section addresses.
2056 (Orphan_output_section::set_section_addresses): Sort
2057 attached input sections according to section order before linker
2058 script assigns section addresses.
2059 * Makefile.am (final_layout.sh): Use a simple linker script to
2060 check if section ordering still works.
2061 * Makefile.in: Regenerate.
2063 2013-01-09 Ben Cheng <bccheng@google.com>
2065 * arm.cc (Target_arm::attributes_accept_div): New function.
2066 (Target_arm::attributes_forbid_div): New function.
2067 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2068 attribute using the same new functions as what bfd/elf32_arm.c
2071 2013-01-07 Cary Coutant <ccoutant@google.com>
2074 * output.cc (Output_section::add_input_section): For incremental
2075 updates, don't track input sections that are allocated from patch
2078 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2079 Ian Lance Taylor <iant@google.com>
2082 * configure.ac (--enable-ld): Removed.
2083 (install_as_default): Set to yes only for --enable-gold=default
2085 * configure: Regenerated.
2087 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2089 * options.h (General_options): Add -fuse-ld= for GCC linker
2090 option compatibility.
2092 2013-01-04 Cary Coutant <ccoutant@google.com>
2094 * configure.ac: Fix typo restoring CXXFLAGS.
2095 * configure: Regenerate.
2097 2013-01-04 Cary Coutant <ccoutant@google.com>
2099 * testsuite/Makefile.am (CXXLINK_S): New macro.
2100 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2101 * testsuite/Makefile.in: Regenerate.
2103 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2105 * version.cc (print_version): Update copyright year to 2013.
2107 2012-12-20 Ian Lance Taylor <iant@google.com>
2109 * layout.cc (Layout::special_ordering_of_input_section): New
2111 (Layout::layout): If input section requires special ordering, must
2112 sort input sections.
2113 (Layout::make_output_section): May sort .text input sections.
2114 (Layout::is_section_name_prefix_grouped): Remove.
2115 * layout.h (class Layout): Declare
2116 special_ordering_of_input_section. Don't declare
2117 is_section_name_prefix_grouped.
2118 * output.cc (Output_section::add_input_section): Revert last
2120 (Output_section::Input_section_sort::match_file_name): Don't crash
2121 if called on output section data.
2122 (Output_section::Input_section_sort_compare): Sort based on
2124 (Output_section::Input_section_sort_section_order_index_compare):
2126 (Output_section::sort_attached_input_sections): Likewise.
2128 2012-12-18 Sriraman Tallam <tmsriram@google.com>
2130 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
2131 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2132 * output.cc (Output_section::add_input_section): Check if section
2133 name contains special prefix. Keep input sections to sort such
2135 (Output_section::Input_section_sort_section_order_index_compare
2136 ::operator()): Group sections according to prefixes.
2137 (Output_section::sort_attached_input_sections): Add condition to
2138 Input_section_entry constructor call.
2139 * testsuite/Makefile.am (text_section_grouping): New test.
2140 * testsuite/Makefile.in: Regenerate.
2141 * testsuite/text_section_grouping.cc: New file.
2142 * testsuite/text_section_grouping.sh: New file.
2144 2012-12-17 Nick Clifton <nickc@redhat.com>
2146 * Makefile.am: Add copyright notice.
2149 * configure.ac: Likewise.
2150 * ftruncate.c: Likewise.
2151 * Makefile.in: Regenerate.
2153 2012-12-14 Cary Coutant <ccoutant@google.com>
2155 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2156 --no-as-needed flag.
2157 (exception_separate_shared_12_test): Likewise.
2158 (incremental_copy_test): Likewise.
2159 * testsuite/Makefile.in: Regenerate.
2161 2012-12-14 Cary Coutant <ccoutant@google.com>
2163 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2164 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2166 2012-12-12 Alan Modra <amodra@gmail.com>
2168 * powerpc.cc (class Track_tls): New.
2169 (class Relocate, class Scan): Inherit Track_tls.
2170 (Target_powerpc::Scan::local, global): Track tls optimization
2171 and avoid creating plt entry for __tls_get_addr if all uses
2173 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2175 2012-12-12 Alan Modra <amodra@gmail.com>
2177 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2178 Replace no_toc_optimize with toc_optimize.
2179 * output.h (Output_section::input_sections): Provide non-const variant.
2180 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2181 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2183 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2184 (class Sort_toc_sections): New.
2185 (Target_powerpc::do_finalize_sections): Sort toc sections.
2186 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2188 2012-12-10 Roland McGrath <mcgrathr@google.com>
2190 * testsuite/binary_unittest.cc (read_all): New function.
2191 (Sized_binary_test): Use it instead of ::read.
2192 * fileread.cc (do_read): Don't assume pread always reads the whole
2193 amount in a single call.
2195 2012-12-10 Alan Modra <amodra@gmail.com>
2197 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2198 Set EM_PPC64 or EM_PPC here.
2199 (Target_selector_powerpc::do_recognize): Delete.
2201 2012-12-10 Alan Modra <amodra@gmail.com>
2203 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2205 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2207 2012-12-07 Roland McGrath <mcgrathr@google.com>
2209 * testsuite/binary_unittest.cc (Sized_binary_test):
2210 Use open_descriptor rather than ::open.
2212 2012-12-07 Alan Modra <amodra@gmail.com>
2214 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2215 typedef and invalid_address constant.
2216 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2217 instantiate constants.
2219 2012-12-06 Roland McGrath <mcgrathr@google.com>
2221 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2222 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2223 * aclocal.m4: Regenerate.
2224 * configure: Regenerate.
2225 * Makefile.in: Regenerate.
2226 * testsuite/Makefile.in: Regenerate.
2228 2012-12-07 Alan Modra <amodra@gmail.com>
2230 * options.h (General_options): Add no_toc_optimize.
2231 * powerpc.cc (ok_lo_toc_insn): New function.
2232 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2234 2012-12-06 Alan Modra <amodra@gmail.com>
2236 * options.h (General_options): Add plt_align, plt_static_chain,
2237 plt_thread_safe. Update stub_group_size help text.
2238 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2239 for new plt_thread_safe_ var.
2240 (use_plt_offset): Correct comments.
2241 (Target_powerpc::do_relax): Look for thread creation symbols to
2242 determine default plt_thread_safe value. Clear plt call stubs
2243 as well as branch stubs each iteration.
2244 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2246 (l, hi, ha, write_insn): Move earlier.
2247 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2248 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2250 (Stub_table::update_size): Adjust.
2251 (Stub_table::prev_size, set_prev_size): Delete.
2252 (Stub_table::stub_align): Let --plt-align affect result.
2253 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2254 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2255 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2256 (Stub_table::do_write): Support more stub variants.
2258 2012-12-04 Alan Modra <amodra@gmail.com>
2260 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2261 (Target_powerpc::do_define_standard_symbols): New function.
2263 2012-12-03 Alan Modra <amodra@gmail.com>
2265 * output.h: Formatting, whitespace.
2267 2012-12-03 Alan Modra <amodra@gmail.com>
2269 * layout.h (Layout::get_executable_sections): Declare.
2270 * layout.cc (Layout::get_executable_sections): New function.
2271 * arm.cc (Target_arm::group_sections): Use it.
2272 (Arm_output_section::group_sections): Delete now redundant test.
2273 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2274 param to handle relative relocs.
2275 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2276 (Output_data_reloc::add_absolute): Adjust.
2277 (Output_data_reloc::add_relative): New function.
2278 (Output_data::reset_data_size): New function.
2279 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2280 (Output_section::set_addralign): New function.
2281 (Output_section::checkpoint_set_addralign): New function.
2282 (Output_section::clear_section_offsets_need_adjustment): New function.
2283 (Output_section::input_sections): Make public.
2284 * powerpc.cc (class Output_data_brlt_powerpc): New.
2285 (class Stub_table, class Stub_control): New.
2286 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2287 stub_table_, set_stub_table, stub_table): New vectors and accessor
2289 (Target_powerpc::do_may_relax, do_relax, push_branch,
2290 new_stub_table, stub_tables, brlt_section, group_sections,
2291 add_branch_lookup_table, find_branch_lookup_table,
2292 write_branch_lookup_table, make_brlt_section): New functions.
2293 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2294 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2295 branch_info_): New vars.
2296 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2297 make call stubs here.
2298 (Output_data_glink): Remove all call stub handling from this class.
2299 (Target_powerpc::Scan::local, global): Save interesting branch
2300 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2301 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2302 functions on final link.
2303 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2304 Handle long branch destinations too.
2305 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2306 do_plt_address_for_local): Adjust lookup of plt call stubs.
2308 2012-11-30 Alan Modra <amodra@gmail.com>
2310 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2311 relocs against protected symbols when building 32-bit shared libs.
2313 2012-11-30 Alan Modra <amodra@gmail.com>
2315 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2316 param. Call got_section() to make .got. Update all callers
2317 and their callers and so on.
2319 2012-11-30 Alan Modra <amodra@gmail.com>
2321 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2322 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2323 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2324 value if it already exists.
2326 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2329 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2331 2012-11-14 Roland McGrath <mcgrathr@google.com>
2333 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2334 than bfc instruction for data sandboxing.
2336 2012-11-08 Alan Modra <amodra@gmail.com>
2338 * po/POTFILES.in: Regenerate.
2340 2012-11-05 Alan Modra <amodra@gmail.com>
2342 * configure.ac: Apply 2012-09-10 change to config.in here.
2343 * configure: Regenerate.
2345 2012-11-05 Alan Modra <amodra@gmail.com>
2347 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2348 (struct Opd_ent): Use "Address" rather than "Offset".
2349 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2350 (Target_powerpc::got_section): Make public.
2351 (Target_powerpc::scan_relocs): Move code setting symbols..
2352 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2353 Create _SDA_BASE_ only when referenced.
2355 2012-11-02 Roland McGrath <mcgrathr@google.com>
2357 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2360 2012-11-01 Roland McGrath <mcgrathr@google.com>
2362 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2363 for offset_in_output_section parameter.
2364 (Sized_target::relocate_special_relocatable): Likewise.
2365 * arm.cc (Target_arm::relocate_relocs): Likewise.
2366 (Target_arm::relocate_special_relocatable): Likewise.
2367 * i386.cc (Target_i386::relocate_relocs): Likewise.
2368 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2369 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2370 * target-reloc.h (relocate_relocs): Likewise.
2371 * testsuite/testfile.cc (Target_test): Likewise.
2372 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2373 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2375 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2376 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2378 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2379 parameter, which is unused in the [!F_SETFD] case.
2381 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2382 SYMNDX to off_t before comparing it to this->data_size().
2383 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2384 * incremental.cc (Output_section_incremental_inputs::do_write):
2385 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2387 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2389 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2391 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2392 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2395 2012-10-29 Cary Coutant <ccoutant@google.com>
2397 * dwp.cc (usage): Add file and exit status parameters;
2398 add --help and --version options.
2399 (print_version): New function.
2400 (main): Add --help and --version options.
2402 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2404 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2405 final_layout_sequence.txt.
2406 * testsuite/Makefile.in: Regenerated.
2408 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2410 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2411 COMPILE generated by automake.
2413 (CXXCOMPILE1): Likewise.
2414 (CXXLINK1): Likewise.
2415 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2417 (CXXCOMPILE): Likewise.
2418 (CXXLINK): Likewise.
2419 * testsuite/Makefile.in: Regenerated.
2421 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2423 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2424 on bad fwrite return.
2426 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2428 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2431 2012-10-23 Cary Coutant <ccoutant@google.com>
2433 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2434 * testsuite/Makefile.in: Regenerate.
2435 * testsuite/dwp_test.h: New source file.
2436 * testsuite/dwp_test_1.cc: New source file.
2437 * testsuite/dwp_test_1.s: New source file.
2438 * testsuite/dwp_test_1.sh: New source file.
2439 * testsuite/dwp_test_1b.cc: New source file.
2440 * testsuite/dwp_test_1b.s: New source file.
2441 * testsuite/dwp_test_2.cc: New source file.
2442 * testsuite/dwp_test_2.s: New source file.
2443 * testsuite/dwp_test_2.sh: New source file.
2444 * testsuite/dwp_test_main.cc: New source file.
2445 * testsuite/dwp_test_main.s: New source file.
2447 2012-10-23 Cary Coutant <ccoutant@google.com>
2449 * dwp.h: New header file.
2450 * dwp.cc: New source file.
2451 * gold.h: Move shared declarations to system.h.
2452 * system.h: New header file.
2453 * Makefile.am: Add dwp.
2454 * Makefile.in: Regenerate.
2456 2012-10-23 Cary Coutant <ccoutant@google.com>
2458 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2459 Dwarf_info_reader::read_from_pointer.
2460 (Dwarf_pubnames_table::read_header): Likewise.
2461 (Dwarf_pubnames_table::next_name): Likewise.
2462 (Dwarf_die::read_attributes): Likewise.
2463 (Dwarf_die::skip_attributes): Likewise.
2464 (Dwarf_info_reader::read_from_pointer): New function template.
2465 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2466 (Dwarf_pubnames_table): Likewise.
2467 (Dwarf_info_reader::read_from_pointer): New function template.
2468 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2469 Dwarf_pubnames_table ctor.
2471 2012-10-23 Cary Coutant <ccoutant@google.com>
2473 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2475 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2477 (Dwarf_info_reader::set_abbrev_shndx): New method.
2478 (Dwarf_info_reader::abbrev_shndx_): New data member.
2480 2012-10-23 Cary Coutant <ccoutant@google.com>
2482 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2483 from object, not parameters.
2484 (Dwarf_info_reader::parse): Likewise.
2485 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2486 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2487 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2490 2012-10-23 Cary Coutant <ccoutant@google.com>
2492 * fileread.cc (Input_file::Input_file): New constructor.
2493 * fileread.h (class Input_file): Add new constructor.
2495 2012-10-18 Alan Modra <amodra@gmail.com>
2498 * object.cc (Relobj::is_section_name_included): Also match
2499 .sdata personality section.
2501 2012-10-18 Alan Modra <amodra@gmail.com>
2503 * target-reloc.h (class Default_comdat_behavior): New, package up..
2504 (get_comdat_behaviour): ..this.
2505 (relocate_section): Add Relocate_comdat_behavior template arg,
2506 adjust code to suit.
2507 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2508 (Target_arm::scan_reloc_section): Likewise.
2509 * i386.cc (Target_i386::relocate_section): Likewise.
2510 * sparc.cc (Target_sparc::relocate_section): Likewise.
2511 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2512 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2513 * powerpc.cc (class Relocate_comdat_behavior): New.
2514 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2515 gold::relocate_section with new template arg.
2517 2012-10-18 Alan Modra <amodra@gmail.com>
2519 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2520 dynamic relocs for GOT_TPREL got entries, without symbol if
2522 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2523 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2524 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2526 2012-10-17 Alan Modra <amodra@gmail.com>
2529 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2531 2012-10-16 Sriraman Tallam <tmsriram@google.com>
2533 * layout.cc (Layout::include_section): Keep sections marked
2534 SHF_EXCLUDE when doing relocatable links.
2536 2012-10-16 Alan Modra <amodra@gmail.com>
2538 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2539 (Target_powerpc::do_finalize_sections): Call it.
2540 (Output_data_save_res): New class and supporting functions.
2541 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2542 normal symbols defined in object files.
2544 2012-10-12 Alan Modra <amodra@gmail.com>
2546 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2547 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2548 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2549 section if scan_opd_relocs not yet called.
2550 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2552 2012-10-12 Alan Modra <amodra@gmail.com>
2554 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2555 add_local_ifunc_entry): Revert last change.
2556 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2558 2012-10-05 Alan Modra <amodra@gmail.com>
2560 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2561 do_plt_address_for_global): New functions.
2562 (Output_data_got_powerpc::do_write): Don't segfault when linking
2564 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2565 add_local_ifunc_entry): Return true on adding entry..
2566 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2567 glink->add_entry call. Remove unused symtab param. Adjust calls.
2568 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2569 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2570 set up symbols here.
2571 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2572 syms here. Do so even when no .iplt. Don't segfault when linking
2574 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2575 new variants without reloc param.
2576 (Glink_sym_ent::Glink_sym_ent): Likewise.
2577 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2578 reloc when refs will resolve to plt call stub.
2579 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2580 R_PPC_PLTREL24 to resolve locally.
2581 (Target_powerpc::Scan::global): Correct ifunc handling.
2582 (Target_powerpc::Relocate::relocate): Correct local sym glink
2583 lookup. Don't destroy "value" when we have a plt call stub,
2584 and when checking plt call validity.
2585 (Target_powerpc::do_dynsym_value): Simplify.
2587 2012-10-05 Alan Modra <amodra@gmail.com>
2589 * i386.cc (Output_data_plt_i386::address_for_global,
2590 address_for_local): Add plt offset to returned value. Adjust uses.
2591 * sparc.cc (Output_data_plt_sparc::address_for_global,
2592 address_for_local): Likewise.
2593 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2594 address_for_local): Likewise.
2595 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2596 address_for_local): Likewise.
2597 * target.h (Target::plt_address_for_global, plt_address_for_local):
2599 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2600 (Output_data_got::Got_entry::write): Nor here.
2601 * output.h: Comment fix.
2603 2012-10-02 Jiong Wang <jiwang@tilera.com>
2605 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2606 global_offset_table_ value for larget got.
2607 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2609 2012-09-29 Alan Modra <amodra@gmail.com>
2611 * powerpc.cc (Target_powerpc::iplt_): New output section.
2612 (Target_powerpc::iplt_section, make_iplt_section,
2613 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2614 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2615 Target_powerpc::plt_entry_count): Count iplt entries too.
2616 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2617 reloc section in constructor. New params.
2618 (Target_powerpc::make_plt_section): Create reloc section here instead.
2619 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2621 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2622 (Output_data_glink::add_entry, find_entry): New functions to
2623 deal with local syms.
2624 (Glink_sym_ent): Add support for local syms.
2625 (Output_data_glink::do_write): Handle ifunc plt entries.
2626 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2627 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2628 (Target_powerpc::Relocate::relocate): Likewise.
2629 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2631 2012-09-25 Alan Modra <amodra@gmail.com>
2633 * object.h (Sized_relobj_file::adjust_local_symbol,
2634 do_adjust_local_symbol): New functions.
2635 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2636 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2637 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2638 and irregular opd entry spacing.
2639 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2640 (Global_symbol_visitor_opd): New functor.
2641 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2642 on deleted opd entries.
2644 2012-09-15 Jiong Wang <jiwang@tilera.com>
2646 * tilegx.cc: New file.
2647 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2648 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2649 * configure.tgt: Add entries for tilegx*.
2650 * configure.ac: Likewise.
2651 * Makefile.in: Rebuild.
2652 * configure: Likewise.
2653 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2656 2012-09-13 Alan Modra <amodra@gmail.com>
2658 * target-reloc.h (scan_relocs): Call scan.local for relocs
2659 against symbols in discarded sections. Pass is_discarded
2661 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2662 Add is_discarded param.
2663 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2664 is_discarded to flag opd entry as discarded. Don't emit dyn
2665 relocs on such entries.
2666 (Target_powerpc::Scan::global): Similarly detect and handle
2668 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2669 opd_ent_. Update all uses.
2670 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2671 (Target_powerpc::relocate_section): Zero out discarded opd
2674 2012-09-12 Ian Lance Taylor <iant@google.com>
2677 * output.cc: Rename Output_data_got template parameter from size
2678 to got_size for all functions. Compile all variants of
2680 (Output_data_got::Got_entry::write): Correct use of size for
2681 symbol value. Use local_is_tls rather than casting to
2683 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2684 (class Sized_relobj_file): Add do_local_is_tls.
2685 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2687 2012-09-11 Alan Modra <amodra@gmail.com>
2690 * layout.cc (Layout::set_segment_offsets): When using
2691 common-page-size alignment, ensure we are on a new max-page-size
2693 * output.cc (Output_segment::set_section_addresses): Use
2694 abi_pagesize, not common_pagesize for relro boundary.
2695 (Output_segment::set_offset): Likewise.
2697 2012-09-11 Alan Modra <amodra@gmail.com>
2699 * output.h (Output_data_got::add_global_tls, add_local_tls,
2700 add_local_tls_pair): New functions.
2701 (Output_data_got::add_local_pair_with_rel): Remove second
2702 reloc param. Expand comment.
2703 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2704 use_plt_or_tls_offset_, similarly for constructor param.
2705 (Output_data_got::Got_entry::write): Add got_index param.
2706 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2707 add_local_tls_pair): New functions.
2708 (Output_data_got::Got_entry::write): Handle tls symbols
2709 with use_plt_or_tls_offset_ set specially.
2710 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2711 (Output_data_got::do_write): Replace iterator with index, pass
2712 index to entry write function.
2713 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2714 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2715 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2717 * i386.cc (Target_i386::Scan::local): Likewise.
2718 * sparc.cc (Target_sparc::Scan::local): Likewise.
2719 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2720 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2721 do_tls_offset_for_global): New functions.
2722 (Target_powerpc::Scan::local): Correct TLS relocations and got
2724 (Target_powerpc::Scan::global): Don't emit unnecessary
2725 dynamic relocations on TLS GOT entries.
2727 2012-09-10 Matthias Klose <doko@ubuntu.com>
2729 * config.in: Disable sanity check for kfreebsd.
2731 2012-09-10 Sterling Augustine <saugustine@google.com>
2733 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2734 (Gdb_index::pubtypes_read): New parameter.
2735 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2737 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2740 2012-09-09 Alan Modra <amodra@gmail.com>
2742 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2743 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2744 * gc.h (gc_process_relocs): Call target gc_add_reference.
2745 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2746 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2747 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2749 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2750 to cater for when we don't need code offset. Update use.
2751 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2752 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2753 set_opd_valid): New functions.
2754 (Target_powerpc::do_gc_add_reference): New function.
2755 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2757 (Target_powerpc::do_gc_mark_symbol): New function.
2759 2012-09-06 Cary Coutant <ccoutant@google.com>
2761 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2762 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2763 (Dwarf_die::skip_attributes): Likewise.
2764 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2765 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2767 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2769 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2771 * testsuite/script_test_3.t: Add .got.plt output section
2773 * testsuite/script_test_4.t: Likewise.
2775 2012-09-05 Alan Modra <amodra@gmail.com>
2777 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2778 update all uses and lose "enum" when using type.
2780 2012-09-05 Alan Modra <amodra@gmail.com>
2782 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2783 * configure: Regenerate.
2784 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2785 (plugin_final_layout.stdout): Likewise.
2786 (memory_test): Set page sizes to 0x1000.
2787 * testsuite/Makefile.in: Regenerate.
2788 * testsuite/discard_locals_test.sh: Add FIXME comment.
2789 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2790 * testsuite/pr14265.t: Add .got output section statement.
2791 * testsuite/script_test_2.t: Likewise.
2792 * testsuite/script_test_3.t: Likewise.
2793 * testsuite/script_test_4.t: Likewise.
2794 * testsuite/script_test_5.t: Likewise.
2795 * testsuite/script_test_6.t: Likewise.
2796 * testsuite/script_test_7.t: Likewise.
2797 * testsuite/script_test_9.t: Likewise.
2799 2012-09-05 Alan Modra <amodra@gmail.com>
2801 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2802 (Powerpc_relocate_functions::Status): New typedef.
2803 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2804 (Target_powerpc::Scan::local): Handle REL64.
2805 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2806 for REL32 and REL64.
2807 (Target_powerpc::symval_for_branch): New function, extracted from..
2808 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2809 checks. Report overflow errors.
2811 2012-09-05 Alan Modra <amodra@gmail.com>
2813 * object.h (Sized_relobj_file::emit_relocs): Delete.
2814 (Sized_relobj_file::emit_relocs_reltype): Delete.
2815 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2816 relocate_relocs for --emit-relocs.
2817 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2818 * output.h: Update comment.
2819 (Output_segment::first_section): New function.
2820 (Output_segment::first_section_load_address): Use first_section.
2821 * output.cc (Output_segment::first_section): New function extracted..
2822 (Output_segment::first_section_load_address): ..from here. Delete.
2823 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2824 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2825 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2826 adjust call to target.h function.
2827 * i386.cc (Target_i386): Likewise.
2828 * sparc.cc (Target_sparc): Likewise.
2829 * x86_64.cc (Target_x86_64): Likewise.
2830 * powerpc.cc (Target_powerpc): Likewise.
2831 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2832 first tls section has section symbol for optimised local dynamic
2834 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2835 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2837 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2838 Rename to relocate_relocs. Update error message.
2840 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2842 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2845 2012-08-31 Alan Modra <amodra@gmail.com>
2847 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2848 (Powerpc_relobj::toc_base_offset): New stub function.
2849 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2850 got_mod_index_offset to tlsld_got_offset. Update all refs.
2851 (Target_powerpc::Relocate::enum skip_tls): New.
2852 (Target_powerpc::call_tls_get_addr_): New var.
2853 (Target_powerpc::is_branch_reloc): Move to file scope.
2854 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2855 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2857 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2858 (powerpc_info): Correct common_pagesize for ppc64.
2859 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2860 (Powerpc_relocate_functions): Add overflow check enums and functions.
2861 Add non-shift version of rela, rela_ua. Delete all rel public
2862 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2863 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2864 addr16_ha3, addr14 functions.
2865 (Output_data_got_powerpc::add_constant_pair): New function.
2866 (Output_data_got_powerpc::got_base_offset): Likewise.
2867 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2868 (instruction constants): Sort, add some more.
2869 (Output_data_glink::do_write): Add and use Address typedef. Use
2870 object->toc_base_offset() stub for 64-bit.
2871 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2872 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2873 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2874 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2875 Always treat .opd relocs as against locally defined symbol.
2876 Correct condition for RELATIVE relocs.
2877 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2878 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2879 for 32-bit syms with a plt entry. Correct ppc64 toc base
2880 calculations. Handle TLS relocs, and more. Add overflow
2881 checking and adjust for Powerpc_relocate_functions changes.
2882 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2883 Reinstate --emit-relocs code with FIXME.
2885 2012-08-30 Alan Modra <amodra@gmail.com>
2887 * layout.cc (Layout::set_segment_offsets): Set p_align to
2888 abi_pagesize, not common_pagesize.
2889 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2890 to determine whether file header can go in segment.
2892 2012-08-30 Alan Modra <amodra@gmail.com>
2894 * output.h (Output_reloc::Output_reloc <output section>): Add
2895 is_relative param. Adjust calls.
2896 (Output_reloc::add_output_section_relative): New functions.
2897 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2899 (Output_reloc::symbol_value): Handle SECTION_CODE.
2901 2012-08-24 Sriraman Tallam <tmsriram@google.com>
2903 * gold.cc (queue_middle_tasks): Call layout again when unique
2904 segments for sections is desired.
2905 * layout.cc (Layout::Layout): Initialize new members.
2906 (Layout::get_output_section_flags): New function.
2907 (Layout::choose_output_section): Call get_output_section_flags.
2908 (Layout::layout): Make output section for mapping to a unique segment.
2909 (Layout::insert_section_segment_map): New function.
2910 (Layout::attach_allocated_section_to_segment): Make unique segment for
2911 output sections marked so.
2912 (Layout::segment_precedes): Check for unique segments when sorting.
2913 * layout.h (Layout::Unique_segment_info): New struct.
2914 (Layout::Section_segment_map): New typedef.
2915 (Layout::insert_section_segment_map): New function.
2916 (Layout::get_output_section_flags): New function.
2917 (Layout::is_unique_segment_for_sections_specified): New function.
2918 (Layout::set_unique_segment_for_sections_specified): New function.
2919 (Layout::unique_segment_for_sections_specified_): New member.
2920 (Layout::section_segment_map_): New member.
2921 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2922 Rename is_gc_pass_one to is_pass_one.
2923 Rename is_gc_pass_two to is_pass_two.
2924 Rename is_gc_or_icf to is_two_pass.
2925 Check for which pass based on whether symbols data is present.
2926 Make it two pass when unique segments for sections is desired.
2927 * output.cc (Output_section::Output_section): Initialize new
2929 * output.h (Output_section::is_unique_segment): New function.
2930 (Output_section::set_is_unique_segment): New function.
2931 (Output_section::is_unique_segment_): New member.
2932 (Output_section::extra_segment_flags): New function.
2933 (Output_section::set_extra_segment_flags): New function.
2934 (Output_section::extra_segment_flags_): New member.
2935 (Output_section::segment_alignment): New function.
2936 (Output_section::set_segment_alignment): New function.
2937 (Output_section::segment_alignment_): New member.
2938 (Output_segment::Output_segment): Initialize is_unique_segment_.
2939 (Output_segment::is_unique_segment): New function.
2940 (Output_segment::set_is_unique_segment): New function.
2941 (Output_segment::is_unique_segment_): New member.
2942 * plugin.cc (allow_unique_segment_for_sections): New function.
2943 (unique_segment_for_sections): New function.
2944 (Plugin::load): Add new functions to transfer vector.
2945 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2946 * Makefile.in: Regenerate.
2947 * testsuite/plugin_final_layout.sh: Check if unique segment
2948 functionality works.
2949 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2951 (allow_unique_segment_for_sections): New global.
2952 (unique_segment_for_sections): New global.
2953 (claim_file_hook): Call allow_unique_segment_for_sections.
2954 (all_symbols_read_hook): Call unique_segment_for_sections.
2956 2012-08-22 Cary Coutant <ccoutant@google.com>
2958 * layout.cc (Layout::include_section): Don't assert on GROUP
2959 sections with --emit-relocs.
2961 2012-08-21 Cary Coutant <ccoutant@google.com>
2963 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2964 if --export-dynamic-symbol names an undef symbol.
2966 2012-08-18 Alan Modra <amodra@gmail.com>
2968 * powerpc.cc: Formatting and white space.
2969 (Powerpc_relobj): Rename got2_section_ to special_.
2970 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2971 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2972 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2973 (Target_powerpc): Add Address typedef and invalid_address. Use
2975 (Target_powerpc::is_branch_reloc): New function.
2976 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2977 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2978 for dst_mask, value and addend.
2979 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2980 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2981 (Output_data_glink::do_write): Correct toc base. Don't try to use
2982 uint16_t for 24-bit offset. Use get_output_section_offset and
2984 (Target_powerpc::Scan::local): Handle more relocs.
2985 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2986 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2987 Plug in toc restoring insn after plt calls. Translate branches
2988 to function descriptor symbols to corresponding entry point.
2989 (Target_powerpc::relocate_for_relocatable): Check return from
2990 get_output_section_offset.
2991 * symtab.h: Comment typo.
2993 2012-08-14 Ian Lance Taylor <iant@google.com>
2995 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2996 unsupported_relocal_local to call unsupported_reloc_global.
2998 2012-08-14 Nick Clifton <nickc@redhat.com>
3001 * script-sections.cc (Sections_element::output_section_name): Add
3002 keep return parameter.
3003 (Output_section_element::match_name): Add keep return parameter.
3004 Return the value of the keep_ member.
3005 * script-sections.h (class Output_section): Update
3006 output_section_name prototype.
3007 * layout.cc (Layout::keep_input_section): New public member
3009 (Layout::choose_output_section): Pass keep parameter to
3010 output_section_name.
3011 * layout.h (class Layout): Add keep_input_section.
3012 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3014 * testsuite/Makefile.am: Add a test.
3015 * testsuite/Makefile.in: Regenerate.
3016 * testsuite/pr14265.c: Source file for the test.
3017 * testsuite/pr14265.t: Linker script for the test.
3018 * testsuite/pr14265.sh: Shell script for the test.
3020 2012-08-14 Alan Modra <amodra@gmail.com>
3022 * target.h (Target::output_section_name): New function.
3023 (Target::do_output_section_name): New function.
3024 * layout.cc (Layout::choose_output_section): Call the above.
3025 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3027 2012-08-14 Alan Modra <amodra@gmail.com>
3029 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3030 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3031 for replace_constant call.
3032 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3033 (Output_data_glink::do_print_to_mapfile): New function.
3034 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3035 (Target_powerpc::Relocate::relocate): Likewise.
3037 2012-08-14 Alan Modra <amodra@gmail.com>
3039 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3040 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3041 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3042 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3043 all references to shndx_. Handle special case for R_PPC_PLTREL24
3045 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3046 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3047 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3049 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3050 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3052 2012-08-12 Alan Modra <amodra@gmail.com>
3054 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3055 (glink insn constants): Use uint32_t.
3056 (Output_data_glink::add_entry): Use insert, not [] operator.
3058 2012-08-11 Alan Modra <amodra@gmail.com>
3060 * object.h (Sized_relobj_file::find_shdr): New function.
3061 (Sized_relobj_file::find_special_sections): New function.
3062 * object.cc (Sized_relobj_file::find_shdr): New function.
3063 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3064 (Sized_relobj_file::find_special_sections): New function, split out..
3065 (Sized_relobj_file::do_read_symbols): ..from here.
3066 * output.h (Output_data_got::replace_constant): New function.
3067 (Output_data_got::num_entries): New function.
3068 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3069 (Output_data_got::got_offset): Protected rather than private.
3070 (Output_data_got::replace_got_entry): New function.
3071 * output.cc (Output_data_got::replace_got_entry): New function.
3072 * powerpc.cc (class Powerpc_relobj): New.
3073 (class Powerpc_relocate_functions): Delete all psymval variants or
3074 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3075 Implement _ha functions using corresponding _hi function.
3076 (Powerpc_relobj::find_special_sections): New function.
3077 (Target_powerpc::do_make_elf_object): New function.
3078 (class Output_data_got_powerpc): New.
3079 (class Output_data_glink): New.
3080 (class Powerpc_scan_relocatable_reloc): New.
3081 Many more changes througout file.
3083 2012-08-09 Nick Clifton <nickc@redhat.com>
3085 * po/vi.po: Updated Vietnamese translation.
3087 2012-08-07 Ian Lance Taylor <iant@google.com>
3089 * layout.cc (Layout::add_target_dynamic_tags): If
3090 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3093 2012-07-30 Nick Clifton <nickc@redhat.com>
3095 * po/gold.pot: Updated template.
3096 * po/es.po: Updated Spanish translation.
3098 2012-07-18 Cary Coutant <ccoutant@google.com>
3101 * configure.ac: Add check for -gpubnames support.
3102 * configure: Regenerate.
3103 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3104 support; force -gno-pubnames.
3105 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3107 (gdb_index_test_4): New test.
3108 * testsuite/Makefile.in: Regenerate.
3109 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3110 * testsuite/gdb_index_test_2.sh: Likewise.
3111 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3112 * testsuite/gdb_index_test_4.sh: New script.
3113 * testsuite/gdb_index_test_comm.sh: New script with common code;
3114 don't look for space after colon.
3116 2012-07-16 Sriraman Tallam <tmsriram@google.com>
3118 * gold.cc (queue_middle_tasks): Update function order only after
3119 deferred objects due to plugins are processed.
3121 2012-07-11 Ian Lance Taylor <iant@google.com>
3123 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3124 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3125 (Target_arm::scan_reloc_for_stub): Likewise.
3126 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3127 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3128 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3129 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3130 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3132 2012-07-10 Dodji Seketeli <dodji@redhat.com>
3133 Ian Lance Taylor <iant@google.com>
3136 * configure.ac: Test whether std::tr1::hash<off_t> works.
3137 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3139 * output.h (class Output_fill): Add virtual destructor.
3140 * configure, config.in: Rebuild.
3142 2012-06-22 Roland McGrath <mcgrathr@google.com>
3144 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3146 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3148 * plugin.cc (Plugin::load): Handle position independent executables.
3150 2012-06-06 Cary Coutant <ccoutant@google.com>
3152 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3154 (lines_only_debug_sections): Likewise.
3155 (gdb_fast_lookup_sections): New static array.
3156 (is_gdb_debug_section): Rename formal parameter.
3157 (is_lines_only_debug_section): Likewise.
3158 (is_gdb_fast_lookup_section): New function.
3159 (Layout::include_section): Check for ".zdebug_" prefix; pass
3160 section name suffix to is_gdb_debug_section, et al.; check for
3161 fast-lookup sections when building .gdb_index.
3162 * options.h (--strip-debug-gdb): Update GDB version number.
3164 2012-06-06 Cary Coutant <ccoutant@google.com>
3166 * configure.ac: Add check for fallocate.
3167 * configure: Regenerate.
3168 * config.in: Regenerate.
3170 * options.h (class General_options): Add --mmap-output-file and
3171 --posix-fallocate options.
3172 * output.cc: (posix_fallocate): Remove; replace with...
3173 (gold_fallocate): New function.
3174 (Output_file::map_no_anonymous): Call gold_fallocate.
3175 (Output_file::map): Check --mmap-output-file option.
3177 2012-06-05 Jing Yu <jingyu@google.com>
3179 * gold.h (textdomain): Add do {} to empty while(0).
3180 (bindtextdomain): Likewise.
3182 2012-06-04 Cary Coutant <ccoutant@google.com>
3184 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3187 2012-05-25 Sriraman Tallam <tmsriram@google.com>
3189 * symtab.cc (Symbol_table::define_special_symbol):
3190 Initialize *poldsym to prevent uninitialized variable errors.
3192 2012-05-23 Cary Coutant <ccoutant@google.com>
3194 * layout.cc (Layout::section_name_mapping): Add rules to handle
3195 exact match on .data.rel.ro.local or .data.rel.ro.
3196 (Layout::output_section_name): Check for exact matches.
3198 2012-05-23 Cary Coutant <ccoutant@google.com>
3200 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3203 2012-05-22 Cary Coutant <ccoutant@google.com>
3205 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3206 object before exporting symbol.
3208 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3210 * testsuite/tls_test.cc: Include "config.h" first.
3211 * testsuite/tls_test_c.c: Likewise.
3213 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
3214 Nick Clifton <nickc@redhat.com>
3217 * configure.in: Add check that sysdep.h has been included before
3218 any system header files.
3219 * configure: Regenerate.
3220 * config.in: Regenerate.
3222 2012-05-14 Cary Coutant <ccoutant@google.com>
3224 * layout.cc (Layout::make_output_section): Mark .tdata section
3226 * testsuite/relro_test.cc: Add a TLS variable.
3228 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3231 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3232 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3235 2012-05-08 Cary Coutant <ccoutant@google.com>
3237 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3238 (lines_only_debug_sections): Likewise.
3240 2012-05-02 Roland McGrath <mcgrathr@google.com>
3242 * nacl.cc: New file.
3244 * Makefile.am (CCFILES, HFILES): Add them.
3245 * Makefile.in: Regenerate.
3246 * i386.cc (Output_data_plt_i386_nacl): New class.
3247 (Output_data_plt_i386_nacl_exec): New class.
3248 (Output_data_plt_i386_nacl_dyn): New class.
3249 (Target_i386_nacl): New class.
3250 (Target_selector_i386_nacl): New class.
3251 (target_selector_i386): Use it instead of Target_selector_i386.
3252 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3253 (Target_x86_64_nacl): New class.
3254 (Target_selector_x86_64_nacl): New class.
3255 (target_selector_x86_64, target_selector_x32): Use it instead of
3256 Target_selector_x86_64.
3257 * arm.cc (Output_data_plt_arm_nacl): New class.
3258 (Target_arm_nacl): New class.
3259 (Target_selector_arm_nacl): New class.
3260 (target_selector_arm, target_selector_armbe): Use it instead of
3261 Target_selector_arm.
3263 * target-select.cc (select_target): Take new Input_file* and off_t
3264 arguments, pass them on to recognize method of selector.
3265 * object.cc (make_elf_sized_object): Update caller.
3266 * parameters.cc (parameters_force_valid_target): Likewise.
3267 * incremental.cc (make_sized_incremental_binary): Likewise.
3268 * target-select.h: Update decl.
3269 (Target_selector::recognize): Take new Input_file* argument,
3270 pass it on to do_recognize.
3271 (Target_selector::do_recognize): Take new Input_file* argument.
3272 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3273 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3274 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3275 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3277 * target.h (Target::Target_info): New members isolate_execinstr
3279 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3280 * arm.cc (Target_arm::arm_info): Update initializer.
3281 * i386.cc (Target_i386::i386_info): Likewise.
3282 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3283 * sparc.cc (Target_sparc::sparc_info): Likewise.
3284 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3285 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3286 * layout.cc (Layout::attach_allocated_section_to_segment):
3287 Take new const Target* argument. If target->isolate_execinstr(), act
3289 (Layout::find_first_load_seg): Take new const Target* argument;
3290 if target->isolate_execinstr(), reject PF_X segments.
3291 (Layout::relaxation_loop_body): Update caller.
3292 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3293 reset file offset to zero when we hit LOAD_SEG, and then do a second
3294 loop over the segments before LOAD_SEG to reassign offsets after
3295 addresses have been determined. Handle target->rosegment_gap().
3296 (Layout::attach_section_to_segment): Take new const Target* argument;
3297 pass it to attach_allocated_section_to_segment.
3298 (Layout::make_output_section): Update caller.
3299 (Layout::attach_sections_to_segments): Take new const Target* argument;
3300 pass it to attach_section_to_segment.
3301 * gold.cc (queue_middle_tasks): Update caller.
3302 * layout.h (Layout): Update method decls with new arguments.
3304 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3305 Target_info pointer to use.
3306 (Target_arm::do_make_data_plt): New virtual method.
3307 (Target_arm::make_data_plt): New method that calls it.
3308 (Target_arm::make_plt_entry): Use it.
3309 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3310 for the section alignment.
3311 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3313 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3314 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3316 (Output_data_plt_arm::get_plt_entry_size): Call it.
3317 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3318 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3319 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3321 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3322 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3323 method instead of sizeof(plt_entry).
3324 (Output_data_plt_arm::add_entry): Likewise.
3325 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3326 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3328 (Target_arm::plt_entry_size): Likewise.
3329 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3331 (Output_data_plt_arm_standard): ... here, new class.
3332 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3333 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3334 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3336 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3337 Take additional argument for the PLT entry size.
3338 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3339 Use get_plt_entry_size method rather than plt_entry_size variable.
3340 (Output_data_plt_x86_64::reserve_slot): Likewise.
3341 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3342 (Output_data_plt_x86_64::add_entry): Likewise.
3343 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3344 (Output_data_plt_x86_64::address_for_global): Likewise.
3345 (Output_data_plt_x86_64::address_for_local): Likewise.
3346 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3347 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3348 Make method non-static.
3349 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3351 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3352 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3353 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3354 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3356 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3357 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3359 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3360 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3362 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3363 (Output_data_plt_x86_64::plt_entry_size)
3364 (Output_data_plt_x86_64::first_plt_entry)
3365 (Output_data_plt_x86_64::plt_entry)
3366 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3367 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3368 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3369 (Output_data_plt_x86_64_standard): ... here, new class.
3370 (Target_x86_64::Target_x86_64): Take optional argument for the
3371 Target_info pointer to use.
3372 (Target_x86_64::do_make_data_plt): New virtual method.
3373 (Target_x86_64::make_data_plt): New method to call it.
3374 (Target_x86_64::init_got_plt_for_update): Use that.
3375 Call this->plt_->add_eh_frame method here.
3376 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3377 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3378 rather than static method.
3379 (Target_x86_64::plt_entry_size): Likewise.
3380 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3381 rather than plt_entry_size variable. Move guts of PLT filling to...
3382 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3383 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3384 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3386 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3387 additional argument for the section alignment.
3388 Don't do add_eh_frame_for_plt here.
3389 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3390 non-static. Use get_plt_entry_size method rather than plt_entry_size
3392 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3394 (Output_data_plt_i386::get_plt_entry_size): Call it.
3395 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3396 (Output_data_plt_i386::add_eh_frame): New method to call it.
3397 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3399 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3400 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3402 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3403 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3404 method instead of plt_entry_size.
3405 (Output_data_plt_i386::plt_entry_size)
3406 (Output_data_plt_i386::plt_eh_frame_fde_size)
3407 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3408 (Output_data_plt_i386_standard): ... here, new class.
3409 (Output_data_plt_i386_exec): New class.
3410 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3411 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3412 (Output_data_plt_i386::exec_plt_entry): Move to ...
3413 (Output_data_plt_i386_exec::plt_entry): ... here.
3414 (Output_data_plt_i386_dyn): New class.
3415 (Output_data_plt_i386::first_plt_entry): Move to ...
3416 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3417 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3418 (Output_data_plt_i386_dyn::plt_entry): ... here.
3419 (Target_i386::Target_i386): Take optional argument for the Target_info
3421 (Target_i386::do_make_data_plt): New virtual method.
3422 (Target_i386::make_data_plt): New method to call it.
3423 (Target_i386::make_plt_section): Use that.
3424 Call this->plt_->add_eh_frame method here.
3425 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3426 rather than plt_entry_size variable.
3427 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3428 (Output_data_plt_i386::address_for_local): Likewise.
3429 (Output_data_plt_i386::do_write): Likewise.
3430 Move guts of PLT filling to...
3431 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3432 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3433 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3434 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3436 2012-05-01 Cary Coutant <ccoutant@google.com>
3438 * dwarf_reader.cc (Dwarf_die::read_attributes)
3439 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3440 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3441 * reduced_debug_output.cc
3442 (Output_reduced_debug_info_section::get_die_end): Remove
3443 DW_FORM_GNU_ref_index. Add default case.
3445 2012-04-26 Mark Wielaard <mjw@redhat.com>
3447 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3448 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3449 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3450 DW_AT_high_pc as offset from DW_AT_low_pc.
3452 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3453 * testsuite/Makefile.in: Regenerate.
3454 * testsuite/gdb_index_test_3.c: New test source file.
3455 * testsuite/gdb_index_test_3.sh: New test source file.
3457 2012-04-25 Ian Lance Taylor <iant@google.com>
3459 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3461 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3462 as a class, not a struct.
3463 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3464 (Target_arm::apply_cortex_a8_workaround): Likewise.
3465 * gc.h: Declare Reloc_types as a struct, not a class.
3466 * object.h: Declare Symbols_data as a struct.
3467 * reloc.h: Declare Read_relocs_data as a struct.
3468 * target.h: Declare Relocate_info as a struct.
3470 2012-04-24 David S. Miller <davem@davemloft.net>
3472 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3473 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3476 2012-04-24 Cary Coutant <ccoutant@google.com>
3478 * incremental-dump.cc (find_input_containing_global): Replace
3479 magic number with symbolic constant.
3480 (dump_incremental_inputs): Update version number.
3481 * incremental.cc (Output_section_incremental_inputs): Update version
3482 number; import symbolic constants from Incremental_inputs_reader.
3483 (Incremental_inputs::create_data_sections): Align relocations
3484 section correctly for 64-bit targets.
3485 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3486 constants; add padding.
3487 (Output_section_incremental_inputs::write_header): Add assert for
3489 (Output_section_incremental_inputs::write_input_files): Add assert
3490 for input_entry_size.
3491 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3492 add assert for object_info_size, input_section_entry_size,
3493 global_sym_entry_size.
3494 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3495 for data structure sizes; use them.
3496 (Incremental_input_entry_reader): Import symbolic constants from
3497 Incremental_inputs_reader; use them.
3499 2012-04-23 David S. Miller <davem@davemloft.net>
3501 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3503 (Target_sparc::Target_sparc): Initialize new fields.
3504 (Target_sparc::do_make_elf_object): New function.
3505 (Target_sparc::do_adjust_elf_header): New function.
3507 2012-04-23 Cary Coutant <ccoutant@google.com>
3509 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3510 CU range table of gdb index.
3512 2012-04-20 David S. Miller <davem@davemloft.net>
3514 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3517 2012-04-16 David S. Miller <davem@davemloft.net>
3519 * sparc.cc (Target_sparc::got_address): New function.
3520 (Sparc_relocate_functions::gdop_hix22): New function.
3521 (Sparc_relocate_functions::gdop_lox10): New function.
3522 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3524 (Target_sparc::Scan::local): Likewise if the global symbol is not
3525 preemptible and is not IFUNC.
3526 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3527 transformations for local and non-preemptible non-IFUNC global
3530 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3531 writing out 64-bit part of ranges.
3533 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3534 -fpic and -fpie respectively.
3535 * Makefile.in: Regenerate.
3537 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3538 (Target_sparc::Target_sparc): Initialize new field.
3539 (Target_sparc::do_plt_section_for_global): New function.
3540 (Target_sparc::do_plt_section_for_local): New function.
3541 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3542 (Target_sparc::make_plt_section): New function, broken out of
3543 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3544 (Target_sparc::make_plt_entry): Call make_plt_section.
3545 (Target_sparc::make_local_ifunc_plt_entry): New function.
3546 (Target_sparc::rela_ifunc_section): New function.
3547 (Target_sparc::plt_section): Remove const.
3548 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3549 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3550 and ifunc_count_ fields.
3551 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3552 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3553 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3554 (Output_data_plt_sparc::rela_ifunc): New function.
3555 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3556 (Output_data_plt_sparc::has_ifunc_section): New function.
3557 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3558 (Output_data_plt_sparc::address_for_global): New function.
3559 (Output_data_plt_sparc::address_for_local): New function.
3560 (Output_data_plt_sparc::plt_index_to_offset): New function.
3561 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3563 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3565 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3566 R_SPARC_JMP_IREL to switch.
3567 (Target_sparc::Scan::check_non_pic): Likewise.
3568 (Target_sparc::Scan::local): Handle IFUNC symbols.
3569 (Target_sparc::Scan::local): Likewise.
3570 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3571 and plt_address_for_local.
3572 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3573 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3575 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3576 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3577 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3578 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3580 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3581 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3583 * sparc.cc (Target_sparc::Scan::global): Likewise.
3584 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3586 2012-04-16 Cary Coutant <ccoutant@google.com>
3588 * archive.cc (Library_base::should_include_member): Check for
3589 --export-dynamic-symbol.
3590 * options.h (class General_options): Add --export-dynamic-symbol.
3591 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3592 --export-dynamic-symbol.
3593 (Symbol_table::gc_mark_undef_symbols): Likewise.
3594 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3596 2012-04-12 David S. Miller <davem@davemloft.net>
3598 * sparc.cc (Reloc::wdisp10): New relocation method.
3599 (Reloc::h34): Likewise.
3600 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3601 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3603 (Target_sparc::Scan::local): Likewise.
3604 (Target_sparc::Scan::global): Likewise.
3605 (Target_sparc::Relocate::relocate): Likewise.
3607 2012-04-09 Cary Coutant <ccoutant@google.com>
3609 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3612 2012-04-06 Ian Lance Taylor <iant@google.com>
3614 * timer.cc: #include <unistd.h>.
3616 2012-04-06 Roland McGrath <mcgrathr@google.com>
3618 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3619 * config.in: Regenerate.
3620 * configure: Regenerate.
3622 2012-04-05 Nick Clifton <nickc@redhat.com>
3624 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3625 (AM_LC_MESSAGES): Add.
3626 * aclocal.m4: Regenerate.
3627 * config.in: Regenerate.
3628 * configure: Regenerate.
3630 2012-03-21 Cary Coutant <ccoutant@google.com>
3632 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3633 * Makefile.in: Regenerate.
3634 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3635 (Sized_elf_reloc_mapper::symbol_section): New function.
3636 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3637 (make_elf_reloc_mapper): New function.
3638 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3639 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3640 (Dwarf_abbrev_table::do_get_abbrev): New function.
3641 (Dwarf_ranges_table::read_ranges_table): New function.
3642 (Dwarf_ranges_table::read_range_list): New function.
3643 (Dwarf_pubnames_table::read_section): New function.
3644 (Dwarf_pubnames_table::read_header): New function.
3645 (Dwarf_pubnames_table::next_name): New function.
3646 (Dwarf_die::Dwarf_die): New function.
3647 (Dwarf_die::read_attributes): New function.
3648 (Dwarf_die::skip_attributes): New function.
3649 (Dwarf_die::set_name): New function.
3650 (Dwarf_die::set_linkage_name): New function.
3651 (Dwarf_die::attribute): New function.
3652 (Dwarf_die::string_attribute): New function.
3653 (Dwarf_die::int_attribute): New function.
3654 (Dwarf_die::uint_attribute): New function.
3655 (Dwarf_die::ref_attribute): New function.
3656 (Dwarf_die::child_offset): New function.
3657 (Dwarf_die::sibling_offset): New function.
3658 (Dwarf_info_reader::check_buffer): New function.
3659 (Dwarf_info_reader::parse): New function.
3660 (Dwarf_info_reader::do_parse): New function.
3661 (Dwarf_info_reader::do_read_string_table): New function.
3662 (Dwarf_info_reader::lookup_reloc): New function.
3663 (Dwarf_info_reader::get_string): New function.
3664 (Dwarf_info_reader::visit_compilation_unit): New function.
3665 (Dwarf_info_reader::visit_type_unit): New function.
3666 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3667 Sized_elf_reloc_mapper.
3668 (Sized_dwarf_line_info::symbol_section): Remove function.
3669 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3670 (Sized_dwarf_line_info::read_line_mappings): Remove object
3671 parameter, adjust callers.
3672 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3673 * dwarf_reader.h: Include <sys/types.h>.
3674 (class Track_relocs): Remove forward declaration.
3675 (class Elf_reloc_mapper): New class.
3676 (class Sized_elf_reloc_mapper): New class.
3677 (class Dwarf_abbrev_table): New class.
3678 (class Dwarf_range_list): New class.
3679 (class Dwarf_ranges_table): New class.
3680 (class Dwarf_pubnames_table): New class.
3681 (class Dwarf_die): New class.
3682 (class Dwarf_info_reader): New class.
3683 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3684 (Sized_dwarf_line_info::symbol_section): Remove member function.
3685 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3687 * gdb-index.cc: New source file.
3688 * gdb-index.h: New source file.
3689 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3690 and .debug_types sections, call Layout::add_to_gdb_index.
3691 (Sized_relobj_incr::do_section_name): Implement.
3692 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3693 return type; Implement.
3694 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3696 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3697 parameter list and return type.
3698 (Sized_incr_dynobj::do_section_contents): Likewise.
3699 * layout.cc: Include gdb-index.h.
3700 (Layout::Layout): Initialize gdb_index_data_.
3701 (Layout::init_fixed_output_section): Check for .gdb_index section.
3702 (Layout::add_to_gdb_index): New function. Instantiate.
3703 * layout.h: Add forward declaration for class Gdb_index.
3704 (Layout::add_to_gdb_index): New member function.
3705 (Layout::gdb_index_data_): New data member.
3706 * main.cc: Include gdb-index.h.
3707 (main): Print statistics for gdb index.
3708 * object.cc (Object::section_contents): Move code into
3709 do_section_contents.
3710 (need_decompressed_section): Check for sections needed when building
3712 (build_compressed_section_map): Likewise.
3713 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3715 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3716 sections; call Layout::add_to_gdb_index.
3717 (Sized_relobj_file::do_decompressed_section_contents): Call
3718 do_section_contents directly.
3719 * object.h (Object::do_section_contents): Adjust parameter list and
3721 (Object::do_decompressed_section_contents): Call do_section_contents
3723 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3725 * options.h (class General_options): Add --gdb-index option.
3726 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3727 list and return type.
3728 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3729 * reloc.h (Track_relocs::checkpoint): New function.
3730 (Track_relocs::reset): New function.
3732 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3734 * testsuite/Makefile.in: Regenerate.
3735 * testsuite/gdb_index_test.cc: New test source file.
3736 * testsuite/gdb_index_test_1.sh: New test source file.
3737 * testsuite/gdb_index_test_2.sh: New test source file.
3739 2012-03-19 Doug Kwan <dougkwan@google.com>
3741 * arm.cc (Target_arm::do_define_standard_symbols): New method.
3742 (Target_arm::do_finalize_sections): Remove code which defines
3743 __exidx_start and __exidx_end. Make symbol table parameter
3744 anonymous as it is not used.
3745 * gold.cc (queue_middle_tasks): Call target hook to define any
3746 target-specific symbols.
3747 * target.h (Target::define_standard_symbols): New method.
3748 (Target::do_define_standard_symbols): Same.
3749 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3750 * testsuite/Makefile.in: Regenerate.
3751 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3753 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3754 relocations are generated for __exidx_start and __exidx_end.
3756 2012-03-16 Doug Kwan <dougkwan@google.com>
3758 * testsuite/Makefile.am: Disable test initpri3b.
3759 * testsuite/Makefile.in: Regenerate.
3761 2012-03-15 Doug Kwan <dougkwan@google.com>
3763 * arm.cc (Target_arm::got_section): Make .got section read-only
3766 2012-03-15 Ian Lance Taylor <iant@google.com>
3769 * layout.cc (Layout::make_output_section): Correctly mark
3770 SHT_INIT_ARRAY, et. al., as relro.
3772 2012-03-14 Doug Kwan <dougkwan@google.com>
3774 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3775 dynamic relocations for protected symbols in shared objects.
3777 2012-03-13 Ian Lance Taylor <iant@google.com>
3779 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3780 keep the larger alignment.
3782 2012-03-12 Cary Coutant <ccoutant@google.com>
3784 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3785 handling of DW_LNE_define_file.
3787 2012-03-12 Cary Coutant <ccoutant@google.com>
3789 * reduced_debug_output.cc
3790 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3793 2012-02-29 Cary Coutant <ccoutant@google.com>
3795 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3797 2012-02-29 Cary Coutant <ccoutant@google.com>
3799 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3800 Call Object::decompressed_section_contents.
3801 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3803 (Sized_dwarf_line_info::buffer_start_): New data member.
3804 * merge.cc (Output_merge_data::do_add_input_section): Call
3805 Object::decompressed_section_contents.
3806 (Output_merge_string::do_add_input_section): Likewise.
3807 * object.cc (need_decompressed_section): New function.
3808 (build_compressed_section_map): Decompress sections needed later.
3809 (Sized_relobj_file::do_decompressed_section_contents): New function.
3810 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3811 * object.h (Object::decompressed_section_contents): New function.
3812 (Object::discard_decompressed_sections): New function.
3813 (Object::do_decompressed_section_contents): New function.
3814 (Object::do_discard_decompressed_sections): New function.
3815 (Compressed_section_info): New type.
3816 (Compressed_section_map): Include decompressed section contents.
3817 (Sized_relobj_file::do_decompressed_section_contents): New function.
3818 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3820 2012-02-16 Cary Coutant <ccoutant@google.com>
3822 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3823 * testsuite/Makefile.in: Regenerate.
3825 2012-02-14 Cary Coutant <ccoutant@google.com>
3827 * options.cc (General_options::finalize): Disallow -pie and -static.
3829 2012-02-03 Doug Kwan <dougkwan@google.com>
3831 * arm.cc (Arm_relocate_functions::abs8,
3832 Arm_relocate_functions::abs16): Use
3833 Bits::has_signed_unsigned_overflow32.
3834 (Arm_relocate_functions::thm_abs8): Correct range of
3836 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3839 2012-02-02 Doug Kwan <dougkwan@google.com>
3841 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3842 position independent outputs, not just shared objects.
3844 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3846 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3847 * configure: Regenerated.
3849 2012-01-27 Ian Lance Taylor <iant@google.com>
3851 * reloc.h (Bits): New class with static functions, copied from
3852 namespace utils in arm.cc.
3853 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3856 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3858 * incremental.cc (write_info_blocks): Correct relocation offset.
3860 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3862 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3863 (Relocate::tls_gd_to_le): Likewise.
3865 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3867 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3869 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3871 * configure.ac: Check if -mcmodel=medium works.
3872 * configure: Regenerated.
3874 2012-01-24 Cary Coutant <ccoutant@google.com>
3876 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3878 (read_unsigned_LEB_128_x): ... this new function.
3879 (read_signed_LEB_128): Replaced with inline definition and ...
3880 (read_signed_LEB_128_x): ... this new function.
3881 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3882 (read_unsigned_LEB_128): Add inline definition.
3883 (read_signed_LEB_128_x): New function.
3884 (read_signed_LEB_128): Add inline definition.
3885 * testsuite/Makefile.am (leb128_unittest): New unit test.
3886 * testsuite/Makefile.in: Regenerate.
3887 * testsuite/leb128_unittest.cc: New unit test.
3889 2012-01-23 Ian Lance Taylor <iant@google.com>
3892 * i386.cc (Target_i386::do_code_fill): When using a jmp
3893 instruction, pad with nop instructions.
3894 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3896 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3898 * x86_64.cc (gc_process_relocs): Add typename on types used in
3900 (scan_relocs): Likewise.
3901 (relocate_section): Likewise.
3902 (apply_relocation): Likewise.
3904 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3906 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3907 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3910 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3912 * x86_64.cc: Initial support for x32.
3914 2012-01-03 Cary Coutant <ccoutant@google.com>
3916 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3917 Use abstract base class for GOT.
3918 * gold/output.h (class Output_data_got_base): New abstract base class.
3919 (class Output_data_got): Derive from new base class, adjust ctors.
3920 (Output_data_got::reserve_slot): Make virtual; rename to
3921 do_reserve_slot; Adjust callers.
3922 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3923 pointer to abstract base class.
3924 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3926 2011-12-18 Ian Lance Taylor <iant@google.com>
3928 * object.h (Relobj::local_symbol_value): New function.
3929 (Relobj::local_plt_offset): New function.
3930 (Relobj::local_has_got_offset): New function.
3931 (Relobj::local_got_offset): New function.
3932 (Relobj::set_local_got_offset): New function.
3933 (Relobj::do_local_symbol_value): New pure virtual function.
3934 (Relobj::do_local_plt_offset): Likewise.
3935 (Relobj::do_local_has_got_offset): Likewise.
3936 (Relobj::do_local_got_offset): Likewise.
3937 (Relobj::do_set_local_got_offset): Likewise.
3938 (Sized_relobj::do_local_has_got_offset): Rename from
3939 local_has_got_offset.
3940 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3941 (Sized_relobj::do_set_local_got_offset): Rename from
3942 set_local_got_offset.
3943 (Sized_relobj_file::do_local_plt_offset): Rename from
3945 (Sized_relobj_file::do_local_symbol_value): New function.
3946 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3948 * output.cc (Output_data_got::Got_entry::write): Change object to
3949 Relobj. Use local_symbol_value.
3950 (Output_data_got::add_global_with_rel): Change rel_dyn to
3951 Output_data_reloc_generic*. Use add_global_generic.
3952 (Output_data_got::add_global_with_rela): Remove. Change all
3953 callers to use add_global_with_rel.
3954 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3955 Output_data_reloc_generic*. Use add_global_generic.
3956 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3957 callers to use add_global_pair_with_rel.
3958 (Output_data_got::add_local): Change object to Relobj*.
3959 (Output_data_got::add_local_plt): Likewise.
3960 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3961 change rel_dyn to Output_data_reloc_generic*. Use
3963 (Output_data_got::add_local_with_rela): Remove. Change all
3964 callers to use all_local_with_rel.
3965 (Output_data_got::add_local_pair_with_rel): Change object to
3966 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3967 add_output_section_generic.
3968 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3969 callers to use add_local_pair_with_rel.
3970 (Output_data_got::reserve_local): Change object to Relobj*.
3971 * output.h: (class Output_data_reloc_generic): Add pure virtual
3972 declarations for add_global_generic, add_local_generic,
3973 add_output_section_generic.
3974 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3975 functions for Output_data_reloc_generic. Update declarations for
3976 changes listed in output.cc.
3977 (class Output_data_got): Change template parameter to got_size.
3978 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3979 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3981 (Sized_relobj_incr::do_local_plt_offset): New function.
3982 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3985 2011-12-17 Cary Coutant <ccoutant@google.com>
3987 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3988 * resolve.cc (Symbol_table::resolve): Likewise.
3989 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3991 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3993 2011-12-16 Ian Lance Taylor <iant@google.com>
3995 * output.h (Output_data_reloc_generic::add): Only call
3996 add_dynamic_reloc if this is a dynamic reloc section.
3998 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4001 * target-reloc.h (apply_relocation): Replace <64, false> with
4004 2011-11-25 Nick Clifton <nickc@redhat.com>
4006 * po/it.po: New Italian translation.
4008 2011-11-17 Sterling Augustine <saugustine@google.com>
4010 * script.cc (script_include_directive): Implement.
4011 (read_script_file): New local variables name and search_path. Update
4012 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4013 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4014 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4016 2011-11-11 Sterling Augustine <saugustine@google.com>
4018 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4019 (file_or_sections_cmd): Likewise.
4021 2011-11-11 Doug Kwan <dougkwan@google.com>
4023 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4024 if --just-symbols is given.
4026 2011-11-10 Doug Kwan <dougkwan@google.com>
4029 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4030 when processing data relocs.
4031 * reloc.h (Relocate_functions::rel_unaligned): New method.
4032 (Relocate_functions::pcrel_unaligned): Ditto.
4033 (Relocate_functions::rel32_unaligned): Ditto.
4034 (Relocate_functions::pcrel32_unaligned): Ditto.
4036 2011-11-09 Doug Kwan <dougkwan@google.com>
4039 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4040 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4041 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4042 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4043 (Relocate_functions::rel_unaligned): New.
4044 (Relocate_functions::rel32_unaligned): New.
4045 * target-reloc.h (relocate_for_relocatable): Add code to handle
4046 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4047 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4048 arm_unaligned_reloc_r): New targets.
4049 * testsuite/Makefile.in: Regenerate.
4050 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4053 2011-11-02 Ian Lance Taylor <iant@google.com>
4055 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4057 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4058 * options.cc (General_options::finalize): Use library search path
4059 from configure script if specified. If not native and no sysroot,
4060 only search TOOLLIBDIR.
4061 * options.h (Search_directory::Search_directory): Change name to
4063 (General_options::add_to_library_path_with_sysroot): Change arg to
4065 * configure, Makefile.in, config.in: Rebuild.
4067 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4069 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4070 we are working around the ARM1176 Erratum.
4071 * options.h (General_options::fix_arm1176): Add option.
4072 * testsuite/Makefile.am: Add testcases, and keep current ones
4074 * testsuite/Makefile.in: Regenerate.
4075 * testsuite/arm_fix_1176.s: New file.
4076 * testsuite/arm_fix_1176.sh: Likewise.
4078 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4080 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4082 (Target_arm::may_use_blx): Remove method.
4083 (Target_arm::set_may_use_blx): Likewise.
4084 (Target_arm::may_use_v4t_interworking): New method.
4085 (Target_arm::may_use_v5t_interworking): Likewise.
4086 (Target_arm::may_use_blx_): Remove member variable.
4087 (Arm_relocate_functions::arm_branch_common): Check for v5T
4089 (Arm_relocate_functions::thumb_branch_common): Likewise.
4090 (Reloc_stub::stub_type_for_reloc): Likewise.
4091 (Target_arm::do_finalize_sections): Correct interworking checks.
4092 * testsuite/Makefile.am: Add new tests.
4093 * testsuite/Makefile.in: Regenerate.
4094 * testsuite/arm_farcall_arm_arm.s: New test.
4095 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4096 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4097 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4098 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4099 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4100 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4101 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4103 2011-10-31 Cary Coutant <ccoutant@google.com>
4106 * expression.cc (Expression::eval_with_dot): Add
4107 is_section_dot_assignment parameter.
4108 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4109 absolute and assigning to dot within a section.
4110 * script-sections.cc
4111 (Output_section_element_assignment::set_section_addresses): Pass
4112 dot_section to set_if_absolute.
4113 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4114 as is_section_dot_assignment flag to eval_with_dot.
4115 (Output_section_element_dot_assignment::set_section_addresses):
4117 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4118 parameter. Also set value if relative to dot_section; set the
4119 symbol's output_section.
4120 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4121 parameter. Adjust all callers.
4122 (Expression::eval_maybe_dot): Likewise.
4123 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4125 * testsuite/script_test_2.t: Test assignment of an absolute value
4126 to dot within an output section element.
4128 2011-10-31 Cary Coutant <ccoutant@google.com>
4130 * options.h (class General_options): Add --[no-]gnu-unique options.
4131 * symtab.cc (Symbol_table::sized_write_globals): Convert
4132 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4134 2011-10-31 Cary Coutant <ccoutant@google.com>
4137 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4138 unnecessary assertion.
4139 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4141 2011-10-31 Sriraman Tallam <tmsriram@google.com>
4143 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4145 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4147 Change to just keep the section associated with symbol.
4148 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4149 they are externally visible and --export-dynamic is turned on.
4150 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4152 2011-10-19 Ian Lance Taylor <iant@google.com>
4155 * script-sections.cc
4156 (Output_section_element_dot_assignment::needs_output_section): New
4159 2011-10-19 Ian Lance Taylor <iant@google.com>
4162 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4163 --section-start option was seen.
4164 * options.h (General_options::any_section_start): New function.
4166 2011-10-18 David S. Miller <davem@davemloft.net>
4169 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4170 member to track relocation locations that have moved during TLS
4171 reloc optimizations.
4172 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4173 (Target_sparc::Relocate::relocate): Adjust view down by 4
4174 bytes if it matches reloc_adjust_addr_.
4175 (Target_sparc::Relocate::relocate_tls): Always move the
4176 __tls_get_addr call delay slot instruction forward 4 bytes when
4177 performing relaxation.
4179 2011-10-18 Cary Coutant <ccoutant@google.com>
4181 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4182 (Output_file::map_no_anonymous): Check for non-zero
4183 return code from posix_fallocate.
4185 2011-10-17 Cary Coutant <ccoutant@google.com>
4188 * plugin.cc (is_visible_from_outside): Check for symbols
4189 referenced from dynamic objects.
4190 * resolve.cc (Symbol_table::resolve): Don't count references
4191 from dynamic objects as references from real ELF files.
4192 * testsuite/plugin_test_2.sh: Adjust expected result.
4194 2011-10-17 Cary Coutant <ccoutant@google.com>
4196 * gold.cc: Include timer.h.
4197 (queue_middle_tasks): Stamp time.
4198 (queue_final_tasks): Likewise.
4199 * main.cc (main): Store timer in parameters. Print timers
4201 * parameters.cc (Parameters::Parameters): Initialize timer_.
4202 (Parameters::set_timer): New function.
4203 (set_parameters_timer): New function.
4204 * parameters.h (Parameters::set_timer): New function.
4205 (Parameters::timer): New function.
4206 (Parameters::timer_): New data member.
4207 (set_parameters_timer): New function.
4208 * timer.cc (Timer::stamp): New function.
4209 (Timer::get_pass_time): New function.
4210 * timer.h (Timer::stamp): New function.
4211 (Timer::get_pass_time): New function.
4212 (Timer::pass_times_): New data member.
4214 2011-10-17 Cary Coutant <ccoutant@google.com>
4216 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4217 task for members of lib groups.
4219 2011-10-17 Cary Coutant <ccoutant@google.com>
4222 * fileread.cc (File_read::find_view): Add assert.
4223 (File_read::make_view): Move bounds check (replace with assert)...
4224 (File_read::find_or_make_view): ... to here.
4226 2011-10-12 Cary Coutant <ccoutant@google.com>
4228 * output.cc (Output_file::open_base_file): Handle case where
4229 ::read returns less than requested size.
4231 2011-10-10 Cary Coutant <ccoutant@google.com>
4233 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
4234 Initialize defined_count_.
4235 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4236 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4237 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4238 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4239 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4240 * incremental.h (Sized_relobj_incr::defined_count_): New data
4242 (Sized_incr_dynobj::defined_count_): New data member.
4243 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
4244 Return zeroes instead of internal error.
4246 2011-10-10 Cary Coutant <ccoutant@google.com>
4249 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
4250 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4251 * output.h (class Output_reloc): Add use_plt_offset flag.
4252 (Output_reloc::type_): Adjust size of bit field.
4253 (Output_reloc::use_plt_offset_): New bit field.
4254 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4255 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4256 flag. Adjust all callers.
4257 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
4258 creating RELATIVE relocations.
4260 2011-10-10 Nick Clifton <nickc@redhat.com>
4262 * po/es.po: Updated Spanish translation.
4263 * po/fi.po: Updated Finnish translation.
4265 2011-10-03 Diego Novillo <dnovillo@google.com>
4267 * options.cc (parse_uint): Fix dereference of RETVAL.
4269 2011-09-29 Sriraman Tallam <tmsriram@google.com>
4271 * layout.h (section_order_map_): New member.
4272 (get_section_order_map): New member function.
4273 * output.cc (Output_section::add_input_section): Check for patterns
4274 only when --section-ordering-file is specified.
4275 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4276 output_sections have been formed.
4277 * layout.cc (Layout_Layout): Initialize section_order_map_.
4278 * plugin.cc (update_section_order): Store order in order_map. Do not
4280 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4281 * testsuite/Makefile.in: Regenerate.
4282 * testsuite/plugin_section_order.c: New file.
4283 * testsuite/plugin_final_layout.cc: New file.
4284 * testsuite/plugin_final_layout.sh: New file.
4286 2011-09-29 Cary Coutant <ccoutant@google.com>
4288 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4290 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
4291 symbols during incremental update.
4292 (Symbol_table::add_from_dynobj): Likewise.
4294 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4295 Ian Lance Taylor <iant@google.com>
4297 * symtab.cc (Symbol_table::define_special_symbol): Always
4298 canonicalize version string.
4300 2011-09-26 Cary Coutant <ccoutant@google.com>
4302 * gold.cc (queue_initial_tasks): Move option checks ...
4303 * options.cc (General_options::finalize): ... to here. Disable
4304 some options; make others fatal.
4306 2011-09-26 Cary Coutant <ccoutant@google.com>
4309 * plugin.cc (get_symbols_v2): New function.
4310 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4311 (is_referenced_from_outside): New function.
4312 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4313 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4314 (get_symbols): Pass version parameter.
4315 (get_symbols_v2): New function.
4316 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4318 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4319 (onload): Add LDPT_GET_SYMBOLS_V2.
4320 (all_symbols_read_hook): Use get_symbols_v2; check for
4321 LDPR_PREVAILING_DEF_IRONLY_EXP.
4322 * testsuite/plugin_test_3.sh: Update expected results.
4324 2011-09-23 Simon Baldwin <simonb@google.com>
4326 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4327 configuration options.
4328 * configure: Regenerate.
4329 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4330 * Makefile.in: Regenerate.
4331 * testsuite/Makefile.in: Regenerate.
4333 2011-09-19 Sriraman Tallam <tmsriram@google.com>
4335 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4337 2011-09-19 Cary Coutant <ccoutant@google.com>
4339 * incremental.cc (can_incremental_update): Fix typo in comment.
4340 * incremental.h (can_incremental_update): Likewise.
4342 2011-09-18 Cary Coutant <ccoutant@google.com>
4344 * incremental.cc (can_incremental_update): New function.
4345 * incremental.h (can_incremental_update): New function.
4346 * layout.cc (Layout::init_fixed_output_section): Call it.
4347 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4348 * object.cc (Sized_relobj_file::do_layout): Call
4349 can_incremental_update.
4351 2011-09-13 Cary Coutant <ccoutant@google.com>
4353 * configure.ac: Check for glibc support for gnu_indirect_function
4354 support with static linking, setting automake conditional
4356 * Makefile.in: Regenerate.
4357 * configure: Regenerate.
4359 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4360 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4362 * testsuite/Makefile.in: Regenerate.
4364 2011-09-13 Cary Coutant <ccoutant@google.com>
4366 * incremental.cc (Sized_relobj_incr::do_layout): Call
4367 report_comdat_group for kept comdat sections.
4368 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4369 * testsuite/Makefile.in: Regenerate.
4370 * testsuite/incr_comdat_test_1.cc: New source file.
4371 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4372 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4373 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4375 2011-09-13 Ian Lance Taylor <iant@google.com>
4377 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4378 variable external_symbols_offset.
4380 2011-09-12 Ian Lance Taylor <iant@google.com>
4382 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4383 triggered if object has no symbols.
4385 2011-09-09 David S. Miller <davem@davemloft.net>
4387 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4388 (Output_fill_debug_line::do_write): Likewise.
4390 2011-08-29 Cary Coutant <ccoutant@google.com>
4392 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4393 casts to match formatting specs.
4394 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4396 2011-08-26 Cary Coutant <ccoutant@google.com>
4398 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4399 remaining hole size when allocating.
4400 (Layout::make_output_section): Set fill methods for debug sections.
4401 * layout.h (Free_list::Free_list_node): Move from private to
4403 (Free_list::set_min_hole_size): New function.
4404 (Free_list::begin, Free_list::end): New functions.
4405 (Free_list::min_hole_): New data member.
4406 * output.cc: Include dwarf.h.
4407 (Output_fill_debug_info::do_minimum_hole_size): New function.
4408 (Output_fill_debug_info::do_write): New function.
4409 (Output_fill_debug_line::do_minimum_hole_size): New function.
4410 (Output_fill_debug_line::do_write): New function.
4411 (Output_section::Output_section): Initialize new data member.
4412 (Output_section::set_final_data_size): Ensure patch space is larger
4413 than minimum hole size.
4414 (Output_section::do_write): Fill holes in debug sections.
4415 * output.h (Output_fill): New class.
4416 (Output_fill_debug_info): New class.
4417 (Output_fill_debug_line): New class.
4418 (Output_section::set_free_space_fill): New function.
4419 (Output_section::free_space_fill_): New data member.
4420 * testsuite/Makefile.am (incremental_test_3): Add
4421 --incremental-patch option.
4422 (incremental_test_4): Likewise.
4423 (incremental_test_5): Likewise.
4424 (incremental_test_6): Likewise.
4425 (incremental_copy_test): Likewise.
4426 (incremental_common_test_1): Likewise.
4427 * testsuite/Makefile.in: Regenerate.
4429 2011-08-26 Nick Clifton <nickc@redhat.com>
4431 * po/es.po: Updated Spanish translation.
4433 2011-08-01 Cary Coutant <ccoutant@google.com>
4435 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4436 * gold/testsuite/Makefile.in: Regenerate.
4437 * gold/testsuite/justsyms_exec.c: New source file.
4438 * gold/testsuite/justsyms_lib.c: New source file.
4440 2011-08-01 Cary Coutant <ccoutant@google.com>
4442 * layout.cc (Layout::set_segment_offsets): Don't realign text
4443 segment if -Ttext was specified.
4444 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4446 * object.h (Sized_relobj_file::e_type): New function.
4447 (Sized_relobj_file::e_type_): New data member.
4448 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4449 base address for ET_EXEC files.
4450 * target.cc (Target::do_make_elf_object_implementation): Allow
4451 ET_EXEC files with --just-symbols option.
4453 2011-07-28 Cary Coutant <ccoutant@google.com>
4455 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4456 Add thread_number parameter.
4457 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4458 * workqueue-threads.cc
4459 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4460 current thread if its thread number is greater than desired thread
4462 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4463 Add thread_number parameter.
4464 (Workqueue::should_cancel_thread): Likewise.
4465 (Workqueue::find_runnable_or_wait): Pass thread_number to
4466 should_cancel_thread.
4467 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4470 2011-07-22 Sriraman Tallam <tmsriram@google.com>
4472 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4473 only after checking if it cannot be forced local.
4474 * symtab.h (is_externally_visible): Check if the symbol is not forced
4477 2011-07-15 Ian Lance Taylor <iant@google.com>
4479 * options.h (class General_options): Add --print-output-format.
4480 Move -EL next to -EB, for better --help output.
4481 * target-select.cc: Include <cstdio>, "options.h", and
4483 (Target_selector::do_target_bfd_name): New function.
4484 (print_output_format): New function.
4485 * target-select.h (class Target_selector): Update declarations.
4486 (Target_selector::target_bfd_name): New function.
4487 (print_output_format): Declare.
4488 * main.cc: Include "target-select.h".
4489 (main): Handle --print-output-format.
4490 * gold.cc: Include "target-select.h".
4491 (queue_initial_tasks): Handle --print-output-format when there are
4493 * parameters.cc (parameters_force_valid_target): Give a better
4494 error message if -EB/-EL does not match target.
4495 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4498 2011-07-15 Ian Lance Taylor <iant@google.com>
4500 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4501 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4502 (Output_data_plt_i386::do_write): Write address of .dynamic
4503 section to first entry in .got.plt section.
4504 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4505 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4507 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4508 section to first entry in .got.plt section.
4509 * layout.h (Layout::dynamic_section): New function.
4511 2011-07-13 Sriraman Tallam <tmsriram@google.com>
4513 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4515 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4516 input_section_position_, and input_section_glob_.
4517 (read_layout_from_file): Call function section_ordering_specified.
4518 * layout.h (is_section_ordering_specified): New function.
4519 (section_ordering_specified): New function.
4520 (section_ordering_specified_): New boolean member.
4521 * main.cc(main): Call load_plugins after layout object is defined.
4522 * output.cc (Output_section::add_input_section): Use
4523 function section_ordering_specified to check if section ordering is
4525 * output.cc (Output_section::add_relaxed_input_section): Use
4526 function section_ordering_specified to check if section ordering is
4528 (Output_section::update_section_layout): New function.
4529 (Output_section::sort_attached_input_sections): Check if input section
4531 * output.h (Output_section::update_section_layout): New function.
4532 * plugin.cc (get_section_count): New function.
4533 (get_section_type): New function.
4534 (get_section_name): New function.
4535 (get_section_contents): New function.
4536 (update_section_order): New function.
4537 (allow_section_ordering): New function.
4538 (Plugin::load): Add the new interfaces to the transfer vector.
4539 (Plugin_manager::load_plugins): New parameter.
4540 (Plugin_manager::all_symbols_read): New parameter.
4541 (Plugin_manager::claim_file): New parameter. Save the elf object for
4543 (Plugin_manager::get_elf_object): New function.
4544 (Plugin_manager::get_view): Change to directly use the bool to check
4545 if get_view is called from claim_file_hook.
4546 * plugin.h (input_objects): New function
4547 (Plugin__manager::load_plugins): New parameter.
4548 (Plugin_manager::claim_file): New parameter.
4549 (Plugin_manager::get_elf_object): New function.
4550 (Plugin_manager::in_claim_file_handler): New function.
4551 (Plugin_manager::in_claim_file_handler_): New member.
4552 (layout): New function.
4553 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4554 handler with an extra parameter. Make the elf object before calling
4556 * testsuite/plugin_test.c (get_section_count): New function pointer.
4557 (get_section_type): New function pointer.
4558 (get_section_name): New function pointer.
4559 (get_section_contents): New function pointer.
4560 (update_section_order): New function pointer.
4561 (allow_section_ordering): New function pointer.
4562 (onload): Check if the new interfaces exist.
4564 2011-07-13 Ian Lance Taylor <iant@google.com>
4566 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4568 * x86_64.cc (Target_x86_64::got_section): Likewise.
4569 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4570 (relro_now_test_SOURCES): New variable.
4571 (relro_now_test_DEPENDENCIES): New variable.
4572 (relro_now_test_LDFLAGS): New variable.
4573 (relro_now_test_LDADD): New variable.
4574 (relro_now_test.so): New target.
4575 * testsuite/Makefile.in: Rebuild.
4577 2011-07-12 Ian Lance Taylor <iant@google.com>
4580 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4581 GLOB_DAT relocation rather than a RELATIVE relocation for a
4582 protected symbol when creating a shared library.
4583 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4584 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4585 * testsuite/protected_main_1.cc (main): Test that protected
4586 function has same address.
4588 2011-07-11 Ian Lance Taylor <iant@google.com>
4591 * options.h (class General_options): Add -Bgroup.
4592 * options.cc (General_options::finalize): If -Bgroup is set,
4593 default to --unresolved-symbols=report-all.
4594 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4595 * target-reloc.h (issue_undefined_symbol_error): Handle
4596 --unresolved-symbols=report-all.
4598 2011-07-08 Ian Lance Taylor <iant@google.com>
4601 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4602 if linker script discards key sections.
4603 (Layout::create_dynamic_symtab): Likewise.
4604 (Layout::assign_local_dynsym_offsets): Likewise.
4605 (Layout::sized_create_version_sections): Likewise.
4606 (Layout::create_interp): Likewise.
4607 (Layout::finish_dynamic_section): Likewise.
4608 (Layout::set_dynamic_symbol_size): Likewise.
4610 2011-07-08 Ian Lance Taylor <iant@google.com>
4613 * options.h (class General_options): Add --unresolved-symbols.
4614 * target-reloc.h (issue_undefined_symbol_error): Check
4615 --unresolved-symbols. Add comments.
4617 2011-07-08 Ian Lance Taylor <iant@google.com>
4619 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4620 expression more complex.
4622 2011-07-08 Ian Lance Taylor <iant@google.com>
4625 * target-reloc.h (issue_undefined_symbol_error): New inline
4626 function, broken out of relocate_section.
4627 (relocate_section): Call issue_undefined_symbol_error.
4628 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4629 there is no TLS segment if we are about to issue an undefined
4631 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4633 2011-07-08 Ian Lance Taylor <iant@google.com>
4636 * resolve.cc (Symbol_table::should_override): Add fromtype
4637 parameter. Change all callers. Give error when linking together
4638 TLS and non-TLS symbol.
4639 (Symbol_table::should_override_with_special): Add fromtype
4640 parameter. Change all callers.
4641 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4642 there is no TLS segment if we have reported some errors.
4643 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4645 2011-07-08 Ian Lance Taylor <iant@google.com>
4648 * target.h (Target::plt_address_for_global): New function.
4649 (Target::plt_address_for_local): New function.
4650 (Target::plt_section_for_global): Remove.
4651 (Target::plt_section_for_local): Remove.
4652 (Target::do_plt_address_for_global): New virtual function.
4653 (Target::do_plt_address_for_local): New virtual function.
4654 (Target::do_plt_section_for_global): Remove.
4655 (Target::do_plt_section_for_local): Remove.
4656 (Target::register_global_plt_entry): Add Symbol_table and Layout
4658 * output.cc (Output_data_got::Got_entry::write): Use
4659 plt_address_for_global and plt_address_for_local.
4660 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4661 address of output section.
4662 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4663 got_irelative_, and irelative_count_ fields. Update
4665 (Output_data_plt_i386::has_irelative_section): New function.
4666 (Output_data_plt_i386::entry_count): Add irelative_count_.
4667 (Output_data_plt_i386::set_final_data_size): Likewise.
4668 (class Target_i386): Add got_irelative_ and rel_irelative_
4669 fields. Update declarations.
4670 (Target_i386::Target_i386): Initialize new fields.
4671 (Target_i386::do_plt_address_for_global): New function replacing
4672 do_plt_section_for_global.
4673 (Target_i386::do_plt_address_for_local): New function replacing
4674 do_plt_section_for_local.
4675 (Target_i386::got_section): Create got_irelative_.
4676 (Target_i386::rel_irelative_section): New function.
4677 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4678 fields. Don't define __rel_iplt_{start,end}.
4679 (Output_data_plt_i386::add_entry): Add symtab and layout
4680 parameters. Change all callers. Use different PLT and GOT for
4682 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4683 layout parameters. Change all callers. Use different PLT and
4685 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4686 (Output_data_plt_i386::rel_irelative): New function.
4687 (Output_data_plt_i386::address_for_global): New function.
4688 (Output_data_plt_i386::address_for_local): New function.
4689 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4690 IRELATIVE GOT when changing IFUNC GOT entries.
4691 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4693 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4694 if we didn't create an IRELATIVE GOT.
4695 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4696 plt_address_for_local.
4697 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4698 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4699 got_irelative_, and irelative_count_ fields. Update
4701 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4702 Initialize new fields. Remove symtab parameter. Change all
4704 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4706 (Output_data_plt_x86_64::has_irelative_section): New function.
4707 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4708 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4709 fields. Update declarations.
4710 (Target_x86_64::Target_x86_64): Initialize new fields.
4711 (Target_x86_64::do_plt_address_for_global): New function replacing
4712 do_plt_section_for_global.
4713 (Target_x86_64::do_plt_address_for_local): New function replacing
4714 do_plt_section_for_local.
4715 (Target_x86_64::got_section): Create got_irelative_.
4716 (Target_x86_64::rela_irelative_section): New function.
4717 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4718 all callers. Don't create __rel_iplt_{start,end}.
4719 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4720 parameters. Change all callers. Use different PLT and GOT for
4722 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4723 layout parameters. Change all callers. Use different PLT and
4725 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4726 parameters. Change all callers. Use different PLT and GOT for
4728 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4729 (Output_data_plt_x86_64::rela_irelative): New function.
4730 (Output_data_plt_x86_64::address_for_global): New function.
4731 (Output_data_plt_x86_64::address_for_local): New function.
4732 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4733 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4734 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4735 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4737 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4739 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4740 symbols if we didn't create an IRELATIVE GOT.
4741 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4742 plt_address_for_local.
4743 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4744 * testsuite/ifuncvar1.c: New test file.
4745 * testsuite/ifuncvar2.c: New test file.
4746 * testsuite/ifuncvar3.c: New test file.
4747 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4748 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4749 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4750 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4751 * testsuite/Makefile.in: Rebuild.
4753 2011-07-07 Cary Coutant <ccoutant@google.com>
4755 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4756 (two_file_test_1_ndebug.o): Likewise.
4757 (two_file_test_1b_ndebug.o): Likewise.
4758 (two_file_test_2_ndebug.o): Likewise.
4759 (two_file_test_main_ndebug.o): Likewise.
4760 (incremental_test_2): Link with no-debug versions.
4762 2011-07-06 Cary Coutant <ccoutant@google.com>
4764 * gold/incremental.cc
4765 (Output_section_incremental_inputs::write_info_blocks): Check for
4766 hidden and internal symbols.
4768 2011-07-06 Cary Coutant <ccoutant@google.com>
4770 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4771 Check disposition for startup file.
4772 (Incremental_inputs::report_command_line): Ignore
4773 --incremental-startup-unchanged option.
4774 * options.cc (General_options::parse_incremental_startup_unchanged):
4776 (General_options::General_options): Initialize new data member.
4777 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4778 (General_options): Add --incremental-startup-unchanged option.
4779 (General_options::incremental_startup_disposition): New function.
4780 (General_options::incremental_startup_disposition_): New data member.
4782 2011-07-06 Cary Coutant <ccoutant@google.com>
4784 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4785 input file index to Script_info ctor.
4786 (Sized_incremental_binary::do_file_has_changed): Find the
4787 command-line argument for files named in scripts.
4788 * incremental.h (Script_info::Script_info): New ctor
4789 with input file index.
4790 (Script_info::input_file_index): New function.
4791 (Script_info::input_file_index_): New data member.
4792 (Incremental_binary::get_library): Add const.
4793 (Incremental_binary::get_script_info): Add const.
4794 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4795 * testsuite/Makefile.am (incremental_test_5): New test case.
4796 (incremental_test_6): New test case.
4797 * testsuite/Makefile.in: Regenerate.
4799 2011-07-06 Cary Coutant <ccoutant@google.com>
4801 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4802 debug output when command lines differ.
4804 2011-07-06 Cary Coutant <ccoutant@google.com>
4806 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4807 --incremental-patch option.
4808 * layout.cc (Free_list::allocate): Extend allocation beyond original
4810 (Layout::make_output_section): Mark sections that should get
4812 * options.cc (parse_percent): New function.
4813 * options.h (parse_percent): New function.
4814 (DEFINE_percent): New macro.
4815 (General_options): Add --incremental-patch option.
4816 * output.cc (Output_section::Output_section): Initialize new data
4818 (Output_section::add_input_section): Print section name when out
4820 (Output_section::add_output_section_data): Likewise.
4821 (Output_section::set_final_data_size): Add patch space when
4822 doing --incremental-full.
4823 (Output_section::do_reset_address_and_file_offset): Remove patch
4825 (Output_segment::set_section_list_addresses): Print debug output
4826 only if --incremental-update.
4827 * output.h (Output_section::set_is_patch_space_allowed): New function.
4828 (Output_section::is_patch_space_allowed_): New data member.
4829 (Output_section::patch_space_): New data member.
4830 * parameters.cc (Parameters::incremental_full): New function.
4831 * parameters.h (Parameters::incremental_full): New function
4832 * testsuite/Makefile.am (incremental_test_2): Add test for
4833 --incremental-patch option.
4834 * testsuite/Makefile.in: Regenerate.
4835 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4836 (t18): Remove function body.
4838 2011-07-05 Doug Kwan <dougkwan@google.com>
4841 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4842 Arm_Address type for relocation result.
4843 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4845 (Arm_relocate_functions::abs32): Use unaligned access.
4846 (Arm_relocate_functions::rel32): Ditto.
4847 (Arm_relocate_functions::prel31): Ditto.
4848 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4849 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4850 static data relocations.
4851 * testsuite/Makefile.in: Regnerate.
4852 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4854 2011-07-05 Ian Lance Taylor <iant@google.com>
4857 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4858 symbols if necessary.
4859 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4861 2011-07-05 Ian Lance Taylor <iant@google.com>
4864 * resolve.cc (Symbol::override_base_with_special): Simply override
4865 version with special symbol version, ignoring previous version.
4867 2011-07-05 Ian Lance Taylor <iant@google.com>
4869 * object.cc (Sized_relobj_file::include_section_group): Add
4870 information to comment about signature location.
4872 2011-07-02 Ian Lance Taylor <iant@google.com>
4875 * options.h (class General_options): Add -f and -F.
4876 * options.cc (General_options::finalize): Fatal error if -f/-F
4877 are used without -shared.
4878 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4880 2011-07-02 Ian Lance Taylor <iant@google.com>
4882 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4884 2011-07-01 Ian Lance Taylor <iant@google.com>
4888 * resolve.cc (Symbol::override_base_with_special): Don't override
4889 the version if the overriding symbol has a different name.
4890 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4891 all callers. If we give an error about an undefined version,
4892 define the base version if necessary.
4893 * dynobj.h (class Versions): Update declaration.
4894 * testsuite/weak_alias_test_5.cc: New file.
4895 * testsuite/weak_alias_test.script: New file.
4896 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4897 and versioned_alias have the right value, and call t2.
4898 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4899 weak_alias_test_5.so.
4900 (weak_alias_test_LDADD): Likewise.
4901 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4902 * testsuite/Makefile.in: Rebuild.
4904 2011-07-01 Ian Lance Taylor <iant@google.com>
4907 * options.h (class General_options): Support -z notext.
4908 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4910 (two_file_shared_nonpic.so): Likewise.
4911 (two_file_shared_mixed.so): Likewise.
4912 (two_file_shared_mixed_1.so): Likewise.
4913 (weak_undef_lib_nonpic.so): Likewise.
4914 (alt/weak_undef_lib_nonpic.so): Likewise.
4915 (tls_test_shared_nonpic.so): Likewise.
4916 * testsuite/Makefile.in: Rebuild.
4918 2011-07-01 Ian Lance Taylor <iant@google.com>
4921 * configure.ac: Test whether static linking works, setting
4922 the automake conditional HAVE_STATIC.
4923 * testsuite/Makefile.am: Disable tests using -static if
4924 HAVE_STATIC is not true.
4925 * configure, testsuite/Makefile.in: Rebuild.
4927 2011-07-01 Ian Lance Taylor <iant@google.com>
4930 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4931 Assert if we see DW_EH_PE_indirect.
4932 * target.h (Target::ehframe_datarel_base): New function.
4933 (Target::do_ehframe_datarel_base): New target function.
4934 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4935 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4938 2011-07-01 Ian Lance Taylor <iant@google.com>
4941 * options.h (class General_options): Add
4942 --ld-generated-unwind-info.
4943 * ehframe.cc (Fde::write): Add address parameter. Change all
4944 callers. If associated with PLT, fill in address and size.
4945 (Cie::set_output_offset): Only add merge mapping if there is an
4947 (Cie::write): Add address parameter. Change all callers.
4948 (Eh_frame::add_ehframe_for_plt): New function.
4949 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4950 input_offset_ fields into union u_, with new plt field.
4951 (Fde::Fde): Adjust for new union field.
4952 (Fde::Fde) [Output_data version]: New constructor.
4953 (Fde::add_mapping): Only add merge mapping if there is an object.
4954 (class Cie): Update declarations.
4955 (class Eh_frame): Declare add_ehframe_for_plt.
4956 * layout.cc (Layout::layout_eh_frame): Break out code into
4957 make_eh_frame_section, and call it.
4958 (Layout::make_eh_frame_section): New function.
4959 (Layout::add_eh_frame_for_plt): New function.
4960 * layout.h (class Layout): Update declarations.
4961 * merge.cc (Merge_map::add_mapping): Add assertion.
4962 * i386.cc: Include "dwarf.h".
4963 (class Output_data_plt_i386): Make first_plt_entry,
4964 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4965 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4966 and plt_eh_frame_fde.
4967 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4968 boundary. Call add_eh_frame_for_plt if appropriate.
4969 * x86_64.cc: Include "dwarf.h".
4970 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4971 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4972 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4973 and plt_eh_frame_fde.
4974 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4977 2011-06-29 Ian Lance Taylor <iant@google.com>
4980 * object.cc (Sized_relobj_file::layout_section): Change shdr
4981 parameter to be const.
4982 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4984 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4985 appropriate. Call layout_eh_frame_section.
4986 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4988 * object.h (class Sized_relobj_file): Update declarations.
4990 2011-06-29 Ian Lance Taylor <iant@google.com>
4993 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4995 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4997 2011-06-29 Ian Lance Taylor <iant@google.com>
5000 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5002 * layout.cc (Layout::layout_eh_frame): Likewise.
5004 2011-06-29 Ian Lance Taylor <iant@google.com>
5007 * layout.cc (Layout::symtab_section_shndx): New function.
5008 * layout.h (class Layout): Declare symtab_section_shndx.
5009 * output.cc (Output_section::write_header): Call it.
5011 2011-06-29 Ian Lance Taylor <iant@google.com>
5014 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5015 symbols which are not used in a relocation.
5017 2011-06-28 Ian Lance Taylor <iant@google.com>
5020 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5021 script create indistinguishable segments.
5022 (Layout::set_segment_offsets): Use stable_sort when sorting
5023 segments. Pass this to Compare_segments constructor.
5024 * layout.h (class Layout): Make segment_precedes non-static.
5025 (class Compare_segments): Change from struct to class. Add
5026 layout_ field. Add constructor.
5027 * script-sections.cc
5028 (Script_sections::attach_sections_using_phdrs_clause): Rename
5029 local orphan to is_orphan. Don't report failure to put empty
5030 section in segment. On attachment failure, report name of
5031 section, and attach to first PT_LOAD segment.
5033 2011-06-28 Ian Lance Taylor <iant@google.com>
5036 * target-select.cc (Target_selector::Target_selector): Add
5037 emulation parameter. Change all callers.
5038 (select_target_by_bfd_name): Rename from select_target_by_name.
5040 (select_target_by_emulation): New function.
5041 (supported_emulation_names): New function.
5042 * target-select.h (class Target_selector): Add emulation_ field.
5043 Update declarations.
5044 (Target_selector::recognize_by_bfd_name): Rename from
5045 recognize_by_name. Change all callers.
5046 (Target_selector::supported_bfd_names): Rename from
5047 supported_names. Change all callers.
5048 (Target_selector::recognize_by_emulation): New function.
5049 (Target_selector::supported_emulations): New function.
5050 (Target_selector::emulation): New function.
5051 (Target_selector::do_recognize_by_bfd_name): Rename from
5052 do_recognize_by_name. Change all callers.
5053 (Target_selector::do_supported_bfd_names): Rename from
5054 do_supported_names. Change all callers.
5055 (Target_selector::do_recognize_by_emulation): New function.
5056 (Target_selector::do_supported_emulations): New function.
5057 (select_target_by_bfd_name): Change name in declaration.
5058 (select_target_by_emulation): Declare.
5059 (supported_emulation_names): Declare.
5060 * parameters.cc (parameters_force_valid_target): Try to find
5061 target based on emulation from -m option.
5062 * options.h (class General_options): Change doc string for -m.
5063 * options.cc (help): Print emulations.
5064 (General_options::parse_V): Likewise.
5065 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5066 Add emulation parameter. Change all callers.
5068 2011-06-28 Ian Lance Taylor <iant@google.com>
5070 * target.h (class Target): Add osabi_ field.
5071 (Target::osabi): New function.
5072 (Target::set_osabi): New function.
5073 (Target::Target): Initialize osabi_.
5074 (Target::do_adjust_elf_header): Make pure virtual.
5075 (Sized_target::do_adjust_elf_header): Declare.
5076 * target.cc (Sized_target::do_adjust_elf_header): New function.
5077 (class Sized_target): Instantiate all versions.
5078 * freebsd.h (class Target_freebsd): Remove.
5079 (Target_selector_freebsd::do_recognize): Call set_osabi on
5081 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5082 (Target_selector_freebsd::set_osabi): Remove.
5083 * i386.cc (class Target_i386): Inherit from Sized_target rather
5084 than Target_freebsd.
5085 * x86_64.cc (class Target_x86_64): Likewise.
5087 2011-06-28 Ian Lance Taylor <iant@google.com>
5089 * target.h (Target::can_check_for_function_pointers): Rewrite.
5091 (Target::can_icf_inline_merge_sections): Likewise.
5092 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5093 (Target::Target_info): Add can_icf_inline_merge_sections field.
5094 (Target::do_can_check_for_function_pointers): New virtual
5096 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5097 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5098 from can_check_for_function_pointers, move in file.
5099 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5100 section_may_have_icf_unsafe_poineters, move in file.
5101 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5102 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5103 Rename from can_check_for_function_pointers, move in file.
5104 (Target_i386::can_icf_inline_merge_sections): Remove.
5105 (Target_i386::i386_info): Initialize
5106 can_icf_inline_merge_sections.
5107 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5108 Initialize can_icf_inline_merge_sections.
5109 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5110 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5111 Rename from can_check_for_function_pointers, move in file.
5112 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5113 (Target_x86_64::x86_64_info): Initialize
5114 can_icf_inline_merge_sections.
5115 * testsuite/testfile.cc (Target_test::test_target_info):
5117 * icf.cc (get_section_contents): Correct formatting.
5119 2011-06-27 Ian Lance Taylor <iant@google.com>
5121 * symtab.cc (Symbol::versioned_name): New function.
5122 (Symbol_table::add_to_final_symtab): Use versioned_name when
5124 (Symbol_table::sized_write_symbol): Likewise.
5125 * symtab.h (class Symbol): Declare versioned_name.
5126 * stringpool.h (class Stringpool_template): Add variant of add
5127 which takes a std::basic_string.
5128 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5129 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5130 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5131 (ver_test_12.o): New target.
5132 * testsuite/Makefile.in: Rebuild.
5134 2011-06-27 Doug Kwan <dougkwan@google.com>
5136 * arm.cc (Arm_relocate_functions::thm_jump8,
5137 Arm_relocate_functions::thm_jump11): Use a wider signed
5138 type to compute offset.
5139 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5141 * testsuite/Makefile.in: Regenerate.
5142 * testsuite/arm_branch_in_range.sh: Check test results of
5143 arm_thm_jump11 and arm_thm_jump8.
5144 * testsuite/arm_thm_jump11.s: New test source file.
5145 * testsuite/arm_thm_jump11.t: New linker script.
5146 * testsuite/arm_thm_jump8.s: New test source file.
5147 * testsuite/arm_thm_jump8.t: New linker script.
5149 2011-06-24 Ian Lance Taylor <iant@google.com>
5151 * layout.cc: Include "object.h".
5152 (ctors_sections_in_init_array): New static variable.
5153 (Layout::is_ctors_in_init_array): New function.
5154 (Layout::layout): Add entry to ctors_sections_in_init_array if
5156 * layout.h (class Layout): Declare is_ctors_in_init_array.
5157 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5158 is_ctors_reverse_view is set.
5159 (Sized_relobj_file::write_sections): Add layout parameter. Change
5160 all callers. Set is_ctors_reverse_view field of View_size.
5161 (Sized_relobj_file::reverse_words): New function.
5162 * object.h (Sized_relobj_file::View_size): Add
5163 is_ctors_reverse_view field.
5164 (class Sized_relobj_file): Update declarations.
5165 * testsuite/initpri3.c: New test.
5166 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5168 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5169 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5170 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5171 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5172 * testsuite/Makefile.in: Rebuild.
5174 2011-06-24 Cary Coutant <ccoutant@google.com>
5176 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5177 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5178 (debug_msg_cdebug.err): New targets.
5179 * testsuite/Makefile.in: Regenerate.
5180 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5181 Fix checks for link with shared library.
5183 2011-06-24 Doug Kwan <dougkwan@google.com>
5185 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5186 skip empty text sections.
5187 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5189 2011-06-22 Ian Lance Taylor <iant@google.com>
5192 * options.h (class General_options): Add --ctors-in-init-array.
5193 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5194 friends as SHT_PROGBITS for merging sections.
5195 (Layout::layout): Remove special handling of .init_array and
5196 friends. Don't sort if doing relocatable link. Sort for .ctors
5197 and .dtors if ctors_in_init_array.
5198 (Layout::make_output_section): Force correct section types for
5199 .init_array and friends. Don't sort if doing relocatable link,
5200 Don't sort .ctors and .dtors if ctors_in_init_array.
5201 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5202 (Layout::output_section_name): Add relobj parameter. Change all
5203 callers. Handle .ctors. and .dtors. in code rather than table.
5204 Handle .ctors and .dtors if ctors_in_init_array.
5205 (Layout::match_file_name): New function, moved from output.cc.
5206 * layout.h (class Layout): Update declarations.
5207 * output.cc: Include "layout.h".
5208 (Input_section_sort_entry::get_priority): New function.
5209 (Input_section_sort_entry::match_file_name): Just call
5210 Layout::match_file_name.
5211 (Output_section::Input_section_sort_init_fini_compare::operator()):
5212 Handle .ctors and .dtors. Sort by explicit priority rather than
5214 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5215 * testsuite/initpri2.c: New test.
5216 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5217 (check_PROGRAMS): Add initpri2.
5218 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5219 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5220 * configure, testsuite/Makefile.in: Rebuild.
5222 2011-06-19 Ian Lance Taylor <iant@google.com>
5225 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5226 .interp section to a PT_INTERP segment even if we have seen a
5227 --dynamic-linker option. Don't do it if we have seen a PHDRS
5228 clause in a linker script.
5229 (Layout::finalize): Don't create a .interp section if we've
5230 already create a PT_INTERP segment.
5231 (Layout::create_interp): Always call choose_output_section (revert
5232 patch of 2011-06-17). Don't create PT_INTERP segment.
5233 * script-sections.cc
5234 (Script_sections::create_note_and_tls_segments): Add a .interp
5235 section to a PT_INTERP segment even if we have seen a
5236 --dynamic-linker option.
5238 2011-06-18 Ian Lance Taylor <iant@google.com>
5240 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5241 merely because a non-PT_LOAD segment has a dynamic reloc.
5243 2011-06-18 Ian Lance Taylor <iant@google.com>
5245 * layout.cc (Layout::finish_dynamic_section): Don't create
5246 DT_FLAGS entry if not needed.
5248 2011-06-18 Ian Lance Taylor <iant@google.com>
5251 * layout.cc (Layout::layout_eh_frame): Correct handling of
5252 writable .eh_frame section.
5254 2011-06-17 Ian Lance Taylor <iant@google.com>
5257 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5258 symbol is redefined with the exact same object and value.
5260 2011-06-17 Ian Lance Taylor <iant@google.com>
5263 * layout.h (class Layout): Add interp_segment_ field.
5264 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5265 (Layout::attach_allocated_section_to_segment): If making shared
5266 library, put .interp section in PT_INTERP segment.
5267 (Layout::finalize): Also call create_interp if -dynamic-linker
5269 (Layout::create_interp): Assert that there is no PT_INTERP
5270 segment. If not using a SECTIONS clause, use make_output_section.
5271 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5272 * script-sections.cc
5273 (Script_sections::create_note_and_tls_segments): If making shared
5274 library, put .interp section in PT_INTERP segment.
5276 2011-06-17 Ian Lance Taylor <iant@google.com>
5278 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5279 when making a shared library.
5281 2011-06-17 Ian Lance Taylor <iant@google.com>
5283 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5284 parameter. Change all callers. Don't issue warning about PC32
5285 against locally defined symbol.
5287 2011-06-16 Ian Lance Taylor <iant@google.com>
5289 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5290 occurs in same object.
5292 2011-06-14 Alan Modra <amodra@gmail.com>
5294 * po/POTFILES.in: Regenerate.
5296 2011-06-09 Ian Lance Taylor <iant@google.com>
5298 * script-sections.cc
5299 (Orphan_output_section::set_section_addresses): For a relocatable
5300 link set address to 0.
5302 2011-06-09 Cary Coutant <ccoutant@google.com>
5305 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5306 used with --compress-debug-sections.
5307 * gold/object.cc (Sized_relobj_file::do_layout): Report
5308 uncompressed size of compressed input sections.
5310 2011-06-08 Cary Coutant <ccoutant@google.com>
5313 * testsuite/two_file_test_2_v1.cc: Change initialization of
5314 v2 to keep it in .data.
5316 2011-06-07 Cary Coutant <ccoutant@google.com>
5318 * common.cc (Symbol_table::do_allocate_commons_list): Call
5320 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5321 (Errors::fallback): New function.
5322 (gold_fallback): New function.
5323 * errors.h (Errors::fallback): New function.
5324 * gold.cc (gold_exit): Change status parameter to enum; adjust
5326 (queue_initial_tasks): Call gold_fallback.
5327 * gold.h: Include cstdlib.
5328 (Exit_status): New enum type.
5329 (gold_exit): Change status parameter to enum.
5330 (gold_fallback): New function.
5331 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5332 (Layout::create_symtab_sections): Likewise.
5333 (Layout::create_shdrs): Likewise.
5334 * main.cc (main): Adjust call to gold_exit.
5335 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5336 (Output_data_got::add_got_entry_pair): Likewise.
5337 (Output_section::add_input_section): Likewise.
5338 (Output_section::add_output_section_data): Likewise.
5339 (Output_segment::set_section_list_addresses): Likewise.
5340 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5342 2011-06-07 Cary Coutant <ccoutant@google.com>
5344 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5345 for incremental links.
5346 * output.cc (Output_segment::set_section_list_addresses): Remove
5347 FIXME and test for TLS or BSS.
5349 2011-06-07 Cary Coutant <ccoutant@google.com>
5351 * testsuite/Makefile.am: Add incremental_copy_test,
5352 incremental_common_test_1.
5353 * testsuite/Makefile.in: Regenerate.
5354 * testsuite/common_test_1_v1.c: New source file.
5355 * testsuite/common_test_1_v2.c: New source file.
5356 * testsuite/copy_test_v1.cc: New source file.
5358 2011-06-07 Cary Coutant <ccoutant@google.com>
5360 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5361 update, allocate common from bss section's free list.
5362 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5363 linker-defined symbols.
5364 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5365 Skip GOT and PLT entries that are no longer referenced.
5366 (Output_section_incremental_inputs::write_info_blocks): Mark
5367 linker-defined symbols.
5368 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5369 * output.cc (Output_section::allocate): New function.
5370 * output.h (Output_section::allocate): New function.
5371 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5372 linker-defined symbols.
5373 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5374 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5375 (Symbol::init_base_output_data): Likewise.
5376 (Symbol::init_base_output_segment): Likewise.
5377 (Symbol::init_base_constant): Likewise.
5378 (Sized_symbol::init_output_data): Likewise.
5379 (Sized_symbol::init_output_segment): Likewise.
5380 (Sized_symbol::init_constant): Likewise.
5381 (Symbol_table::do_define_in_output_data): Likewise.
5382 (Symbol_table::do_define_in_output_segment): Likewise.
5383 (Symbol_table::do_define_as_constant): Likewise.
5384 * symtab.h (Symbol::is_predefined): New function.
5385 (Symbol::init_base_output_data): Add is_predefined parameter.
5386 (Symbol::init_base_output_segment): Likewise.
5387 (Symbol::init_base_constant): Likewise.
5388 (Symbol::is_predefined_): New data member.
5389 (Sized_symbol::init_output_data): Add is_predefined parameter.
5390 (Sized_symbol::init_output_segment): Likewise.
5391 (Sized_symbol::init_constant): Likewise.
5392 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5394 2011-06-07 Cary Coutant <ccoutant@google.com>
5396 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5397 instead of emit_copy_reloc.
5398 (Copy_relocs::emit_copy_reloc): Refactor.
5399 (Copy_relocs::make_copy_reloc): New function.
5400 (Copy_relocs::add_copy_reloc): Remove.
5401 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5403 (Copy_relocs::make_copy_reloc): New function.
5404 (Copy_relocs::add_copy_reloc): Remove.
5405 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5406 unchanged input files.
5407 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5408 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5409 Reserve BSS space for COPY relocations.
5410 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5411 (Output_section_incremental_inputs::write_info_blocks): Record
5412 whether a symbol is copied from a shared object.
5413 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5414 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5415 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5416 (Incremental_input_entry_reader::get_output_symbol_index): Add
5418 (Incremental_binary::emit_copy_relocs): New function.
5419 (Incremental_binary::do_emit_copy_relocs): New function.
5420 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5422 (Sized_incremental_binary::add_copy_reloc): New function.
5423 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5424 (Sized_incremental_binary::Copy_reloc): New struct.
5425 (Sized_incremental_binary::Copy_relocs): New typedef.
5426 (Sized_incremental_binary::copy_relocs_): New data member.
5427 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5428 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5429 * target.h (Sized_target::emit_copy_reloc): New function.
5430 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5432 2011-06-02 Cary Coutant <ccoutant@google.com>
5435 * gold/archive.cc (Archive::Archive): Initialize new data member.
5436 (Archive::include_all_members): Return if archive has already been
5438 * gold/archive.h (Archive::include_all_members_): New data member.
5440 2011-06-02 Nick Clifton <nickc@redhat.com>
5442 * dynobj.h: Fix spelling mistake in comment.
5443 * output.cc: Likewise.
5445 2011-05-31 Doug Kwan <dougkwan@google.com>
5449 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
5450 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5451 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5452 redundant arm_exidx_test.so.
5453 * testsuite/Makefile.in: Regenerate.
5454 (check_SCRIPTS): Add pr12826.sh
5455 (check_DATA): Add pr12826.stdout
5456 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5457 * testsuite/pr12826.sh: New file.
5458 * testsuite/pr12826_1.s: Ditto.
5459 * testsuite/pr12826_1.s: Ditto.
5461 2011-05-30 Ian Lance Taylor <iant@google.com>
5463 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5466 2011-05-29 Ian Lance Taylor <iant@google.com>
5469 * testsuite/Makefile.am: Use different file name for two_file_test
5470 temporary file for each incremental test.
5471 * testsuite/Makefile.in: Rebuild.
5473 2011-05-29 Ian Lance Taylor <iant@google.com>
5475 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5476 binary input file is empty.
5478 2011-05-27 Ian Lance Taylor <iant@google.com>
5480 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5481 (ver_test_9.so): Likewise.
5482 * testsuite/Makefile.in: Rebuild.
5484 2011-05-26 Cary Coutant <ccoutant@google.com>
5486 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5487 * incremental.cc (Incremental_inputs::report_input_section): Fix
5488 comment, indentation.
5489 (Incremental_inputs::report_comdat_group): New function.
5490 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5491 of data for incremental input file entry.
5492 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5493 group count, COMDAT group signatures.
5494 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5495 an unchanged input file.
5496 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5497 Initialize new data member.
5498 (Incremental_object_entry::add_comdat_group): New function.
5499 (Incremental_object_entry::get_comdat_group_count): New function.
5500 (Incremental_object_entry::get_comdat_signature_key): New function.
5501 (Incremental_object_entry::groups_): New data member.
5502 (Incremental_inputs::report_comdat_group): New function.
5503 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5504 data for incremental input file entry.
5505 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5506 (Incremental_input_entry_reader::get_input_section): Adjust size of
5507 data for incremental input file entry.
5508 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5509 (Incremental_input_entry_reader::get_comdat_group_signature): New
5511 * object.cc (Sized_relobj::include_section_group): Report kept
5512 COMDAT groups for incremental links.
5514 2011-05-24 David Meyer <pdox@google.com>
5516 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5517 with name parameter. Add found_name parameter.
5518 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5519 * dirsearch.h (class Dirsearch): Update declaration.
5521 2011-05-24 Ian Lance Taylor <iant@google.com>
5523 * archive.cc (Library_base::should_include_member): Pull in object
5524 from archive if it defines the entry symbol.
5525 * parameters.cc (Parameters::entry): New function.
5526 * parameters.h (class Parameters): Declare entry.
5527 * output.h (class Output_file_header): Remove entry_ field.
5528 * output.cc (Output_file_header::Output_file_header): Remove entry
5529 parameter. Change all callers.
5530 (Output_file_header::entry): Use parameters->entry.
5531 * gold.cc (queue_middle_tasks): Likewise.
5532 * plugin.cc (Plugin_hook::run): Likewise.
5534 2011-05-24 Cary Coutant <ccoutant@google.com>
5536 * gold.cc (queue_initial_tasks): Pass incremental base filename
5537 to Output_file::open_base_file; don't print error message.
5538 * incremental-dump.cc (main): Adjust call to
5539 Output_file::open_for_modification.
5540 * incremental-dump.cc (main): Likewise.
5541 * incremental.cc (Incremental_inputs::report_command_line):
5542 Ignore --incremental-base option when comparing command lines.
5543 Ignore parameter when given as separate argument.
5544 * options.h (class General_options): Add --incremental-base.
5545 * output.cc (Output_file::Output_file):
5546 (Output_file::open_base_file): Add base_name and writable parameters;
5547 read base file into new file; print error message here.
5548 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5550 * output.h (Output_file::open_for_modification): Rename to...
5551 (Output_file::open_base_file): ...this; add base_name and
5552 writable parameters; adjust all callers.
5553 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5555 * testsuite/Makefile.am (incremental_test_4): Test
5557 * testsuite/Makefile.in: Regenerate.
5559 2011-05-24 Cary Coutant <ccoutant@google.com>
5561 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5563 * testsuite/Makefile.in: Regenerate.
5564 * testsuite/two_file_test_1_v1.cc: New test source file.
5565 * testsuite/two_file_test_1b_v1.cc: New test source file.
5566 * testsuite/two_file_test_2_v1.cc: New test source file.
5568 2011-05-24 Cary Coutant <ccoutant@google.com>
5570 * dynobj.h (Dynobj::do_dynobj): New function.
5571 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5572 flag and soname for shared objects.
5573 * incremental.cc (Incremental_inputs::report_object): Make
5574 either Incremental_object_entry or Incremental_dynobj_entry; add
5575 soname to string table.
5576 (Incremental_inputs::report_input_section): Add assertion.
5577 (Output_section_incremental_inputs::set_final_data_size): Adjust
5578 type of input file entry for shared libraries; adjust size of
5579 shared library info entry.
5580 (Output_section_incremental_inputs::write_input_files): Write
5581 as_needed flag for shared libraries.
5582 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5583 of input file entry for shared libraries; write soname.
5584 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5585 soname from incremental info.
5586 * incremental.h (enum Incremental_input_flags): Add
5587 INCREMENTAL_INPUT_AS_NEEDED.
5588 (Incremental_input_entry::Incremental_input_entry): Initialize new
5590 (Incremental_input_entry::set_as_needed): New function.
5591 (Incremental_input_entry::as_needed): New function.
5592 (Incremental_input_entry::do_dynobj_entry): New function.
5593 (Incremental_input_entry::as_needed_): New data member.
5594 (Incremental_object_entry::Incremental_object_entry): Don't check
5596 (Incremental_object_entry::do_type): Likewise.
5597 (class Incremental_dynobj_entry): New class.
5598 (Incremental_input_entry_reader::as_needed): New function.
5599 (Incremental_input_entry_reader::get_soname): New function.
5600 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5601 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5602 size of shared library info entry.
5603 * layout.cc (Layout::finish_dynamic_section): Don't test for
5604 incremental link when adding DT_NEEDED entries.
5605 * object.h (Object::Object): Initialize new data member.
5606 (Object::dynobj): New function.
5607 (Object::set_as_needed): New function.
5608 (Object::as_needed): New function.
5609 (Object::do_dynobj): New function.
5610 (Object::as_needed_): New data member.
5612 2011-05-24 Cary Coutant <ccoutant@google.com>
5614 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5615 info; adjust display of GOT entries.
5616 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5617 vector of input objects; remove file_status_.
5618 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5619 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5620 got_plt reader; call target hooks to reserve GOT entries.
5621 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5622 of input file info header and GOT info entry.
5623 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5625 (Got_plt_view_info::got_descriptor): Remove.
5626 (Got_plt_view_info::sym_index): New data member.
5627 (Got_plt_view_info::input_index): New data member.
5628 (Local_got_offset_visitor::visit): Write input file index.
5629 (Global_got_offset_visitor::visit): Write 0 for input file index.
5630 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5631 with sym_index and input_index.
5632 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5633 incremental info GOT entry; replace got_descriptor with input_index.
5634 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5635 map from input file index to object.
5636 (Sized_relobj_incr::do_layout): Replace direct data member reference
5637 with accessor function.
5638 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5639 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5640 Adjust size of input file info header.
5641 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5642 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5643 (Incremental_input_entry_reader::get_input_section): Adjust size of
5644 input file info header.
5645 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5646 of incremental info GOT entry.
5647 (Incremental_got_plt_reader::get_got_desc): Remove.
5648 (Incremental_got_plt_reader::get_got_symndx): New function.
5649 (Incremental_got_plt_reader::get_got_input_index): New function.
5650 (Sized_incremental_binary::Sized_incremental_binary): Remove
5651 file_status_; add input_objects_.
5652 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5653 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5654 (Sized_incremental_binary::file_is_unchanged): Remove.
5655 (Sized_incremental_binary::set_input_object): New function.
5656 (Sized_incremental_binary::input_object): New function.
5657 (Sized_incremental_binary::file_status_): Remove.
5658 (Sized_incremental_binary::input_objects_): New data member.
5659 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5661 (Sized_relobj_incr::invalid_address): Move to base class.
5662 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5664 (Sized_relobj_incr::do_output_section_offset): Likewise.
5665 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5666 (Sized_relobj_incr::section_offsets_): Likewise.
5667 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5669 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5670 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5671 with accessor function.
5672 (Sized_relobj_file::do_layout): Likewise.
5673 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5674 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5675 (Sized_relobj_file::compute_final_local_value): Replace refs to
5676 section_offsets_ with accessor function.
5677 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5678 * object.h (Relobj::Relobj): Initialize new data members.
5679 (Relobj::add_dyn_reloc): New function.
5680 (Relobj::first_dyn_reloc): New function.
5681 (Relobj::dyn_reloc_count): New function.
5682 (Relobj::first_dyn_reloc_): New data member.
5683 (Relobj::dyn_reloc_count_): New data member.
5684 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5686 (Sized_relobj::Address): New typedef.
5687 (Sized_relobj::invalid_address): Move here from child class.
5688 (Sized_relobj::Sized_relobj): Initialize new data members.
5689 (Sized_relobj::sized_relobj): New function.
5690 (Sized_relobj::is_output_section_offset_invalid): Move here from
5692 (Sized_relobj::get_output_section_offset): Likewise.
5693 (Sized_relobj::local_has_got_offset): Likewise.
5694 (Sized_relobj::local_got_offset): Likewise.
5695 (Sized_relobj::set_local_got_offset): Likewise.
5696 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5697 (Sized_relobj::clear_got_offsets): New function.
5698 (Sized_relobj::section_offsets): Move here from child class.
5699 (Sized_relobj::do_output_section_offset): Likewise.
5700 (Sized_relobj::do_set_section_offset): Likewise.
5701 (Sized_relobj::Local_got_offsets): Likewise.
5702 (Sized_relobj::local_got_offsets_): Likewise.
5703 (Sized_relobj::section_offsets_): Likewise.
5704 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5706 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5708 (Sized_relobj_file::sized_relobj): New function
5709 (Sized_relobj_file::local_has_got_offset): Move to base class.
5710 (Sized_relobj_file::local_got_offset): Likewise.
5711 (Sized_relobj_file::set_local_got_offset): Likewise.
5712 (Sized_relobj_file::get_output_section_offset): Likewise.
5713 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5714 (Sized_relobj_file::do_output_section_offset): Likewise.
5715 (Sized_relobj_file::do_set_section_offset): Likewise.
5716 (Sized_relobj_file::Local_got_offsets): Likewise.
5717 (Sized_relobj_file::local_got_offsets_): Likewise.
5718 (Sized_relobj_file::section_offsets_): Likewise.
5719 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5721 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5722 (Output_reloc::get_symbol_index): Likewise.
5723 (Output_reloc::local_section_offset): Likewise.
5724 (Output_reloc::get_address): Likewise.
5725 (Output_reloc::symbol_value): Likewise.
5726 (Output_data_got::reserve_slot): Move to class definition.
5727 (Output_data_got::reserve_local): New function.
5728 (Output_data_got::reserve_slot_for_global): Remove.
5729 (Output_data_got::reserve_global): New function.
5730 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5731 (all constructors, two instantiations).
5732 (Output_reloc::get_relobj): New function (two instantiations).
5733 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5734 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5735 (Output_data_reloc::add_global): Adjust type of relobj.
5736 (Output_data_reloc::add_global_relative): Likewise.
5737 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5738 (Output_data_reloc::add_local): Likewise.
5739 (Output_data_reloc::add_local_relative): Likewise.
5740 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5741 (Output_data_reloc::add_local_section): Likewise.
5742 (Output_data_reloc::add_output_section): Likewise.
5743 (Output_data_reloc::add_absolute): Likewise.
5744 (Output_data_reloc::add_target_specific): Likewise.
5745 (Output_data_got::reserve_slot): Move definition here.
5746 (Output_data_got::reserve_local): New function.
5747 (Output_data_got::reserve_global): New function.
5748 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5749 section_offsets_ with accessor function.
5750 (Sized_relobj_file::write_sections): Likewise.
5751 (Sized_relobj_file::do_relocate_sections): Likewise.
5752 * target.h (Sized_target::reserve_local_got_entry): New function.
5753 (Sized_target::reserve_global_got_entry): New function.
5754 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5755 (Target_x86_64::reserve_global_got_entry): New function.
5756 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5758 2011-05-23 Cary Coutant <ccoutant@google.com>
5760 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5761 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5762 bit when checking got_type.
5763 * incremental.cc (Sized_incremental_binary::setup_readers):
5764 Store symbol table and string table locations; initialize bit vector
5765 of file status flags.
5766 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5768 (Sized_incremental_binary::do_process_got_plt): New function.
5769 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5770 (Output_section_incremental_inputs::set_final_data_size): Record
5771 file index for each input file.
5772 (Output_section_incremental_inputs::write_got_plt): Store file index
5773 instead of input entry offset for each GOT entry.
5775 (Incremental_input_entry::Incremental_input_entry): Initialize new
5777 (Incremental_input_entry::set_offset): Store file index.
5778 (Incremental_input_entry::get_file_index): New function.
5779 (Incremental_input_entry::file_index_): New data member.
5780 (Incremental_binary::process_got_plt): New function.
5781 (Incremental_binary::do_process_got_plt): New function.
5782 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5784 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5785 (Sized_incremental_binary::set_file_is_unchanged): New function.
5786 (Sized_incremental_binary::file_is_unchanged): New function.
5787 (Sized_incremental_binary::do_process_got_plt): New function.
5788 (Sized_incremental_binary::file_status_): New data member.
5789 (Sized_incremental_binary::main_symtab_loc_): New data member.
5790 (Sized_incremental_binary::main_strtab_loc_): New data member.
5791 * output.cc (Output_data_got::Got_entry::write): Add case
5793 (Output_data_got::add_global): Call add_got_entry.
5794 (Output_data_got::add_global_plt): Likewise.
5795 (Output_data_got::add_global_with_rel): Likewise.
5796 (Output_data_got::add_global_with_rela): Likewise.
5797 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5798 (Output_data_got::add_global_pair_with_rela): Likewise.
5799 (Output_data_got::add_local): Call add_got_entry.
5800 (Output_data_got::add_local_plt): Likewise.
5801 (Output_data_got::add_local_with_rel): Likewise.
5802 (Output_data_got::add_local_with_rela): Likewise.
5803 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5804 (Output_data_got::add_local_pair_with_rela): Likewise.
5805 (Output_data_got::reserve_slot): New function.
5806 (Output_data_got::reserve_slot_for_global): New function.
5807 (Output_data_got::add_got_entry): New function.
5808 (Output_data_got::add_got_entry_pair): New function.
5809 (Output_section::add_output_section_data): Edit FIXME.
5811 (Output_section_data_build::Output_section_data_build): New
5812 constructor with size parameter.
5813 (Output_data_space::Output_data_space): Likewise.
5814 (Output_data_got::Output_data_got): Initialize new data member; new
5815 constructor with size parameter.
5816 (Output_data_got::add_constant): Call add_got_entry.
5817 (Output_data_got::reserve_slot): New function.
5818 (Output_data_got::reserve_slot_for_global): New function.
5819 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5820 (Output_data_got::add_got_entry): New function.
5821 (Output_data_got::add_got_entry_pair): New function.
5822 (Output_data_got::free_list_): New data member.
5823 * target.h (Sized_target::init_got_plt_for_update): New function.
5824 (Sized_target::register_global_plt_entry): New function.
5825 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5826 Initialize new data member; call init; add constructor with PLT count.
5827 (Output_data_plt_x86_64::init): New function.
5828 (Output_data_plt_x86_64::add_relocation): New function.
5829 (Output_data_plt_x86_64::reserve_slot): New function.
5830 (Output_data_plt_x86_64::free_list_): New data member.
5831 (Target_x86_64::init_got_plt_for_update): New function.
5832 (Target_x86_64::register_global_plt_entry): New function.
5833 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5834 incremental updates.
5835 (Output_data_plt_x86_64::add_relocation): New function.
5836 * testsuite/object_unittest.cc (Object_test): Set default options.
5838 2011-05-16 Ian Lance Taylor <iant@google.com>
5840 * options.h (class General_options): Make -i a synonym for -r.
5842 2011-05-16 Ian Lance Taylor <iant@google.com>
5844 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5846 2011-05-10 Cary Coutant <ccoutant@google.com>
5848 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5851 2011-05-06 Ian Lance Taylor <iant@google.com>
5853 * layout.cc (Layout::layout): If the output section flags change,
5854 update the ordering.
5856 2011-04-25 Cary Coutant <ccoutant@google.com>
5858 * incremental-dump.cc (dump_incremental_inputs): Print local
5859 symbol info for each input file.
5861 (Output_section_incremental_inputs::set_final_data_size): Add local
5862 symbol info to input file entries in incremental info.
5863 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5864 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5865 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5866 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5868 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5869 (Sized_incr_relobj::do_relocate): Write the local symbols.
5870 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5871 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5872 Adjust size of input file header.
5873 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5874 (Incremental_inputs_reader::get_local_symbol_count): New function.
5875 (Incremental_inputs_reader::get_input_section): Adjust size of input
5877 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5878 (Sized_incr_relobj::This): New typedef.
5879 (Sized_incr_relobj::sym_size): New const data member.
5880 (Sized_incr_relobj::Local_symbol): New struct.
5881 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5882 (Sized_incr_relobj::do_local_symbol_offset): New function.
5883 (Sized_incr_relobj::local_symbol_count_): New data member.
5884 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5885 (Sized_incr_relobj::local_symbol_index_): New data member.
5886 (Sized_incr_relobj::local_symbol_offset_): New data member.
5887 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5888 (Sized_incr_relobj::local_symbols_): New data member.
5889 * object.h (Relobj::output_local_symbol_count): New function.
5890 (Relobj::local_symbol_offset): New function.
5891 (Relobj::do_output_local_symbol_count): New function.
5892 (Relobj::do_local_symbol_offset): New function.
5893 (Sized_relobj::do_output_local_symbol_count): New function.
5894 (Sized_relobj::do_local_symbol_offset): New function.
5896 2011-04-22 Vladimir Simonov <sv@sw.ru>
5898 * descriptors.cc (set_close_on_exec): New function.
5899 (Descriptors::open): Use set_close_on_exec.
5900 * output.cc (S_ISLNK): Define if not defined.
5902 2011-04-22 Cary Coutant <ccoutant@google.com>
5904 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5906 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5907 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5908 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5910 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5911 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5912 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5914 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5916 (Incremental_binary::apply_incremental_relocs): New function.
5917 (Incremental_binary::do_apply_incremental_relocs): New function.
5918 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5920 (Sized_incremental_binary::add_global_symbol): New function.
5921 (Sized_incremental_binary::global_symbol): New function.
5922 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5923 (Sized_incremental_binary::symbol_map_): New data member.
5924 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5925 * target.h (Sized_target::apply_relocation): New function.
5926 * target-reloc.h (apply_relocation): New function.
5927 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5929 2011-04-22 Doug Kwan <dougkwan@google.com>
5931 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5932 flag of a SHT_ARM_EXIDX section.
5933 * testsuite/Makefile.am (arm_exidx_test): New test rules.
5934 * testsuite/Makefile.in: Regenerate.
5935 * testsuite/arm_exidx_test.s: New file.
5936 * testsuite/arm_exidx_test.sh: Same.
5938 2011-04-20 Cary Coutant <ccoutant@google.com>
5941 * archive.h (Incremental_archive_entry::Archive_member):
5942 Initialize arg_serial_ (second constructor).
5944 2011-04-17 Ian Lance Taylor <iant@google.com>
5946 * object.cc (Relocate_info::location): Simplify location string.
5947 * errors.cc (Errors::error_at_location): Don't print program
5949 (Errors::warning_at_location): Likewise.
5950 (Errors::undefined_symbol): Likewise.
5951 * testsuite/debug_msg.sh: Update accordingly.
5953 2011-04-14 Cary Coutant <ccoutant@google.com>
5955 * gold/layout.cc (Layout::symtab_section_offset): New function.
5956 * gold/layout.h (Layout::symtab_section_offset): New function.
5957 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5959 2011-04-12 Ian Lance Taylor <iant@google.com>
5961 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5962 with MREMAP_MAYMOVE.
5963 * output.h (class Output_file): Add map_is_allocated_ field.
5964 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5965 not available, provide stubs. If mremap is not available, #define
5967 (MREMAP_MAYMOVE): Define if not defined.
5968 (Output_file::Output_file): Initialize map_is_allocated_.
5969 (Output_file::resize): Check map_is_allocated_.
5970 (Output_file::map_anonymous): If mmap fails, use malloc.
5971 (Output_file::unmap): Don't do anything for an anonymous map.
5972 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5973 is not available, provide stubs.
5974 (File_read::View::~View): Use free rather than delete[].
5975 (File_read::make_view): Use malloc rather than new[]. If mmap
5977 (File_read::find_or_make_view): Use malloc rather than new[].
5978 * gold.h: Remove HAVE_REMAP code.
5979 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5980 exists. Rename mremap to gold_mremap. If mmap is not available
5982 * configure, config.in: Rebuild.
5984 2011-04-11 Ian Lance Taylor <iant@google.com>
5986 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5987 initialize local variable v.
5989 2011-04-11 Cary Coutant <ccoutant@google.com>
5991 * archive.cc (Archive::include_member): Adjust call to
5993 (Add_archive_symbols::run): Track argument serial numbers.
5994 (Lib_group::include_member): Likewise.
5995 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5996 * archive.h (Incremental_archive_entry::Archive_member):
5997 Initialize arg_serial_.
5998 (Archive_member::arg_serial_): New data member.
5999 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6000 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6002 (Sized_dynobj::do_for_all_local_got_entries): New function.
6003 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6005 * fileread.cc (get_mtime): New function.
6006 * fileread.h (get_mtime): New function.
6007 * gold.cc (queue_initial_tasks): Check for incremental update.
6008 (process_incremental_input): New function.
6009 (queue_middle_tasks): Don't force valid target for incremental
6011 * incremental-dump.cc (find_input_containing_global): Adjust
6012 size of symbol info entry.
6013 (dump_incremental_inputs): Dump argument serial number and
6014 in_system_directory flag; bias shndx by 1; print symbol names
6015 when dumping per-file symbol lists; use new symbol info readers.
6017 (Output_section_incremental_inputs:update_data_size): New function.
6018 (Sized_incremental_binary::setup_readers): Setup input readers
6019 for each input file; build maps for files added from libraries
6021 (Sized_incremental_binary::check_input_args): New function.
6022 (Sized_incremental_binary::do_check_inputs): Build map of argument
6023 serial numbers to input arguments.
6024 (Sized_incremental_binary::do_file_has_changed): Rename
6025 do_file_is_unchanged to this; compare file modification times.
6026 (Sized_incremental_binary::do_init_layout): New function.
6027 (Sized_incremental_binary::do_reserve_layout): New function.
6028 (Sized_incremental_binary::do_get_input_reader): Remove.
6029 (Sized_incremental_binary::get_symtab_view): New function.
6030 (Incremental_checker::can_incrementally_link_output_file): Remove.
6031 (Incremental_inputs::report_command_line): Exclude --debug options.
6032 (Incremental_inputs::report_archive_begin): Add parameter; track
6033 argument serial numbers; don't put input file entry for archive
6034 before archive members.
6035 (Incremental_inputs::report_archive_end): Put input file entry
6036 for archive after archive members.
6037 (Incremental_inputs::report_object): Add parameter; track argument
6038 serial numbers and in_system_directory flag.
6039 (Incremental_inputs::report_script): Add parameter; track argument
6041 (Output_section_incremental_inputs::set_final_data_size): Adjust
6042 size of symbol info entry; check for forwarding symbols.
6043 (Output_section_incremental_inputs::write_input_files): Write
6044 in_system_directory flag and argument serial number.
6045 (Output_section_incremental_inputs::write_info_blocks): Map section
6046 indices between incremental info and original input file; store
6047 input section index for each symbol.
6048 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6049 change operator() to visit().
6050 (class Global_got_offset_visitor): Likewise.
6051 (class Global_symbol_visitor_got_plt):
6052 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6054 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6055 (Sized_incr_relobj::do_read_symbols): New function.
6056 (Sized_incr_relobj::do_layout): New function.
6057 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6058 (Sized_incr_relobj::do_add_symbols): New function.
6059 (Sized_incr_relobj::do_should_include_member): New function.
6060 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6061 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6062 (Sized_incr_relobj::do_section_size): New function.
6063 (Sized_incr_relobj::do_section_name): New function.
6064 (Sized_incr_relobj::do_section_contents): New function.
6065 (Sized_incr_relobj::do_section_flags): New function.
6066 (Sized_incr_relobj::do_section_entsize): New function.
6067 (Sized_incr_relobj::do_section_address): New function.
6068 (Sized_incr_relobj::do_section_type): New function.
6069 (Sized_incr_relobj::do_section_link): New function.
6070 (Sized_incr_relobj::do_section_info): New function.
6071 (Sized_incr_relobj::do_section_addralign): New function.
6072 (Sized_incr_relobj::do_initialize_xindex): New function.
6073 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6074 (Sized_incr_relobj::do_read_relocs): New function.
6075 (Sized_incr_relobj::do_gc_process_relocs): New function.
6076 (Sized_incr_relobj::do_scan_relocs): New function.
6077 (Sized_incr_relobj::do_count_local_symbols): New function.
6078 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6079 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6080 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6081 (Sized_incr_relobj::do_relocate): New function.
6082 (Sized_incr_relobj::do_set_section_offset): New function.
6083 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6084 (Sized_incr_dynobj::do_read_symbols): New function.
6085 (Sized_incr_dynobj::do_layout): New function.
6086 (Sized_incr_dynobj::do_add_symbols): New function.
6087 (Sized_incr_dynobj::do_should_include_member): New function.
6088 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6089 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6090 (Sized_incr_dynobj::do_section_size): New function.
6091 (Sized_incr_dynobj::do_section_name): New function.
6092 (Sized_incr_dynobj::do_section_contents): New function.
6093 (Sized_incr_dynobj::do_section_flags): New function.
6094 (Sized_incr_dynobj::do_section_entsize): New function.
6095 (Sized_incr_dynobj::do_section_address): New function.
6096 (Sized_incr_dynobj::do_section_type): New function.
6097 (Sized_incr_dynobj::do_section_link): New function.
6098 (Sized_incr_dynobj::do_section_info): New function.
6099 (Sized_incr_dynobj::do_section_addralign): New function.
6100 (Sized_incr_dynobj::do_initialize_xindex): New function.
6101 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6102 (make_sized_incremental_object): New function.
6103 (Incremental_library::copy_unused_symbols): New function.
6104 (Incremental_library::do_for_all_unused_symbols): New function.
6105 * incremental.h (enum Incremental_input_flags): New type.
6106 (class Incremental_checker): Remove.
6107 (Incremental_input_entry::Incremental_input_entry): Add argument
6109 (Incremental_input_entry::arg_serial): New function.
6110 (Incremental_input_entry::set_is_in_system_directory): New function.
6111 (Incremental_input_entry::is_in_system_directory): New function.
6112 (Incremental_input_entry::arg_serial_): New data member.
6113 (Incremental_input_entry::is_in_system_directory_): New data member.
6114 (class Script_info): Move here from script.h.
6115 (Script_info::Script_info): Add filename parameter.
6116 (Script_info::filename): New function.
6117 (Script_info::filename_): New data member.
6118 (Incremental_script_entry::Incremental_script_entry): Add argument
6120 (Incremental_object_entry::Incremental_object_entry): Likewise.
6121 (Incremental_object_entry::add_input_section): Build list of input
6122 sections with map to original shndx.
6123 (Incremental_object_entry::get_input_section_index): New function.
6124 (Incremental_object_entry::shndx_): New data member.
6125 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6126 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6127 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6129 (Incremental_inputs::report_archive_begin): Likewise.
6130 (Incremental_inputs::report_object): Likewise.
6131 (Incremental_inputs::report_script): Likewise.
6132 (class Incremental_global_symbol_reader): New class.
6133 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6134 and store flags and input file type.
6135 (Incremental_input_entry_reader::arg_serial): New function.
6136 (Incremental_input_entry_reader::type): Extract type from flags.
6137 (Incremental_input_entry_reader::is_in_system_directory): New function.
6138 (Incremental_input_entry_reader::get_input_section_count): Call
6139 accessor function for type.
6140 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6141 function for type; adjust size of global symbol entry.
6142 (Incremental_input_entry_reader::get_global_symbol_count): Call
6143 accessor function for type.
6144 (Incremental_input_entry_reader::get_object_count): Likewise.
6145 (Incremental_input_entry_reader::get_object_offset): Likewise.
6146 (Incremental_input_entry_reader::get_member_count): Likewise.
6147 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6148 (Incremental_input_entry_reader::get_member_offset): Likewise.
6149 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6150 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6151 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6152 (Incremental_input_entry_reader::get_global_symbol_reader): New
6154 (Incremental_input_entry_reader::get_output_symbol_index): New
6156 (Incremental_input_entry_reader::type_): Remove.
6157 (Incremental_input_entry_reader::flags_): New data member.
6158 (Incremental_inputs_reader::input_file_offset): New function.
6159 (Incremental_inputs_reader::input_file_index): New function.
6160 (Incremental_inputs_reader::input_file): Call input_file_offset.
6161 (Incremental_inputs_reader::input_file_at_offset): New function.
6162 (Incremental_relocs_reader::get_r_type): Reformat.
6163 (Incremental_relocs_reader::get_r_shndx): Reformat.
6164 (Incremental_relocs_reader::get_r_offset): Reformat.
6165 (Incremental_relocs_reader::data): New function.
6166 (Incremental_binary::Incremental_binary): Initialize new data members.
6167 (Incremental_binary::check_inputs): Add cmdline parameter.
6168 (Incremental_binary::file_is_unchanged): Remove.
6169 (Input_reader::arg_serial): New function.
6170 (Input_reader::get_unused_symbol_count): New function.
6171 (Input_reader::get_unused_symbol): New function.
6172 (Input_reader::do_arg_serial): New function.
6173 (Input_reader::do_get_unused_symbol_count): New function.
6174 (Input_reader::do_get_unused_symbol): New function.
6175 (Incremental_binary::input_file_count): New function.
6176 (Incremental_binary::get_input_reader): Change signature to use
6177 index instead of filename.
6178 (Incremental_binary::file_has_changed): New function.
6179 (Incremental_binary::get_input_argument): New function.
6180 (Incremental_binary::get_library): New function.
6181 (Incremental_binary::get_script_info): New function.
6182 (Incremental_binary::init_layout): New function.
6183 (Incremental_binary::reserve_layout): New function.
6184 (Incremental_binary::output_file): New function.
6185 (Incremental_binary::do_check_inputs): New function.
6186 (Incremental_binary::do_file_is_unchanged): Remove.
6187 (Incremental_binary::do_file_has_changed): New function.
6188 (Incremental_binary::do_init_layout): New function.
6189 (Incremental_binary::do_reserve_layout): New function.
6190 (Incremental_binary::do_input_file_count): New function.
6191 (Incremental_binary::do_get_input_reader): Change signature.
6192 (Incremental_binary::input_args_map_): New data member.
6193 (Incremental_binary::library_map_): New data member.
6194 (Incremental_binary::script_map_): New data member.
6195 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6197 (Sized_incremental_binary::output_section): New function.
6198 (Sized_incremental_binary::inputs_reader): Add const.
6199 (Sized_incremental_binary::symtab_reader): Add const.
6200 (Sized_incremental_binary::relocs_reader): Add const.
6201 (Sized_incremental_binary::got_plt_reader): Add const.
6202 (Sized_incremental_binary::get_symtab_view): New function.
6203 (Sized_incremental_binary::Inputs_reader): New typedef.
6204 (Sized_incremental_binary::Input_entry_reader): New typedef.
6205 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6206 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6207 (Sized_incremental_binary::do_file_has_changed): New function.
6208 (Sized_incremental_binary::do_init_layout): New function.
6209 (Sized_incremental_binary::do_reserve_layout): New function.
6210 (Sized_input_reader::Inputs_reader): Remove.
6211 (Sized_input_reader::Input_entry_reader): Remove.
6212 (Sized_input_reader::do_arg_serial): New function.
6213 (Sized_input_reader::do_get_unused_symbol_count): New function.
6214 (Sized_input_reader::do_get_unused_symbol): New function.
6215 (Sized_incremental_binary::do_input_file_count): New function.
6216 (Sized_incremental_binary::do_get_input_reader): Change signature;
6217 use index instead of filename.
6218 (Sized_incremental_binary::section_map_): New data member.
6219 (Sized_incremental_binary::input_entry_readers_): New data member.
6220 (class Sized_incr_relobj): New class.
6221 (class Sized_incr_dynobj): New class.
6222 (make_sized_incremental_object): New function.
6223 (class Incremental_library): New class.
6224 * layout.cc (Free_list::num_lists): New static data member.
6225 (Free_list::num_nodes): New static data member.
6226 (Free_list::num_removes): New static data member.
6227 (Free_list::num_remove_visits): New static data member.
6228 (Free_list::num_allocates): New static data member.
6229 (Free_list::num_allocate_visits): New static data member.
6230 (Free_list::init): New function.
6231 (Free_list::remove): New function.
6232 (Free_list::allocate): New function.
6233 (Free_list::dump): New function.
6234 (Free_list::print_stats): New function.
6235 (Layout_task_runner::run): Resize output file for incremental updates.
6236 (Layout::Layout): Initialize new data members.
6237 (Layout::set_incremental_base): New function.
6238 (Layout::init_fixed_output_section): New function.
6239 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6240 incremental updates.
6241 (Layout::create_gold_note): Do not create gold note section for
6242 incremental updates.
6243 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6244 for incremental updates.
6245 (Layout::set_section_offsets): For incremental updates, allocate space
6247 (Layout::create_symtab_sections): Layout with offsets relative to
6248 start of section; for incremental updates, allocate space from free
6250 (Layout::create_shdrs): For incremental updates, allocate space from
6252 (Layout::finish_dynamic_section): For incremental updates, do not
6253 check --as-needed (fixed in subsequent patch).
6254 * layout.h (class Free_list): New class.
6255 (Layout::set_incremental_base): New function.
6256 (Layout::incremental_base): New function.
6257 (Layout::init_fixed_output_section): New function.
6258 (Layout::allocate): New function.
6259 (Layout::incremental_base_): New data member.
6260 (Layout::free_list_): New data member.
6261 * main.cc (main): Print Free_list statistics.
6262 * object.cc (Relobj::finalize_incremental_relocs): Add
6263 clear_counts parameter; clear counts only when clear_counts is set.
6264 (Sized_relobj::Sized_relobj): Initialize new base class.
6265 (Sized_relobj::do_layout): Don't report special sections.
6266 (Sized_relobj::do_for_all_local_got_entries): New function.
6267 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6268 symtab_off to all symbol table offsets.
6269 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6270 * object.h (class Got_offset_list): Move to top of file.
6271 (Object::Object): Allow case where input_file == NULL.
6272 (Object::~Object): Likewise.
6273 (Object::input_file): Assert that input_file != NULL.
6274 (Object::lock): Allow case where input_file == NULL.
6275 (Object::unlock): Likewise.
6276 (Object::is_locked): Likewise.
6277 (Object::token): Likewise.
6278 (Object::release): Likewise.
6279 (Object::is_incremental): New function.
6280 (Object::get_mtime): New function.
6281 (Object::for_all_local_got_entries): New function.
6282 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6283 (Object::set_is_in_system_directory): New function.
6284 (Object::is_in_system_directory): New function.
6285 (Object::do_is_incremental): New function.
6286 (Object::do_get_mtime): New function.
6287 (Object::do_for_all_local_got_entries): New function.
6288 (Object::is_in_system_directory_): New data member.
6289 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6290 (class Sized_relobj_base): New class.
6291 (class Sized_relobj): Derive from Sized_relobj_base.
6292 (class Sized_relobj::Symbols): Redeclare from base class.
6293 (class Sized_relobj::local_got_offset_list): Remove.
6294 (class Sized_relobj::Output_sections): Redeclare from base class.
6295 (class Sized_relobj::do_for_all_local_got_entries): New function.
6296 (class Sized_relobj::write_local_symbols): Add offset parameter.
6297 (class Sized_relobj::local_symbol_offset_): Update comment.
6298 (class Sized_relobj::local_dynsym_offset_): Update comment.
6299 * options.cc (Input_arguments::add_file): Remove const.
6300 * options.h (Input_file_argument::Input_file_argument):
6301 Initialize arg_serial_ (all constructors).
6302 (Input_file_argument::set_arg_serial): New function.
6303 (Input_file_argument::arg_serial): New function.
6304 (Input_file_argument::arg_serial_): New data member.
6305 (Input_arguments::Input_arguments): Initialize file_count_.
6306 (Input_arguments::add_file): Remove const.
6307 (Input_arguments::number_of_input_files): New function.
6308 (Input_arguments::file_count_): New data member.
6309 (Command_line::number_of_input_files): Call
6310 Input_arguments::number_of_input_files.
6311 * output.cc (Output_segment_headers::Output_segment_headers):
6313 (Output_section::Input_section::current_data_size): New function.
6314 (Output_section::Output_section): Initialize new data members.
6315 (Output_section::add_input_section): Don't do merge sections for
6316 an incremental link; allocate space from free list for an
6318 (Output_section::add_output_section_data): Allocate space from
6319 free list for an incremental update.
6320 (Output_section::update_data_size): New function.
6321 (Output_section::set_fixed_layout): New function.
6322 (Output_section::reserve): New function.
6323 (Output_segment::set_section_addresses): Remove const.
6324 (Output_segment::set_section_list_addresses): Remove const; allocate
6325 space from free list for an incremental update.
6326 (Output_segment::set_offset): Adjust size of RELRO segment for an
6328 * output.h (Output_data::current_data_size): Move here from
6330 (Output_data::pre_finalize_data_size): New function.
6331 (Output_data::update_data_size): New function.
6332 (Output_section_headers::update_data_size): new function.
6333 (Output_section_data_build::current_data_size): Move to Output_data.
6334 (Output_data_strtab::update_data_size): New function.
6335 (Output_section::current_data_size): Move to Output_data.
6336 (Output_section::set_fixed_layout): New function.
6337 (Output_section::has_fixed_layout): New function.
6338 (Output_section::reserve): New function.
6339 (Output_section::update_data_size): New function.
6340 (Output_section::has_fixed_layout_): New data member.
6341 (Output_section::free_list_): New data member.
6342 (Output_segment::set_section_addresses): Remove const.
6343 (Output_segment::set_section_list_addresses): Remove const.
6344 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6346 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6348 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6349 parameter when calling Add_symbols constructor; store argument
6350 serial number for members of a lib group.
6351 (Add_symbols::locks): Allow case where token == NULL.
6352 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6353 (Read_member::~Read_member): New function.
6354 (Read_member::is_runnable): New function.
6355 (Read_member::locks): New function.
6356 (Read_member::run): New function.
6357 (Check_script::~Check_script): New function.
6358 (Check_script::is_runnable): New function.
6359 (Check_script::locks): New function.
6360 (Check_script::run): New function.
6361 (Check_library::~Check_library): New function.
6362 (Check_library::is_runnable): New function.
6363 (Check_library::locks): New function.
6364 (Check_library::run): New function.
6365 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6366 (Add_symbols::library_): New data member.
6367 (class Read_member): New class.
6368 (class Check_script): New class.
6369 (class Check_library): New class.
6370 * reloc.cc (Read_relocs::is_runnable): Allow case where
6372 (Read_relocs::locks): Likewise.
6373 (Scan_relocs::locks): Likewise.
6374 (Relocate_task::locks): Likewise.
6375 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6377 (Sized_relobj::incremental_relocs_scan): Fix comment.
6378 (Sized_relobj::do_relocate): Pass output file offset to
6379 write_local_symbols.
6380 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6381 from class declaration.
6382 * script.cc (read_input_script): Allocate Script_info; pass
6383 argument serial number to report_script.
6384 * script.h (class Script_info): Move to incremental.h.
6385 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6386 * symtab.h (Symbol_table::add_from_incrobj): New function.
6387 (Symbol_table::set_file_offset): New function.
6389 2011-04-05 Cary Coutant <ccoutant@google.com>
6391 * incremental-dump.cc (dump_incremental_inputs): Change signature
6392 to take a Sized_incremental_binary; change caller. Use readers
6393 in Sized_incremental_binary.
6395 (Sized_incremental_binary::find_incremental_inputs_sections):
6396 Rename do_find_incremental_inputs_sections to this.
6397 (Sized_incremental_binary::setup_readers): New function.
6398 (Sized_incremental_binary::do_check_inputs): Check
6399 has_incremental_info_ flag; move setup code to setup_readers;
6401 (Sized_incremental_binary::do_file_is_unchanged): New function.
6402 (Sized_incremental_binary::do_get_input_reader): New function.
6403 * incremental.h (class Incremental_binary): Move to end of file.
6404 (Incremental_binary::file_is_unchanged): New function.
6405 (Incremental_binary::do_file_is_unchanged): New function.
6406 (Incremental_binary::Input_reader): New class.
6407 (Incremental_binary::get_input_reader): New function.
6408 (class Sized_incremental_binary): Move to end of file.
6409 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6410 input section reader classes.
6411 (Sized_incremental_binary::has_incremental_info): New function.
6412 (Sized_incremental_binary::inputs_reader): New function.
6413 (Sized_incremental_binary::symtab_reader): New function.
6414 (Sized_incremental_binary::relocs_reader): New function.
6415 (Sized_incremental_binary::got_plt_reader): New function.
6416 (Sized_incremental_binary::do_file_is_unchanged): New function.
6417 (Sized_incremental_binary::Sized_input_reader): New class.
6418 (Sized_incremental_binary::get_input_reader): New function.
6419 (Sized_incremental_binary::find_incremental_inputs_sections):
6420 Rename do_find_incremental_inputs_sections to this.
6421 (Sized_incremental_binary::setup_readers): New function.
6422 (Sized_incremental_binary::has_incremental_info_): New data member.
6423 (Sized_incremental_binary::inputs_reader_): New data member.
6424 (Sized_incremental_binary::symtab_reader_): New data member.
6425 (Sized_incremental_binary::relocs_reader_): New data member.
6426 (Sized_incremental_binary::got_plt_reader_): New data member.
6427 (Sized_incremental_binary::current_input_file_): New data member.
6429 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6432 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6435 2011-03-30 Cary Coutant <ccoutant@google.com>
6437 * archive.cc (Archive::include_member): Adjust call to report_object.
6438 (Add_archive_symbols::run): Add script_info to call to
6439 report_archive_begin.
6440 (Lib_group::include_member): Adjust call to report_object.
6441 (Add_lib_group_symbols::run): Adjust call to report_object.
6442 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6443 blocks. Add object count for script input files.
6444 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6445 script_info parameter; change all callers.
6446 (Incremental_inputs::report_object): Add script_info parameter;
6448 (Incremental_inputs::report_script): Store backpointer to
6449 incremental info entry.
6450 (Output_section_incremental_inputs::set_final_data_size): Record
6451 additional information for scripts.
6452 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6453 * incremental.h (Incremental_script_entry::add_object): New function.
6454 (Incremental_script_entry::get_object_count): New function.
6455 (Incremental_script_entry::get_object): New function.
6456 (Incremental_script_entry::objects_): New data member; adjust
6458 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6459 (Incremental_inputs::report_object): Add script_info parameter.
6460 (Incremental_inputs_reader::get_object_count): New function.
6461 (Incremental_inputs_reader::get_object_offset): New function.
6462 * options.cc (Input_arguments::add_file): Return reference to
6464 * options.h (Input_argument::set_script_info): New function.
6465 (Input_argument::script_info): New function.
6466 (Input_argument::script_info_): New data member; adjust all
6468 (Input_file_group::add_file): Return reference to new input argument.
6469 (Input_file_lib::add_file): Likewise.
6470 (Input_arguments::add_file): Likewise.
6471 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6472 * script.cc (Parser_closure::Parser_closure): Add script_info
6473 parameter; adjust all callers.
6474 (Parser_closure::script_info): New function.
6475 (Parser_closure::script_info_): New data member.
6476 (read_input_script): Report scripts earlier to incremental info.
6477 (script_add_file): Set script_info in Input_argument.
6478 (script_add_library): Likewise.
6479 * script.h (Script_options::Script_info): Rewrite class.
6481 2011-03-29 Cary Coutant <ccoutant@google.com>
6483 * archive.cc (Library_base::should_include_member): Move
6484 method here from class Archive.
6485 (Archive::Archive): Initialize base class.
6486 (Archive::should_include_member): Move to base class.
6487 (Archive::do_for_all_unused_symbols): New function.
6488 (Add_archive_symbols::run): Remove redundant access to
6490 (Lib_group::Lib_group): Initialize base class.
6491 (Lib_group::do_filename): New function.
6492 (Lib_group::include_member): Pass pointer to Lib_group to
6494 (Lib_group::do_for_all_unused_symbols): New function.
6495 (Add_lib_group_symbols::run): Report archive information for
6497 * archive.h (class Library_base): New base class.
6498 (class Archive): Derive from Library_base.
6499 (Archive::filename): Move to base class.
6500 (Archive::set_incremental_info): Likewise.
6501 (Archive::incremental_info): Likewise.
6502 (Archive::Should_include): Likewise.
6503 (Archive::should_include_member): Likewise.
6504 (Archive::Armap_entry): Remove.
6505 (Archive::Unused_symbol_iterator): Remove.
6506 (Archive::unused_symbols_begin): Remove.
6507 (Archive::unused_symbols_end): Remove.
6508 (Archive::do_filename): New function.
6509 (Archive::do_get_mtime): New function.
6510 (Archive::do_for_all_unused_symbols): New function.
6511 (Archive::task_): Move to base class.
6512 (Archive::incremental_info_): Likewise.
6513 (class Lib_group): Derive from Library_base.
6514 (Lib_group::do_filename): New function.
6515 (Lib_group::do_get_mtime): New function.
6516 (Lib_group::do_for_all_unused_symbols): New function.
6517 (Lib_group::task_): Move to base class.
6518 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6520 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6522 * incremental.cc (Incremental_inputs::report_archive_begin):
6523 Use Library_base; call library's get_mtime; add incremental inputs
6524 entry before members.
6525 (class Unused_symbol_visitor): New class.
6526 (Incremental_inputs::report_archive_end): Use Library_base; use
6527 visitor class to record unused symbols; don't add incremental inputs
6528 entry after members.
6529 (Incremental_inputs::report_object): Use Library_base.
6531 (Incremental_archive_entry::Incremental_archive_entry): Remove
6532 unused Archive parameter.
6533 (Incremental_inputs::report_archive_begin): Use Library_base.
6534 (Incremental_inputs::report_archive_end): Likewise.
6535 (Incremental_inputs::report_object): Likewise.
6536 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6538 * object.h (Object::for_all_global_symbols): New function.
6539 (Object::do_for_all_global_symbols): New function.
6540 (Sized_relobj::do_for_all_global_symbols): New function.
6541 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6543 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6546 2011-03-27 Ian Lance Taylor <iant@google.com>
6548 * archive.cc (Archive::interpret_header): Return -1 if something
6549 goes wrong. Change callers accordingly.
6551 2011-03-25 Cary Coutant <ccoutant@google.com>
6553 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6554 * testsuite/Makefile.in: Regenerate.
6556 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
6558 * plugin.cc (get_view): New.
6559 (Plugin::load): Pass get_view to the plugin.
6560 (Plugin_manager::get_view): New.
6562 2011-03-21 Ian Lance Taylor <iant@google.com>
6564 * testsuite/final_layout.sh: Rewrite to not use dc.
6565 * testsuite/relro_test.sh: Fail if dc is not present.
6567 2011-03-21 Sriraman Tallam <tmsriram@google.com>
6569 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6571 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6572 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6574 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6575 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6577 2011-03-14 Ian Lance Taylor <iant@google.com>
6579 * script-sections.cc (Sort_output_sections::script_compare):
6580 Rename from is_before, change return type.
6581 (Sort_output_sections::operator()): Adjust accordingly.
6583 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6586 * testsuite/odr_violation2.cc: Add comment to make all error line
6587 numbers double digits.
6588 * testsuite/debug_msg.sh: Adjust expected errors.
6590 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6592 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6593 but mark earlier ones as non-canonical
6594 (offset_to_iterator): Update search target and example
6595 (do_addr2line): Return extra lines in a vector*
6596 (format_file_lineno): Extract from do_addr2line
6597 (one_addr2line): Add vector* out-param
6598 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6599 when a lineno entry appeared last for its instruction
6600 (Dwarf_line_info): Add vector* out-param
6601 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6602 * symtab.cc (Odr_violation_compare): Include the lineno in the
6604 (linenos_from_loc): New. Combine the canonical line for an
6605 address with its other lines.
6606 (True_if_intersect): New. Helper functor to make
6607 std::set_intersection a query.
6608 (detect_odr_violations): Compare sets of lines instead of just
6609 one line for each function. This became less deterministic, but
6610 has fewer false positives.
6611 * symtab.h: Declarations.
6612 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6613 mix an optimized and non-optimized object in the same binary
6614 (odr_violation2.so): Same.
6615 * testsuite/Makefile.in: Regenerate from Makefile.am.
6616 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6617 * testsuite/debug_msg.sh: Update line numbers and add
6619 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6620 non-optimized context.
6621 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6622 isn't inlined, and use OdrDerived in an optimized context.
6623 * testsuite/odr_header1.h: Defines OdrDerived, where
6624 optimization will change the
6625 first-instruction-in-the-destructor's file and line number.
6626 * testsuite/odr_header2.h: Defines OdrBase.
6628 2011-03-09 Ian Lance Taylor <iant@google.com>
6630 * fileread.cc (File_read::clear_views): Don't delete the whole
6633 2011-03-08 Ian Lance Taylor <iant@google.com>
6636 * fileread.cc: #include <climits>.
6637 (GOLD_IOV_MAX): Define.
6638 (File_read::read_multiple): Limit number of entries by iov_max.
6639 * fileread.h (class File_read): Always set max_readv_entries to
6642 2011-03-07 Ian Lance Taylor <iant@google.com>
6645 * options.h (class General_options): Add -dy and -dn.
6647 2011-03-02 Cary Coutant <ccoutant@google.com>
6649 * testsuite/script_test_9.t: Add TLS segment.
6651 2011-03-02 Simon Baldwin <simonb@google.com>
6653 * configure.ac: Add check for gnu_indirect_function support in
6654 the toolchain building binutils.
6655 * configure: Rebuild.
6657 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
6659 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6660 plugin only symbols.
6661 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6662 in plugin files as not needed in the symbol table.
6664 2011-02-11 Sriraman Tallam <tmsriram@google.com>
6666 * output.cc (Output_section::add_input_section): Delay fill
6667 generation for section ordering.
6669 2011-02-09 Ian Lance Taylor <iant@google.com>
6672 * object.h (class Sized_relobj): Remove clear_local_symbols.
6673 * reloc.cc (Sized_relobj::do_relocate): Don't call
6674 clear_local_symbols.
6676 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
6678 * plugin.cc (is_visible_from_outside): Return true for symbols
6681 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6683 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6686 2011-02-02 Sriraman Tallam <tmsriram@google.com>
6688 * icf.h (is_section_foldable_candidate): Change type of parameter
6690 * icf.cc (Icf::find_identical_sections): Change type of local variable
6691 section_name to be std::string.
6692 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6694 2011-01-25 Ian Lance Taylor <iant@google.com>
6696 * script.cc (script_add_extern): Rewrite to use
6697 add_symbol_reference.
6699 2011-01-25 Doug Kwan <dougkwan@google.com>
6701 * icf.cc (get_section_contents): Always lock section's object.
6703 2011-01-24 Ian Lance Taylor <iant@google.com>
6705 * options.h (class General_options): Accept
6706 --no-detect-odr-violations.
6708 2011-01-24 Ian Lance Taylor <iant@google.com>
6710 * version.cc (version_string): Bump to 1.11.
6712 2011-01-24 Ian Lance Taylor <iant@google.com>
6714 * plugin.cc (class Plugin_rescan): Define new class.
6715 (Plugin_manager::claim_file): Set any_claimed_.
6716 (Plugin_manager::save_archive): New function.
6717 (Plugin_manager::save_input_group): New function.
6718 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6720 (Plugin_manager::new_undefined_symbol): New function.
6721 (Plugin_manager::rescan): New function.
6722 (Plugin_manager::rescannable_defines): New function.
6723 (Plugin_manager::add_input_file): Set any_added_.
6724 * plugin.h (class Plugin_manager): define new fields rescannable_,
6725 undefined_symbols_, any_claimed_, and any_added_. Declare
6726 Plugin_rescan as friend. Declare new functions.
6727 (Plugin_manager::Rescannable): Define type.
6728 (Plugin_manager::Rescannable_list): Define type.
6729 (Plugin_manager::Undefined_symbol_list): Define type.
6730 (Plugin_manager::Plugin_manager): Initialize new fields.
6731 * archive.cc (Archive::defines_symbol): New function.
6732 (Add_archive_symbols::run): Pass archive to plugins if any.
6733 * archive.h (class Archive): Declare defines_symbol.
6734 * readsyms.cc (Input_group::~Input_group): New function.
6735 (Finish_group::run): Pass input_group to plugins if any.
6736 * readsyms.h (class Input_group): Declare destructor.
6737 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6740 2011-01-10 Ian Lance Taylor <iant@google.com>
6742 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6744 (Layout::set_segment_offsets): Reset increase_relro before calling
6745 set_section_addresses a second time.
6747 2011-01-04 Cary Coutant <ccoutant@google.com>
6749 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6750 sections before NOBITS sections.
6752 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6754 * version.cc (print_version): Update copyright to 2011.
6756 2010-12-23 Cary Coutant <ccoutant@google.com>
6758 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6759 of OS to this->add. Add OD parameter to second form of the function.
6761 2010-12-20 Ian Lance Taylor <iant@google.com>
6763 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6764 second of two consecutive entries with same offset.
6766 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6768 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6769 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6770 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6771 to avoid unneeded links against $(LDADD).
6772 * testsuite/Makefile.in: Regenerate.
6774 2010-12-15 Ian Lance Taylor <iant@google.com>
6777 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6778 for R_X86_64_32 and R_X86_64_PC32.
6779 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6780 ver_matching_def_pic.o.
6781 (ver_matching_def_pic.o): New target.
6783 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6785 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6786 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6787 Move definition before File_read::View member definitions.
6788 (File_read::View::~View): Initialize and hold lock before
6789 updating current_mapped_bytes.
6791 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6793 * dwarf_reader.cc: Remove outdated comment.
6794 * gold-threads.cc: Fix typo in error message.
6795 * archive.cc: Fix typos in comments.
6796 * archive.h: Likewise.
6797 * arm-reloc-property.cc: Likewise.
6798 * arm-reloc-property.h: Likewise.
6799 * arm-reloc.def: Likewise.
6801 * attributes.h: Likewise.
6802 * cref.cc: Likewise.
6803 * ehframe.cc: Likewise.
6804 * fileread.h: Likewise.
6806 * i386.cc: Likewise.
6808 * incremental.h: Likewise.
6809 * int_encoding.cc: Likewise.
6810 * layout.h: Likewise.
6811 * main.cc: Likewise.
6812 * merge.h: Likewise.
6813 * object.cc: Likewise.
6814 * object.h: Likewise.
6815 * options.cc: Likewise.
6816 * readsyms.cc: Likewise.
6817 * reduced_debug_output.cc: Likewise.
6818 * reloc.cc: Likewise.
6819 * script-sections.cc: Likewise.
6820 * sparc.cc: Likewise.
6821 * symtab.h: Likewise.
6822 * target-reloc.h: Likewise.
6823 * target.cc: Likewise.
6824 * target.h: Likewise.
6825 * timer.cc: Likewise.
6826 * timer.h: Likewise.
6827 * x86_64.cc: Likewise.
6829 2010-12-09 Cary Coutant <ccoutant@google.com>
6831 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6833 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6834 parameter; change all callers.
6835 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6836 * options.h (warn_execstack): New option.
6838 2010-12-07 Doug Kwan <dougkwan@google.com>
6840 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6841 like function call relocations.
6843 2010-12-07 Ian Lance Taylor <iant@google.com>
6845 * archive.cc (Archive::get_elf_object_for_member): Permit
6846 punconfigured to be NULL.
6847 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6848 (Archive::include_member): Pass NULL to get_elf_object_for_member
6849 if we searched for the archive and this is the first included
6852 2010-12-01 Ian Lance Taylor <iant@google.com>
6854 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6855 track_relocs_type_ field.
6856 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6857 Set track_relocs_type_.
6858 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6859 contents when using RELA relocs.
6860 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6862 * reloc.cc (Track_relocs::next_addend): New function.
6863 * reloc.h (class Track_relocs): Declare next_addend.
6865 2010-12-01 Ian Lance Taylor <iant@google.com>
6867 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6870 2010-12-01 Ian Lance Taylor <iant@google.com>
6872 * README: Update compilers known to work and fail.
6874 2010-11-23 Matthias Klose <doko@ubuntu.com>
6876 * configure.in: For --enable-gold, handle value `default' instead of
6877 `both*'. Always install ld as ld.bfd, install as ld if gold is
6879 * configure: Regenerate.
6881 2010-11-18 Doug Kwan <dougkwan@google.com>
6883 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6884 and right_alignment to be zero. Store result alignment only if it is
6885 greater than existing alignment.
6887 2010-11-16 Cary Coutant <ccoutant@google.com>
6890 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6891 Check for ".zdebug_line".
6893 2010-11-16 Doug Kwan <dougkwan@google.com>
6894 Cary Coutant <ccoutant@google.com>
6896 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6897 by reference; adjust all callers.
6898 * output.cc (Output_segment::set_section_addresses): Adjust references
6899 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6901 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6902 end at page boundary.
6904 2010-11-16 Cary Coutant <ccoutant@google.com>
6907 * layout.cc (Layout::choose_output_section): Transform names of
6908 compressed sections even when using a script with a SECTIONS clause.
6909 (Layout::output_section_name): Remove code to transform
6910 compressed debug section names.
6911 * output.cc (Output_section::add_input_section): Use uncompressed
6912 section size when tracking input sections.
6914 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6916 * symtab.h (Symbol::NON_PIC_REF): Remove.
6917 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6918 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6919 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6920 (Symbol::use_plt_offset): Take a flags argument and pass it
6921 directly to needs_dynamic_reloc. Restrict check for undefined
6922 weak symbols to function calls.
6923 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6924 (Target_arm::Scan::global): Use it.
6925 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6926 (Target_arm::Relocate::relocate): Likewise.
6927 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6928 parameter with an r_type parameter. Use get_reference_flags
6930 (Target_arm::Relocate::relocate): Update accordingly.
6931 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6932 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6933 (Target_i386::Scan::global): Likewise.
6934 (Target_i386::Relocate::relocate): Likewise.
6935 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6936 parameter with an r_type parameter. Use get_reference_flags
6938 (Target_i386::Relocate::relocate): Update accordingly.
6939 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6940 (Target_powerpc::Scan::global): Use it.
6941 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6942 (Target_powerpc::Relocate::relocate): Likewise.
6943 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6944 (Target_sparc::Scan::global): Use it.
6945 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6946 (Target_sparc::Relocate::relocate): Likewise.
6947 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6948 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6949 (Target_x86_64::Scan::global): Likewise.
6950 (Target_x86_64::Relocate::relocate): Likewise.
6952 2010-11-08 Doug Kwan <dougkwan@google.com>
6953 Cary Coutant <ccoutant@google.com>
6955 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6956 (Arm_exidx_merge_section::section_contents_): New data member.
6957 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6958 (Arm_input_section::~Arm_input_section): De-allocate memory.
6959 (Arm_input_section::original_contents_): New data member.
6960 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6961 in parameters instead of calling Object::section_contents without
6963 (Arm_output_section::group_section): New parameter TASK. Pass it
6964 to callees that need locking objects.
6965 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6966 to lock EXIDX input sections. Fix a formatting issue. Call
6967 Arm_exidx_merged_section::build_contents to create merged section
6969 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6970 to lock object of stub table owner.
6971 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6972 TEXT_SIZE to initialize data member TEXT_SIZE_.
6973 (Arm_exidx_input_section::addralign): Fix typo in comment.
6974 (Arm_exidx_input_section::text_size): New method.
6975 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6976 that require locking objects. Lock objects before scanning for stubs
6977 and updating local symbols.
6978 (Arm_input_section<big_endian>::init): Copy contents of original
6980 (Arm_input_section<big_endian>::do_write): Use saved contents of
6981 original input section instead of calling Object::section_contents
6983 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6984 size without calling Object::section_size().
6985 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6986 for size. Allocate a buffer for merged EXIDX entries.
6987 (Arm_exidx_merged_section::build_contents): New method.
6988 (Arm_exidx_merged_section::do_write): Move merge section contents
6989 building code to Arm_exidx_merged_section::build_contetns. Write
6990 out contetns in buffer instead of building it on the fly.
6991 (Arm_relobj::make_exidx_input_section): Also pass text section size
6992 to Arm_exidx_input_section constructor.
6993 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6994 (Arm_dynobj::do_read_symbols): Fix memory leak.
6995 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6996 * target.h: (class Task): Add forward declaration.
6997 (Target::relax): Add new parameter TASK and pass it to
6999 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7001 2010-11-05 Cary Coutant <ccoutant@google.com>
7004 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7005 object when reading from the file.
7006 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7008 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7009 when reading section contents.
7010 (get_section_contents): Likewise.
7011 (icf::find_identical_sections): Likewise.
7012 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7013 object when reading from the file.
7014 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7015 the object when doing deferred section layout.
7017 2010-11-03 Nick Clifton <nickc@redhat.com>
7020 * script.h (class Symbol_assignment: name): New member. Returns
7021 the name of the symbol.
7022 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7023 Returns true if the given symbol name is on the list of
7024 assignments wating to be processed.
7025 * archive.cc (should_incldue_member): If the symbol is undefined,
7026 check to see if it is on the list of symbols pending assignment.
7028 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7030 * script-sections.cc (Script_sections::find_memory_region): Check
7031 for a NULL output section pointer.
7033 2010-10-29 Doug Kwan <dougkwan@google.com>
7035 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7036 Output_section::add_relaxed_input_section.
7037 * output.cc (Output_section::add_relaxed_input_section): Add new
7038 arguments LAYOUT and NAME. Set section order index.
7039 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7040 Copy section order index.
7041 * output.h (Output_section::add_relaxed_input_section): Add new
7042 arguments LAYOUT and NAME.
7044 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7046 * testsuite/Makefile.am: Move gcctestdir/ld rule to
7047 NATIVE_OR_CROSS_LINKER.
7048 * testsuite/Makefile.in: Regenerate.
7050 2010-10-20 Doug Kwan <dougkwan@google.com>
7052 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7053 without SHF_LINK_ORDER flags.
7054 * layout.cc (Layout::choose_output_section): Do not filter
7055 SHF_LINK_ORDER flag in a relocatable link.
7057 2010-10-17 Cary Coutant <ccoutant@google.com>
7059 * output.h (Output_segment::set_section_addresses): Change function
7060 signature. Update all callers.
7061 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7063 (Output_segment::set_section_addresses): Align after last TLS
7064 section. Add padding before last relro section instead of after.
7066 2010-10-17 Doug Kwan <dougkwan@google.com>
7068 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7069 GOT output section to be writable.
7071 2010-10-14 Cary Coutant <ccoutant@google.com>
7073 * debug.h (DEBUG_INCREMENTAL): New flag.
7074 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7075 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7077 * incremental.cc (report_command_line): Ignore all forms of
7079 * layout.cc (Layout::Layout): Check parameters for incremental link
7081 * options.cc (General_options::parse_incremental): New function.
7082 (General_options::parse_no_incremental): New function.
7083 (General_options::parse_incremental_full): New function.
7084 (General_options::parse_incremental_update): New function.
7085 (General_options::incremental_mode_): New data member.
7086 (General_options::finalize): Check incremental_mode_.
7087 * options.h (General_options): Update help text for --incremental.
7088 Add --no-incremental, --incremental-full, --incremental-update.
7089 (General_options::Incremental_mode): New enum type.
7090 (General_options::incremental_mode): New function.
7091 (General_options::incremental_mode_): New data member.
7092 * parameters.cc (Parameters::incremental_mode_): New data member.
7093 (Parameters::set_options): Set incremental_mode_.
7094 (Parameters::set_incremental_full): New function.
7095 (Parameters::incremental): New function.
7096 (Parameters::incremental_update): New function.
7097 (set_parameters_incremental_full): New function.
7098 * parameters.h (Parameters::set_incremental_full): New function.
7099 (Parameters::incremental): New function.
7100 (Parameters::incremental_update): New function.
7101 (Parameters::incremental_mode_): New data member.
7102 (set_parameters_incremental_full): New function.
7103 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7104 incremental link mode.
7105 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7106 (Sized_relobj::do_relocate_sections): Likewise.
7107 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7109 * testsuite/Makefile.in: Regenerate.
7110 * testsuite/incremental_test.sh: Filter all forms of --incremental.
7112 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7114 * script-sections.h (class Script_sections): Make
7115 Sections_elements typedef public.
7116 * script-sections.cc (class Sort_output_sections): Add elements_
7117 field. Add constructor which sets it; change all callers.
7118 (Sort_output_sections::is_before): New function.
7119 (Sort_output_sections::operator()): Call is_before.
7120 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7122 * testsuite/script_test_10.sh: New test. Test script section
7124 * testsuite/script_test_10.t: Likewise.
7125 * testsuite/script_test_10.s: Likewise.
7126 * testsuite/Makefile.am: Wrap the cross linker tests and the
7127 common tests into NATIVE_OR_CROSS_LINKER.
7128 (check_SCRIPTS): Add script_test_10.sh.
7129 (check_DATA): Add script_test_10.stdout.
7130 (script_test_10.o, script_test_10): New targets.
7131 (script_test_10.stdout): New target.
7132 * configure, testsuite/Makefile.in: Regenerate.
7134 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7136 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7137 error for the deprecated relocations.
7138 (Target_arm::Scan::global): Likewise.
7139 (Target_arm::Relocate::relocate): Likewise.
7141 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7143 * fileread.cc (Input_file::find_file): Initialize *found_name
7144 and *namep when using the fallback search for case 4.
7146 2010-10-11 Cary Coutant <ccoutant@google.com>
7148 * options.h (class General_options): Redefine -z lazy as an alias for
7149 the negation of -z now.
7151 2010-10-11 Ian Lance Taylor <iant@google.com>
7153 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7156 2010-10-06 Nick Clifton <nickc@redhat.com>
7158 * script-sections.cc(class Memory_region): Remove
7159 current_lma_offset_ field. Rename current_vma_offset_ to
7160 current_offset_. Add last_section_ field.
7161 (Memory_region::get_current_vma_address): Rename to
7162 get_current_address.
7163 (Memory_region::get_current_lma_address): Delete.
7164 (Memory_region::increment_vma_offset): Rename to
7166 (Memory_region::increment_lma_offset): Delete.
7167 (Memory_region::attributes_compatible): New method. Returns
7168 true if the provided section is compatible with the region.
7169 (Memory_region::get_last_section): New method. Returns the last
7170 section to use the region.
7171 (Memory_region::set_last_section): New method. Stores the last
7172 section to use the region.
7173 (Script_sections::block_in_region): New method. Returns true if
7174 a block of memory is contained within a region.
7175 (Script_sections::find_memory_region): New method. Locates a
7176 memory region to be used to set a VMA or LMA address.
7177 (Output_section_definition::set_section_addresses): Add code to
7178 check for addresses set by memory regions.
7179 (Output_segment::set_section_addresses): Remove memory region
7181 (Script_sections::create_segment): Add a warning if a header
7182 segment is created outside of any region.
7183 * script-sections.h (class Script_sections): Add prototypes for
7184 find_memory_region and block_in_region methods.
7185 * testsuite/memory_test.s: Use .long instead of .word.
7186 * testsuite/memory_test.t: Add some more output sections.
7187 * testsuite/memory_test.sh: Update expected output.
7189 2010-10-02 Doug Kwan <dougkwan@google.com>
7191 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7192 defintion to symtab.h
7193 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7194 declaration to defintion.
7196 2010-10-01 Nick Clifton <nickc@redhat.com>
7198 * expression.cc (eval): Replace dummy argument with NULL.
7199 (eval_maybe_dot): Check for a NULL result section pointer.
7200 (Symbol_expression::value): Likewise.
7201 (Dot_expression::value): Likewise.
7202 (BINARY_EXPRESSION): Likewise.
7203 (Max_expression::value): Likewise.
7204 (Min_expression::value): Likewise.
7205 (Absolute_expression::value): Likewise.
7206 (Addr_expression::value_from_output_section): Likewise.
7207 (Loaddddr_expression::value_from_output_section): Likewise.
7208 (Segment_start_expression::value): Likewise.
7209 * script-sections.cc
7210 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7212 (Sections_elememt_dot_assignment::set_section_addresses):
7214 (Output_data_expression::do_write_to_buffer): Likewise.
7215 (Output_section_definition::finalize_symbols): Likewise.
7216 (Output_section_definition::set_section_addresses): Likewise.
7218 2010-09-30 Doug Kwan <dougkwan@google.com>
7220 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7222 2010-09-28 Sriraman Tallam <tmsriram@google.com>
7224 * target.h (Target::can_icf_inline_merge_sections): New virtual
7226 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7228 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7230 * icf.cc (get_section_contents): Inline merge sections only when
7233 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7235 * configure: Regenerate.
7237 2010-09-17 Ian Lance Taylor <iant@google.com>
7239 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
7240 * testsuite/Makefile.am (memory_test.o): New target.
7241 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7243 * testsuite/Makefile.in: Rebuild.
7245 2010-09-17 Doug Kwan <dougkwan@google.com>
7247 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7248 defintion if relocation uses GOT entries of the symbol.
7249 * testsuite/icf_safe_test.sh: Fix test.
7250 * testsuite/icf_safe_so_test.sh: Fix test.
7252 2010-09-16 Cary Coutant <ccoutant@google.com>
7254 * script_sections.cc (class Memory_region): Remove "NULL" from
7255 vector initializations.
7257 2010-09-15 Cary Coutant <ccoutant@google.com>
7259 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7260 Resolve forwarding symbols.
7262 2010-09-15 Doug Kwan <dougkwan@google.com>
7264 * gold/testsuite/script_test_3.t: Add ARM special sections.
7265 * gold/testsuite/script_test_4.t: Same.
7266 * gold/testsuite/script_test_5.t: Same.
7267 * gold/testsuite/script_test_6.t: Same.
7268 * gold/testsuite/script_test_7.t: Same.
7269 * gold/testsuite/script_test_7.t: Same.
7270 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7272 2010-09-14 Cary Coutant <ccoutant@google.com>
7274 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7275 (Target_x86_64::Relocate::relocate_tls): Replace check for
7276 saw_tls_block_reloc_ with test for executable section.
7278 2010-09-12 Cary Coutant <ccoutant@google.com>
7280 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7281 position-independent executables to shared libraries need dynamic
7283 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7284 position-independent executables.
7285 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7286 * testsuite/Makefile.in: Regenerate.
7288 2010-09-10 Nick Clifton <nickc@redhat.com>
7291 * testsuite/memory_test.t: Discard any sections that are not
7294 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7297 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7298 "This::" to work around a bug in gcc 4.2.
7300 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7302 2010-09-09 Rafael Espindola <espindola@google.com>
7304 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7305 sections with different PF_X flags in the same segment.
7306 (Layout::find_first_load_seg): Search all segments to find the first
7308 * options.h (rosegment): New.
7310 2010-09-08 Rafael Espindola <espindola@google.com>
7312 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
7314 2010-09-08 Doug Kwan <dougkwan@google.com>
7316 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7317 (Arm_relobj::do_relocate_sections): Add new parameter for output
7318 file to match the parent.
7319 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7320 of local symbols instead of input values. Update code to track
7321 changes in gold::relocate_section.
7322 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7323 (Sized_relobj::compute_final_local_value_internal): New methods.
7324 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7325 body into private version of Sized_relobj::compute_final_local_value.
7326 Call the inline method.
7327 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7328 merged symbol value if there is one.
7329 (Symbol_value::has_output_value): New method defintiion.
7330 (Sized_relobj::Compute_final_local_value_status): New enum type.
7331 (Sized_relobj::compute_final_local_value): New methods.
7332 (Sized_relobj::compute_final_local_value_internal): New methods.
7333 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7334 and arm_cortex_a8.sh.
7335 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7336 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7338 * Makefile.in: Regenerate.
7339 * testsuite/arm_bl_out_of_range.s: Update test.
7340 * testsuite/thumb_bl_out_of_range.s: Ditto.
7341 * testsuite/thumb_blx_out_of_range.s: Ditto.
7342 * testsuite/arm_branch_out_of_range.sh: New file.
7343 * testsuite/arm_cortex_a8.sh: Ditto.
7344 * testsuite/arm_cortex_a8_b.s: Ditto.
7345 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7346 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7347 * testsuite/arm_cortex_a8_bl.s: Ditto.
7348 * testsuite/arm_cortex_a8_blx.s: Ditto.
7349 * testsuite/arm_cortex_a8_local.s: Ditto.
7350 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7351 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7353 2010-09-08 Rafael Espindola <espindola@google.com>
7355 * Makefile.am (memory_test.stdout): Run readelf with -W.
7356 * Makefile.in: Regenerate.
7357 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7360 2010-09-08 Rafael Espindola <espindola@google.com>
7362 * script-sections.cc (Script_sections::add_memory_region): Convert
7363 field precision to int.
7364 * script.cc (script_set_section_region, script_set_section_region):
7365 Convert field precision to int.
7367 2010-09-08 Rafael Espindola <espindola@google.com>
7369 * arm.cc (do_finalize_sections): Create the __exidx_start and
7370 __exdix_end symbols even when the section is missing.
7372 2010-09-08 Nick Clifton <nickc@redhat.com>
7374 * README: Remove claim that MEMORY is not supported.
7375 * expression.cc (script_exp_function_origin)
7376 (script_exp_function_length): Move from here to ...
7377 * script.cc: ... here.
7378 (script_set_section_region, script_add_memory)
7379 (script_parse_memory_attr, script_include_directive): New
7381 * script-sections.cc
7382 (class Memory_region): New class.
7383 (class Output_section_definition): Add set_memory_region,
7384 set_section_vma, set_section_lma and get_section_name methods.
7385 (class Script_Sections): Add add_memory_region,
7386 find_memory_region, find_memory_region_origin,
7387 find_memory_region_length and set_memory_region methods.
7388 Have set_section_addresses method walk the list of set memory
7390 Extend the print methos to display memory regions.
7391 * script-sections.h: Add prototypes for new methods.
7392 Add enum for MEMORY region attributes.
7393 * yyscript.y: Add support for parsing MEMORY regions.
7394 * script-c.h: Add prototypes for new functions.
7395 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7396 * testsuite/Makefile.in: Regenerate.
7397 * testsuite/memory_test.sh: New script.
7398 * testsuite/memory_test.s: New assembler source file.
7399 * testsuite/memory_test.t: New linker script.
7401 2010-08-27 Doug Kwan <dougkwan@google.com>
7403 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7404 reference override an existing dynamic weak reference.
7405 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7406 * testsuite/Makefile.in: Regenerate.
7407 * testsuite/dyn_weak_ref.sh: New file.
7408 * testsuite/dyn_weak_ref_1.c: Ditto.
7409 * testsuite/dyn_weak_ref_2.c: Ditto.
7411 2010-08-27 Ian Lance Taylor <iant@google.com>
7413 * incremental.h (class Incremental_input_entry): Add virtual
7416 2010-08-27 Ian Lance Taylor <iant@google.com>
7418 * testsuite/start_lib_test_3.c: Mark t3 as used.
7420 2010-08-27 Nick Clifton <nickc@redhat.com>
7422 * options.cc (version_script): Fix small typo in previous
7425 2010-08-25 Nick Clifton <nickc@redhat.com>
7427 * archive.cc: Formatting fixes: Remove whitespace between
7428 typename and following asterisk. Remove whitespace between
7429 function name and opening parenthesis.
7430 * archive.h: Likewise.
7432 * attributes.cc: Likewise.
7433 * attributes.h: Likewise.
7434 * common.cc: Likewise.
7435 * copy-relocs.cc: Likewise.
7436 * dirsearch.h: Likewise.
7437 * dynobj.cc: Likewise.
7438 * ehframe.cc: Likewise.
7439 * ehframe.h: Likewise.
7440 * expression.cc: Likewise.
7441 * fileread.cc: Likewise.
7442 * fileread.h: Likewise.
7444 * gold-threads.cc: Likewise.
7445 * gold.cc: Likewise.
7446 * i386.cc: Likewise.
7448 * incremental-dump.cc: Likewise.
7449 * incremental.cc: Likewise.
7450 * layout.cc: Likewise.
7451 * layout.h: Likewise.
7452 * main.cc: Likewise.
7453 * merge.cc: Likewise.
7454 * merge.h: Likewise.
7455 * object.cc: Likewise.
7456 * object.h: Likewise.
7457 * options.cc: Likewise.
7458 * options.h: Likewise.
7459 * output.cc: Likewise.
7460 * output.h: Likewise.
7461 * plugin.cc: Likewise.
7462 * plugin.h: Likewise.
7463 * powerpc.cc: Likewise.
7464 * reloc.cc: Likewise.
7465 * script-c.h: Likewise.
7466 * script-sections.cc: Likewise.
7467 * script.cc: Likewise.
7468 * stringpool.cc: Likewise.
7469 * symtab.cc: Likewise.
7470 * symtab.h: Likewise.
7471 * target.cc: Likewise.
7472 * timer.cc: Likewise.
7473 * timer.h: Likewise.
7474 * version.cc: Likewise.
7475 * x86_64.cc: Likewise.
7477 2010-08-24 Nick Clifton <nickc@redhat.com>
7480 * layout.cc (segment_precedes): Sort segments by their physical
7481 addresses, if they have been set.
7483 2010-08-23 Cary Coutant <ccoutant@google.com>
7485 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7487 (Lib_group::include_member): Unlock object after deleting its
7489 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7492 2010-08-19 Neil Vachharajani <nvachhar@google.com>
7493 Cary Coutant <ccoutant@google.com>
7495 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7496 constructor, and set_blocker.
7497 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7499 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7500 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7501 * testsuite/Makefile.am (start_lib_test): New test case.
7502 * testsuite/Makefile.in: Regenerate.
7503 * testsuite/start_lib_test_main.c: New file.
7504 * testsuite/start_lib_test_1.c: New file.
7505 * testsuite/start_lib_test_2.c: New file.
7506 * testsuite/start_lib_test_3.c: New file.
7508 2010-08-19 Ian Lance Taylor <iant@google.com>
7510 * Makefile.in: Rebuild with automake 1.11.1.
7511 * aclocal.m4: Likewise.
7512 * testsuite/Makefile.in: Likewise.
7514 2010-08-19 Ian Lance Taylor <iant@google.com>
7517 * i386.cc (class Output_data_plt_i386): Update declarations.
7518 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7519 local_ifuncs_ fields.
7520 (Target_i386::do_plt_section_for_global): New function.
7521 (Target_i386::do_plt_section_for_local): New function.
7522 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7523 parameter; change all callers. Initialize global_ifuncs_ and
7524 local_ifuncs_. If doing a static link define __rel_iplt_start and
7526 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7527 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7528 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7530 (Target_i386::make_plt_section): New function, broken out of
7531 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7532 (Target_i386::make_plt_entry): Call make_plt_section.
7533 (Target_i386::make_local_ifunc_plt_entry): New function.
7534 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7535 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7536 R_386_IRELATIVE to switch.
7537 (Target_i386::Scan::global): Likewise.
7538 (Target_i386::Relocate::relocate): Likewise.
7539 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7541 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7542 (Target_x86_64::do_plt_section_for_global): New function.
7543 (Target_x86_64::do_plt_section_for_local): New function.
7544 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7545 parameter; change all callers. If doing a static link define
7546 __rela_iplt_start and __rela_iplt_end.
7547 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7548 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7549 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7551 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7552 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7554 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7555 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7556 R_X86_64_IRELATIVE to switch.
7557 (Target_x86_64::Scan::global): Likewise.
7558 (Target_x86_64::Relocate::relocate): Likewise.
7559 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7561 * target.h (class Target): Add plt_section_for_global and
7562 plt_section_for_local functions. Add do_plt_section_for_global
7563 and do_plt_section_for_local virtual functions.
7564 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7565 clarifying comments.
7566 (Symbol::use_plt_offset): Handle IFUNC symbol.
7567 * object.cc (Sized_relobj::Sized_relobj): Initialize
7569 (Sized_relobj::local_has_plt_offset): New function.
7570 (Sized_relobj::local_plt_offset): New function.
7571 (Sized_relobj::set_local_plt_offset): New function.
7572 (Sized_relobj::do_count): Handle IFUNC symbol.
7573 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7574 a bit away from input_shndx_ field. Add set_is_func_symbol and
7575 is_ifunc_symbol functions.
7576 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7577 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7578 local_plt_offsets_ field.
7579 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7580 * output.h (class Output_section_data): Add non-const
7581 output_section function.
7582 (class Output_data_got): Update declarations.
7583 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7584 Add use_plt_offset parameter to global and local constructors.
7585 Change all callers. Change local_sym_index_ field to 31 bits.
7586 Change GSYM_CODE and CONSTANT_CODE accordingly.
7587 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7588 doing a static link don't set sh_link field.
7589 (Output_data_got::Got_entry::write): Use PLT offset if
7591 (Output_data_got::add_global_plt): New function.
7592 (Output_data_got::add_local_plt): New function.
7593 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7594 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7595 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7596 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7597 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7599 * testsuite/ifunc-sel.h: New file.
7600 * testsuite/ifuncmain1.c: New file.
7601 * testsuite/ifuncmain1vis.c: New file.
7602 * testsuite/ifuncmod1.c: New file.
7603 * testsuite/ifuncdep2.c: New file.
7604 * testsuite/ifuncmain2.c: New file.
7605 * testsuite/ifuncmain3.c: New file.
7606 * testsuite/ifuncmod3.c: New file.
7607 * testsuite/ifuncmain4.c: New file.
7608 * testsuite/ifuncmain5.c: New file.
7609 * testsuite/ifuncmod5.c: New file.
7610 * testsuite/ifuncmain6pie.c: New file.
7611 * testsuite/ifuncmod6.c: New file.
7612 * testsuite/ifuncmain7.c: New file.
7613 * configure, testsuite/Makefile.in: Rebuild.
7615 2010-08-18 Ian Lance Taylor <iant@google.com>
7618 (Output_section_incremental_inputs::write_input_files): Add cast
7619 to avoid signed/unsigned comparison warning.
7620 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7622 2010-08-12 Cary Coutant <ccoutant@google.com>
7624 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7626 2010-08-13 Ian Lance Taylor <iant@google.com>
7628 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7630 2010-08-12 Cary Coutant <ccoutant@google.com>
7631 Doug Kwan <dougkwan@google.com>
7633 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7634 defintion overrides non-weak undef, remember that the original undef
7636 * symtab.cc (Symbol_table::sized_write_global): For undef without
7637 an original weak binding, set binding to global in output.
7638 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7639 * testsuite/Makefile.in: Regenerate.
7640 * testsuite/strong_ref_weak_def.sh: New file.
7641 * testsuite/strong_ref_weak_def_1.c: Ditto.
7642 * testsuite/strong_ref_weak_def_2.c: Ditto.
7644 2010-08-12 Cary Coutant <ccoutant@google.com>
7646 * testsuite/incremental_test.sh: Rewrite.
7647 * testsuite/incremental_test_1.c: Rewrite.
7648 * testsuite/incremental_test_2.c: Rewrite.
7650 2010-08-12 Cary Coutant <ccoutant@google.com>
7652 * arm.cc (Target_arm::got_size): Add const.
7653 (Target_arm::got_entry_count): New function.
7654 (Target_arm::plt_entry_count): New function.
7655 (Target_arm::first_plt_entry_offset): New function.
7656 (Target_arm::plt_entry_size): New function.
7657 (Output_data_plt_arm::entry_count): New function.
7658 (Output_data_plt_arm::first_plt_entry_offset): New function.
7659 (Output_data_plt_arm::get_plt_entry_size): New function.
7660 * i386.cc (Target_i386::got_size): Add const.
7661 (Target_i386::got_entry_count): New function.
7662 (Target_i386::plt_entry_count): New function.
7663 (Target_i386::first_plt_entry_offset): New function.
7664 (Target_i386::plt_entry_size): New function.
7665 (Output_data_plt_i386::entry_count): New function.
7666 (Output_data_plt_i386::first_plt_entry_offset): New function.
7667 (Output_data_plt_i386::get_plt_entry_size): New function.
7668 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7669 find_incremental_inputs_sections. Dump incremental_got_plt section.
7670 * incremental.cc: Include target.h.
7671 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7672 parameter. Adjust all callers. Find incremental_got_plt section.
7673 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7675 (Output_section_incremental_inputs::set_final_data_size): Calculate
7676 size of incremental_got_plt section.
7677 (Output_section_incremental_inputs::do_write): Write the
7678 incremental_got_plt section.
7679 (Got_plt_view_info): New struct.
7680 (Local_got_offset_visitor): New class.
7681 (Global_got_offset_visitor): New class.
7682 (Global_symbol_visitor_got_plt): New class.
7683 (Output_section_incremental_inputs::write_got_plt): New function.
7684 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7685 Add parameter. Adjust all callers.
7686 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7687 (Incremental_inputs::got_plt_section): New function.
7688 (Incremental_inputs::got_plt_section_): New data member.
7689 (Incremental_got_plt_reader): New class.
7690 * layout.cc (Layout::create_incremental_info_sections): Add the
7691 incremental_got_plt section.
7692 * object.h (Got_offset_list::get_list): New function.
7693 (Got offset_list::for_all_got_offsets): New function.
7694 (Sized_relobj::local_got_offset_list): New function.
7695 * powerpc.cc (Target_powerpc::got_size): Add const.
7696 (Target_powerpc::got_entry_count): New function.
7697 (Target_powerpc::plt_entry_count): New function.
7698 (Target_powerpc::first_plt_entry_offset): New function.
7699 (Target_powerpc::plt_entry_size): New function.
7700 (Output_data_plt_powerpc::entry_count): New function.
7701 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7702 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7703 * sparc.cc (Target_sparc::got_size): Add const.
7704 (Target_sparc::got_entry_count): New function.
7705 (Target_sparc::plt_entry_count): New function.
7706 (Target_sparc::first_plt_entry_offset): New function.
7707 (Target_sparc::plt_entry_size): New function.
7708 (Output_data_plt_sparc::entry_count): New function.
7709 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7710 (Output_data_plt_sparc::get_plt_entry_size): New function.
7711 * symtab.h (Symbol::got_offset_list): New function.
7712 (Symbol_table::for_all_symbols): New function.
7713 * target.h (Sized_target::got_entry_count): New function.
7714 (Sized_target::plt_entry_count): New function.
7715 (Sized_target::plt_entry_size): New function.
7716 * x86_64.cc (Target_x86_64::got_size): Add const.
7717 (Target_x86_64::got_entry_count): New function.
7718 (Target_x86_64::plt_entry_count): New function.
7719 (Target_x86_64::first_plt_entry_offset): New function.
7720 (Target_x86_64::plt_entry_size): New function.
7721 (Output_data_plt_x86_64::entry_count): New function.
7722 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7723 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7725 2010-08-12 Cary Coutant <ccoutant@google.com>
7727 * archive.cc: Include incremental.h.
7728 (Archive::Archive): Initialize incremental_info_.
7729 (Archive::include_member): Record archive members in incremental info.
7730 (Add_archive_symbols::run): Record begin and end of an archive in
7732 (Lib_group::include_member): Record objects in incremental info.
7733 * archive.h (Incremental_archive_entry): Forward declaration.
7734 (Archive::set_incremental_info): New member function.
7735 (Archive::incremental_info): New member function.
7736 (Archive::Unused_symbol_iterator): New class.
7737 (Archive::unused_symbols_begin): New member function.
7738 (Archive::unused_symbols_end): New member function.
7739 (Archive::incremental_info_): New data member.
7740 * incremental-dump.cc (find_input_containing_global): New function.
7741 (dump_incremental_inputs): Dump new incremental info sections.
7742 * incremental.cc: Include symtab.h.
7743 (Output_section_incremental_inputs): New class.
7744 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7745 new incremental info sections.
7746 (Sized_incremental_binary::do_check_inputs): Likewise.
7747 (Incremental_inputs::report_archive): Remove.
7748 (Incremental_inputs::report_archive_begin): New function.
7749 (Incremental_inputs::report_archive_end): New function.
7750 (Incremental_inputs::report_object): New function.
7751 (Incremental_inputs::finalize_inputs): Remove.
7752 (Incremental_inputs::report_input_section): New function.
7753 (Incremental_inputs::report_script): Rewrite.
7754 (Incremental_inputs::finalize): Do nothing but finalize string table.
7755 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7756 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7757 (Incremental_inputs::create_data_sections): New function.
7758 (Incremental_inputs::relocs_entsize): New function.
7759 (Output_section_incremental_inputs::set_final_data_size): New function.
7760 (Output_section_incremental_inputs::do_write): New function.
7761 (Output_section_incremental_inputs::write_header): New function.
7762 (Output_section_incremental_inputs::write_input_files): New function.
7763 (Output_section_incremental_inputs::write_info_blocks): New function.
7764 (Output_section_incremental_inputs::write_symtab): New function.
7765 * incremental.h (Incremental_script_entry): Forward declaration.
7766 (Incremental_object_entry): Forward declaration.
7767 (Incremental_archive_entry): Forward declaration.
7768 (Incremental_inputs): Forward declaration.
7769 (Incremental_inputs_header_data): Remove.
7770 (Incremental_inputs_header): Remove.
7771 (Incremental_inputs_header_write): Remove.
7772 (Incremental_inputs_entry_data): Remove.
7773 (Incremental_inputs_entry): Remove.
7774 (Incremental_inputs_entry_write): Remove.
7775 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7776 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7777 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7778 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7780 (Incremental_input_entry): New class.
7781 (Incremental_script_entry): New class.
7782 (Incremental_object_entry): New class.
7783 (Incremental_archive_entry): New class.
7784 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7785 (Incremental_inputs::report_inputs): Remove.
7786 (Incremental_inputs::report_archive): Remove.
7787 (Incremental_inputs::report_archive_begin): New function.
7788 (Incremental_inputs::report_archive_end): New function.
7789 (Incremental_inputs::report_object): Change prototype.
7790 (Incremental_inputs::report_input_section): New function.
7791 (Incremental_inputs::report_script): Change prototype.
7792 (Incremental_inputs::get_reloc_count): New function.
7793 (Incremental_inputs::set_reloc_count): New function.
7794 (Incremental_inputs::create_data_sections): New function.
7795 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7796 (Incremental_inputs::inputs_section): New function.
7797 (Incremental_inputs::symtab_section): New function.
7798 (Incremental_inputs::relocs_section): New function.
7799 (Incremental_inputs::get_stringpool): Add const.
7800 (Incremental_inputs::command_line): Add const.
7801 (Incremental_inputs::inputs): Remove.
7802 (Incremental_inputs::command_line_key): New function.
7803 (Incremental_inputs::input_file_count): New function.
7804 (Incremental_inputs::input_files): New function.
7805 (Incremental_inputs::relocs_entsize): New function.
7806 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7807 (Incremental_inputs::finalize_inputs): Remove.
7808 (Incremental_inputs::Input_info): Remove.
7809 (Incremental_inputs::lock_): Remove.
7810 (Incremental_inputs::inputs_): Change type.
7811 (Incremental_inputs::inputs_map_): Remove.
7812 (Incremental_inputs::current_object_entry_): New data member.
7813 (Incremental_inputs::inputs_section_): New data member.
7814 (Incremental_inputs::symtab_section_): New data member.
7815 (Incremental_inputs::relocs_section_): New data member.
7816 (Incremental_inputs::reloc_count_): New data member.
7817 (Incremental_inputs_reader): New class.
7818 (Incremental_symtab_reader): New class.
7819 (Incremental_relocs_reader): New class.
7820 * layout.cc (Layout::finalize): Move finalization of incremental info
7821 and creation of incremental info sections to follow finalization of
7822 symbol table. Set offsets for postprocessing sections.
7823 (Layout::create_incremental_info_sections): Call
7824 Incremental_inputs::create_data_sections. Add incremental symtab
7825 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7826 sections to layout after input sections.
7827 * layout.h (struct Timespec): Forward declaration.
7828 (Layout::incremental_inputs): Add const.
7829 (Layout::create_incremental_info_sections): Add parameter.
7830 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7831 * object.cc: Include incremental.h.
7832 (Relobj::finalize_incremental_relocs): New function.
7833 (Sized_relobj::do_layout): Record input sections in incremental info.
7834 * object.h (Object::output_section): New function.
7835 (Object::output_section_offset): Moved from Relobj.
7836 (Object::get_incremental_reloc_base): New function.
7837 (Object::get_incremental_reloc_count): New function.
7838 (Object::do_output_section): New function.
7839 (Object::do_output_section_offset): Moved from Relobj.
7840 (Object::do_get_incremental_reloc_base): New function.
7841 (Object::do_get_incremental_reloc_count): New function.
7842 (Object::Object): Initialize new data members.
7843 (Relobj::output_section): Renamed do_output_section and moved to
7845 (Relobj::output_section_offset): Moved to Object.
7846 (Relobj::do_get_incremental_reloc_base): New function.
7847 (Relobj::do_get_incremental_reloc_count): New function.
7848 (Relobj::allocate_incremental_reloc_counts): New function.
7849 (Relobj::count_incremental_reloc): New function.
7850 (Relobj::finalize_incremental_relocs): New function.
7851 (Relobj::next_incremental_reloc_index): New function.
7852 (Relobj::reloc_counts_): New data member.
7853 (Relobj::reloc_bases_): New data member.
7854 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7855 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7856 (Sized_relobj::incremental_relocs_scan): New function.
7857 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7858 (Sized_relobj::incremental_relocs_write): New function.
7859 (Sized_relobj::incremental_relocs_write_reltype): New function.
7860 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7862 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7863 archives and object files elsewhere.
7864 (Add_symbols::run): Report object files here.
7865 (Finish_group::run): Report end of archive at end of group.
7866 * reloc.cc: Include layout.h, incremental.h.
7867 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7868 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7869 (Sized_relobj::incremental_relocs_scan): New function.
7870 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7871 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7872 (Sized_relobj::incremental_relocs_write): New function.
7873 (Sized_relobj::incremental_relocs_write_reltype): New function.
7874 * script.cc (read_input_script): Rewrite test for incremental link.
7875 Change call to Incremental_inputs::report_script.
7876 * symtab.h (Symbol_table::first_global_index): New function.
7877 (Symbol_table::output_count): New function.
7879 2010-08-12 Doug Kwan <dougkwan@google.com>
7881 * arm.cc (Target_arm::merge_object_attributes): Check command line
7882 options --no-wchar-size-warning and --no-enum-size-warning.
7883 * options.h (General_options): Add ld-compatible options
7884 --no-enum-size-warning and --no-wchar-size-warning.
7886 2010-08-04 Ian Lance Taylor <iant@google.com>
7888 * x86_64.cc (Target_x86_64::Scan::local): Use
7889 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7890 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7891 (Target_x86_64::Scan::global): Likewise.
7892 (Target_x86_64::Relocate::relocate): Likewise.
7893 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7896 2010-08-03 Cary Coutant <ccoutant@google.com>
7898 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7899 to reserve space in merged_strings vector. Keep total input size
7901 (Output_merge_string::do_print_merge_stats): Print total input size.
7902 * merge.h (Output_merge_string): Add input_size_ field.
7903 * stringpool.cc (Stringpool_template::string_length): Move
7904 implementations out of Stringpool_template class and place in
7906 * stringpool.h (string_length): Move out of Stringpool_template.
7908 2010-08-03 Ian Lance Taylor <iant@google.com>
7911 * layout.cc (relaxation_loop_body): If address of load segment is
7912 set, adjust address to include headers if possible.
7914 2010-08-03 Ian Lance Taylor <iant@google.com>
7916 * version.cc (version_string): Bump to 1.10.
7918 2010-08-03 Ian Lance Taylor <iant@google.com>
7921 * layout.h (enum Output_section_order): Define.
7922 (class Layout): Update declarations.
7923 * layout.cc (Layout::get_output_section): Add order parameter.
7924 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7925 is_first_non_relro parameters. Change all callers.
7926 (Layout::choose_output_section): Likewise.
7927 (Layout::add_output_section_data): Likewise.
7928 (Layout::make_output_section): Likewise. Set order.
7929 (Layout::default_section_order): New function.
7930 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7931 * output.cc (Output_section::Output_section): Initialize order_.
7932 Don't initialize deleted fields.
7933 (Output_segment::Output_segment): Don't initialize deleted
7935 (Output_segment::add_output_section_to_load): New function
7936 replacing add_output_section. Change all callers to call this or
7937 add_output_section_to_nonload.
7938 (Output_segment::add_output_section_to_nonload): New function.
7939 (Output_segment::remove_output_section): Rewrite.
7940 (Output_segment::add_initial_output_data): Likewise.
7941 (Output_segment::has_any_data_sections): Likewise.
7942 (Output_segment::is_first_section_relro): Likewise.
7943 (Output_segment::maximum_alignment): Likewise.
7944 (Output_segment::has_dynamic_reloc): New function replacing
7945 dynamic_reloc_count. Change all callers.
7946 (Output_segment::has_dynamic_reloc_list): New function replacing
7947 dynamic_reloc_count_list. Change all callers.
7948 (Output_segment::set_section_addresses): Rewrite.
7949 (Output_segment::set_offset): Rewrite.
7950 (Output_segment::find_first_and_last_list): Remove.
7951 (Output_segment::set_tls_offsets): Rewrite.
7952 (Output_segment::first_section_load_address): Likewise.
7953 (Output_segment::output_section_count): Likewise.
7954 (Output_segment::section_with_lowest_load_address): Likewise.
7955 (Output_segment::write_section_headers): Likewise.
7956 (Output_segment::print_sections_to_map): Likewise.
7957 * output.h (class Output_data): Remove dynamic_reloc_count_
7958 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7959 (Output_data::add_dynamic_reloc): Rewrite.
7960 (Output_data::has_dynamic_reloc): New function.
7961 (Output_data::dynamic_reloc_count): Remove.
7962 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7963 is_last_relro_, is_first_non_relro_, is_interp_,
7964 is_dynamic_linker_section_ fields. Add order and set_order
7965 functions. Remove is_relro_local, set_is_relro_local,
7966 is_last_relro, set_is_last_relro, is_first_non_relro,
7967 set_is_first_non_relro functions, is_interp, set_is_interp,
7968 is_dynamic_linker_section, and set_is_dynamic_linker_section
7970 (class Output_segment): Change Output_data_list from std::list to
7971 std:;vector. Add output_lists_ field. Remove output_data_ and
7972 output_bss_ fields. Update declarations.
7974 2010-08-02 Ian Lance Taylor <iant@google.com>
7976 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7977 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7978 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7980 2010-08-02 Ian Lance Taylor <iant@google.com>
7983 * script.cc (Script_options::Script_options): Initialize
7984 symbol_definitions_ and symbol_references_.
7985 (Script_options::add_symbol_assignment): Update
7986 symbol_definitions_ and symbol_references_.
7987 (Script_options::add_symbol_reference): New function.
7988 (script_symbol): New function.
7989 * script.h (class Script_options): Add symbol_definitions_ and
7990 symbol_references_ fields.
7991 (Script_options::referenced_const_iterator): New type.
7992 (Script_options::referenced_begin): New function.
7993 (Script_options::referenced_end): New function.
7994 (Script_options::is_referenced): New function.
7995 (Script_options::any_unreferenced): New function.
7996 * script-c.h (script_symbol): Declare.
7997 * yyscript.y (exp): Call script_symbol.
7998 * symtab.cc: Include "script.h".
7999 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8000 Change all callers. Check symbols referenced by scripts.
8001 (Symbol_table::add_undefined_symbols_from_command_line): Add
8002 layout parameter. Change all callers.
8003 (Symbol_table::do_add_undefined_symbols_from_command_line):
8004 Likewise. Break out loop body. Check symbols referenced by
8006 (Symbol_table::add_undefined_symbol_from_command_line): New
8007 function broken out of
8008 do_add_undefined_symbols_from_command_line.
8009 * symtab.h (class Symbol_table): Update declarations.
8010 * archive.cc: Include "layout.h".
8011 (Archive::should_include_member): Add layout parameter. Change
8012 all callers. Check for symbol mentioned in expression.
8013 * archive.h (class Archive): Update declaration.
8014 * object.cc (Sized_relobj::do_should_include_member): Add layout
8016 * object.h (Object::should_include_member): Add layout parameter.
8018 (Object::do_should_include_member): Add layout parameter.
8019 (class Sized_relobj): Update declaration.
8020 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8022 * dynobj.h (class Sized_dynobj): Update declaration.
8023 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8025 * plugin.h (class Sized_pluginobj): Update declaration.
8027 2010-08-02 Ian Lance Taylor <iant@google.com>
8030 * output.cc (Output_segment::set_offset): Search for the first and
8031 last sections rather than assuming that the list is in order.
8032 (Output_segment::find_first_and_last_list): New function.
8033 * output.h (class Output_segment): Update declarations.
8034 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8035 (relro_strip_test_SOURCES): New variable.
8036 (relro_strip_test_DEPENDENCIES): New variable.
8037 (relro_strip_test_LDFLAGS): New variable.
8038 (relro_strip_test_LDADD): New variable.
8039 (relro_strip_test.so): New target.
8041 2010-08-02 Ian Lance Taylor <iant@google.com>
8043 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8044 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8045 (Target_i386::got_tlsdesc_section): New function.
8046 (Target_i386::got_section): Create space for GOT entries for
8047 TLSDESC relocations.
8048 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8050 (Target_i386::Scan::global): Likewise.
8051 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8053 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8054 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8055 (Target_x86_64::got_tlsdesc_section): New function.
8056 (Target_x86_64::got_section): Create space for GOT entries for
8057 TLSDESC relocations.
8058 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8060 (Target_x86_64::Scan::global): Likewise.
8061 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8064 2010-08-02 Ian Lance Taylor <iant@google.com>
8066 * testsuite/final_layout.sh: Use dc to convert from hex to
8069 2010-07-29 Sriraman Tallam <tmsriram@google.com>
8071 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8072 paramter to the call to gold::gc_process_relocs.
8073 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8074 paramter to the call to gold::gc_process_relocs.
8075 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8076 parameter to the call to gold::gc_process_relocs.
8077 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8078 template parameter to the call to gold::gc_process_relocs.
8079 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8080 paramter to the call to gold::gc_process_relocs.
8081 * gc.h (get_embedded_addend_size): New function.
8082 (gc_process_relocs): Save the size of the reloc for use by ICF.
8083 * icf.cc (get_section_contents): Get the addend from the text section
8084 for SHT_REL relocation sections.
8085 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8086 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8087 * int_encoding.h (read_from_pointer): New overloaded function.
8088 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8089 * testsuite/icf_sht_rel_addend_test.sh: New file.
8090 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8091 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8093 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8095 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8096 * Makefile.in: Regenerate.
8097 * testsuite/Makefile.in: Regenerate.
8099 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8101 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8102 * gold/testsuite/debug_msg.cc: Likewise.
8103 * gold/testsuite/odr_violation1.cc
8104 * gold/testsuite/odr_violation2.cc
8106 2010-07-21 Cary Coutant <ccoutant@google.com>
8108 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8109 string, and length fields.
8110 (Output_merge_string::Merged_strings_list): New type.
8111 (Output_merge_string::Merged_strings_lists): New typedef.
8112 (Output_merge_string): Replace merged_strings_ with
8113 merged_strings_lists_.
8114 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8115 Merged_strings_list per input object and section. Don't store pointer
8116 to the string. Don't store length with each merged string entry.
8117 (Output_merge_string::finalize_merged_data): Loop over list of merged
8118 strings lists. Recompute length of each merged string.
8120 2010-07-15 Cary Coutant <ccoutant@google.com>
8122 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8125 2010-07-14 Ian Lance Taylor <iant@google.com>
8127 * descriptors.cc (Descriptors::open): Report correct name in error
8130 2010-07-13 Doug Kwan <dougkwan@google.com>
8132 * arm.cc (Arm_input_section::Arm_input_section): For a
8133 SHT_ARM_EXIDX section, always keeps the input sections.
8134 (Arm_input_section::set_exidx_section_link): New method.
8135 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8136 has_errors_ to false.
8137 (Arm_exidx_input_section::has_errors,
8138 Arm_exidx_input_section::set_has_errors): New methods.
8139 (Arm_exidx_input_section::has_errors_): New data member.
8140 (Arm_relobj::get_exidx_shndx_list): New method.
8141 (Arm_output_section::append_text_sections_to_list): Do not skip
8142 section without SHF_EXECINSTR.
8143 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8145 (Arm_relobj::make_exidx_input_section): Add new parameter for text
8146 section header. Make error messages more verbose. Check for
8147 a non-executable section linked to an EXIDX section.
8148 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8149 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8150 check that there is no deferred EXIDX section if we exit early.
8151 Instead of not making an EXIDX section in case of an error, make one
8152 and set the has_errors flag of it.
8153 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8154 in a relocatable link.
8155 (Target_arm::do_relax): Look for the EXIDX output section instead of
8156 assuming that it is called .ARM.exidx.
8157 (Target_arm::fix_exidx_coverage): Add a new parameter for input
8158 section list. Do not check for SHF_EXECINSTR section flags but
8159 skip any input section with errors.
8160 * output.cc (Output_section::Output_section): Initialize
8161 always_keeps_input_sections_ to false.
8162 (Output_section::add_input_section): Check for
8163 always_keeps_input_sections_.
8164 * output.h (Output_section::always_keeps_input_sections,
8165 Output_section::set_always_keeps_input_sections): New methods.
8166 (Output_section::always_keeps_input_sections): New data member.
8168 2010-07-13 Rafael Espindola <espindola@google.com>
8170 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8171 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8173 2010-07-13 Philip Herron <herron.philip@googlemail.com>
8174 Ian Lance Taylor <iant@google.com>
8176 * output.h (Output_section_lookup_maps::add_merge_section):
8177 Correct check of whether value was inserted.
8178 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8179 (Output_section_lookup_maps::add_relaxed_input_section):
8181 * arm.cc (Target_arm::got_section): Remove used local os.
8182 * i386.cc (Target_i386::got_section): Likewise.
8183 * x86_64.cc (Target_x86_64::got_section): Likewise.
8184 * sparc.cc (Target_sparc::got_section): Likewise.
8185 (Target_sparc::relocate): Remove unused local have_got_offset.
8186 * powerpc.cc (Target_powerpc::relocate): Likewise.
8188 2010-07-13 Ian Lance Taylor <iant@google.com>
8190 * compressed_output.cc (zlib_decompress): Fix signature in
8193 * archive.cc (Archive::include_member): Unlock an external member
8194 of a thin archive. Don't bother to delete an object we know is
8197 2010-07-12 Cary Coutant <ccoutant@google.com>
8199 * compressed_output.cc (zlib_decompress): New function.
8200 (get_uncompressed_size): New function.
8201 (decompress_input_section): New function.
8202 * compressed_output.h (get_uncompressed_size): New function.
8203 (decompress_input_section): New function.
8204 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8205 Handle compressed debug sections.
8206 * layout.cc (is_compressed_debug_section): New function.
8207 (Layout::output_section_name): Map compressed section names to
8209 * layout.h (is_compressed_debug_section): New function.
8210 (is_debug_info_section): Recognize compressed debug sections.
8211 * merge.cc: Include compressed_output.h.
8212 (Output_merge_data::do_add_input_section): Handle compressed
8214 (Output_merge_string::do_add_input_section): Handle compressed
8216 * object.cc: Include compressed_output.h.
8217 (Sized_relobj::Sized_relobj): Initialize new data members.
8218 (build_compressed_section_map): New function.
8219 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8220 * object.h (Object::section_is_compressed): New method.
8221 (Object::do_section_is_compressed): New method.
8222 (Sized_relobj::Compressed_section_map): New type.
8223 (Sized_relobj::do_section_is_compressed): New method.
8224 (Sized_relobj::compressed_sections_): New data member.
8225 * output.cc (Output_section::add_input_section): Handle compressed
8227 * reloc.cc: Include compressed_output.h.
8228 (Sized_relobj::write_sections): Handle compressed debug sections.
8230 2010-07-08 Cary Coutant <ccoutant@google.com>
8232 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8233 weak when resolving to a dynamic def.
8234 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8235 for weak undef/dynamic def cases. Adjust callers.
8236 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8237 undef_binding_weak_.
8238 (Symbol_table::sized_write_globals): Adjust symbol binding.
8239 (Symbol_table::sized_write_symbol): Add binding parameter.
8240 * symtab.h (Symbol::set_undef_binding): New method.
8241 (Symbol::is_undef_binding_weak): New method.
8242 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8243 (Symbol_table::should_override): Add new parameter.
8244 (Symbol_table::sized_write_symbol): Add new parameter.
8246 * testsuite/weak_undef_file1.cc: Add new test case.
8247 * testsuite/weak_undef_file2.cc: Fix header comment.
8248 * testsuite/weak_undef_test.cc: Add new test case.
8250 2010-06-29 Doug Kwan <dougkwan@google.com>
8252 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8253 Initialize USE_SYMBOL_.
8254 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8256 (Arm_reloc_property::uses_symbol_): New data member declaration.
8257 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8258 uses symbol value and symbol is undefined but not weakly undefined.
8260 2010-06-28 Rafael Espindola <espindola@google.com>
8262 * plugin.cc (Plugin::load): Use dlerror.
8264 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8266 * symtab.cc (detect_odr_violations): When reporting an ODR
8267 violation, report an object where the symbol is defined.
8269 2010-06-25 Doug Kwan <dougkwan@google.com>
8271 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8272 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8274 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8275 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8276 target hook to detect function points.
8277 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8278 * icf.h (Icf::check_section_for_function_pointers): Change type of
8279 parameter SECTION_NAME to const reference to std::string. Use
8280 target hook to determine if section may have unsafe pointers.
8281 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8284 2010-06-21 Rafael Espindola <espindola@google.com>
8286 * fileread.cc (Input_file::find_fie): New
8287 (Input_file::open): Use Input_file::find_fie.
8288 * fileread.h (Input_file::find_fie): New
8289 * plugin.cc (set_extra_library_path): New.
8290 (Plugin::load): Add set_extra_library_path to the transfer vector.
8291 (Plugin_manager::set_extra_library_path): New.
8292 (Plugin_manager::add_input_file): Use the extra search path if set.
8293 (set_extra_library_path(): New.
8294 * plugin.h (Plugin_manager): Add set_extra_library_path and
8297 2010-06-19 Cary Coutant <ccoutant@google.com>
8299 * layout.cc (gdb_sections): Add .debug_types.
8300 (lines_only_debug_sections): Likewise.
8302 2010-06-18 Rafael Espindola <espindola@google.com>
8304 * plugin.cc (add_input_file,add_input_library)
8305 (Plugin_manager::add_input_file): Make filename arguments const.
8306 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8309 2010-06-16 Doug Kwan <dougkwan@google.com>
8311 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8312 .ARM.attributes section if we have not merged any input
8313 attributes sections.
8315 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8317 * arm.cc: Allow combining objects with no EABI version
8320 2010-06-15 Rafael Espindola <espindola@google.com>
8322 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8324 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8326 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8327 (struct iovec): Correct !HAVE_READV definition.
8329 2010-06-10 Cary Coutant <ccoutant@google.com>
8331 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8332 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8334 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8337 * symtab.h (Symbol::is_placeholder): New member function.
8338 * target-reloc.h (relocate_section): Check for placeholder symbols.
8340 * testsuite/Makefile.am (plugin_test_8): New test.
8341 (plugin_test_9): New test.
8342 * testsuite/Makefile.in: Regenerate.
8344 2010-06-09 Nick Clifton <nickc@redhat.com>
8346 * yyscript.y (input_list_element): Allow strings prefixed with
8347 the '-' character. Treat these as libraries.
8348 * script.cc (script_add_library): New function. Adds a library
8349 specified by "-l<name>" found in an input script.
8350 * script-c.h: Add prototype for script_add_library.
8352 2010-06-07 Doug Kwan <dougkwan@google.com>
8354 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8355 Restrict stub-group size to be within long conditional branch
8356 range when working around cortex-A8 erratum.
8358 2010-06-07 Damien Diederen <dd@crosstwine.com>
8360 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8363 2010-06-03 Sriraman Tallam <tmsriram@google.com>
8367 (Output_section::Input_section_sort_entry::compare_section_ordering):
8368 Change to return non-zero correctly.
8369 (Output_section::Input_section_sort_section_order_index_compare
8370 ::operator()): Change to fix ambiguity in comparisons.
8372 2010-06-01 Sriraman Tallam <tmsriram@google.com>
8374 * gold.h (is_wildcard_string): New function.
8375 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8376 (Layout::layout_eh_frame): Ditto.
8377 (Layout::find_section_order_index): New method.
8378 (Layout::read_layout_from_file): New method.
8379 * layout.h (Layout::find_section_order_index): New method.
8380 (Layout::read_layout_from_file): New method.
8381 (Layout::input_section_position_): New private member.
8382 (Layout::input_section_glob_): New private member.
8383 * main.cc (main): Call read_layout_from_file here.
8384 * options.h (--section-ordering-file): New option.
8385 * output.cc (Output_section::input_section_order_specified_): New
8387 (Output_section::Output_section): Initialize new member.
8388 (Output_section::add_input_section): Add new parameter.
8389 Keep input sections when --section-ordering-file is used.
8390 (Output_section::set_final_data_size): Sort input sections when
8391 section ordering file is specified.
8392 (Output_section::Input_section_sort_entry): Add new parameter.
8394 (Output_section::Input_section_sort_entry::compare_section_ordering):
8396 (Output_section::Input_section_sort_compare::operator()): Change to
8397 consider section_order_index.
8398 (Output_section::Input_section_sort_init_fini_compare::operator()):
8399 Change to consider section_order_index.
8400 (Output_section::Input_section_sort_section_order_index_compare
8401 ::operator()): New method.
8402 (Output_section::sort_attached_input_sections): Change to sort
8403 according to section order when specified.
8404 (Output_section::add_input_section<32, true>): Add new parameter.
8405 (Output_section::add_input_section<64, true>): Add new parameter.
8406 (Output_section::add_input_section<32, false>): Add new parameter.
8407 (Output_section::add_input_section<64, false>): Add new parameter.
8408 * output.h (Output_section::add_input_section): Add new parameter.
8409 (Output_section::input_section_order_specified): New
8411 (Output_section::set_input_section_order_specified): New method.
8412 (Input_section::Input_section): Initialize section_order_index_.
8413 (Input_section::section_order_index): New method.
8414 (Input_section::set_section_order_index): New method.
8415 (Input_section::section_order_index_): New member.
8416 (Input_section::Input_section_sort_section_order_index_compare): New
8418 (Output_section::input_section_order_specified_): New member.
8419 * script-sections.cc (is_wildcard_string): Delete and move modified
8421 (Output_section_element_input::Output_section_element_input): Modify
8422 call to is_wildcard_string.
8423 (Output_section_element_input::Input_section_pattern
8424 ::Input_section_pattern): Ditto.
8425 (Output_section_element_input::Output_section_element_input): Ditto.
8426 * testsuite/Makefile.am (final_layout): New test case.
8427 * testsuite/Makefile.in: Regenerate.
8428 * testsuite/final_layout.cc: New file.
8429 * testsuite/final_layout.sh: New file.
8431 2010-06-01 Rafael Espindola <espindola@google.com>
8433 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8435 2010-06-01 Rafael Espindola <espindola@google.com>
8437 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8438 visibility of symbols.
8440 2010-05-27 Doug Kwan <dougkwan@google.com>
8442 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8443 from start of output section instead of address for a local symbol
8444 in a merged or relaxed section when doing a relocatable link.
8446 2010-05-26 Rafael Espindola <espindola@google.com>
8449 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8450 adding sections the garbage collector removed.
8451 * gold/testsuite/Makefile.am: Add test.
8452 * gold/testsuite/Makefile.in: Regenerate.
8453 * gold/testsuite/plugin_test_7.sh: New.
8454 * gold/testsuite/plugin_test_7_1.c: New.
8455 * gold/testsuite/plugin_test_7_2.c: New.
8457 2010-05-26 Rafael Espindola <espindola@google.com>
8459 * script-sections.cc (Output_section_definition::set_section_addresses):
8460 Check for --section-start.
8462 2010-05-26 Doug Kwan <dougkwan@google.com>
8464 * arm.cc (Arm_scan_relocatable_relocs): New class.
8465 (Target_arm::relocate_special_relocatable): New method.
8466 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8467 (Arm_relocate_functions::thumb_branch_common): Same.
8468 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8469 instead of Default_scan_relocatable_relocs.
8470 * target-reloc.h (relocate_for_relocatable): Let target handle
8471 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8472 * target.h (Sized_target::relocate_special_relocatable): New method.
8474 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8476 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8478 2010-05-23 Doug Kwan <dougkwan@google.com>
8480 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8482 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8483 with a direct branch, not a conditional branch, to a stub.
8484 * merge.cc (Output_merge_base::record_input_section): New method
8486 (Output_merge_data::do_add_input_section): Record input section if
8487 keeps-input-sections flag is set.
8488 (Output_merge_string::do_add_input_section): Ditto.
8489 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8490 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8492 (Output_merge_base::keeps_input_sections,
8493 Output_merge_base::set_keeps_input_sections,
8494 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8496 (Output_merge_base::Input_sections): New type declaration.
8497 (Output_merge_base::input_sections_begin,
8498 Output_merge_base::input_sections_end,
8499 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8500 (Output_merge_base::bool keeps_input_sections_,
8501 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8502 Output_merge_base::input_sections_): New data members.
8503 (Output_merge_data::do_set_keeps_input_sections): New method
8505 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8506 * output.cc (Output_section::Input_section::relobj): Move method
8507 defintion from class declaration to here and handle merge sections.
8508 (Output_section::Input_section::shndx): Ditto.
8509 (Output_section::Output_section): Remove initializations of removed
8510 data members and initialize new data member LOOKUP_MAPS_.
8511 (Output_section::add_input_section): Set keeps-input-sections flag
8512 for a newly created merge output section as appropriate. Adjust code
8513 to use Output_section_lookup_maps class.
8514 (Output_section::add_relaxed_input_section): Adjst code for lookup
8515 maps code refactoring.
8516 (Output_section::add_merge_input_section): Add a new parameter
8517 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8518 class. If adding input section to a newly created merge output
8519 section fails, remove the new merge section.
8520 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
8521 Adjust code for use of the Output_section_lookup_maps class.
8522 (Output_section::find_merge_section): Ditto.
8523 (Output_section::build_lookup_maps): New method defintion.
8524 (Output_section::find_relaxed_input_section): Adjust code to use
8525 Output_section_lookup_maps class.
8526 (Output_section::get_input_sections): Export merge sections. Adjust
8527 code to use Output_section_lookup_maps class.
8528 (Output_section:::add_script_input_section): Adjust code to use
8529 Output_section_lookup_maps class. Update lookup maps for merge
8531 (Output_section::discard_states): Use Output_section_lookup_maps.
8532 (Output_section::restore_states): Same.
8533 * output.h (Merge_section_properties): Move class defintion out of
8535 (Output_section_lookup_maps): New class.
8536 (Output_section::Input_section::is_merge_section): New method
8538 (Output_section::Input_section::relobj): Move defintion out of class
8539 defintion. Declare method only.
8540 (Output_section::Input_section::shndx): Ditto.
8541 (Output_section::Input_section::output_merge_base): New method defintion.
8542 (Output_section::Input_section::u2_.pomb): New union field.
8543 (Output_section::Merge_section_by_properties_map,
8544 Output_section::Output_section_data_by_input_section_map,
8545 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8547 (Output_section::add_merge_input_section): Add new parameter
8548 KEEPS_INPUT_SECTIONS.
8549 (Output_section::build_lookup_maps): New method declaration.
8550 (Output_section::merge_section_map_,
8551 Output_section::merge_section_by_properties_map_,
8552 Output_section::relaxed_input_section_map_,
8553 Output_section::is_relaxed_input_section_map_valid_): Remove data
8555 (Output_section::lookup_maps_): New data member.
8557 2010-05-21 Doug Kwan <dougkwan@google.com>
8560 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8561 avoid a compilation error.
8563 2010-05-19 Rafael Espindola <espindola@google.com>
8565 * script-sections.cc (Output_section_definition::allocate_to_segment):
8566 Update the phdrs_list even when the output section is NULL.
8567 * testsuite/Makefile.am: Add test.
8568 * testsuite/Makefile.in: Regenerate.
8569 * testsuite/script_test_9.cc: New.
8570 * testsuite/script_test_9.sh: New.
8571 * testsuite/script_test_9.t: New.
8573 2010-05-19 Doug Kwan <dougkwan@google.com>
8575 * arm.cc (Arm_input_section::original_size): New method.
8576 (Arm_input_section::do_addralign): Add a cast.
8577 (Arm_input_section::do_output_offset): Remove static cast.
8578 (Arm_input_section::original_addralign,
8579 Arm_input_section::original_size_): Change type to uint32_t.
8580 (Arm_input_section::init): Add safe casts for section alignment
8582 (Arm_input_section::set_final_data_size): Do not set address and
8583 offset of stub table.
8584 (Arm_output_section::fix_exidx_coverage): Change use of of
8585 Output_section::Simple_input_section to that of
8586 Output_section::Input_section.
8587 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8588 except for the first pass.
8589 * output.cc (Output_section::get_input_sections): Change type of
8590 input_sections to std::list<Input_section>.
8591 (Output_section::add_script_input_section): Rename from
8592 Output_section::add_simple_input_section. Change type of SIS
8593 parameter from Simple_input_section to Input_section.
8594 * output.h (Output_section::Simple_input_section): Remove class.
8595 (Output_section::Input_section): Change class visibility to public.
8596 (Output_section::Input_section::addralign): Use stored alignments
8597 for special input sections if set.
8598 (Output_section::Input_section::set_addralign): New method.
8599 (Output_section::get_input_sections): Change parameter type from
8600 list of Simple_input_section to list of Input_section.
8601 (Output_section::add_script_input_section): Rename from
8602 Output_section::add_simple_input_section. Change first parameter's
8603 type from Simple_input_section to Input_section and remove the
8604 second and third parameters.
8605 * script-sections.cc (Input_section::Input_section_list): Change
8606 type to list of Output_section::Input_section/
8607 (Input_section_info::Input_section_info): Change parameter type of
8608 INPUT_SECTION to Output_section::Input_section.
8609 (Input_section_info::input_section): Change return type.
8610 (Input_section_info::input_section_): Change type to
8611 Output_section::Input_section.
8612 (Output_section_element_input::set_section_addresses): Adjust code
8613 to use Output_section::Input_section instead of
8614 Output_section::Simple_input_section. Adjust code for renaming
8615 of Output_section::add_simple_input_section.
8616 (Orphan_output_section::set_section_addresses): Ditto.
8618 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8620 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8621 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8623 2010-05-18 Rafael Espindola <espindola@google.com>
8625 * options.cc (General_options::finalize): Handle -nostdlib.
8626 * options.h (nostdlib): New option.
8627 * script.cc (script_add_search_dir): Handle -nostdlib.
8629 2010-05-12 Doug Kwan <dougkwan@google.com>
8631 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8632 attributes section only if there no attributes section after merging.
8633 (Target_arm::merge_object_attributes): Move value of
8634 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
8635 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8636 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8637 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8638 and arm_attr_merge_7.stdout.
8639 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8640 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8641 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8642 arm_attr_merge_7b.o): New rules.
8643 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8645 * testsuite/Makefile.in: Regenerate.
8646 * testsuite/arm_attr_merge.sh: New file.
8647 * testsuite/arm_attr_merge_[67][ab].s: Same.
8649 2010-05-05 Nick Clifton <nickc@redhat.com>
8651 * po/es.po: Updated Spanish translation.
8653 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8655 * Makefile.am (install-exec-local): Properly install gold as
8656 default cross linker.
8657 * Makefile.in: Regenerated.
8659 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8660 Nick Clifton <nickc@redhat.com>
8662 * configure.ac (install_as_default): Define and set to false
8663 unless --enable-gold or --enable-gold=both/gold has been
8665 * configure: Regenerate.
8667 * Makefile.am (install-exec-local): Install the executable as
8668 'ld.gold'. If install_as_default is true then also install it as
8670 * Makefile.in: Regenerated.
8672 2010-04-24 Ian Lance Taylor <iant@google.com>
8674 * layout.cc (Layout::layout_reloc): In relocatable link don't
8675 combine reloc sections for grouped sections.
8677 2010-04-23 Sriraman Tallam <tmsriram@google.com>
8679 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8680 sections that are not ordinary to icf.
8681 * icf.cc (get_section_contents): Handle relocation pointing to section
8682 with no object or shndx information.
8683 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8684 * testsuite/Makefile.in: Regenerate.
8685 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8686 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8688 2010-04-22 Ian Lance Taylor <iant@google.com>
8690 * expression.cc (Expression::Expression_eval_info): Add
8691 result_alignment_pointer field.
8692 (Expression::eval_with_dot): Add result_alignment_pointer
8693 parameter. Change all callers.
8694 (Expression::eval_maybe_dot): Likewise.
8695 (class Binary_expression): Add alignment_pointer parameter to
8696 left_value and right_value. Change all callers.
8697 (BINARY_EXPRESSION): Set result alignment.
8698 (class Trinary_expression): Add alignment_pointer parameter to
8699 arg2_value and arg3_value. Change all callers.
8700 (Trinary_cond::value): Set result alignment.
8701 (Max_expression::value, Min_expression::value): Likewise.
8702 (Align_expression::value): Likewise.
8703 * script-sections.cc (class Sections_element): Add dot_alignment
8704 parameter to set_section_addresses virtual function. Update
8706 (class Output_section_element): Likewise.
8707 (Script_sections::create_segments): Add dot_alignment parameter.
8709 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8710 (Script_sections::set_phdrs_clause_addresses): Likewise.
8711 * script-sections.h: Update declarations.
8712 * script.h: Update declarations.
8713 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8715 * testsuite/script_test_3.t: Set large alignment.
8716 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8717 segment has expected alignment.
8719 2010-04-22 Nick Clifton <nickc@redhat.com>
8721 * po/gold.pot: Updated by the Translation project.
8722 * po/vi.po: Updated Vietnamese translation.
8724 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8726 * testsuite/Makefile.am (check_PROGRAMS): Add
8727 icf_virtual_function_folding_test.
8728 * testsuite/Makefile.in: Regenerated.
8730 2010-04-15 Andrew Haley <aph@redhat.com>
8732 * options.h (merge_exidx_entries): New option.
8733 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8734 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8735 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8736 (Target_arm::merge_exidx_entries): New function.
8737 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8738 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8739 to Arm_exidx_fixup constructor.
8740 Add new arg, merge_exidx_entries.
8741 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8742 Arm_output_section::fix_exidx_coverage.
8744 2010-04-18 Sriraman Tallam <tmsriram@google.com>
8746 * icf.cc (get_section_contents): Check for preemptible functions.
8747 Ignore addend when appropriate.
8748 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8750 (add_from_relobj): Check for section folded.
8751 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8752 * symtab.h (should_add_dynsym_entry): Add new parameter.
8753 * target-reloc.h (scan_relocs): Check for section folded.
8754 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8755 Check reloc types for function pointers in shared objects.
8756 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8758 (icf_preemptible_functions_test): New test case.
8759 (icf_string_merge_test): New test case.
8760 * testsuite.Makefile.in: Regenerate.
8761 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8762 bar_glob. Refactor code.
8763 * testsuite/icf_preemptible_functions_test.cc: New file.
8764 * testsuite/icf_preemptible_functions_test.sh: New file.
8765 * testsuite/icf_string_merge_test.cc: New file.
8766 * testsuite/icf_string_merge_test.sh: New file.
8767 * testsuite/icf_virtual_function_folding_test.cc: New file.
8768 * testsuite/icf_virtual_function_folding_test.sh: New file.
8770 2010-04-14 Doug Kwan <dougkwan@google.com>
8772 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8773 for local symbol recounting if we remove a section due to ICF.
8774 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8775 there are no regular objects in input.
8777 2010-04-13 Doug Kwan <dougkwan@google.com>
8779 * arm.cc (Arm_input_section::set_final_data_size): Compute
8780 accurate final data size instead of using current data size.
8782 2010-04-09 Doug Kwan <dougkwan@google.com>
8784 * layout.cc (Layout::choose_output_section): Handle script section
8786 (Layout::make_output_section_for_script): Add section type parameter.
8787 Handle script section types.
8788 * layout.h (Layout::make_output_section_for_script): Add section
8790 * output.cc (Output_section::Output_section): Initialize data member
8792 (Output_section::do_reset_address_and_file_offset): Do not set address
8793 to 0 if section is a NOLOAD section.
8794 * output.h (Output_section::is_noload): New method.
8795 (Output_section::set_is_noload): Ditto.
8796 (Output_section::is_noload_): New data member.
8797 * script-c.h (Script_section_type): New enum type.
8798 (struct Parser_output_section_header): Add new file section_type.
8799 * script-sections.cc (Sections_element::output_section_name): Add
8800 parameter for returning script section type.
8801 (Output_section_definition::output_section_name): Ditto.
8802 (Output_section_definition::section_type)P; New method.
8803 (Output_section_definiton::script_section_type_name): Ditto.
8804 (Output_section_definition::script_section_type_): New data member.
8805 (Output_section_definition::Output_section_definition): Initialize
8806 data member Output_section_definition::script_section_type_.
8807 (Output_section_definition::create_sections): Pass script section type
8808 to Layout::make_output_section_for_script.
8809 (Output_section_definition::output_section_name): Return script
8810 section type to caller.
8811 (Output_section_definition::set_section_address): Do not advance
8812 dot value and load address if section type is NOLOAD. Set address
8813 of NOLOAD sections regardless of section flags.
8814 (Output_section_definition::print): Print section type if it is
8815 not SCRIPT_SECTION_TYPE_NONE.
8816 (Output_section_definition::section_type): New method.
8817 (Output_section_definition::script_section_type_name): Ditto.
8818 (Script_sections::output_section_name): Add new parameter
8819 PSECTION_TYPE for returning script section type. Pass it to
8820 section elements. Handle discard sections.
8821 (Sort_output_sections::operator()): Handle NOLOAD sections.
8822 * script-sections.h (Script_sections::Section_type): New enum type.
8823 (Script_sections::output_section_name): Add a new parameter for
8824 returning script section type.
8825 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8827 * yyscript.y (union): Add new field SECTION_TYPE.
8828 (COPY, DSECT, INFO, NOLOAD): New tokens.
8829 (opt_address_and_section_type): Change type to output_section_header.
8830 (section_type): New non-terminal
8831 (section_header): Handle section type.
8832 (opt_address_and_section_type): Return section type value.
8834 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8836 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8837 * testsuite/plugin_common_test_2.c (foo): Likewise.
8839 2010-04-08 Doug Kwan <dougkwan@google.com>
8841 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8843 * output.cc (Output_section::add_merge_input_section): Simplify
8844 code and return status of Output_merge_base::add_input_section.
8845 Update merge section map only if Output_merge_base::add_input_section
8848 2010-04-07 Doug Kwan <dougkwan@google.com>
8850 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8851 if section is marked as containing instructions but has no mapping
8853 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8854 correct section index.
8855 (Arm_relobj::find_linked_text_section): Ditto.
8857 2010-04-07 Cary Coutant <ccoutant@google.com>
8859 * archive.cc (include_member): Destroy Read_symbols_data object before
8861 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8862 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8863 (Read_symbols_data::~Read_symbols_data) New destructor.
8864 (Section_relocs::Section_relocs) New constructor.
8865 (Section_relocs::~Section_relocs) New destructor.
8866 (Read_relocs_data::Read_relocs_data) New constructor.
8867 (Read_relocs_data::~Read_relocs_data) New destructor.
8868 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8869 pointers to NULL after deleting.
8871 2010-04-07 Doug Kwan <dougkwan@google.com>
8873 * arm.cc: Replace "endianity" with "endianness" in comments.
8874 (Arm_exidx_cantunwind): Ditto.
8875 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8876 (Arm_relobj::merge_flags_and_attributes): New method.
8877 (Arm_relobj::merge_flags_and_attributes_): New data member.
8878 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8879 (Arm_relobj::scan_sections_for_stubs): Ditto.
8880 (Arm_relobj::do_read_symbols): Check to see if we really want to
8881 merge processor-specific flags and attributes. Exit early if
8882 an object is empty except for section names and the undefined symbol.
8883 (Target_arm::do_finalize_sections): Move check for ELF format to
8884 Arm_relobj::do_read_symbols. Merge processor specific flags and
8885 attributes from a regular object only when we have determined that
8886 it is aapropriate. Do not create an .ARM.attributes section in
8887 output if there is no regular input object.
8888 (Target_arm::merge_processor_specific_flags): Check
8889 --warn-mismatch before printing any error.
8890 (Target_arm::merge_object_attributes): Ditto.
8891 * gold.cc (queue_middle_tasks): Handle the case in which there is
8892 no regular object in input.
8893 * options.cc (General_options::parse_EB): New method.
8894 (General_options::parse_EL): Same.
8895 (General_options::General_options): Initialize endianness_.
8896 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8898 (General_options::Endianness): New enum.
8899 (General_options::endianness): New method.
8900 (General_options::endianness_): New data member.
8901 * parameters.cc (Parameters::set_options): Check target endianness.
8902 (Parameters::set_target_once): Ditto.
8903 (Parameters::check_target_endianness): New method.
8904 (parameters_force_valid_target): If either -EL or -EB is specified,
8905 use it to define endianness of default target.
8906 * parameters.h (Parameters::check_target_endianness): New method
8908 * target.h (class Target): Change "endianity" to "endianness"
8911 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8913 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8914 * configure: Regenerate.
8915 * Makefile.in: Regenerate.
8916 * testsuite/Makefile.in: Regenerate.
8918 2010-04-06 Cary Coutant <ccoutant@google.com>
8921 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8922 prevailing definitions of common symbols.
8923 * testsuite/plugin_test_6.sh: New test case.
8924 * testsuite/plugin_common_test_1.c: New test case.
8925 * testsuite/plugin_common_test_2.c: New test case.
8926 * testsuite/Makefile.am (plugin_test_6): New test case.
8927 * testsuite/Makefile.in: Regenerate.
8929 2010-04-06 Nick Clifton <nickc@redhat.com>
8931 * po/vi.po: New Vietnamese translation.
8933 2010-03-30 Doug Kwan <dougkwan@google.com>
8935 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8937 2010-03-25 Doug Kwan <dougkwan@google.com>
8939 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8940 to avoid a conversion warning on a 32-bit host.
8942 2010-03-24 Ian Lance Taylor <iant@google.com>
8944 * testsuite/script_test_3.t: Add a TLS segment.
8945 * testsuite/Makefile.am (check_PROGRAMS): Add
8946 tls_phdrs_script_test.
8947 (tls_phdrs_script_test_SOURCES): Define.
8948 (tls_phdrs_script_test_DEPENDENCIES): Define.
8949 (tls_phdrs_script_test_LDFLAGS): Define.
8950 (tls_phdrs_script_test_LDADD): Define.
8951 * testsuite/Makefile.in: Rebuild.
8953 2010-03-23 Cary Coutant <ccoutant@google.com>
8955 * fileread.cc (find_or_make_view): Fix comment.
8957 2010-03-23 Ian Lance Taylor <iant@google.com>
8959 * script-sections.cc (class Orphan_section_placement): Define
8960 PLACE_TLS and PLACE_TLS_BSS.
8961 (Orphan_section_placement::Orphan_section_placement): Initialize
8963 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8964 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8965 (tls_script_test_SOURCES): Define.
8966 (tls_script_test_DEPENDENCIES): Define.
8967 (tls_script_test_LDFLAGS): Define.
8968 (tls_script_test_LDADD): Define.
8969 * testsuite/Makefile.in: Rebuild.
8971 2010-03-22 Doug Kwan <dougkwan@google.com>
8973 * arm.cc (Arm_relocate_functions::abs8,
8974 Arm_relocate_functions::abs16): Use correct check for overflow
8975 specified in the ARM ELF specs.
8976 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8977 target of a BLX instruction specially.
8978 (Reloc_stub::stub_type_for_reloc): Ditto.
8979 (Relocate::relocate): Use symbolic names instead of numeric relocation
8980 codes to report error.
8981 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8983 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8984 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8985 thumb2_blx_out_of_range.stdout
8986 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8987 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8988 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8989 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8990 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8991 thumb2_blx_in_range, thumb2_blx_in_range.o,
8992 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8993 thumb2_blx_out_of_range.o): New rules.
8994 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
8995 thumb2_blx_in_range and thumb2_blx_out_of_range.
8996 * testsuite/Makefile.in: Regenerate.
8997 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8998 * testsuite/thumb_blx_in_range.s: New file.
8999 * testsuite/thumb_blx_out_of_range.s: New file.
9001 2010-03-22 Rafael Espindola <espindola@google.com>
9003 * archive.cc (Should_include): Move to archive.h.
9004 (should_include_member): Make it a member of Archive.
9006 (Add_lib_group_symbols): New.
9007 * archive.h: Include options.h.
9008 (Archive_member): Moved from Archive.
9009 (Should_include): Moved from archive.cc.
9011 (Add_lib_group_symbols): New.
9012 * dynobj.cc (do_should_include_member): New.
9013 * dynobj.h (do_should_include_member): New.
9014 * gold.cc (queue_initial_tasks): Update call to queue.
9015 * main.cc (main): Print lib group stats.
9016 * object.cc (do_should_include_member): New.
9017 * object.h: Include archive.h.
9018 (Object::should_include_member): New.
9019 (Object::do_should_include_member): New.
9020 (Sized_relobj::do_should_include_member): New.
9021 * options.cc (General_options::parse_start_lib): New.
9022 (General_options::parse_end_lib): New.
9023 (Input_arguments::add_file): Handle lib groups.
9024 (Input_arguments::start_group): Check we are not in a lib.
9025 (Input_arguments::start_lib): New.
9026 (Input_arguments::end_lib): New.
9027 * options.h (General_options): Add start_lib and end_lib.
9028 (Input_argument::lib_): New.
9029 (Input_argument::lib): New.
9030 (Input_argument::is_lib): New.
9031 (Input_file_lib): New.
9032 (Input_arguments::in_lib_): New.
9033 (Input_arguments::in_lib): New.
9034 (Input_arguments::start_lib): New.
9035 (Input_arguments::end_lib_): New.
9036 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9037 in unused members as preempted.
9038 (Sized_pluginobj::do_should_include_member): New.
9039 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9040 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9042 (Read_symbols::do_whole_lib_group): New.
9043 (Read_symbols::do_lib_group): New.
9044 (Read_symbols::do_read_symbols): Handle lib groups.
9045 (Read_symbols::get_name): Handle lib groups.
9046 * readsyms.h (Read_symbols): Add an archive member pointer.
9047 (Read_symbols::do_whole_lib_group): New.
9048 (Read_symbols::do_lib_group): New.
9049 (Read_symbols::member_): New.
9050 * script.cc (read_input_script): Update call to queue_soon.
9052 2010-03-19 Doug Kwan <dougkwan@google.com>
9054 * arm.cc (Stub_table::Stub_table): Initialize new data members
9055 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9056 (Stub_table::add_reloc_stub): Assign stub offset and update
9057 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9058 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9060 (Stub_table::update_data_size_and_addralign): Use
9061 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9062 instead of going over all reloc stubs.
9063 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
9064 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9065 Stringpool_template::offset_ to size of Stringpool_char.
9066 (Stringpool_template::new_key_offset): Remove code to initialize
9067 Stringpool_template::offset_.
9068 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9069 Stringpool_template::offset_ to zero.
9071 2010-03-15 Doug Kwan <dougkwan@google.com>
9073 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9075 (Stringpool_template::new_key_offset): New method.
9076 (Stringpool_template::add_string): Assign offsets when adding new
9078 (Stringpool_template::set_string_offsets): Do not set string offsets
9079 when not optimizing.
9080 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9082 (Chunked_vector::clear): Clear size_.
9083 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9084 (Chunked_vector::size): Return size_.
9085 (Chunked_vector::push_back): Use size_ to find insert position.
9086 (Chunked_vector::size_): New data member.
9087 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9088 (Stringpool_template::new_key_offset): New method declaration.
9089 (Stringpool_template::offset_): New data member.
9091 2010-03-15 Rafael Espindola <espindola@google.com>
9093 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9094 Add_symbols' constructor.
9095 * readsyms.h (Add_symbols): Remove the input_group member.
9097 2010-03-10 Ian Lance Taylor <iant@google.com>
9099 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9100 target to ask whether a reference to a symbol requires a stack
9102 * target.h (Target::is_call_to_non_split): New function.
9103 (Target::do_is_call_to_non_split): Declare virtual function.
9104 * target.cc: Include "symtab.h".
9105 (Target::do_is_call_to_non_split): New function.
9106 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9108 2010-03-10 Cary Coutant <ccoutant@google.com>
9110 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9111 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9112 (File_read::open[2]): Add whole_file_view_ to list of views.
9113 (File_read::make_view): Remove test of whole_file_view_.
9114 (File_read::find_or_make_view): Create whole_file_view_ if
9116 (File_read::clear_views): Replace bool parameter with enum;
9117 adjust all callers. Don't delete views with permanent data;
9118 do delete cached views and views from archives if
9119 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9120 if clearing the corresponding view.
9121 * fileread.h (File_read::Clear_views_mode): New enum.
9122 (File_read::View::is_permanent_view): New method.
9123 (File_read::clear_views): Replace bool parameter
9124 with enum; adjust all callers.
9125 * options.h (General_options): Change keep_files_mapped option;
9126 add map_whole_files.
9127 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9129 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9132 2010-03-10 David S. Miller <davem@davemloft.net>
9134 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9136 2010-03-09 Sriraman Tallam <tmsriram@google.com>
9138 * icf.cc (get_section_contents): Add '@' marker after processing the
9141 2010-03-08 Doug Kwan <dougkwan@google.com>
9143 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9144 due to a conversion warning.
9145 (Arm_relobj::update_output_local_symbol_count): Check for local
9146 symbol with unset output index.
9148 2010-03-05 Ian Lance Taylor <iant@google.com>
9150 * options.h (class General_options): Add --spare-dynamic-tags.
9151 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9152 --spare-dynamic-tags.
9154 2010-03-05 Ian Lance Taylor <iant@google.com>
9156 * incremental.cc: Include "libiberty.h".
9158 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9160 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9161 function, is_info_ member.
9162 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9163 (Versions::Versions): Update caller.
9164 (Versions::define_base_version): Likewise.
9165 (Versions::add_def): Likewise.
9167 2010-03-03 Sriraman Tallam <tmsriram@google.com>
9169 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9170 (Scan::possible_function_pointer_reloc): New function.
9171 (Scan::local_reloc_may_be_function_pointer): Change to call
9172 possible_function_pointer_reloc.
9173 (Scan::global_reloc_may_be_function_pointer): Ditto.
9174 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9175 relocations in ".data.rel.ro._ZTV" section.
9176 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9177 * testsuite/icf_safe_so_test.cc: Ditto.
9178 * testsuite/icf_safe_test.cc: Ditto.
9179 * testsuite/icf_safe_test.sh: Ditto.
9181 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9182 Ian Lance Taylor <iant@google.com>
9184 * target-reloc.h (relocate_section): Check the symbol table index
9185 for -1U before setting the local symbol index.
9186 (scan_relocatable_relocs): If copying the relocation, record that
9187 the local symbol is required.
9188 * object.h (Symbol_value::is_output_symtab_index_set): New
9190 (Symbol_value::may_be_discarded_from_output_symtab): New
9192 (Symbol_value::has_output_symtab_entry): New function.
9193 (Symbol_value::needs_output_symtab_entry): Remove.
9194 (Symbol_value::output_symtab_index): Make sure the symbol index is
9196 (Symbol_value::set_output_symtab_index): Make sure the symbol
9197 index is not set. Make sure the new index is valid.
9198 (Symbol_value::set_must_have_output_symtab_entry): New function.
9199 (Symbol_value::has_output_dynsym_entry): New function.
9200 (Symbol_value::set_output_dynsym_index): Make sure the new index
9202 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9203 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9204 local symbol if permitted.
9205 (Sized_relobj::do_finalize_local_symbols): Call
9206 is_output_symtab_index_set rather than needs_output_symtab_entry.
9207 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9208 rather than needs_output_symtab_entry. Call
9209 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9210 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9211 is_output_symtab_index_set rather than needs_output_symtab_entry.
9212 * testsuite/discard_locals_relocatable_test.c: New file.
9213 * testsuite/discard_locals_test.sh: Test -r.
9214 * testsuite/Makefile.am (check_DATA): Add
9215 discard_locals_relocatable_test1.syms,
9216 discard_local_relocatable_test2.syms.
9217 (MOSTLYCLEANFILES): Likewise. Also add
9218 discard_locals_relocatable_test1.lout and
9219 discard_locals_relocatable_test2.out.
9220 (discard_locals_relocatable_test1.syms): New target.
9221 (discard_locals_relocatable_test.o): New target.
9222 (discard_locals_relocatable_test1.out): New target.
9223 (discard_locals_relocatable_test2.syms): New target.
9224 (discard_locals_relocatable_test2.out): New target.
9225 (various): Add missing ../ld-new dependencies.
9226 * testsuite/Makefile.in: Rebuild.
9228 2010-03-03 Nick Clifton <nickc@redhat.com>
9230 * po/fi.po: New Finnish translation.
9232 2010-03-01 Doug Kwan <dougkwan@google.com>
9234 * layout.cc (Layout::Layout): Force section types of .init_array*,
9235 .preinit_array* and .fini_array* sections.
9236 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9237 Fix check of return value of std::string::find.().
9238 (Output_section::Input_section_sort_compare::operator()): Remove
9239 comment about .init_array.
9240 (Output_section::Input_section_sort_init_fini_compare::operator()):
9242 (Output_section::sort_attached_input_sections): Handle .init_array
9243 and .fini_array specially.
9244 * output.h (Output_section::Inut_section_sort_compare): Update
9246 (Output_section::Input_section_sort_init_fini_compare): New struct.
9248 2010-02-26 Doug Kwan <dougkwan@google.com>
9250 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9251 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9252 * testsuite/debug_msg.sh: Avoid matching source line number for
9253 use of global variable undef_int.
9255 2010-02-26 Doug Kwan <dougkwan@google.com>
9257 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9258 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9259 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9260 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9261 * options.cc (General_options::General_options): Initialize member
9263 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9264 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9265 and rm_no_fix_v4bx.stdout
9266 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9267 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9268 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9269 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9270 and arm_no_fix_v4bx.
9271 * Makefile.in: Regenerate.
9272 * testsuite/arm_fix_v4bx.s: New file.
9273 * testsuite/arm_fix_v4bx.sh: Ditto.
9275 2010-02-24 Doug Kwan <dougkwan@google.com>
9277 * arm.cc (Target_arm::got_section): Make the .got section the first
9278 non RELRO section in the data segment.
9279 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9280 suffixes of section names.
9282 2010-02-24 Doug Kwan <dougkwan@google.com>
9284 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9285 flags and attributes merging if an input file is a binary file.
9286 * fileread.cc (Input_file::open): Record format of original file.
9287 * fileread.h (Input_file::Format): New enum type.
9288 (Input_file::Input_file): Initialize data member format_.
9289 (Input_file::format): New method definition.
9290 (Input_file::format_):: New data member.
9292 2010-02-24 Doug Kwan <dougkwan@google.com>
9294 * arm.cc (Arm_output_data_got): New class.
9295 (ARM_TCB_SIZE): New constant
9296 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9297 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9298 If user uses a script with a SECTIONS clause, issue only a warning
9299 for a misplaced EXIDX input section. Otherwise, issue an error.
9300 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
9302 (Target_arm::got_mode_index_entry): Handle static linking.
9303 (Target_arm::Scan::local): Ditto.
9304 (Target_arm::Scan::global): Ditto.
9305 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9306 all incorrectly implemented relocations.
9307 (Target_arm::fix_exidx_coverage): Pass layout to
9308 Arm_output_section::fix_exidx_coverage.
9309 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9310 from ".ARM.exidx." and ".ARM.extab.".
9312 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9314 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9315 section if it does not already exist.
9316 * attributes.cc (Attributes_section_data::Attributes_section_data):
9317 Don't crash if size is zero.
9319 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9320 Ian Lance Taylor <iant@google.com>
9322 * gold.cc (queue_middle_tasks): If no input files were opened,
9324 * workqueue.h (Task_function::Task_function): Assert that there is
9327 2010-02-22 Doug Kwan <dougkwan@google.com>
9329 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9330 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9331 types to avoid warnings due to different uint64_t implementations
9334 2010-02-21 Doug Kwan <dougkwan@google.com>
9336 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9337 handling of the maximum backward branch offset.
9338 (Arm_relocate_functions::thumb_branch_common): Ditto.
9339 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9340 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
9341 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
9342 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9343 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9344 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9345 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9346 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9347 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9348 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9349 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9350 thumb2_bl_out_of_range.o): New rules.
9351 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9352 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9353 thumb2_bl_out_of_range
9354 * testsuite/Makefile.in: Regenerate.
9355 * testsuite/arm_bl_in_range.s: New file.
9356 * testsuite/arm_bl_out_of_range.s: Ditto.
9357 * testsuite/arm_branch_in_range.sh: Ditto.
9358 * testsuite/arm_branch_range.t: Ditto.
9359 * testsuite/thumb2_branch_range.t: Ditto.
9360 * testsuite/thumb_bl_in_range.s: Ditto.
9361 * testsuite/thumb_bl_out_of_range.s: Ditto.
9362 * testsuite/thumb_branch_range.t: Ditto.
9364 2010-02-20 Sriraman Tallam <tmsriram@google.com>
9366 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9367 Add reloc offset information.
9368 * icf.cc (get_section_contents): Change iterators to point to the new
9369 vectors. Add reloc offset information to the contents.
9370 * icf.h (Icf::Sections_reachable_info): New typedef.
9371 (Icf::Sections_reachable_list): New typedef.
9372 (Icf::Offset_info): New typedef.
9373 (Icf::Reloc_info): New struct typedef.
9374 (Icf::Reloc_info_list): New typedef.
9375 (Icf::symbol_reloc_list): Delete method.
9376 (Icf::addend_reloc_list): Delete method.
9377 (Icf::section_reloc_list): Delete method.
9378 (Icf::reloc_info_list): New method.
9379 (Icf::reloc_info_list_): New member.
9381 2010-02-19 Doug Kwan <dougkwan@google.com>
9383 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9384 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9385 * arm.cc (Arm_relocation_functions): New forward declaration.
9386 (Target_arm::Target_arm): Initialize new data members
9387 got_mod_index_offset_ and tls_base_symbol_defined_.
9388 (Target_arm::Relocate::relocate_tls): New method.
9389 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9390 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9392 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
9393 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9394 (Target_arm::got_mod_index_offset_,
9395 Target_arm::tls_base_symbol_defined_): New data members.
9396 (Target_arm::Scan::local, Target::Scan::global,
9397 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9400 2010-02-18 Doug Kwan <dougkwan@google.com>
9402 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9403 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9404 text section as a parameter becuase some broken tools may not set
9405 the link in section header.
9406 (Target_arm::has_got_section): New method.
9407 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9408 without any mapping symbol as data only. Remove warning.
9409 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9410 link in its section header, try to discover the link by inspecting the
9411 REL31 relocation at the beginning of the section.
9412 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9414 (Target_arm::Scan::global): Treat any reference to the symbol
9415 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9417 2010-02-12 Sriraman Tallam <tmsriram@google.com>
9419 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9420 (Scan::global_reloc_may_be_function_pointer): New function.
9421 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9422 (Scan::global_reloc_may_be_function_pointer): New function.
9423 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9424 (Scan::global_reloc_may_be_function_pointer): New function.
9425 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9426 (Scan::global_reloc_may_be_function_pointer): New function.
9427 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9428 (Scan::global_reloc_may_be_function_pointer): New function.
9429 (Scan::possible_function_pointer_reloc): New function.
9430 (Target_x86_64::can_check_for_function_pointers): New function.
9431 * gc.h (gc_process_relocs): Scan relocation types to determine if
9432 function pointers were taken for targets that support it.
9433 * icf.cc (Icf::find_identical_sections): Include functions for
9434 folding in safe ICF whose pointer is not taken.
9435 * icf.h (Secn_fptr_taken_set): New typedef.
9436 (fptr_section_id_): New member.
9437 (section_has_function_pointers): New function.
9438 (set_section_has_function_pointers): New function.
9439 (check_section_for_function_pointers): New function.
9440 * options.h: Fix comment for safe ICF option.
9441 * target.h (can_check_for_function_pointers): New function.
9442 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9443 Modify icf_safe_test for X86-64.
9444 * testsuite/Makefile.in: Regenerate.
9445 * testsuite/icf_safe_so_test.cc: New file.
9446 * testsuite/icf_safe_so_test.sh: New file.
9447 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9448 (main): Change to take pointer to function kept_func_3.
9449 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9450 folding is done correctly for X86-64.
9452 2010-02-12 David S. Miller <davem@davemloft.net>
9454 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9455 is_symbolless parameter.
9456 (Output_reloc<SHT_REL>::is_symbolless): New.
9457 (Output_reloc<SHT_REL>::is_symbolless_): New.
9458 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9459 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9460 (Output_reloc<SHT_RELA>::is_symbolless): New.
9461 (Output_data_reloc::add_global): Handle is_symbolless.
9462 (Output_data_reloc::add_global_relative): Likewise.
9463 (Output_data_reloc::add_local): Likewise.
9464 (Output_data_reloc::add_local_relative): Likewise.
9465 (Output_data_reloc::add_symbolless_global_addend): New.
9466 (Output_data_reloc::add_symbolless_local_addend): New.
9467 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9469 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9470 instead of ->is_relative_
9471 (Output_reloc::write): Likewise.
9472 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9473 (Output_reloc::write_rel): Simplify.
9475 * sparc.cc (Target_sparc::Scan::local): Use
9476 ->add_symbolless_local_addend as needed.
9477 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9478 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9479 based upon relocation offset.
9481 2010-02-11 Doug Kwan <dougkwan@google.com>
9483 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9484 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9485 beginning of function.
9486 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9487 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9488 parameter is_32bit in calls to should_apply_static_reloc.
9489 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9490 (check_DATA): Add arm_abs_global.stdout.
9491 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9492 arm_abs_global.stdout): New rules.
9493 (MOSTLLYCLEANFILES): Add arm_abs_global
9494 * Makefile.in: Regenerate.
9495 * testsuite/arm_abs_global.s: New file.
9496 * testsuite/arm_abs_global.sh: Ditto.
9497 * testsuite/arm_abs_lib.s: Ditto.
9499 2010-02-11 Ian Lance Taylor <iant@google.com>
9501 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9503 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9504 Allocate_commons_task first.
9505 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9506 task, rather than symtab_lock_.
9507 (Gc_process_relocs::~Gc_process_relocs): New function.
9508 (Gc_process_relocs::is_runnable): Check this_blocker_.
9509 (Gc_process_relocs::locks): Use next_blocker_ rather than
9511 (Scan_relocs::~Scan_relocs): New function.
9512 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9514 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9516 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9517 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9518 constructor accordingly.
9519 (class Gc_process_relocs): Likewise.
9520 (class Scan_relocs): Likewise.
9521 * common.h (class Allocate_commons_task): Remove symtab_lock_
9522 field, and corresponding constructor parameter.
9523 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9525 (Allocate_commons_task::locks): Likewise.
9527 2010-02-11 Ian Lance Taylor <iant@google.com>
9529 * gold-threads.h (class Once): Define.
9530 (class Initialize_lock): Rewrite as child of Once.
9531 * gold-threads.cc (class Once_initialize): Define.
9532 (once_pointer_control): New static variable.
9533 (once_pointer, once_arg): New static variables.
9534 (c_run_once): New static function.
9535 (Once::Once, Once::run_once, Once::internal_run): New functions.
9536 (class Initialize_lock_once): Remove.
9537 (initialize_lock_control): Remove.
9538 (initialize_lock_pointer): Remove.
9539 (initialize_lock_once): Remove.
9540 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9541 (Initialize_lock::initialize): Rewrite.
9542 (Initialize_lock::do_run_once): New function.
9543 * archive.cc (Archive::interpret_header): Only clear name if it is
9545 * fileread.cc: Include "gold-threads.h"
9546 (file_counts_lock): New static variable.
9547 (file_counts_initialize_lock): Likewise.
9548 (File_read::release): Only increment counts when using --stats.
9549 Use a lock around the increment.
9550 * parameters.cc (class Set_parameters_target_once): Define.
9551 (set_parameters_target_once): New static variable.
9552 (Parameters::Parameters): Move here from parameters.h.
9553 (Parameters::set_target): Rewrite.
9554 (Parameters::set_target_once): New function.
9555 (Parameters::clear_target): Move here and rewrite.
9556 * parameters.h (class Parameters): Update declarations. Add
9557 set_parameters_target_once_ field.
9558 (Parameters::Parameters): Move to parameters.cc.
9559 (Parameters::clear_target): Likewise.
9560 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9562 (Start_group::~Start_group): New function.
9563 (Start_group::is_runnable): New function.
9564 (Start_group::locks, Start_group::run): New functions.
9565 (Finish_group::run): Change saw_undefined to size_t.
9566 * readsyms.h (class Start_group): Define.
9567 (class Finish_group): Change saw_undefined_ field to size_t.
9568 (Finish_group::Finish_group): Remove saw_undefined and
9569 this_blocker parameters. Change all callers.
9570 (Finish_group::set_saw_undefined): New function.
9571 (Finish_group::set_blocker): New function.
9572 * symtab.h (class Symbol_table): Change saw_undefined to return
9573 size_t. Change saw_undefined_ field to size_t.
9574 * target-select.cc (Set_target_once::do_run_once): New function.
9575 (Target_selector::Target_selector): Initialize set_target_once_
9576 field. Don't initialize lock_ and initialize_lock_ fields.
9577 (Target_selector::instantiate_target): Rewrite.
9578 (Target_selector::set_target): New function.
9579 * target-select.h (class Set_target_once): Define.
9580 (class Target_selector): Update declarations. Make
9581 Set_target_once a friend. Remove lock_ and initialize_lock_
9582 fields. Add set_target_once_ field.
9584 2010-02-10 Ian Lance Taylor <iant@google.com>
9586 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9588 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9589 (queue_middle_tasks): Add all blockers before queueing any tasks.
9590 (queue_final_tasks): Likewise.
9591 * token.h (Task_token::add_blockers): New function.
9592 * object.h (Input_objects::number_of_relobjs): New function.
9594 2010-02-10 Ian Lance Taylor <iant@google.com>
9596 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9597 shared, not if not position independent.
9598 * x86_64.cc (Relocate::relocate_tls): Likewise.
9599 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9600 (tls_pie_pic_test): New target.
9601 * testsuite/Makefile.in: Rebuild.
9603 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9604 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9605 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9606 * testsuite/Makefile.in: Rebuild.
9608 2010-02-09 David S. Miller <davem@davemloft.net>
9610 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9611 R_SPARC_RELATIVE using ->add_local_relative().
9612 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9614 * output.h (Output_data_dynamic::add_section_size): New method
9615 that takes two Output_data objects.
9616 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9617 entry param. Handle it in initializers.
9618 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9619 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9620 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9622 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9623 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9624 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9625 for dynrel_includes_plt.
9626 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9627 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9628 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9630 (Target_sparc::do_finalize_sections): Update to pass true for
9631 dynrel_includes_plt.
9632 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9633 output before .rela.plt
9634 (Target_powerpc::do_finalize_sections): Update to pass true for
9635 dynrel_includes_plt when 32-bit.
9637 2010-02-08 Doug Kwan <dougkwan@google.com>
9639 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9641 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9642 Arm_relobj::scan_section_for_cortex_a8_stubs,
9643 Arm_relobj::do_relocation_section): Instead of calling
9644 Output_section::output_address, use faster
9645 Arm_relobj::simple_input_section_output_address.
9647 2010-02-08 David S. Miller <davem@davemloft.net>
9649 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9650 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9651 relocation helper function.
9653 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9654 just like R_SPARC_GOT{10,13,22}.
9655 (Target_sparc::Scan::local): Likewise.
9656 (Target_sparc::Relocate:relocate): Likewise.
9658 2010-02-06 Ian Lance Taylor <iant@google.com>
9660 * configure.ac: Rewrite targetobjs duplicate removal code to use
9661 only shell constructs.
9662 * configure: Rebuild.
9664 2010-02-05 Doug Kwan <dougkwan@google.com>
9667 * arm.cc (Arm_relobj::section_is_scannable): New method.
9668 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9669 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9671 2010-02-04 Doug Kwan <dougkwan@google.com>
9674 * arm-reloc-property.cc (cstdio): Include.
9675 * configure.ac (targetobjs): Remove duplicates.
9676 * configure: Regenerate.
9677 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9678 big and little endian version for a given address size.
9680 2010-02-03 Doug Kwan <dougkwan@google.com>
9682 * arm-reloc-property.cc
9683 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9685 * arm-reloc-property.h
9686 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9687 New method definition.
9688 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9690 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9692 (GOT_PREL): Change implemented to Y.
9693 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9694 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9695 (Arm_relocate_functions::movw_abs_nc): Remove method.
9696 (Arm_relocate_functions::movt_abs): Ditto.
9697 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9698 (Arm_relocate_functions::thm_movt_abs): Ditto.
9699 (Arm_relocate_functions::movw_rel_nc): Ditto.
9700 (Arm_relocate_functions::movw_rel): Ditto.
9701 (Arm_relocate_functions::movt_rel): Ditto.
9702 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9703 (Arm_relocate_functions:thm_movw_rel): Ditto.
9704 (Arm_relocate_functions:thm_movt_rel): Ditto.
9705 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9706 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9707 New method definitions.
9708 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9709 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9710 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9711 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9712 (Target_arm::Relocate::relocate): Check for non-static or
9713 unimplemented relocation code and exit early. Change calls to
9714 Target_arm::reloc_uses_thumb_bit and
9715 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9716 instead. Refactor code to handle similar relocations to increase
9717 code sharing. Remove check for unsupported relocation code in switch
9719 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9720 relocation property table to find out size. Change error message to
9721 print out the name of a relocation code instead of the numeric value.
9722 (Target_arm::scan_reloc_for_stub): Use relocation property table
9723 instead of calling Target_arm::reloc_uses_thumb_bit().
9725 2010-02-02 Doug Kwan <dougkwan@google.com>
9727 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9728 types of relaxed input section.
9730 2010-02-02 Doug Kwan <dougkwan@google.com>
9732 * Makefile.am (HFILES): Add arm-reloc-property.h.
9734 (TARGETSOURCES): Add arm-reloc-property.cc
9735 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
9736 (libgold_a_SOURCES): $(DEFFILES)
9737 * Makefile.in: Regenerate.
9738 * arm-reloc-property.cc: New file.
9739 * arm-reloc-property.h: New file.
9740 * arm-reloc.def: New file.
9741 * arm.cc: Update comments.
9742 (arm-reloc-property.h): New included header.
9743 (arm_reloc_property_table): New global variable.
9744 (Target_arm::do_select_as_default_target): New method definition.
9745 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9746 arm-reloc-property to targ_extra_obj.
9747 * parameters.cc (set_parameters_target): Call
9748 Target::select_as_default_target().
9749 * target.h (Target::select_as_default_target): New method definition.
9750 (Target::do_select_as_default_target): Same.
9752 2010-02-01 Doug Kwan <dougkwan@google.com>
9754 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9755 first_output_text_section_.
9756 (Arm_exidx_fixup::first_output_text_section): New method definition.
9757 (Arm_exidx_fixup::first_output_text_section_): New data member.
9758 (Arm_exidx_fixup::process_exidx_section): Record the first text
9759 output section seen.
9760 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9761 and entsize in output section header.
9763 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9765 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9766 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9767 (Arm_relocate_functions::thm_alu11): New Method.
9768 (Arm_relocate_functions::thm_pc8): New Method.
9769 (Arm_relocate_functions::thm_pc12): New Method.
9770 (Target_arm::Scan::local): Handle the relocations.
9771 (Target_arm::Scan::global): Likewise.
9772 (Target_arm::Relocate::relocate): Likewise.
9773 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9775 2010-01-29 Doug Kwan <dougkwan@google.com>
9777 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9778 of relocation types as ld.
9780 2010-01-29 Doug Kwan <dougkwan@google.com>
9782 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9784 (Arm_relocate_functions::thumb_branch_common): Ditto.
9785 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9786 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9787 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9788 Arm_relocate_functions::jump24): Remove.
9789 (Target_arm::Relocate::relocate): Adjust code to call
9790 Arm_relocation_functions::arm_branch_common and
9791 Arm_relocation_functions::thumb_branch_common instead of their removed
9792 wrappers. Merge switch-cases together to reduce source code size.
9794 2010-01-29 Doug Kwan <dougkwan@google.com>
9796 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9797 output_local_symbol_count_needs_update_.
9798 (Arm_relobj::output_local_symbol_count_needs_update,
9799 Arm_relobj::set_output_local_symbol_count_needs_update,
9800 Arm_relobj::update_output_local_symbol_count): New methods.
9801 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9803 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9804 of pointed function as in a R_ARM_PREL31 relocation.
9805 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9806 for output local symbol count updating.
9807 (Target_arm::do_relax): Update output local symbol counts in objects
9809 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9811 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9813 * arm.cc: Added support for the ARM relocations:
9814 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9815 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9816 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9818 (Arm_relocate_functions::movw_rel): New method.
9819 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9820 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9822 (Arm_relocate_functions::thm_movw_rel): New method.
9823 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9825 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9827 (Target_arm::Scan::global): Likewise.
9828 (Target_arm::Relocate::relocate): Likewise.
9829 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9832 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9834 * arm.cc: Added support for ARM group relocations.
9835 (Target_arm::reloc_needs_sym_origin): New method.
9836 (Arm_relocate_functions::calc_grp_kn): New method.
9837 (Arm_relocate_functions::calc_grp_residual): New method.
9838 (Arm_relocate_functions::calc_grp_gn): New method.
9839 (Arm_relocate_functions::arm_grp_alu): New Method.
9840 (Arm_relocate_functions::arm_grp_ldr): New Method.
9841 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9842 (Arm_relocate_functions::arm_grp_ldc): New Method.
9843 (Target_arm::Scan::local): Handle the ARM group relocations.
9844 (Target_arm::Scan::global): Likewise.
9845 (Target_arm::Relocate::relocate): Likewise.
9846 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9849 2010-01-26 Doug Kwan <dougkwan@google.com>
9851 * arm.cc (set): Include.
9852 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9854 (Arm_output_section::Text_section_list): New type.
9855 (Arm_output_section::append_text_sections_to_list): New method.
9856 (Arm_output_section::fix_exidx_coverage): Ditto.
9857 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
9858 (Arm_relobj::convert_input_section_to_relaxed_section): Use
9859 Relobj::set_section_offset() instead of
9860 Sized_relobj::invalidate_section_offset().
9861 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
9862 parameter for section headers. Ignore relocation sections for
9863 unallocated sections and EXIDX sections.
9864 (Target_arm::fix_exidx_coverage): New method.
9865 (Target_arm::output_section_address_less_than): New type.
9866 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9867 linked text section instead of the EXIDX section.
9868 (Arm_output_section::create_stub_group): Add an assertion to check
9869 that this is not an EXIDX output section.
9870 (Arm_output_section::append_text_sections_to_list): New method.
9871 (Arm_output_section::fix_exidx_coverage): Ditto.
9872 (Arm_relobj::scan_sections_for_stubs): Adjust call to
9873 Arm_relobj::section_needs_reloc_stub_scanning.
9874 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9876 (Target_arm::fix_exidx_coverage): New method.
9877 * object.h (Relobj::set_output_section): New method.
9878 (Sized_relobj::invalidate_section_offset): Remove method.
9879 (Sized_relobj::do_invalidate_section_offset): Remove method.
9880 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9882 2010-01-25 Doug Kwan <dougkwan@google.com>
9884 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9885 Fix warning due to signed and unsigned comparison on a 32-bit host.
9887 2010-01-22 Doug Kwan <dougkwan@google.com>
9889 * arm.cc (Target_arm::do_relax): Record an output section for section
9890 offset adjustment it contains any stub table that has changed.
9891 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9892 offsets in an output section if necessary.
9893 * output.cc (Output_section::Output_section): Initialize
9894 section_offsets_need_adjustments_.
9895 (Output_section::add_input_section_for_script): Renamed to
9896 Output_section::add_simple_input_section.
9897 (Output_section::save_states): Add a comment.
9898 (Output_section::discard_states): New method defintion.
9899 (Output_section::adjust_section_offsets): Same.
9900 * output.h (Output_section::add_input_section_for_script): Renamed to
9901 Output_section::add_simple_input_section.
9902 (Output_section::discard_states): New method declaration.
9903 (Output_section::adjust_section_offsets): Same.
9904 (Output_section::section_offsets_need_adjustment,
9905 Output_section::set_section_offsets_need_adjustment): New method
9907 (Output_section::section_offsets_need_adjustment_): New data member.
9908 * script-sections.cc
9909 (Output_section_element_input::set_section_address): Adjust code for
9910 renaming of Output_section::add_input_section_for_script.
9911 (Orphan_output_section::set_section_address): Same.
9913 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9915 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9916 Fix_v4bx enum values .
9917 * gold/options.h (General_options): New option definitions.
9918 (General_options::fix_v4bx): New method.
9919 (General_options::Fix_v4bx): New enum.
9920 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9921 (General_options::parse_fix_v4bx_interworking): New method.
9923 2010-01-22 Doug Kwan <dougkwan@google.com>
9925 * arm.cc (Arm_exidx_fixup): New class.
9927 2010-01-21 Doug Kwan <dougkwan@google.com>
9929 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9931 (Arm_exidx_section_offset_map): New type.
9933 2010-01-21 Doug Kwan <dougkwan@google.com>
9935 * arm.cc (Arm_exidx_input_section): New class.
9936 (Arm_relobj::exidx_input_section_by_link,
9937 Arm_relobj::exidx_input_section_by_shndx,
9938 Arm_relobj::make_exidx_input_section): New methods.
9939 (read_arm_attributes_section): Remove.
9940 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9941 information about them.
9942 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9945 2010-01-20 Doug Kwan <dougkwan@google.com>
9947 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9948 Input_section_specifier to Section_id.
9949 (Target_arm::new_arm_input_section: Adjust code for change of key
9951 (Target_arm::find_arm_input_section): Ditto.
9952 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9953 (Section_id): Remove.
9954 (Garbage_collection::Section_id_hash): Remove.
9955 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9956 (Section_id): Remove.
9957 (Icf::Section_id_hash): Remove.
9958 * object.h (Section_id, Const_section_id, Section_id_hash,
9959 Const_section_id_hash): New type definitions.
9960 * output.cc (Output_section::add_relaxed_input_section): Change to
9961 use Const_section_id instead of Input_section_specifier as key type.
9962 (Output_section::add_merge_input_section): Ditto.
9963 (Output_section::build_relaxation_map): Change to use Section_id
9964 instead of Input_section_specifier as key type.
9965 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9967 (Output_section::convert_input_sections_to_relaxed_sections): Change
9968 to use Const_section_id instead of Input_section_specifier as key type.
9969 (Output_section::find_merge_section): Ditto.
9970 (Output_section::find_relaxed_input_section): Ditto.
9971 * output.h (Input_section_specifier): Remove class.
9972 (Output_section::Output_section_data_by_input_section_map): Change
9973 key type to Const_section_id.
9974 (Output_section::Output_relaxed_input_section_by_input_section_map):
9976 (Output_section::Relaxation_map): Change key type to Section_id.
9978 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9980 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9981 (class Arm_v4bx_stub): New class.
9982 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9983 (Stub_factory::make_arm_v4bx_stub): New method.
9984 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9985 (Stub_table::empty): Handle v4bx stubs.
9986 (Stub_table::add_arm_v4bx_stub): New method.
9987 (Stub_table::find_arm_v4bx_stub): New method.
9988 (Arm_relocate_functions::v4bx): New method.
9989 (Target_arm::fix_v4bx): New method.
9990 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9991 (Stub_table::relocate_stubs): Likewise.
9992 (Stub_table::do_write): Likewise.
9993 (Stub_table::update_data_size_and_addralign): Likewise.
9994 (Stub_table::finalize_stubs): Likewise.
9995 (Target_arm::Scan::local): Likewise.
9996 (Target_arm::Scan::global): Likewise.
9997 (Target_arm::do_finalize_sections): Likewise.
9998 (Target_arm::Relocate::relocate): Likewise.
9999 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10001 (Target_arm::scan_reloc_for_stub): Likewise.
10002 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10004 2010-01-19 Ian Lance Taylor <iant@google.com>
10006 * output.cc (Output_section_headers::do_sized_write): Write large
10007 segment count to sh_info field.
10008 (Output_file_header::do_sized_write): For large segment count,
10009 write PN_XNUM to e_phnum field.
10011 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10013 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10014 (Arm_relocate_functions::thm_jump8): New function.
10015 (Arm_relocate_functions::thm_jump11): New function.
10016 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10018 (Target_arm::Scan::global): Likewise.
10019 (Target_arm::Relocate::relocate): Likewise.
10020 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10023 2010-01-14 Doug Kwan <dougkwan@google.com>
10025 * arm.cc (map, utility): Include headers.
10026 (Target_arm::apply_cortex_a8_workaround): New method.
10027 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10028 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10029 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10030 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10031 the --[no-]fix-cortex-a8 command line options.
10032 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10033 (Target_arm::relocate_stub): Use addend in instruction template.
10034 * options.h (DEFINE_bool): Set the user-set flag.
10035 (General_options): Add --[no-]-fix-cortex options.
10036 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
10037 : Update fast look-up map after conversion.
10039 2010-01-14 Sriraman Tallam <tmsriram@google.com>
10041 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10042 in the first pass of do_layout.
10044 2010-01-13 Doug Kwan <dougkwan@google.com>
10046 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10047 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10048 apparent compiler problem of not folding static constant integral
10049 data members of elfcpp::Elf_sizes<32>.
10051 2010-01-13 Doug Kwan <dougkwan@google.com>
10053 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10054 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10055 Arm_relobj::scan_section_for_cortex_a8_erratum,
10056 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10057 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10058 sections to scan for relocation stubs into a new method
10059 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10060 relocation and Cortex-A8 stub scanning.
10061 (Target_arm::do_relax): Force stubs to be after stubbed sections
10062 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
10063 the beginning of a new relaxation pass. Update a comment.
10064 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10066 2010-01-12 Ian Lance Taylor <iant@google.com>
10068 * target-reloc.h (visibility_error): New inline function.
10069 (relocate_section): Call visibility_error.
10070 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10071 (MOSTLYCLEANFILES): Likewise.
10072 (protected_4_pic.o, protected_3.err): New targets.
10073 * testsuite/protected_4.cc: New file.
10075 2010-01-12 Doug Kwan <dougkwan@google.com>
10077 * arm.cc (Cortex_a8_reloc): New class.
10078 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10079 and cortex_a8_relocs_info_.
10080 (Target_arm::fix_cortex_a8): New method definition.
10081 (Target_arm::Cortex_a8_relocs_info): New type.
10082 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10083 New data member declarations.
10084 (Target_arm::scan_reloc_for_stub): Record information about
10085 relocations for THUMB branches that might be exempted from the
10086 Cortex-A8 workaround.
10087 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10088 at the beginning of a relaxation pass.
10090 2010-01-12 Doug Kwan <dougkwan@google.com>
10092 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10093 (Arm_relobj::Mapping_symbol_position,
10094 Arm_reloj::Mapping_symbol_position_less,
10095 Arm_relobj::Mapping_symbols_info): New types.
10096 (Target_arm::is_mapping_symbol_name): New method definition.
10097 (Arm_relobj::do_count_local_symbols): Save information about mapping
10100 2010-01-11 Doug Kwan <dougkwan@google.com>
10102 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10103 Arm_relocate_functions::thumb32_branch_upper,
10104 Arm_relocate_functions::thumb32_branch_lower,
10105 Arm_relocate_functions::thumb32_cond_branch_offset,
10106 Arm_relocate_functions::thumb32_cond_branch_upper,
10107 Arm_relocate_functions::thumb32_cond_branch_lower,
10108 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10109 branch offset encoding.
10110 (Arm_relocate_functions::thumb_branch_common): Use new branch
10111 offset encoding methods to avoid code duplication.
10112 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10113 (Stub_addend_reader::operator()): Use new branch encoding method
10114 to avoid code duplication.
10116 2010-01-11 Doug Kwan <dougkwan@google.com>
10118 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10119 (Target_arm::do_finalize_sections): Define special EXIDX section
10120 symbols only if referenced.
10121 * gc.h (Garbage_collection::add_reference): New method.
10122 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10125 2010-01-11 Ian Lance Taylor <iant@google.com>
10127 * script.cc (Version_script_info::build_expression_list_lookup):
10128 Change complaing about duplicate wildcard match from error to
10131 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10133 (Version_script_info::Version_script_info): Initialize globs_,
10134 default_version_, default_is_global_, and exact_. Don't
10135 initialize globals_ or locals_.
10136 (Version_script_info::build_lookup_tables): Build local symbols
10138 (Version_script_info::unquote): New function.
10139 (Version_script_info::add_exact_match): New function.
10140 (Version_script_info::build_expression_list_lookup): Remove lookup
10141 parameter. Add is_global parameter. Change all callers. Handle
10142 wildcard pattern specially. Unquote pattern. Call
10144 (Version_script_info::get_name_to_match): New function.
10145 (Version_script_info::get_symbol_version): New function.
10146 (Version_script_info::get_symbol_version_helper): Remove.
10147 (Version_script_info::check_unmatched_names): Call unquote.
10148 * script.h (class Version_script_info): Change get_symbol_version
10149 to be non-inline and add is_global parameter; change all callers.
10150 Rewrite symbol_is_local. Update declarations. Define struct
10151 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10152 Remove globals_ and locals_ members. Add exact_, globs_,
10153 default_version_, is_global_.
10154 (Version_script_info::Glob): Remove pattern, add expression and
10155 is_global. Update constructor. Change all callers.
10156 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10158 (Versions::symbol_section_contents): If a symbol is undefined, or
10159 defined in a dynamic object, set the version index to
10161 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10163 (Symbol_table::add_from_pluginobj): Likewise.
10164 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10166 2010-01-11 Doug Kwan <dougkwan@google.com>
10168 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10169 (incremental_dump_LDADD): Add linking option for libintl.
10170 * Makefile.in: Regenerate.
10172 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10175 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10177 * testsuite/Makefile.in: Regenerated.
10179 2010-01-10 Doug Kwan <dougkwan@google.com>
10181 * options.h (DEFINE_var): Use parentheses around argument varname__
10182 in macro body to avoid any unintended subsequent substitutions.
10184 2010-01-10 Ian Lance Taylor <iant@google.com>
10186 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10187 candidates before doing symbol resolution.
10189 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10190 ODR candidates if only one is weak.
10192 2010-01-08 Ian Lance Taylor <iant@google.com>
10194 * script.cc (Version_script_info::build_expression_list_lookup):
10195 Don't warn about ambiguous version, just record the ambiguity.
10196 (Version_script_info::get_symbol_version_helper): Give error if
10197 version is ambiguous.
10199 2010-01-08 Doug Kwan <dougkwan@google.com>
10201 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
10202 prev_data_size_ and prev_addralign_. Remove initializer for
10203 deleted data member has_been_changed_.
10204 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10205 to determine if the table is empty.
10206 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10208 (Stub_table::add_reloc_stub): Define method in class definition
10209 instead of just declaring it there.
10210 (Stub_table::add_cortex_a8_stub): New method definition.
10211 (Stub_table::update_data_size_and_addralign): Ditto.
10212 (Stub_table::finalize_stubs): Ditto.
10213 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10214 (Stub_table::do_addralign_): Return address alignment in the
10215 (Stub_table::do_reset_address_and_file_offset): Define method in
10216 class definition instead of declaring it there. Set current data
10217 size to be the data size of the previous pass.
10218 (Stub_table::set_final_data_size): Use current data size as the
10220 (Stub_table::relocate_stub): Change parameter type of stub from
10221 Reloc_stub pointer to Stub pointer.
10222 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10223 (Stub_table::Cortex_a8_stub_list): New typedef.
10224 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10225 Stub_table::prev_addralign_): New data member.
10226 (Arm_relobj::Arm_relobj): Initialize data member
10227 section_has_cortex_a8_workaround_.
10228 (Arm_relobj::section_has_cortex_a8_workaround,
10229 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10231 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10233 (Target_arm::relocate_stub): Change parameter type of stub from
10234 Reloc_stub pointer to Stub pointer.
10235 (Insn_template::size, Insn_template::alignment): Handle
10236 THUMB16_SPECIAL_TYPE.
10237 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10238 Stub_table::update_data_size_and_addralign,
10239 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10241 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10242 (Stub_table::do_write): Ditto.
10243 (Target_arm::do_relax): Adjust code for changes in Stub_table.
10245 2010-01-08 Ian Lance Taylor <iant@google.com>
10248 * symtab.h (class Symbol): Remove fields is_target_special_ and
10249 has_plt_offset_. Add field is_defined_in_discarded_section_.
10250 (Symbol::is_defined_in_discarded_section): New function.
10251 (Symbol::set_is_defined_in_discarded_section): New function.
10252 (Symbol::has_plt_offset): Rewrite.
10253 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10254 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10255 Don't initialize is_target_special_ or has_plt_offset_.
10256 Initialize is_defined_in_discarded_section_.
10257 (Symbol_table::add_from_relobj): If appropriate, set
10258 is_defined_in_discarded_section.
10259 * resolve.cc (Symbol::override_base_with_special): Don't test
10260 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10261 * target-reloc.h (relocate_section): Do special handling for
10262 symbols defined in discarded sections for global symbols as well
10265 2010-01-08 Ian Lance Taylor <iant@google.com>
10267 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10268 the SHT_SYMTAB case.
10270 2010-01-08 Ian Lance Taylor <iant@google.com>
10272 * object.cc (Sized_relobj::do_layout): Don't get confused if
10273 layout_eh_frame returns NULL.
10275 2010-01-08 Ian Lance Taylor <iant@google.com>
10278 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10279 dynamic symbol table, use the normal symbol table.
10280 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10283 2010-01-08 Ian Lance Taylor <iant@google.com>
10286 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10289 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10291 * version.cc (print_version): Change to "Copyright 2010".
10293 2010-01-08 Ian Lance Taylor <iant@google.com>
10297 * i386.cc (class Target_i386): Change return type of plt_section
10299 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10300 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10301 tls_desc_rel_ field.
10302 (Output_data_plt_i386::rel_tls_desc): New function.
10303 (Target_i386::rel_tls_desc_section): New function.
10304 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10305 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10306 R_386_TLS_DESC reloc in rel_tls_desc_section.
10307 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10308 Define struct Tlsdesc_info.
10309 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10310 (Target_x86_64::do_reloc_symbol_index): New function.
10311 (Target_x86_64::add_tlsdesc_info): New function.
10312 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10313 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10314 tlsdesc_rel_ field.
10315 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10317 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10318 (Target_x86_64::rela_tlsdesc_section): New function.
10319 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10321 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10322 (Target_x86_64::do_reloc_addend): New function.
10323 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10324 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10325 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10326 (Output_reloc::type): New function.
10327 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10328 (Output_reloc::is_target_specific): New function.
10329 (Output_reloc::target_arg): New function.
10330 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10331 absolute relocs and target specific relocs.
10332 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10333 add_target_specific.
10334 (class Output_data_reloc) [SHT_RELA]: Likewise.
10335 * output.cc (Output_reloc::Output_reloc): Add four new versions
10336 for absolute relocs and target specific relocs.
10337 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10338 (Output_reloc::get_symbol_index): Likewise.
10339 (Output_reloc::local_section_offset): Check that local_sym_index_
10340 is not TARGET_CODE or 0.
10341 (Output_reloc::symbol_value): Likewise.
10342 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10344 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10345 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10347 * layout.cc (add_target_dynamic_tags): Use output section for
10348 DT_PLTRELSZ and DT_JMPREL.
10350 2010-01-07 Ian Lance Taylor <iant@google.com>
10353 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10355 (class Output_data_reloc_generic): Define.
10356 (class Output_data_reloc_base): Change base class to
10357 Output_data_reloc_generic. Change add() method to call
10358 bump_relative_reloc_count for a relative reloc. Remove
10359 sort_relocs_ field.
10360 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10362 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10363 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10365 * layout.h (class Layout): Update declaration.
10367 2010-01-07 Ian Lance Taylor <iant@google.com>
10369 * output.h (class Output_data): Add const version of
10370 output_section and do_output_section.
10371 (class Output_section_data): Add const version of
10373 (class Output_section): Likewise.
10374 * layout.cc (Layout::add_target_dynamic_tags): New function.
10375 * layout.h (class Layout): Update declarations.
10376 * arm.cc (Target_arm::do_finalize_sections): Use
10377 add_target_dynamic_tags.
10378 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10379 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10380 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10381 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10383 2010-01-07 Ian Lance Taylor <iant@google.com>
10386 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10389 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10390 Ian Lance Taylor <iant@google.com>
10393 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10394 Xindex::read_symtab_xindex.
10396 2010-01-07 Doug Kwan <dougkwan@google.com>
10398 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10399 (Insn_template::thumb16_bcond_insn): New method declaration.
10400 (Insn_template): Fix spelling.
10401 (Stub::thumb16_special): New method declaration.
10402 (Stub::do_write): Define virtual method which was previously pure
10404 (Stub::do_thumb16_special): New method declaration.
10405 (Stub::do_fixed_endian_write): New template member.
10406 (Reloc_stub::do_write): Remove.
10407 (Reloc_stub::do_fixed_endian_write): Remove.
10408 (Cortex_a8_stub): New class definition.
10409 (Stub_factory::make_cortex_a8_stub): New method definition.
10410 (Stub_factory::Stub_factory): Add missing static storage class
10411 qualifier for elf32_arm_stub_a8_veneer_blx.
10413 2010-01-07 Ian Lance Taylor <iant@google.com>
10416 * options.h (class General_options): Add --warn-unresolved-symbols
10417 and --error-unresolved-symbols.
10418 * errors.cc (Errors::undefined_symbol): Implement
10419 --warn-unresolved-symbols.
10421 * options.h (class General_options): Add -z text and -z textoff.
10422 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10424 2010-01-06 Sriraman Tallam <tmsriram@google.com>
10426 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10427 (Garbage_collection::cident_sections): New function.
10428 (Garbage_collection::add_cident_section): New function.
10429 (Garbage_collection::cident_sections_): New member.
10430 (gc_process_relocs): Add references to sections whose names are C
10432 * gold.h (cident_section_start_prefix): New constant.
10433 (cident_section_stop_prefix): New constant.
10434 (is_cident): New function.
10435 * layout.cc (Layout::define_section_symbols): Replace string constants
10436 with the newly defined constants.
10437 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10439 * testsuite/Makefile.am: Add gc_orphan_section_test.
10440 * testsuite/Makefile.in: Regenerate.
10441 * testsuite/gc_orphan_section_test.cc: New file.
10442 * testsuite/gc_orphan_section_test.sh: New file.
10444 2010-01-06 Ian Lance Taylor <iant@google.com>
10447 * options.h (class General_options): Add --warn-shared-textrel.
10448 * layout.cc (Layout::finish_dynamic_section): Implement
10449 --warn-shared-textrel.
10452 * options.h (class General_options): Add --warn-multiple-gp.
10454 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10456 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10457 $(THREADSLIB) and $(LIBDL).
10458 * Makefile.in: Rebuild.
10460 2010-01-06 Ian Lance Taylor <iant@google.com>
10463 * options.cc (General_options::parse_section_start): New function.
10464 (General_options::section_start): New function.
10465 (General_options::General_options): Initialize all members.
10466 * options.h: Include <map>
10467 (class General_options): Add --section-start. Add section_starts_
10469 * layout.cc (Layout::attach_allocated_section_to_segment): If
10470 --section-start was used, set the address of the segment. Remove
10471 local sort_sections.
10472 (Layout::relaxation_loop_body): If the address of the load segment
10473 has been set by --section-start, don't use it.
10474 * output.h (Output_segment::update_flags_for_output_section): New
10476 * output.cc (Output_segment::add_output_section): Call
10477 update_flags_for_output_section.
10479 2010-01-05 Ian Lance Taylor <iant@google.com>
10482 * options.h (class General_options): Add --undefined-version.
10483 * script.cc (struct Version_expression): Add was_matched_by_symbol
10485 (Version_script_info::matched_symbol): New function.
10486 (Version_script_info::get_symbol_version_helper): Call
10488 (Version_script_info::check_unmatched_names): New function.
10489 * script.h (class Version_script_info): Update declarations.
10490 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10492 * options.h (class General_options): Use DEFINE_bool_alias for
10493 allow_multiple_definition.
10494 * resolve.cc (Symbol_table::should_override): Don't test
10495 allow_multiple_definition.
10498 * options.h (class General_options): Add --cref.
10499 * main.cc (main): Print cref table if --cref. Don't close mapfile
10500 until after printing cref table.
10501 * cref.cc: Include "symtab.h".
10502 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10503 (Cref_table_compare::operator()): New function.
10504 (Cref_inputs::gather_cref): New function.
10505 (filecol): New static const.
10506 (Cref_inputs::print_cref): New function.
10507 (Cref::print_cref): New function.
10508 * cref.h: Include <cstdio>.
10509 (class Cref): Update declarations.
10510 * mapfile.h (Mapfile::file): New function.
10511 * object.h (class Object): Define Symbols. Declare virtual
10512 do_get_global_symbols.
10513 (Object::get_global_symbols): New function.
10514 * object.cc (Input_objects::add_object): Pass object to cref_ if
10516 (Input_objects::archive_start): Likewise.
10517 (Input_objects::archive_stop): Likewise.
10518 (Input_objects::print_cref): New function.
10519 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10520 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10522 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10524 * plugin.h (class Sized_pluginobj): Update declarations.
10526 2010-01-05 Ian Lance Taylor <iant@google.com>
10528 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10529 to is_default_version. Rename insdef to insdefault.
10530 (Symbol_table::add_from_relobj): Rename def to is_default_version
10531 and local to is_forced_local.
10532 (Symbol_table::add_from_pluginobj): Likewise.
10533 (Symbol_table::add_from_dynobj): Likewise.
10534 (Symbol_table::define_special_symbol): Rename insdef to
10537 2010-01-04 Ian Lance Taylor <iant@google.com>
10540 * options.h (class General_options): Add
10541 --allow-multiple-definition and -z muldefs.
10542 * resolve.cc (Symbol_table::should_override): Don't warn about a
10543 multiple symbol definition if --allow-multiple-definition or -z
10547 * options.h (class General_options): Add --add-needed and
10548 --copy-dt-needed-entries. Tweak --as-needed help entry.
10549 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10550 error if --copy-dt-needed-entries aka --add-needed is used and
10551 would cause a change in behaviour.
10554 * options.h (class General_options): Add -G as a short version of
10555 --shared. Add no-op options -assert, -g, and -i.
10557 2010-01-04 Sriraman Tallam <tmsriram@google.com>
10559 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10560 check for .text or .gnu.linkonce.t sections.
10561 * icf.cc (Icf::find_identical_sections): Ditto.
10562 Change the detection for mangled function name within the section
10564 * icf.h (is_section_foldable_candidate): New function.
10566 2009-12-30 Ian Lance Taylor <iant@google.com>
10569 * options.h (class General_options): Permit two dashes with
10570 --retain-symbols-file.
10572 2009-12-30 Ian Lance Taylor <iant@google.com>
10575 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10576 don't put the file header and segment headers in the text
10580 * common.cc (Sort_commons::operator()): Stabilize sort when both
10582 (Symbol_table::do_allocate_commons_list): When allocating common
10583 symbols, skip a symbol which is no longer common.
10584 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10585 an object before checking its type.
10586 * testsuite/common_test_2.c: New file.
10587 * testsuite/common_test_3.c: New file.
10588 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10589 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10590 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10591 (common_test_2_pic.o, common_test_2.so): New targets.
10592 (common_test_3_pic.o, common_test_3.so): New targets.
10593 * testsuite/Makefile.in: Rebuild.
10596 * script.cc (read_input_script): If we see a new SECTIONS clause,
10597 and we have added an input section, give an error.
10598 * layout.h (class Layout): Add have_added_input_section function.
10599 Add have_added_input_section_ field.
10600 * layout.cc (Layout::Layout): Initialize
10601 have_added_input_section_.
10602 (Layout::layout): Set have_added_input_section_.
10603 (Layout::layout_eh_frame): Likewise.
10605 2009-12-30 Ian Lance Taylor <iant@google.com>
10608 * options.h (class General_options): Add --sort-common option.
10609 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10610 * common.cc (Sort_common): Add sort_order parameter to
10611 constructor. Add sort_order_ field.
10612 (Sort_commons::operator): Check sort_order_.
10613 (Symbol_table::allocate_commons): Determine the sort order.
10614 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10615 Change all callers.
10616 (Symbol_table::do_allocate_commons_list): Likewise.
10618 2009-12-30 Ian Lance Taylor <iant@google.com>
10621 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10622 symbols from this object, don't change the visibility of an
10624 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10626 2009-12-30 Ian Lance Taylor <iant@google.com>
10629 * script.h (class Version_script_info): Define Language enum.
10630 Update declarations. Define Glob, Exact, and Lookup types. Add
10631 new fields globals_, locals_, and is_finalized_.
10632 * script.cc: Various formatting fixes.
10633 (class Parser_closure): Change language_stack_ from a vector of
10634 std::string to one of Version_script_info::Language. Adjust all
10636 (class Lazy_demangler): Remove.
10637 (struct Version_expression): Change language from std::string to
10638 Version_script_info::Language.
10639 (Version_script_info::Version_script_info): New function.
10640 (Version_script_info::~Version_script_info): Don't call clear.
10641 (Version_script_info::finalize): New function.
10642 (Version_script_info::build_lookup_tables): New function.
10643 (Version_script_info::build_expression_list_lookup): New
10645 (Version_script_info::get_symbol_version_helper): Rewrite to use
10647 (Version_script_info::print_expression_list): Adjust to use
10648 Version_script_info::Language.
10649 (script_push_lex_into_version_mode): Check that the version script
10650 has not been finalized.
10651 (version_script_push_lang): Change language string to
10652 Version_script_info::Language.
10653 * options.cc (Command_line::version_script): New function.
10654 * options.h (class General_options): Add finalize_dynamic_list
10655 function. Change version_script from declaration to definition.
10656 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10657 * testsuite/version_script.map: Remove duplicate def of foo.
10658 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10659 version_script.map.
10660 * testsuite/Makefile.in: Rebuild.
10662 2009-12-30 Ian Lance Taylor <iant@google.com>
10665 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10666 if the input symbol index is 0, make the output symbol index 0.
10668 2009-12-30 Ian Lance Taylor <iant@google.com>
10671 * options.h (class General_options): Add -x/--discard-all.
10672 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10673 --discard-all. If the local symbol needs a dynamic entry, check
10674 that before handling --discard-locals.
10676 2009-12-30 Ian Lance Taylor <iant@google.com>
10679 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10681 (Output_segment::add_output_section): Don't change the flags if
10682 the type is PT_TLS.
10685 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10686 GNU hash table if they need a dynamic value. Otherwise, don't add
10687 them if they are defined in a dynamic object or are forced local.
10689 2009-12-29 Ian Lance Taylor <iant@google.com>
10692 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10693 .gnu.hash table for a 32-bit target.
10696 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10697 regular and a dynamic object only needs a dynamic symbol table
10698 entry if it is externally visible.
10701 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10702 constructor. Add global_offset_table_ field.
10703 (Target_i386::got_section): Set global_offset_table_.
10704 (Target_i386::do_finalize_sections): Set global_offset_table_
10706 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10707 in constructor. Add global_offset_table_ field.
10708 (Target_x86_64::got_section): Set global_offset_table_.
10709 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10712 * layout.cc (Layout::Layout): Initialize increase_relro_.
10713 (Layout::get_output_section): Add is_relro, is_last_relro, and
10714 is_first_non_relro parameters. Change all callers.
10715 (Layout::choose_output_section): Likewise.
10716 (Layout::add_output_section_data): Likewise.
10717 (Layout::make_output_section): Likewise.
10718 (Layout::set_segment_offsets): Clear increase_relro when using a
10720 * layout.h (class Layout): Add increase_relro method. Add
10721 increase_relro_ field. Update declarations.
10722 * output.cc (Output_section::Output_section): Initialize
10723 is_last_relro_ and is_first_non_relro_.
10724 (Output_segment::add_output_section): Group relro sections is
10725 do_sort is true. Handle is_last_relro and is_first_non_relro.
10726 (Output_segment::maximum_alignment): Remove relro handling.
10727 (Output_segment::set_section_addresses): Add increase_relro
10728 parameter. Change all callers. Add initial alignment to align
10729 relro sections on separate page. Remove old relro handling.
10730 (Output_segment::set_section_list_addresses): Remove in_relro
10731 parameter. Change all callers.
10732 (Output_segment::set_offset): Add increase parameter. Change all
10733 callers. Remove old relro handling.
10734 * output.h (class Output_section): Add new methods: is_last_relro,
10735 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10736 Add is_last_relro_ and is_first_non_relro_ fields.
10737 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10738 Create separate .got.plt section. Call increase_relro.
10739 * x86_64.cc (Target_x86_64::got_section): Likewise.
10740 * testsuite/relro_script_test.t: Add .got.plt.
10743 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10744 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10745 (Layout::finalize): Call set_dynamic_symbol_size.
10746 (Layout::set_dynamic_symbol_size): New function.
10747 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10748 set_dynamic_symbol_size.
10751 * output.h (class Output_section): Add is_entsize_zero_ field.
10752 * output.cc (Output_section::Output_section): Initialize
10754 (Output_section::set_entsize): If two different entsizes are
10755 requested, force it to zero.
10756 (Output_section::add_input_section): Set flags for .debug_str
10757 before updating section flags. Set entsize.
10758 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10759 and SHF_STRING if all input sections have those flags.
10761 2009-12-29 Rafael Espindola <espindola@google.com>
10763 * main.cc (main): Fix the sys time reporting.
10764 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10767 2009-12-29 Sriraman Tallam <tmsriram@google.com>
10769 * options.cc (General_options::parse_version): Allow -v to exit
10770 without an error if there is nothing to link.
10772 2009-12-29 Ian Lance Taylor <iant@google.com>
10774 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10775 using a version of gcc before 4.1.
10776 * configure: Rebuild.
10778 2009-12-28 Chris Demetriou <cgd@google.com>
10780 * attributes.cc (Output_attributes_section_data::do_write): Use
10781 std::vector::front rather than std::vector::data.
10783 2009-12-28 Ian Lance Taylor <iant@google.com>
10785 * symtab.h (class Symbol_table): Add enum Defined.
10786 * resolve.cc (Symbol_table::should_override): Add defined
10787 parameter. Change all callers. Test whether object is NULL
10788 before calling a method on it.
10789 (Symbol_table::report_resolve_problem): Add defined parameter.
10790 Change all callers.
10791 (Symbol_table::should_override_with_special): Likewise.
10792 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10793 parameter. Change all callers.
10794 (Symbol_table::do_define_in_output_data): Likewise.
10795 (Symbol_table::define_in_output_segment): Likewise.
10796 (Symbol_table::do_define_in_output_segment): Likewise.
10797 (Symbol_table::define_as_constant): Likewise.
10798 (Symbol_table::do_define_as_constant): Likewise.
10799 * script.h (class Symbol_assignment): Add is_defsym parameter to
10800 constructor; change all callers.
10801 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10802 parameter. Change all callers. Add is_defsym_ field.
10803 (class Parser_closure): Add parsing_defsym parameter to
10804 constructor; change all callers. Add parsing_defsym accessor
10805 function. Add parsing_defsym_ field.
10807 2009-12-28 Ian Lance Taylor <iant@google.com>
10809 * gold.cc (queue_middle_tasks): Fix formatting.
10810 * object.cc (Relobj::is_section_name_included): Likewise.
10812 2009-12-23 Ian Lance Taylor <iant@google.com>
10814 * i386.cc (Target_i386::do_calls_non_split): Recognize
10815 -fsplit-stack prologue for a function with a static chain.
10816 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10817 -fsplit-stack prologue when using %r11.
10819 2009-12-21 Sriraman Tallam <tmsriram@google.com>
10821 * options.cc (General_options::parse_version): Make -v continue and do
10822 the link like GNU ld does.
10824 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
10826 * Makefile.am (CCFILES): Add timer.cc.
10827 (HFILES): Add timer.h.
10828 * configure.ac: Check for sysconf and times.
10829 * main.cc: include timer.h.
10830 (main): Use Timer instead of get_run_time.
10833 * workqueue.cc: include timer.h.
10834 (Workqueue::find_and_run_task):
10835 Report user, sys and wall time.
10836 * Makefile.in: Regenerate.
10837 * config.in: Regenerate.
10838 * configure: Regenerate.
10840 2009-12-16 Doug Kwan <dougkwan@google.com>
10842 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10844 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10845 relaxed input sections.
10846 * output.cc (Output_section::find_relaxed_input_section): Change
10847 return type to Output_relaxed_input_section pointer. Adjust code
10848 for new type of relaxed_input_section_map_.
10849 * output.h (Output_section::find_relaxed_input_section): Change
10850 return type to Output_relaxed_input_section pointer.
10851 (Output_section::Output_relaxed_input_section_by_input_section_map):
10853 (Output_section::relaxed_input_section_map_): Change type to
10854 Output_section::Output_relaxed_input_section_by_input_section_map.
10855 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10858 2009-12-15 Ian Lance Taylor <iant@google.com>
10860 * layout.cc (Layout::create_shstrtab): Only write out after input
10861 sections if we are compressing debug sections.
10863 2009-12-15 Ian Lance Taylor <iant@google.com>
10865 * archive.cc (Archive::add_symbols): Only look up a symbol without
10866 a version if there is, in fact, a version.
10868 2009-12-14 Ian Lance Taylor <iant@google.com>
10870 Revert -Wshadow changes, all changes from:
10871 2009-12-11 Doug Kwan <dougkwan@google.com>
10872 2009-12-11 Nick Clifton <nickc@redhat.com>
10873 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10875 2009-12-11 Doug Kwan <dougkwan@google.com>
10877 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10879 * attributes.cc (Object_attribute::size): Ditto.
10880 (Attributes_section_data::size): Ditto.
10881 (Attributes_section_data::Attributes_section_data): Ditto.
10882 (Output_attributes_section_data::do_write): Ditto.
10883 * attributes.h (Object_attribute::set_type): Ditto.
10884 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10886 2009-12-11 Nick Clifton <nickc@redhat.com>
10888 * archive.cc: Fix shadowed variable warnings.
10889 * arm.cc: Likewise.
10890 * compressed_output.cc: Likewise.
10891 * compressed_output.h: Likewise.
10892 * configure: Likewise.
10893 * dwarf_reader.cc: Likewise.
10894 * dynobj.cc: Likewise.
10895 * dynobj.h: Likewise.
10896 * ehframe.cc: Likewise.
10897 * ehframe.h: Likewise.
10898 * errors.cc: Likewise.
10899 * expression.cc: Likewise.
10900 * fileread.cc: Likewise.
10901 * fileread.h: Likewise.
10902 * freebsd.h: Likewise.
10903 * i386.cc: Likewise.
10904 * icf.cc: Likewise.
10905 * incremental.h: Likewise.
10906 * layout.cc: Likewise.
10907 * layout.h: Likewise.
10908 * mapfile.cc: Likewise.
10909 * merge.cc: Likewise.
10910 * merge.h: Likewise.
10911 * object.cc: Likewise.
10912 * object.h: Likewise.
10913 * options.h: Likewise.
10914 * output.cc: Likewise.
10915 * output.h: Likewise.
10916 * parameters.cc: Likewise.
10917 * plugin.cc: Likewise.
10918 * powerpc.cc: Likewise.
10919 * reduced_debug_output.cc: Likewise.
10920 * reduced_debug_output.h: Likewise.
10921 * reloc.cc: Likewise.
10922 * reloc.h: Likewise.
10923 * resolve.cc: Likewise.
10924 * script-sections.cc: Likewise.
10925 * script.cc: Likewise.
10926 * script.h: Likewise.
10927 * sparc.cc: Likewise.
10928 * symtab.cc: Likewise.
10929 * symtab.h: Likewise.
10930 * target-select.cc: Likewise.
10931 * target-select.h: Likewise.
10932 * token.h: Likewise.
10933 * workqueue.cc: Likewise.
10934 * workqueue.h: Likewise.
10935 * x86_64.cc: Likewise.
10937 2009-12-10 Doug Kwan <dougkwan@google.com>
10939 * arm.cc (attributes.h): New include.
10940 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10941 (Arm_relobj::~Arm_relobj): Delete object pointed by
10942 attributes_section_data_.
10943 (Arm_relobj::attributes_section_data): New method definition.
10944 (Arm_relobj::attributes_section_data_): New data member declaration.
10945 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10946 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10947 attributes_section_data_.
10948 (Arm_dynobj::attributes_section_data): New method definition.
10949 (Arm_dynobj::attributes_section_data_): New data member declaration.
10950 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10951 initialization value of may_use_blx_ to false.
10952 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
10953 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10954 object attributes to compute results instead of hard-coding.
10955 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10956 Target_arm::get_secondary_compatible_arch,
10957 Target_arm::set_secondary_compatible_arch
10958 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10959 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10960 New method declarations.
10961 (Target_arm::get_aeabi_object_attribute): New method definition.
10962 (Target_arm::attributes_section_data_): New data member declaration.
10963 (read_arm_attributes_section): New template definition.
10964 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10965 (Arm_dynobj::do_read_symbols): Ditto.
10966 (Target_arm::do_finalize_sections): Merge attributes sections from
10967 input. Check for BLX use after attributes section merging.
10968 Fix __exidx_start and __exidx_end visibility. Create an
10969 .ARM.attributes section if necessary.
10970 (Target_arm::get_secondary_compatible_arch,
10971 Target_arm::set_secondary_compatible_arch,
10972 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10973 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
10974 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
10975 New method definitions.
10977 2009-12-09 Ian Lance Taylor <iant@google.com>
10979 * plugin.cc (Plugin::load): Don't cast from void* to a function
10982 2009-12-09 Ian Lance Taylor <iant@google.com>
10984 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10985 information fields.
10987 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10989 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10990 Replace two_file_shared_1.so with two_file_shared_2.so.
10991 * testsuite/Makefile.in: Regenerated.
10993 2009-12-08 Doug Kwan <dougkwan@google.com>
10995 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10996 (HFILES): Add attributes.h and int_encoding.h.
10997 * Makefile.in: Regenerate.
10998 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10999 function definitions to int_encoding.cc
11000 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11001 prototypes to int_encoding.h
11002 * reduced_debug_output.cc (int_encoding.h): New include.
11003 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11004 function definitions to int_encoding.cc
11005 (insert_into_vector, read_from_pointer): Move template definitions to
11007 * attributes.cc: New file.
11008 * attributes.h: New file.
11009 * int_encoding.cc: New file.
11010 * int_encoding.h: New file.
11012 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
11015 * incremental-dump.cc (dump_incremental_inputs): New.
11016 (main): Use dump_incremental_inputs.
11018 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11021 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11022 checking elfcpp::STT_FUNC.
11023 (Target_i386::Relocate::relocate): Likewise.
11024 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11026 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11027 symbols from shared libraries into normal FUNC symbols.
11029 * symtab.h (Symbol): Add is_func and use it.
11031 2009-12-05 Doug Kwan <dougkwan@google.com>
11033 * arm.cc (Target_arm::arm_info): Initialize new fields
11034 attributes_section and attributes_vendor.
11035 * i386.cc (Target_i386::i386_info): Same.
11036 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11037 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11038 fields attributes_section and attributes_vendor.
11039 * sparc.cc (Target_sparc::sparc_info): Same.
11040 * target.h (Target::attributes_section, Target::attributes_vendor,
11041 Target::is_attributes_section, Target::attribute_arg_type,
11042 Target::attributes_order): New method definitions.
11043 (Target::Target_info::attributes_section,
11044 Target::Target_info::attributes_vendor): New fields.
11045 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11046 virtual method definitions.
11047 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11048 attributes_section and attributes_vendor.
11049 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11051 2009-12-05 Doug Kwan <dougkwan@google.com>
11053 * arm.cc: Update comments about interworking and stub generation.
11054 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11055 considered as non-PIC.
11056 (Arm_relocate_functions::base_abs): Fix formatting.
11057 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11058 of function to use GOT entry address instead of offset.
11059 (Target_arm::Scan::global): Issue an error if a symbol would need a
11060 PLT does not get one because it is untyped. Remove code to create
11061 dynamic symbols for relative branches.
11062 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11063 takes unsigned integer instead of boolean.
11065 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11067 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11068 (two_file_test_LDADD): Likewise.
11069 (common_test_1_LDADD): Likewise.
11070 (exception_test_LDADD) Likewise.
11071 (weak_test_LDADD): Likewise.
11072 (many_sections_test_LDADD): Likewise.
11073 (initpri1_LDADD): Likewise.
11074 (script_test_1_LDADD): Likewise.
11075 (script_test_2_LDADD): Likewise.
11076 (justsyms_LDADD): Likewise.
11077 (binary_test_LDADD): Likewise.
11078 (large_LDADD): Likewise.
11079 * testsuite/Makefile.in: Regenerated.
11081 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
11083 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11084 (Symbol_table::override_with_special): Likewise.
11085 (Symbol_table::add_from_object): Likewise.
11087 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
11089 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11090 Don't set the data_offset twice.
11092 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
11094 * testsuite/Makefile.in: Regenerate.
11096 2009-12-03 Doug Kwan <dougkwan@google.com>
11098 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11099 (Target_arm::do_finalize_sections): Add parameter for symbol table
11100 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11101 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11102 parameter for symbol table pointer.
11103 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11104 an additional parameter for a pointer to symbol table.
11105 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11106 parameter for a symbol table pointer.
11107 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11108 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11110 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11111 parameter for a symbol table pointer.
11113 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
11115 * incremental.cc (Incremental_inputs_header)
11116 (Incremental_inputs_header_write, Incremental_inputs_entry)
11117 (Incremental_inputs_entry_write): Move ...
11118 * incremental.h (Incremental_inputs_header)
11119 (Incremental_inputs_header_write, Incremental_inputs_entry)
11120 (Incremental_inputs_entry_write): here.
11122 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11124 * incremental.cc (make_sized_incremental_binary): Set the target.
11125 Error if it is incompatible.
11126 * output.h (Output_file): Add filename method.
11128 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11130 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11131 from the get_* methods.
11133 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11135 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11136 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11137 Write 0 for the data_offset of scripts.
11139 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11141 * testsuite/Makefile.am: Add the incremental_test.sh test.
11142 * testsuite/incremental_test.sh: New.
11143 * testsuite/incremental_test_1.c: New.
11144 * testsuite/incremental_test_2.c: New.
11146 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
11148 * incremental-dump.cc (main): Fix typos.
11150 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
11153 * incremental-dump.cc (main): Use llu to print 64 bit values.
11155 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11156 H.J. Lu <hongjiu.lu@intel.com>
11158 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11160 (incremental_dump_LDADD): Likewise.
11161 * Makefile.in: Regenerated.
11163 2009-11-25 Doug Kwan <dougkwan@google.com>
11167 2009-11-25 Doug Kwan <dougkwan@google.com>
11169 * arm.cc (Target_arm::Target_arm): Move method definition
11170 outside of class definition. Add code to handle
11171 --target1-rel, --target1-abs and --target2= options.
11172 (Target_arm::get_reloc_reloc_type): Change method to be
11173 non-static and const.
11174 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11175 New data member declaration.
11176 (Target_arm::Scan::local, Target_arm::Scan::global,
11177 Target_arm::Relocate::relocate,
11178 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11179 Adjust call to Target_arm::get_real_reloc_type.
11180 (Target_arm::get_real_reloc_type): Use command line options
11181 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11182 * options.h (--target1-rel, --target1-abs, --target2): New
11185 2009-11-25 Doug Kwan <dougkwan@google.com>
11187 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11188 class definition. Add code to handle --target1-rel, --target1-abs
11189 and --target2= options.
11190 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11192 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11193 member declaration.
11194 (Target_arm::Scan::local, Target_arm::Scan::global,
11195 Target_arm::Relocate::relocate,
11196 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11197 call to Target_arm::get_real_reloc_type.
11198 (Target_arm::get_real_reloc_type): Use command line options to
11199 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11200 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11203 2009-11-25 Doug Kwan <dougkwan@google.com>
11205 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11206 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11207 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11209 (Arm_relocate_functions::thm_call): Replace body with a call to
11210 Arm_relocate_functions::thumb_branch_common.
11211 (Arm_relocate_functions::thm_jump24,
11212 Arm_relocate_functions::thm_xpc22): New method definitions.
11213 (Arm_relocate_functions::thumb_branch_common): New method definition.
11214 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11216 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11217 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11219 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11221 * Makefile.am: Build incremental-dump
11222 * Makefile.in: Regenerate.
11223 * incremental-dump.cc: New.
11224 * incremental.cc (Incremental_inputs_header_data,
11225 Incremental_inputs_entry_data): Move to incremental.h
11226 * incremental.h: (Incremental_inputs_header_data,
11227 Incremental_inputs_entry_data): Move from incremental.cc
11229 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11231 * incremental.cc (Incremental_inputs_header,
11232 Incremental_inputs_header_write, Incremental_inputs_entry,
11233 Incremental_inputs_entry_write): Add a typedef with the data type.
11235 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11237 * incremental.cc (Incremental_inputs_header,
11238 Incremental_inputs_header_write, Incremental_inputs_entry,
11239 Incremental_inputs_entry_write): Update comment about which
11240 type has the filed descriptions.
11242 2009-11-15 Doug Kwan <dougkwan@google.com>
11244 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11245 (Arm_relocate_functions::arm_branch_common): Change method defintion
11246 in class definition to a method declaration and update list of formal
11248 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11249 Arm_relocation_functions::jump24): Adjust call to
11250 Arm_relocate_functions::arm_branch_common. Update list of formal
11252 (Arm_relocate_functions::xpc25): New method definition.
11253 (Arm_relocate_functions::arm_branch_common): Move method defintion
11254 out from class definition. Use stubs for mode-switching and extending
11256 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11257 specially. Change code to enable use of stubs in ARM branches.
11259 2009-11-10 Doug Kwan <dougkwan@google.com>
11261 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11262 in method declaration.
11263 (Target_arm::relocate_stub): New method declaration.
11264 (Target_arm::default_target): Change to return a pointer instead of
11266 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11267 Target_arm::default_target.
11268 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11270 (Target_arm::relocate_section): Adjust view.
11271 (Target_arm::relocate_stub): New method definition.
11273 2009-11-10 Doug Kwan <dougkwan@google.com>
11275 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11277 * incremental.cc (open_incremental_binary): Initialized local
11278 variables to avoid warnings.
11279 * object.cc (make_elf_object): Ditto.
11280 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11283 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11286 * testsuite/plugin_test.c: Include "config.h".
11288 2009-11-09 Doug Kwan <dougkwan@google.com>
11290 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11291 (arm_symbol_value): Remove.
11292 (Arm_relocate_functions::arm_branch_common,
11293 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11294 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11295 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11296 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11297 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11298 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11299 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11300 Arm_relocate_functions::thm_mobw_abs_nc,
11301 Arm_relocate_functions::thm_mov_abs,
11302 Arm_relocate_functions::movw_prel_nc,
11303 Arm_relocate_functions::thm_movt_abs,
11304 Arm_relocate_functions::movt_prel,
11305 Arm_relocate_functions::thm_movw_prel_nc,
11306 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11307 (Target_arm::Relocate::relocate): Only decompose address into two
11308 parts if relocation type uses the thumb-bit and pass the actual
11309 bit instead of a flag indicating that the thumb-bit is used. Adjust
11310 calls to methods in Arm_relocate_functions for this change.
11312 2009-11-08 Ian Lance Taylor <iant@google.com>
11315 * reloc.cc: Instantiate
11316 Sized_relobj::initialize_input_to_output_maps and
11317 Sized_relobj:free_input_to_output_maps.
11319 2009-11-06 Ian Lance Taylor <iant@google.com>
11322 * defstd.cc (in_segment): Set only_if_ref true for "end".
11324 2009-11-06 Doug Kwan <dougkwan@google.com>
11326 * arm.cc (class Reloc_stub): Correct a comment.
11327 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11328 (Target_arm::scan_section_for_stubs): New method declaration.
11329 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11330 Change methods from private to protected.
11331 (Target_arm::do_may_relax): New method definition.
11332 (Target_arm::do_relax, Target_arm::group_sections,
11333 Target_arm::scan_reloc_for_stub,
11334 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11335 (Target_arm::arm_input_section_map_): New data member declaration.
11336 (Target_arm::scan_reloc_for_stub,
11337 Target_arm::scan_reloc_section_for_stubs,
11338 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11339 Target_arm::do_relax): New method definitions.
11341 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11343 * configure.ac: Check for (struct stat)::st_mtim
11344 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11345 * config.in: Regenerate.
11346 * configure: Regenerate.
11348 2009-11-05 Ian Lance Taylor <iant@google.com>
11351 * output.cc (Output_segment::add_output_section): Add missing
11354 2009-11-04 Ian Lance Taylor <iant@google.com>
11357 * object.h (class Object): Add is_needed and set_is_needed
11358 methods. Add is_needed_ field. Make bool fields into bitfields.
11359 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11360 defined in a dynamic object and referenced by a regular object,
11361 set is_needed for the dynamic object.
11362 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11363 if the file is marked with as_needed and it is not needed.
11365 2009-11-04 Ian Lance Taylor <iant@google.com>
11368 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11369 tags if data is discarded by linker script.
11370 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11371 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11372 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11373 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11375 2009-11-04 Ian Lance Taylor <iant@google.com>
11377 * layout.cc (Layout::get_output_section): Add is_interp and
11378 is_dynamic_linker_section parameters. Change all callers.
11379 (Layout::choose_output_section): Likewise.
11380 (Layout::make_output_section): Likewise.
11381 (Layout::add_output_section_data): Add is_dynamic_linker_section
11382 parameter. Change all callers.
11383 * layout.h (class Layout): Update declarations.
11384 * output.h (class Output_section): Add is_interp, set_is_interp,
11385 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11386 Add is_interp_, is_dynamic_linker_section_ fields. Change
11387 generate_code_fills_at_write_ to a bitfield.
11388 * output.cc (Output_section::Output_sections): Initialize new
11390 (Output_segment::add_output_section): Add do_sort parameter.
11391 Change all callers.
11393 2009-11-03 Ian Lance Taylor <iant@google.com>
11396 * options.h (class General_options): Add --warn-common.
11397 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11398 merging two common symbols.
11399 (Symbol_table::should_override): Handle --warn-common when merging
11400 a common symbol with a defined symbol. Use report_resolve_problem
11401 for multiple definitions.
11402 (Symbol_table::report_resolve_problem): New function.
11403 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11405 2009-11-03 Doug Kwan <dougkwan@google.com>
11407 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11409 (Target_arm::stub_factory): New method definition.
11410 (Target_arm::new_arm_input_section,
11411 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11412 Target_arm::reloc_uses_thumb_bit): New method declarations.
11413 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
11414 New type definitions.
11415 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11416 member declarations.
11417 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11418 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11419 New method definitions.
11421 2009-11-03 Ian Lance Taylor <iant@google.com>
11423 * options.h (class General_options): Add --warn_constructors.
11425 2009-11-03 Ian Lance Taylor <iant@google.com>
11428 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11429 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11431 2009-11-03 Ian Lance Taylor <iant@google.com>
11434 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11435 --msgid-bugs-address.
11436 (install-pdf): New target.
11437 (install-data_yes): Look up one directory to find mkinstalldirs.
11439 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11441 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11444 2009-10-30 Doug Kwan <dougkwan@google.com>
11446 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11448 2009-10-30 Doug Kwan <dougkwan@google.com>
11450 * arm.cc (Stub_addend_reader): New struct template definition
11451 and partial specializations.
11452 (Stub_addend_reader::operator()): New method definition for a
11453 partially specialized template.
11455 2009-10-30 Doug Kwan <dougkwan@google.com>
11457 * arm.cc (Arm_relobj::processor_specific_flags): New method
11459 (Arm_relobj::do_read_symbols): New method declaration.
11460 (Arm_relobj::processor_specific_flags_): New data member declaration.
11461 (Arm_dynobj): New class definition.
11462 (Target_arm::do_finalize_sections): Add input_objects parameter.
11463 (Target_arm::do_adjust_elf_header): New method declaration.
11464 (Target_arm::are_eabi_versions_compatible,
11465 (Target_arm::merge_processor_specific_flags): New method declaration.
11466 (Target_arm::do_make_elf_object): New overloaded method definitions
11468 (Arm_relobj::do_read_symbols): New method definition.
11469 (Arm_dynobj::do_read_symbols): Ditto.
11470 (Target_arm::do_finalize_sections): Add input_objects parameters.
11471 Merge processor-specific flags from all input objects.
11472 (Target_arm::are_eabi_versions_compatible,
11473 Target_arm::merge_processor_specific_flags,
11474 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11475 New method definitions.
11476 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11477 Input_objects pointer type parameter.
11478 * layout.cc (Layout::finalize): Pass input objects to target's.
11479 finalize_sections function.
11480 * output.cc (Output_file_header::do_sized_write): Set ELF file
11481 header's processor-specific flags.
11482 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11483 Input_objects pointer type parameter.
11484 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11485 * target.h (Input_objects): New forward class declaration.
11486 (Target::processor_specific_flags,
11487 Target::are_processor_specific_flags_sect): New method definitions.
11488 (Target::finalize_sections): Add input_objects parameter.
11489 (Target::Target): Initialize processor_specific_flags_ and
11490 are_processor_specific_flags_set_.
11491 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11493 (Target::set_processor_specific_flags): New method definition.
11494 (Target::processor_specific_flags_,
11495 Target::are_processor_specific_flags_set_): New data member
11497 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11498 Input_objects pointer type parameter.
11500 2009-10-30 Doug Kwan <dougkwan@google.com>
11502 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11504 2009-10-28 Ian Lance Taylor <iant@google.com>
11506 * object.h (class Relobj): Drop options parameter from
11507 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11508 do_scan_relocs, do_relocate. Change all callers.
11509 (class Sized_relobj): Drop options parameters from
11510 do_gc_process_relocs, do_scan_relocs, do_relocate,
11511 do_relocate_sections, relocate_sections, emit_relocs_scan,
11512 emit_relocs_scan_reltype. Change all callers.
11513 (struct Relocate_info): Remove options field and all references to
11515 * reloc.h (class Read_relocs): Remove options constructor
11516 parameter and options_ field. Change all callers.
11517 (class Gc_process_relocs, class Scan_relocs): Likewise.
11518 (class Relocate_task): Likewise.
11519 * target-reloc.h (scan_relocs): Remove options parameter. Change
11521 (scan_relocatable_relocs): Likewise.
11522 * target.h (class Sized_target): Remove options parameter from
11523 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11525 * gc.h (gc_process_relocs): Remove options parameter. Change all
11527 * arm.cc: Update functions to remove options parameters.
11528 * i386.cc: Likewise.
11529 * powerpc.cc: Likewise.
11530 * sparc.cc: Likewise.
11531 * x86_64.cc: Likewise.
11532 * testsuite/testfile.cc: Likewise.
11534 2009-10-28 Doug Kwan <dougkwan@google.com>
11536 * arm.cc (Arm_relobj): New class definition.
11537 (Arm_relobj::scan_sections_for_stubs,
11538 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11539 New method definitions.
11541 2009-10-28 Cary Coutant <ccoutant@google.com>
11543 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11544 (Plugin::cleanup_done_): New member.
11545 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11546 (Plugin_manager::cleanup_done_): Remove.
11547 (Plugin_manager::add_input_file): Edit error message.
11548 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11549 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11551 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11553 * fileread.cc: (File_read::View::~View): Use the new
11554 data_ownership_ filed.
11555 (File_read::~File_read): Dispose the new whole_file_view_.
11556 (File_read::open): Mmap the whole file if needed.
11557 (File_read::open): Use whole_file_view_ instead of contents_.
11558 (File_read::find_view): Use whole_file_view_ if applicable.
11559 (File_read::do_read): Use whole_file_view_ instead of contents_.
11560 (File_read::make_view): Use whole_file_view_ instead of contents_,
11561 update File_read::View::View call.
11562 (File_read::find_or_make_view): Update File_read::View::View
11564 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11566 (File_read::View::Data_ownership): New enum.
11567 (File_read::View::View): Replace bool mapped_ with Data_ownership
11569 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11570 (File_read::View::data_ownership_): New field.
11571 (File_read::contents_): Remove (replaced by whole_file_view_).
11572 (File_read::whole_file_view_): New field.
11573 * options.h (class General_options): Add --keep-files-mapped.
11575 2009-10-27 Cary Coutant <ccoutant@google.com>
11577 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11578 * testsuite/Makefile.am (plugin_test_5): New test case.
11579 * testsuite/Makefile.in: Regenerate.
11581 2009-10-25 Doug Kwan <dougkwan@google.com>
11583 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11584 from private to protected to allow access by child class.
11585 (Sized_relobj::do_relocate_sections): New method declaration.
11586 (Sized_relobj::relocate_sections): Virtualize.
11587 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
11588 Sized_relobj::relocate_sections. Instantiate template explicitly
11589 for different target sizes and endianity.
11591 2009-10-24 Doug Kwan <dougkwan@google.com>
11593 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11594 (Arm_input_section::as_arm_input_section): New method.
11595 (Arm_output_section): New class definition.
11596 (Arm_output_section::create_stub_group,
11597 Arm_output_section::group_sections): New method definitions.
11599 2009-10-22 Doug Kwan <dougkwan@google.com>
11601 * arm.cc (Arm_input_section): New class definition.
11602 (Arm_input_section::init, Arm_input_section:do_write,
11603 Arm_input_section::set_final_data_size,
11604 Arm_input_section::do_reset_address_and_file_offset): New method
11607 2009-10-21 Doug Kwan <dougkwan@google.com>
11609 * arm.cc (Stub_table, Arm_input_section): New forward class
11611 (Stub_table): New class defintion.
11612 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11613 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11614 New method definition.
11616 2009-10-21 Doug Kwan <dougkwan@google.com>
11618 * arm.cc: Update copyright comments.
11619 (Target_arm): New forward class template declaration.
11620 (Arm_address): New type.
11621 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11622 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11623 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11625 (Insn_template): Same.
11626 (DEF_STUBS): New macro.
11627 (Stub_type): New enum type.
11628 (Stub_template): New class definition.
11630 (Reloc_stub): Same.
11631 (Stub_factory): Same.
11632 (Target_arm::Target_arm): Initialize may_use_blx_ and
11633 should_force_pic_veneer_.
11634 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11635 Target_arm::should_force_pic_veneer,
11636 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11637 Target_arm::using_thumb_only, Target_arm:;default_target): New
11639 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11640 New data member declarations.
11641 (Insn_template::size, Insn_template::alignment): New method defintions.
11642 (Stub_template::Stub_template): New method definition.
11643 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11644 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11645 (Stub_factory::Stub_factory): New method definition.
11646 * gold.h (string_hash): New template.
11647 * output.h (Input_section_specifier::hash_value): Use
11649 (Input_section_specifier::string_hash): Remove.
11650 * stringpool.cc (Stringpool_template::string_hash): Use
11653 2009-10-20 Doug Kwan <dougkwan@google.com>
11655 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11656 symbols of relaxed input sections.
11657 * output.h (Output_section::find_relaxed_input_section): Make
11660 2009-10-16 Doug Kwan <dougkwan@google.com>
11662 * dynobj.cc (Versions::Versions): Initialize version_script_.
11663 Only insert base version symbol definition for a shared object
11664 if version script defines any version versions.
11665 (Versions::define_base_version): New method definition.
11666 (Versions::add_def): Check that base version is not needed.
11667 (Versions::add_need): Define base version lazily.
11668 * dynobj.h (Versions::define_base_version): New method declaration.
11669 (Versions::needs_base_version_): New data member declaration.
11670 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11671 (check_DATA): Add no_version_test.stdout.
11672 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11674 * testsuite/Makefile.in: Regenerate.
11675 * testsuite/no_version_test.c: New file.
11676 * testsuite/no_version_test.sh: Ditto.
11678 2009-10-16 Doug Kwan <dougkwan@google.com>
11680 * expression.cc (class Segment_start_expression): New class definition.
11681 (Segment_start_expression::value): New method definition.
11682 (script_exp_function_segment_start): Return a new
11683 Segment_start_expression.
11684 * gold/script-c.h (script_saw_segment_start_expression): New function
11686 * script-sections.cc (Script_sections::Script_sections): Initialize
11687 SAW_SEGMENT_START_EXPRESSION_ to false.
11688 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11689 and -Tbbs options to specify section addresses if given in
11690 command line and no SEGMENT_START expression is seen in a script.
11691 * script-sections.h (Script_sections::saw_segment_start_expression,
11692 Script_sections::set_saw_segment_start_expression): New method
11694 (Script_sections::saw_segment_start_expression_): New data member
11696 * script.cc (script_saw_segment_start_expression): New function.
11697 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11698 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11699 script_test_7.sh and script_test_8.sh.
11700 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11701 script_test_8.stdout.
11702 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11703 (script_test_6, script_test_6.stdout, script_test_7,
11704 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11705 * Makefile.in: Regenerate.
11706 * testsuite/script_test_6.sh: New file.
11707 * testsuite/script_test_6.t: Same.
11708 * testsuite/script_test_7.sh: Same.
11709 * testsuite/script_test_7.t: Same.
11710 * testsuite/script_test_8.sh: Same.
11712 2009-10-16 Doug Kwan <dougkwan@google.com>
11714 * output.cc (Output_segment::set_section_list_address): Cast
11715 expressions to unsigned long long type to avoid format warnings.
11717 2009-10-15 Ian Lance Taylor <iant@google.com>
11719 * script.cc (Script_options::add_symbol_assignment): Always add a
11720 dot assignment to script_sections_.
11721 * script-sections.cc (Script_sections::add_dot_assignment):
11722 Initialize if necessary.
11724 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11725 program headers with no load segment if there is a linker script.
11727 * layout.cc (Layout::set_segment_offsets): Align the file offset
11728 to the segment aligment for -N or -n with no load segment.
11729 * output.cc (Output_segment::add_output_section): Don't crash if
11730 the first section is a TLS section.
11731 (Output_segment::set_section_list_addresses): Print an error
11732 message if the address moves backward in a linker script.
11733 * script-sections.cc
11734 (Output_section_element_input::set_section_addresses): Don't
11735 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11736 (Orphan_output_section::set_section_addresses): Likewise.
11738 2009-10-15 Doug Kwan <dougkwan@google.com>
11740 * layout.cc (Layout::finish_dynamic_section): Generate tags
11741 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11742 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11743 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11745 2009-10-14 Ian Lance Taylor <iant@google.com>
11747 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11749 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11750 data_shdr fields of relinfo.
11751 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11752 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11753 R_386_TLS_LDO_32, adjust based on section flags.
11754 (Target_i386::Relocate::fix_up_ldo): Remove.
11756 2009-10-13 Ian Lance Taylor <iant@google.com>
11758 Add support for -pie.
11759 * options.h (class General_options): Add -pie and
11761 (General_options::output_is_position_independent): Test -pie.
11762 (General_options::output_is_executable): Return true if not shared
11763 and not relocatable.
11764 (General_options::output_is_pie): Remove.
11765 * options.cc (General_options::finalize): Reject incompatible uses
11767 * gold.cc (queue_middle_tasks): A -pie link is not static.
11768 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11769 * symtab.cc (Symbol::final_value_is_known): Return false if
11770 output_is_position_independent.
11771 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11772 output_is_position_independent.
11773 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11774 output_is_position_independent.
11775 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11776 output_is_position_independent.
11777 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11779 (basic_pie_test.o, basic_pie_test): New targets.
11780 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11781 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11782 (two_file_pie_test): New target.
11783 * testsuite/Makefile.in: Rebuild.
11784 * README: Remove note saying that -pie is not supported.
11786 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11788 * options.h (class General_options): Add -init and -fini.
11789 * layout.cc (Layout::finish_dynamic_section): Emit
11790 given init and fini functions.
11792 2009-10-13 Sriraman Tallam <tmsriram@google.com>
11794 * gc.h (gc_process_relocs): Check if icf is enabled using new
11796 * gold.cc (queue_initial_tasks): Likewise.
11797 (queue_middle_tasks): Likewise.
11798 * object.cc (do_layout): Likewise.
11799 * symtab.cc (is_section_folded): Likewise.
11800 * main.cc (main): Likewise.
11801 * reloc.cc (Read_relocs::run): Likewise.
11802 (Sized_relobj::do_scan_relocs): Likewise.
11803 * icf.cc (is_function_ctor_or_dtor): New function.
11804 (Icf::find_identical_sections): Check if function is ctor or dtor when
11805 safe icf is chosen.
11806 * options.h (General_options::icf): Change option to be an enum.
11807 (Icf_status): New enum.
11808 (icf_enabled): New method.
11809 (icf_safe_folding): New method.
11810 (set_icf_status): New method.
11811 (icf_status_): New variable.
11812 * (options.cc) (General_options::finalize): Set icf_status_.
11813 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11814 icf_test and icf_keep_unique_test to use the --icf enum flag.
11815 * testsuite/icf_safe_test.sh: New file.
11816 * testsuite/icf_safe_test.cc: New file.
11818 2009-10-12 Sriraman Tallam <tmsriram@google.com>
11820 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11821 includes to gc.h and icf.h.
11822 * arm.cc: Include gc.h.
11823 * gold.cc: Likewise.
11824 * i386.cc: Likewise.
11825 * powerpc.cc: Likewise.
11826 * sparc.cc: Likewise.
11827 * x86_64.cc: Likewise.
11828 * gc.h: Include icf.h.
11830 2009-10-11 Ian Lance Taylor <iant@google.com>
11832 * plugin.cc: Include "gold.h" before other header files.
11834 2009-10-10 Chris Demetriou <cgd@google.com>
11836 * options.h (Input_file_argument::Input_file_type): New enum.
11837 (Input_file_argument::is_lib_): Replace with...
11838 (Input_file_argument::type_): New member.
11839 (Input_file_argument::Input_file_argument): Take Input_file_type
11840 'type' rather than boolean 'is_lib' as second argument.
11841 (Input_file_argument::is_lib): Use type_.
11842 (Input_file_argument::is_searched_file): New function.
11843 (Input_file_argument::may_need_search): Handle is_searched_file.
11844 * options.cc (General_options::parse_library): Support -l:filename.
11845 (General_options::parse_just_symbols): Update for Input_file_argument
11847 (Command_line::process): Likewise.
11848 * archive.cc (Archive::get_file_and_offset): Likewise.
11849 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11850 * script.cc (read_script_file, script_add_file): Likewise.
11851 * fileread.cc (Input_file::Input_file): Likewise.
11852 (Input_file::will_search_for): Handle is_searched_file.
11853 (Input_file::open): Likewise.
11854 * readsyms.cc (Read_symbols::get_name): Likewise.
11855 * testsuite/Makefile.am (searched_file_test): New test.
11856 * testsuite/Makefile.in: Regenerate.
11857 * testsuite/searched_file_test.cc: New file.
11858 * testsuite/searched_file_test_lib.cc: New file.
11860 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11861 Ian Lance Taylor <iant@google.com>
11863 * descriptor.cc: Include <cstdio> and "binary-io.h".
11864 (Descriptors::open): Open the files in binary mode always.
11865 * script.cc (Lex::get_token): Treat \r as whitespace.
11867 2009-10-09 Ian Lance Taylor <iant@google.com>
11869 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11871 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11872 Ian Lance Taylor <iant@google.com>
11874 * configure.ac: Check for readv function also.
11875 * fileread.cc (readv): Define if not HAVE_READV.
11876 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11878 * config.in: Regenerate.
11879 * configure: Regenerate.
11881 2009-10-09 Doug Kwan <dougkwan@google.com>
11883 * layout.cc (Layout::make_output_section): Call target hook to make
11884 ordinary output section.
11885 (Layout::finalize): Adjust parameter list of call the
11886 Target::may_relax().
11887 * layout.h (class Layout::section_list): New method.
11888 * merge.h (Output_merge_base::entsize): Change visibility to public.
11889 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11891 (Output_merge_string::do_is_string): New method.
11892 * object.cc (Sized_relobj::do_setup): renamed from
11893 Sized_relobj::set_up.
11894 * object.h (Sized_relobj::adjust_shndx,
11895 Sized_relobj::initializ_input_to_output_maps,
11896 Sized_relobj::free_input_to_output_maps): Change visibilities to
11898 (Sized_relobj::setup): Virtualize.
11899 (Sized_relobj::do_setup): New method declaration.
11900 (Sized_relobj::invalidate_section_offset,
11901 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11902 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11903 * options.cc (parse_int): New function.
11904 * options.h (parse_int): New declaration.
11905 (DEFINE_int): New macro.
11906 (stub_group_size): New option.
11907 * output.cc (Output_section::Output_section): Initialize memebers
11908 merge_section_map_, merge_section_by_properties_map_,
11909 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11910 (Output_section::add_input_section): Handled deferred code-fill
11911 generation and remove an old comment.
11912 (Output_section::add_relaxed_input_section): New method definition.
11913 (Output_section::add_merge_input_section): Use merge section by
11914 properties map to speed to search. Update merge section maps
11916 (Output_section::build_relaxation_map): New method definition.
11917 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11919 (Output_section::relax_input_section): Renamed to
11920 Output_section::convert_input_sections_to_relaxed_sections and change
11921 interface to take a vector of pointers to relaxed sections.
11922 (Output_section::find_merge_section,
11923 Output_section::find_relaxed_input_section): New method definitions.
11924 (Output_section::is_input_address_mapped,
11925 Output_section::output_offset, Output_section::output_address):
11926 Use output section data maps to speed up searching.
11927 (Output_section::find_starting_output_address): Add comments.
11928 (Output_section::do_write,
11929 Output_section::write_to_postprocessing_buffer): Do code-fill
11930 generation as appropriate.
11931 (Output_section::get_input_sections): Invalidate relaxed input section
11933 (Output_section::restore_states): Adjust type of checkpoint .
11934 Invalidate relaxed input section map.
11935 * output.h (Output_merge_base): New class declaration.
11936 (Input_section_specifier): New class defintion.
11937 (class Output_relaxed_input_section) Change base class to
11938 Output_section_data_build.
11939 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11940 base class initializer.
11941 (Output_section::add_relaxed_input_section): New method declaration.
11942 (Output_section::Input_section): Change visibility to protected.
11943 (Output_section::Input_section::relobj,
11944 Output_section::Input_section::shndx): Handle relaxed input sections.
11945 Output_section::input_sections) Change visibility to protected. Also
11946 define overload to return a non-const pointer.
11947 (Output_section::Merge_section_properties): New class defintion.
11948 (Output_section::Merge_section_by_properties_map,
11949 Output_section::Output_section_data_by_input_section_map,
11950 Output_section::Relaxation_map): New types.
11951 (Output_section::relax_input_section): Rename method to
11952 Output_section::convert_input_sections_to_relaxed_sections and change
11953 interface to take a vector of relaxed section pointers.
11954 (Output_section::find_merge_section,
11955 Output_section::find_relaxed_input_section,
11956 Output_section::build_relaxation_map,
11957 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11958 New method declarations.
11959 (Output_section::merge_section_map_
11960 Output_section::merge_section_by_properties_map_,
11961 Output_section::relaxed_input_section_map_,
11962 Output_section::is_relaxed_input_section_map_valid_,
11963 Output_section::generate_code_fills_at_write_): New data members.
11964 * script-sections.cc
11965 (Output_section_element_input::set_section_addresses): Call
11966 current_data_size and addralign methods of relaxed input sections.
11967 (Orphan_output_section::set_section_addresses): Call current_data_size
11968 and addralign methods of relaxed input sections.
11969 * symtab.cc (Symbol_table::compute_final_value): Extract template
11970 from the body of Symbol_table::sized_finalize_symbol.
11971 (Symbol_table::sized_finalized_symbol): Call
11972 Symbol_table::compute_final_value.
11973 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11974 (Symbol_table::compute_final_value): New templated method declaration.
11975 * target.cc (Target::do_make_output_section): New method defintion.
11976 * target.h (Target::make_output_section): New method declaration.
11977 (Target::relax): Add more parameters for input objects, symbol table
11978 and layout. Adjust call to do_relax.
11979 (Target::do_make_output_section): New method declaration.
11980 (Target::do_relax): Add parameters for input objects, symbol table
11983 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11985 * pread.c: Include stdio.h.
11987 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11989 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11992 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11994 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11995 Change read_shndx type to unsigned int.
11996 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11998 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11999 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12000 Change read_shndx type to unsigned int.
12001 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12003 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12004 * layout.cc (Layout::create_symtab_sections): Cast the result of
12005 local_symcount * symsize to off_t in the gold_assert.
12007 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12009 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12010 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12012 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12013 (Arm_relocate_functions::thm_abs5): New function.
12014 (Arm_relocate_functions::abs12): New function.
12015 (Arm_relocate_functions::abs16): New function.
12016 (Arm_relocate_functions::base_abs): New function.
12017 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12018 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12019 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12021 (Scan::global): Likewise.
12022 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12023 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12024 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12025 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12028 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12030 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12031 (Arm_relocate_functions::movt_prel): New function.
12032 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12033 (Arm_relocate_functions::thm_movt_prel): New function.
12034 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12035 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12036 (Scan::global, Relocate::relocate): Likewise.
12037 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12039 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12041 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12042 Incremental_checker.
12043 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12045 (class Incremental_inputs_header): New class.
12046 (Incremental_inputs_header_writer): Edit comment.
12047 (Incremental_inputs_entry): New class.
12048 (Incremental_inputs_entry_writer): Edit comment.
12049 (Sized_incremental_binary::do_find_incremental_inputs_section):
12050 Add *strtab_shndx parameter, fill it.
12051 (Sized_incremental_binary::do_check_inputs): New method.
12052 (Incremental_checker::can_incrementally_link_output_file): Use
12053 Sized_incremental_binary::check_inputs.
12054 (Incremental_inputs::report_command_line): Save command line in
12057 (Incremental_binary::find_incremental_inputs_section): New
12059 (Incremental_binary::do_find_incremental_inputs_section): Add
12060 strtab_shndx parameter.
12061 (Incremental_binary::do_check_inputs): New pure virtual method.
12062 (Sized_incremental_binary::do_check_inputs): Declare.
12063 (Incremental_checker::Incremental_checker): Add incremental_inputs
12064 parameter, use it to initialize incremental_inputs_.
12065 (Incremental_checker::incremental_inputs_): New field.
12066 (Incremental_checker::command_line): New method.
12067 (Incremental_checker::inputs): New method.
12068 (Incremental_checker::command_line_): New field.
12070 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12072 * incremental.cc: Include <cstdarg> and "target-select.h".
12073 (vexplain_no_incremental): New function.
12074 (explain_no_incremental): New function.
12075 (Incremental_binary::error): New method.
12076 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12078 (make_sized_incremental_binary): New function.
12079 (open_incremental_binary): New function.
12080 (can_incrementally_link_file): Add checks if output is ELF and has
12082 * incremental.h: Include "elfcpp_file.h" and "output.h".
12083 (Incremental_binary): New class.
12084 (Sized_incremental_binary): New class.
12085 (open_incremental_binary): Declare.
12086 * object.cc (is_elf_object): Use
12087 elfcpp::Elf_recognizer::is_elf_file.
12088 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12089 * output.h (Output_file::filesize): New method.
12091 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12093 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12095 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12096 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12098 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12100 (Arm_relocate_functions::movw_abs_nc): New function.
12101 (Arm_relocate_functions::movt_abs): New function.
12102 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12103 (Arm_relocate_functions::thm_movt_abs): New function.
12104 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12105 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12106 (Scan::global): Likewise.
12107 (Relocate::relocate): Likewise.
12108 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12110 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12112 * arm.cc (Arm_relocate_functions::got_prel) New function.
12113 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12114 (Relocate::relocate): Likewise.
12115 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12117 2009-10-06 Ian Lance Taylor <iant@google.com>
12119 * options.h (class General_options): Define
12120 split_stack_adjust_size parameter.
12121 * object.h (class Object): Add uses_split_stack_ and
12122 has_no_split_stack_ fields. Add uses_split_stack and
12123 has_no_split_stack accessor functions. Declare
12124 handle_split_stack_section.
12125 (class Reloc_symbol_changes): Define.
12126 (class Sized_relobj): Define Function_offsets. Declare
12127 split_stack_adjust, split_stack_adjust_reltype, and
12129 * object.cc (Object::handle_split_stack_section): New function.
12130 (Sized_relobj::do_layout): Call handle_split_stack_section.
12131 * dynobj.cc (Sized_dynobj::do_layout): Call
12132 handle_split_stack_section.
12133 * reloc.cc (Sized_relobj::relocate_sections): Call
12134 split_stack_adjust for executable sections in split_stack
12135 objects. Pass reloc_map to relocate_section.
12136 (Sized_relobj::split_stack_adjust): New function.
12137 (Sized_relobj::split_stack_adjust_reltype): New function.
12138 (Sized_relobj::find_functions): New function.
12139 * target-reloc.h: Include "object.h".
12140 (relocate_section): Add reloc_symbol_changes parameter. Change
12142 * target.h (class Target): Add calls_non_split method. Declare
12143 do_calls_non_split virtual method. Declare match_view and
12145 * target.cc: Include "elfcpp.h".
12146 (Target::do_calls_non_split): New function.
12147 (Target::match_view): New function.
12148 (Target::set_view_to_nop): New function.
12149 * gold.cc (queue_middle_tasks): Give an error if mixing
12150 split-stack and non-split-stack objects with -r.
12151 * i386.cc (Target_i386::relocate_section): Add
12152 reloc_symbol_changes parameter.
12153 (Target_i386::do_calls_non_split): New function.
12154 * x86_64.cc (Target_x86_64::relocate_section): Add
12155 reloc_symbol_changes parameter.
12156 (Target_x86_64::do_calls_non_split): New function.
12157 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12159 * powerpc.cc (Target_powerpc::relocate_section): Add
12160 reloc_symbol_changes parameter.
12161 * sparc.cc (Target_sparc::relocate_section): Add
12162 reloc_symbol_changes parameter.
12163 * configure.ac: Call AM_CONDITIONAL for the default target.
12164 * configure: Rebuild.
12165 * testsuite/Makefile.am (TEST_AS): New variable.
12166 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12167 (check_DATA): Add split_i386 and split_x86_64 files.
12168 (SPLIT_DEFSYMS): Define.
12169 (split_i386_[1234n].o): New targets.
12170 (split_i386_[124]): New targets.
12171 (split_i386_[1234r].stdout): New targets.
12172 (split_x86_64_[1234n].o): New targets.
12173 (split_x86_64_[124]): New targets.
12174 (split_x86_64_[1234r].stdout): New targets.
12175 (MOSTLYCLEANFILES): Add new executables.
12176 * testsuite/split_i386.sh: New file.
12177 * testsuite/split_x86_64.sh: New file.
12178 * testsuite/split_i386_1.s: New file.
12179 * testsuite/split_i386_2.s: New file.
12180 * testsuite/split_i386_3.s: New file.
12181 * testsuite/split_i386_4.s: New file.
12182 * testsuite/split_i386_n.s: New file.
12183 * testsuite/split_x86_64_1.s: New file.
12184 * testsuite/split_x86_64_2.s: New file.
12185 * testsuite/split_x86_64_3.s: New file.
12186 * testsuite/split_x86_64_4.s: New file.
12187 * testsuite/split_x86_64_n.s: New file.
12188 * testsuite/testfile.cc (Target_test): Update relocation_section
12190 * testsuite/Makefile.in: Rebuild.
12192 2009-10-06 Ian Lance Taylor <iant@google.com>
12194 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12195 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12196 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12197 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12198 the address on ldo_addrs_.
12199 (Target_i386::Relocate::fix_up_ldo): New function.
12201 2009-10-06 Rafael Espindola <espindola@google.com>
12203 * plugin.cc (add_input_library): New.
12204 (Plugin::load): Add add_input_library to tv.
12205 (Plugin_manager::add_input_file): Add the is_lib argument.
12206 (add_input_file): Update call to Plugin_manager::add_input_file.
12207 (add_input_library): New.
12208 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12210 2009-09-30 Doug Kwan <dougkwan@google.com>
12212 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12213 symbol and call Symbol::may_need_copy_reloc to determine if
12214 a copy reloc is needed.
12215 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12216 nocopyreloc is given in command line.
12217 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12218 given in command line.
12219 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12220 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12221 of the removed Target_i386::may_need_copy_reloc.
12222 * options.h (copyreloc): New option with default value false.
12223 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12224 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12225 instead of the removed Target_powerpc::may_need_copy_reloc.
12226 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12227 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12228 instead of the removed Target_sparc::may_need_copy_reloc.
12229 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12230 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12231 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12232 instead of the removed Target_x86_64::may_need_copy_reloc.
12234 2009-09-30 Ian Lance Taylor <iant@google.com>
12236 * object.h (class Object): Remove target_ field, and target,
12237 sized_target, and set_target methods.
12238 (Object::sized_target): Remove.
12239 (class Sized_relobj): Update declarations. Remove sized_target.
12240 * object.cc (Sized_relobj::setup): Remove target parameter.
12241 Change all callers.
12242 (Input_objects::add_object): Don't do anything with the target.
12243 (make_elf_sized_object): Add punconfigured parameter. Change all
12244 callers. Set or test parameter target.
12245 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12246 Change all callers.
12247 * parameters.cc (Parameters::set_target): Change parameter type to
12249 (Parameters::default_target): Remove.
12250 (set_parameters_target): Change parameter type to be non-const.
12251 (parameters_force_valid_target): New function.
12252 (parameters_clear_target): New function.
12253 * parameters.h (class Parameters): Update declarations. Remove
12254 default_target method. Add sized_target and clear_target
12255 methods. Change target_ to be non-const.
12256 (set_parameters_target): Update declaration.
12257 (parameters_force_valid_target): Declare.
12258 (parameters_clear_target): Declare.
12259 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12260 as NULL if we aren't searching.
12261 (Add_symbols::run): Don't check for compatible target.
12262 * fileread.cc (Input_file::open_binary): Call
12263 parameters_force_valid_target.
12264 * gold.cc (queue_middle_tasks): Likewise.
12265 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12266 set_target on object.
12267 * dynobj.h (class Sized_dynobj): Update declarations.
12268 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12269 make_elf_object returns NULL.
12270 (Archive::include_member): Don't check whether object target is
12272 * output.cc (Output_section::add_input_section): Get target from
12274 (Output_section::relax_input_section): Likewise.
12275 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12277 (Sized_relobj::do_scan_relocs): Likewise.
12278 (Sized_relobj::relocate_sections): Likewise.
12279 * resolve.cc (Symbol_table::resolve): Likewise.
12280 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12281 parameter. Change all callers.
12282 (Symbol_table::add_from_object): Get target from parameters.
12283 (Symbol_table::add_from_relobj): Don't check object target.
12284 (Symbol_table::add_from_dynobj): Likewise.
12285 (Symbol_table::define_special_symbol): Get target from
12287 * symtab.h (class Symbol_table): Update declaration.
12288 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12289 parameter. Change all callers. Clear parameter target.
12290 (Binary_test): Test target here.
12291 * testsuite/object_unittest.cc (gold_testsuite): Remove
12292 target_test_pointer parameter. Change all callers.
12293 (Object_test): Test target here.
12295 2009-09-26 Ian Lance Taylor <iant@google.com>
12297 * testsuite/initpri1.c: Don't try to use constructor priorities if
12298 compiling with gcc before 4.3.
12300 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12302 * testsuite/retain_symbols_file_test.sh (check_present): Change
12303 output file name to retain_symbols_file_test.stdout.
12304 (check_absent): Likewise.
12306 2009-09-18 Craig Silverstein <csilvers@google.com>
12308 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12309 * options.cc: Include <cerrno> and <fstream>.
12310 (General_options::finalize): Parse -retain-symbols-file tag.
12311 * options.h: New flag.
12312 (General_options): New method should_retain_symbol, new
12313 variable symbols_to_retain.
12314 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12315 should_retain_symbol map.
12316 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12317 * testsuite/Makefile.in: Regenerate.
12318 * testsuite/retain_symbols_file_test.sh: New file.
12320 2009-09-18 Nick Clifton <nickc@redhat.com>
12322 * po/es.po: Updated Spanish translation.
12324 2009-09-17 Doug Kwan <dougkwan@google.com>
12326 * debug.h (DEBUG_RELAXATION): New constant.
12327 (DEBUG_ALL): Add DEBUG_RELAXATION.
12328 (debug_string_to_enum): Add relaxation debug option.
12330 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12331 Layout::Relaxation_debug_check::read_sections,
12332 Layout::Relaxation_debug_check::read_sections): New method definitions.
12333 (Layout::Layout): Initialize data members
12334 record_output_section_data_from_scrips_,
12335 script_output_section_data_list_ and relaxation_debug_check_.
12336 (Layout::save_segments, Layout::restore_segments,
12337 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12338 Layout::relaxation_loop_body): New method definitions.
12339 (Layout::finalize): Support relaxation. Move section layout code to
12340 Layout::relaxation_loop_body.
12341 (Layout::set_asection_address_from_script): Move code for orphan
12342 section placement out.
12343 (Layout::place_orphan_sections_in_script): New method definition.
12344 * layout.h (Output_segment_headers, Output_file_header):
12345 New forward class declarations.
12346 (Layout::~Layout): Define.
12347 (Layout::new_output_section_data_from_script): New method definition.
12348 (Layout::place_orphan_sections_in_script): New method declaration.
12349 (Layout::Segment_states): New type declaration.
12350 (Layout::save_segments, Layout::restore_segments,
12351 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12352 Layout::relaxation_loop_body): New method declarations.
12353 (Layout::Output_section_data_list): New type declaration.
12354 (Layout::Relaxation_debug_check): New class definition.
12355 (Layout::record_output_section_data_from_script_,
12356 Layout::script_output_section_data_list_, Layout::segment_states_,
12357 Layout::relaxation_debug_check_): New data members.
12358 * output.cc: (Output_section_headers::do_size): New method definition.
12359 (Output_section_headers::Output_section_headers): Move size
12360 computation to Output_section_headers::do_size.
12361 (Output_segment_headers::do_size): New method definition.
12362 (Output_file_header::Output_file_header): Move size computation to
12363 Output_file_header::do_size and call it.
12364 (Output_file_header::do_size): New method definition.
12365 (Output_data_group::Output_data_group): Adjust call to
12366 Output_section_data.
12367 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12368 (Output_symtab_xindex::do_write): Add array bound check.
12369 (Output_section::Input_section::print_to_mapfile): Handle
12370 RELAXED_INPUT_SECTION_CODE.
12371 (Output_section::Output_section): Initialize data member checkpoint_.
12372 (Output_section::~Output_section): Delete checkpoint object pointed
12374 (Output_section::add_input_section): Always add an Input_section if
12376 (Output_section::add_merge_input_section): Add assert.
12377 (Output_section::relax_input_section): New method definition.
12378 (Output_section::set_final_data_size): Set load address to zero for
12379 an unallocated section.
12380 (Output_section::do_address_and_file_offset_have_reset_values):
12381 New method definition.
12382 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12383 Handle relaxed input section.
12384 (Output_section::sort_attached_input_sections): Checkpoint input
12385 section list lazily.
12386 (Output_section::get_input_sections): Change type of input_sections to
12387 list of Simple_input_section pointers. Checkpoint input section list
12388 lazily. Also handle relaxed input sections.
12389 (Output_section::add_input_section_for_script): Take a reference to
12390 a Simple_input_section object instead of Relobj pointer and section
12391 index as parameter. Handle relaxed input sections.
12392 (Output_section::save_states, Output_section::restore_states): New
12393 method definitions.
12394 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12395 (Output_data::is_data_size_fixed): New method definition.
12396 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12398 (Output_data::address_and_file_offset_have_reset_values): New method
12400 (Output_data::do_address_and_file_offset_have_reset_values): New method
12402 (Output_data::set_data_size): Check that data size is not fixed.
12403 (Output_data::fix_data_size): New method definition.
12404 (Output_data::is_data_size_fixed_): New data member.
12405 (Output_section_headers::set_final_data_size): New method definition.
12406 (Output_section_headers::do_size): New method declaration.
12407 (Output_segment_headers::set_final_data_size): New method definition.
12408 (Output_segment_headers::do_size): New method declaration.
12409 (Output_file_header::set_final_data_size)::New method definition.
12410 (Output_file_header::do_size)::New method declaration.
12411 (Output_section_data::Output_section_data): Add new parameter
12412 is_data_size_fixed and use it to fix data size.
12413 (Output_data_const::Output_data_const): Adjust call to base class
12414 constructor and fix data size.
12415 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12416 base class constructor and fix data size.
12417 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12418 base class constructor and fix data size.
12419 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12420 class constructor and fix data size.
12421 (Output_data_group::set_final_data_size): New method definition.
12422 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12423 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12424 class constructor and fix data size.
12425 (Output_relaxed_input_section): New class definition.
12426 (Output_section::Simple_input_section): New class definition.
12427 (Output_section::get_input_sections): Adjust parameter list.
12428 (Output_section::add_input_section_for_script): Same.
12429 (Output_section::save_states, Output_section::restore_states,
12430 Output_section::do_address_and_file_offset_have_reset_values,
12431 (Output_section::Input_section::Input_section): Handle
12432 RELAXED_INPUT_SECTION_CODE. Add new overload for
12433 Output_relaxed_input_section.
12434 (Output_section::Input_section::is_input_section,
12435 Output_section::Input_section::set_output_section): Handle relaxed
12437 (Output_section::Input_section::is_relaxed_input_section,
12438 Output_section::Input_section::output_section_data,
12439 Output_section::Input_section::relaxed_input_section): New method
12441 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12443 (Output_section::Input_section::u1_): Update comments.
12444 (Output_section::Input_section::u2_): Add new union member poris.
12445 (Output_section::Checkpoint_output_section): New classs definition.
12446 (Output_section::relax_input_section): New method declaration.
12447 (Output_section::checkpoint_): New data member.
12448 (Output_segment): Update comments.
12449 (Output_segment::Output_segment): Un-privatize copy constructor.
12450 (Output_segment::operator=): Un-privatize.
12451 * script-sections.cc (Output_section_element::Input_section_list):
12452 Change element type to Output_section::Simple_input_section.
12453 (Output_section_element_dot_assignment::set_section_addresses):
12454 Register output section data for relaxation clean up.
12455 (Output_data_exression::Output_data_expression): Adjust call to base
12456 constructor to fix data size.
12457 (Output_section_element_data::set_section_addresses): Register
12458 Output_data_expression object for relaxation clean up.
12459 (struct Input_section_info): Replace Relobj pointer and section index
12460 pair with Output_section::Simple_input_section and Convert struct to a
12462 (Input_section_sorter::operator()): Adjust access to
12463 Input_section_info data member to use accessors.
12464 (Output_section_element_input::set_section_addresses): Use layout
12465 parameter. Adjust code to use Output_section::Simple_input_section
12466 and Input_secction_info classes. Register filler for relaxation
12468 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12469 and section index pair with Output_section::Simple_input_section
12470 class. Adjust code accordingly.
12471 (Phdrs_element::release_segment): New method definition.
12472 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12474 (Script_sections::release_segments): New method definition.
12475 * gold/script-sections.h (Script_sections::release_segments): New
12476 method declaration.
12477 * gold/target.h (Target::may_relax, Target::relax,
12478 Target::do_may_relax, Target::do_relax): New method definitions.
12480 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12482 * arm.cc (has_signed_unsigned_overflow): New function.
12483 (Arm_relocate_functions::abs8): New function.
12484 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12485 (Target_arm::Scan::global): Likewise.
12486 (Target_arm::relocate::relocate): Likewise.
12487 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12490 2009-09-16 Cary Coutant <ccoutant@google.com>
12492 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12493 * testsuite/Makefile.in: Regenerate.
12495 2009-09-11 Nick Clifton <nickc@redhat.com>
12497 * po/gold.pot: Updated by the Translation project.
12499 2009-09-08 Cary Coutant <ccoutant@google.com>
12501 * output.cc (Output_file::open): Add execute permission to empty file.
12502 * testsuite/Makefile.am (permission_test): New test.
12503 * testsuite/Makefile.in: Regenerate.
12505 2009-09-02 Ian Lance Taylor <iant@google.com>
12507 * output.cc (Output_file::resize): Call map_no_anonymous rather
12510 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12512 * gold.cc: Include "incremental.h".
12513 (queue_initial_tasks): Call Incremental_checker methods.
12514 * incremental.cc: Include "output.h".
12515 (Incremental_checker::can_incrementally_link_output_file): New
12517 * incremental.h (Incremental_checker): New class.
12519 * output.cc (Output_file::open_for_modification): New method.
12520 (Output_file::map_anonymous): Changed return type to bool. Record
12521 map in base_ field.
12522 (Output_file::map_no_anonymous): New method, broken out of map.
12523 (Output_file::map): Use map_no_anonymous and map_anonymous.
12524 * output.h (class Output_file): Update declarations.
12526 2009-08-24 Cary Coutant <ccoutant@google.com>
12528 * options.h (Command_line::Pre_options): New class.
12529 (Command_line::pre_options): New member.
12530 * options.cc (gold::options::ready_to_register): New variable.
12531 (One_option::register_option): Do nothing if not registering options.
12532 Assert if same short option registered twice.
12533 (General_options::General_options): Turn off option registration when
12535 (Command_line::Pre_options::Pre_options): New constructor.
12537 2009-08-24 Cary Coutant <ccoutant@google.com>
12539 * options.h (General_options::no_keep_memory): Remove incorrect
12542 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12544 * Makefile.am (am__skiplex, am__skipyacc): New.
12545 * Makefile.in: Regenerate.
12547 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12549 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12550 (INCLUDES): ... this.
12551 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12552 (AM_CPPFLAGS): Renamed from ...
12553 (INCLUDE): ... this.
12554 * Makefile.in, testsuite/Makefile.in: Regenerate.
12556 * Makefile.in: Regenerate.
12557 * aclocal.m4: Likewise.
12558 * config.in: Likewise.
12559 * configure: Likewise.
12560 * testsuite/Makefile.in: Likewise.
12562 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12563 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12564 * Makefile.in: Regenerate.
12565 * testsuite/Makefile.in: Regenerate.
12567 2009-08-19 Cary Coutant <ccoutant@google.com>
12569 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12570 symbols in shared libraries overridden by hidden or internal symbols
12571 in the main program.
12573 2009-08-19 Chris Demetriou <cgd@google.com>
12575 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12576 checking source file names in error messages.
12578 2009-08-18 Doug Kwan <dougkwan@google.com>
12580 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12581 an elcpp::Ehdr as parameter. Adjust call to set_target.
12582 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12583 an elfcpp::Ehdr as parameter.
12584 * object.cc (Object::set_target): Remove the version that looks up
12585 a target and sets it.
12586 (Sized_relobj::setup): Take a Target object instead of
12587 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12588 (make_elf_sized_object): Find target and ask target to
12589 make an ELF object.
12590 * object.h: (Object::set_target): Remove the version that looks up
12591 a target and sets it.
12592 (Sized_relobj::setup): Take a Target object instead of
12593 an elfcpp:Ehdr as parameter.
12594 * target.cc: Include dynobj.h.
12595 (Target::do_make_elf_object_implementation): New.
12596 (Target::do_make_elf_object): New.
12597 * target.h (Target::make_elf_object): New template declaration.
12598 (Target::do_make_elf_object): New method declarations.
12599 (Target::do_make_elf_object_implementation): New template declaration.
12601 2009-08-14 Ian Lance Taylor <iant@google.com>
12603 * gold.h (FUNCTION_NAME): Define.
12604 (gold_unreachable): Use FUNCTION_NAME.
12606 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12608 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12609 symbol in the --keep-unique list is not found.
12611 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12613 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12614 been maked as --keep-unique.
12615 (Icf::unfold_section): New function.
12616 * icf.h (Icf::unfold_section): New function.
12617 * options.h (General_options::keep_unique): New option.
12618 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12619 * testsuite/Makefile.in: Regenerate.
12620 * testsuite/icf_keep_unique_test.sh: New file.
12621 * testsuite/icf_keep_unique_test.cc: New file.
12623 2009-08-12 Cary Coutant <ccoutant@google.com>
12626 * resolve.cc (Symbol_table::resolve): Check for references from
12627 dynamic objects to hidden and internal symbols.
12628 * testsuite/Makefile.am (hidden_test.sh): New test.
12629 * testsuite/Makefile.in: Regenerate.
12630 * testsuite/hidden_test.sh: New script.
12631 * testsuite/hidden_test_1.c: New test source.
12632 * testsuite/hidden_test_main.c: New test source.
12634 2009-08-11 Doug Kwan <dougkwan@google.com>
12636 * arm.cc: Update comments.
12637 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12638 segment to locate the .ARM.exidx section if present.
12640 2009-08-09 Doug Kwan <dougkwan@google.com>
12642 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12645 2009-08-07 Sriraman Tallam <tmsriram@google.com>
12646 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12649 2009-08-06 Sriraman Tallam <tmsriram@google.com>
12651 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12652 valid tls_segment only for non-debug-section relocations.
12653 * testsuite/Makefile.am: Add gc_tls_test.
12654 * testsuite/Makefile.in: Regenerate.
12655 * testsuite/gc_tls_test.cc: New file.
12656 * testsuite/gc_tls_test.sh: New file.
12658 2009-08-05 Sriraman Tallam <tmsriram@google.com>
12660 * icf.cc: New file.
12662 * Makefile.am (CCFILES): Add icf.cc.
12663 (HFILES): Add icf.h
12664 * Makefile.in: Regenerate.
12665 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12666 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12667 section, symbol and addend information for the relocs.
12668 * gold.cc (queue_middle_tasks): Call identical code folding.
12669 * gold.h: Add defines for multimap.
12670 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12671 to the call of finalize_local_symbols.
12672 * main.cc (main): Create object of class Icf.
12673 * object.cc (Sized_relobj::do_layout): Allow this function to be
12674 called twice during icf.
12675 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12676 to sections marked as identical by icf.
12677 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12679 (Sized_relobj::do_section_entsize): New function.
12680 * object.h (Object::section_entsize): New function.
12681 (Object::do_section_entsize): New pure virtual function.
12682 (Relobj::finalize_local_symbols): Add new parameter.
12683 (Relobj::do_section_entsize): New function.
12684 * options.h (General_options::icf): New option.
12685 (General_options::icf_iterations): New option.
12686 (General_options::print_icf_sections): New option.
12687 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12688 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12689 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12691 * symtab.cc (Symbol_table::is_section_folded): New function.
12692 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12693 to sections marked as identical by icf.
12694 * symtab.h (Symbol_table::set_icf): New function.
12695 (Symbol_table::icf): New function.
12696 (Symbol_table::is_section_folded): New function.
12697 (Symbol_table::icf_): New data member.
12698 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12699 * testsuite/Makefile.am: Add commands to build icf_test.
12700 * testsuite/Makefile.in: Regenerate.
12701 * testsuite/icf_test.sh: New file.
12702 * testsuite/icf_test.cc: New file.
12704 2009-07-24 Chris Demetriou <cgd@google.com>
12706 * layout.cc (is_compressible_debug_section): Fix incorrect
12707 comment about compressed section names.
12709 2009-07-20 Ian Lance Taylor <ian@airs.com>
12712 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12714 2009-07-16 Ian Lance Taylor <iant@google.com>
12717 * layout.h: #include <map>.
12718 (class Kept_section): Change from struct to class. Add accessors
12719 and setters. Add section size to Comdat_group mapping. Change
12720 Comdat_group to std::map. Add is_comdat_ field. Add
12721 linkonce_size field in union.
12722 (class Layout): Update declaration of find_or_add_kept_section.
12723 Don't declare find_kept_object.
12724 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12725 parameter. Add object, shndx, is_comdat, and is_group_name
12726 parameters. Change all callers. Adjust for new Kept_section.
12727 (Layout::find_kept_object): Remove.
12728 * object.cc (Sized_relobj::include_section_group): Update use of
12729 Kept_section. Rename secnum to shndx. Only record
12730 Kept_comdat_section if sections are the same size.
12731 (Sized_relobj::include_linkonce_section): Update use of
12732 Kept_section. Only record Kept_comdat_section if sections are the
12733 same size. Set size of linkonce section.
12734 (Sized_relobj::map_to_kept_section): Update call to
12735 get_kept_comdat_section.
12736 * object.h (class Sized_relobj): Rename fields in
12737 Kept_comdat_section to drop trailing underscores; change object
12738 field to Relobj*. Change Kept_comdat_section_table to store
12739 struct rather than pointer.
12740 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12741 Add kept_object and kept_shndx parameters. Change all callers.
12742 (Sized_relobj::get_kept_comdat_section): Change return type to
12743 bool. Add kept_object and kept_shndx parameters. Change all
12745 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12746 Layout::find_or_add_kept_section.
12748 2009-07-09 Ian Lance Taylor <iant@google.com>
12750 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12751 Reserve space in the hash table.
12753 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12755 * fileread.cc (File_read::get_mtime): New method.
12756 * fileread.h (Timespec): New structure.
12757 (File_read::get_mtime): New method.
12758 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12759 Renamed from timestamp_nsec.
12760 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12762 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
12764 (Incremental_inputs::report_archive): Save mtime; style fix.
12765 (Incremental_inputs::report_obejct): Save mtime; style fix.
12766 (Incremental_inputs::report_script): Save mtime; style fix.
12767 (Incremental_inputs::finalize_inputs): Style fix.
12768 (Incremental_inputs::finalize): Style fix.
12769 (Incremental_inputs::create_input_section_data): Store inputs
12771 * incremental.h (Incremental_inputs::report_script): Add mtime
12773 (Incremental_inputs::Input_info::Input_info): Intialize only one
12775 (Incremental_inputs::Input_info::archive): Move to nameless
12777 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12778 (Incremental_inputs::Input_info::script): Move to nameless union.
12779 (Incremental_inputs::mtime): New field.
12780 * script.cc (read_input_script): Pass file mtime to
12782 * script.h (Script_info::inputs): Style fix.
12784 2009-07-01 Ian Lance Taylor <ian@airs.com>
12786 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12789 2009-06-24 Ian Lance Taylor <iant@google.com>
12792 * layout.cc (Layout::choose_output_section): If we find an
12793 existing section, update the flags.
12794 (Layout::create_notes): New function, broken out of
12796 (Layout::finalize): Don't create note sections.
12797 (Layout::create_note): Don't crash if linker script discards
12799 (Layout::create_gold_note): Likewise.
12800 (Layout::create_build_id): Likewise. Don't set
12801 after_input_sections on the section.
12802 (Layout::create_executable_stack_info): Remove target parameter.
12804 * layout.h (class Layout): Declare create_notes. Update
12805 declaration of create_executable_stack_info.
12806 * gold.cc (queue_middle_tasks): Call create_notes.
12807 * output.cc (Output_section::update_flags_for_input_section): Move
12808 here from output.h. If SHF_ALLOC flag is newly set, mark address
12810 * output.h (Output_data::mark_address_invalid): New function.
12811 (class Output_section): Only declare, not define,
12812 update_flags_for_input_section. Remove set_flags.
12814 2009-06-24 Ian Lance Taylor <iant@google.com>
12816 * script-sections.cc (Output_section_definition::
12817 set_section_addresses): Rename shadowing local load_address to
12820 2009-06-24 Ian Lance Taylor <iant@google.com>
12823 * reloc.cc (relocate_sections): Skip empty relocation sections.
12825 2009-06-23 Ian Lance Taylor <iant@google.com>
12828 * layout.cc (Layout::create_note): Use choose_output_section
12829 rather than make_output_section.
12831 2009-06-23 Ian Lance Taylor <iant@google.com>
12834 * options.cc (General_options::parse_V): Set printed_version_.
12835 (General_options::General_options): Initialize printed_version_.
12836 * options.h (class General_options): Add printed_version_ field.
12837 * gold.cc (queue_initial_tasks): If there are no input files,
12838 don't give a fatal error if we printed the version information.
12839 (queue_middle_tasks): If using -r with a shared object, give a
12840 fatal error rather than an ordinary error.
12842 2009-06-23 Ian Lance Taylor <iant@google.com>
12845 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12846 (Layout::make_output_section): Set have_stabstr_section_ if we see
12847 a .stab*str section.
12848 (Layout::finalize): Call link_stabs_sections.
12849 (Layout::link_stabs_sections): New file.
12850 * layout.h (class Layout): Add have_stabstr_section_ field.
12851 Declare link_stabs_sections.
12853 2009-06-23 Doug Kwan <dougkwan@google.com>
12855 * Makefile.am (libgold_a_LIBADD): New.
12856 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
12857 * Makefile.in: Regenerate.
12858 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12859 * configure: Regenerate.
12860 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12861 * fileread.cc: Include sys/state.h
12862 * gold.h: Declare memmem and strndup if found missing.
12863 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12865 2009-06-23 Ian Lance Taylor <iant@google.com>
12867 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12868 * configure: Rebuild.
12870 2009-06-23 Ian Lance Taylor <iant@google.com>
12873 * object.cc (Object::section_contents): Don't try to get a view if
12874 the section has length zero.
12875 (Object::handle_gnu_warning_section): If the section is empty, use
12876 the name of the section as the warning.
12878 2009-06-23 Ian Lance Taylor <iant@google.com>
12881 * stringpool.h (class Stringpool_template): Add optimize_ field.
12882 (Stringpool_template::set_optimize): New function.
12883 * stringpool.cc (Stringpool_template::Stringpool_template):
12884 Initialize optimize_ field.
12885 (Stringpool_template::set_string_offsets): Test local optimize
12886 fild rather than parameter.
12887 * layout.cc (Layout::Layout): Call set_optimize on the section
12890 2009-06-22 Ian Lance Taylor <iant@google.com>
12893 * yyscript.y: Parse TARGET.
12894 * script.cc (script_set_target): New function.
12895 * script-c.h (script_set_target): Declare.
12896 * options.cc (General_options::string_to_object_format): Rename
12897 from string_to_object_format in anonymous namespace. Change
12899 * options.h (class General_options): Declare
12900 string_to_object_format.
12902 2009-06-22 Ian Lance Taylor <iant@google.com>
12904 * script-sections.cc (Script_sections::create_segments): Don't put
12905 program headers in a PT_LOAD segment if -n or -N.
12907 2009-06-22 Ian Lance Taylor <iant@google.com>
12910 * options.h (class General_options): Add -z lazy and -z now. Sort
12911 -z options into alphabetical order.
12912 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12914 2009-06-21 Ian Lance Taylor <iant@google.com>
12916 * layout.cc (Layout::make_output_section): Call
12917 Target::new_output_section.
12918 (Layout::attach_allocated_section_to_segment): Put large section
12919 sections in a separate load segment with the large segment flag
12921 (Layout::segment_precedes): Sort large data segments after other
12923 (align_file_offset): New static function.
12924 (Layout::set_segment_offsets): Use align_file_offset.
12925 * output.h (class Output_section): Add is_small_section_ and
12926 is_large_section_ fields.
12927 (Output_section::is_small_section): New function.
12928 (Output_section::set_is_small_section): New function.
12929 (Output_section::is_large_section): New function.
12930 (Output_section::set_is_large_section): New function.
12931 (Output_section::is_large_data_section): New function.
12932 (class Output_segment): Add is_large_data_segment_ field.
12933 (Output_segment::is_large_data_segment): New function.
12934 (Output_segment::set_is_large_data_segment): New function.
12935 * output.cc (Output_section::Output_section): Initialize new
12937 (Output_segment::Output_segment): Likewise.
12938 (Output_segment::add_output_section): Add assertion that large
12939 data sections always go in large data segments. Force small data
12940 sections to the end of the list of data sections. Force small BSS
12941 sections to the start of the list of BSS sections. For large BSS
12942 sections to the end of the list of BSS sections.
12943 * symtab.h (class Symbol): Declare is_common_shndx.
12944 (Symbol::is_defined): Check Symbol::is_common_shndx.
12945 (Symbol::is_common): Likewise.
12946 (class Symbol_table): Define enum Commons_section_type. Update
12947 declarations. Add small_commons_ and large_commons_ fields.
12948 * symtab.cc (Symbol::is_common_shndx): New function.
12949 (Symbol_table::Symbol_table): Initialize new fields.
12950 (Symbol_table::add_from_object): Put small and large common
12951 symbols in the right list.
12952 (Symbol_table::sized_finalized_symbol): Check
12953 Symbol::is_common_shndx.
12954 (Symbol_table::sized_write_globals): Likewise.
12955 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12956 common symbol lists. Don't call do_allocate_commons_list if the
12958 (Symbol_table::do_allocate_commons_list): Remove is_tls
12959 parameter. Add comons_section_type parameter. Change all
12960 callers. Handle small and large common symbols.
12961 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12962 Symbol::is_common_shndx.
12963 * resolve.cc (symbol_to_bits): Likewise.
12964 * target.h (Target::small_common_shndx): New function.
12965 (Target::small_common_section_flags): New function.
12966 (Target::large_common_shndx): New function.
12967 (Target::large_common_section_flags): New function.
12968 (Target::new_output_section): New function.
12969 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12970 small_common_section_flags, and large_common_section_flags
12972 (Target::do_new_output_section): New virtual function.
12973 * arm.cc (Target_arm::arm_info): Initialize new fields.
12974 * i386.cc (Target_i386::i386_info): Likewise.
12975 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12977 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12978 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12979 (Target_x86_64::do_new_output_section): New function.
12980 * configure.ac: Define conditional MCMODEL_MEDIUM.
12981 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12982 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12983 (large_LDFLAGS): Define.
12984 * testsuite/large.c: New file.
12985 * testsuite/testfile.cc (Target_test::test_target_info):
12986 Initialize new fields.
12987 * configure, testsuite/Makefile.in: Rebuild.
12989 2009-06-05 Doug Kwan <dougkwan@google.com>
12991 * Makefile.am (CCFILES): Add target.cc.
12992 * Makefile.in: Regenerate.
12993 * i386.cc (class Target_i386): Define new virtual method to
12994 override do_is_local_label_name in parent.
12995 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12996 local symbols if --discard-locals or -X is given.
12997 * options.h (class General_options): Declare new options
12998 '--discard-locals' and '-X' for discarding locals.
12999 * target.h (class Target): Define new methods is_local_label_name.
13000 Declare new virtual method do_is_local_label_name.
13001 * target.cc: New file.
13002 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13003 (check_SCRIPTS): Add discard_locals_test.sh.
13004 (check_DATA): Add discard_local_tests.syms.
13005 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13006 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13007 * testsuite/Makefile.in: Regenerate.
13008 * testsuite/discard_locals_test.c: New file.
13009 * testsuite/discard_locals_test.sh: Same.
13011 2009-06-05 Doug Kwan <dougkwan@google.com>
13013 * object.cc (Sized_relobj::Sized_relobj): Initialize
13014 discarded_eh_frame_shndx_ to -1U.
13015 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13017 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13018 a discarded .eh_frame section.
13019 (Sized_relobj::do_finalize_local_symbols): Ditto.
13020 * object.h (class Sized_relobj): Declare new member
13021 discarded_eh_frame_shndx_.
13022 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13023 (local_labels_test.o, local_labels_test): New rules.
13024 * testsuite/Makefile.in: Regenerate.
13026 2009-06-04 Doug Kwan <dougkwan@google.com>
13028 * layout.cc (Layout::section_name_mapping): Add mapping for
13029 special ARM sections.
13031 2009-06-03 Doug Kwan <dougkwan@google.com>
13033 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13034 (utils::has_overflow): Same.
13036 2009-06-03 Ian Lance Taylor <iant@google.com>
13038 * layout.cc (Layout::section_name_mapping): New array, replacing
13039 Layout::linkonce_mapping.
13040 (Layout::section_name_mapping_count): New variable, replacing
13041 Layout::linkonce_mapping_count.
13042 (Layout::linkonce_output_name): Remove.
13043 (Layout::output_section_name): Rewrite.
13044 * layout.h (class Layout): Rename Linkonce_mapping to
13045 Section_name_mapping, linkonce_mapping to section_name_mapping,
13046 linkonce_mapping_count to section_name_mapping_count. Don't
13047 declare linkonce_output_name.
13049 2009-06-03 Doug Kwan <dougkwan@google.com>
13051 * gold/arm.cc (namespace utils): New.
13052 (Target_arm::reloc_is_non_pic): Define new method.
13053 (class Arm_relocate_functions): New.
13054 (Target_arm::Relocate::relocate): Handle relocation types used by
13057 2009-06-03 Ian Lance Taylor <iant@google.com>
13059 * arm.cc (Target_arm::scan::global): Use || instead of |.
13061 2009-06-02 Doug Kwan <dougkwan@google.com>
13063 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13064 issued_non_pic_error_.
13065 (class Target_arm::Scan): Declare new method check_non_pic.
13066 Define new method symbol_needs_plt_entry.
13067 Declare new data member issued_non_pic_error_.
13068 (class Target_arm::Relocate): Declare new method
13069 should_apply_static_reloc.
13070 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13071 (Target_arm::Scan::check_non_pic): Define new method.
13072 (Target_arm::Scan::local): Handle a small subset of reloc types used
13074 (Target_arm::Scan::local): Same.
13075 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13077 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13079 * incremental.cc (Incremental_inputs::report_command_line): Filter
13080 out --incremental-* options.
13082 2009-05-29 Doug Kwan <dougkwan@google.com>
13084 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13086 (class Target_arm): Update comment.
13087 (Target_arm::Target_arm): Initialize new data members GOT_,
13088 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13089 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13090 and Target_arm::rel_dyn_section.
13091 Declare new_enum Target_arm::Got_type.
13092 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13094 Update commments for member do_dynsym_value.
13095 (Target_arm::got_size, Target_arm::plt_section,
13096 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13097 new methods inside class defintion.
13098 (Target_arm::got_section): Define new method.
13099 (Target_arm::rel_dyn_section): Same.
13100 (Output_data_plt_arm): New template class.
13101 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13102 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13103 (Output_data_plt_arm::add_entry): Same.
13104 (Output_data_plt_arm::first_plt_entry): Define new
13105 static data member for PLT instruction template.
13106 (Output_data_plt_arm::plt_entry): Same.
13107 (Output_data_plt_arm::do_write): Define new method.
13108 (Target_arm::make_plt_entry): Same.
13109 (Target_arm::do_finalize_sections): Same.
13110 (Target_arm::do_dynsym_value): Same.
13112 2009-05-28 Doug Kwan <dougkwan@google.com>
13114 * Makefile.am (TARGETSOURCES): Add arm.cc.
13115 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13116 * Makefile.in: Regenerate.
13117 * arm.cc: New file.
13118 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13120 2009-05-26 Doug Kwan <dougkwan@google.com>
13122 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13123 (General_options::check_excluded_libs): Strip off directories in
13124 archive name before matching like GNU ld does.
13125 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13126 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13127 (exclude_libs_test_LDFLAGS): Add linker option
13128 -Wl,--exclude-libs,libexclude_libs_test_3
13129 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13130 an explicit archive without using -l.
13131 (alt/libexclude_libs_test_3.a): New make rule.
13132 * testsuite/Makefile.in: Regenerate.
13133 * testsuite/exclude_libs_test.c : Declare lib3_default().
13135 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13136 * exclude_libs_test_3.c: New file.
13138 2009-05-26 Nick Clifton <nickc@redhat.com>
13140 * po/id.po: New Indonesian translation.
13141 * po/gold.pot: Updated template file.
13143 2009-05-22 Sriraman Tallam <tmsriram@google.com>
13145 * testsuite/Makefile.am: Add -ffunction-sections to compile
13146 gc_comdat_test files. Add -Wl,--gc-sections to build
13148 * testsuite/Makefile.in: Regenerate.
13149 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13151 2009-05-21 Sriraman Tallam <tmsriram@google.com>
13153 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13154 kept comdat section was garbage collected.
13155 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13156 * testsuite/Makefile.in: Regenerate.
13157 * testsuite/gc_comdat_test.sh: New file.
13158 * testsuite/gc_comdat_test_1.cc: New file.
13159 * testsuite/gc_comdat_test_2.cc: New file.
13161 2009-05-19 Doug Kwan <dougkwan@google.com>
13163 * archive.cc (Archive::Archive): Move constructor from archive.h
13164 to here. Initialize no_export_.
13165 (Archive::get_elf_object_for_member): Set no_export flag of object.
13166 * archive.h (Archive::Archive): Move constructor body to
13168 (Archive::no_export): New method.
13169 (Archive::no_export_): New field.
13170 * object.h (Object::Object): Initialize no_export_ to false.
13171 (Object::no_export, Object::set_no_export): New methods.
13172 (Object::no_export_): New field.
13173 * options.cc (General_options::parse_exclude_libs): New method.
13174 (General_options::check_excluded_libs) Same.
13175 * options.h (exclude_libs): New option.
13176 (General_options::check_excluded_libs): New method declaration.
13177 (General_options::excluded_libs_): New field.
13178 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13179 default or protected visibility if an object has no-export flag set.
13180 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13181 (check_SCRIPTS): Add exclude_libs_test.sh.
13182 (check_DATA): Add exclude_libs_test.syms.
13183 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13184 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13185 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13186 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13187 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13188 libexclude_libs_test_2.a): New rules.
13189 * testsuite/Makefile.in: Regenerate.
13190 * testsuite/exclude_libs_test.c: New file.
13191 * testsuite/exclude_libs_test.sh: Ditto.
13192 * testsuite/exclude_libs_test_1.c: Ditto.
13193 * testsuite/exclude_libs_test_2.c: Ditto.
13195 2009-05-15 Ian Lance Taylor <iant@google.com>
13197 * configure.ac: Check for declarations for cases where libiberty.h
13198 checks HAVE_DECL_xxx.
13199 * configure, config.in: Rebuild.
13201 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13203 * gold.h (Incremental_argument_list): Remove (invalid) forward
13205 * incremental.cc (Incremental_inputs::report_achive): New method.
13206 (Incremental_inputs::report_object): New method.
13207 (Incremental_inputs::report_script): New method.
13208 (Incremental_inputs::finalize_inputs): New method.
13209 (Incremental_inputs::finalize): Call finalize_inputs().
13210 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13211 Create inputs entries.
13212 * incremental.h (Incremental_input_type): New enum.
13213 (Incremental_inputs::Incremental_input): Initialize new fields.
13214 (Incremental_inputs::report_inputs): New method.
13215 (Incremental_inputs::report_achive): New method.
13216 (Incremental_inputs::report_object): New method.
13217 (Incremental_inputs::report_script): New method.
13218 (Incremental_inputs::finalize_inputs): New method.
13219 (Incremental_inputs::Input_info): New struct.
13220 (Incremental_inputs::Input_info_map): New typedef.
13221 (Incremental_inputs::lock_): New field.
13222 (Incremental_inputs::Inputs_): New field.
13223 (Incremental_inputs::Inputs_map): New field.
13224 * main.cc (main): Call Incremental_input::report_inputs.
13225 * options.h (Input_argument_list): Typedef moved from
13227 (Input_file_group::Files): Remove, use ::Input_argument_list.
13228 (Input_file_group::Input_argument_list): Remove, use
13229 ::Input_argument_list.
13230 * plugin.cc (Plugin_manager::add_input_file): Add error in
13232 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13234 * script.cc (read_input_script): Call
13235 Incremental_input::report_script.
13236 * script.h (Script_info): New class.
13238 2009-04-27 Ian Lance Taylor <iant@google.com>
13240 * x86_64.cc (do_adjust_output_section): Set entsize to
13243 2009-04-23 Elliott Hughes <enh@google.com>
13245 * output.cc (Output_file::close): After short writes, continue
13246 writing from the correct offset in the buffer being written.
13248 2009-04-23 Chris Demetriou <cgd@google.com>
13250 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13251 * configure: Regenerate.
13252 * config.in: Regenerate.
13253 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13254 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13256 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13258 * incremental.cc (Incremental_inputs_header_data): Renamed from
13259 Incremental_input_header_data.
13260 (Incremental_inputs_header_data::data_size): New field.
13261 (Incremental_inputs_header_data::put_input_file_count): Renamed
13262 from input_file_count.
13263 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13264 from command_line_offset.
13265 (Incremental_inputs_header_data::put_reserved): Renamed from
13267 (Incremental_inputs_entry_data): Renamed from
13268 Incremental_input_entry_data.
13269 (Incremental_inputs_entry_data::data_size): New field.
13270 (Incremental_inputs::report_command_line): New method.
13271 (Incremental_inputs::finalize): New method.
13272 (Incremental_inputs::create_incremental_inputs_data): New method.
13273 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13274 * incremental.h: New file.
13275 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
13276 (Layout::finalize): Create incremental inputs section in
13277 incremental builds.
13278 (Layout::create_incremental_info_sections): New method.
13279 * layout.h (Layout::incremental_inputs): New method.
13280 (Layout::create_incremental_info_sections): New method.
13281 (Layout::incremental_inputs_): New field.
13282 * main.cc (main): Notify Incremental_input of the command line.
13284 2009-04-01 Ian Lance Taylor <iant@google.com>
13285 Mikolaj Zalewski <mikolajz@google.com>
13287 * gold.h (reserve_unordered_map): Define, three versions, one for
13288 each version of Unordered_map.
13289 * layout.cc (Layout::Layout): Remove options parameter. Add
13290 number_of_input_files parameter. Don't initialize options_.
13291 Initialize number_of_input_files_ and resized_signatures_. Move
13292 sections_are_attached_.
13293 (Layout::layout_group): Reserve space for group_signatures_.
13294 (Layout::find_or_add_kept_section): Change name parameter to be a
13295 reference. Resize signatures_ map when it gets large enough.
13296 (Layout::layout_eh_frame): Use parameters->options() instead of
13298 (Layout::make_output_section): Likewise.
13299 (Layout::attach_allocated_section_to_segment): Likewise.
13300 (Layout::finalize, Layout::create_executable_stack): Likewise.
13301 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13302 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13303 * layout.h (class Layout): Update declarations. Remove options_
13304 field. Add number_of_input_files_ and resized_signatures_
13305 fields. Move sections_are_attached_ field.
13306 * main.cc (main): Pass number of input files to Layout
13307 constructor. Don't pass options.
13309 2009-03-30 Ian Lance Taylor <iant@google.com>
13311 * ffsll.c (ffsll): Correct implementation.
13313 2009-03-27 Ian Lance Taylor <iant@google.com>
13315 * ffsll.c: New file.
13316 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13317 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13318 * ftruncate.c (ftruncate): Declare before definition.
13319 * mremap.c (mremap): Likewise.
13320 * pread.c (pread): Likewise.
13321 * configure, Makefile.in, config.in: Rebuild.
13323 * mremap.c: New file.
13324 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13325 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13326 (mremap): Declare if HAVE_MREMAP is not defined.
13327 * configure, Makefile.in, config.in: Rebuild.
13329 2009-03-27 Cary Coutant <ccoutant@google.com>
13331 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13332 position independent.
13333 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13334 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13336 2009-03-24 Cary Coutant <ccoutant@google.com>
13338 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13340 (needs_dynamic_reloc): Likewise.
13342 2009-03-24 Ian Lance Taylor <iant@google.com>
13344 * yyscript.y (file_cmd): Recognize EXTERN.
13345 (extern_name_list, extern_name_list_body): New nonterminals.
13346 * script.cc (script_add_extern): Define.
13347 * script-c.h (script_add_extern): Declare.
13349 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
13351 * object.cc (is_elf_object): Define.
13352 * object.h (is_elf_object): Declare.
13353 * archive.cc (Archive::get_elf_object_for_member): Call
13355 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
13357 2009-03-24 Elliott Hughes <enh@google.com>
13359 * output.cc (Output_file::map_anonymous): Define.
13360 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13361 try an anonymous one. Report the size if the mmap fails.
13362 * output.h (class Output_file): Declare map_anonymous.
13364 2009-03-24 Ian Lance Taylor <iant@google.com>
13366 * target-select.cc (instantiate_target): Don't acquire the lock if
13367 the instantiated_target_ field has already been set.
13369 2009-03-23 Ian Lance Taylor <iant@google.com>
13371 * gold-threads.h (class Initialize_lock): Define.
13372 * gold-threads.cc (class Initialize_lock_once): Define.
13373 (initialize_lock_control): New static variable.
13374 (initialize_lock_pointer): New static variable.
13375 (initialize_lock_once): New static function.
13376 (Initialize_lock::Initialize_lock): Define.
13377 (Initialize_lock::initialize): Define.
13378 * target-select.h: Include "gold-threads.h".
13379 (class Target_selector): Add lock_ and initialize_lock_ fields.
13380 Don't define instantiate_target, just declare it.
13381 * target-select.cc (Target_selector::Target_selector): Initialize
13383 (Target_selector::instantiate_target): Define.
13384 * descriptors.h: Include "gold-threads.h".
13385 (class Descriptors): Add initialize_lock_ field.
13386 * descriptors.cc (Descriptors::Descriptors): Initialize new
13388 (Descriptors::open): Use initialize_lock_ field
13389 * errors.h (class Errors): Add initialize_lock_ field.
13390 * errors.cc (Errors::Errors): Initialize new field.
13391 (Errors::initialize_lock): Use initialize_lock_ field.
13392 * powerpc.cc (class Target_selector_powerpc): Remove
13393 instantiated_target_ field. In do_recognize call
13394 instantiate_target rather than do_instantiate_target. In
13395 do_instantiate_target just allocate a new target.
13396 * sparc.cc (class Target_selector_sparc): Likewise.
13398 * freebsd.h: New file.
13399 * i386.cc: Include "freebsd.h".
13400 (Target_i386): Derive from Target_freebsd rather than
13402 (Target_selector_i386): Derive from Target_selector_freebsd rather
13403 than Target_selector.
13404 * x86_64.cc: Include "freebsd.h".
13405 (Target_x86_64): Derive from Target_freebsd rather than
13407 (Target_selector_x86_64): Derive from Target_selector_freebsd
13408 rather than Target_selector.
13409 * target.h (class Target): Add adjust_elf_header and
13410 do_adjust_elf_header.
13411 * output.cc (Output_file_header:: do_sized_write): Call target
13412 adjust_elf_header routine.
13413 * configure.tgt: Set targ_osabi.
13414 * configure.ac: Define GOLD_DEFAULT_OSABI.
13415 * parameters.cc (Parameters::default_target): Pass
13416 GOLD_DEFAULT_OSABI to select_target.
13417 * target-select.h (class Target_selector): Make instantiate_target
13418 protected rather than private.
13419 * Makefile.am (HFILES): Add freebsd.h.
13420 * configure, Makefile.in, config.in: Rebuild.
13422 * merge.cc (do_add_input_section): Correct pend value. Change
13423 message about last entry not being null terminated from error to
13426 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13428 * incremental.cc: New file.
13429 * Makefile.am (CCFILES): Add incremental.cc.
13430 * Makefile.in: Rebuild.
13432 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13434 * layout.cc (Layout::output_section_name): Preserve names
13435 of '.note.' sections.
13437 2009-03-19 Ian Lance Taylor <iant@google.com>
13439 * descriptors.cc (Descriptors::open): Check that the options are
13440 valid before using them.
13442 2009-03-18 Ian Lance Taylor <iant@google.com>
13444 * script-sections.h: Include <list>.
13445 (class Script_sections): Change Sections_elements from std::vector
13446 to std::list. Typedef public Elements_iterator. Add
13447 orphan_section_placement_, data_segment_align_start_, and
13448 saw_data_segment_align_ fields. Remove data_segment_align_index_
13450 * script-sections.cc (class Orphan_section_placement): New class.
13451 (class Sections_element): Add virtual functions is_relro and
13452 orphan_section_init. Remove virtual function place_orphan_here.
13453 (class Output_section_definition): Add is_relro and
13454 orphan_section_init. Remove place_orphan_here.
13455 (class Orphan_output_section): Likewise.
13456 (Script_sections::Script_sections): Update for field changes.
13457 (Script_sections::data_segment_align): Set saw_data_segment_align_
13458 and data_segment_align_start_, not data_segment_align_index.
13459 (Script_sections::data_segment_relro_end): Check
13460 saw_data_segment_align_. Use data_segment_align_start_ rather
13461 than data_segment_align_index_.
13462 (Script_sections::place_orphan): Rewrite to use
13463 Orphan_section_placement.
13465 2009-03-17 Ian Lance Taylor <iant@google.com>
13467 * archive.cc (Archive::add_symbols): Check for a version attached
13468 to the symbol name in the archive map.
13469 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13470 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13471 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13472 (ver_test_11.a): New target.
13473 * testsuite/Makefile.in: Rebuild.
13475 * configure.ac: Check for chsize and posix_fallocate. Replace
13477 * ftruncate.c: New file, from gnulib.
13478 * output.cc (posix_fallocate): Define dummy version if not
13479 HAVE_POSIX_FALLOCATE.
13480 (Output_file::map): Call posix_fallocate rather than lseek and
13482 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13483 * configure, Makefile.in, config.in: Rebuild.
13485 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
13487 * layout.h (Layout::create_note): Add section_name parameter.
13488 * layout.cc (Layout::create_note): Likewise.
13489 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
13491 2009-03-17 Ian Lance Taylor <iant@google.com>
13493 * descriptors.cc: Include "options.h".
13494 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13495 (Descriptors::open): Always use O_CLOEXEC when opening a new
13496 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13497 then set FD_CLOEXEC.
13499 * sparc.cc (class Target_sparc): Add has_got_section.
13500 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13501 make sure we have a GOT section.
13503 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13504 (Target_sparc::Scan::local): Likewise.
13505 (Target_sparc::Scan::global): Likewise.
13506 (Target_sparc::Relocate::relocate): Likewise.
13507 (Target_sparc::Relocate::relocate_tls): Likewise.
13509 * symtab.cc (Symbol_table::define_default_version): New function,
13510 broken out of add_from_object.
13511 (Symbol_table::add_from_object): Call define_default_version.
13512 (Symbol_table::define_special_symbol): Add resolve_oldsym
13513 parameter. Change all callers. If the version for a symbol comes
13514 from a version script, resolve it with the symbol with the same
13515 name with no version. Also add the symbol without a version if
13517 (do_define_in_output_data): If resolving with oldsym, don't delete
13519 (do_define_in_output_segment): Likewise.
13520 (do_define_as_constant): Likewise.
13521 * symtab.h (class Symbol_table): Update declarations.
13523 2009-03-13 Ian Lance Taylor <iant@google.com>
13525 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13526 (Read_symbols::requeue): New function.
13527 (Read_symbols::do_read_symbols): If make_elf_object fails because
13528 the target type is not configured, and the file was searched for,
13529 issue a warning and retry with the next directory.
13530 (Add_symbols::run): If the file has an incompatible format, and
13531 it was searched for, requeue the Read_symbols task. On error,
13532 release the object.
13533 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13534 dirindex parameter to constructor. Change all callers. Declare
13535 incompatible_warning and requeue.
13536 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13537 input_argument_ and input_group_ fields. Add them to
13538 constructor. Change all callers.
13539 (class Read_script): Add dirindex_ field. Add it to constructor.
13540 Change all callers.
13541 * archive.cc (Archive::setup): Remove input_objects parameter.
13542 Change all callers.
13543 (Archive::get_file_and_offset): Likewise.
13544 (Archive::read_all_symbols): Likewise.
13545 (Archive::read_symbols): Likewise.
13546 (Archive::get_elf_object_for_member): Remove input_objects
13547 parameter. Add punconfigured parameter. Change all callers.
13548 (Archive::add_symbols): Change return type to bool. Check return
13549 value of include_member.
13550 (Archive::include_all_members): Likewise.
13551 (Archive::include_member): Change return type to bool. Return
13552 false if first included object has incompatible target. Set
13553 included_member_ field.
13554 (Add_archive_symbols::run): If add_symbols returns false, requeue
13556 * archive.h (class Archive): Add included_member_ field.
13557 Initialize it in constructor. Add input_file and searched_for
13558 methods. Update declarations.
13559 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13560 input_argument_ fields. Add them to constructor. Change all
13562 * script.cc: Include "target-select.h".
13563 (class Parser_closure): Add skip_on_incompatible_target_ and
13564 found_incompatible_target_ fields. Add
13565 skip_on_incompatible_target parameter to constructor. Change all
13566 callers. Add methods skip_on_incompatible_target,
13567 clear_skip_on_incompatible_target, found_incompatible_target, and
13568 set_found_incompatible_target.
13569 (read_input_script): Add dirindex parameter. Change all callers.
13570 If parser finds an incompatible target, requeue Read_symbols
13572 (script_set_symbol): Clear skip_on_incompatible_target in
13574 (script_add_assertion, script_parse_option): Likewise.
13575 (script_start_sections, script_add_phdr): Likewise.
13576 (script_check_output_format): New function.
13577 * script.h (read_input_script): Update declaration.
13578 * script-c.h (script_check_output_format): Declare.
13579 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13580 (ignore_cmd): Remove OUTPUT_FORMAT.
13581 * fileread.cc (Input_file::Input_file): Add explicit this.
13582 (Input_file::will_search_for): New function.
13583 (Input_file::open): Add pindex parameter. Change all callers.
13584 * fileread.h (class Input_file): Add input_file_argument method.
13585 Declare will_search_for. Update declarations.
13586 * object.cc (make_elf_object): Add punconfigured parameter.
13587 Change all callers.
13588 * object.h (class Object): Make input_file public. Add
13589 searched_for method.
13590 (make_elf_object): Update declaration.
13591 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13593 * dirsearch.h (class Dirsearch): Update declaration.
13594 * options.h (class General_options): Add --warn-search-mismatch.
13595 * parameters.cc (Parameters::is_compatible_target): New function.
13596 * parameters.h (class Parameters): Declare is_compatible_target.
13597 * workqueue.cc (Workqueue::add_blocker): New function.
13598 * workqueue.h (class Workqueue): Declare add_blocker.
13600 * fileread.cc (Input_file::open): Remove options parameter.
13601 Change all callers.
13602 (Input_file::open_binary): Likewise.
13603 * script.cc (read_input_script): Likewise.
13604 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13605 options parameter from constructor. Change all callers.
13606 (class Read_script): Likewise.
13607 * fileread.h (class Input_file): Update declarations.
13608 * script.h (read_input_script): Update declaration.
13610 2009-03-10 Nick Clifton <nickc@redhat.com>
13612 * po/es.po: New Spanish translation.
13614 2009-03-06 Cary Coutant <ccoutant@google.com>
13616 * options.cc (parse_short_option): Keep dash_z from registering itself.
13618 2009-03-03 Ian Lance Taylor <iant@google.com>
13621 * target-reloc.h (relocate_section): Pass output_section to
13623 * i386.cc (Target_i386::should_apply_static_reloc): Add
13624 output_section parameter. Change all callers.
13625 (Target_i386::Relocate::relocate): Add output_section parameter.
13626 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13627 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13628 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13629 * testsuite/two_file_shared.sh: New script.
13630 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13631 (check_DATA): Add two_file_shared.dbg.
13632 (two_file_shared.dbg): New target.
13633 * testsuite/Makefile.in: Rebuild.
13635 2009-03-01 Ian Lance Taylor <iant@google.com>
13637 * configure.ac: Check for byteswap.h.
13638 * configure: Rebuild.
13639 * config.in: Rebuild.
13641 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13643 * layout.cc (Layout::find_or_add_kept_section): New function.
13644 (Layout::add_comdat): Removed.
13645 * layout.h (struct Kept_section): Move out of class Layout.
13646 Remove trailing underscores from field names. Add group_sections
13647 field. Rename group_ field to is_group. Change all uses.
13648 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13649 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13650 comdat_groups_ field.
13651 (Sized_relobj::include_section_group): Use
13652 find_or_add_kept_section and Kept_section::group_sections.
13653 (Sized_relobj::include_linkonce_section): Likewise.
13654 * object.cc (class Sized_relobj): Don't define Comdat_group or
13655 Comdat_group_table. Remove find_comdat_group and
13656 add_comdat_group. Remove comdat_groups_ field.
13657 * plugin.cc (include_comdat_group): Use
13658 Layout::find_or_add_kept_section.
13660 2009-02-28 Ian Lance Taylor <iant@google.com>
13662 * README: --gc-sections and map files are now supported. Document
13663 some build requirements.
13666 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13667 relocatable link set the value of the section symbol to zero.
13668 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13669 relocatable link don't include the section address in the local
13672 2009-02-27 Ian Lance Taylor <iant@google.com>
13675 * options.h (class Search_directory): Add is_system_directory.
13676 (class General_options): Declare is_in_system_directory.
13677 * options.cc (get_relative_sysroot): Make static.
13678 (get_default_sysroot): Make static.
13679 (General_optoins::is_in_system_directory): New function.
13680 * fileread.cc (Input_file::is_in_system_directory): New function.
13681 * fileread.h (class Input_file): Declare is_in_system_directory.
13682 * object.h (class Object): Add is_in_system_directory.
13683 (class Input_objects): Remove system_library_directory_ field.
13684 * object.cc (Input_objects::add_object): Don't set
13685 system_library_directory_.
13686 (input_objects::found_in_system_library_directory): Remove.
13687 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13688 parameter. Change all callers.
13689 (Symbol_table::sized_write_globals): Likewise.
13690 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13691 Call Object::is_in_system_directory.
13692 * symtab.h (class Symbol_table): Update declarations.
13695 * descriptors.h (Open_descriptor): Add is_on_stack field.
13696 * descriptors.cc (Descriptors::open): If the descriptor is on the
13697 top of the stack, remove it. Initialize is_on_stack field.
13698 (Descriptors::release): Only add pod to stack if it is not on the
13700 (Descriptors::close_some_descriptor): Clear stack_next and
13701 is_on_stack fields.
13704 * output.cc (Output_section::find_starting_output_address): Rename
13705 from starting_output_address; add PADDR parameter; change return
13707 * output.h (class Output_section): Declare
13708 find_starting_output_address instead of starting_output_address.
13709 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13710 section symbol for which we can't find a merge section.
13713 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13714 hidden or internal, force the symbol to be local.
13715 * resolve.cc (Symbol::override_visibility): Define.
13716 (Symbol::override_base): Use override_visibility.
13717 (Symbol_table::resolve): Likewise.
13718 (Symbol::override_base_with_special): Likewise.
13719 (Symbol_table::override_with_special): If the visibility is hidden
13720 or internal, force the symbol to be local.
13721 * symtab.h (class Symbol): Add set_visibility and
13722 override_visibility.
13723 * testsuite/ver_test_1.sh: New file.
13724 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13725 (check_DATA): Add ver_test_1.syms.
13726 (ver_test_1.syms): New target.
13727 * testsuite/Makefile.in: Rebuild.
13729 2009-02-25 Cary Coutant <ccoutant@google.com>
13731 * layout.cc (Layout::choose_output_section): Don't rename sections
13732 when using a linker script that has a SECTIONS clause.
13733 * Makefile.in: Regenerate.
13735 * testsuite/Makefile.am (script_test_5.sh): New test case.
13736 * testsuite/Makefile.in: Regenerate.
13737 * testsuite/script_test_5.cc: New file.
13738 * testsuite/script_test_5.sh: New file.
13739 * testsuite/script_test_5.t: New file.
13741 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
13743 * archive.cc (Archive::include_member): Update calls to add_symbols.
13744 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13745 the Layout argument.
13746 * dynobj.h (do_add_symbols): Add the Layout argument.
13747 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13749 * object.h (Object::add_symbols): Add the Layout argument.
13750 (Object::do_add_symbols): Add the Layout argument.
13751 (Sized_relobj::do_add_symbols): Add the Layout argument.
13752 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13753 Unify the two versions.
13754 (Add_plugin_symbols): Remove.
13755 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13756 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13757 (Add_plugin_symbols): Remove.
13758 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13759 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13760 (Add_symbols::run): Make it work with Pulginobj.
13762 2009-02-06 Ian Lance Taylor <iant@google.com>
13764 * object.cc (Sized_relobj::do_layout): Make info message start
13765 with lower case letter.
13767 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13769 * binary.cc: Fix file comment.
13771 * options.h (enum Incremental_disposition): Define.
13772 (class General_options): Add new options: --incremental,
13773 --incremental_changed, --incremental_unchanged,
13774 --incremental_unknown. Add incremental_disposition_ and
13775 implicit_incremental_ fields.
13776 (General_options::incremental_disposition): New function.
13777 (class Position_dependent_options): Add incremental_disposition
13779 (Position_dependent_options::copy_from_options): Set incremental
13781 * options.cc (General_options::parse_incremental_changed): New
13783 (General_options::parse_incremental_unchanged): New function.
13784 (General_options::parse_incremental_unknown): New function.
13785 (General_options::General_options): Initialize new fields
13786 incremental_disposition_ and implicit_incremental_.
13787 (General_options::finalize): Check for uasge of --incremental-*
13788 without --incremental.
13790 2009-02-06 Chris Demetriou <cgd@google.com>
13792 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13793 pointer and to report location as the file name associated with
13795 (gold_undefined_symbol_at_location): New function to replace the
13796 old gold_undefined_symbol functionality.
13797 * target-reloc.h (relocate_section): Update to use
13798 gold_undefined_symbol_at_location.
13799 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13800 Call gold_undefined_symbol function rather than gold_error.
13801 * errors.h (Errors::undefined_symbol): Take location as a
13802 string, rather than calculating it from a relocation.
13803 * errors.cc (Errors::fatal): Print "fatal error:" before the
13805 (Errors::error, Errors::error_at_location): Print "error: "
13806 before the formatted message.
13807 (Errors::undefined_symbol): Take location as a string, rather
13808 than calculating it from a relocation.
13809 (gold_undefined_symbol_at_location): New function akin to
13810 old gold_undefined_symbol, calculates location from relocation.
13811 (gold_undefined_symbol): Change to take only a Symbol pointer
13812 and to report location as the file name associated with the symbol.
13813 * testsuite/debug_msg.sh: Update for changed error messages.
13814 * testsuite/undef_symbol.sh: Likewise.
13816 2009-02-04 Duncan Sands <baldrick@free.fr>
13819 * reduced_debug_output.h
13820 (Output_reduced_debug_abbrev_section::failed): Use format for
13822 (Output_reduced_debug_info_section::faild): Likewise.
13824 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13826 * script.cc (Lazy_demangler): New class.
13827 (Version_script_info::get_symbol_version_helper): Demangle a
13830 2009-01-29 Cary Coutant <ccoutant@google.com>
13832 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13834 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13836 2009-01-28 Ian Lance Taylor <iant@google.com>
13838 * version.cc (version_string): Bump to 1.9.
13840 * gold.h: Include <cstring> and <stdint.h>.
13841 * version.cc: Include <cstdio>.
13842 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13844 * reduced_debug_output.cc (insert_into_vector): Rename from
13845 Insert_into_vector; change all callers. Use Swap_unaligned to
13846 avoid aliasing issue; remove union since it is unnecessary.
13848 2009-01-27 Sriraman Tallam <tmsriram@google.com>
13850 * Makefile.am (CCFILES): Add gc.cc.
13851 (HFILES): Add gc.h.
13852 * Makefile.in: Regenerate.
13853 * gold.cc (Gc_runner): New class.
13854 (queue_initial_tasks): Call garbage collection related tasks
13855 when corresponding options are invoked.
13856 (queue_middle_gc_tasks): New function.
13857 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13858 processed early before laying out sections during garbage collection.
13859 * gold.h (queue_middle_gc_tasks): New function.
13860 (is_prefix_of): Move from "layout.cc".
13861 * i386.cc (Target_i386::gc_process_relocs): New function.
13862 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13863 * main.cc (main): Create object of class "Garbage_collection".
13864 * object.cc (Relobj::copy_symbols_data): New function.
13865 (Relobj::is_section_name_included): New function.
13866 (Sized_relobj::do_layout): Allow this function to be called twice
13867 during garbage collection and defer layout of section during the
13869 * object.h (Relobj::get_symbols_data): New function.
13870 (Relobj::is_section_name_included): New function.
13871 (Relobj::copy_symbols_data): New function.
13872 (Relobj::set_symbols_data): New function.
13873 (Relobj::get_relocs_data): New function.
13874 (Relobj::set_relocs_data): New function.
13875 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13876 (Relobj::gc_process_relocs): New function.
13877 (Relobj::do_gc_process_relocs): New pure virtual function.
13878 (Relobj::sd_): New data member.
13879 (Sized_relobj::is_output_section_offset_invalid): New function.
13880 (Sized_relobj::do_gc_process_relocs): New function.
13881 * options.h (General_options::gc_sections): Modify to not be a no-op.
13882 (General_options::print_gc_sections): New option.
13883 * plugin.cc (Plugin_finish::run): Remove function call to
13884 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13885 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13886 * reloc.cc (Read_relocs::run): Add task to process relocs and
13887 determine unreferenced sections when doing garbage collection.
13888 (Gc_process_relocs): New class.
13889 (Sized_relobj::do_gc_process_relocs): New function.
13890 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13891 sections that are garbage collected.
13892 * reloc.h (Gc_process_relocs): New class.
13893 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13894 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13895 symbols whose corresponding sections are garbage collected.
13896 (Symbol_table::Symbol_table): Add new parameter for the garbage
13898 (Symbol_table::gc_mark_undef_symbols): New function.
13899 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13900 (Symbol_table::gc_mark_dyn_syms): New function.
13901 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13903 (Symbol_table::add_from_object): Likewise.
13904 (Symbol_table::add_from_relobj): When building shared objects, do not
13905 treat externally visible symbols as garbage.
13906 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13907 table information for static and relocatable links.
13908 * symtab.h (Symbol_table::set_gc): New function.
13909 (Symbol_table::gc): New function.
13910 (Symbol_table::gc_mark_undef_symbols): New function.
13911 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13912 (Symbol_table::gc_mark_dyn_syms): New function.
13913 (Symbol_table::gc_): New data member.
13914 * target.h (Sized_target::gc_process_relocs): New pure virtual
13916 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13917 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13919 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13921 * options.h (General_options::gc_sections): Define as a no-op for now.
13922 (General_options::no_keep_memory): Ditto.
13923 (General_options::Bshareable): Define.
13924 * options.cc (General_options::finalize): Honor -Bshareable.
13926 2009-01-20 Andreas Schwab <schwab@suse.de>
13928 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13929 read the value in the contents, since we don't use it. Use the
13930 template endianness when writing.
13931 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13933 2009-01-19 Andreas Schwab <schwab@suse.de>
13935 * configure.tgt (powerpc64-*): Fix targ_obj.
13937 2009-01-15 Ian Lance Taylor <iant@google.com>
13939 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13940 local symbols when stripping all symbols.
13942 2009-01-14 Cary Coutant <ccoutant@google.com>
13944 * output.cc (Output_reloc): Add explicit instantiations.
13946 2009-01-14 Cary Coutant <ccoutant@google.com>
13948 * archive.cc (Archive::get_elf_object_for_member): Remove call
13949 to File_read::claim_for_plugin.
13950 * descriptors.cc (Descriptors::open): Remove reference to
13952 (Descriptors::claim_for_plugin): Remove.
13953 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13954 (Descriptors::is_claimed): Remove.
13955 (claim_descriptor_for_plugin): Remove.
13956 * fileread.cc (File_read::claim_for_plugin): Remove.
13957 * fileread.h (File_read::claim_for_plugin): Remove.
13958 (File_read::descriptor): Reopen descriptor if necessary.
13959 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13960 (Plugin_manager::all_symbols_read): Add task parameter. Change
13962 (Plugin_manager::get_input_file): New function.
13963 (Plugin_manager::release_input_file): New function.
13964 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13965 corresponding data member.
13966 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13967 and pass to base constructor. Change all callers.
13968 (get_input_file, release_input_file): New functions.
13969 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13970 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13971 (Plugin_manager::all_symbols_read): Add task parameter.
13972 (Plugin_manager::get_input_file): New function.
13973 (Plugin_manager::release_input_file): New function.
13974 (Plugin_manager::task_): New data member.
13975 (Pluginobj::Pluginobj): Add filesize parameter.
13976 (Pluginobj::filename): New function.
13977 (Pluginobj::descriptor): New function.
13978 (Pluginobj::filesize): New function.
13979 (Pluginobj::filesize_): New data member.
13980 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13981 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13982 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13984 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13985 with archive libraries.
13986 * testsuite/Makefile.in: Regenerate.
13987 * testsuite/plugin_test.c (struct sym_info): New type.
13988 (get_input_file, release_input_file): New static variables.
13989 (onload): Capture new transfer vector entries.
13990 (claim_file_hook): Stop reading at end of file according to filesize.
13991 Factor out parsing of readelf output into separate function.
13992 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13993 APIs and get the source file name from the symbol table. Convert
13994 source file name to corresponding object file name. Print info
13995 message when adding new input files.
13996 (parse_readelf_line): New function.
13997 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13998 * testsuite/plugin_test_2.sh: Likewise.
13999 * testsuite/plugin_test_3.sh: Likewise.
14000 * testsuite/plugin_test_4.sh: New test case.
14002 2009-01-07 Ian Lance Taylor <iant@google.com>
14004 * version.cc (version_string): Bump to 1.8.
14006 2008-12-23 Cary Coutant <ccoutant@google.com>
14008 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14009 * plugin.cc (Plugin_manager::finish): Rename as
14010 layout_deferred_objects. Move cleanup to separate function.
14011 (Plugin_manager::cleanup): New function.
14012 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14014 * plugin.h (Plugin_manager::finish): Rename as
14015 layout_deferred_objects.
14016 (Plugin_manager::cleanup): New function.
14017 (Plugin_manager::cleanup_done): New field.
14019 2008-12-23 Cary Coutant <ccoutant@google.com>
14021 * plugin.cc (is_visible_from_outside): New function.
14022 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14023 so we don't return "IR only" status for exported symbols or -r links.
14025 * testsuite/Makefile.am (plugin_test_3): New test case.
14026 * testsuite/Makefile.in: Regenerate.
14027 * testsuite/plugin_test_3.sh: New file.
14029 2008-12-22 Cary Coutant <ccoutant@google.com>
14031 * object.cc (Sized_relobj::layout_section): New function.
14032 (Sized_relobj::do_layout): Defer layout of input sections until after
14033 plugin has provided replacement files.
14034 (Sized_relobj::do_layout_deferred_sections): New function.
14035 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14036 (Relobj::layout_deferred_sections): New function.
14037 (Relobj::do_layout_deferred_sections): New function.
14038 (Sized_relobj::do_layout_deferred_sections): New function.
14039 (Sized_relobj::layout_section): New function.
14040 (Sized_relobj::Deferred_layout): New structure.
14041 (Sized_relobj::deferred_layout_): New field.
14042 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14043 Change all callers. Layout deferred sections.
14044 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14046 (Plugin_hook::run): Move code from do_plugin_hook inline.
14047 (Plugin_hook::do_plugin_hook): Remove.
14048 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14049 (Plugin_manager::finish): Renamed, was cleanup.
14050 (Plugin_manager::should_defer_layout): New function.
14051 (Plugin_manager::add_deferred_layout_object): New function.
14052 (Plugin_manager::Deferred_layout_list): New type.
14053 (Plugin_manager::deferred_layout_objects_): New field.
14054 (Plugin_hook::do_plugin_hook): Remove.
14056 2008-12-17 Ian Lance Taylor <iant@google.com>
14058 * options.h (class General_options): Add --no case for
14061 2008-12-16 Cary Coutant <ccoutant@google.com>
14063 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14065 (Plugin_manager::claim_file): Create plugin object even if
14066 plugin did not call the add_symbols callback.
14067 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14068 asking for more symbols than were added.
14069 * testsuite/Makefile.am (plugin_test_1): Add test case with
14071 (empty.syms): New target.
14072 * testsuite/Makefile.in: Regenerate.
14073 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14074 message. Don't call add_symbols if no globals.
14075 (all_symbols_read_hook): Don't provide replacement for empty
14078 2008-12-12 Ian Lance Taylor <iant@google.com>
14080 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14081 r_type == 0 for a local symbol with r_sym == 0.
14082 (scan_relocatable_relocs): Pass r_sym to
14083 local_non_section_strategy.
14084 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14087 * configure.ac: Update test for TLS descriptors: they are
14088 supported as of glibc 2.9.
14089 * configure: Rebuild.
14091 2008-12-11 Ian Lance Taylor <iant@google.com>
14094 * target-reloc.h (Default_scan_relocatable_relocs): For each
14095 function, map r_type == 0 to RELOC_DISCARD.
14097 2008-12-10 Cary Coutant <ccoutant@google.com>
14099 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14100 object to override a kept COMDAT group from a plugin object.
14102 2008-12-09 Ian Lance Taylor <iant@google.com>
14105 * yyscript.y (file_cmd): Handle INPUT.
14107 * testsuite/initpri1.c: Change all declarations to be full
14108 prototypes by adding void, to avoid compiler warnings.
14110 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
14112 * options.cc (General_options::parse_plugin_opt): New.
14113 (General_options::add_plugin): The argument now is just the filename.
14114 (General_options::add_plugin_option): New.
14115 * options.h (plugin_opt): New.
14116 (add_plugin): Change argument name.
14117 (add_plugin_option): New.
14118 * plugin.cc (Plugin::load): Don't parse the plugin option.
14119 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14120 (Plugin::add_option): New.
14121 (Plugin::args_): Change type.
14122 (Plugin::filename_): New.
14123 (Plugin_manager::add_plugin_option): New.
14124 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14125 * testsuite/Makefile.in: Regenerate.
14127 2008-12-05 Cary Coutant <ccoutant@google.com>
14129 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14130 Handle --strip-lto-sections option.
14131 * options.h (strip_lto_sections): New option.
14133 2008-12-01 Cary Coutant <ccoutant@google.com>
14135 * plugin.cc (ld_plugin_message): Change format parameter to const.
14136 Fix mismatch between new[] and delete.
14138 2008-11-14 Cary Coutant <ccoutant@google.com>
14140 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14143 2008-11-05 Craig Silverstein <csilvers@google.com>
14145 * options.cc (General_options::parse_dynamic_list): New function.
14146 * options.h (General_options): New flags dynamic_list,
14147 dynamic_list_data, dynamic_list_cpp_new, and
14148 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14149 (General_options::in_dynamic_list): New function.
14150 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14151 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14152 (Lex::can_continue_name): Likewise.
14154 (read_script_file): New parameter script_options.
14155 (read_dynamic_list): New function.
14156 (Script_options::define_dynamic_list): New function.
14157 (dynamic_list_keyword_parsecodes): New variable.
14158 (dynamic_list_keywords): New variable.
14159 * script.h (Script_options::define_dynamic_list): New function
14161 (read_dynamic_list): New function prototype.
14162 * symtab.cc (strprefix): New macro.
14163 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14164 dynamic_list_data, dynamic_list_cpp_new, and
14165 dynamic_list_cpp_typeinfo.
14166 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14167 (dynamic_list_expr): New rule.
14168 (dynamic_list_nodes): Likewise.
14169 (dynamic_list_node): Likewise.
14170 * testsuite/Makefile.am (dynamic_list): New test.
14171 * testsuite/Makefile.in: Regenerated.
14172 * testsuite/dynamic_list.t: New file.
14173 * testsuite/dynamic_list.sh: New file.
14175 2008-11-05 Craig Silverstein <csilvers@google.com>
14177 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14178 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14179 (t11_last): Likewise.
14180 * testsuite/ver_test_6.c (main): Likewise.
14182 2008-10-07 Cary Coutant <ccoutant@google.com>
14184 * options.c (General_options::finalize): Add check for -static and
14186 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14189 2008-10-02 Cary Coutant <ccoutant@google.com>
14191 * plugin.cc (make_sized_plugin_object): Fix conditional
14192 compilation to work when not all targets are enabled.
14194 2008-09-29 Cary Coutant <ccoutant@google.com>
14196 * archive.cc (Archive::get_file_and_offset): Use filename instead
14197 of name to get library path.
14198 (Archive::include_member): Unlock external member of a thin archive.
14200 * testsuite/Makefile.am (TEST_AR): New variable.
14201 (thin_archive_test_1): New test.
14202 (thin_archive_test_2): New test.
14203 * testsuite/Makefile.in: Regenerate.
14204 * testsuite/thin_archive_main.cc: New file.
14205 * testsuite/thin_archive_test_1.cc: New file.
14206 * testsuite/thin_archive_test_2.cc: New file.
14207 * testsuite/thin_archive_test_3.cc: New file.
14208 * testsuite/thin_archive_test_4.cc: New file.
14210 2008-09-29 Cary Coutant <ccoutant@google.com>
14212 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14213 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14215 (Sized_relobj::do_finalize_local_symbols): Likewise.
14216 (Sized_relobj::map_to_kept_section): Likewise.
14217 * object.h (Sized_relobj::invalid_address): New constant.
14218 (Sized_relobj::do_output_section_offset): Check for invalid_address
14220 * output.cc (Output_reloc::local_section_offset): Use constant
14221 invalid_address instead of -1U.
14222 (Output_reloc::get_address): Likewise.
14223 (Output_section::output_address): Change -1U to -1ULL.
14224 * output.h (Output_reloc::invalid_address): New constant.
14225 * reloc.cc (Sized_relobj::write_sections): Use constant
14226 invalid_address instead of -1U.
14227 (Sized_relobj::relocate_sections): Likewise.
14228 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14229 values for merge sections.
14230 * target-reloc.h (relocate_for_relocatable): Use constant
14231 invalid_address instead of -1U.
14233 2008-09-19 Cary Coutant <ccoutant@google.com>
14235 Add plugin functionality for link-time optimization (LTO).
14236 * configure.ac (plugins): Add --enable-plugins option.
14237 * configure: Regenerate.
14238 * config.in: Regenerate.
14239 * Makefile.am (LIBDL): New variable.
14240 (CCFILES): Add plugin.cc.
14241 (HFILES): Add plugin.h.
14242 (ldadd_var): Add LIBDL.
14243 * Makefile.in: Regenerate.
14245 * archive.cc: Include "plugin.h".
14246 (Archive::setup): Don't preread archive symbols when using a plugin.
14247 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14248 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14250 (Archive::include_member): Add symbols from plugin objects.
14251 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14252 * descriptors.cc (Descriptors::open): Check for file descriptors
14253 abandoned by plugins.
14254 (Descriptors::claim_for_plugin): New function.
14255 * descriptors.h (Descriptors::claim_for_plugin): New function.
14256 (Open_descriptor::is_claimed): New field.
14257 (claim_descriptor_for_plugin): New function.
14258 * fileread.cc (File_read::claim_for_plugin): New function.
14259 * fileread.h (File_read::claim_for_plugin): New function.
14260 (File_read::descriptor): New function.
14261 * gold.cc: Include "plugin.h".
14262 (queue_initial_tasks): Add task to call plugin hooks for generating
14264 * main.cc: Include "plugin.h".
14265 (main): Load plugin libraries.
14266 * object.h (Pluginobj): Declare.
14267 (Object::pluginobj): New function.
14268 (Object::do_pluginobj): New function.
14269 (Object::set_target): New function.
14270 * options.cc: Include "plugin.h".
14271 (General_options::parse_plugin): New function.
14272 (General_options::General_options): Initialize plugins_ field.
14273 (General_options::add_plugin): New function.
14274 * options.h (Plugin_manager): Declare.
14275 (General_options): Add --plugin option.
14276 (General_options::has_plugins): New function.
14277 (General_options::plugins): New function.
14278 (General_options::add_plugin): New function.
14279 (General_options::plugins_): New field.
14280 * plugin.cc: New file.
14281 * plugin.h: New file.
14282 * readsyms.cc: Include "plugin.h".
14283 (Read_symbols::do_read_symbols): Check for archive before checking
14284 for ELF file. Call plugin hooks to claim files.
14285 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14286 from a real object file; force override when processing replacement
14288 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14289 (Symbol::init_base_object): Likewise.
14290 (Symbol::init_base_output_data): Likewise.
14291 (Symbol::init_base_output_segment): Likewise.
14292 (Symbol::init_base_constant): Likewise.
14293 (Symbol::init_base_undefined): Likewise.
14294 (Symbol::output_section): Assert that object is not a plugin.
14295 (Symbol_table::add_from_pluginobj): New function.
14296 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14298 (Symbol_table::sized_write_globals): Likewise.
14299 (Symbol_table::add_from_pluginobj): Instantiate template.
14300 * symtab.h (Sized_pluginobj): Declare.
14301 (Symbol::in_real_elf): New function.
14302 (Symbol::set_in_real_elf): New function.
14303 (Symbol::in_real_elf_): New field.
14304 (Symbol_table::add_from_pluginobj): New function.
14306 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14307 (LIBDL): New variable.
14308 (LDADD): Add LIBDL.
14309 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14310 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14311 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14312 (MOSTLYCLEANFILES): Likewise.
14313 * testsuite/Makefile.in: Regenerate.
14314 * testsuite/plugin_test.c: New file.
14315 * testsuite/plugin_test_1.sh: New file.
14316 * testsuite/plugin_test_2.sh: New file.
14318 2008-09-16 Ian Lance Taylor <iant@google.com>
14320 * target-reloc.h (relocate_section): Check whether a symbol is
14321 defined by the ABI before reporting an undefined symbol error.
14322 * target.h (Target::is_defined_by_abi): Make parameter const.
14323 (Target::do_is_defined_by_abi): Likewise.
14324 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14325 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14326 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14327 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14328 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14329 * testsuite/Makefile.in: Rebuild.
14331 * fileread.cc (make_view): Add casts to avoid warning.
14333 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
14335 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14336 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14338 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
14340 * options.h (General_options::output_is_executable): New.
14341 (General_options::output_is_pie): New.
14342 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14343 for shared libraries.
14344 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14346 2008-09-11 Chris Demetriou <cgd@google.com>
14348 * options.h (origin): New -z option.
14349 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14350 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14353 2008-09-05 Cary Coutant <ccoutant@google.com>
14355 * fileread.cc (File_read::make_view): Add check for attempt to map
14356 beyond end of file.
14358 2008-09-05 Cary Coutant <ccoutant@google.com>
14360 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14361 explicit instantiations.
14363 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14366 * options.cc (General_options::finalize): Allow undefined symbols
14367 in shlibs if linking -shared.
14370 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14371 symbols as not needing a dynsym entry.
14373 2008-08-20 Craig Silverstein <csilvers@google.com>
14375 * fileread.cc (File_read::open): Do not lock the file unless it
14376 was successfully opened.
14378 2008-08-14 Cary Coutant <ccoutant@google.com>
14380 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14381 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14382 * testsuite/tls_test.cc (struct int128): 128-bit struct
14383 for testing TLS relocs with non-zero addend.
14384 (v12): New TLS variable.
14386 (t_last): Add check for v12.
14387 * testsuite/tls_test.h (t12): New function.
14388 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14390 2008-08-13 Ian Lance Taylor <iant@google.com>
14392 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14393 set tls_segment_ or relro_segment_.
14394 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14396 * output.h (Output_section::clear_is_relro): New function.
14397 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14398 sections specially even when output_data_ is empty.
14399 (Output_segment::maximum_alignment): When first section is relro,
14400 only force alignment for PT_LOAD segments.
14401 * script.cc (script_data_segment_align): New function.
14402 (script_data_segment_relro_end): New function.
14403 * script-c.h (script_data_segment_align): Declare.
14404 (script_data_segment_relro_end): Declare.
14405 * script-sections.h (class Script_sections): Declare
14406 data_segment_align and data_segment_relro_end. Add fields
14407 segment_align_index_ and saw_relro_end_.
14408 * script-sections.cc (class Sections_element): Add set_is_relro
14409 virtual function. Add new bool* parameter to place_orphan_here.
14410 Add get_output_section virtual function.
14411 (class Output_section_definition): Add set_is_relro. Add new
14412 bool* parameter to place_orphan_here. Add get_output_section.
14413 Add is_relro_ field.
14414 (Output_section_definition::Output_section_definition): Initialize
14415 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14416 and is_relro_ fields.
14417 (Output_section_definition::place_orphan_here): Add is_relro
14419 (Output_section_definition::set_section_addresses): Set relro for
14421 (Output_section_definition::alternate_constraint): Likewise.
14422 (class Orphan_output_section): Add new bool* parameter to
14423 place_orphan_here. Add get_output_section.
14424 (Orphan_output_section::place_orphan_here): Add is_relro
14426 (Script_sections::Script_sections): Initialize
14427 data_segment_align_index_ and saw_relro_end_.
14428 (Script_sections::data_segment_align): New function.
14429 (Script_sections::data_segment_relro_end): New function.
14430 (Script_sections::place_orphan): Set or clear is_relro.
14431 (Script_sections::set_section_addresses): Force alignment of first
14433 * yyscript.y (exp): Call script_data_segment_align and
14434 script_data_segment_relro_end.
14435 * testsuite/relro_script_test.t: New file.
14436 * testsuite/relro_test.cc (using_script): Declare.
14437 (t1, t2): Test using_script.
14438 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14439 (relro_script_test_SOURCES): Define.
14440 (relro_script_test_DEPENDENCIES): Define.
14441 (relro_script_test_LDFLAGS): Define.
14442 (relro_script_test_LDADD): Define.
14443 (relro_script_test.so): New target.
14444 * testsuite/Makefile.in: Rebuild.
14446 2008-08-06 Cary Coutant <ccoutant@google.com>
14448 * archive.cc (Archive::total_archives, Archive::total_members)
14449 (Archive::total_members_loaded): New variables.
14450 (Archive::setup): Add parameter. Add option to preread
14452 (Archive::read_armap): Add counter.
14453 (Archive::get_file_and_offset): New function.
14454 (Archive::get_elf_object_for_member): New function.
14455 (Archive::read_all_symbols): New function.
14456 (Archive::read_symbols): New function.
14457 (Archive::add_symbols): Add counters.
14458 (Archive::include_all_members): Use armap to find members if it's
14460 (Archive::include_member): Skip reading symbols if already read.
14461 Factored code into Archive::get_file_and_offset and
14462 Archive::get_elf_object_for_member. Changed call to
14463 Mapfile::report_include_archive_member.
14464 (Archive::print_stats): New function.
14465 * archive.h: Declare Object and Read_symbols_data classes.
14466 (Archive::Archive): Add initializers for new members.
14467 (Archive::setup): Add parameter.
14468 (Archive::print_stats): New function.
14469 (Archive::total_archives, Archive::total_members)
14470 (Archive::total_members_loaded): New variables.
14471 (Archive::get_file_and_offset): New function.
14472 (Archive::get_elf_object_for_member): New function.
14473 (Archive::read_all_symbols): New function.
14474 (Archive::read_symbols): New function.
14475 (Archive::Archive_member): New class.
14476 (Archive::members_): New member.
14477 (Archive::num_members_): New member.
14478 * main.cc: Include archive.h.
14479 (main): Call Archive::print_stats.
14480 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14481 archive parameter; member_name is now the fully-decorated name.
14482 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14483 * options.h: (General_options): Add --preread-archive-symbols option.
14484 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14487 2008-08-04 Ian Lance Taylor <iant@google.com>
14489 * symtab.h (Symbol::use_plt_offset): New function.
14490 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14491 * powerpc.cc (Relocate::relocate): Likewise.
14492 * sparc.cc (Relocate::relocate): Likewise.
14493 * x86_64.cc (Relocate::relocate): Likewise.
14494 * testsuite/weak_plt.sh: New test.
14495 * testsuite/weak_plt_main.cc: New test.
14496 * testsuite/weak_plt_shared.cc: New test.
14497 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14498 (check_PROGRAMS): Add weak_plt.
14499 (check_DATA): Add weak_plt_shared.so.
14500 (weak_plt_main_pic.o, weak_plt): New targets.
14501 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14502 * testsuite/Makefile.in: Rebuild.
14504 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14506 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14507 * testsuite/Makefile.in: Rebuild.
14509 2008-08-04 Alan Modra <amodra@bigpond.net.au>
14511 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14512 * Makefile.in: Regenerate.
14513 * po/POTFILES.in: Regenerate.
14515 2008-07-29 Ian Lance Taylor <iant@google.com>
14517 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14518 symbols before other symbols.
14519 * testsuite/script_test_2.cc (test_addr): Declare.
14520 (test_addr_alias): Declare.
14521 (main): Check that test_addr and test_addr_alias have the right
14523 * testsuite/script_test_2.t: Define test_addr_alias and
14526 2008-07-24 Ian Lance Taylor <iant@google.com>
14529 * descriptors.cc: New file.
14530 * descriptors.h: New file.
14531 * gold-threads.h (class Hold_optional_lock): New class.
14532 * fileread.cc: Include "descriptors.h".
14533 (File_read::~File_read): Release descriptor rather than closing
14535 (File_read::open) [file]: Call open_descriptor rather than open.
14536 Set is_descriptor_opened_.
14537 (File_read::open) [memory]: Assert that descriptor is not open.
14538 (File_read::reopen_descriptor): New function.
14539 (File_read::release): Release descriptor.
14540 (File_read::do_read): Make non-const. Reopen descriptor.
14541 (File_read::read): Make non-const.
14542 (File_read::make_view): Reopen descriptor.
14543 (File_read::do_readv): Likewise.
14544 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14545 Update declarations.
14546 * layout.cc: Include "descriptors.h".
14547 (Layout::create_build_id): Use open_descriptor rather than open.
14548 * output.cc: Include "descriptors.h".
14549 (Output_file::open): Use open_descriptor rather than open.
14550 * archive.cc (Archive::const_iterator): Change Archive to be
14552 (Archive::begin, Archive::end): Make non-const.
14553 (Archive::count_members): Likewise.
14554 * archive.h (class Archive): Update declarations.
14555 * object.h (Object::read): Make non-const.
14556 * Makefile.am (CCFILES): Add descriptors.cc.
14557 (HFILES): Add descriptors.h.
14558 * Makefile.in: Rebuild.
14561 * gold.h: Always include <clocale>. Add Solaris workarounds
14562 following code in binutils/sysdep.h.
14565 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14566 this->eh_frame_hdr_ is NULL before using it.
14568 * dynobj.cc (Versions::Versions): Update comment.
14570 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14571 the base version name.
14573 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14574 array size plus one.
14575 (Stringpool_template::set_string_offsets): Subtract one from key
14576 before using it as an array index.
14577 (Stringpool_template::get_offset_with_length): Likewise.
14578 (Stringpool_template::write_to_buffer): Likewise.
14579 * stringpool.h (Stringpool_template::get_offset_from_key):
14582 2008-07-23 Ian Lance Taylor <iant@google.com>
14585 * object.h (Merged_symbol_value::value): Do our best to handle a
14589 * script.cc (Version_script_info::get_versions): Don't add empty
14590 version tag to return value.
14591 (Version_script_info::get_symbol_version_helper): Change return
14592 type to bool. Add pversion parameter. Change all callers.
14593 (script_register_vers_node): Don't require a non-NULL tag.
14594 * script.h (class Version_script_info): Update declarations.
14595 (Version_script_info::get_symbol_version): Change return type to
14596 bool. Add version parameter. Change all callers.
14597 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14598 handling. Handle an empty version from a version script.
14599 (Symbol_table::define_special_symbol): Likewise.
14600 * testsuite/ver_test_10.script: New file.
14601 * testsuite/ver_test_10.sh: New file.
14602 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14603 (check_DATA): Add ver_test_10.syms.
14604 (ver_test_10.syms, ver_test_10.so): New target.
14605 * testsuite/Makefile.in: Rebuild.
14607 2008-07-23 Simon Baldwin <simonb@google.com>
14609 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14610 to zero for undefined symbols from dynamic libraries.
14612 2008-07-23 Ian Lance Taylor <iant@google.com>
14614 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14615 Change all callers.
14616 * symtab.h (class Symbol_table): Update declaration.
14617 * testsuite/ver_test_9.cc: New file.
14618 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14619 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14620 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14621 (ver_test_9.so, ver_test_9.o): New targets.
14622 * testsuite/Makefile.in: Rebuild.
14624 2008-07-22 Ian Lance Taylor <iant@google.com>
14626 * options.h (class General_options): Define --check-sections.
14627 * layout.cc (Layout::set_segment_offsets): Handle
14630 * options.h (class General_options): Define -n/--nmagic and
14632 * options.cc (General_options::finalize): For -n/--nmagic or
14633 -N/--omagic, set -static.
14634 * layout.cc (Layout::attach_allocated_section_to_segment): If
14635 -N/--omagic, don't put read-only and read-write sections in
14636 different segments.
14637 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14638 finding a read-only segment.
14639 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14640 don't set the minimum segment alignment to the common page size,
14641 and don't set the file offset to the address modulo the page size.
14642 * script-sections.cc (Script_sections::create_segments): If
14643 -n/--omagic, don't put read-only and read-write sections in
14644 different segments.
14646 * cref.cc: New file.
14647 * cref.h: New file.
14648 * options.h (class General_options): Add --print-symbol-counts.
14649 * main.cc (main): Issue defined symbol report if requested.
14650 * archive.cc (Archive::interpret_header): Make into a const member
14652 (Archive::add_symbols): Call Input_objects::archive_start and
14654 (Archive::const_iterator): Define new class.
14655 (Archive::begin, Archive::end): New functions.
14656 (Archive::include_all_members): Rewrite to use iterator.
14657 (Archive::count_members): New function.
14658 * archive.h (class Archive): Update declarations.
14659 (Archive::filename): New function.
14660 * object.cc: Include "cref.h".
14661 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14662 (Sized_relobj::do_get_global_symbol_counts): New function.
14663 (Input_objects::add_object): Add object to cross-referencer.
14664 (Input_objects::archive_start): New function.
14665 (Input_objects::archive_stop): New function.
14666 (Input_objects::print_symbol_counts): New function.
14667 * object.h: Declare Cref and Archive.
14668 (Object::get_global_symbol_counts): New function.
14669 (Object::do_get_global_symbol_counts): New pure virtual function.
14670 (class Sized_relobj): Add defined_count_ field. Update
14672 (class Input_objects): Add cref_ field. Update constructor.
14673 Update declarations.
14674 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14676 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14678 (Sized_dynobj::do_get_global_symbol_counts): New function.
14679 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14680 defined_count_. Update declarations. Define Symbols typedef.
14681 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14682 parameter. Change all callers.
14683 (Symbol_table::add_from_dynobj): Add sympointers and defined
14684 parameters. Change all callers.
14685 * symtab.h (class Symbol_table): Update declarations.
14686 * Makefile.am (CCFILES): Add cref.cc.
14687 (HFILES): Add cref.h.
14688 * Makefile.in: Rebuild.
14690 2008-07-22 Simon Baldwin <simonb@google.com>
14692 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14693 to zero when writing undefined symbols.
14695 2008-07-22 Ian Lance Taylor <iant@google.com>
14697 * output.cc (Output_section::add_input_section): Don't try to
14698 merge empty merge sections.
14700 2008-07-21 Craig Silverstein <csilvers@google.com>
14702 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14703 Include symbol version in error message.
14705 2008-07-20 Chris Demetriou <cgd@google.com>
14707 * configure.ac (gold_cv_c_random_seed): New configured variable.
14708 (RANDOM_SEED_CFLAGS): New substituted variable.
14709 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14710 * configure: Rebuild.
14711 * Makefile.in: Likewise.
14712 * testsuite/Makefile.in: Likewise.
14714 2008-07-18 Ian Lance Taylor <iant@google.com>
14716 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14717 where we see NAME/NULL and NAME/VERSION as separate symbols.
14718 * testsuite/ver_test_main.cc (main): Call t4.
14719 (t4, t4_2a): Define.
14720 * testsuite/ver_test_2.cc (t4_2): Define.
14721 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14722 * testsuite/ver_test_4.cc (t4_2a): Define.
14723 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14724 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14726 2008-07-17 Ian Lance Taylor <iant@google.com>
14728 * dynobj.cc (Versions::add_def): If we give an error about a
14729 missing version, go ahead and create the version anyhow.
14731 2008-07-10 Ian Lance Taylor <iant@google.com>
14733 Handle output sections with more than 0x7fffffff bytes.
14734 * object.h (class Relobj): Change map_to_output_ to
14735 output_sections_, and just keep a section pointer. Change all
14736 uses. Move comdat group support to Sized_relobj.
14737 (Relobj::is_section_specially_mapped): Remove.
14738 (Relobj::output_section): Remove poff parameter. Change all
14740 (Relobj::output_section_offset): New function.
14741 (Relobj::set_section_offset): Rewrite.
14742 (Relobj::map_to_output): Remove.
14743 (Relobj::output_sections): New function.
14744 (Relobj::do_output_section_offset): New pure virtual function.
14745 (Relobj::do_set_section_offset): Likewise.
14746 (class Sized_relobj): Add section_offsets_ field. Add comdat
14747 group support from Relobj. Update declarations.
14748 (Sized_relobj::get_output_section_offset): New function.
14749 (Sized_relobj::do_output_section_offset): New function.
14750 (Sized_relobj::do_set_section_offset): New function.
14751 * object.cc (Relobj::output_section_address): Remove.
14752 (Sized_relobj::Sized_relobj): Initialize new fields.
14753 (Sized_relobj::include_section_group): Cast find_kept_object to
14755 (Sized_relobj::include_linkonce_section): Likewise.
14756 (Sized_relobj::do_layout): Use separate arrays for output section
14758 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14760 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14761 output_sections and section_offsets.
14762 (Sized_relobj::write_local_symbols): Likewise.
14763 (map_to_kept_section): Compute output address directly.
14764 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14765 output_sections and section_offsets.
14766 (Sized_relobj::write_sections): Likewise.
14767 (Sized_relobj::relocate_sections): Likewise.
14768 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14769 * output.h (class Output_reloc): Update declarations. Change
14770 u2_.relobj to Sized_relobj*.
14771 (class Output_data_reloc): Change add functions to use
14773 * output.cc (Output_reloc::Output_reloc): Change relobj to
14775 (Output_reloc::local_section_offset): Change return type to
14776 Elf_Addr. Use get_output_section_offset.
14777 (Output_reloc::get_address): Likewise.
14778 (Output_section::is_input_address_mapped): Don't call
14779 is_section_specially_mapped.
14780 (Output_section::output_offset): Likewise.
14781 (Output_section::output_address): Likewise.
14782 (Output_section::starting_output_address): Likewise.
14783 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14784 parameter to Sized_relobj*.
14785 (Copy_relocs::need_copy_reloc): Likewise.
14786 (Copy_relocs::save): Likewise.
14787 * copy-relocs.h (class Copy_relocs): Update declarations.
14788 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14789 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14790 * target-reloc.h (relocate_for_relocatable): Change
14791 offset_in_output_section type to Elf_Addr. Change code that uses
14793 * layout.cc (Layout::layout): Always set *off.
14794 * mapfile.cc (Mapfile::print_input_section): Use
14795 output_section_offset.
14796 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14798 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14799 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14800 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14802 2008-07-03 Ian Lance Taylor <iant@google.com>
14804 * layout.cc (Layout::include_section): Do not discard unrecognized
14805 SHT_STRTAB sections.
14807 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14809 * script.cc (Lex::can_continue_name): Make '?' allowable in
14810 version-script names.
14811 * testsuite/version_script.map: Change glob pattern to use '?'
14813 2008-06-30 Manish Singh <yosh@gimp.org>
14816 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14819 2008-06-30 Ian Lance Taylor <iant@google.com>
14823 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14824 versions]: Don't try to read the value in the contents, since we
14825 don't use it. Use the template endianness when writing.
14827 2008-06-25 Cary Coutant <ccoutant@google.com>
14829 * fileread.cc (File_read::make_view): Assert on zero-length view.
14830 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14831 symbol table when there are no symbols to read.
14833 2008-06-23 Craig Silverstein <csilvers@google.com>
14835 * version.cc (version_string): Bump to 1.7
14837 2008-06-18 Craig Silverstein <csilvers@google.com>
14839 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14840 constant 0xFFFF to type Valtype.
14841 (Powerpc_relocate_functions::rel16_ha): Likewise.
14843 2008-06-17 Ian Lance Taylor <iant@google.com>
14845 * output.h (Output_section::Input_section): Initialize p2align_ to
14846 zero for Output_section_data constructors.
14847 (Output_section::Input_section::addralign): If not an input
14848 section, return the alignment of the Output_section_data.
14849 * testsuite/copy_test.cc: New file.
14850 * testsuite/copy_test_1.cc: New file.
14851 * testsuite/copy_test_2.cc: New file.
14852 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14853 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14854 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14855 (copy_test_1_pic.o, copy_test_1.so): New targets.
14856 (copy_test_2_pic.o, copy_test_2.so): New targets.
14857 * testsuite/Makefile.in: Rebuild.
14859 * script-sections.cc (Script_sections::place_orphan): Initialize
14860 local variable exact.
14862 2008-06-13 David Edelsohn <edelsohn@gnu.org>
14864 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14866 2008-06-12 David Edelsohn <edelsohn@gnu.org>
14867 David S. Miller <davem@davemloft.net>
14869 * powerpc.cc: New file.
14870 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14871 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14872 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14873 * Makefile.in: Rebuild.
14875 2008-06-09 Ian Lance Taylor <iant@google.com>
14877 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14879 (throwing, orig_terminate): New static variables.
14880 (terminate_handler): New static function.
14881 (t2): Set terminate handler.
14883 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14886 * binary.cc (Binary_to_elf::sized_convert): Fix .data
14889 2008-05-30 Cary Coutant <ccoutant@google.com>
14891 * archive.cc (Archive::include_all_members) Correct to step
14892 over symbol table and extended name table in thin archives.
14894 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14897 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14900 2008-05-28 Caleb Howe <cshowe@google.com>
14902 * reduced_debug_output.cc: New file.
14903 * reduced_debug_output.h: New file.
14904 * options.h (class General_options): Add --strip-debug-non-line.
14905 * options.cc (General_options::finalize): Add strip_debug_non_line
14906 to the strip heirarchy.
14907 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14909 * layout.cc: Include "reduced_debug_output.h".
14910 (Layout::Layout): Initialize new fields.
14911 (line_only_debug_sections): New static array.
14912 (is_lines_only_debug_sections): New static inline function.
14913 (Layout::include_section): Handle --strip-debug-non-line.
14914 (Layout::make_output_section): If --strip-debug-non-line, build
14915 new output sections for .debug_abbrev and .debug_info.
14916 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14917 gold. Warn about possible overflow.
14918 (read_signed_LEB_128): Likewise.
14919 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14920 (read_signed_LEB_128): Declare.
14921 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14922 (HFILES): Add reduced_debug_output.h.
14923 * Makefile.in: Rebuild.
14925 2008-05-21 Ian Lance Taylor <iant@google.com>
14927 * mapfile.cc: New file.
14928 * mapfile.h: New file.
14929 * options.h (class General_options): Add -M/--print-map and -Map.
14930 * options.cc (General_options::finalize): Make -M equivalent to
14932 * main.cc: Include <cstdio> and "mapfile.h".
14933 (main): Open mapfile if requested.
14934 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14935 constructor. Change caller.
14936 (queue_initial_tasks): Add mapfile parameter. Change caller.
14937 (queue_middle_tasks): Likewise.
14938 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14940 * archive.cc: Include "mapfile.h".
14941 (Archive::add_symbols): Add mapfile parameter. Change all
14942 callers. Pass mapfile, symbol, and reason to include_member.
14943 (Archive::include_all_members): Add mapfile parameter. Change all
14945 (Archive::include_member): Add mapfile, sym, and why parameters.
14946 Change all callers. Report inclusion to map file.
14947 * archive.h: Include "fileread.h".
14948 (class Archive): Update declarations.
14949 (Archive::file): New const method.
14950 (class Add_archive_symbols): Add mapfile_ field. Update
14951 constructor. Change all callers.
14952 * readsyms.h (class Read_symbols): Likewise.
14953 (class Finish_group): Likewise.
14954 (class Read_script): Likewise.
14955 * common.cc: Include "mapfile.h".
14956 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14958 (Symbol_table::do_allocate_commons): Likewise.
14959 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14960 symbol allocation to mapfile.
14961 * common.h (class Allocate_commons_task): Add mapfile_ field.
14962 Update constructor. Change all callers.
14963 * symtab.h (class Symbol_table): Update declarations.
14964 * layout.cc: Include "mapfile.h".
14965 (Layout_task_runner::run): Print information to mapfile.
14966 (Layout::create_gold_note): Change Output_data_fixed_space to
14967 Output_data_zero_fill.
14968 (Layout::create_build_id): Likewise.
14969 (Layout::print_to_mapfile): New function.
14970 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14971 constructor. Change caller.
14972 (class Layout): Declare print_to_mapfile.
14973 * output.cc (Output_section::Input_section::print_to_mapfile): New
14975 (Output_section::add_input_section): If producing a map, always
14976 add to input_sections_ list.
14977 (Output_section::do_print_to_mapfile): New function.
14978 (Output_segment::print_sections_to_mapfile): New function.
14979 (Output_segment::print_section_list_to_mapfile): New function.
14980 * output.h: Include "mapfile.h".
14981 (Output_data::print_to_mapfile): New function.
14982 (Output_data::do_print_to_mapfile): New virtual function.
14983 (Output_segment_headers::do_print_to_mapfile): New function.
14984 (Output_file_header::do_print_to_mapfile): New function.
14985 (Output_data_const::do_print_to_mapfile): New function.
14986 (class Output_data_const_buffer): Add map_name_ field. Update
14987 constructor. Change all callers. Add do_print_to_mapfile
14989 (class Output_data_fixed_space): Likewise.
14990 (class Output_data_space): Likewise.
14991 (class Output_data_zero_fill): New class.
14992 (Output_data_strtab::do_print_to_mapfile): New function.
14993 (Output_data_reloc_base::do_print_to_mapfile): New function.
14994 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14995 (Output_data_group::do_print_to_mapfile): New function.
14996 (Output_data_got::do_print_to_mapfile): New function.
14997 (Output_data_dynamic::do_print_to_mapfile): New function.
14998 (Output_symtab_xindex::do_print_to_mapfile): New function.
14999 (class Output_section): Declare do_print_to_mapflie. Declare
15000 print_to_mapfile in Input_section.
15001 (class Output_segment): Declare new functions.
15002 * object.h (Sized_relobj::symbol_count): New function.
15003 * script-sections.cc
15004 (Output_section_element_dot_assignment::set_section_addresses):
15005 Change Output_data_fixed_space to Output_data_zero_fill.
15006 (Output_data_expression::do_print_to_mapfile): New function.
15007 * script.cc (read_input_script): Add mapfile parameter. Change
15009 * script.h (read_input_script): Update declaration.
15010 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15011 (Eh_frame::do_print_to_mapfile): New function.
15012 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15013 (Output_merge_string::do_print_to_mapfile): New function.
15014 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15016 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15018 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15020 * Makefile.am (CCFILES): Add mapfile.cc.
15021 (HFILES): Add mapfile.h.
15022 * Makefile.in: Rebuild.
15024 2008-05-19 Ian Lance Taylor <iant@google.com>
15026 * options.h (class General_options): Add -z relro.
15027 * layout.cc (Layout::Layout): Initialize relro_segment_.
15028 (Layout::add_output_section_data): Return the output section.
15029 (Layout::make_output_section): Rcognize relro sections and mark
15030 them appropriately.
15031 (Layout::attach_allocated_section_to_segment): Put relro sections
15032 in a PT_GNU_RELRO segment.
15033 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15035 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15037 (Layout::linkonce_mapping): Map d.rel.ro.local to
15038 .data.rel.ro.local.
15039 (Layout::output_section_name): Us .data.rel.ro.local for any
15040 section which begins with that.
15041 * layout.h (class Layout): Update add_output_section_data
15042 declaration. Add relro_segment_ field.
15043 * output.cc (Output_section::Output_section): Initialize is_relro_
15044 and is_relro_local_ fields.
15045 (Output_segment::add_output_section): Group relro sections.
15046 (Output_segment::is_first_section_relro): New function.
15047 (Output_segment::maximum_alignment): If there is a relro section,
15048 align the segment to the common page size.
15049 (Output_segment::set_section_addresses): Track whether we are
15050 looking at relro sections. If the last section is a relro
15051 section, align to the common page size.
15052 (Output_segment::set_section_list_addresses): Add in_relro
15053 parameter. Change all callers. Align to the page size when
15054 moving from relro to non-relro section.
15055 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15057 * output.h (class Output_section): Add is_relro_ and
15058 is_relro_local_ fields.
15059 (Output_section::is_relro): New function.
15060 (Output_section::set_is_relro): New function.
15061 (Output_section::is_relro_local): New function.
15062 (Output_section::set_is_relro_local): New function.
15063 (class Output_segment): Update declarations.
15064 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15065 * sparc.cc (Target_sparc::got_section): Likewise.
15066 * x86_64.cc (Target_x86_64::got_section): Likewise.
15067 * testsuite/relro_test_main.cc: New file.
15068 * testsuite/relro_test.cc: New file.
15069 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15070 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15071 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15072 (relro_test.so, relro_test_pic.o): New targets.
15073 * testsuite/Makefile.in: Rebuild.
15075 2008-05-16 Ian Lance Taylor <iant@google.com>
15077 * output.cc (Output_segment::add_output_section): Remove front
15079 * output.h (class Output_segment): Remove
15080 add_initial_output_section and overloaded add_output_section.
15081 Update declaration of remaining add_output_section.
15082 * layout.cc (Layout::create_interp): Call add_output_section
15083 rather than add_initial_output_section.
15084 (Layout::finish_dynamic_section): Likewise.
15086 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15087 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15088 know the dynamic type.
15089 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15090 field. Initialize it in constructor.
15091 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15092 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15093 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15096 * output.cc (Output_reloc::get_address): Change return type to
15098 * output.h (class Output_reloc): Update get_address declaration.
15099 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15100 for section addresses.
15102 2008-05-09 Ian Lance Taylor <iant@google.com>
15105 * gold.cc (gold_nomem): Use return value of write.
15107 2008-05-08 Ian Lance Taylor <iant@google.com>
15109 * symtab.c (Symbol::init_base_output_data): Add version
15110 parameter. Change all callers.
15111 (Symbol::init_base_output_segment): Likewise.
15112 (Symbol::init_base_constant): Likewise.
15113 (Symbol::init_base_undefined): Likewise.
15114 (Sized_symbol::init_output_data): Likewise.
15115 (Sized_symbol::init_output_segment): Likewise.
15116 (Sized_symbol::init_constant): Likewise.
15117 (Sized_symbol::init_undefined): Likewise.
15118 (Symbol_table::do_define_in_output_data): If the new symbol has a
15119 version, mark it as the default.
15120 (Symbol_table::do_define_in_output_segment): Likewise.
15121 (Symbol_table::do_define_as_constant): Likewise.
15122 * symtab.h (class Symbol): Update declarations.
15123 (class Sized_symbol): Likewise.
15124 * resolve.cc (Symbol::override_version): New function.
15125 (Symbol::override_base): Call override_version.
15126 (Symbol::override_base_with_special): Likewise.
15127 * testsuite/ver_script_8.script: New file.
15128 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15129 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15130 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15131 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15133 2008-05-06 Ian Lance Taylor <iant@google.com>
15136 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15138 (class General_options): Remove existing --undefined, and add
15139 --no-undefined instead. Add new --undefined as synonym for -u.
15140 * archive.cc (Archive::add_symbols): Check whether symbol was
15142 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15143 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15144 all uses. Add IS_UNDEFINED. Update declarations to split
15145 different versions of init_base. Declare init_base_undefined.
15146 (Symbol::is_defined): Handle IS_UNDEFINED.
15147 (Symbol::is_undefined): Likewise.
15148 (Symbol::is_weak_undefined): Call is_undefined.
15149 (Symbol::is_absolute): Handle IS_CONSTANT.
15150 (class Sized_symbol): Update declarations to split different
15151 versions of init. Declare init_undefined.
15152 (class Symbol_table): Declare new functions.
15153 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15154 Change all callers.
15155 (Symbol::init_base_output_data): Likewise.
15156 (Symbol::init_base_output_segment): Likewise.
15157 (Symbol::init_base_constant): Likewise.
15158 (Symbol::init_base_undefined): New function.
15159 (Sized_symbol::init_object): Rename from init. Change all
15161 (Sized_symbol::init_output_data): Likewise.
15162 (Sized_symbol::init_output_segment): Likewise.
15163 (Sized_symbol::init_constant): Likewise.
15164 (Sized_symbol::init_undefined): New function.
15165 (Symbol_table::add_undefined_symbols_from_command_line): New
15167 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15169 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15170 (Symbol::output_section): Likewise.
15171 (Symbol::set_output_section): Likewise.
15172 (Symbol_table::sized_finalize_symbol): Likewise.
15173 (Symbol_table::sized_write_globals): Likewise.
15174 * resolve.cc (Symbol_table::should_override): Likewise.
15175 (Symbol::override_base_with_special): Likewise.
15177 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15178 symbol, change it to have default visibility.
15179 * testsuite/protected_1.cc: New file.
15180 * testsuite/protected_2.cc: New file.
15181 * testsuite/protected_3.cc: New file.
15182 * testsuite/protected_main_1.cc: New file.
15183 * testsuite/protected_main_2.cc: New file.
15184 * testsuite/protected_main_3.cc: New file.
15185 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15186 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15187 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15188 (protected_1.so): New target.
15189 (protected_1_pic.o, protected_2_pic.o): New targets.
15190 (protected_3_pic.o): New target.
15191 (check_PROGRAMS): Add protected_2.
15192 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15193 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15194 * testsuite/Makefile.in: Rebuild.
15196 * options.h (DEFINE_var): Add set_user_set_##varname__.
15197 (DEFINE_bool_alias): New macro.
15198 (class General_options): Define -Bstatic using DEFINE_bool_alias
15199 rather than DEFINE_special. Add --undefined as an alias for -z
15201 * options.cc (General_options::parse_Bstatic): Remove.
15203 * options.h (class General_options): Add --fatal-warnings.
15204 * main.cc (main): Implement --fatal-warnings.
15205 * errors.h (Errors::warning_count): New function.
15207 * options.h (class General_options): Add -Bsymbolic-functions.
15208 * symtab.h (Symbol::is_preemptible): Check for
15209 -Bsymbolic-functions.
15211 2008-05-05 Ian Lance Taylor <iant@google.com>
15213 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15214 as noVARNAME rather than no-VARNAME.
15215 (class General_options): Add option -z combreloc.
15216 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15218 (Output_reloc::sort_before) [SHT_REL]: New function.
15219 (Output_reloc::sort_before) [SHT_RELA]: New function.
15220 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15221 Sort_relocs_comparison.
15222 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15223 parameter. Change all callers.
15224 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15225 sort_relocs parameter. Change all callers.
15226 * output.cc (Output_reloc::get_address): New function, broken out
15228 (Output_reloc::write_rel): Call it.
15229 (Output_reloc::compare): New function.
15230 (Output_data_reloc_base::do_write): Optionally sort relocs.
15232 * configure.ac: If targ_extra_obj is set, link it in.
15233 * configure.tgt: Initialize all variables.
15234 (x86_64*): Set targ_extra_obj and targ_extra_size.
15235 * configure: Rebuild.
15237 * object.cc (Sized_relobj::include_section_group): Adjust section
15238 indexes read from group data. Build vector to pass to
15240 * layout.cc (Layout::layout_group): Add flags and shndxes
15241 parameters. Remove contents parameter. Change caller. Update
15242 explicit instantiations.
15243 * layout.h (class Layout): Update layout_group declaration.
15244 * output.cc (Output_data_group::Output_data_group): Add flags and
15245 input_shndxes parameters. Remove contents parameter. Change
15247 (Output_data_group::do_write): Change input_sections_ to
15249 * output.h (class Output_data_group): Update constructor
15250 declaration. Rename input_sections_ to input_shndxes_.
15251 * testsuite/many_sections_test.cc: Add template.
15253 2008-04-30 Cary Coutant <ccoutant@google.com>
15255 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15257 * layout.cc (Layout::include_section): Refactored check for debug
15259 (Layout::add_comdat): Add new parameters. Change type
15260 of signature parameter. Add object and shndx to signatures table.
15261 (Layout::find_kept_object): New function.
15262 * layout.h: Include <cstring>.
15263 (Layout::is_debug_info_section): New function.
15264 (Layout::add_comdat): Add new parameters.
15265 (Layout::find_kept_object): New function.
15266 (Layout::Kept_section): New struct.
15267 (Layout::Signatures): Change type of map range.
15268 * object.cc (Relobj::output_section_address): New function.
15269 (Sized_relobj::include_section_group): Add new parameters. Change
15270 calls to Layout::add_comdat. Change to build table of kept comdat
15271 groups and table mapping discarded sections to kept sections.
15272 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15273 (Sized_relobj::do_layout): Change calls to include_section_group and
15274 include_linkonce_section.
15275 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15276 value to zero when section is discarded.
15277 (Sized_relobj::map_to_kept_section): New function.
15278 * object.h (Relobj::output_section_address): New function.
15279 (Relobj::Comdat_group): New type.
15280 (Relobj::find_comdat_group): New function.
15281 (Relobj::Comdat_group_table): New type.
15282 (Relobj::Kept_comdat_section): New type.
15283 (Relobj::Kept_comdat_section_table): New type.
15284 (Relobj::add_comdat_group): New function.
15285 (Relobj::set_kept_comdat_section): New function.
15286 (Relobj::get_kept_comdat_section): New function.
15287 (Relobj::comdat_groups_): New field.
15288 (Relobj::kept_comdat_sections_): New field.
15289 (Symbol_value::input_value): Update comment.
15290 (Sized_relobj::map_to_kept_section) New function.
15291 (Sized_relobj::include_linkonce_section): Add new parameter.
15292 * target-reloc.h (Comdat_behavior): New type.
15293 (get_comdat_behavior): New function.
15294 (relocate_section): Add code to map a discarded section to the
15295 corresponding kept section when applying a relocation.
15297 2008-04-30 Craig Silverstein <csilvers@google.com>
15299 * dwarf_reader.cc (next_generation_count): New static var.
15300 (Addr2line_cache_entry): New struct.
15301 (addr2line_cache): New static var.
15302 (Dwarf_line_info::one_addr2line): Added caching.
15303 (Dwarf_line_info::clear_addr2line_cache): New function.
15304 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15305 cache-size parameter.
15306 (Dwarf_line_info::one_addr2line_cache): New function.
15307 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15308 new cache-size argument to one_addr2line(), and clear cache.
15310 2008-04-28 Cary Coutant <ccoutant@google.com>
15312 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15313 R_386_PC8 relocations.
15315 2008-04-23 Ian Lance Taylor <iant@google.com>
15317 * object.cc (Sized_relobj::include_section_group): Check for
15318 invalid section group.
15320 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15323 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15324 than read for file header.
15325 * archive.cc (Archive::include_member): Likewise.
15327 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
15329 * aclocal.m4: Regenerate.
15330 * configure: Regenerate.
15332 2008-04-19 Ian Lance Taylor <iant@google.com>
15334 * version.cc (version_string): Bump to 1.6.
15336 * testsuite/Makefile.am (many_sections_r_test): New target.
15337 (many_sections_r_test_SOURCES): Remove.
15338 (many_sections_r_test_DEPENDENCIES): Remove.
15339 (many_sections_r_test_LDFLAGS): Remove.
15340 (many_sections_r_test_LDADD): Remove.
15342 * object.cc (Sized_relobj::do_add_symbols): Always pass
15343 local_symbol_count_ to add_from_relobj.
15345 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15346 every thousand variables.
15347 * testsuite/Makefile.in: Rebuild.
15349 * object.cc (Xindex::initialize_symtab_xindex): New function.
15350 (Xindex::read_symtab_xindex): New function.
15351 (Xindex::sym_xindex_to_shndx): New function.
15352 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15354 (Sized_relobj::do_initialize_xindex): New function.
15355 (Sized_relobj::do_read_symbols): Adjust section links.
15356 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15357 parameter. Change all callers.
15358 (Sized_relobj::include_section_group): Adjust section links and
15359 symbol section indexes.
15360 (Sized_relobj::do_layout): Adjust section links.
15361 (Sized_relobj::do_count_local_symbols): Adjust section links and
15362 symbol section indexes.
15363 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15364 ordinary and special symbols.
15365 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15366 dynsym_xindex parameters. Change all callers. Adjust section
15367 links. Use SHN_XINDEX when needed.
15368 (Sized_relobj::get_symbol_location_info): Adjust section links.
15369 Don't get fooled by special symbols.
15370 * object.h (class Xindex): Define.
15371 (class Object): Add xindex_ parameter. Declare virtual functoin
15372 do_initialize_xindex.
15373 (Object::adjust_sym_shndx): New function.
15374 (Object::set_xindex): New protected function.
15375 (class Symbol_value): Add is_ordinary_shndx_ field.
15376 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15377 (Symbol_value::value): Assert ordinary section.
15378 (Symbol_value::initialize_input_to_output_map): Likewise.
15379 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15380 Change all callers.
15381 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15383 (class Sized_relobj): Update declarations.
15384 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15385 parameter. Change all callers.
15386 (Sized_relobj::adjust_shndx): New function.
15387 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15389 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15390 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15391 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15392 (Sized_dynobj::read_dynsym_section): Adjust section links.
15393 (Sized_dynobj::read_dynamic): Likewise.
15394 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15396 (Sized_dynobj::do_initialize_xindex): New function.
15397 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15398 do_initialize_xindex.
15399 (Sized_dynobj::adjust_shndx): New function.
15400 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15401 dynsym_xindex_ fields.
15402 (Layout::finalize): Add a call to set_section_indexes before
15403 creating the symtab sections.
15404 (Layout::set_section_indexes): Don't do anything if the section
15405 already has a section index.
15406 (Layout::create_symtab_sections): Add shnum parameter. Change
15407 caller. Create .symtab_shndx section if needed.
15408 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15410 (Layout::allocated_output_section_count): New function.
15411 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15413 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15414 fields. Update declarations.
15415 (Layout::symtab_xindex): New function.
15416 (Layout::dynsym_xindex): New function.
15417 (class Write_symbols_task): Add layout_ field.
15418 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15420 * output.cc (Output_section_headers::Output_section_headers): Add
15421 shstrtab_section parameter. Change all callers.
15422 (Output_section_headers::do_sized_write): Store overflow values
15423 for section count and section string table section index in
15424 section header zero.
15425 (Output_file_header::do_sized_write): Check for overflow of
15426 section count and section string table section index.
15427 (Output_symtab_xindex::do_write): New function.
15428 (Output_symtab_xindex::endian_do_write): New function.
15429 * output.h (class Output_section_headers): Add shstrtab_section_.
15430 Update declarations.
15431 (class Output_symtab_xindex): Define.
15432 (Output_section::has_out_shndx): New function.
15433 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15435 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15436 Change all callers.
15437 (Sized_symbol::init): Likewise.
15438 (Symbol::output_section): Check for ordinary symbol.
15439 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15440 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15442 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15443 Change all callers. Simplify handling of symbols from sections
15444 not included in the link.
15445 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15447 (Weak_alias_sorter::operator()): Assert that symbols are
15449 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15451 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15452 parameters. Change all callers.
15453 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15454 symbol distinction. Use SHN_XINDEX when needed.
15455 (Symbol_table::write_section_symbol): Add symtab_xindex
15456 parameter. Change all callers.
15457 (Symbol_table::sized_write_section_symbol): Likewise. Use
15458 SHN_XINDEX when needed.
15459 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15461 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15462 (Symbol::is_defined): Check is_ordinary.
15463 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15464 (Symbol::is_absolute, Symbol::is_common): Likewise.
15465 (class Sized_symbol): Update declarations.
15466 (class Symbol_table): Update declarations.
15467 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15468 parameters. Change all callers.
15469 (Sized_symbol::override): Likewise.
15470 (Symbol_table::override): Likewise.
15471 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15472 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15473 is_ordinary, and orig_st_shndx parameters. Change all callers.
15474 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15475 to be in an ordinary section.
15476 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15477 object and is_ordinary parameters. Change all callers.
15478 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15479 Change all callers. Don't add undefined or non-ordinary symbols
15481 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15482 Change all callers.
15483 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15485 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15486 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15487 (Sized_relobj::relocate_sections): Likewise.
15488 * target-reloc.h (scan_relocs): Adjust section symbol index.
15489 (scan_relocatable_relocs): Likewise.
15490 * i386.cc (Scan::local): Check for ordinary symbols.
15491 * sparc.cc (Scan::local): Likewise.
15492 * x86_64.cc (Scan::local): Likewise.
15493 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15494 to symbol_section_and_value.
15495 * testsuite/many_sections_test.cc: New file.
15496 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15497 (check_PROGRAMS): Add many_sections_test.
15498 (many_sections_test_SOURCES): Define.
15499 (many_sections_test_DEPENDENCIES): Define.
15500 (many_sections_test_LDFLAGS): Define.
15501 (BUILT_SOURCES): Add many_sections_define.h.
15502 (many_sections_define.h): New target.
15503 (BUILT_SOURCES): Add many_sections_check.h.
15504 (many_sections_check.h): New target.
15505 (check_PROGRAMS): Add many_sections_r_test.
15506 (many_sections_r_test_SOURCES): Define.
15507 (many_sections_r_test_DEPENDENCIES): Define.
15508 (many_sections_r_test_LDFLAGS): Define.
15509 (many_sections_r_test_LDADD): Define.
15510 (many_sections_r_test.o): New target.
15511 * testsuite/Makefile.in: Rebuild.
15513 2008-04-17 Cary Coutant <ccoutant@google.com>
15515 * errors.cc (Errors::info): New function.
15516 (gold_info): New function.
15517 * errors.h (Errors::info): New function.
15518 * gold.h (gold_info): New function.
15519 * object.cc (Input_objects::add_object): Print trace output.
15520 * options.cc (options::parse_set): New function.
15521 (General_options::parse_wrap): Deleted.
15522 (General_options::General_options): Deleted initializer.
15523 * options.h (options::String_set): New typedef.
15524 (options::parse_set): New function.
15525 (DEFINE_set): New macro.
15526 (General_options::wrap): Changed to use DEFINE_set. Changed
15527 callers of any_wrap_symbols and is_wrap_symbol.
15528 (General_options::trace, General_options::trace_symbol):
15530 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15531 (General_options::wrap_symbols_): Deleted.
15532 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15534 2008-04-17 David S. Miller <davem@davemloft.net>
15536 * options.cc (General_options::parse_V): New function.
15537 * options.h: Add entries for -V and -Qy.
15539 2008-04-17 Ian Lance Taylor <iant@google.com>
15541 * common.cc (Symbol_table::allocate_commons): Remove options
15542 parameter. Change caller.
15543 (Symbol_table::do_allocate_commons): Remove options parameter.
15544 Change caller. Just call do_allocate_commons_list twice.
15545 (Symbol_table::do_allocate_commons_list): New function, broken out
15546 of do_allocate_commons.
15547 * common.h (class Allocate_commons_task): Remove options_ field.
15548 Update constructor.
15549 * symtab.cc (Symbol_table::Symbol_table): Initialize
15551 (Symbol_table::add_from_object): Put TLS common symbols on
15553 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15554 which are IN_OUTPUT_DATA.
15555 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15556 allocate_commons and do_allocate_commons declarations. Declare
15557 do_allocate_commons_list.
15558 * gold.cc (queue_middle_tasks): Update creation of
15559 Allocate_commons_task to not pass options.
15560 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15561 (TLS_TEST_C_FLAGS): New variable.
15562 (tls_test_c_pic.o): New target.
15563 (tls_test_shared.so): Link in tls_test_c_pic.o.
15564 (tls_test_c_pic_ie.o): New target.
15565 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15566 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15567 (tls_test_c.o): New target.
15568 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15569 (tls_pic_test_LDADD): Likewise.
15570 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15571 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15572 (tls_test_c_gnu2.o): New target.
15573 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15575 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15576 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15577 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15578 * testsuite/tls_test.cc: Include "config.h".
15579 (t_last): Call t11_last.
15580 * testsuite/tls_test.h (t11, t11_last): Declare.
15581 * testsuite/tls_test_c.c: New file.
15582 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15583 * configure.ac: Check for OpenMP support.
15584 * configure, config.in, Makefile.in: Rebuild.
15585 * testsuite/Makefile.in: Rebuild.
15587 2008-04-16 Cary Coutant <ccoutant@google.com>
15589 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15590 (Target_i386::tls_base_symbol_defined_): New field.
15591 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15592 (Target_i386::Scan::global): Likewise.
15593 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15594 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15595 (Target_x86_64::tls_base_symbol_defined_): New field.
15596 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15597 (Target_x86_64::Scan::global): Likewise.
15599 2008-04-16 Cary Coutant <ccoutant@google.com>
15601 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15602 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15603 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15604 building shared libraries.
15605 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15606 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15607 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15608 * testsuite/Makefile.in: Rebuild.
15609 * testsuite/weak_undef.h: New file.
15610 * testsuite/weak_undef_file1.cc: Add extra test cases.
15611 * testsuite/weak_undef_file2.cc: Likewise.
15612 * testsuite/weak_undef_test.cc: Likewise.
15614 2008-04-16 David S. Miller <davem@davemloft.net>
15616 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15617 Add issued_non_pic_error_ field. Declare check_non_pic.
15618 (Target_sparc::Scan::check_non_pic): New function.
15619 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15620 (Target_sparc::Scan::global): Likewise.
15622 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15623 * configure: Rebuild.
15625 * options.h (DEFINE_enable): New macro.
15626 (new_dtags): New enable option.
15627 (initfirst, interpose, loadfltr, nodefaultlib,
15628 nodelete, nodlopen, nodump): New -z options.
15629 * layout.cc (Layout:finish_dynamic_section): If new
15630 dtags enabled, emit DT_RUNPATH. Also, emit a
15631 DT_FLAGS_1 containing any specified -z flags.
15633 2008-04-16 Ian Lance Taylor <iant@google.com>
15635 * copy-relocs.cc: New file.
15636 * copy-relocs.h: New file.
15637 * reloc.cc: Remove Copy_relocs code.
15638 * reloc.h: Likewise.
15639 * reloc-types.h (struct Reloc_types) [both versions]: Add
15640 get_reloc_addend_noerror.
15641 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15642 variants of add_global which take an addend which must be zero.
15643 * i386.cc: Include "copy-relocs.h".
15644 (class Target_i386): Change type of copy_relocs_ to variable,
15645 update initializer.
15646 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15647 Change all callers.
15648 (Target_i386::do_finalize_sections): Change handling of
15650 * sparc.cc: Include "copy-relocs.h".
15651 (class Target_sparc): Change type of copy_relocs_ to variable,
15652 update initializer.
15653 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15654 Change all callers.
15655 (Target_sparc::do_finalize_sections): Change handling of
15657 * x86_64.cc: Include "copy-relocs.h".
15658 (class Target_x86_64): Change type of copy_relocs_ to variable,
15659 update initializer.
15660 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15661 class. Change all callers.
15662 (Target_x86_64::do_finalize_sections): Change handling of
15664 * Makefile.am (CCFILES): Add copy-relocs.cc.
15665 (HFILES): Add copy-relocs.h.
15667 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15669 * testsuite/script_test_4.sh: Permit leading zeroes.
15671 2008-04-15 Ian Lance Taylor <iant@google.com>
15673 * script-sections.cc (Script_sections::create_segments): Use
15674 header_size_adjustment even when there is enough room for the
15676 * testsuite/script_test_4.sh: New file.
15677 * testsuite/script_test_4.t: New file.
15678 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15679 (check_DATA): Add script_test_4.stdout.
15680 (MOSTLYCLEANFILES): Likewise.
15681 (script_test_4): New target.
15682 (script_test_4.stdout): New target.
15683 * testsuite/Makefile.in: Rebuild.
15685 * sparc.cc: Add definitions for Output_data_plt_sparc class
15688 2008-04-14 David S. Miller <davem@davemloft.net>
15690 * sparc.cc: New file.
15691 * Makefile.am (TARGETSOURCES): Add sparc.cc
15692 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15693 * configure.tgt: Document targ_extra_size and
15694 targ_extra_big_endian. Add entries for sparc-* and
15696 * configure.ac: Handle targ_extra_size and
15697 targ_extra_big_endian.
15698 * Makefile.in: Rebuild.
15699 * configure: Likewise.
15700 * po/POTFILES.in: Likewise.
15701 * po/gold.pot: Likewise.
15703 2008-04-14 Ian Lance Taylor <iant@google.com>
15705 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15706 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15707 in the name/type/flags to section mapping. Don't call
15708 allocate_output_section.
15709 (Layout::choose_output_section): Change parameter from adjust_name
15710 to is_input_section. Don't permit input sections after sections
15711 are attached to segments. Don't call allocate_output_section.
15712 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15713 not write_enable_output_section.
15714 (Layout::make_output_section): Don't push to
15715 unattached_section_list_ nor call attach_to_segment. Call
15716 attach_section_to_segment if sections are attached.
15717 (Layout::attach_sections_to_segments): New function.
15718 (Layout::attach_section_to_segment): New function.
15719 (Layout::attach_allocated_section_to_segment): Rename from
15720 attach_to_segment. Remove flags parameter.
15721 (Layout::allocate_output_section): Remove function.
15722 (Layout::write_enable_output_section): Remove function.
15723 * layout.h (class Layout): Update for above changes. Add new
15724 field sections_are_attached_.
15725 * output.h (Output_section::update_flags_for_input_section): New
15727 * output.cc (Output_section::add_input_section): Call
15728 update_flags_for_input_section.
15729 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15731 2008-04-11 Cary Coutant <ccoutant@google.com>
15733 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15734 thought unnecessary.
15735 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15737 2008-04-11 Ian Lance Taylor <iant@google.com>
15739 * output.h (class Output_section_data): Remove inline definition
15741 * output.cc (Output_section_data::set_addralign): New function.
15743 2008-04-11 Cary Coutant <ccoutant@google.com>
15745 Add support for TLS descriptors for i386 and x86_64.
15746 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15747 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15748 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15750 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15751 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15752 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15754 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15755 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15756 Fix problem with initial-exec relocations.
15757 (Target_i386::Relocate::relocate_tls): Likewise.
15758 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15760 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15761 support for section-plus-offset dynamic table entries.
15762 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15763 (Output_data_dynamic::Dynamic_entry): Add support for
15764 section-plus-offset dynamic table entries.
15765 (Output_data_dynamic::Classification): Likewise.
15766 (Output_data_dynamic::classification_): Renamed offset_.
15767 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15768 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15769 (Target_x86_64::make_plt_section): New function.
15770 (Target_x86_64::reserve_tlsdesc_entries): New function.
15771 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15772 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15773 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15774 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15775 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15776 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15777 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15778 add extra PLT entry for TLS descriptors.
15779 (Output_data_plt_x86_64::got_): New field.
15780 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15781 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15783 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15785 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15786 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15787 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15788 R_386_TLS_DESC_CALL relocations.
15789 (Target_x86_64::Scan::global): Likewise.
15790 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15791 for TLS descriptors.
15792 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15793 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15794 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15795 GD-to-IE relaxation.
15796 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15797 and TLS_DESCRIPTORS.
15798 * Makefile.in: Rebuild.
15799 * configure: Rebuild.
15800 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15801 (tls_test_shared2.so): New target.
15802 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15803 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15804 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15805 (tls_shared_gd_to_ie_test_LDADD): New variable.
15806 (tls_shared_gnu2_gd_to_ie_test): New target.
15807 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15809 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15810 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15811 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15812 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15813 (tls_shared_gnu2_test): New target.
15814 (tls_test_gnu2_shared.so): New target.
15815 (tls_shared_gnu2_test_SOURCES): New variable.
15816 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15817 (tls_shared_gnu2_test_LDFLAGS): New variable.
15818 (tls_shared_gnu2_test_LDADD): New variable.
15819 * testsuite/Makefile.in: Rebuild.
15820 * testsuite/Makefile.
15822 2008-04-11 Ian Lance Taylor <iant@google.com>
15824 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15826 * testsuite/Makefile.in: Rebuild.
15828 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15830 * testsuite/script_test_2.cc (main): Adjust test.
15832 2008-04-11 David S. Miller <davem@davemloft.net>
15833 Ian Lance Taylor <iant@google.com>
15835 * options.h (General_options): Add entries for '-Y' and
15837 * options.cc (General_options:finalize): If -Y was used, add those
15838 entries to the library path instead of the default "/lib" and
15841 2008-04-11 David S. Miller <davem@davemloft.net>
15843 * testsuite/justsyms.t: Start at 0x100.
15844 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
15845 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15847 * testsuite/script_test_2.cc: Adjust string and section length
15850 2008-04-09 Ian Lance Taylor <iant@google.com>
15853 * script-sections.cc (Sections_element::allocate_to_segment): Add
15855 (Output_section_definition::allocate_to_segment): Likewise.
15856 (Orphan_output_section::allocate_to_segment): Likewise.
15857 (Script_sections::attach_sections_using_phdrs_clause): Don't
15858 propagate non-PT_LOAD segments to orphan sections.
15859 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15860 readelf rather than objdump.
15861 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15862 .interp section and PT_INTERP segment are the same size.
15863 * testsuite/Makefile.in: Rebuild.
15865 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15866 aliases for symbols defined in the same object.
15867 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15868 (weak_alias_test_SOURCES): New variable.
15869 (weak_alias_test_DEPENDENCIES): New variable.
15870 (weak_alias_test_LDFLAGS): New variable.
15871 (weak_alias_test_LDADD): New variable.
15872 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15873 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15874 (weak_alias_test_3.o): New target.
15875 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15876 * testsuite/weak_alias_test_main.cc: New file.
15877 * testsuite/weak_alias_test_1.cc: New file.
15878 * testsuite/weak_alias_test_2.cc: New file.
15879 * testsuite/weak_alias_test_3.cc: New file.
15881 2008-04-08 Ian Lance Taylor <iant@google.com>
15883 * options.h (class General_options): Add --noinhibit-exec option.
15884 * main.cc (main): Check --noinhibit-exec.
15886 * options.h (class General_options): Define --wrap as a special
15887 option. Add wrap_symbols_ field.
15888 (General_options::any_wrap_symbols): New function.
15889 (General_options::is_wrap_symbol): New function.
15890 * options.cc (General_options::parse_wrap): New function.
15891 (General_options::General_options): Initialize wrap_symbols_.
15892 * symtab.cc (Symbol_table::wrap_symbol): New function.
15893 (Symbol_table::add_from_object): Handle --wrap.
15894 * symtab.h (class Symbol_table): Declare wrap_symbol.
15895 * target.h (Target::wrap_char): New function.
15896 (Target::Target_info): Add wrap_char field.
15897 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15898 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15899 * testsuite/testfile.cc (Target_test::test_target_info):
15902 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15905 * layout.h (class Layout): Add added_eh_frame_data_ field.
15906 * layout.cc (Layout::Layout): Initialize new field.
15907 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15908 output section until we find a section we merged successfully.
15909 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15910 that the size be non-zero.
15912 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15915 2008-04-08 Craig Silverstein <csilvers@google.com>
15917 * configure.ac: Export new conditional variable HAVE_ZLIB.
15918 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15920 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15921 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15923 2008-04-07 Ian Lance Taylor <iant@google.com>
15925 * version.cc (version_string): Set to "1.5".
15927 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15928 Add issued_non_pic_error_ field. Declare check_non_pic.
15929 (Target_x86_64::Scan::check_non_pic): New function.
15930 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15931 (Target_x86_64::Scan::global): Likewise.
15933 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15934 addend parameter. Change caller. Handle merge sections.
15935 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15936 Address to Addend. Don't add in the result of
15937 local_section_offset, pass down the addend and use the returned
15939 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15940 Update declarations of local_section_offset and symbol_value.
15941 * testsuite/two_file_test_1.cc (t18): New function.
15942 * testsuite/two_file_test_2.cc (f18): New function.
15943 * testsuite/two_file_test_main.cc (main): Call t18.
15944 * testsuite/two_file_test.h (t18, f18): Declare.
15946 * configure.ac: Don't test for objdump, c++filt, or readelf.
15947 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15949 (TEST_READELF): New variable.
15950 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15951 (check_PROGRAMS): Add two_file_strip_test.
15952 (two_file_strip_test): New target.
15953 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15954 (two_file_same_shared_strip_test_SOURCES): New variable.
15955 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15956 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15957 (two_file_same_shared_strip_test_LDADD): New variable.
15958 (two_file_shared_strip.so): New target.
15959 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15960 (ver_test_5.syms, ver_test_7.syms): Likewise.
15961 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15962 (strip_test_3.stdout): Use TEST_OBJDUMP.
15963 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15965 2008-04-04 Cary Coutant <ccoutant@google.com>
15967 * symtab.h (Symbol::is_weak_undefined): New function.
15968 (Symbol::is_strong_undefined): New function.
15969 (Symbol::is_absolute): New function.
15970 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15971 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15973 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15974 (weak_undef_test): New target.
15975 * testsuite/Makefile.in: Rebuild.
15976 * testsuite/weak_undef_file1.cc: New file.
15977 * testsuite/weak_undef_file2.cc: New file.
15978 * testsuite/weak_undef_test.cc: New file.
15980 2008-04-03 Craig Silverstein <csilvers@google.com>
15982 * compressed_output.h (class Output_compressed_section): Use
15984 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15986 (zlib_compressed_suffix): Removed.
15987 (Output_compressed_section::set_final_data_size): Use unsigned
15989 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15990 Fix linker invocation.
15991 (flagstest_o_specialfile_and_compress_debug_sections):
15993 * testsuite/Makefile.in: Regenerated.
15995 2008-04-02 David S. Miller <davem@davemloft.net>
15997 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15998 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16000 2008-04-02 Craig Silverstein <csilvers@google.com>
16004 2008-04-02 Ian Lance Taylor <iant@google.com>
16006 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16007 parameters. Update for new key type to views_. Change all
16009 (File_read::read): Adjust for byteshift in returned view.
16010 (File_read::add_view): New function, broken out of
16011 find_and_make_view.
16012 (File_read::make_view): New function, broken out of
16013 find_and_make_view.
16014 (File_read::find_or_make_view): Add offset and aligned
16015 parameters. Rewrite accordingly. Change all callers.
16016 (File_read::get_view): Add offset and aligned parameters. Adjust
16017 for byteshift in return value.
16018 (File_read::get_lasting_view): Likewise.
16019 * fileread.h (class File_read): Update declarations.
16020 (class File_read::View): Add byteshift_ field. Add byteshift to
16021 constructor. Add byteshift method.
16022 * archive.h (Archive::clear_uncached_views): New function.
16023 (Archive::get_view): Add aligned parameter. Change all callers.
16024 * object.h (Object::get_view): Add aligned parameter. Change all
16026 (Object::get_lasting_view): Likewise.
16028 * fileread.cc (File_read::release): Don't call clear_views if
16029 there are multiple objects.
16030 * fileread.h (File_read::clear_uncached_views): New function.
16031 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16034 2008-03-31 Cary Coutant <ccoutant@google.com>
16036 Add thin archive support.
16037 * archive.cc (Archive::armagt): New const.
16038 (Archive::setup): Remove task parameter and calls to unlock.
16039 (Archive::unlock_nested_archives): New function.
16040 (Archive::read_header): Add nested_off parameter. Change
16042 (Archive::interpret_header): Likewise.
16043 (Archive::include_all_members): Change to handle thin
16045 (Archive::include_member): Likewise.
16046 * archive.h (Archive::Archive): Add new parameters and
16048 (Archive::armagt): New const.
16049 (Archive::setup): Remove task parameter.
16050 (Archive::unlock_nested_archives): New function.
16051 (Archive::read_header): Add nested_off parameter.
16052 (Archive::interpret_header): Likewise.
16053 (Archive::Nested_archive_table): New typedef.
16054 (Archive::is_thin_archive_): New field.
16055 (Archive::nested_archives_): New field.
16056 (Archive::options_): New field.
16057 (Archive::dirpath_): New field.
16058 (Archive::task_): New field.
16059 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16060 for thin archives. Pass additional parameters to
16061 Archive::Archive. Unlock the archive file after calling
16064 2008-03-29 Ian Lance Taylor <iant@google.com>
16066 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16067 version symbol to be local.
16068 * testsuite/ver_test_4.sh: New file.
16069 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16070 (check_DATA): Add ver_test_4.syms.
16071 (ver_test_4.syms): New target.
16072 * testsuite/Makefile.in: Rebuild.
16075 (Output_section::Input_section_sort_entry::has_priority): New
16077 (Output_section::Input_section_sort_entry::match_file_name): New
16079 (Output_section::Input_section_sort_entry::match_section_name):
16081 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16083 (Output_section::Input_section_sort_entry::match_section_file):
16085 (Output_section::Input_section_sort_compare::operator()): Rewrite
16086 using new Input_section_sort_entry functions. Sort crtbegin and
16087 crtend first. Sort sections with no priority before sections with
16089 * testsuite/initpri1.c (d3): Check j != 4.
16090 (cd5): New constructor/destructor function.
16091 (main): Check j != 2.
16093 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16094 new symbol when resolving, don't call set_is_default.
16095 * testsuite/ver_test_7.cc: New file.
16096 * testsuite/ver_test_7.sh: New file.
16097 * testsuite/Makefile.am (ver_test_7.so): New target.
16098 (ver_test_7.o): New target.
16099 (check_SCRIPTS): Add ver_test_7.sh.
16100 (check_DATA): Add ver_test_7.syms.
16101 (ver_test_7.syms): New target.
16103 2008-03-28 Ian Lance Taylor <iant@google.com>
16105 * layout.cc (Layout::layout): If we see an input section with a
16106 name that needs sorting, set the must_sort flag for the output
16108 (Layout::make_output_section): If the name of the output section
16109 indicates that it might require sorting, set the may_sort flag.
16110 * output.h (Output_section::may_sort_attached_input_sections): New
16112 (Output_section::set_may_sort_attached_input_sections): New
16114 (Output_section::must_sort_attached_input_sections): New
16116 (Output_section::set_must_sort_attached_input_sections): New
16118 (class Output_section): Declare Input_section_sort_entry. Define
16119 Input_section_sort_compare. Declare
16120 sort_attached_input_sections. Add new fields:
16121 may_sort_attached_input_sections_,
16122 must_sort_attached_input_sections_,
16123 attached_input_sections_are_sorted_.
16124 * output.cc (Output_section::Output_section): Initialize new
16126 (Output_section::add_input_section): Add an entry to
16127 input_sections_ if may_sort or must_sort are true.
16128 (Output_section::set_final_data_size): Call
16129 sort_attached_input_sections if necessary.
16130 (Output_section::Input_section_sort_entry): Define new class.
16131 (Output_section::Input_section_sort_compare::operator()): New
16133 (Output_section::sort_attached_input_sections): New function.
16134 * configure.ac: Check whether the compiler supports constructor
16135 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16136 * testsuite/initpri1.c: New file.
16137 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16138 CONSTRUCTOR_PRIORITY.
16139 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16140 (initpri1_LDFLAGS): New variable.
16141 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16143 2008-03-27 Ian Lance Taylor <iant@google.com>
16145 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16146 * testsuite/common_test_1.c: New file.
16147 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16148 (common_test_1_SOURCES): New variable.
16149 (common_test_1_DEPENDENCIES): New variable.
16150 (common_test_1_LDFLAGS): New variable.
16152 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16153 and commons_ correctly when NAME/VERSION does not override
16155 * testsuite/ver_test_6.c: New file.
16156 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16157 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16158 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16160 2008-03-26 Ian Lance Taylor <iant@google.com>
16162 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16163 of an undefined symbol from a version script.
16164 * testsuite/Makefile.am (ver_test_5.so): New target.
16165 (ver_test_5.o): New target.
16166 (check_SCRIPTS): Add ver_test_5.sh.
16167 (check_DATA): Add ver_test_5.syms.
16168 (ver_test_5.syms): New target.
16169 * testsuite/ver_test_5.cc: New file.
16170 * testsuite/ver_test_5.script: New file.
16171 * testsuite/ver_test_5.sh: New file.
16172 * Makefile.in, testsuite/Makefile.in: Rebuild.
16175 Fix problems building gold with gcc 4.3.0.
16176 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16177 (gold_error_at_location, gold_warning_at_location): Use it.
16178 * configure.ac: Check whether we can compile and use a template
16179 function with a printf attribute.
16180 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16181 when jumping over bytes.
16182 * object.cc: Instantiate Object::read_section_data.
16183 * debug.h: Include <cstring>
16184 * dwarf_reader.cc: Include <algorithm>
16185 * main.cc: Include <cstring>.
16186 * options.cc: Include <cstring>.
16187 * output.cc: Include <cstring>.
16188 * script.cc: Include <cstring>.
16189 * script.h: Include <string>.
16190 * symtab.cc: Include <cstring> and <algorithm>.
16191 * target-select.cc: Include <cstring>.
16192 * version.cc: Include <string>.
16193 * testsuite/testmain.cc: Include <cstdlib>.
16194 * configure, config.in: Rebuild.
16196 2008-03-25 Ian Lance Taylor <iant@google.com>
16198 * options.cc: Include "../bfd/bfdver.h".
16199 (options::help): Print bug reporting address.
16201 * version.cc (print_version): Adjust output for current value of
16202 BFD_VERSION_STRING.
16206 * options.cc (options::help): Print list of supported targets.
16207 * target-select.h: Include <vector>.
16208 (class Target_selector): Make machine_, size_, and is_big_endian_
16209 fields const. Add bfd_name_ and instantiated_target_ fields.
16210 (Target_selector::Target_selector): Add bfd_name parameter.
16211 (Target_selector::recognize): Make non-virtual, call
16213 (Target_selector::recognize_by_name): Make non-virtual, call
16214 do_recognize_by_name.
16215 (Target_selector::supported_names): New function.
16216 (Target_selector::bfd_name): New function.
16217 (Target_selector::do_instantiate_target): New pure virtual
16219 (Target_selector::do_recognize): New virtual function.
16220 (Target_selector::do_recognize_by_name): New virtual function.
16221 (Target_selector::instantiate_target): New private function.
16222 (supported_target_names): Declare.
16223 * target-select.cc (Target_selector::Target_selector): Update for
16224 new parameter and fields.
16225 (select_target_by_name): Check that the name matches before
16226 calling recognize_by_name.
16227 (supported_target_names): New function.
16228 * i386.cc (class Target_selector_i386): Update Target_selector
16229 constructor call. Remove recognize and recognize_by_name. Add
16230 do_instantiate_target.
16231 * x86_64.cc (class Target_selector_x86_64): Likewise.
16232 * testsuite/testfile.cc (class Target_selector_test): Update for
16233 changes to Target_selector.
16235 * README: Rewrite, with some notes on unsupported features.
16237 2008-03-24 Cary Coutant <ccoutant@google.com>
16239 * i386.cc (Target_i386::Got_type): New enum declaration.
16240 (Target_i386::Scan::local): Updated callers of Output_data_got
16242 (Target_i386::Scan::global): Likewise.
16243 (Target_i386::Relocate::relocate): Likewise.
16244 (Target_i386::Relocate::relocate_tls): Likewise.
16245 * object.h (Got_offset_list): New class.
16246 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16247 (Sized_relobj::local_got_offset): Likewise.
16248 (Sized_relobj::set_local_got_offset): Likewise.
16249 (Sized_relobj::local_has_tls_got_offset): Removed.
16250 (Sized_relobj::local_tls_got_offset): Removed.
16251 (Sized_relobj::set_local_tls_got_offset): Removed.
16252 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16253 * output.cc (Output_data_got::add_global): Added got_type parameter.
16254 (Output_data_got::add_global_with_rel): Likewise.
16255 (Output_data_got::add_global_with_rela): Likewise.
16256 (Output_data_got::add_global_pair_with_rel): New function.
16257 (Output_data_got::add_global_pair_with_rela): New function.
16258 (Output_data_got::add_local): Added got_type parameter.
16259 (Output_data_got::add_local_with_rel): Likewise.
16260 (Output_data_got::add_local_with_rela): Likewise.
16261 (Output_data_got::add_local_pair_with_rel): New function.
16262 (Output_data_got::add_local_pair_with_rela): New function.
16263 (Output_data_got::add_global_tls): Removed.
16264 (Output_data_got::add_global_tls_with_rel): Removed.
16265 (Output_data_got::add_global_tls_with_rela): Removed.
16266 (Output_data_got::add_local_tls): Removed.
16267 (Output_data_got::add_local_tls_with_rel): Removed.
16268 (Output_data_got::add_local_tls_with_rela): Removed.
16269 * output.h (Output_data_got::add_global): Added got_type parameter.
16270 (Output_data_got::add_global_with_rel): Likewise.
16271 (Output_data_got::add_global_with_rela): Likewise.
16272 (Output_data_got::add_global_pair_with_rel): New function.
16273 (Output_data_got::add_global_pair_with_rela): New function.
16274 (Output_data_got::add_local): Added got_type parameter.
16275 (Output_data_got::add_local_with_rel): Likewise.
16276 (Output_data_got::add_local_with_rela): Likewise.
16277 (Output_data_got::add_local_pair_with_rel): New function.
16278 (Output_data_got::add_local_pair_with_rela): New function.
16279 (Output_data_got::add_global_tls): Removed.
16280 (Output_data_got::add_global_tls_with_rel): Removed.
16281 (Output_data_got::add_global_tls_with_rela): Removed.
16282 (Output_data_got::add_local_tls): Removed.
16283 (Output_data_got::add_local_tls_with_rel): Removed.
16284 (Output_data_got::add_local_tls_with_rela): Removed.
16285 * resolve.cc (Symbol::override_base_with_special): Removed
16286 reference to has_got_offset_ field.
16287 * symtab.cc (Symbol::init_fields): Replaced initialization
16288 of got_offset_ with got_offsets_. Removed initialization
16290 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
16291 (Symbol::got_offset): Likewise.
16292 (Symbol::set_got_offset): Likewise.
16293 (Symbol::has_tls_got_offset): Removed.
16294 (Symbol::tls_got_offset): Removed.
16295 (Symbol::set_tls_got_offset): Removed.
16296 (Symbol::got_offset_): Removed.
16297 (Symbol::tls_mod_got_offset_): Removed.
16298 (Symbol::tls_pair_got_offset_): Removed.
16299 (Symbol::got_offsets_): New field.
16300 (Symbol::has_got_offset): Removed.
16301 (Symbol::has_tls_mod_got_offset): Removed.
16302 (Symbol::has_tls_pair_got_offset): Removed.
16303 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16304 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16306 (Target_x86_64::Scan::global): Likewise.
16307 (Target_x86_64::Relocate::relocate): Likewise.
16308 (Target_x86_64::Relocate::relocate_tls): Likewise.
16310 2008-03-25 Ben Elliston <bje@au.ibm.com>
16312 * yyscript.y: Fix spelling error in comment.
16314 2008-03-24 Ian Lance Taylor <iant@google.com>
16316 * options.h (class General_options): Define build_id option.
16317 * layout.h (class Layout): Declare write_build_id, create_note,
16318 create_build_id. Add build_id_note_ member.
16319 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16320 "libiberty.h", "md5.h", "sha1.h".
16321 (Layout::Layout): Initialize eh_frame_data_,
16322 eh_frame_hdr_section_, and build_id_note_.
16323 (Layout::finalize): Call create_build_id.
16324 (Layout::create_note): New function, broken out of
16325 Layout::create_gold_note.
16326 (Layout::create_gold_note): Call create_note.
16327 (Layout::create_build_id): New function.
16328 (Layout::write_build_id): New function.
16329 (Close_task_runner::run): Call write_build_id.
16331 * x86_64.cc: Correct license to GPLv3.
16333 2008-03-23 Ian Lance Taylor <iant@google.com>
16335 * options.cc: Include "demangle.h".
16336 (parse_optional_string): New function.
16337 (parse_long_option): Handle takes_optional_argument.
16338 (parse_short_option): Update dash_z initializer. Handle
16339 takes_optional_argument.
16340 (General_options::General_options): Initialize do_demangle_.
16341 (General_options::finalize): Set do_demangle_. Handle demangling
16343 * options.h (parse_optional_string): Declare.
16344 (struct One_option): Add optional_arg field. Update constructor.
16345 Update call constructor calls. Add takes_optional_argument
16347 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16348 (DEFINE_optional_string): Define.
16349 (General_options::demangle): Change from DEFINE_bool to
16350 DEFINE_optional_string.
16351 (General_options::no_demangle): New function.
16352 (General_options::do_demangle): New function.
16353 (General_options::set_do_demangle): New function.
16354 (General_options::execstack_status_): Move definition to end of
16356 (General_options::static_): Likewise.
16357 (General_options::do_demangle_): New field.
16358 * object.cc (big_endian>::get_symbol_location_info): Call
16359 Options::do_demangle, not Options::demangle.
16360 * symtab.cc (demangle): Likewise.
16362 2008-03-22 Ian Lance Taylor <iant@google.com>
16364 * gold.h: Include <cstddef> and <sys/types.h>
16365 * options.h: Include <cstring>.
16367 2008-03-21 Ian Lance Taylor <iant@google.com>
16369 * Added source code to GNU binutils.
16371 Copyright (C) 2008-2014 Free Software Foundation, Inc.
16373 Copying and distribution of this file, with or without modification,
16374 are permitted in any medium without royalty provided the copyright
16375 notice and this notice are preserved.
16381 version-control: never